19 releases (breaking)

0.20.0 Jul 14, 2022
0.17.1 Jun 22, 2022
0.15.0 Mar 31, 2022
0.10.1 Dec 13, 2021
0.2.0 Jul 30, 2021

#31 in #icp

Download history 3/week @ 2023-12-25 5/week @ 2024-01-22 129/week @ 2024-01-29 7/week @ 2024-02-05 20/week @ 2024-02-26 48/week @ 2024-03-04 16/week @ 2024-03-11 20/week @ 2024-03-18 1/week @ 2024-03-25 303/week @ 2024-04-01

343 downloads per month
Used in icx-asset

Apache-2.0

470KB
10K 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, http_transport::ReqwestHttpReplicaV2Transport};
use ic_agent::identity::BasicIdentity;
use ic_utils::Canister;
use std::time::Duration;
let agent = Agent::builder()
    .with_transport(ReqwestHttpReplicaV2Transport::create(replica_url)?)
    .with_identity(BasicIdentity::from_pem_file(pemfile)?)
    .build()?;
let canister = Canister::builder()
    .with_canister_id(canister_id)
    .with_agent(&agent)
    .build()?;
ic_asset::sync(&canister, &[concat!(env!("CARGO_MANIFEST_DIR"), "assets/").as_ref()], Duration::from_secs(60)).await?;

Dependencies

~29–45MB
~810K SLoC