Avalanche
Avalanche
Avalanche
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_getBlockByNumber returns the block data for an Avalanche C-Chain block at a given height or named tag such as latest or finalized. You get the full header — timestamp, gas usage, the AVAX-denominated base fee — plus either transaction hashes or full transaction objects. It is the height-keyed way to walk the C-Chain, and because Snowman finality lands in roughly one to two seconds, the finalized tag is rarely far behind latest. Query https://avalanche.therpc.io/YOUR_API_KEY (chain ID 43114).
latest block for a real-time Avalanche monitoring dashboard; at ~1–2s block times it refreshes quickly.finalized block to anchor queries that must be reorg-safe under Snowman consensus.includeTransactions=false) before fetching receipts in bulk.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | blockTag | string | 是 | The block to retrieve. |
| 2 | includeTransactions | boolean | 是 | When true, transactions[] contains full transaction objects. When false, only hashes. |
| 类型 | 描述 |
|---|---|
| object | null | Same block object as eth_getBlockByHash. Returns null if the block does not exist. |
Try it live in the Avalanche playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | Invalid params | Block number is malformed or block tag is unrecognised. |
includeTransactions, not the string "true" — the JSON-RPC type check will reject a quoted value.eth_getBlockReceipts over N individual eth_getTransactionReceipt calls — far fewer round trips against the C-Chain.includeTransactions=true, the response can reach 1–2 MB for a heavily loaded C-Chain block; budget bandwidth accordingly.参数
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"
true = full tx objects, false = tx hashes only