Complete API reference for canister management and deployment
create(options?)
options
(optional): ICanisterCreateOptions
settings
: ICanisterSettings
- Initial canister settingscycles
: bigint | string
- Initial cycles amountPromise<{ canisterId: Principal }>
- Created canister information
Example:
deploy(options)
options
: ICanisterDeployOptions
canisterId
: Principal
- Target canister IDwasmModule
: Uint8Array
- WASM module bytesinstallArgs
: Uint8Array
- Installation arguments (optional)mode
: 'install' | 'upgrade' | 'reinstall'
- Installation mode (default: ‘install’)Promise<IDeployResult>
canisterId
: Principal
- Deployed canister IDmoduleHash
: string
- Hash of deployed modulecyclesUsed
: bigint
- Cycles consumed during deploymentstart(canisterId)
canisterId
: Principal | string
- Canister to startPromise<void>
Example:
stop(canisterId)
canisterId
: Principal | string
- Canister to stopPromise<void>
Example:
delete(canisterId)
canisterId
: Principal | string
- Canister to deletePromise<void>
Example:
call(options)
options
: ICanisterCallOptions
canisterId
: Principal
- Target canistermethodName
: string
- Method to callargs
: unknown[]
- Method argumentsidlFactory
: IDL.InterfaceFactory
- Candid interface factoryPromise<unknown>
- Method result
Example:
query(options)
options
: ICanisterQueryOptions
canisterId
: Principal
- Target canistermethodName
: string
- Method to callargs
: unknown[]
- Method argumentsidlFactory
: IDL.InterfaceFactory
- Candid interface factoryPromise<unknown>
- Method result
Example:
createActor(canisterId, idlFactory)
canisterId
: Principal | string
- Target canisteridlFactory
: IDL.InterfaceFactory
- Candid interface factoryActorSubclass<T>
- Typed actor instance
Example:
getStatus(canisterId)
canisterId
: Principal | string
- Canister to queryPromise<ICanisterStatus>
canisterId
: Principal
- Canister IDstatus
: 'running' | 'stopping' | 'stopped'
- Current statussettings
: ICanisterSettings
- Current settingsmemorySize
: bigint
- Memory usage in bytescycles
: bigint
- Current cycles balancemoduleHash
: string
- Hash of installed moduleupdateSettings(canisterId, settings)
canisterId
: Principal | string
- Target canistersettings
: Partial<ICanisterSettings>
- Settings to updatePromise<void>
Example:
addController(canisterId, controller)
canisterId
: Principal | string
- Target canistercontroller
: Principal | string
- New controller principalPromise<void>
Example:
removeController(canisterId, controller)
canisterId
: Principal | string
- Target canistercontroller
: Principal | string
- Controller to removePromise<void>
Example:
formatCycles(cycles)
cycles
: bigint
- Cycles amountstring
- Formatted cycles (e.g., “2.5T”, “1.2B”)
Example:
parseCycles(cycles)
cycles
: string
- Cycles string (e.g., “2.5T”, “1B”)bigint
- Parsed cycles amount
Example:
exists(canisterId)
canisterId
: Principal | string
- Canister to checkPromise<boolean>
- Whether canister exists
Example:
isController(canisterId)
canisterId
: Principal | string
- Canister to checkPromise<boolean>
- Whether current identity is a controller
Example:
ICanisterSettings
ICanisterDeployOptions
IDeployResult
ICanisterCallOptions