20 releases (breaking)

0.21.0 Sep 20, 2024
0.20.0 Jul 14, 2022
0.18.0 Jun 24, 2022
0.15.0 Mar 31, 2022
0.2.0 Jul 30, 2021

#29 in #dfinity

Download history 3/week @ 2024-07-31 2/week @ 2024-08-21 6/week @ 2024-08-28 9/week @ 2024-09-04 20/week @ 2024-09-11 242/week @ 2024-09-18 63/week @ 2024-09-25 48/week @ 2024-10-02 54/week @ 2024-10-09 93/week @ 2024-10-16 79/week @ 2024-10-23 66/week @ 2024-10-30 34/week @ 2024-11-06 100/week @ 2024-11-13

305 downloads per month
Used in icx-asset

Apache-2.0

530KB
13K SLoC

ic-asset is a library for manipulating assets in an asset canister.


lib.rs:

A library for manipulating assets in an asset canister.

Example

use ic_agent::agent::Agent;
use ic_agent::identity::BasicIdentity;
use ic_utils::Canister;
use std::time::Duration;
let agent = Agent::builder()
    .with_url(replica_url)
    .with_identity(BasicIdentity::from_pem_file(pemfile)?)
    .build()?;
let canister = Canister::builder()
    .with_canister_id(canister_id)
    .with_agent(&agent)
    .build()?;
let logger = slog::Logger::root(slog::Discard, slog::o!());
ic_asset::sync(&canister, &[concat!(env!("CARGO_MANIFEST_DIR"), "assets/").as_ref()], false, &logger).await?;

Dependencies

~43–60MB
~1.5M SLoC