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