TriportRPC

eth_blockNumber

POSThttps://triport.io/rpc/tron

Returns the latest Tron block number as an EVM hexadecimal quantity.

Tron mainnettron:rpcfree+; tron_read_rpc: 15 / 20 / 100 / 250 RPS (free / basic / pro / business; default, unmeasured)

eth_blockNumber returns the number of the latest block visible to the selected Tron JSON-RPC node. The result uses the EVM quantity format: a 0x-prefixed hexadecimal string with no unnecessary leading zeroes.

Use this method to establish a current head before requesting blocks or bounded log ranges. It reports a height, not a complete block; use eth_getBlockByNumber when block data is required.

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.
resultstringLatest block number as an EVM hex quantity.

Errors

See Tron errors for the shared envelope and routing behavior.

CodeMeaningWhen it happens
-32602Invalid paramsparams is not empty or the request shape is invalid.
-32601Method not foundThe requested method is outside the published Tron catalog.
401UnauthorizedThe x-token header is missing or invalid.
429Rate limitedThe tron_read_rpc budget is exceeded.

Examples

const body = { jsonrpc: "2.0", id: 1, method: "eth_blockNumber", params: [] };
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(body),
});
console.log((await response.json()).result);

Notes

  • Convert the result with BigInt(result) when a decimal height is needed.
  • Tron has no WebSocket head subscription on this product surface; poll this method at an interval that fits the tier budget.
  • Related: eth_getBlockByNumber returns block data.