Overview
TonModule provides native TON blockchain operations including message signing, TON and Jetton transfers, balance queries, and network details. Access it via DynamicSDK.instance().ton.
Prerequisites
- Dynamic SDK initialized (see Quickstart)
- User authenticated (see Authentication)
- TON enabled in the Dynamic dashboard
Get a TON Wallet
If TON is enabled in the dashboard, the user gets a TON wallet on signup. Find it viauserWallets, or create one explicitly with EmbeddedWalletChain.ton:
Get Balance
Query the TON balance for a wallet. Returned as a string (nanotons) to preserve precision.Sign a Message
Sign a message using the connected TON wallet:Send TON
Send TON tokens to a recipient address. Returns aTonTransactionResult containing the BOC and transaction hash.
| Parameter | Type | Description |
|---|---|---|
walletId | String | The wallet ID to send from |
to | String | Recipient TON address |
amount | String | Amount in nanotons (1 TON = 10⁹ nanotons) |
comment | String? | Optional comment to attach to the transaction |
Send Jettons
Send Jetton tokens (TON’s fungible token standard, similar to ERC-20):| Parameter | Type | Description |
|---|---|---|
walletId | String | The wallet ID to send from |
to | String | Recipient TON address |
amount | String | Amount in the Jetton’s smallest unit |
jettonMasterAddress | String | Jetton master (contract) address |
comment | String? | Optional comment |
Get Network Details
Query the chain ID and network name for the connected wallet:chainId—-239for mainnet,-3for testnetname—"mainnet"or"testnet"
API Reference
| Method | Returns | Description |
|---|---|---|
getBalance | String | Get wallet balance (nanotons) |
signMessage | String | Sign a message |
sendTon | TonTransactionResult | Send TON, returns {boc, hash} |
sendJetton | TonTransactionResult | Send Jettons, returns {boc, hash} |
getNetworkDetails | TonNetworkDetails | Get {chainId, name} |
Next Steps
- Bitcoin Operations — Bitcoin operations
- SUI Operations — SUI operations
- Token Balances — Multi-chain balance queries