eth_chainId
Tron / https://triport.io/rpc/tron
Minimum tier: Free
Last updated:
eth_chainId identifies the EVM-compatible Tron mainnet represented by this
endpoint. The value is encoded as an EVM hex quantity and is suitable for
network checks in EVM tooling.
Use it to reject an incorrectly configured endpoint before reading state. It is
the hexadecimal form of the same numeric identifier returned as a decimal
string by net_version.
Parameters
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| chainId | Quantity |
Examples
curl https://triport.io/rpc/tron \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'const res = await fetch("https://triport.io/rpc/tron", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "eth_chainId",
"params": []
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/rpc/tron",
headers={"Authorization": "Bearer <api-key>"},
json={"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Chain: Tron.
- Clusters: mainnet.
- Credit cost: 1 per call.
FAQ
- What does eth_chainId do?
- Returns the Tron EVM mainnet chain identifier as a hexadecimal quantity.
- How many credits does eth_chainId cost?
- eth_chainId costs 1 credit(s) per call on Triport by default.
- Is eth_chainId available over WebSocket?
- eth_chainId is an HTTP JSON-RPC method.