跳至主要內容

交易

tokenview大约 2 分钟

交易

交易详情

GET https://services.tokenview.io/vipapi/tx/trx/{交易哈希}?apikey={apikey}

参数

Request

curl --location https://services.tokenview.io/vipapi/tx/trx/ec1f112ed9403372e6c4b8c54a9e6b670612634d5e7f4f9b134c2ada716b617a?apikey={apikey}

Response

{
    "code": 1,
    "msg": "成功",
    "data": {
        "blockHash": "0000000002c94a77d61344443cad0d66f4406d38c9774da98db7282b9d6eb53a",
        "tType": "Trigger Smart",
        "fee": "6.498",
        "type": "tx",
        "network": "TRX",
        "block_no": 46746231,
        "toIsContract": 1,
        "gasLimit": 40000000,
        "gasUsed": 14650,
        "netFee": 345000,
        "tokenTransfer": [
            {
                "tokenSymbol": "USDT",
                "index": 193,
                "tokenAddr": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
                "tokenInfo": {
                    "c": "TRC20",
                    "s": "USDT",
                    "d": "6",
                    "f": "Tether USD",
                    "h": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"
                },
                "token": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
                "tokenDecimals": "6",
                "from": "TRpn2AWwXLfYSVtRaxKGm5oMCPvrRyvBJv",
                "to": "TRYSAPwtYAewyUjeckH9mGJ28yuZVUDEfz",
                "value": "328530259"
            }
        ],
        "from": "TRpn2AWwXLfYSVtRaxKGm5oMCPvrRyvBJv",
        "value": "0",
        "height": 46746231,
        "gasFee": 6153000,
        "index": 193,
        "txid": "ec1f112ed9403372e6c4b8c54a9e6b670612634d5e7f4f9b134c2ada716b617a",
        "confirmations": 140,
        "input": "a9059cbb000000000000000000000000aad29988614ee7b79ff5e075e1e39d1e35d48b8d000000000000000000000000000000000000000000000000000000001394f953",
        "expiration": 1670826996,
        "time": 1670826945,
        "to": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"
    }
}

应答字段说明

{
    "code": 1,
    "msg": "成功",
    "data": {
        "blockHash": "0000000002c94a77d61344443cad0d66f4406d38c9774da98db7282b9d6eb53a",
        "tType": "Trigger Smart",
        "fee": "6.498",                        // 交易的手续费 
        "type": "tx",                          // 返回的记录类型:交易transaction
        "network": "TRX",                      // 公链符号
        "block_no": 46746231,                  // 区块高度
        "toIsContract": 1,                     // 如果出现该字段,表示to地址是合约地址
        "gasLimit": 40000000,                  // gas最大使用量
        "gasUsed": 14650,                      // 实际的gas使用量
        "netFee": 345000,
        "tokenTransfer": [           // 如果出现此tokenTransfer字段,表示此交易里包含了代币转账
            {
                "tokenSymbol": "USDT", // 代币符号symbol
                "index": 193,          // 此交易在区块里位置索引
                "tokenAddr": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", // 代币的hash地址
                "tokenInfo": {
                    "c": "TRC20",
                    "s": "USDT",                               // 代币符号 symbol
                    "d": "6",                                  // 代币精度 decimals
                    "f": "Tether USD",                         // 代币全称 name
                    "h": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"  // 代币hash地址
                },
                "token": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", // 代币名称或者hash地址
                "tokenDecimals": "6",                          // 代币精度
                "from": "TRpn2AWwXLfYSVtRaxKGm5oMCPvrRyvBJv",  // 转出代币的地址
                "to": "TRYSAPwtYAewyUjeckH9mGJ28yuZVUDEfz",    // 接收代币的地址
                "value": "328530259"                           // 转账金额(单位是代币),需要除以10的decimals次方才是真实数字
            }
        ],
        "from": "TRpn2AWwXLfYSVtRaxKGm5oMCPvrRyvBJv",  // 发起交易的地址hash(如果是转账:就是转出地址;如果是调用合约:就是调用合约的发起方的地址)
        "value": "0",                          // 转账的金额
        "height": 46746231,                    // 区块高度deprecated
        "gasFee": 6153000,
        "index": 193,                          // 此交易在区块里位置索引
        "txid": "ec1f112ed9403372e6c4b8c54a9e6b670612634d5e7f4f9b134c2ada716b617a", // 此交易的hash
        "confirmations": 140,                  // 确认数
        "input": "a9059cbb000000000000000000000000aad29988614ee7b79ff5e075e1e39d1e35d48b8d000000000000000000000000000000000000000000000000000000001394f953",
        "expiration": 1670826996,
        "time": 1670826945,                    // 区块生成时间UTC
        "to": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t" // 被动交易的地址hash(如果是转账:就是转入地址;如果是调用合约:就是被调用合约的地址)
    }
}

交易确认数

GET https://services.tokenview.io/vipapi/tx/confirmation/trx/{交易哈希}?apikey={apikey}

参数

Request

curl --location https://services.tokenview.io/vipapi/tx/confirmation/trx/ec1f112ed9403372e6c4b8c54a9e6b670612634d5e7f4f9b134c2ada716b617a?apikey={apikey}

Response

{
    "code": 1,
    "msg": "成功",
    "data": {
        "network": "TRX",
        "txId": "ec1f112ed9403372e6c4b8c54a9e6b670612634d5e7f4f9b134c2ada716b617a",
        "confirmation": 193
    }
}

应答字段说明

"data": {
        "network": "TRX", // 公链的简称
        "txId": "ec1f112ed9403372e6c4b8c54a9e6b670612634d5e7f4f9b134c2ada716b617a",   // 交易hash
        "confirmation": 193 // 此交易的确认数
    }

上次编辑于: