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
contextmethod forResult.
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>