上链交易结果查询
GET
/v2/tx/{operation_id}根据在接口请求时自定义的 Operation ID ,查询相关的链上操作结果。每笔交易会产生唯一的 Operation ID,根据 Operation ID,可以查询具体的交易结果,包含交易状态、交易信息及交易详情。
当前支持查询当月及上个月的交易结果,其它月历史数据已归档,暂不支持查询对应结果。
注意:若查询出的链上操作结果 status 为 2(失败),请在业务侧做容错处理。可以参考接口返回的 message(交易失败的错误描述信息) 对接口的请求参数做适当调整后,使用「新的 Operation ID 」重新发起接口请求。
请求参数
Path 参数
operation_id
string
必需
操作 ID,是指用户在进行具体的业务接口请求时,自定义的操作ID。注意:如果是创建链账户/批量创建链账户的操作 ID,不可通过此接口查询上链交易结果,须前往查询链账户接口进行查询。
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
data
object
必需
module
integer
必需
交易模块: 1 nft;2 ns 域名;3 record 存证;4 合约调用;
operation
integer
必需
用户操作类型
- module = 1 时,可选: 1:issue_class; 2:transfer_class; 3:mint_nft; 4:edit_nft; 5:burn_nft; 6:transfer_nft;
- modele = 2 时,可选: 1:create_domain; 2:transfer_domain
tx_hash
string
交易哈希
status
integer
必需
交易状态, 0 处理中; 1 成功; 2 失败; 3 未处理
交易状态说明:
- status 为 0(处理中),上链请求正在处理,请等待处理完成;
- status 为 1(成功),交易已上链并执行成功;
- status 为 2(失败),说明该交易执行失败。请在业务侧做容错处理。
- status 为 3(未处理),上链请求还在等待处理,请稍等;
message
string
可选
交易失败的错误描述信息
block_height
integer
交易上链的区块高度
timestamp
string
可选
交易上链时间(UTC 时间)
nft
object
可选
对应不同操作类型的消息体,下方的 Key 只作为展示用, 实际返回中不存在该 Key, 只返回对应数据
ns
object
可选
对应不同操作类型的消息体,下方的 Key 只作为展示用, 实际返回中不存在该 Key, 只返回对应数据
record
object
可选
对应不同操作类型的消息体,下方的 Key 只作为展示用, 实际返回中不存在该 Key, 只返回对应数据
示例
{
"data": {
"module": 0,
"operation": 0,
"tx_hash": "string",
"status": 0,
"message": "string",
"block_height": 0,
"timestamp": "string",
"nft": {
"issue_class": {
"class_id": "string"
},
"transfer_class": {
"class_id": "string"
},
"mint": {
"class_id": "string",
"id": "string"
},
"edit": {
"class_id": "string",
"id": "string"
},
"transfer": {
"class_id": "string",
"id": "string"
},
"burn": {
"class_id": "string",
"id": "string"
}
},
"ns": {
"create_domain": {
"name": "string",
"owner": "string",
"node": "string",
"expires": 0
},
"transfer_domain": {
"name": "string",
"owner": "string",
"node": "string",
"expires": 0
}
},
"record": {
"create_record": {
"record_id": 0,
"certificate_url": "string"
}
}
}
}
最后修改时间: 1 年前