API文档


YOYOW Explorer API V1

您的应用可以使用 http://yoyow.bts.ai 提供的区块链数据 API,实时获取YOYOW网络数据。

请求

所有API采用GET方式进行请求。

GET /api/v1/get_account?uid=9999

API响应类型

所有的响应类型均为application/json

API列表

Account

获取YOYOW账户信息

1.基本信息

GET /api/v1/get_account?uid=268613658

{
  "uid": 268613658,
  "name": "yoyo268613658",
  "owner": {
    "weight_threshold": 1,
    "account_uid_auths": [],
    "key_auths": [
      [
        "YYW6YP33HSkmvE4AukbfrCeWsgKm5p7Eqz7U22EHXxSj32wf9uTtp",
        1
      ]
    ]
  },
  "active": {
    "weight_threshold": 1,
    "account_uid_auths": [],
    "key_auths": [
      [
        "YYW6GtdB46KUgqUL3Sdsje1TRLXvAMJ1Sv2xHTqgNKErtxw9HssiH",
        1
      ]
    ]
  },
  "secondary": {
    "weight_threshold": 1,
    "account_uid_auths": [],
    "key_auths": [
      [
        "YYW8DcH6vXjQx8aW7ok1CoeiBwwh3LyuJW9gfS35RXTELvRyXEtRj",
        1
      ]
    ]
  },
  "memo_key": "YYW5fise4PQAshbeFERJxsfxrKY8E83vM8oTtTykMEbPR4AAh1aZn",
  "reg_info": {
    "registrar": 224373708,
    "referrer": 23080,
    "registrar_percent": 0,
    "referrer_percent": 0,
    "allowance_per_article": {
      "amount": 0,
      "asset_id": 0
    },
    "max_share_per_article": {
      "amount": 0,
      "asset_id": 0
    },
    "max_share_total": {
      "amount": 0,
      "asset_id": 0
    },
    "buyout_percent": 10000
  },
  "can_post": false,
  "can_reply": false,
  "can_rate": false,
  "is_full_member": false,
  "is_registrar": false,
  "is_admin": false,
  "create_time": "2017-09-08T22:41:42",
  "last_update_time": "2017-09-08T22:41:42",
  "active_data": "{}",
  "secondary_data": "{}"
}

2.见证人信息

GET /api/v1/get_witness?uid=268613658

{
  "account": 268613658,
  "name": "yoyo268613658",
  "sequence": 1,
  "is_valid": true,
  "signing_key": "YYW5NskaCvCQx6kp31Divr3kRh6XncWmFyvCf8Ft5zsfdyVyoviSa",
  "pledge": "7000000000",
  "pledge_last_update": "2017-09-09T06:31:18",
  "average_pledge": 366604870,
  "average_pledge_last_update": "2017-09-09T15:31:42",
  "average_pledge_next_update_block": 94001,
  "total_votes": 70216797,
  "by_pledge_position": "0",
  "by_pledge_position_last_update": "12870895108261606914308637873274679",
  "by_pledge_scheduled_time": "12871823307513277355052627263986925",
  "by_vote_position": "0",
  "by_vote_position_last_update": "7593235033673720623999464163383924",
  "by_vote_scheduled_time": "7598081201209314292959751623479039",
  "last_confirmed_block_num": 93349,
  "last_aslot": 93382,
  "total_produced": 192,
  "total_missed": 0,
  "url": ""
}

3.完全信息

GET /api/v1/get_full_account?uid=268613658

