Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Getting Started

tonutils is a native Rust TON SDK. The current public surface is focused on LiteAPI access over native ADNL TCP, TL serialization, TON cells/BoC primitives, network config parsing, and a scriptable CLI.

Audience: first-time crate users and embedders choosing features. Prerequisite: basic Rust async familiarity for LiteClient examples. Live network access is only needed for LiteClient, LiteBalancer, contract, and config-download flows; TVM, BoC, TL-B schema, and many examples work offline.

Feature Selection

Default features enable the native LiteClient path over ADNL TCP:

tonutils = { path = "../tonutils-rs" }

The default feature set is std, adnl-tcp, and liteclient. Because liteclient depends on tvm, adnl-tcp depends on adnl, and both tvm and adnl depend on tl, the default build also compiles TL and TVM support.

Use narrower features when embedding only a part of the SDK:

tonutils = { path = "../tonutils-rs", default-features = false, features = ["tvm"] }

Enable config parsing and CLI support explicitly:

tonutils = { path = "../tonutils-rs", features = ["network-config", "cli"] }

Current Feature Map

  • std: standard library support. It is currently part of the default build.
  • tl: TL types, LiteAPI request and response structures, and serialization helpers.
  • tvm: cells, slices, builders, BoC, addresses, dictionaries, TL-B helpers, and TVM stack values. Enables tl.
  • adnl: ADNL types shared by transports. Enables tl.
  • adnl-tcp: native ADNL TCP transport. Enables adnl plus async transport dependencies.
  • liteclient: LiteAPI client, LiteBalancer, and contract helpers over ADNL TCP. Enables adnl-tcp and tvm.
  • network-config: TON global config parsing and liteserver selection helpers.
  • cli: command line interface for shell scripts and diagnostics. Enables liteclient and network-config.

Future feature groups may add proof verification, wallets, DHT, overlays, mempool scanning, and optional TON emulator bindings.

Guide Map

  • LiteClient: typed and raw LiteAPI workflows.
  • LiteBalancer: multi-peer workflows and prototype limits.
  • Contracts: account state and get-method wrappers.
  • Wallets: mnemonic derivation, addresses, and signed transfer BoCs.
  • TVM primitives: cells, BoC, stack values, addresses, and dictionaries.
  • TL and LiteAPI: constructors, serialization, raw bytes, and schema checks.
  • Networking: ADNL TCP, network config, and future protocol boundaries.
  • CLI: shell commands, output formats, and exit behavior.
  • Examples: compiling examples and live input variables.
  • Testing: local checks, live tests, and fixture expectations.