githubEdit

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.

circle-info

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.

circle-exclamation

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

circle-info

On EVM chains, values are typically expressed in Wei (1 ETH = 10^18 Wei).

The following example will:

  1. Retrieve the first Ethereum account (see Manage Accounts)

  2. Send 0.001 ETH (1000000000000000 wei) to an account using sendTransaction.

Send ETH
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

circle-info

On TON, values are expressed in Nanotons (1 TON = 10^9 Nanotons).

The following example will:

  1. Retrieve the first TON account

  2. Send 1 TON (1000000000 nton) to an account using sendTransaction.

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:

  1. Retrieve an ETH and ton account using the getAccount() method.

  2. Send ETH and await the transaction.

  3. Send TON and await the transaction.

Next Steps

For more complex interactions like swapping tokens or bridging assets, learn how to integrate protocols.