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.

相关方法