Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ton-blockchain/acton/llms.txt

Use this file to discover all available pages before exploring further.

acton wrapper generates a Tolk wrapper for a contract defined in Acton.toml and optionally produces a stub test file or a TypeScript wrapper for frontend and tooling integrations. Wrapper generation uses the ABI emitted by the Tolk compiler from the contract source (or from a configured types interface file for precompiled .boc contracts). No prior acton build run is required.

Synopsis

# Generate wrapper for one contract
acton wrapper [OPTIONS] <CONTRACT_NAME>

# Generate wrappers for every contract in Acton.toml
acton wrapper [OPTIONS] --all

Arguments & options

Wrapper options

FlagTypeDefaultDescription
<CONTRACT_NAME>stringContract name from Acton.toml. Required unless --all is given. Conflicts with --all.
--allflagfalseGenerate wrappers for every contract defined in Acton.toml. Conflicts with --output, --test-output, and <CONTRACT_NAME>.
-o, --output <PATH>pathWrite the generated wrapper to an exact file path. Conflicts with --output-dir and --all.
--output-dir <DIR>path[wrappers.tolk].output-dir or project defaultWrite the generated wrapper to a directory and let Acton choose the file name. Conflicts with --output.

Test stub options

FlagTypeDefaultDescription
-t, --testflagfalseGenerate a stub test file alongside the wrapper. Conflicts with --ts.
--test-output <PATH>pathWrite the generated test file to an exact path. Requires --test. Conflicts with --all, --test-output-dir, and --ts.
--test-output-dir <DIR>path[wrappers.tolk].test-output-dir or project defaultWrite the generated test file to a directory. Requires --test. Conflicts with --test-output and --ts.

TypeScript options

FlagTypeDefaultDescription
--tsflagfalseGenerate a TypeScript wrapper via @ton/tolk-abi-to-typescript@0.5.0. Requires Node.js, npm, and npx in PATH. Conflicts with --test, --test-output, and --test-output-dir.

Global flags

FlagTypeDefaultDescription
--color <WHEN>auto | always | neverautoControl coloured output.
--manifest-path <PATH>pathPath to Acton.toml. Conflicts with --project-root.
--project-root <PATH>pathPath to project root. Conflicts with --manifest-path.

ABI requirements

Wrapper generation depends on the ABI exposed by the Tolk compiler.
ABI fieldEffect when present
storage: ...Generates typed storage helpers: fromStorage(...), deploy(...)
incomingMessages: ...Generates send{Message}(...) and sendAny(...) helpers
Declared get methodsGenerated as typed wrapper methods
When incomingMessages is absent, message-sending helpers are not generated. When storage is absent, storage helpers fall back to an untyped initializer.

Acton.toml configuration

Acton.toml
[wrappers.tolk]
output-dir       = "wrappers"
generate-test    = true
test-output-dir  = "tests"

[wrappers.typescript]
output-dir = "wrappers-ts"
For precompiled .boc contracts, add a types interface file so wrapper generation can read ABI metadata:
Acton.toml
[contracts.Precompiled]
src   = "contracts/Precompiled.boc"
types = "contracts/Precompiled.types.tolk"
CLI flags override config values for the current invocation. Existing wrapper files at the target path are always overwritten.

TypeScript generation

acton wrapper --ts shells out to npx @ton/tolk-abi-to-typescript@0.5.0. Node.js, npm, and npx must be in PATH. The --ts flag cannot be combined with --test, --test-output, or --test-output-dir.

Examples

acton wrapper Counter
acton wrapper compiles the contract source directly each time it runs — you do not need to run acton build first. For .boc contracts, configure a types interface file in Acton.toml to enable ABI-backed wrapper generation.

Build docs developers (and LLMs) love