BNB Smart Chain
BNB Smart Chain
BNB Smart Chain
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
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.
| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | 是 | The hash of the block to count transactions in. |
| 类型 | 描述 |
|---|---|
| string (hex) | Hex-encoded transaction count. "0x0" means the block is empty. |
Try it live in the BNB Smart Chain playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-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.参数
0x-prefixed 32-byte block hash