eth_getBlockTransactionCountByHash - Optimism
Returns the number of transactions in a block matching the given block hash.

Parameters

  • DATA, 32 Bytes - hash of a block.
    1
    params: [
    2
    '0x02b853cf50bc1c335b70790f93d5a390a35a166bea9c895e685cc866e4961cae'
    3
    ]
    Copied!

Returns

  • QUANTITY - integer of the number of transactions in this block.
Request
Curl
Postman
1
curl https://opt-mainnet.g.alchemyapi.io/v2/your-api-key \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-d '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByHash","params":["0x02b853cf50bc1c335b70790f93d5a390a35a166bea9c895e685cc866e4961cae"],"id":0}'
Copied!
1
URL: https://opt-mainnet.g.alchemyapi.io/v2/your-api-key
2
RequestType: POST
3
Body:
4
{
5
"jsonrpc":"2.0",
6
"method":"eth_getBlockTransactionCountByHash",
7
"params":["0x02b853cf50bc1c335b70790f93d5a390a35a166bea9c895e685cc866e4961cae"],
8
"id":0
9
}
Copied!
Result
1
{
2
"jsonrpc": "2.0",
3
"id": 0,
4
"result": "0x1"
5
}
Copied!
Optimism API
Alchemy Documentation
Copy link
Contents