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

# Tron Providers

> Tron Architecture

LI.FI offers bridging between Tron and other supported ecosystems, such as EVM chains and Solana.

> [!NOTE]
>
> Tron chainId in LI.FI is `728126428` (chain key `TRN`).
>
> Native TRX is represented as `T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb` (6 decimals). TRC20 tokens are addressed by their Base58 contract address (`T...`).
>
> Tron addresses are Base58 and case-sensitive. Always pass them exactly as returned by the API. The hex form (`41...`) is not accepted.

> [!NOTE]
>
> Same-chain swaps on Tron are not supported yet. Quotes with Tron as the source chain are always cross-chain.

## Requesting a quote

A quote for Tron can be requested using the same endpoints as EVM. Only the chain ids, token addresses and the transaction data differ.

> [!NOTE]
>
> `fromAddress` when the source chain is Tron must be a Base58 `T...` account address.
>
> `toAddress` when Tron is the destination chain is a Base58 `T...` address. When bridging out of Tron, `toAddress` is a regular address on the destination chain (for example an EVM address).

## Token approvals

Sending a TRC20 token requires a token allowance: the executing contract pulls the tokens from your account, so give an allowance to the step's `estimate.approvalAddress` for at least `fromAmount` before executing. Native TRX is passed as the transaction's call value and needs no approval.

To check whether a route needs an approval, scan the quote's `includedSteps`: whenever a step's `estimate.skipApproval` is not `true`, approve that step's `estimate.approvalAddress`.

> [!NOTE]
>
> An approval is a separate Tron transaction (TRC20 `approve(spender, amount)`). Submit it and wait for it to be confirmed before broadcasting the LI.FI transaction.

## Executing a transaction

### Transaction data

`transactionRequest` carries the unsigned Tron transaction in two forms:

* `data` — the hex-encoded protobuf `raw_data` of an unsigned `TriggerSmartContract` transaction (the `raw_data_hex` of a Tron node), prefixed with `0x`.
* `customData.tronTransaction` — the same transaction as a TronWeb transaction object: `{ visible, txID, raw_data, raw_data_hex }`. `customData.contractType` is `TriggerSmartContract`.

Inside the object, `raw_data_hex` and `txID` are plain lowercase hex without the `0x` prefix, so `data` equals `0x` + `raw_data_hex`.

`to` is the LI.FI contract on Tron, `value` is the TRX call value in SUN and `gasLimit` is the transaction's `fee_limit` in SUN (see [Gas](#gas)). Both are hex-encoded strings, matching `raw_data.fee_limit` in the transaction object.

To execute the transaction with [TronWeb](https://tronweb.network/):

1. Request the transaction data through the regular quote flow.
2. Sign `customData.tronTransaction` with the sender account's key.
3. Broadcast the signed transaction to the Tron network.

```typescript theme={"system"}
import { TronWeb } from "tronweb";

const tronWeb = new TronWeb({
  fullHost: "https://api.trongrid.io",
  privateKey: SENDER_PRIVATE_KEY,
});

const { transactionRequest } = quote;
const transaction = transactionRequest.customData.tronTransaction;

const signedTransaction = await tronWeb.trx.sign(transaction);
const { result, txid } = await tronWeb.trx.sendRawTransaction(signedTransaction);
```

> [!NOTE]
>
> `data` alone is enough to rebuild the transaction without TronWeb: the transaction id is the SHA-256 hash of the `raw_data` bytes (strip the `0x` prefix first), and the signature is made over that id. `customData.tronTransaction` saves you the deserialization.

> [!WARNING]
>
> **Transaction validity window**
>
> The transaction is valid until `raw_data.expiration`, about 10 minutes after it was built. The network rejects a transaction broadcast after its expiration.
>
> * Sign and broadcast promptly after receiving the transaction data.
> * Request a new transaction if the one you hold is stale.
> * If signing takes longer (for example with an MPC signer), extend the expiration **before** signing. TronWeb recomputes `txID` and `raw_data_hex` for you:
>
> ```typescript theme={"system"}
> const extendedTransaction = await tronWeb.transactionBuilder.extendExpiration(
>   transaction,
>   extraSeconds
> );
> const signedTransaction = await tronWeb.trx.sign(extendedTransaction);
> ```
>
> The expiration cannot be more than 24 hours after the current block. Do not modify any other field of `raw_data`.

### Gas

Tron charges bandwidth and energy. The estimated costs are returned in the step's `estimate.gasCosts` as two `SEND` entries in SUN (TRX, 6 decimals): one for bandwidth and one for energy. Resources staked by the sender account are consumed first; the remainder is burned in TRX.

`transactionRequest.gasLimit` is the transaction's `fee_limit`: the maximum TRX the transaction is allowed to burn for energy. It is a safety ceiling, not the expected cost.

## Status tracking

Transaction status can be tracked using the regular [status tracking](https://docs.li.fi/introduction/user-flows-and-examples/status-tracking.md) flow.

> [!NOTE]
>
> When polling `/status` for a transaction that originates on Tron, always pass `fromChain=TRN` (or the Tron chain id `728126428`). Tron transaction hashes are 64-character hex strings and are otherwise indistinguishable from Bitcoin transaction hashes.


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