ic-agent-canister-runtime
Library that implements the ic_canister_runtime crate's Runtime trait using ic-agent.
This can be useful when, e.g., contacting a canister via ingress messages instead of via another canister.
Usage
Add this to your Cargo.toml (see crates.io for the latest version):
= "0.1.0"
= "0.1.0"
Then, use the library to abstract your code making requests to canisters as follows:
use AgentRuntime;
use Runtime;
let agent = builder.build.unwrap;
let runtime = new;
// Make a request to the `http_request` example canister's `make_http_post_request` endpoint
// See: https://github.com/dfinity/canhttp/tree/main/examples/http_canister
let http_request_result: String = runtime
.update_call
.await
.expect;
assert!;
assert!;
See the Rust documentation for more details.
License
This project is licensed under the Apache License 2.0.