跳至主要內容

工具

tokenview大约 2 分钟

工具

BCH 地址格式转化

GET https://services.tokenview.io/vipapi/utils/cashaddr/{新格式/经典格式}?apikey={apikey}

参数

备注

  • 地址无效,返回 40001 代码;
  • 地址有效,返回新格式地址和老格式地址如下:
    • cashAddress: 新格式地址
    • legacyAddress: 经典格式地址

Request

curl --location https://services.tokenview.io/vipapi/utils/cashaddr/qzu9xxpgkkwnu3y00exnn3n5hpr355hrf55fyq3nw5?apikey={apikey}

Response

{
    "code": 1,
    "msg": "成功",
    "data": {
        "legacyAddress": "1Hocso77yXCtCLBQavyVkZaoLSAh5wLVb4",
        "cashAddress": "bitcoincash:qzu9xxpgkkwnu3y00exnn3n5hpr355hrf55fyq3nw5"
    }
}

DCR/HC 买票&投票&退票

GET https://services.tokenview.io/vipapi/dcr/address/{ticket|vote|revocation}/{地址}/{页码}/{每页交易条数}?apikey={apikey}

参数

  • {ticket|vote|revocation}: ticket 或 vote 或 revocation
  • {地址}:DCR地址或HC地址;
  • {页码}:1,2,3,... 50,最多50页;
  • {每页交易条数}:1,2,3...50,每页交易条数,最多50条。
  • {apikey}: 可在Tokenview API 后台管理系统获取激活状态的 APIKEY: https://services.tokenview.ioopen in new window
描述:DCR/HC 相较于BTC,有一个 Stake 机制,Stake 机制是通过三种特殊交易运作:Ticket,Vote,Revocation。
解释:
  • Ticket: 用户买票的交易。
  • Vote: 用户投票成功,获取 stake 收益的交易。
  • Revocation: 用户投票没有被选中,直到选票过期,选票会被退回,相当于退款交易,不能获取stake收益。

Request

curl --location https://services.tokenview.io/vipapi/dcr/address/ticket/DsUNkwKT7DnAKbzRUQW1SPFwfgVnhJq7d8C/1/10?apikey={apikey}

Response

{
  "code": 1,
  "msg": "成功",
  "data": [
    {
      "type": "address",
      "network": "DCR",
      "hash": "DsUNkwKT7DnAKbzRUQW1SPFwfgVnhJq7d8C",
      "txCount": 2,
      "spend": "-260.63145548",
      "receive": "0",
      "normalTxCount": 0,
      "txs": [
        {
          "type": "tx",
          "network": "DCR",
          "block_no": 369192,
          "height": 369192,
          "index": 13,
          "time": 1565345611,
          "txid": "63043d08e4975c9fd5d448050b57e0f62bc78f7d64d02f86f36c14737b9c8f95",
          "fee": "0.0000542",
          "tType": "Ticket",
          "confirmations": 172086,
          "inputs": [
            {
              "input_no": 0,
              "address": "DsUNkwKT7DnAKbzRUQW1SPFwfgVnhJq7d8C",
              "value": "0.05011177",
              "received_from": {
                "output_no": 2,
                "txid": "1e0c61d5e4f6952b16088e6904b2603438c791ba878b34a5bae5f79f90ecbe32"
              }
            },
            {
              "input_no": 1,
              "address": "DsUNkwKT7DnAKbzRUQW1SPFwfgVnhJq7d8C",
              "value": "130.26561597",
              "received_from": {
                "output_no": 3,
                "txid": "1e0c61d5e4f6952b16088e6904b2603438c791ba878b34a5bae5f79f90ecbe32"
              }
            }
          ],
          "outputs": [
            {
              "output_no": 0,
              "address": "DcgbJdGsCBuoQm6TuiuAWjWYoKBHxfAJmVN",
              "value": "130.31567354"
            },
            {
              "output_no": 1,
              "address": "DsSkjK6HdBGvGjCWV5koYL1ffRCsGUqoXK1",
              "value": "0.0"
            },
            {
              "output_no": 2,
              "address": "DsQxuVRvS4eaJ42dhQEsCXauMWjvopWgrVg",
              "value": "0.0"
            },
            {
              "output_no": 3,
              "address": "DsjD4PRqKttH6s3E6XTVKLpc6PdWjWFcuKL",
              "value": "0.0"
            },
            {
              "output_no": 4,
              "address": "DsQxuVRvS4eaJ42dhQEsCXauMWjvopWgrVg",
              "value": "0.0"
            }
          ],
          "inputCnt": 2,
          "outputCnt": 5
        },
        {
          "type": "tx",
          "network": "DCR",
          "block_no": 369192,
          "height": 369192,
          "index": 15,
          "time": 1565345611,
          "txid": "db6837c66ee53cbbe6090f02f5086005ae23e7e59fec58f5b02810f7ee9fd9c7",
          "fee": "0.0000542",
          "tType": "Ticket",
          "confirmations": 172086,
          "inputs": [
            {
              "input_no": 0,
              "address": "DsUNkwKT7DnAKbzRUQW1SPFwfgVnhJq7d8C",
              "value": "0.05011177",
              "received_from": {
                "output_no": 0,
                "txid": "1e0c61d5e4f6952b16088e6904b2603438c791ba878b34a5bae5f79f90ecbe32"
              }
            },
            {
              "input_no": 1,
              "address": "DsUNkwKT7DnAKbzRUQW1SPFwfgVnhJq7d8C",
              "value": "130.26561597",
              "received_from": {
                "output_no": 1,
                "txid": "1e0c61d5e4f6952b16088e6904b2603438c791ba878b34a5bae5f79f90ecbe32"
              }
            }
          ],
          "outputs": [
            {
              "output_no": 0,
              "address": "DcgbJdGsCBuoQm6TuiuAWjWYoKBHxfAJmVN",
              "value": "130.31567354"
            },
            {
              "output_no": 1,
              "address": "DsSkjK6HdBGvGjCWV5koYL1ffRCsGUqoXK1",
              "value": "0.0"
            },
            {
              "output_no": 2,
              "address": "DsQxuVRvS4eaJ42dhQEsCXauMWjvopWgrVg",
              "value": "0.0"
            },
            {
              "output_no": 3,
              "address": "Dsn9qkguiAF1VAECaWv2dzyicBGhEr6DmPE",
              "value": "0.0"
            },
            {
              "output_no": 4,
              "address": "DsQxuVRvS4eaJ42dhQEsCXauMWjvopWgrVg",
              "value": "0.0"
            }
          ],
          "inputCnt": 2,
          "outputCnt": 5
        }
      ]
    }
  ]
}
上次编辑于: