eth_getBlockByNumber
Tron / https://triport.io/rpc/tron
Minimum tier: Free
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
| Name | Type | Required | Description |
|---|---|---|---|
| block | BlockNumberOrLatest | Yes | |
| fullTransactions | boolean | Yes |
Returns
| Field | Type |
|---|---|
| block | objectnull |
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
- Transport: HTTP (JSON-RPC).
- Chain: Tron.
- Clusters: mainnet.
- 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.