transaction/getstatus - 获取指定交易的执行状态
使用transaction模块的getstatus方法获取指定交易的执行状态。
API定义
GET|POST /api
查询|表单参数:
- module:transaction
- action:getstatus
- txhash:要查询执行状态的交易哈希
- apikey:etherscan的API密钥
API返回结果
返回结果为一个JSON对象,主要字段如下:
- status:状态码,1为成功
- message:调用描述信息,OK为成功
- result:调用结果对象,包含如下字段:
- isError:是否错误,0 - 无错误,1 - 有错误
- errDescription:错误描述信息
示例代码
以curl为例的示例代码如下,也可以直接点击这里查看浏览器中的调用结果:
~$ curl https://api.etherscan.io/api?module=transaction&action=getstatus&txhash=0x15f8e5ea1079d9a0bb04a4c58ae5fe7654b5b2b4463375ff7ffb490aa0032f3a&apikey=YourApiKeyToken
返回结果:
{
"status": "1",
"message": "OK",
"result": {
"isError": "1",
"errDescription": "Bad jump destination"
}
}