#internet-computer #canister #ic #dfinity #subcanister

bity-ic-canister-client

Description spécifique de la crate

4 releases

new 0.1.3 Mar 17, 2025
0.1.2 Mar 17, 2025
0.1.1 Mar 17, 2025
0.1.0 Mar 14, 2025

#5 in #subcanister

Download history 242/week @ 2025-03-12

242 downloads per month

MIT license

28KB
291 lines

Client utilities for Internet Computer canister interactions.

This module provides low-level utilities for making cross-canister calls (C2C) with support for different serialization formats and cycle payments.

Features

  • Cross-canister calls with custom serialization/deserialization
  • Support for cycle payments in C2C calls
  • Raw C2C call functionality with detailed error handling
  • Integration with tracing for debugging and monitoring

Examples

use bity_ic_canister_client::make_c2c_call;
use candid::{encode_one, decode_one};

async fn transfer(
    canister_id: Principal,
    args: &TransferArgs,
) -> CallResult<TransferResponse> {
    make_c2c_call(
        canister_id,
        "transfer",
        args,
        encode_one,
        |r| decode_one(r),
    )
    .await
}

Dependencies

~5–13MB
~157K SLoC