Skip to content

lbtc explorer api

woshiinsensible edited this page Apr 3, 2019 · 11 revisions

API description:

返回最新块高和块哈希

Request:

{ "param": "" }

Response:

{
  "blockcount": 4828738,
  "blockhash": "917d7bfc674820ea205118680e22ae3766278b59e8a1406848e4bdaf5e9ddfb8"
}

API description:

通过块高获取块信息

Request:

{ "param": "4114490" //块高 }

Response:

[
  {
    "result": {
      "hash": "1f3c66518bc0fb8f39d680762880df6c0b2574e444753bb7c49131e873729474",
      "confirmations": 3,
      "strippedsize": 287,
      "size": 287,
      "weight": 1148,
      "height": 4114490,
      "version": 536870912,
      "versionHex": "20000000",
      "merkleroot": "bebc1df95db7fe595fb5f2fdfe882b87be531e8586118dbf70d9c974f97a022d",
      "tx": [
        "bebc1df95db7fe595fb5f2fdfe882b87be531e8586118dbf70d9c974f97a022d"
      ],
      "time": 1551930967,
      "mediantime": 1551930952,
      "nonce": 0,
      "bits": "00000000",
      "difficulty": 1,
      "chainwork": "00000000000000000000000000000000000000000000000000000000003ec83b",
      "previousblockhash": "cb97df674ee9d2289e7055ee1c3949def0e757abdced65936963e23007271517",
      "nextblockhash": "e913fdcd9f88fa06ea887a730f21a7333ed60df224dd4da03f6079664583e6a8"
    },
    "error": null,
    "id": 1
  },
  [
    {
      "result": {
        "txid": "bebc1df95db7fe595fb5f2fdfe882b87be531e8586118dbf70d9c974f97a022d",
        "hash": "bebc1df95db7fe595fb5f2fdfe882b87be531e8586118dbf70d9c974f97a022d",
        "size": 206,
        "vsize": 206,
        "version": 65282,
        "locktime": 0,
        "vin": [
          {
            "coinbase": "033ac83e0101",
            "sequence": 4294967295
          }
        ],
        "vout": [
          {
            "value": 0.0625,
            "n": 0,
            "scriptPubKey": {
              "asm": "OP_DUP OP_HASH160 10b2cf8b54b213d57182971d1465cad4542b932e OP_EQUALVERIFY OP_CHECKSIG",
              "hex": "76a91410b2cf8b54b213d57182971d1465cad4542b932e88ac",
              "reqSigs": 1,
              "type": "pubkeyhash",
              "addresses": [
                "12XJ24F4S7idamHFqzFjA8yx5cFZUhfYuA"
              ]
            }
          },
          {
            "value": 0,
            "n": 1,
            "scriptPubKey": {
              "asm": "OP_RETURN 033c20e2b7f2117eec81cd81ee24f71a48645ae2815f0cf2e40e890c0a1ab31288 304402204aa0029e9b5b451247b3719654f32efede8146f48c8a7642ee87e55b99066b0e02207fab36ccf93ec00ab0dca36e75ade62657283e69752a4e88b1d6ddae8e086cc8",
              "hex": "6a21033c20e2b7f2117eec81cd81ee24f71a48645ae2815f0cf2e40e890c0a1ab3128846304402204aa0029e9b5b451247b3719654f32efede8146f48c8a7642ee87e55b99066b0e02207fab36ccf93ec00ab0dca36e75ade62657283e69752a4e88b1d6ddae8e086cc8",
              "type": "nulldata"
            }
          }
        ],
        "blockhash": "1f3c66518bc0fb8f39d680762880df6c0b2574e444753bb7c49131e873729474",
        "height": 4114490,
        "confirmations": 3,
        "time": 1551930967,
        "blocktime": 1551930967
      },
      "error": null,
      "id": 1
    }
  ]
]

API description:

返回交易信息

Request:

{ "param": "bebc1df95db7fe595fb5f2fdfe882b87be531e8586118dbf70d9c974f97a022d" //txhash }

Response:

{
  "result": {
    "txid": "bebc1df95db7fe595fb5f2fdfe882b87be531e8586118dbf70d9c974f97a022d",
    "hash": "bebc1df95db7fe595fb5f2fdfe882b87be531e8586118dbf70d9c974f97a022d",
    "size": 206,
    "vsize": 206,
    "version": 65282,
    "locktime": 0,
    "vin": [
      {
        "coinbase": "033ac83e0101",
        "sequence": 4294967295
      }
    ],
    "vout": [
      {
        "value": 0.0625,
        "n": 0,
        "scriptPubKey": {
          "asm": "OP_DUP OP_HASH160 10b2cf8b54b213d57182971d1465cad4542b932e OP_EQUALVERIFY OP_CHECKSIG",
          "hex": "76a91410b2cf8b54b213d57182971d1465cad4542b932e88ac",
          "reqSigs": 1,
          "type": "pubkeyhash",
          "addresses": [
            "12XJ24F4S7idamHFqzFjA8yx5cFZUhfYuA"
          ]
        }
      },
      {
        "value": 0,
        "n": 1,
        "scriptPubKey": {
          "asm": "OP_RETURN 033c20e2b7f2117eec81cd81ee24f71a48645ae2815f0cf2e40e890c0a1ab31288 304402204aa0029e9b5b451247b3719654f32efede8146f48c8a7642ee87e55b99066b0e02207fab36ccf93ec00ab0dca36e75ade62657283e69752a4e88b1d6ddae8e086cc8",
          "hex": "6a21033c20e2b7f2117eec81cd81ee24f71a48645ae2815f0cf2e40e890c0a1ab3128846304402204aa0029e9b5b451247b3719654f32efede8146f48c8a7642ee87e55b99066b0e02207fab36ccf93ec00ab0dca36e75ade62657283e69752a4e88b1d6ddae8e086cc8",
          "type": "nulldata"
        }
      }
    ],
    "blockhash": "1f3c66518bc0fb8f39d680762880df6c0b2574e444753bb7c49131e873729474",
    "height": 4114490,
    "confirmations": 211,
    "time": 1551930967,
    "blocktime": 1551930967
  },
  "error": null,
  "id": 1
}

API description:

返回给参数地址投票的地址列表

Request:

{ "param": "1BFJKtxojtuh8mhAWyc8t7HY7KkRM87JMa" }

Response:

{
  {
    "result": [
      "11kowCmzJXKTn8VcUSuWYhWvxdLh5cMf8",
      "1U6TNpsTBb8obj5MYeagfeshJ7RmkZK72",
      "1WtsYWVzRzcrMmZiXCqPw1kkp2UM1ZXdU",
      "1fHcxBzXUg7K2AgT2nkZ3HbXsFMuWsY6A",
      "1i6q3JfLtXnh5cbUt74iRqPQJCWnC9fFR",
      "1iEChHMkzH5Bh91fioteXQRxmmEPKDZrC",
      "1jxP488gE3VTxLerr2wXYNVMUMqbmGr6S",
      "......"
    ],
    "error": null,
    "id": 1
  }
}

API description:

返回参数地址投票给锻造节点的地址和名字

Request:

{ "param": "1BFJKtxojtuh8mhAWyc8t7HY7KkRM87JMa" }

Response:

{
  "result": [
    {
      "name": "Whale",
      "delegate": "1WtsYWVzRzcrMmZiXCqPw1kkp2UM1ZXdU"
    },
    {
      "name": "Trading",
      "delegate": "1r2MPfcwUT5do8sSAZAe1UJeSspQBpyhf"
    },
    {
      "name": "ryryan",
      "delegate": "12aL5w9qTpbseeoZ3hbEPGA7mejbPxJmjr"
    },
    {
      "name": "Yolo",
      "delegate": "12zR7fw2H1RKStKoycLJ5pE6gUrTT55QTF"
    },
    {
        ......
    },
  ],
  "error": null,
  "id": 1
}

API description:

返回锻造节点的的票数

Request:

{ "param": "Whale" }

Response:

{
  "result": 66532726794498,
  "error": null,
  "id": 1
}

API description:

返回所有锻造节点的地址、名字和得票数

Request:

{ "param": "" }

Response:

[
  {
    "name": "nikkio",
    "address": "1EV5pK7ZN9BcnCNAgGvPXRLSAWj3WxVFv8",
    "count": 0
  },
  {
    "name": "nodemaster10",
    "address": "1FcRLtVcBkmnJXHHP3S3Fbsv3UJ4KXVgDr",
    "count": 0
  },
  {
    "name": "saokong",
    "address": "1JDqh9gbW8YPhY25PNjxaiZAd4vC5yy66m",
    "count": 0
  },
  {
    "name": "sea",
    "address": "1EUzSxcjpE2iFxwgnm914ZwgxqoCFs9MrD",
    "count": 0
  },
  {
    ......
  }
]

API description:

查询接口

Request:

{ "param": 12345 //块高 }

Response:

[
  {
    "result": {
      "hash": "d5efb63c75ac55ec267d1a8405eee318dc7176e0ff348adfc11a43b7dbec437f",
      "confirmations": 1626418,
      "strippedsize": 286,
      "size": 286,
      "weight": 1144,
      "height": 12345,
      "version": 536870912,
      "versionHex": "20000000",
      "merkleroot": "6c37d5a279beb87ccc70b83bb30837b36bd46f25ef6b51e20e1176ca5754c1b0",
      "tx": [
        "6c37d5a279beb87ccc70b83bb30837b36bd46f25ef6b51e20e1176ca5754c1b0"
      ],
      "time": 1539250279,
      "mediantime": 1539250261,
      "nonce": 0,
      "bits": "1b3fffc0",
      "difficulty": 1,
      "chainwork": "000000000000000000000000000000000000000000000000000000000000303a",
      "previousblockhash": "aa8896fe24965975ce76ede6ea1e54257040f5cf67bdd4d73f165de7afe70055",
      "nextblockhash": "b2b5d64fd5abb4bdb78594892a3e1e90c4da267f77c406478427d2fb6c57a5c1"
    },
    "error": null,
    "id": 1
  },
  [
    {
      "result": {
        "txid": "6c37d5a279beb87ccc70b83bb30837b36bd46f25ef6b51e20e1176ca5754c1b0",
        "hash": "6c37d5a279beb87ccc70b83bb30837b36bd46f25ef6b51e20e1176ca5754c1b0",
        "size": 205,
        "vsize": 205,
        "version": 65282,
        "locktime": 0,
        "vin": [
          {
            "coinbase": "0239300101",
            "sequence": 4294967295
          }
        ],
        "vout": [
          {
            "value": 0.0625,
            "n": 0,
            "scriptPubKey": {
              "asm": "OP_DUP OP_HASH160 a02a9b99125c5ba622c5c632d3f1109d565f73ec OP_EQUALVERIFY OP_CHECKSIG",
              "hex": "76a914a02a9b99125c5ba622c5c632d3f1109d565f73ec88ac",
              "reqSigs": 1,
              "type": "pubkeyhash",
              "addresses": [
                "1FbtA8qCwrvaRLHmyyZyyS21fwESq63Asq"
              ]
            }
          },
          {
            "value": 0,
            "n": 1,
            "scriptPubKey": {
              "asm": "OP_RETURN 0295c6d3e539bdeea5384af5a05294261f2848c17e4b17316f33bb15f5bb2b8159 304402203d99e08a52dfb8357d18b6d6bef33e9e26fe1d7a4162c83be25bee5d327182ed02202f03235f8201210ba01832e953109716a09d237f81808dedc1aea471ff553d99",
              "hex": "6a210295c6d3e539bdeea5384af5a05294261f2848c17e4b17316f33bb15f5bb2b815946304402203d99e08a52dfb8357d18b6d6bef33e9e26fe1d7a4162c83be25bee5d327182ed02202f03235f8201210ba01832e953109716a09d237f81808dedc1aea471ff553d99",
              "type": "nulldata"
            }
          }
        ],
        "blockhash": "d5efb63c75ac55ec267d1a8405eee318dc7176e0ff348adfc11a43b7dbec437f",
        "height": 12345,
        "confirmations": 1626418,
        "time": 1539250279,
        "blocktime": 1539250279
      },
      "error": null,
      "id": 1
    }
  ]
]

Request:

{ "param": "185CrfwWxVyTCcjaRBmXuxyztq1G4xoH3r //地址 }

Response:

{
  "result": 787193968876,
  "error": null,
  "id": 1,
  "addr": "185CrfwWxVyTCcjaRBmXuxyztq1G4xoH3r"
}

Request:

{ "param": "daf1e5440cb0c09eced1211859ae4c842b70ba5c5349dbd6fc84a1c9971f93c3 //交易哈希 }

Response:

{
  "result": {
    "txid": "daf1e5440cb0c09eced1211859ae4c842b70ba5c5349dbd6fc84a1c9971f93c3",
    "hash": "daf1e5440cb0c09eced1211859ae4c842b70ba5c5349dbd6fc84a1c9971f93c3",
    "size": 207,
    "vsize": 207,
    "version": 65282,
    "locktime": 0,
    "vin": [
      {
        "coinbase": "030daa490101",
        "sequence": 4294967295
      }
    ],
    "vout": [
      {
        "value": 0.0625,
        "n": 0,
        "scriptPubKey": {
          "asm": "OP_DUP OP_HASH160 4d94710a1b4e251a04118fd962410434ead856a8 OP_EQUALVERIFY OP_CHECKSIG",
          "hex": "76a9144d94710a1b4e251a04118fd962410434ead856a888ac",
          "reqSigs": 1,
          "type": "pubkeyhash",
          "addresses": [
            "185CrfwWxVyTCcjaRBmXuxyztq1G4xoH3r"
          ]
        }
      },
      {
        "value": 0,
        "n": 1,
        "scriptPubKey": {
          "asm": "OP_RETURN 028bf744a6314c3d9a89edb27b4aa7b97e56d2b389f3c3c079d875213640d6eb72 30450221009f8df2c7fb90405b52f18f12dca39e9f5e3c4698ae0af5e0840b11f0cc1309a3022059df7d000114909299a7309a0f3d983f248d5bd73fcb0c5cb7e63d83a68513e1",
          "hex": "6a21028bf744a6314c3d9a89edb27b4aa7b97e56d2b389f3c3c079d875213640d6eb724730450221009f8df2c7fb90405b52f18f12dca39e9f5e3c4698ae0af5e0840b11f0cc1309a3022059df7d000114909299a7309a0f3d983f248d5bd73fcb0c5cb7e63d83a68513e1",
          "type": "nulldata"
        }
      }
    ],
    "blockhash": "75fedbb5e7fa08e0a1e6342078451411fcfcdc222ab4b5441d87a6a4646a1091",
    "height": 4827661,
    "confirmations": 87,
    "time": 1554098599,
    "blocktime": 1554098599
  },
  "error": null,
  "id": 1
}

Request:

{ "param": "Jo //锻造节点名称 }

Response:

{
  "result": 698371362640,
  "error": null,
  "id": 1,
  "addr": "17e8rTdBcTVQmvoWbWDqtyxYQtM7zeZUaE"
}

API description:

返回地址余额

Request:

{ "param": "1MjdLcqxwMkbzXcn3nLkKwrygaX7ALYZBv" }

Response:

{
  "result": 788248292648,
  "error": null,
  "id": 1,
  "addr": "1MjdLcqxwMkbzXcn3nLkKwrygaX7ALYZBv"
}

API description:

返回最新块高和lbtc流通量

Request:

{ "param": "" }

Response:

{
  "blockcount": 4114576,
  "total": 3848087
}

API description:

返回参数地址最新100条交易

Request:

{ "param": "1r2MPfcwUT5do8sSAZAe1UJeSspQBpyhf" }

Response:

{
  "error": 0,
  "msg": [
    {
      "txid": "326e2a5d9c22f0b5fa5cc6abd9aa09bc0e48cd760c050194160ddfb9b6d9f7f2",
      "height": 4828637,
      "time": 1554101530
    },
    {
      "txid": "69c9840e312b868665afc2a9ccf5e0523dfffbb4b9886e3864700185a6ca84f8",
      "height": 4828572,
      "time": 1554101335
    },
    {
      "txid": "edf5af2ca928630d290d55263e5374daece9335bfb65d402826cd9cfcce7d4d8",
      "height": 4828516,
      "time": 1554101167
    },
    {
        ......
    },
  ]
}

API description:

返回锻造节点状态

Request:

{ "param": "" }

Response:

{
  "error": 0,
  "msg": [
    {
      "address": "1LiKPvkHdiKLea1Zh5nvZRFira9SpY7KfR",
      "status": "1",
      "now": "0",
      "ratio": 0.9379,
      "name": "Abbey",
      "count": 62833640740983
    },
    {
      "address": "1CpgvGmm87Wqgu84G5voeFR5s9ADwGbQpc",
      "status": "1",
      "now": "0",
      "ratio": 0.941,
      "name": "XYZ",
      "count": 62833640740983
    },
    {
      "address": "1GrWYD4yQeiPbsRobvFych91ey43Vifya7",
      "status": "1",
      "now": "0",
      "ratio": 0.9377,
      "name": "JPMorgan",
      "count": 62038633542198
    },
    {
      "address": "165PBfCEys3KVw1se234Wy8mZ48g7xVwqw",
      "status": "1",
      "now": "0",
      "ratio": 0.8736,
      "name": "zthuning",
      "count": 71657298702117
    },
    {
      ......
    }
    
  ]
}

Response Description:

 "address": 节点地址,
 "status": 节点本轮出块状态,
 "now": 是否正在出块,
 "ratio": 出块率,
 "name": 节点名称,
 "count": 总得票数

API description:

返回理事会成员信息列表

Request:

{ "param": "" }

Response:

{
  "error": 0,
  "msg": [
    {
      "address": "12M23RqcFY9yuoac9piMrbmzBdh271pb62",
      "name": "Eagly",
      "url": "LightningBTC.uk",
      "votes": 58815701
    },
    {
      "address": "19rSrWjji6GxLwWFHfjkar8SJeYwKwFQP3",
      "name": "LightningBTC",
      "url": "www.lbtc.group",
      "votes": 0
    },
    {
      "address": "1CKbTd4ThjmRFhaGbGVfqa5B1ivLuxYHQD",
      "name": "TestCommitteesName",
      "url": "TestCommitteesUrl",
      "votes": 642363220
    }
  ]
}

Response Description:

"address": 理事会成员的地址,
"name": 理事会成员的名称,
"url": 理事会成员的url链接,
"votes": 理事会成员的投票数

API description:

返回理事会成员投票的地址和名字

Request:

{ "param": "1CKbTd4ThjmRFhaGbGVfqa5B1ivLuxYHQD" }

Response:

{
  "error": 0,
  "msg": [
    {
      "address": "1CKbTd4ThjmRFhaGbGVfqa5B1ivLuxYHQD",
      "name": "TestCommitteesName"
    }
  ]
}

API description:

返回给理事会成员投票的地址

Request:

{ "param": "TestCommitteesName" }

Response:

{
  "error": 0,
  "msg": [
    {
      "address": "18v1ox2JtFJ6Ds4oZWGCB8La5mZsVHiqzH"
    },
    {
      "address": "1CKbTd4ThjmRFhaGbGVfqa5B1ivLuxYHQD"
    }
  ]
}

API description:

返回所有议案详情

Request:

{ "param": "" }

Response:

{
  "error": 0,
  "msg": [
    {
      "title": "Change the DPOS reward mechanism of LBTC * 改变LBTC的DPOS奖励机制以防止LBTC的长期集中化",
      "detail": "[Motion] Change the DPOS reward mechanism of LBTC to prevent long term centralisation of LBTC by private forging pools * [动议]建议改变LBTC的DPOS奖励机制,以防止私人锻造",
      "url": "https://goo.gl/pYeB6C",
      "starttime": 1544802385,
      "endtime": 1545666368,
      "committee": "12M23RqcFY9yuoac9piMrbmzBdh271pb62",
      "options": [
        {
          "option": "Yes * 是",
          "address": [
            {
              "voters": "1HgZBKUVhfYGpqKm2vx3APtUWUqN3tVkM",
              "votes": 7428289800
            },
            {
              "voters": "1ZeCu5qeumLRhV4QDsE1f2QtWAhPMyuZf",
              "votes": 100095480
            },
            {
              "voters": "1dDZv6cA5LkrBvax6ebEcxzsBHPiUeRaN",
              "votes": 16824488315
            },
            {
              "voters": "12M23RqcFY9yuoac9piMrbmzBdh271pb62",
              "votes": 295998000
            },
            {
              "voters": "1LXGYYcUGtBLmkmzRwcT69JoqBMzvSAC2W",
              "votes": 814048318751
            }
          ]
        },
        {
          "option": "No * 没有",
          "address": [
            
          ]
        }
      ],
      "state": {
        "isfinished": true,
        "ispassed": false,
        "optoinindex": 0,
        "totalvote": 838697190346
      },
      "id": "bf674efe7d1b82129c2d634e9c37214dfea00171"
    },
    {
      ......
    }
  ]
}

API description:

返回地址投票给的议案id

Request:

{ "param": "1CKbTd4ThjmRFhaGbGVfqa5B1ivLuxYHQD" }

Response:

{
  "error": 0,
  "msg": [
    {
      "id": "41c21759e215575a695f3827ab075542a8f8e5a3",
      "index": 1
    },
    {
      "id": "31c8ba875fc9824b94fb65dbf07574d0c62a5cfc",
      "index": 0
    }
  ]
}

API description:

返回理事会成员提交的议案id

Request:

{ "param": "TestCommitteesName" }

Response:

{
  "error": 0,
  "msg": [
    {
      "billid": "41c21759e215575a695f3827ab075542a8f8e5a3"
    }
  ]
}
Clone this wiki locally