21 releases (breaking)

0.22.0 Feb 10, 2025
0.21.0 Sep 20, 2024
0.20.0 Jul 14, 2022
0.15.0 Mar 31, 2022
0.2.0 Jul 30, 2021

#36 in #icp

Download history 122/week @ 2024-11-30 34/week @ 2024-12-07 31/week @ 2024-12-14 1/week @ 2024-12-21 6/week @ 2024-12-28 91/week @ 2025-01-04 132/week @ 2025-01-11 97/week @ 2025-01-18 187/week @ 2025-01-25 167/week @ 2025-02-01 208/week @ 2025-02-08 195/week @ 2025-02-15 162/week @ 2025-02-22 132/week @ 2025-03-01 107/week @ 2025-03-08 35/week @ 2025-03-15

441 downloads per month
Used in icx-asset

Apache-2.0

560KB
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, None).await?;

Dependencies

~45–66MB
~1.5M SLoC