BNB Smart Chain
BNB Smart Chain
BNB Smart Chain
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
eth_getBlockTransactionCountByHash answers a single question about a BNB Smart Chain block: how many transactions it contains, looked up by the block's 32-byte hash. It skips the payload entirely and just returns the tally as hex. BNB Smart Chain is the BNB-gas, PoSA-validator EVM, so this count reflects exactly what one canonical, uncle-free block sealed. Send the hash to https://bsc.therpc.io/YOUR_API_KEY at chain ID 56 and you get back that number alone — a cheap way to gauge how busy the block was.
| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | Ja | The hash of the block to count transactions in. |
| Typ | Beschreibung |
|---|---|
| string (hex) | Hex-encoded transaction count. "0x0" means the block is empty. |
Try it live in the BNB Smart Chain playground.
| Code | Meldung | Ursache |
|---|---|---|
-32602 | Invalid params | Block hash is malformed or not 32 bytes. |
null rather than an error, so null-check before you feed the result into parseInt.eth_getBlockTransactionCountByNumber is the simpler counterpart to reach for.Parameter
0x-prefixed 32-byte block hash