BNB Smart Chain
BNB Smart Chain
BNB Smart Chain
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Given a 32-byte block hash, eth_getBlockByHash returns the full record of that BNB Smart Chain block: header fields, gas accounting, plus either transaction hashes or whole transaction objects. BSC is a PoSA-secured EVM that pays fees in BNB, and its validators seal blocks with no uncles. A hash therefore pins one canonical block and nothing else. Send the lookup to https://bsc.therpc.io/YOUR_API_KEY at chain ID 56. You get that exact block's contents back, or null when no block carries the supplied hash.
blockHash from a transaction receipt, into the full block record.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 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 BNB Smart Chain playground.
| الكود | الرسالة | السبب |
|---|---|---|
-32602 | Invalid params | Block hash is malformed or not 32 bytes. |
includeTransactions flag must be a JSON boolean, true or false, never the quoted string "true", or the node rejects the params.true, a full block from a busy BSC slot can run past 1 MB. Stream the response or fall back to hash-only mode where bandwidth is tight.null, not an error, so null-check the result before reading any field off it.المعاملات
0x-prefixed 32-byte block hash
true = full tx objects, false = tx hashes only