wf-cdk-bindgen

Crates.iowf-cdk-bindgen
lib.rswf-cdk-bindgen
version0.1.8
created_at2025-03-31 21:29:09.236086+00
updated_at2025-08-25 22:51:10.17382+00
descriptionInternet Computer Binding Generator.
homepage
repositoryhttps://github.com/wasm-forge/wf-cdk-bindgen
max_upload_size
id1614022
size84,970
(wasm-forge)

documentation

README

wf-cdk-bindgen

DISCLAIMER

This is a temporary fork of the ic-cdk-bindgen. Once the necessary changes are propagated into the original project, this crate will no longer be required.

About project

Generate Rust bindings from Candid to make inter-canister calls.

How to use

  1. Canister project add ic-cdk-bindgen as a build dependency.
[build-dependencies]
ic-cdk-bindgen = "0.1"
  1. Add build.rs to generate Rust bindings in the source directory with config options.
use ic_cdk_bindgen::{Builder, Config};
fn main() {
    let counter = Config::new("counter");
    let mut builder = Builder::new();
    builder.add(counter);
    builder.build(None);  // default write to src/declarations
}
  1. In Canister code,
mod declarations;
use declarations::counter::counter;

counter.inc().await?
Commit count: 11

cargo fmt