eth_getBlockTransactionCountByNumber - Optimism

eth_getBlockTransactionCountByNumber. Retrieves the number of transactions in a block identified by its number

eth_getBlockTransactionCountByNumber - optimism [Value: 11CU]
Retrieves the number of transactions in a block specified by its block number
Use cases

Use cases

  • Retrieve transaction count by block number
  • Validate transaction density
  • Analyze blockchain activity trends
Constraints

Constraints

  • Requires valid and specific block number
  • Dependent on node synchronization
  • Limited by network latency
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl https://optimism.drpc.org \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_getBlockTransactionCountByNumber","params":["0xc5043f"],"id":1,"jsonrpc":"2.0"}'
'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xfe"
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray of strings
array of strings
blockNumberstring
The block number or tag ("latest", "earliest", "pending") at which to get the balance.
  • latest [default] - The most recent block in the blockchain (default).
  • safe - A block that has been validated by the beacon chain.
  • finalized - a block confirmed by over two-thirds of validators
  • earliest - A block approved by more than two-thirds of the validators.
  • pending - Transactions that have been broadcast but not yet included in a block.

Response

200
The number of transactions in the specified block.

Response params

object
idinteger
jsonrpcstring
resultstring