Documentation Index
Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
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
| Parameter | Type | Required | Description |
|---|
jettonMasterAddress | string | Yes | Jetton master contract address |
recipientAddress | string | Yes | Recipient’s main wallet address |
jettonAmount | bigint | Yes | Amount of jettons in base units |
forwardTonAmount | bigint | Yes | TON amount to forward with notification |
forwardPayload | string | No | Optional comment/memo |