TON Dart
Dart library for the TON network: build, sign, and send transactions, manage wallet contracts (v1–v5, highload), Jettons, NFTs, BOC serialization, TonConnect sessions, and autogenerated TonAPI / TonCenter API clients.
This package is the continuation of the original mrtnetwork/ton_dart.
Crypto engine: blockchain_utils dual backend
All cryptography delegates to
blockchain_utils: pure
Dart by default, optional Rust backend (FFI on native, WASM on web). When set
(blockchainUtils.setRustApi()), all high-level crypto used here routes
through Rust. Rust core:
mrtnetwork/blockchain-utils.
Breaking changes
- All legacy exception classes removed — every error is
BuError. Failures throwBuErrorwith aTonErrorTypetaxonomy value (domain: 'ton': plugin, BOC, dict, keys, contracts, metadata, tuples, TonConnect bridge/payload/TTL, …). Message text anddetailspreserved via same-signature helpers — updatecatchclauses andonfilters toBuError.
Supported networks
| Network | Support |
|---|---|
| Mainnet | ✅ |
| Testnet | ✅ |
Wallet contract addresses encode the workchain via the dedicated
TonWorkChain class (masterchain / basechain).
Features
Transactions & wallets
| Area | Support |
|---|---|
| Wallets | Basic v1–v4, v5R1, Highload v3, MultiOwner |
| Signing | Ed25519 external messages, multi-message transfers |
| BOC | Cell / BOC encode, decode, hashing, address parse/serialize |
Tokens & NFTs
| Area | Support |
|---|---|
| Jettons | Minter + wallet deploy, mint, transfer (Jetton, StableJetton) |
| NFTs | Collections (incl. editable), items, transfers, ownership |
Providers (autogenerated)
| API | Source |
|---|---|
| TonAPI | Autogenerated models + requests (lib/src/provider/generated/tonapi/) |
| TonCenter v2 | Autogenerated models + requests (lib/src/provider/generated/toncenter/) |
| TonCenter v3 | Partial support, autogenerated (lib/src/provider/generated/toncenter_v3/) |
TonConnect
| Area | Support |
|---|---|
| Sessions | Connect / disconnect flows, request validation, deep links |
| Bridge | SSE bridge provider, message signing requests |
Unfreeze service
| Area | Support |
|---|---|
| Server | UnfreezeService — unfreeze / state-recovery flows |
| Tooling | Quick client + emulator helpers (lib/src/unfreeze/) |
Examples
See example/
(jetton minter/wallet, stable jetton, NFTs, multi-owner, highload, versioned
wallets, transfers).
Contributing
Contributions are welcome! Please follow these guidelines:
- Fork the repository and create a new branch.
- Make your changes and ensure tests pass.
- Submit a pull request with a detailed description of your changes.
Feature requests and bugs
Please file feature requests and bugs in the issue tracker.