TriportRPC

eth_getBlockByNumber

Tron / https://triport.io/rpc/tron

Minimum tier: Free

Tron method guide

Last updated:

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

eth_getBlockByNumber parameters
NameTypeRequiredDescription
blockBlockNumberOrLatestYes
fullTransactionsbooleanYes

Returns

eth_getBlockByNumber return value
FieldType
blockobjectnull

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_getBlockByNumber","params":["<block>","<fullTransactions>"]}'
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_getBlockByNumber",
  "params": [
    "<block>",
    "<fullTransactions>"
  ]
}),
});
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_getBlockByNumber","params":["<block>","<fullTransactions>"]},
)
print(resp.json())

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Chain: Tron.
  3. Clusters: mainnet.
  4. Credit cost: 1 per call.

FAQ

What does eth_getBlockByNumber do?
Returns the EVM representation of a Tron block by quantity or latest.
How many credits does eth_getBlockByNumber cost?
eth_getBlockByNumber costs 1 credit(s) per call on Triport by default.
Is eth_getBlockByNumber available over WebSocket?
eth_getBlockByNumber is an HTTP JSON-RPC method.