Avalanche
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Avalanche
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
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.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | blockTag | string | Sí | The block to retrieve. |
| 2 | includeTransactions | boolean | Sí | When true, transactions[] contains full transaction objects. When false, only hashes. |
| Tipo | Descripción |
|---|---|
| object | null | Same block object as eth_getBlockByHash. Returns null if the block does not exist. |
Try it live in the Avalanche playground.
| Código | Mensaje | Causa |
|---|---|---|
-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.Parámetros
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"
true = full tx objects, false = tx hashes only