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