美文网首页区块链研习社互联网科技区块链大学
BlockDog API 查询 EOS 交易详情 - 区块链数据

BlockDog API 查询 EOS 交易详情 - 区块链数据

作者: 极客红石 | 来源:发表于2019-05-25 22:31 被阅读29次

    简介:BlockDog 方块狗是公鹿钱包团队推出的网站。他们借用这个网站提供公共 API 服务以方便 EOS 开发者进行 EOS 相关开发。本文整理使用 BlockDog API 查询 EOS 交易详情。

    BlockDog 方块狗是公鹿钱包团队推出的网站。他们借用这个网站提供公共 API 服务以方便 EOS 开发者进行 EOS 相关开发。

    本文整理使用 BlockDog API 查询 EOS 交易详情。

    BlockDog API 官方文档:https://open-api.eos.blockdog.com/

    使用 BlockDog API 需要申请 apikey//www.blockdog.com/openApi

    免费版 apikey 支持 HTTPS API 调用频次≤3次/秒,WebSocket API 订阅合约/账户调用峰值≤3次。

    BlockDog API 查询 EOS 交易详情:

    Node.js 示例:

    let request = require("request");
    
    let options = { method: 'POST',
        url: 'https://open-api.eos.blockdog.com/v1/third/get_transaction',
        headers:
            { 'content-type': 'application/json',
                apikey: '5b4added-e80c-41fb-b5a9-16269d2de79b',
                accept: 'application/json;charset=UTF-8' },
        body: '{"id":"7ad3ca0f4589ee808a10f67c0c525ad3df8d6b780ad0927bea796b8e51dc72cf"}' };
    
    request(options, function (error, response, body) {
        if (error) throw new Error(error);
    
        console.log(body);
    });
    

    返回的 JSON 示例:

    {
        "id": "7ad3ca0f4589ee808a10f67c0c525ad3df8d6b780ad0927bea796b8e51dc72cf",
        "block_num": 54076814,
        "block_time": "2019-04-21T05:16:45.000",
        "producer_block_id": "0339258ebd8fe3f2c8e656747d3299848216a921dde74ed243fe1c80ae1577d7",
        "receipt": {
            "status": "executed",
            "cpu_usage_us": 842,
            "net_usage_words": 1069
        },
        "elapsed": 1733,
        "net_usage": 8552,
        "scheduled": false,
        "action_traces": [{
            "receipt": {
                "receiver": "eosio",
                "act_digest": "0a221b79814f0d01f28362e71512f383c4f86b225e6778f9ae9dc02edfe71055",
                "global_sequence": "6342722693",
                "recv_sequence": 63781550,
                "auth_sequence": [
                    ["eospokefund1", 10]
                ],
                "code_sequence": 11,
                "abi_sequence": 13
            },
            "act": {
                "account": "eosio",
                "name": "setcode",
                "authorization": [{
                    "actor": "eospokefund1",
                    "permission": "active"
                }],
                "data": {
                    "account": "eospokefund1",
                    "vmtype": 0,
                    "vmversion": 0,
                    "code": "/*此处省略*/"
                },
                "hex_data": "/*此处省略*/"
            },
            "context_free": false,
            "elapsed": 1510,
            "console": "",
            "trx_id": "7ad3ca0f4589ee808a10f67c0c525ad3df8d6b780ad0927bea796b8e51dc72cf",
            "block_num": 54076814,
            "block_time": "2019-04-21T05:16:45.000",
            "producer_block_id": "0339258ebd8fe3f2c8e656747d3299848216a921dde74ed243fe1c80ae1577d7",
            "account_ram_deltas": [{
                "account": "eospokefund1",
                "delta": -60
            }],
            "except": null,
            "inline_traces": []
        }, {
            "receipt": {
                "receiver": "eosio",
                "act_digest": "15f71943f8d448d1dddbf956d8b17bebc73a51b883821588fed77e166840e1e5",
                "global_sequence": "6342722694",
                "recv_sequence": 63781551,
                "auth_sequence": [
                    ["eospokefund1", 11]
                ],
                "code_sequence": 11,
                "abi_sequence": 13
            },
            "act": {
                "account": "eosio",
                "name": "setabi",
                "authorization": [{
                    "actor": "eospokefund1",
                    "permission": "active"
                }],
                "data": {
                    "account": "eospokefund1",
                    "abi": "/*此处省略*/"
                },
                "hex_data": "/*此处省略*/"
            },
            "context_free": false,
            "elapsed": 126,
            "console": "",
            "trx_id": "7ad3ca0f4589ee808a10f67c0c525ad3df8d6b780ad0927bea796b8e51dc72cf",
            "block_num": 54076814,
            "block_time": "2019-04-21T05:16:45.000",
            "producer_block_id": "0339258ebd8fe3f2c8e656747d3299848216a921dde74ed243fe1c80ae1577d7",
            "account_ram_deltas": [],
            "except": null,
            "inline_traces": []
        }],
        "except": null
    }
    

    BlockDog API 服务思维导图:

    BlockDog API.png

    我们有一个区块链知识星球,做区块链前沿资料的归纳整理以方便大家检索查询使用,也是国内顶尖区块链技术社区,欢迎感兴趣的朋友加入。如果你对上面内容有疑问,也可以加入知识星球提问我:

    区块链社群 知识星球

    相关文章

      网友评论

        本文标题:BlockDog API 查询 EOS 交易详情 - 区块链数据

        本文链接:https://www.haomeiwen.com/subject/bcsjgqtx.html