Skip to main content

sendJetton

Sends Jetton tokens (TON’s token standard, similar to ERC-20 or SPL tokens) to a recipient address.

Usage

import { sendJetton, isTonWalletAccount } from "@dynamic-labs-sdk/ton";
import { getPrimaryWalletAccount } from "@dynamic-labs-sdk/client";

const walletAccount = getPrimaryWalletAccount();

if (walletAccount && isTonWalletAccount(walletAccount)) {
  const { transactionHash } = await sendJetton({
    walletAccount,
    transaction: {
      jettonMasterAddress: "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs", // USDT on TON
      recipientAddress: "UQDrjaLahLkMB-hMCmkzOyBuHJ186Qg_CZQhrOhIPBr0oDkB",
      amount: BigInt(1000000), // 1 USDT (6 decimals)
      forwardTonAmount: BigInt(10000000), // 0.01 TON forwarded with transfer notification
      forwardPayload: "Hello!", // Optional comment/memo
    },
  });

  console.log("Transaction hash:", transactionHash);
}

Parameters

ParameterTypeDescription
transaction.jettonMasterAddressstringThe Jetton master contract address
transaction.recipientAddressstringThe recipient’s wallet address
transaction.amountbigintThe amount of Jetton tokens to send in base units
transaction.forwardTonAmountbigint (optional)TON amount to forward with the transfer notification. Defaults to 0.
transaction.forwardPayloadstring (optional)A comment or memo to attach to the transfer
transaction.gasAmountbigint (optional)Gas amount for the transaction execution. Defaults to 50,000,000 nanotons (0.05 TON).
walletAccountTonWalletAccountThe wallet account to send from
clientDynamicClient (optional)The Dynamic client instance. Only required when using multiple clients.

Returns

Promise<TonSendTransactionResponse> - A promise that resolves to an object containing:
  • transactionHash - The hash of the submitted transaction

Errors

ErrorDescription
NotTonProviderErrorThrown if the wallet account’s provider is not a TON provider