Ethereum
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Ethereum
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_getBlockByHash returns the full block that matches a 32-byte hash on Ethereum mainnet. A block hash uniquely pins one block, so unlike a height it survives reorgs cleanly — the hash either exists in your view of the chain or it doesn't. The response carries the header (parent hash, timestamp, miner/proposer, state and receipts roots), the EIP-1559 baseFeePerGas, gas metrics, the post-Merge withdrawals list, and either full transaction objects or just their hashes depending on the second argument. Send it to https://ethereum.therpc.io/YOUR_API_KEY (chain ID 1, native coin ETH). An unknown hash yields null.
blockHash; this turns it into the full block context.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 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 Ethereum playground.
| الكود | الرسالة | السبب |
|---|---|---|
-32602 | Invalid params | Block hash is malformed or not 32 bytes. |
"true" makes some nodes reject the request or treat it as false — send JSON true/false, not quoted text.true, a full mainnet block packed with Uniswap and transfer activity can push the response past 1 MB. Stream or fetch hashes only and pull transactions on demand if bandwidth matters.null, not an error. Null-check before reading .number or .transactions, or you'll throw on a missing block.المعاملات
0x-prefixed 32-byte block hash
true = full tx objects, false = tx hashes only