TriportRPC

net_version

POSThttps://triport.io/rpc/tron

Returns 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.

paramsarrayrequired
Empty array; this method accepts no positional parameters.

Response

Response fields

FieldTypeDescription
jsonrpcstringJSON-RPC protocol version.
idnumberCorrelates the response with the request.
resultstringNetwork identifier in decimal notation.

Errors

See Tron errors for the shared envelope.

CodeMeaningWhen it happens
-32602Invalid paramsA positional parameter was supplied.
-32601Method not foundThe method is not in the published Tron catalog.
401UnauthorizedThe API key is missing or invalid.
429Rate limitedThe 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_chainId returns 0x2b6653dc.