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

#38 in #icp

Download history 19/week @ 2024-03-10 20/week @ 2024-03-17 1/week @ 2024-03-24 37/week @ 2024-03-31 1/week @ 2024-04-07 30/week @ 2024-04-21 22/week @ 2024-04-28 6/week @ 2024-05-05 13/week @ 2024-05-12 14/week @ 2024-05-19 8/week @ 2024-05-26 13/week @ 2024-06-02 32/week @ 2024-06-09 49/week @ 2024-06-16 4/week @ 2024-06-23

99 downloads per month
Used in icx-asset

Apache-2.0

495KB
11K 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–43MB
~797K SLoC