> ## 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.

# sendTransaction (Tron)

# sendTransaction

Sends a Tron transaction to transfer TRX to a recipient address.

## Usage

```javascript theme={"system"}
import { sendTransaction, isTronWalletAccount } from "@dynamic-labs-sdk/tron";
import { getPrimaryWalletAccount } from "@dynamic-labs-sdk/client";

const walletAccount = getPrimaryWalletAccount();

if (walletAccount && isTronWalletAccount(walletAccount)) {
  const result = await sendTransaction({
    walletAccount,
    transaction: {
      to: "RECIPIENT_TRON_ADDRESS",
      amount: 10, // Amount in TRX
    },
  });

  console.log("Transaction result:", result);
}
```

## Parameters

| Parameter            | Type                       | Description                                                             |
| -------------------- | -------------------------- | ----------------------------------------------------------------------- |
| `transaction.to`     | `string`                   | The recipient's Tron address                                            |
| `transaction.amount` | `number`                   | The amount to send in TRX (will be converted to SUN internally)         |
| `walletAccount`      | `TronWalletAccount`        | The wallet account to send from                                         |
| `client`             | `DynamicClient` (optional) | The Dynamic client instance. Only required when using multiple clients. |

## Returns

`Promise<TronBroadcastReturnSignedTransaction>` - A promise that resolves to the broadcast result of the signed transaction.

## Errors

| Error                     | Description                                                    |
| ------------------------- | -------------------------------------------------------------- |
| `NotTronProviderError`    | Thrown if the wallet account's provider is not a Tron provider |
| Signing unavailable error | Thrown if the wallet account is not available for signing      |

## Notes

* The amount is specified in TRX and is automatically converted to SUN (Tron's smallest unit) internally
* The function verifies that the wallet account is available for signing before sending the transaction

## React

```tsx theme={"system"}
import { sendTransaction, isTronWalletAccount } from '@dynamic-labs-sdk/tron';
import { useGetWalletAccounts } from '@dynamic-labs-sdk/react-hooks';
import { useState } from 'react';

function SendTronButton({ recipientAddress, amount }) {
  const { data: walletAccounts = [] } = useGetWalletAccounts();
  const walletAccount = walletAccounts.find(isTronWalletAccount);
  const [status, setStatus] = useState('');

  const handleSend = async () => {
    if (!walletAccount) return;
    await sendTransaction({
      walletAccount,
      transaction: { to: recipientAddress, amount },
    });
    setStatus('Transaction sent');
  };

  return (
    <div>
      <button onClick={handleSend} disabled={!walletAccount}>Send TRX</button>
      {status && <p>{status}</p>}
    </div>
  );
}
```

## Related functions

* [getTronWeb](/javascript/reference/tron/get-tron-web) - Get the TronWeb instance for more advanced operations
* [isTronWalletAccount](/javascript/reference/tron/checking-tron-wallet-account-type) - Check if a wallet account is a Tron account
