BNB Smart Chain
BNB Smart Chain
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
BNB Smart Chain
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
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.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | Sí | The hash of the block to retrieve. |
| 2 | includeTransactions | boolean | Sí | When true, transactions[] contains full transaction objects. When false, only hashes. |
| Tipo | Descripción |
|---|---|
| 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.
| Código | Mensaje | Causa |
|---|---|---|
-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.Parámetros
0x-prefixed 32-byte block hash
true = full tx objects, false = tx hashes only