Skip to content

API Reference


Interface: MotokoCanisterScope

Defined in: docs-entry.ts:627

A Motoko canister scope containing all available tasks. Created by calling .make() on a MotokoCanisterBuilder.

Available Tasks

TaskDescription
deploySmart deployment: creates, builds, and installs in one step
buildCompiles the Motoko source to Wasm
installInstalls or upgrades the Wasm code
createCreates the canister on the replica
bindingsGenerates TypeScript/JavaScript bindings
statusReturns the current canister status
stopStops the canister
removeRemoves/deletes the canister

Example

typescript
// Run a specific task
await ctx.runTask(backend.children.deploy)

// Access task results
const result = await ctx.runTask(backend.children.build)

Properties

_tag

_tag: "scope"

Defined in: docs-entry.ts:628


children

children: object

Defined in: docs-entry.ts:629

bindings

bindings: Task

Generates TypeScript/JavaScript bindings from the Candid file.

build

build: Task

Compiles the Motoko source to Wasm.

config

config: Task

Returns the canister configuration.

create

create: Task

Creates the canister on the replica (allocates canister ID).

deploy

deploy: Task

Smart deployment: creates, builds, and installs in one step.

install

install: Task

Installs or upgrades the Wasm code on the canister.

install_args

install_args: Task

Computes and returns the install arguments.

remove

remove: Task

Removes/deletes the canister from the replica.

status

status: Task

Returns the current canister status (running, stopped, etc.).

stop

stop: Task

Stops the canister.