Candid to JS
Returns JS source that exports idlFactory and init.
@ic-reactor/parser is the low-level WASM parser behind local Candid
compilation in IC Reactor. It converts raw .did source into JavaScript IDL
factories, TypeScript declaration strings, or structured schema metadata.
didjs canister.@ic-reactor/codegen to turn .did files into
generated declarations.@ic-reactor/candid for local
CandidAdapter compilation.Candid to JS
Returns JS source that exports idlFactory and init.
Candid to TS
Returns TypeScript declaration source for the same interface.
Candid Schema
Returns structured types, services, docs, and validation metadata.
WASM Runtime
Implemented in Rust and compiled to WebAssembly.
pnpm add @ic-reactor/parserimport init, { didToJs, didToTs, parseDid } from "@ic-reactor/parser"
const candid = `service : { greet : (text) -> (text) query;}`
// Required on the web build (browsers and bundlers); the Node build// instantiates its WASM module at import time.await init()
const jsSource = didToJs(candid)const tsSource = didToTs(candid)const schema = parseDid(candid)@ic-reactor/candidimport { CandidAdapter } from "@ic-reactor/candid"import { ClientManager } from "@ic-reactor/core"import { QueryClient } from "@tanstack/query-core"
const adapter = new CandidAdapter({ clientManager: new ClientManager({ queryClient: new QueryClient() }),})
await adapter.loadParser()const jsSource = adapter.compileLocal( "service : { greet : () -> (text) query }")