sendTransaction
Sends a custom TON transaction with arbitrary message payloads. This is useful for smart contract calls, multi-message transactions, and contract deployment.Usage
Parameters
| Parameter | Type | Description |
|---|---|---|
request.messages | array | Array of messages to send (see Message format below) |
request.validUntil | number | Transaction deadline as a unix epoch timestamp in seconds |
request.network | CHAIN (optional) | Network identifier (-239 for mainnet, -3 for testnet) |
request.from | string (optional) | Sender address |
walletAccount | TonWalletAccount | The wallet account to send from |
client | DynamicClient (optional) | The Dynamic client instance. Only required when using multiple clients. |
Message format
| Field | Type | Description |
|---|---|---|
address | string | Receiver’s address |
amount | string | Amount to send in nanotons |
payload | string (optional) | Contract data as base64-encoded BOC |
stateInit | string (optional) | State init for contract deployment as base64-encoded BOC |
extraCurrency | { [k: number]: string } (optional) | Extra currencies to send |
Returns
Promise<TonSendTransactionResponse> - A promise that resolves to an object containing:
transactionHash- The hash of the submitted transaction
Errors
| Error | Description |
|---|---|
NotTonProviderError | Thrown if the wallet account’s provider is not a TON provider |
Related functions
- sendTon - Send a simple native TON transfer
- sendJetton - Send Jetton tokens