L0vdL0vd

eth_getTransactionCount

Returns the number of transactions sent from an address (its nonce) at a given block.

Архив · Работает на любом прошлом блоке

curl https://eth.l0vdinfra.com/YOUR_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionCount","params":["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","0x1208a5f"]}'

Пример ответа

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x4a3"
}
Параметры и свой эндпоинт

Параметры

addressstringобязательный
20-byte address, hex encoded.
blockstringобязательный
Block number in hex (e.g. "0x1208a5f") or a tag: "latest", "safe", "finalized", "earliest" or "pending". L0vd endpoints run archive nodes, so any historical block works.

Возвращает

string Nonce, hex encoded.

Когда использовать

Get the nonce of an address: how many transactions it has sent up to and including the given block.

Compare two blocks to count an account's outgoing transactions in a period, or detect whether a wallet was active at all.

Как читать ответ

Hex integer. 0x1 means one transaction sent. For contracts it counts contracts created by that contract (EIP-161).

Советы

  • Use "pending" only when you are about to sign a new transaction; for analytics use a fixed block number so the answer never changes.
  • The nonce counts sent transactions only. Received transfers do not change it.

Связанные методы