Skip to content

eth_getBlockTransactionCountByHash


Returns a hex string representing the number of transactions in a block from a block matching the given block hash.

Parameters

Block hash

A block hash, as a hex number in a JSON string eg. "0xf77e76c25038b0be1fbd12a4f3e404173802bf0c9a9e62deef7949201d59ebfb"

Result

A count as a hex string, or null if the block with this hash is not known to this node.

Example Request

curl -d '{
    "id": "1",
    "jsonrpc": "2.0",
    "method": "eth_getBlockTransactionCountByHash",
    "params": [ "0x4f8547a34d79cafc135cf7c88e994321cd696ab54f00ab0fc8ecf209bf285bb4" ]}' -H "Content-Type: application/json" -X POST "https://api.zq2-prototestnet.zilliqa.com/"

Example response

{"jsonrpc":"2.0","result":"0x1","id":"1"}

Arguments

Parameter Type Required Description
id string Required "1"
jsonrpc string Required "2.0"
method string Required "eth_getBlockByHash"
params array Required [ block_hash ] (*)

(*) Note that, although the Ethereum API docs claim that the block hash parameter is optional, it is mandatory in at least erigon and geth, and also in zq2.