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

export const SupportedTools = ({chainId}) => {
  const [chains, setChains] = useState(null);
  const [tools, setTools] = useState(null);
  const [error, setError] = useState(null);
  useEffect(() => {
    const fetchChains = async () => {
      try {
        const response = await fetch('https://li.quest/v1/chains?chainTypes=EVM,SVM,UTXO,MVM,TVM,STL');
        if (!response.ok) {
          throw new Error(`HTTP error! status: ${response.status}`);
        }
        const jsonData = await response.json();
        setChains(jsonData.chains);
      } catch (err) {
        setError(err.message);
      }
    };
    fetchChains();
  }, []);
  useEffect(() => {
    const fetchTools = async () => {
      try {
        const response = await fetch('https://li.quest/v1/tools');
        if (!response.ok) {
          throw new Error(`HTTP error! status: ${response.status}`);
        }
        const jsonData = await response.json();
        setTools(jsonData);
      } catch (err) {
        setError(err.message);
      }
    };
    fetchTools();
  }, []);
  const parseBridges = (bridges, selectedChainId) => bridges.map(bridge => {
    const fromChainIds = bridge.supportedChains.filter(connection => connection.toChainId === selectedChainId).map(connection => connection.fromChainId);
    const toChainIds = bridge.supportedChains.filter(connection => connection.fromChainId === selectedChainId).map(connection => connection.toChainId);
    const connectedChainIds = [...new Set([...fromChainIds, ...toChainIds])];
    return {
      ...bridge,
      fromChainIds,
      toChainIds,
      connectedChainIds
    };
  }).filter(bridge => bridge.connectedChainIds.length).sort((a, b) => b.connectedChainIds.length - a.connectedChainIds.length);
  const parseExchanges = (exchanges, selectedChainId) => exchanges.filter(exchange => exchange.supportedChains.includes(selectedChainId));
  const renderChains = chains => <div className="p-2">
      <div className="flex flex-wrap gap-4">
        {chains.map(chain => <div key={chain.key} className="relative group flex-shrink-0">
            <img src={chain.logoURI} alt={chain.name} className="w-10 h-10 rounded-full object-cover not-prose" />
            <div className="absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 hidden group-hover:block bg-gray-800 text-white text-xs rounded py-1 px-2 whitespace-nowrap z-10">
              {chain.name}
            </div>
          </div>)}
      </div>
    </div>;
  const renderTools = (tools, chains) => {
    const bridges = parseBridges(tools.bridges, Number(chainId));
    const exchanges = parseExchanges(tools.exchanges, Number(chainId));
    return <div>
      <h2>Supported Bridges</h2>
      <ul>
        {bridges.map(bridge => <li>
            {bridge.name} (<code>{bridge.key}</code>) connects to:
            {renderChains(chains.filter(chain => bridge.connectedChainIds.includes(chain.id)))}
          </li>)}
      </ul>

      <h2>Supported Exchanges</h2>
      <ul>
        {exchanges.map(exchange => <li>{exchange.name} (<code>{exchange.key}</code>)</li>)}
        {exchanges.length === 0 ? '-' : ''}
      </ul>
    </div>;
  };
  if (error) return <div>Error: {error}</div>; else if (chains && tools) return renderTools(tools, chains); else return <div>Loading...</div>;
};

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>

<Note>
  Same-chain swaps on Tron are not supported yet. Quotes with Tron as the source chain are always cross-chain.
</Note>

<SupportedTools chainId="728126428" />

## 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).
</Note>

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

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

<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`.
</Warning>

### 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](/introduction/user-flows-and-examples/status-tracking) 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.
</Note>
