eth_getTransactionCount
The eth_getTransactionCount method returns the number of transactions sent from an address (the account nonce) on the Optimism network. This method is essential for creating new transactions as the nonce must be correctly set to ensure proper transaction ordering and prevent replay attacks. Wallets use this to determine the next nonce value when constructing and signing new transactions.
Parameters
parameter | type | description |
|---|---|---|
address | string (required) | The address to get transaction count for (20 bytes) |
blockParameter | string (required) | Block number in hex or tag (latest, earliest, pending) |
Return Object
The method returns the transaction count (nonce) as a hexadecimal string.
Request Example
Request
Response Example
Response