eth_getBlockTransactionCountByNumber - Optimistic Ethereum


Summary

Returns the number of transactions in a block matching the given block number.

Parameters

1. Block Number Quantity or Tag

Hex block number, or the string latest, earliest or pending
Example: i.e. latest or pending

Code Examples

eth_getBlockTransactionCountByNumber request
curl https://optimism.gateway.tenderly.co/$TENDERLY_NODE_ACCESS_KEY \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "eth_getBlockTransactionCountByNumber",
  "params": [
    "latest"
  ]
}'
eth_getBlockTransactionCountByNumber response
{
  "id": 0,
  "jsonrpc": "2.0",
  "result": "0xa"
}