Skip to main content

Crate bity_ic_canister_client

Crate bity_ic_canister_client 

Source
Expand description

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
}

Modules§

canister_client_macros
Macros for generating Internet Computer canister client code.

Macros§

generate_c2c_call
Generates a function for making cross-canister calls using MessagePack serialization.
generate_candid_c2c_call
Generates a function for making cross-canister calls using Candid serialization.
generate_candid_c2c_call_no_args
Generates a function for making cross-canister calls without arguments.
generate_candid_c2c_call_tuple_args
Generates a function for making cross-canister calls with tuple arguments.
generate_candid_c2c_call_with_payment
Generates a function for making cross-canister calls with cycle payment.
generate_query_call
Generates a function for making query calls to a canister.
generate_update_call
Generates a function for making update calls to a canister.

Traits§

Context
Provides the context method for Result.

Functions§

make_c2c_call
Makes a cross-canister call with custom serialization and deserialization.
make_c2c_call_raw
Makes a raw cross-canister call with byte-level control.
make_c2c_call_with_payment
Makes a cross-canister call with cycle payment and custom serialization.

Type Aliases§

Result
Result<T, Error>