proxy/eth_getTransactionCount - 获取指定地址的交易数量
使用proxy模块的eth_getTransactionCount方法获取地址的交易数量。
API调用
GET|POST /api
查询|表单参数:
- module:proxy
- action:eth_getTransactionCount
- address:要查询的以太坊地址
- tag:区块编号,特殊值latest表示最新区块
- index:交易序号
- apikey:etherscan API密钥
API返回结果
返回结果为一个JSON对象,主要字段如下:
- jsonrpc:RPC版本号,2.0
- id:RPC请求编号
- result:调用结果为指定地址发生的交易总数量
示例代码
以curl为例的调用代码如下,也可以点击这里查看浏览器中的运行结果:
~$ curl https://api.etherscan.io/api?module=proxy&action=eth_getTransactionCount&address=0x2910543af39aba0cd09dbb2d50200b3e800a63d2&tag=latest&apikey=YourApiKeyToken
返回结果如下:
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xaf5d"
}