eth_getTransactionCount
Method
- JSON-RPC method name:
eth_getTransactionCount - JSON-RPC version:
2.0
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| Address | string | yes | |
| Block | anyOf | yes |
Parameter schema
{
"Address": {
"required": true,
"schema": {
"title": "hex encoded address",
"type": "string",
"pattern": "^0x[0-9a-fA-F]{40}$"
}
},
"Block": {
"required": true,
"schema": {
"title": "Block number, tag, or block hash",
"anyOf": [
{
"title": "Block number",
"type": "string",
"pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$"
},
{
"title": "Block tag",
"type": "string",
"enum": [
"earliest",
"finalized",
"safe",
"latest",
"pending"
],
"description": "`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"
},
{
"title": "Block hash",
"type": "string",
"pattern": "^0x[0-9a-f]{64}$"
}
]
}
}
}
Result
- Name:
Transaction count - Type:
string
Result schema
{
"title": "hex encoded unsigned integer",
"type": "string",
"pattern": "^0x([1-9a-f]+[0-9a-f]*|0)$"
}
Positional parameters
Parameter order:
AddressBlock
Errors
This method may return JSON-RPC standard errors (e.g. -32600, -32601, -32602, -32603) as well as application-specific errors.
TODO: Document method-specific error codes and conditions.