# TRON

> JSON-RPC and native HTTP API hosts, setup, and limitations for TRON Mainnet and Nile.

Canonical page: https://rpc.aurpay.net/docs/chains/tron

The TRON Gateway provides both JSON-RPC and the native TRON HTTP API. Its native asset is TRX.

## Supported networks

| Network | Chain ID | JSON-RPC Host | HTTP API Host |
|---|---:|---|---|
| Mainnet | 728126428 | `tron-jsonrpc` | `tron-httpapi` |
| Nile | 3448148188 | `tron-testnet-jsonrpc` | `tron-testnet-httpapi` |

Copy complete Access Points from the dashboard instead of constructing domains from the Hosts.

## JSON-RPC

### Endpoint-free calls

On a shared-cache hit, TRON JSON-RPC `eth_blockNumber` can return a result without an Endpoint. Use an Endpoint-backed Route for additional TRON JSON-RPC methods, parameter variants, and writes. See [Endpoint-free RPC](https://rpc.aurpay.net/docs/endpoint-free-rpc.md) for the complete request set.

### Configure upstream-backed access

[Provider sync](https://rpc.aurpay.net/docs/providers.md) covers Mainnet and Nile: Alchemy, QuickNode, and Chainstack generate both a JSON-RPC and a native HTTP API Endpoint, while dRPC generates a JSON-RPC Endpoint for Mainnet only. Associating one of these Providers with the App automatically maintains its matching synchronized Endpoints in the App's Routes.

Create or synchronize a JSON-RPC Endpoint on the same network, then open the Gateway's JSON-RPC **Routing** section and select it. Verify the Endpoint with `eth_chainId`:

```bash
curl '<tron_jsonrpc_access_point>' \
  -H 'Authorization: Bearer <app_api_key>' \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
```

## Native HTTP API

TRON Mainnet and Nile expose a native HTTP API in addition to JSON-RPC.

[Endpoint-free RPC](https://rpc.aurpay.net/docs/endpoint-free-rpc.md) applies to two exact native HTTP API request shapes. Use a matching `http_api` Endpoint and Route for additional native calls and stable fallback coverage.

### Configure the Route

Open **Apps**, select the App and its TRON Gateway, then switch the Gateway API type to **HTTP API**. In **Routing**:

1. Confirm the App Provider's matching HTTP API Endpoint is already selected, or create/synchronize an `http_api` Endpoint on the same network and select it.
2. Choose **Priority failover** to use the saved order or **Load balance** to assign weights.
3. Save HTTP API routing.

The native HTTP API has one Gateway-wide Route, separate from the JSON-RPC default Route and JSON-RPC per-method rules. Configure at least one matching HTTP API Endpoint so cache misses have upstream coverage.

When a Provider is associated with the App, later Provider synchronizations keep matching Provider-managed targets aligned automatically. Clearing or replacing that App Provider removes its managed targets from this Route, while manually selected targets remain.

### URL and authentication

Mainnet uses `tron-httpapi.<gateway-domain>` and Nile uses `tron-testnet-httpapi.<gateway-domain>`. Prefer the complete URL shown in the dashboard.

API Key in the URL path:

```text
https://tron-httpapi.<gateway-domain>/<app_api_key>/wallet/getnowblock
```

The `Authorization` header keeps the API Key out of the path:

```bash
curl -X POST 'https://tron-httpapi.<gateway-domain>/wallet/getnowblock' \
  -H 'Authorization: Bearer <app_api_key>' \
  -H 'Content-Type: application/json' \
  --data '{}'
```

Choose the `Authorization` header or the first path segment for the API Key. When both placements are present, use the same value in each.

### Requests

The Gateway accepts GET and POST only, for these path families:

| Path family | Purpose |
|---|---|
| `/wallet/*` | FullNode HTTP API |
| `/walletsolidity/*` | SolidityNode HTTP API |
| `/v1/*` | TronGrid API; `v1` is part of the official TRON path |

```bash
curl -X POST 'https://tron-httpapi.<gateway-domain>/<app_api_key>/wallet/getnowblock' \
  -H 'Content-Type: application/json' -d '{}'

curl -X POST 'https://tron-httpapi.<gateway-domain>/<app_api_key>/walletsolidity/getnowblock' \
  -H 'Content-Type: application/json' -d '{}'

curl 'https://tron-httpapi.<gateway-domain>/<app_api_key>/v1/accounts/<address>/transactions?limit=20'
```

Each family requires at least one following path segment. Use `GET` or `POST` with the three path families above.

The request body and ordered, repeated query parameters are forwarded unchanged. Only `Accept` and `Content-Type` request headers are forwarded upstream. Provider credentials come from Endpoint authentication configuration.

### Responses and headers

Upstream status codes and bodies are preserved. Responses pass through only `Content-Type`, `Cache-Control`, `ETag`, `Last-Modified`, `Expires`, and `Retry-After`. An Endpoint-free RPC cache hit also includes `X-RPC-Gateway-Cache: HIT`.

Gateway-generated Wallet/Solidity responses use an `Error` field. TronGrid v1 responses use the `Success`, `Error`, and `StatusCode` fields. See [Errors and recovery](https://rpc.aurpay.net/docs/errors.md) for the status table and recovery actions. Rate-limited responses include `Retry-After`.

### Rate limits, failover, and cache

HTTP API limits are independent from JSON-RPC capacity. Connection or configuration failures, 3xx, and upstream 401, 403, or 429 responses move to the next candidate within the Route attempt bound. After 408, 425, 5xx, an interrupted response, or a timeout, the Gateway moves only stateless queries and fixed signed broadcasts to another Endpoint. Node signing, transaction construction, account or resource changes, and unrecognized paths stop after an ambiguous failure. Ordinary upstream business responses are returned unchanged. Attempt bounds and Circuit behavior are shared with JSON-RPC; see [Retries](https://rpc.aurpay.net/docs/failsafe/retries.md).

`POST /wallet/getnodeinfo` without a body uses the short-lived shared cache tier. `POST /wallet/getblockbynum` with only a non-negative `num` and `visible: true` uses retained PostgreSQL cache entries. All Accounts may read an existing entry. On a miss, the request continues through the caller's HTTP API Route; eligible administrator requests can populate the shared entry, while other misses are forwarded without populating it.

## Supported surface

- JSON-RPC accepts one request per HTTP `POST`.
- The HTTP API accepts `GET` and `POST` under `/wallet/*`, `/walletsolidity/*`, and `/v1/*`.
- Provider-managed HTTP API targets follow the App Provider association; manually selected targets remain under manual control.
- Method and historical-data availability follows the upstream Endpoint. Mainnet and Nile use independent Routes.

## Related

- [Endpoint-free RPC](https://rpc.aurpay.net/docs/endpoint-free-rpc.md)
- [Errors and recovery](https://rpc.aurpay.net/docs/errors.md)
- [Failsafe](https://rpc.aurpay.net/docs/failsafe.md)
- [Routing and reliability](https://rpc.aurpay.net/docs/reliability.md)
