Skip to content

eth_getTransactionCount

Returns the number of transactions sent from an address. The value is the account nonce — pass it as nonce when constructing the next transaction.

On a Flashblocks endpoint (https://mainnet-preconf.base.org), querying with "pending" returns the nonce inclusive of every pre-confirmed transaction and refreshes every ~200ms. This eliminates nonce gaps when an agent submits transactions at high frequency.

NameTypeRequiredDescription
addressstringYesThe 20-byte address to query.
blockstringYesA block number in hex, or one of "latest", "pending", "safe", "finalized", "earliest". Use "pending" against a Flashblocks endpoint to include all pre-confirmed transactions in the count.
FieldTypeDescription
resultstringThe transaction count (nonce) as a hexadecimal string.
Terminal window
curl https://mainnet.base.org \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": ["0x742d35Cc6634C0532925a3b8D4C9dD0b4f3BaEa", "latest"],
"id": 1
}'

Request (Flashblocks pending nonce, ~200ms)

Section titled “Request (Flashblocks pending nonce, ~200ms)”
Terminal window
curl https://mainnet-preconf.base.org \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": ["0x742d35Cc6634C0532925a3b8D4C9dD0b4f3BaEa", "pending"],
"id": 1
}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x4d2"
}