查询上链交易结果
GET
/v3/native/tx/{operation_id}根据在接口请求时自定义的 Operation ID ,查询相关的链上操作结果。每笔交易会产生唯一的 Operation ID,根据 Operation ID,可以查询具体的交易结果,包含交易状态、交易信息及交易详情。 Operation ID 的值为原 Task ID 对应的值,建议程序中尽早将 Task ID 替换为 Operation ID。
当前支持查询当月及上个月的交易结果,其它月历史数据已归档,暂不支持查询对应结果。
注意:
若查询出的链上操作结果 status 为 2(失败),请在业务侧做容错处理。可以参考接口返回的 message(交易失败的错误描述信息) 对 NFT / MT / 业务接口的请求参数做适当调整后,使用「新的 Operation ID 」 重新发起 NFT / MT / 业务接口请求。
请求参数
固定值:application/json
项目 API Key,用于 API 访问鉴权
时间戳,1970年1月1日0点0分0秒到现在的毫秒数
API 签名,算法为SHA256(Params+Timestamp+ApiSecret)
示例代码
返回响应
交易模块: 请通过 查询枚举值列表 接口查看
操作类型:请通过 查询枚举值列表 接口查看
交易状态: 0 处理中; 1 成功; 2 失败; 3 未处理
交易状态说明:
- status 为 0(处理中),上链请求正在处理,请等待处理完成;
- status 为 1(成功),交易已上链并执行成功;
- status 为 2(失败),说明该交易执行失败。请在业务侧做容错处理。
- status 为 3(未处理),上链请求还在等待处理,请稍等;
当交易状态:2 失败,可以参考接口返回的 message(交易失败的错误描述信息) 对 请求参数做适当调整后,使用「新的 Operation ID 」重新发起交易请求。
对应不同操作类型的消息体,下方的 Key 只作为展示用, 实际返回中不存在该 Key, 只返回对应数据
对应不同操作类型的消息体,下方的 Key 只作为展示用, 实际返回中不存在该 Key, 只返回对应数据
对应不同操作类型的消息体,下方的 Key 只作为展示用, 实际返回中不存在该 Key, 只返回对应数据
{
"data": {
"module": 0,
"operation": 0,
"tx_hash": "string",
"status": 0,
"message": "string",
"block_height": "string",
"timestamp": "string",
"nft": {
"issue_class": {
"class_id": "string"
},
"transfer_class": {
"class_id": "string"
},
"mint": {
"id": "string",
"class_id": "string"
},
"edit": {
"id": "string",
"class_id": "string"
},
"transfer": {
"id": "string",
"class_id": "string"
},
"burn": {
"id": "string",
"class_id": "string"
},
"mint_nft_batch": {
"id": "string",
"class_id": "string"
},
"edit_nft_batch": {
"id": "string",
"class_id": "string"
},
"transfer_nft_batch": {
"id": "string",
"class_id": "string"
},
"burn_nft_batch": {
"id": "string",
"class_id": "string"
}
},
"mt": {
"issue_class": {
"class_id": "string"
},
"transfer_class": {
"class_id": "string"
},
"issue": {
"mt_id": "string",
"class_id": "string"
},
"mint": {
"mt_id": "string",
"class_id": "string"
},
"edit": {
"mt_id": "string",
"class_id": "string"
},
"transfer": {
"mt_id": "string",
"class_id": "string"
},
"burn": {
"mt_id": "string",
"class_id": "string"
}
},
"record": {
"create_record": {
"record_id": "string",
"certificate_url": "string"
}
}
}
}