-
Notifications
You must be signed in to change notification settings - Fork 4
Dynamic Candid
b3hr4d edited this page Mar 11, 2026
·
1 revision
Use the candid package family when you do not know everything at compile time.
- canister explorers
- admin tools
- runtime-selected canisters
- metadata-driven forms
- devtools and debugging utilities
Fetches Candid source and compiles it into usable definitions.
import { CandidAdapter } from "@ic-reactor/candid"
const adapter = new CandidAdapter({ clientManager })
const definition = await adapter.getCandidDefinition("ryjl3-tyaaa-aaaaa-aaaba-cai")Runtime reactors that can work without compile-time IDL.
import { CandidDisplayReactor } from "@ic-reactor/candid"
const reactor = new CandidDisplayReactor({
clientManager,
canisterId: "ryjl3-tyaaa-aaaaa-aaaba-cai",
name: "ledger",
})
await reactor.initialize()Use these when you want runtime field metadata, validation hints, and form generation.
Add @ic-reactor/parser when you want local Candid compilation instead of
remote fallback:
await adapter.loadParser()
const jsSource = adapter.compileLocal(candidSource)Use dynamic candid support only when compile-time declarations are not enough. For normal app code, generated or static reactors are usually simpler.