99 releases (5 breaking)
Uses new Rust 2024
| new 0.9.21 | Feb 11, 2026 |
|---|---|
| 0.9.14 | Jan 31, 2026 |
| 0.7.0 | Dec 30, 2025 |
#244 in WebAssembly
450 downloads per month
Used in 12 crates
(7 directly)
49KB
1K
SLoC
canic-cdk
Canic's lightweight wrapper around ic-cdk types and helpers used across the stack.
This crate exists to give Canic (and downstream canisters) a stable import surface:
canic::cdk::apiandcanic::cdk::mgmtre-exportic_cdkAPIs.canic::cdk::timersre-exportsic_cdk_timers.canic::cdk::candidre-exportscandid.canic::cdk::structuresre-exportsic-stable-structuresplus a smallBTreeMapwrapper.canic::cdk::typesprovides common IC types (Principal,Nat,Int,Account, …).canic::cdk::utilshosts small WASM-safe helpers liketime::now_*andwasm::get_wasm_hash.
Most users should access this crate via canic::cdk (from the facade crate).
Example
use canic::cdk::{api, types::Principal};
#[canic::cdk::update]
fn whoami() -> Principal {
api::caller()
}
For installation and workspace usage, see ../../README.md.
Dependencies
~7–19MB
~228K SLoC