> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Tron

> Sign messages, send TRX and TRC20 tokens, and query balances and network details using the Dynamic Swift SDK.

## Overview

`TronModule` provides native Tron blockchain operations including message signing, TRX and TRC20 token transfers, balance queries, and network details. Access it via `DynamicSDK.instance().tron`.

Available since Swift SDK `1.8.0`.

## Prerequisites

* Dynamic SDK initialized (see [Quickstart](/docs/swift/quickstart.md))
* User authenticated (see [Authentication](/docs/swift/authentication.md))
* Tron enabled in the [Dynamic dashboard](https://app.dynamic.xyz/dashboard/chains-and-networks)

## Get a Tron Wallet

If Tron is enabled in the dashboard, the user gets a Tron wallet on signup. Find it via `userWallets`:

```swift theme={"system"}
let sdk = DynamicSDK.instance()

let tronWallet = sdk.wallets.userWallets.first(where: { $0.chain == "TRON" })
```

## Get Balance

Query the TRX balance for a wallet. Returned as a string to preserve precision.

```swift theme={"system"}
let balance = try await sdk.tron.getBalance(walletId: wallet.id)
print("Balance: \(balance) TRX")
```

## Get Network Details

Query the Tron network the wallet is connected to. Returns a `TronNetworkDetails` with the chain ID and network name:

```swift theme={"system"}
let network = try await sdk.tron.getNetworkDetails(walletId: wallet.id)
print("Network: \(network.name) (chainId: \(network.chainId))") // e.g. "Mainnet (chainId: 728126428)"
```

## Sign a Message

Sign a message using the connected Tron wallet:

```swift theme={"system"}
let signature = try await sdk.tron.signMessage(
  walletId: wallet.id,
  message: "Hello, Tron!"
)
print("Signature: \(signature)")
```

## Send a Balance

Send TRX, or a TRC20 token, to a recipient. Returns the transaction hash.

```swift theme={"system"}
let hash = try await sdk.tron.sendBalance(
  walletId: wallet.id,
  toAddress: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", // recipient address
  amount: "0.01"
)
print("Hash: \(hash)")
```

| Parameter | Type | Description |
| - | - | - |
| `walletId` | `String` | The wallet ID to send from |
| `toAddress` | `String` | Recipient Tron address (base58, starts with `T`) |
| `amount` | `String` | Amount to send |
| `tokenAddress` | `String?` | Optional TRC20 token contract address. Omit for TRX |
| `tokenDecimals` | `Int?` | Optional token decimals |

## API Reference

| Method | Returns | Description |
| - | - | - |
| `getBalance` | `String` | Get wallet balance |
| `getNetworkDetails` | `TronNetworkDetails` | Get the connected network |
| `signMessage` | `String` | Sign a message |
| `sendBalance` | `String` | Send TRX or a TRC20 token, returns tx hash |

## Next Steps

* [Stellar Operations](/docs/swift/wallets/stellar/overview.md): Stellar operations
* [TON Operations](/docs/swift/wallets/ton/overview.md): TON operations
* [Token Balances](/docs/swift/wallets/general/token-balances.md): Multi-chain balance queries


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.