// Pre-built UI component for sending Toncoin transactions by clicking a button.
// It handles success and error states while being customizable.
import { SendTonButton } from '@ton/appkit-react';
export const SendToncoin = () => {
// For example: 'UQ...'
const recipientAddress = '<TON_WALLET_ADDRESS>';
// For example, '0.1' or '1' Toncoin.
const toncoin = '<FRACTIONAL_AMOUNT>';
return (
<SendTonButton
// Where to send Toncoin to
recipientAddress={recipientAddress}
// Toncoin amount
amount={toncoin}
// (optional) Comment string
comment="Hello from AppKit!"
// (optional) Add custom button title
// Defaults to Send X TON, where X is Toncoin amount
text="Send TON"
// (optional) Handle successes
onSuccess={(result) => console.log('Transaction sent:', result)}
// (optional) Handle errors
onError={(error) => console.error('Transaction failed:', error)}
// (optional) Add custom CSS classes
className=''
// (optional) When set to `true`, the button is disabled
disabled={false}
/>
);
};