Skip to main content

eth_getTransactionCount

Returns the nonce of an account in the state. NOTE: The name eth_getTransactionCount reflects the historical fact that an account's nonce and sent transaction count were the same. After the Pectra fork, with the inclusion of EIP-7702, this is no longer true.

Params

(2)

1. Address (required)

string
Match pattern:
^0x[0-9a-fA-F]{40}$

2. Block (required)

(any of)
string
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$

Result

(Account nonce)
string
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$

Example

Request

await window.ethereum.request({
"method": "eth_getTransactionCount",
"params": [
"0xc94770007dda54cF92009BFF0dE90c06F603a09f",
"latest"
]
});

Result

"0x1"

Params

Address

Block


Request

await window.ethereum.request({
"method": "eth_getTransactionCount",
"params": [
null,
null
]
});