Avalanche
Avalanche
Avalanche
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_getBlockTransactionCountByHash returns the number of transactions in the Avalanche C-Chain block identified by a given 32-byte hash. It is a lightweight (1 CU) lookup — you learn how full a block is without pulling its full body or any transaction data. On the C-Chain, where gas is paid in AVAX and blocks finalize in roughly one to two seconds, this is handy for gauging activity cheaply. Send the hash to https://avalanche.therpc.io/YOUR_API_KEY (chain ID 43114); the count comes back as a hex string like "0x0" for an empty block.
| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 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 Avalanche playground.
| الكود | الرسالة | السبب |
|---|---|---|
-32602 | Invalid params | Block hash is malformed or not 32 bytes. |
null, not "0x0" — null-check before running parseInt, or you will misread a missing block as an empty one.eth_getBlockTransactionCountByNumber instead.المعاملات
0x-prefixed 32-byte block hash