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

#30 in #dfinity

Download history 5/week @ 2024-08-24 3/week @ 2024-08-31 12/week @ 2024-09-07 130/week @ 2024-09-14 161/week @ 2024-09-21 63/week @ 2024-09-28 39/week @ 2024-10-05 54/week @ 2024-10-12 126/week @ 2024-10-19 63/week @ 2024-10-26 45/week @ 2024-11-02 65/week @ 2024-11-09 254/week @ 2024-11-16 118/week @ 2024-11-23 123/week @ 2024-11-30 73/week @ 2024-12-07

597 downloads per month
Used in icx-asset

Apache-2.0

535KB
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–61MB
~1.5M SLoC