{
  "account": {
    "uid": 268613658,
    "name": "yoyo268613658",
    "owner": {
      "weight_threshold": 1,
      "account_uid_auths": [],
      "key_auths": [
        [
          "YYW6YP33HSkmvE4AukbfrCeWsgKm5p7Eqz7U22EHXxSj32wf9uTtp",
          1
        ]
      ]
    },
    "active": {
      "weight_threshold": 1,
      "account_uid_auths": [],
      "key_auths": [
        [
          "YYW6GtdB46KUgqUL3Sdsje1TRLXvAMJ1Sv2xHTqgNKErtxw9HssiH",
          1
        ]
      ]
    },
    "secondary": {
      "weight_threshold": 1,
      "account_uid_auths": [],
      "key_auths": [
        [
          "YYW8DcH6vXjQx8aW7ok1CoeiBwwh3LyuJW9gfS35RXTELvRyXEtRj",
          1
        ]
      ]
    },
    "memo_key": "YYW5fise4PQAshbeFERJxsfxrKY8E83vM8oTtTykMEbPR4AAh1aZn",
    "reg_info": {
      "registrar": 224373708,
      "referrer": 23080,
      "registrar_percent": 0,
      "referrer_percent": 0,
      "allowance_per_article": {
        "amount": 0,
        "asset_id": 0
      },
      "max_share_per_article": {
        "amount": 0,
        "asset_id": 0
      },
      "max_share_total": {
        "amount": 0,
        "asset_id": 0
      },
      "buyout_percent": 10000
    },
    "can_post": false,
    "can_reply": false,
    "can_rate": false,
    "is_full_member": false,
    "is_registrar": false,
    "is_admin": false,
    "create_time": "2017-09-08T22:41:42",
    "last_update_time": "2017-09-08T22:41:42",
    "active_data": "{}",
    "secondary_data": "{}"
  },
  "statistics": {
    "owner": 268613658,
    "total_ops": 9,
    "prepaid": 0,
    "csaf": 0,
    "core_balance": "7908948000",
    "core_leased_in": 0,
    "core_leased_out": 0,
    "average_coins": 70251912,
    "average_coins_last_update": "2017-09-09T07:57:00",
    "coin_seconds_earned": "42488356377600",
    "coin_seconds_earned_last_update": "2017-09-09T07:57:00",
    "total_witness_pledge": "7000000000",
    "releasing_witness_pledge": 0,
    "witness_pledge_release_block_number": 4294967295,
    "last_witness_sequence": 1,
    "uncollected_witness_pay": 18150000,
    "witness_last_confirmed_block_num": 93349,
    "witness_last_aslot": 93382,
    "witness_total_produced": 192,
    "witness_total_missed": 0,
    "witness_last_reported_block_num": 0,
    "witness_total_reported": 0,
    "total_committee_member_pledge": 0,
    "releasing_committee_member_pledge": 0,
    "committee_member_pledge_release_block_number": 4294967295,
    "last_committee_member_sequence": 0,
    "can_vote": true,
    "is_voter": true,
    "last_voter_sequence": 1
  },
  "csaf_leases_in": [],
  "csaf_leases_out": [],
  "voter": {
    "uid": 268613658,
    "sequence": 1,
    "is_valid": true,
    "votes": "7908948000",
    "number_of_committee_members_voted": 0
  },
  "witness": {
    "account": 268613658,
    "name": "yoyo268613658",
    "sequence": 1,
    "is_valid": true,
    "signing_key": "YYW5NskaCvCQx6kp31Divr3kRh6XncWmFyvCf8Ft5zsfdyVyoviSa",
    "pledge": "7000000000",
    "pledge_last_update": "2017-09-09T06:31:18",
    "average_pledge": 366604870,
    "average_pledge_last_update": "2017-09-09T15:31:42",
    "average_pledge_next_update_block": 94001,
    "total_votes": 70216797,
    "by_pledge_position": "0",
    "by_pledge_position_last_update": "12870895108261606914308637873274679",
    "by_pledge_scheduled_time": "12871823307513277355052627263986925",
    "by_vote_position": "0",
    "by_vote_position_last_update": "7588388866138126955039176703288809",
    "by_vote_scheduled_time": "7593235033673720623999464163383924",
    "last_confirmed_block_num": 93349,
    "last_aslot": 93382,
    "total_produced": 192,
    "total_missed": 0,
    "url": ""
  },
  "witness_votes": [
    268613658,
    415596451
  ],
  "committee_member_votes": []
}

4.用户财富信息

GET /api/v1/get_holder?page=1&limit=2

注:page是页数,默认1;limit是每页个数,默认20,最大100

{
  "total": 266,
  "page": 1,
  "limit": 2,
  "rows": [
    {
      "id": 9,
      "uid": 25638,
      "name": "init",
      "csaf": 872,
      "prepaid": 0,
      "core_balance": 279239780,
      "total": 279240652
    },
    {
      ...
    }
  ]
}

Block

GET /api/v1/get_block?block=82001

{
  "previous": "00014050d0758017a743b1c5552c11a63eb2ce33",
  "timestamp": "2017-09-09T06:31:18",
  "witness": 27291,
  "transaction_merkle_root": "1a3f984774530f7769ec589c538cc456754f7efd",
  "witness_signature": "1f76ca8bacba8d1144f7fc8bf1363756a63544b86fb729f59513c2648702ee01d931ea744e659afb9f11ecff0ddb773f62c4c43124ff0468c19022b1e15e5a7191",
  "transactions": [
    {
      "ref_block_num": 16463,
      "ref_block_prefix": 534700034,
      "expiration": "2017-09-09T06:31:42",
      "operations": [
        [
          14,
          {
            "fee": {
              "total": {
                "amount": 10000,
                "asset_id": 0
              }
            },
            "account": 268613658,
            "new_pledge": {
              "amount": "7000000000",
              "asset_id": 0
            }
          }
        ]
      ],
      "signatures": [
        "1f2ca0949aa3315b82f3283f6a4296f736385d910f411b319e0137cfff9ad90176336fc374f27c870b66e3c5a24678fd48ffca4051e68e1d57c179b76d567237e5"
      ],
      "operation_results": [
        [
          0,
          {}
        ]
      ]
    }
  ],
  "block_id": "000140510b473f2cab207fd23b1b3000fa0d2a33",
  "signing_key": "YYW7i2og2pAEGjFuKUAayAiTc3xQ28E3Kzo6Zgy7xSVzu3BrxdnLJ",
  "transaction_ids": [
    "96d2453af92d1943140c16e94db22e8e99fef716"
  ]
}

Transaction

GET /api/v1/get_tx?tx=96d2453af92d1943140c16e94db22e8e99fef716

[
  {
    "id": 20,
    "block_num": 82001,
    "block_time": "2017-09-09T14:31:18.000+08:00",
    "txid": "96d2453af92d1943140c16e94db22e8e99fef716",
    "trx_in_block": 0,
    "op_in_trx": 0,
    "account_num": "",
    "account_name": "",
    "op_type": 14,
    "infos": [
      14,
      {
        "fee": {
          "total": {
            "amount": 10000,
            "asset_id": 0
          }
        },
        "account": 268613658,
        "new_pledge": {
          "amount": "7000000000",
          "asset_id": 0
        }
      }
    ],
    "results": [
      0,
      {}
    ],
    "created_at": "2017-09-09T14:31:12.517+08:00",
    "updated_at": "2017-09-09T14:31:12.517+08:00"
  }
]