net_version
POST
https://triport.io/rpc/tronReturns the Tron EVM network identifier as a decimal string.
Tron mainnettron:rpcfree+; tron_read_rpc: 15 / 20 / 100 / 250 RPS (free / basic / pro / business; default, unmeasured)
net_version returns the network identifier as a decimal string. The response
is a string even though it contains only decimal digits.
Use it for compatibility with clients that still inspect the net namespace.
For modern EVM chain selection, eth_chainId exposes the
same identifier using the standard hexadecimal quantity representation.
Parameters
JSON-RPC params must be an empty array.
paramsarrayrequiredEmpty array; this method accepts no positional parameters.
Response
Response fields
| Field | Type | Description |
|---|---|---|
jsonrpc | string | JSON-RPC protocol version. |
id | number | Correlates the response with the request. |
result | string | Network identifier in decimal notation. |
Errors
See Tron errors for the shared envelope.
| Code | Meaning | When it happens |
|---|---|---|
-32602 | Invalid params | A positional parameter was supplied. |
-32601 | Method not found | The method is not in the published Tron catalog. |
401 | Unauthorized | The API key is missing or invalid. |
429 | Rate limited | The tron_read_rpc budget is exceeded. |
Examples
const response = await fetch("https://triport.io/rpc/tron", {
method: "POST",
headers: { "x-token": process.env.TRIPORT_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "net_version", params: [] }),
});
console.log((await response.json()).result);Notes
- Do not interpret the result as a hexadecimal quantity.
- The measured mainnet response is
"728126428". - Related:
eth_chainIdreturns0x2b6653dc.