# Send

Trigger the send flow in the wallet, allowing a user to select a token and a destination before executing the
transaction.

You can optionally pass in the token and destination.

```ts title="Pure JS"
import { mega } from '@megaeth-labs/wallet-sdk';

const result = await mega.send({});
```

```tsx title="React"
import { useSend } from '@megaeth-labs/wallet-sdk-react';

export default function SendButton() {
    const { mutate: send, isPending } = useSend();

    return (
        <button onClick={() => send({})} disabled={isPending}>
            Send
        </button>
    );
}
```

```tsx title="Wagmi"
import type { MegaWalletProvider } from '@megaeth-labs/wallet-wagmi-connector';
import { useAccount } from 'wagmi';

export default function SendButton() {
    const { connector } = useAccount();

    async function send() {
        const provider = (await connector?.getProvider()) as MegaWalletProvider;
        await provider.send({});
    }

    return (
        <button onClick={send} disabled={!connector}>
            Send
        </button>
    );
}
```

```ts
interface SendRequest {
    token?: `0x${string}` | 'native';
    destination?: `0x${string}`;
}

interface TransactionResult {
    status: 'approved' | 'cancelled' | 'error';
    receipt?: TransactionReceipt;
    receipts?: TransactionReceipt[];
    error?: string;
}
```
