TriportRPC

eth_getBlockByNumber

POSThttps://triport.io/rpc/tron

Returns the EVM representation of a Tron block by quantity or latest.

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

eth_getBlockByNumber returns an EVM-shaped block object or null. The block selector is either an EVM hex quantity or the literal latest; the second parameter chooses whether transactions are requested in their full form.

Use this method when an EVM-compatible client needs block data. The native wallet alternative getblockbynum accepts a decimal JSON integer and returns a native Tron wallet object. Historical block availability is a per-node capability, not a pool-wide archive guarantee.

Parameters

JSON-RPC params is [block, fullTransactions].

blockstringrequired
EVM hex quantity or the literal latest.
fullTransactionsbooleanrequired
Selects the representation of transactions in the returned block.

Response

Response fields

FieldTypeDescription
jsonrpcstringJSON-RPC protocol version.
idnumberCorrelates the response with the request.
resultobject or nullEVM block object, or null when unavailable.
result.numberstringBlock number shown in the captured example as a hex quantity.

Other block-object fields are intentionally not enumerated: the result schema permits implementation-defined properties and the fixture only guarantees number.

Errors

See Tron errors for the shared envelope.

CodeMeaningWhen it happens
-32602Invalid paramsThe selector is not a quantity or latest, or the flag is not boolean.
-32601Method not foundThe method is outside the published 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: "eth_getBlockByNumber", params: ["latest", false] }),
});
const { result: block } = await response.json();

Notes

  • Unlike current-state methods, this method accepts a hexadecimal block quantity.
  • An unavailable historical block is represented by null in the result schema.
  • There is no WebSocket block stream on the Tron product surface.