Avalanche
Avalanche
Avalanche
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_getBlockByHash returns the full block data for the Avalanche C-Chain block identified by a given 32-byte hash — header fields, gas metrics, AVAX-denominated base fee, and either transaction hashes or full transaction objects. It is the hash-keyed companion to eth_getBlockByNumber, useful when you already hold a block hash and want a definite, reorg-proof reference. Send the hash to https://avalanche.therpc.io/YOUR_API_KEY (chain ID 43114); an unknown hash returns null.
blockHash from a C-Chain transaction receipt.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | 是 | The hash of the block to retrieve. |
| 2 | includeTransactions | boolean | 是 | When true, transactions[] contains full transaction objects. When false, only hashes. |
| 类型 | 描述 |
|---|---|
| object | null | Block object with fields: number, hash, parentHash, timestamp, miner, gasUsed, gasLimit, baseFeePerGas, transactions, uncles, withdrawals, stateRoot, receiptsRoot, transactionsRoot, logsBloom, extraData, size, difficulty, totalDifficulty, mixHash, nonce, sha3Uncles. Returns null if no block was foun |
Try it live in the Avalanche playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | Invalid params | Block hash is malformed or not 32 bytes. |
includeTransactions, not the string "true" — JSON-RPC requires the actual boolean type or the request is rejected.includeTransactions=true, a busy C-Chain block can exceed 1 MB; stream or paginate if bandwidth is tight.null, not an error — always null-check the result before reading fields.参数
0x-prefixed 32-byte block hash
true = full tx objects, false = tx hashes only