-
Notifications
You must be signed in to change notification settings - Fork 362
Explorer API
Base URL:bcapi.movapi.com/blockmeta/bytom2/v1
Curl -X GET http://bcapi.movapi.com/blockmeta/bytom2/v1/block?height=100
error code | error message | error description |
---|---|---|
10000 | 'server inner error' | server error |
20001 | 'request param is not valid' | wrong parameter(type or length) |
20002 | 'request param is null' | lack of parameter |
30001 | 'block hash is not correct' | wrong block hash |
30002 | 'block height is not correct' | wrong block height |
30003 | 'transaction hash is not correct' | wrong tx hash |
30004 | 'asset id is not correct' | wrong asset id |
30005 | 'timestamp is not correct' | wrong timestamp |
Search
Block
Block-headers
Transaction
Transactions
Address
Forbes
Assets
Asset
Daily
Vote-transaction
GET /search
Query whether the parameter is in the database and obtain the data type (address / block height / transaction hash / block hash)
-
String
- data, the parameters to be queried
-
Integer
- code, status code -
String
- msg, error message -
String
- type, data type,including[transaction,block,address]
Curl -X GET /search?data=c335a393db951760acb8a74c739e0e4c860598d64421bfc563ce6d367c822122
{
"code": 200,
"msg": "",
"data": {
"type": "transaction"
}
}
GET /block
Query block information by block height or block hash
The request parameter cannot be empty
-
String
- hash, block hash -
Integer
- height, block height
-
Integer
- code, status code -
String
- msg, error message -
Object
- header, block header information-
String
- hash, block hash -
Integer
- height, block height -
String
- previous_block_hash, previous block hash -
String
- merkle_root, merkle root -
integer
- size,block size -
integer
- timestamp, the timestamp of block generation -
integer
- transaction_count, the amount of transaction contain in this block
-
-
Object
- validator, the generator of this block-
String
- pub_key, public key -
String
- validator_name, generator Chinese name -
String
- validator_name_english, generator English name
-
-
Array of Object
- transactions, the list of transaction contain in this block-
String
- hash, transaction hash -
String
- fee, transaction fee -
Integer
- size, transaction size -
Array of String
-tx_types,transaction type["ordinary","coinbase","issuance","vote","veto", "cross_chain","chain_tx"] -
Array of Object
- inputs, input information-
String
-type, input type['spend', 'issue', 'coinbase','veto'] -
String
- amount, the amount of input asset -
String
- program, control_program -
Object
-* decoded_program*, decoded control_program -
String
- address, account address, only exits when the type is 'spend' -
Object
- asset, input asset information-
String
- id, asset id -
String
- symbol, asset symbol
-
-
-
Array of Object
- outputs, output information-
String
- type, output type["ordinary", "vote","retire"] -
String
- address, the receiver address -
String
- amount, the amount of output asset -
String
- program, control_program -
Object
- decoded_program, decoded control_program -
Object
- asset, output asset information-
String
- id, asset id -
String
- symbol, asset symbol
-
-
-
Curl -X GET /block?height=100
{
"code": 200,
"msg": "",
"data": {
"header": {
"hash": "c7bfc4f264c183bf67518496dad1860f83aced4bbb69d0d5483e4c5c6c5d4289",
"height": 100,
"previous_block_hash": "b376ad51d35e81c65f333e9a3e45520ee9da30b3384aaf113f0ad9ff1b187666",
"merkle_root": "c47d425b3e2c04d19050ef98cf994a2402e915dacd420e64439a1d39a8cc4be4",
"size": 652,
"timestamp": 1629425448,
"transaction_count": 1,
"validator": {
"pub_key": "1313379b05c38ff2d171d512f23f199f0f068a67d77b9d5b6db040f2da1edc0c35c68a21b068956f448fed6441b9c27294f1ca6aaedc2c580de322f3f0260c1f",
"name_zh": "创世节点",
"name_en": "Genesis node"
}
},
"transactions": [
{
"hash": "54f48bcc033886bc28fd7cfe2a15d3b82690280726c40ddc12045f86bcd3d08b",
"fee": "0.0000000000",
"size": 152,
"tx_types": [
"coinbase"
],
"inputs": [
{
"type": "coinbase",
"amount": "0.0000000000",
"program": "",
"decoded_program": "",
"address": "smart contract",
"asset": {
"id": "0000000000000000000000000000000000000000000000000000000000000000",
"symbol": ""
}
}
],
"outputs": [
{
"type": "ordinary",
"amount": "0.0000000000",
"program": "00147979dd397652cc9e02e6f361614a645ea0f79cfc",
"decoded_program": "DUP \nHASH160 \nDATA_20 7979dd397652cc9e02e6f361614a645ea0f79cfc\nEQUALVERIFY \nTXSIGHASH \nSWAP \nCHECKSIG \n",
"address": "bn1q09ua6wtk2txfuqhx7dskzjnyt6s0088ulmsrpr",
"asset": {
"id": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"symbol": "BTM"
}
}
]
}
]
}
}
GET /block-headers
Query the block headers, using paging mechanism
-
Integer
- start, paging start position -
Integer
- limit, data amount per page
-
Integer
- code, status code -
String
- msg, error message -
Array
- object, block header array-
String
- hash, block hash -
Integer
- height, block height -
String
- previous_block_hash, previous block hash -
String
- merkle_root, merkle root -
Integer
- size, block size -
Integer
- timestamp, the timestamp of block generation -
Integer
- transaction_count, the transaction amount contain in this block -
Object
- validator, the generator of this block-
String
- pub_key, public key -
String
- validator_name, generator Chinese name -
String
- validator_name_english, generator English name
-
-
Curl -X GET /block-headers?/blocks?start=10&limit=2
{
"code": 200,
"msg": "",
"data": [
{
"hash": "2f5bfa3a2b6f6b917c0b81d938a012563bfa1d26bd2709f2314864e55dad9b78",
"height": 54705,
"previous_block_hash": "7f36f3855102d427074f8679b8ce506b82cb086d1bdfda1ddd55a2f429f855e3",
"merkle_root": "e7ec1b0cf151c8e97ae696d744bbe3e4d69af5d424eb2841f17b3f3d4226d0af",
"size": 446,
"timestamp": 1629798444,
"transaction_count": 1,
"validator": {
"pub_key": "380d8820818167c67b8e677062e6d6daf6302583b7e205f1eaa2e3446c777aab1d0fc48b101cc2a081e6cbf361d78016596c241d5e69eca09176ce05c1bf397b",
"name_zh": "Bytom海外社区",
"name_en": "Bytom-Community"
}
},
{
"hash": "7f36f3855102d427074f8679b8ce506b82cb086d1bdfda1ddd55a2f429f855e3",
"height": 54704,
"previous_block_hash": "1c62b0deda7d7dfb80407f21bc850ec696f3c0e44d4e9cbbafb58d924510d21d",
"merkle_root": "73c259ec9b04ddda4dc624ec6d58690284d82f83c356412daf89231f459399f4",
"size": 446,
"timestamp": 1629798438,
"transaction_count": 1,
"validator": {
"pub_key": "1ab83450661e1de973e7be2a8a4ba7d4634996f327a6c59b10d59bfd96df6dc5d7afd5b287b1ad96809d89b915ef7002143a33dd06872376927fff589046ec0d",
"name_zh": "链节点",
"name_en": "ChainNode"
}
}
],
"pagination": {
"start": 0,
"limit": 2,
"total": 54706,
"_links": {
"next": "/blockmeta/bytom2/v1/block-headers?limit=2&start=2"
}
}
}
GET /transaction
Query transaction by transaction ID
-
String
- hash, transaction ID
-
Integer
- code, status code -
String
- msg, error message -
Object
- data, block information-
String
- hash, transaction hash -
Integer
- block_height, block height -
Integer
- block_hash, block hash -
String
- fee, transaction fee -
integer
- size,transaction size -
integer
- timestamp, the timestamp of transaction generation -
Array of String
-tx_types,transaction type["ordinary","coinbase","issuance","vote","veto", "cross_chain","chain_tx"] -
Array of Object
- inputs, input information-
String
-type, input type['spend', 'issue', 'coinbase','veto'] -
String
- amount, the amount of input asset -
String
- program, control_program -
Object
-* decoded_program*, decoded control_program -
String
- address, account address, only exits when the type is 'spend' -
Object
- asset, input asset information-
String
- id, asset id -
String
- symbol, asset symbol
-
-
-
Array of Object
- outputs, output information-
String
- type, output type["ordinary", "vote","retire"] -
String
- address, the receiver address -
String
- amount, the amount of output asset -
String
- program, control_program -
Object
- decoded_program, decoded control_program -
Object
- asset, output asset information-
String
- id, asset id -
String
- symbol, asset symbol
-
-
-
Curl -X GET /transaction?hash=19e7fc0bf5d8a2c9c1ec663b948d9be4ceb573d2f4922452febc25cac7d3c23d
{
"code": 200,
"msg": "",
"data": {
"hash": "19e7fc0bf5d8a2c9c1ec663b948d9be4ceb573d2f4922452febc25cac7d3c23d",
"fee": "0.0000000000",
"size": 156,
"block_height": 54949,
"block_hash": "f9068faced79a08545ff2abe0584e068c5f30275050cb81582f1eca196dda807",
"timestamp": 1629799908,
"tx_types": [
"coinbase"
],
"inputs": [
{
"type": "coinbase",
"amount": "0.0000000000",
"program": "",
"decoded_program": "",
"address": "smart contract",
"asset": {
"id": "0000000000000000000000000000000000000000000000000000000000000000",
"symbol": ""
}
}
],
"outputs": [
{
"type": "ordinary",
"amount": "0.0000000000",
"program": "0014978f30da1cd774799f7a4229b14dfdb5e6baffe7",
"decoded_program": "DUP \nHASH160 \nDATA_20 978f30da1cd774799f7a4229b14dfdb5e6baffe7\nEQUALVERIFY \nTXSIGHASH \nSWAP \nCHECKSIG \n",
"address": "bn1qj78npksu6a68n8m6gg5mzn0akhnt4ll8hln2cn",
"asset": {
"id": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"symbol": "BTM"
}
}
]
}
}
GET /transactions
Query a group of transaction by query parameters
-
String
- address, query the transactions by the specified address -
String
- asset, query the transactions by the specified asset -
String
- type, query the transactions by the specified transaction type // vote、cross_chain -
Integer
- start, paging start position -
Integer
- limit, data amount per page
-
Integer
- code, status code -
String
- msg, error message -
Array of Object
- data, transaction list-
String
- hash, transaction hash -
Integer
- block_height, block height -
Integer
- block_hash, block hash -
String
- fee, transaction fee -
integer
- size,transaction size -
integer
- timestamp, the timestamp of transaction generation -
Array of String
-tx_types,transaction type["ordinary","coinbase","issuance","vote","veto", "cross_chain","chain_tx"] -
Array of Object
- inputs, input information-
String
-type, input type['spend', 'issue', 'coinbase','veto'] -
String
- amount, the amount of input asset -
String
- program, control_program -
Object
-* decoded_program*, decoded control_program -
String
- address, account address, only exits when the type is 'spend' -
Object
- asset, input asset information-
String
- id, asset id -
String
- symbol, asset symbol
-
-
-
Array of Object
- outputs, output information-
String
- type, output type["ordinary", "vote","retire"] -
String
- address, the receiver address -
String
- amount, the amount of output asset -
String
- program, control_program -
Object
- decoded_program, decoded control_program -
Object
- asset, output asset information-
String
- id, asset id -
String
- symbol, asset symbol
-
-
-
-
Object
- pagination, paging information-
Integer
- start, paging start position -
Integer
- limit, data amount per page -
Integer
- total, total transaction amount -
Object
- _links, paging link-
String
- next, next paging link -
String
- prev, previous paging link
-
-
Curl -X GET /transactions?block_height=100&start=1&limit=1
{
"code": 200,
"msg": "",
"data": [
{
"hash": "8fb8802b4777d78aad9a1067a0e44badc83a6d78737c7cfef9197e2e4dc3901a",
"fee": "0.0000000000",
"size": 156,
"block_height": 55113,
"block_hash": "ebe54bd2e2f253dbd91483b0d880a4c4a7e063a7ee60bb3de0cee7a3904caabe",
"timestamp": 1629800892,
"tx_types": [
"coinbase"
],
"inputs": [
{
"type": "coinbase",
"amount": "0.0000000000",
"program": "",
"decoded_program": "",
"address": "smart contract",
"asset": {
"id": "0000000000000000000000000000000000000000000000000000000000000000",
"symbol": ""
}
}
],
"outputs": [
{
"type": "ordinary",
"amount": "0.0000000000",
"program": "0014eddab573568136a66b0ab7345dee57bb204616b7",
"decoded_program": "DUP \nHASH160 \nDATA_20 eddab573568136a66b0ab7345dee57bb204616b7\nEQUALVERIFY \nTXSIGHASH \nSWAP \nCHECKSIG \n",
"address": "bn1qahdt2u6ksym2v6c2ku69mmjhhvsyv94hwr8evp",
"asset": {
"id": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"symbol": "BTM"
}
}
]
}
],
"pagination": {
"start": 1,
"limit": 1,
"total": 57564,
"_links": {
"next": "/blockmeta/bytom2/v1/transactions?limit=1&start=2",
"prev": "/blockmeta/bytom2/v1/transactions?limit=1&start=0"
}
}
}
GET /address
Query the asset information related to the specified address
-
String
- address, the specified address,required
-
Integer
- code, status code -
String
- msg, error message -
Array of Object
- data, address information-
Object
- asset, asset information-
String
- id, asset id -
String
- symbol, asset symbol
-
-
String
- address, address -
String
- balance, balance -
String
- total_received, the total received asset amout -
String
- total_sent, the total sent asset amout
-
Curl -X GET /address?address=bn1qj78npksu6a68n8m6gg5mzn0akhnt4ll8hln2cn
{
"code": 200,
"msg": "",
"data": [
{
"asset": {
"id": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"symbol": "BTM"
},
"address": "bn1qj78npksu6a68n8m6gg5mzn0akhnt4ll8hln2cn",
"balance": "4092.7782370400",
"total_received": "10495.0772679500",
"total_sent": "6402.2990309100"
}
]
}
GET /forbes
Query all owners of an asset and sort by balance
-
String
- asset, specified assets ID,Required -
Integer
- start, paging start position -
Integer
- limit, data amount per page
-
Integer
- code, status code -
String
- msg, error message -
Array of Object
- data, asset owner list-
Object
- asset, asset information-
String
- id, asset id -
String
- symbol, asset symbol
-
-
String
- address, owner address -
String
- balance, balance -
String
- total_received, the total received asset amout -
String
- total_sent, the total sent asset amout
-
-
Object
- pagination, paging information-
Integer
- start, paging start position -
Integer
- limit, data amount per page -
Integer
- total, total transaction amount -
Object
- _links, paging link-
String
- next, next paging link -
String
- prev, previous paging link
-
-
Curl -X GET /forbes?asset=47fcd4d7c22d1d38931a6cd7767156babbd5f05bbbb3f7d3900635b56eb1b67e
{
"code": 200,
"msg": "",
"data": [
{
"asset": {
"id": "47fcd4d7c22d1d38931a6cd7767156babbd5f05bbbb3f7d3900635b56eb1b67e",
"symbol": "SUP"
},
"address": "bn1qr5q0sh3zpc66yv5zelrlj8l8kd9ldhqc642epn",
"balance": "87839.3193166200",
"total_received": "87888.9028510100",
"total_sent": "49.5835343900"
},
{
"asset": {
"id": "47fcd4d7c22d1d38931a6cd7767156babbd5f05bbbb3f7d3900635b56eb1b67e",
"symbol": "SUP"
},
"address": "bn1qcj7dzpjlnsg7pf24nj6pduar9dc24uxe7ue4y3",
"balance": "334.6012919800",
"total_received": "334.6012919800",
"total_sent": "0.0000000000"
}
],
"pagination": {
"start": 0,
"limit": 10,
"total": 175,
"_links": {
"next": "/blockmeta/bytom2/v1/forbes?limit=10&start=10"
}
}
}
GET /assets
Query all the assets in the Bytom blockchain
-
Integer
- start, paging start position -
Integer
- limit, data amount per page
-
Integer
- code, status code -
String
- msg, error message -
Array of Object
- assets, asset list-
String
- total_supply, total supply -
Integer
- decimals, numerical accuracy -
String
- name, asset name -
String
- symbol, asset symbol -
String
- asset, asset id -
Integer
- issue_timestamp, first issue time -
String
- program, issue program -
Bool
- is_bap_2, whether a bap-2 asset -
Object
- definition asset definition-
Object
- description asset description -
String
- logo, asset's logo -
Integer
- quorum, asset signatures amount -
Bool
- reissue, whether the asset support additional issuance
-
-
Object
- external (omit) -
Integer
- address_count, the owner number of asset -
Integer
- tx_count, the transacton amount of asset
-
-
Object
- pagination, paging information-
Integer
- start, paging start position -
Integer
- limit, data amount per page -
Integer
- total, total transaction amount -
Object
- _links, paging link-
String
- next, next paging link -
String
- prev, previous paging link
-
-
Curl -X GET /assets
{
"code": 200,
"msg": "",
"data": [
{
"total_supply": "1596306453.6991328000",
"decimals": 8,
"name": "BTM",
"symbol": "BTM",
"asset": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"issue_timestamp": 1629427444,
"program": "",
"is_bap_2": true
},
{
"total_supply": "1000000.0000000000",
"decimals": 8,
"name": "MAG",
"symbol": "MAG",
"asset": "a0a71c215764e342d10d003be6369baf4145d9c7977f7b8f6bf446e628d8b8b8",
"issue_timestamp": 1629427459,
"program": "ae20d66ab117eca2bba6aefed569e52d6bf68a7a4ad7d775cbc01f7b2cfcd798f7b22031ab3c2147c330c5e360b4e585047d1dea5f529476ad5aff475ecdd55541923120851b4a24975df6dbeb4f8e5348542764f85bed67b763875325aa5e45116751b35253ad",
"is_bap_2": true,
"definition": {
"description": {},
"logo": "",
"quorum": 2,
"reissue": true
}
},
{
"total_supply": "98667.0129104500",
"decimals": 8,
"name": "SUP",
"symbol": "SUP",
"asset": "47fcd4d7c22d1d38931a6cd7767156babbd5f05bbbb3f7d3900635b56eb1b67e",
"issue_timestamp": 1629427459,
"program": "0354df07cda069ae203c939b7ba615a49adf57b5b4c9c37e80666436970f8507d56a272539cabcb9e15151ad",
"is_bap_2": true,
"definition": {
"description": {},
"logo": "",
"quorum": 1,
"reissue": false
}
}
],
"pagination": {
"start": 0,
"limit": 10,
"total": 3,
"_links": {}
}
}
GET /asset
Query the asset detail by asset id
-
String
- asset, asset id,required
-
Integer
- code, status code -
String
- msg, error message -
Object
- asset, asset information-
String
- total_supply, total supply -
Integer
- decimals, numerical accuracy -
String
- name, asset name -
String
- symbol, asset symbol -
String
- asset, asset id -
Integer
- issue_timestamp, first issue time -
String
- program, issue program -
Bool
- is_bap_2, whether a bap-2 asset -
Object
- definition asset definition-
Object
- description asset description -
String
- logo, asset's logo -
Integer
- quorum, asset signatures amount -
Bool
- reissue, whether the asset support additional issuance
-
-
Object
- external (omit) -
Integer
- address_count, the owner number of asset -
Integer
- tx_count, the transacton amount of asset
-
Curl -X GET /asset?asset=a0a71c215764e342d10d003be6369baf4145d9c7977f7b8f6bf446e628d8b8b8
{
"code": 200,
"msg": "",
"data": {
"total_supply": "1000000.0000000000",
"decimals": 8,
"name": "MAG",
"symbol": "MAG",
"asset": "a0a71c215764e342d10d003be6369baf4145d9c7977f7b8f6bf446e628d8b8b8",
"issue_timestamp": 1629427459,
"program": "ae20d66ab117eca2bba6aefed569e52d6bf68a7a4ad7d775cbc01f7b2cfcd798f7b22031ab3c2147c330c5e360b4e585047d1dea5f529476ad5aff475ecdd55541923120851b4a24975df6dbeb4f8e5348542764f85bed67b763875325aa5e45116751b35253ad",
"is_bap_2": true,
"definition": {
"description": {},
"logo": "",
"quorum": 2,
"reissue": true
},
"external": {
"address_count": 50,
"tx_count": 3
}
}
}
GET /summary/daily
Query the address, block, transaction and other summary information in daily units. Only the information of the previous day can be queried on that day
-
Integer
- start, start time,timestamp format -
Integer
- end, start time,timestamp format
-
Integer
- code, status code -
String
- msg, error message -
Object
- data, summary information-
Integer
- new_address_count, daily new address -
Integer
- active_address_count, daily active address -
Integer
- block_count, daily new block amount -
Integer
- transaction_count, daily transactions amount -
String
- vote_amount, total daily vote amount -
String
- veto_amount, total daily veto amount -
Integer
- timestamp, time of daily statistics
-
Curl -X GET /summary/daily?start=1629614272&end=1629873563
{
"code": 200,
"msg": "",
"data": [
{
"block_count": 14400,
"transaction_count": 14917,
"vote_amount": "1159667250729465.00000000",
"veto_amount": "732844616000000.00000000",
"new_address_count": 17,
"active_address_count": 17,
"timestamp": 1629648000
},
{
"block_count": 14400,
"transaction_count": 14962,
"vote_amount": "713679135535571.00000000",
"veto_amount": "424472519090000.00000000",
"new_address_count": 111,
"active_address_count": 111,
"timestamp": 1629734400
}
]
}
GET /node/vote-transactions
Query all the voting transaction by node public key
-
String
- pub_key, node public key, required -
Integer
- start,paging start position -
Integer
- limit, data amount per page
-
Integer
- code, status code -
String
- msg, error message -
Array of Object
- data, voting transaction list-
Integer
- timestamp, transaction time -
String
- amount, vote or veto amount -
String
- voter, voter address -
String
- type, vote type,vote or veto -
String
- voted_pub_key, node public key
-
-
Object
- pagination, paging information-
Integer
- start, paging start position -
Integer
- limit, data amount per page -
Integer
- total, total transaction amount -
Object
- _links, paging link-
String
- next, next paging link -
String
- prev, previous paging link
-
-
Curl -X GET /node/vote-transactions?pub_key=f9003633ccbd8cc37e034f4dbe70d9fae980d437948d8cb908d0cab7909780d74a324b4decb5dfcd43fbc6b896ac066b7e02c733a1537360e933278a101a850c
{
"code": 200,
"msg": "",
"data": [
{
"timestamp": 1629557064,
"amount": "410000.00",
"voter": "bn1q95s6aen3qrez88ayz3ehql3c029kzv5unygajd",
"type": "2",
"voted_pub_key": "f9003633ccbd8cc37e034f4dbe70d9fae980d437948d8cb908d0cab7909780d74a324b4decb5dfcd43fbc6b896ac066b7e02c733a1537360e933278a101a850c"
},
{
"timestamp": 1629724344,
"amount": "290000.00",
"voter": "bn1q23q74m3xurqeys39ctp2xwhadr9l77wmsq7ps8",
"type": "2",
"voted_pub_key": "f9003633ccbd8cc37e034f4dbe70d9fae980d437948d8cb908d0cab7909780d74a324b4decb5dfcd43fbc6b896ac066b7e02c733a1537360e933278a101a850c"
},
{
"timestamp": 1629446640,
"amount": "250000.00",
"voter": "bn1q95s6aen3qrez88ayz3ehql3c029kzv5unygajd",
"type": "2",
"voted_pub_key": "f9003633ccbd8cc37e034f4dbe70d9fae980d437948d8cb908d0cab7909780d74a324b4decb5dfcd43fbc6b896ac066b7e02c733a1537360e933278a101a850c"
}
],
"pagination": {
"start": 0,
"limit": 10,
"total": 34,
"_links": {
"next": "/blockmeta/bytom2/v1/node/vote-transactions?limit=10&start=10"
}
}
}
by bytom
Coming soon