Skip to main content

Recommended: JavaScript SDK with React Hooks

For new React apps, we recommend the JavaScript SDK with React Hooks (@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.
In this example, we are going to send jettons (non-native tokens) on TON.
import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
import { isTonWallet } from '@dynamic-labs/ton';

const SendJettonButton = () => {
  const { primaryWallet } = useDynamicContext();

  const onSendJetton = async () => {
    if (!primaryWallet || !isTonWallet(primaryWallet)) {
      throw new Error('TON wallet not found');
    }

    // Send jettons using sendJetton
    const transactionHash = await primaryWallet.sendJetton({
      jettonMasterAddress: 'EQBlqsm144Dq6SjbPI4jjZvA1hqTIP3CvHovbIfW_t-SCALE',
      recipientAddress: 'UQDrjaLahLkMB-hMCmkzOyBuHJ186Qg_CZQhrOhIPBr0oDkB',
      jettonAmount: BigInt(1000000000), // Amount in base units (e.g., 1 token with 9 decimals)
      forwardTonAmount: BigInt(10000000), // TON to forward with notification (0.01 TON)
      forwardPayload: 'Hello!', // Optional comment/memo
    });

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

  return <button onClick={onSendJetton}>Send Jetton</button>;
};

sendJetton Parameters

ParameterTypeRequiredDescription
jettonMasterAddressstringYesJetton master contract address
recipientAddressstringYesRecipient’s main wallet address
jettonAmountbigintYesAmount of jettons in base units
forwardTonAmountbigintYesTON amount to forward with notification
forwardPayloadstringNoOptional comment/memo
Last modified on June 25, 2026