Avalanche
Avalanche
Avalanche
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
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.
| # | 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 Avalanche playground.
| Code | Meldung | Ursache |
|---|---|---|
-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.Parameter
0x-prefixed 32-byte block hash