eth_getTransactionCount - Optimism

eth_getTransactionCount. returns the number of transactions sent from a specified address

eth_getTransactionCount - optimism [Value: 11CU]
Retrieves the number of transactions sent from a specified address
Use cases

Use cases

  • Retrieve total transactions count from specific address
  • Verify account activity by counting transactions
  • Audit the number of sent transactions
Constraints

Constraints

  • Requires valid address input
  • Node synchronization with blockchain required.
  • Depends on the latest blockchain state.
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_getTransactionCount","params":["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"],"id":1,"jsonrpc":"2.0"}'
 '
 
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x31"
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray of strings
array of strings
addressstring
The address for which to retrieve the transaction count.
blockNumberstring
(optional) Block number as an integer, or string
  • latest [default] - The most recent block in the blockchain (default).
  • earliest - The first block, also known as the genesis block.
  • pending - Transactions that have been broadcast but not yet included in a block.

Response

200
The number of transactions sent from the specified address, returned as a hexadecimal string.

Response params

object
idinteger
jsonrpcstring
resultarray_of_objects