ic-asset 0.28.0

Library for storing files in an asset canister.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::canister_api::methods::method_names::API_VERSION;
use ic_utils::Canister;
use ic_utils::call::SyncCall;

pub(crate) async fn api_version(canister: &Canister<'_>) -> u16 {
    canister
        .query(API_VERSION)
        .build()
        .call()
        .await
        .map_or(0, |v: (u16,)| v.0)
}