kaia_getBlockTransactionCountByHash
The eth_getBlockTransactionCountByHash method returns the number of transactions in a block from a block matching the given block hash. Identical to eth_getBlockTransactionCountByNumber but uses the block hash as the identifier, providing certainty about which specific block you're querying even in cases of chain reorganizations.
This method is useful for lightweight block analysis when you only need to know transaction volume without fetching full block data. Developers use this for statistics gathering, monitoring network activity, and determining whether to fetch full block details. Using the block hash ensures you're querying a specific immutable block, making this method reliable even after chain reorganizations where block numbers might refer to different blocks.
Parameters
parameter | type | description |
|---|---|---|
blockHash | string (required) | Hash of the block (32 bytes) |
Return Object
field | type | description |
|---|---|---|
result | string | The number of transactions in the block encoded as a hexadecimal string |
Request Example
Response Example