Send Transactions
Learn how to send native tokens on different blockchains.
You can send native tokens (like ETH, TON, or BTC) from any of your wallet accounts to another address.
Get Testnet Funds: To test these transactions without spending real money, ensure you are on a testnet and have obtained funds. See Testnet Funds & Faucets for a list of available faucets.
BigInt Usage: Always use BigInt (the n suffix) for monetary values to avoid precision loss with large numbers.
Send Native Tokens
The sendTransaction method allows you to transfer value. It accepts a unified configuration object, though specific parameters (like value formatting) may vary slightly depending on the blockchain.
Ethereum Example
On EVM chains, values are typically expressed in Wei (1 ETH = 10^18 Wei).
The following example will:
- Retrieve the first Ethereum account (see Manage Accounts)
- Send 0.001 ETH (1000000000000000 wei) to an account using
sendTransaction.
const ethAccount = await wdk.getAccount('ethereum', 0)
const result = await ethAccount.sendTransaction({
to: '0x71C7656EC7ab88b098defB751B7401B5f6d8976F',
value: 1000000000000000n // 0.001 ETH (in Wei)
})
console.log('Transaction sent! Hash:', result.hash)TON Example
On TON, values are expressed in Nanotons (1 TON = 10^9 Nanotons).
The following example will:
- Retrieve the first TON account
- Send 1 TON (1000000000 nton) to an account using
sendTransaction.
// Send TON transaction
const tonAccount = await wdk.getAccount('ton', 0)
const tonResult = await tonAccount.sendTransaction({
to: 'UQCz5ON7jjK32HnqPushubsHxgsXgeSZDZPvh8P__oqol90r',
value: 1000000000n // 1 TON (in nanotons)
})
console.log('TON transaction:', tonResult.hash)Handling Responses
The sendTransaction method returns a transaction result object. The most important field is typically hash, which represents the transaction ID on the blockchain. You can use this hash to track the status of your payment on a block explorer.
Multi-Chain Transactions
You can orchestrate payments across different chains in a single function by acting on multiple account objects sequentially.
The following example will:
- Retrieve an ETH and ton account using the
getAccount()method. - Send ETH and
awaitthe transaction. - Send TON and
awaitthe transaction.
async function sendCrossChainPayments(wdk) {
const ethAccount = await wdk.getAccount('ethereum', 0)
const tonAccount = await wdk.getAccount('ton', 0)
// 1. Send ETH
await ethAccount.sendTransaction({
to: '0x...',
value: 1000000000000000000n
})
// 2. Send TON
await tonAccount.sendTransaction({
to: 'EQ...',
value: 1000000000n
})
}Next Steps
For more complex interactions like swapping tokens or bridging assets, learn how to integrate protocols.