Skip to main content
Ethereum API
Multichain API

eth_getTransactionCount

Summary: Returns the number of transactions sent from an address.

Parameters

Address string

hex encoded address

Pattern: ^0x[0-9a-fA-F]{40}$


Block anyOf

Block number, tag, or block hash

Block number string

Block number

Pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$

Block tag enum

earliest: The lowest numbered block the client has available; finalized: The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination; safe: The most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions; latest: The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions; pending: A sample next block built by the client on top of latest and containing the set of transactions usually taken from local mempool. Before the merge transition is finalized, any call querying for finalized or safe block MUST be responded to with -39001: Unknown block error

Enum:
"earliest"
"finalized"
"safe"
"latest"
"pending"
32 byte hex value string

32 byte hex value

Pattern: ^0x[0-9a-f]{64}$

Returns

Transaction count string

hex encoded unsigned integer

Pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$

Customize request
Parameter
Value
string
latest
anyOf
Connect your MetaMask wallet to run requests successfully.
Request
await window.ethereum.request({
"method": "eth_getTransactionCount",
"params": [
"0xc94770007dda54cF92009BFF0dE90c06F603a09f",
"latest"
],
});
Example response
"0x1"