eth_getBlockTransactionCountByHash

Returns the number of transactions in the block with the given block hash.

Parameters

Object NameRequiredTypeDetail
BLOCK HASHStringHash of a block.
"params": [
    "0xef0c14940f208ee5d2928d4a46828e29e40bc0cfe260fe65f5c98f957e844730"
]

Result

A hex code of an integer that represents the number of transactions in the block.

Example

Request

curl <your-endpoint> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHash","params": ["0xef0c14940f208ee5d2928d4a46828e29e40bc0cfe260fe65f5c98f957e844730"],"id":1}'

Return

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": "0xcb"
}
Language
Click Try It! to start a request and see the response here!