2020/11/23 Blocknet | API Documentation

Introduction

Blocknet Protocol Service Nodes XBridge XRouter XCloud

Getting Started

Wallet Setup XBridge Setup XRouter Setup XCloud Setup

XBridge APIBETA

dxMakeOrder dxMakePartialOrder dxTakeOrder dxCancelOrder dxGetOrder dxGetOrders dxGetOrderBook dxGetMyOrders dxFlushCancelledOrders dxGetOrderFills dxGetOrderHistory https://api.blocknet.co 1/92 2020/11/23 Blocknet | API Documentation

dxGetTradingData dxGetLocalTokens dxGetNetworkTokens dxGetTokenBalances dxGetNewTokenAddress dxGetUtxos dxSplitAddress dxSplitInputs dxLoadXBridgeConf Status Codes Error Codes

XRouter APIBETA

xrGetNetworkServices xrUpdateNetworkServices xrConnect xrConnectedNodes xrGetBlockCount xrGetBlockHash xrGetBlock xrGetBlocks xrDecodeRawTransaction xrGetTransaction xrGetTransactions xrSendTransaction xrGetReply xrShowConfigs xrReloadConfigs xrStatus

XCloud APIBETA

xrService xrServiceConsensus

Core API

getnetworkinfo listproposals servicenodelist

Web Endpoints

ticker (1.0) ticker (2.0) history status servicenodelist (web) dxgetnetworktokens (web) dxgetorders (web) xrgetnetworkservices (web)

Changelog Need Support?

Introduction

Blocknet provides a simple and powerful API to build previously impossible multi-chain applications that consume services on different , all while remaining 100% trustless and decentralized.

The API is accessible through command line (cli) with additional endpoints on the way. Code examples can be viewed in the dark panels next to each respective API call.

Please see Getting Started to begin using the APIs or continue reading below to learn more about the Blocknet Protocol, the different components, and how they all work.

Blocknet Protocol

Blocknet is an interoperability protocol that can be used as a 2nd layer on any compatible to enable decentralized communication and exchange between different blockchains in a permissionless and trustless manner. Blockchain interoperability comes in 2 parts: exchange (XBridge) and communication (XRouter).

BLOCK is the utility token of the Blocknet blockchain and powers the Blocknet Protocol. BLOCK is used to pay fees for the network's services, such as those provided by XBridge and XRouter. Through these fees, BLOCK is also used for compensation to participating Service Nodes to incentivize support.

https://api.blocknet.co 2/92 2020/11/23 Blocknet | API Documentation

Service Nodes

The protocol is supported by a network of Service Nodes, which are similar to masternodes with an increased level of participation. Service Nodes host full nodes of the supported blockchains, host microservices, verify UTXOs, route communication between blockchains, participate in governance by voting, and perform anti-spam and anti-DOS measures for the network. Read more about Service Nodes here.

Service Nodes earn 100% of fees from XBridge, XRouter, and XCloud services. If you'd like to operate your own Service Node, see the Service Node Setup Guide.

XBridge

XBridge provides the ability to perform true trustless and decentralized exchanges between any digital asset that is supported by the Blocknet Protocol via APIs (view list). When paired with XRouter, any application can perform exchanges between any compatible blockchains using a decentralized SPV implementation. Unlike every other "decentralized" exchange protocols, XBridge doesn't use derivatives (proxy tokens or colored coins), the entire process is done in a trustless manner, and it decentralizes the four components of an exchange:

Storage of Funds - Trading is non-custodial and occurs directly out of the client's wallet. Funds remain within the client's control throughout the entire process. Order Books - Orders are broadcasted directly peer-to-peer over the network. Each client compiles the order book themselves instead of relying on a central order book service. All integrators and services on the protocol share the orderbook and liquidity. Currently there is just support for a public order book, but there are plans for private order books and direct trading as well. Order Matching - This is performed peer-to-peer by the clients. Settlement - This is performed using BIP65 CLTV atomic swap contracts[1]. For blockchains that do not inherently support BIP65, such as , similar methods are being emulated to extend the protocol to those blockchains and subsequent assets.

[1] ACCT using Check Lock Time Verify (#4)

The exchange takes place on each respective blockchain with the process overlooked by a network of 400+ Service Nodes running full nodes of the compatible blockchains to ensure no malicious behavior is ocurring.

Note that once an exchange is completed, when the funds are received will be dependent on the blockchain's accepted confirmation time. By default, the required amount of confirmations for most assets is 0 and the funds aren't spent until each blockchain achieves their respective required amount of confirmations. For instance, let's look at an example of an exchange between BTC requiring 1 confirmation and BLOCK requiring 2 confirmations. BLOCK has a faster confirmation time so it will receive 2 confirmations while BTC has 0, but the funds will not be spent until BLOCK has at least 2 confirmation and BTC has at least 1 confirmation. Both conditions must be met. This setting applies to the asset that you are receiving. The setting for the asset that is being sold is set by the opposite party.

There is currently a fixed fee of 0.015 BLOCK to take (fill) an order and no fee to make(create) an order.

XBRIDGE DESIGN

The following diagrams depict the events of an exchange with various outcomes. As seen in the diagrams, a "client" refers to software utilizing the Blocknet Protocol, which can be a blockchain, microservice, dApp, mobile app, website, etc.

Successful Exchange (view full size image)

The flow of the diagram above is top-to-bottom, left-to-right:

1. The maker client creates an order locally. The order is put in new state. 2. The order is broadcasted to the network. A network transaction fee for the maker asset's blockchain is charged to the maker. 3. The Service Node network verifies the order is good. 4. The order is added to the order books, which the Service Nodes relay. The order is put in open state. 5. The taker client responds to take the order. A network transaction fee for the taker asset's blockchain is charged. A fixed 0.015 BLOCK fee is charged to the taker. The order is put in accepting state. 6. The Service Node network verifies the response to take the order is good. 7. The maker acknowledges the taker. The order is put in hold state. 8. The maker and trader assets are deposited into the atomic swap P2SH address. The order is put in created state. 9. The Service Nodes verify the terms of the atomic swap contract are good. https://api.blocknet.co 3/92 2020/11/23 Blocknet | API Documentation

10. The transactions to the P2SH meet the required amount of confirmations. 11. The P2SH secrets are spent to the opposite party. The order is put in signed state. The order is put in commited state. 12. The maker and taker successfully receive the exchanged assets. The order is put in finished state.

Failed Exchange - Bad Maker Order (view full size image)

The flow of the diagram above is top-to-bottom, left-to-right:

1. The maker client creates an order locally. The order is put in new state. 2. The order is broadcasted to the network. A network transaction fee for the maker asset's blockchain is charged to the maker. 3. The Service Node network verifies the order is bad. 4. The order is rejected by the network. The order is put in canceled state.

Failed Exchange - Bad Taker Response (view full size image)

The flow of the diagram above is top-to-bottom, left-to-right:

1. The maker client creates an order locally. The order is put in new state. 2. The order is broadcasted to the network. A network transaction fee for the maker asset's blockchain is charged to the maker. 3. The Service Node network verifies the order is good. 4. The order is added to the order books, which the Service Nodes relay. The order is put in open state. 5. The taker client responds to take the order. A network transaction fee for the taker asset's blockchain is charged. A fixed 0.015 BLOCK fee is charged to the taker. The order is put in accepting state. 6. The Service Node network verifies the response to take the order is bad. The order is put in canceled state.

https://api.blocknet.co 4/92 2020/11/23 Blocknet | API Documentation

Failed Exchange - Bad Atomic Swap Terms (view full size image)

The flow of the diagram above is top-to-bottom, left-to-right:

1. The maker client creates an order locally. The order is put in new state. 2. The order is broadcasted to the network. A network transaction fee for the maker asset's blockchain is charged to the maker. 3. The Service Node network verifies the order is good. 4. The order is added to the order books, which the Service Nodes relay. The order is put in open state. 5. The taker client responds to take the order. A network transaction fee for the taker asset's blockchain is charged. A fixed 0.015 BLOCK fee is charged to the taker. The order is put in accepting state. 6. The Service Node network verifies the response to take the order is good. 7. The maker acknowledges the taker. The order is put in hold state. 8. The maker and trader assets are deposited into the atomic swap P2SH address. The order is put in created state. 9. The Service Nodes verify the terms of the atomic swap contract are bad. 10. The funds in the P2SH addresses are redeemed back to the original party. The order is put in canceled state.

XBRIDGE FEES

Maker Fee - When creating an order with XBridge, there is no fee other than the transaction fee for the network of the asset being sold. This is the same type of fee you would incur if sending this asset to another party. Having no fee to place an order encourages market makers to add liquidity. This also makes it possible to acquire the BLOCK needed to take orders.

Taker Fee - When accepting an order with XBridge, a static fee of 0.015 BLOCK is charged at the time the order is taken. This fee is charged even if a trade is canceled or fails and is meant to discourage malicious behavior on the network. In addition to the 0.015 BLOCK fee, there is also the transaction fee for the network of the asset being sold. This is the same type of fee you would incur if sending this asset to another party. If the taker asset is BLOCK, there needs to be at least two UXTOs - one or more to cover the 0.015 BLOCK fee and one or more to cover the traded amount. In a future update, there will be a percent-based fee that’s charged when accepting an order, but the details of this are not yet finalized.

XBRIDGE USE CASES

Below is a non-exhaustive list of possible use cases that XBridge enables.

Decentralized Exchange - A truly decentralized exchange can fairly easily be created utilizing XBridge since the protocol handles the order placement, order books, order matching, and settlement. A DEX dApp has already been developed call Block DX. The codebase is entirely open source under MIT license and can be used to create a white label DEX.

Decentralized ShapeShift - The idea of a decentralized exchange can be abstracted to offer a simpler interface similar to ShapeShift where a user enter the amount they want to exchange and the best price is provided.

OTC Trading - Due to the nature of XBridge, it can be used to exchange large amounts securely with the funds always remaining the user's control.

XRouter

XRouter provides the Blocknet Protocol with a communication layer consisting of an inter-blockchain SPV client backend, enabling the verification of blockchain records without requiring users to download the full blockchain. This empowers development of lightweight microservice architectures that harness contracts, protocols, and services from other blockchains, laying a foundation for a decentralized API ecosystem.

Since XRouter functions on the TCP/IP level, it is compatible with any network. This includes public and private DLT's from , to IOTA, to .

Service Nodes earn 100% of fees from XBridge, XRouter, and XCloud services. If you'd like to operate your own Service Node, see the Service Node Setup Guide.

XROUTER DESIGN

The XRouter system utilizes the Service Node network to route calls from the client directly to the respective blockchain. There are 2 types of XRouter calls: submissions and queries.

https://api.blocknet.co 5/92 2020/11/23 Blocknet | API Documentation

XRouter submissions are calls that involve interactions with a blockchain, such as xrSendTransaction . With submissions, the packets are routed from the client to the respective blockchain and a response, if any, is routed back to the client.

XRouter queries are calls requesting information from a blockchain, such as xrGetBlockCount . With queries, the packets are also routed from the client to the respective blockchain and the response of the information queried is routed back to the client. XRouter queries can require a specific amount of Service Nodes to receive a response from in order to achieve consensus on the final answer.

XRouter Overview (view full size image)

The following diagrams depict the events of an XRouter query and submission. As seen in the diagrams, a "client" refers to software utilizing the Blocknet Protocol, which can be a blockchain, microservice, dApp, mobile app, website, etc.

XRouter Query (view full size image)

The flow of the diagram is top-to-bottom:

1. The client dispatches a packet for a query via API call to the Service Node network. 2. The Service Nodes supporting the queried blockchain receive the packet. 3. The Service Nodes route the packet of the query to the blockchain. 4. The Service Nodes route the response from the blockchain back to the client. 5. The client receives all responses, as well as a response for a majority consensus on the answer.

XRouter Submission (view full size image)

1. The client dispatches a packet for a submission via API call to the Service Node network. 2. The Service Nodes supporting the desired blockchain receive the packet. 3. The Service Nodes route the packet of the query to the blockchain. 4. If there is a response from the blockchain, the Service Nodes route the response back to the client. https://api.blocknet.co 6/92 2020/11/23 Blocknet | API Documentation

NAMESPACE

XRouter SPV wallets utlize the xrs:: namespace while XCloud services utilize the xrs:: namespace. A list of the SPV wallets and services can be viewed using xrGetNetworkServices and you can pre-connect to the nodes with xrConnect.

FEES

With XRouter, and subsequently XCloud, fees are determined by a free market. Service Nodes can specify the fee that they wish to charge for a call and client can specify the max fee they are willing to pay for calls.

XROUTER NODE SCORING

Clients keep a local score of each Service Node. When a Service Node reaches a score of -200 , the Service Node will be banned by the client for a 24hr period. After this 24hr period, the Service Node will start with a score of -25 . The ban score threshold can be adjusted using the xrouterbanscore setting in blocknet.conf (see setup).

Action Change in Score

Failure to respond to call within 30s -25

Failure to meet majority consensus -5

Matching consensus correct_nodes * 2

Sending bad XRouter config -10

Sending bad XCloud config -2

This mechanism and values are subject to change in future releases. Join the Developer mailing list to stay updated.

XROUTER USE CASES

The applications for XRouter are as vast and imaginative as the internet. Below are a few examples of use cases:

Supply Chain - In supply chain there will be multiple blockchains being used at various steps of the process much like there is today with traditional software stacks. The Blocknet Protocol and XRouter would allow information to be accessible between these different blockchains. For Example, pharmaceutical manufacturers have strict regulations to follow and need to provide certain information and assurances. Being able to access batch information from the raw materials being consumed, temperature and humidity information during transportation, and final destinations are all important. A utilizing XRouter to gather this information from each respective chain and write it to the pharmaceutical’s blockchain along with the batch code. XRouter would enable this communication to occur in a trustless way, which is important to ensure validity of the information.

Storage and Hosting - If creating a dApp on Ethereum, you may require storage functionality. Ethereum doesn’t intrinsically handle file storage very efficiently. In this scenario, XRouter can be used to interact with other blockchains such as Storj, , Sia, or Swarm to utilize their storage services.

Media and Content - For content creation, a creator has the option of publishing to the LBRY Credits or Alexandria blockchains. Similar to HootSuite, which is a tool that allows posting to multiple social media platforms simultaneously, a dApp can be created using XRouter that offers the same benefit. The user can post their content once, whether it’s audio, video, literature, or art, and have it published to Alexandria’s and LBRY Credit’s blockchain platform simultaneously.

Markets - There are many blockchains creating decentralized marketplaces including Origami, District0x, OpenBazaar, and Syscoin’s marketplace, but the offering of products are relatively low on each independent platform. A dApp that utilizes XRouter to aggregate all the products into a single hub would offer a lot more options to users and a fuller marketplace. It can also make publishing products easier by publishing to all platforms simultaneously through a single form, offering more exposure than posting to a single marketplace while saving time.

Business and Industry - There are many dApps and blockchains that will end up using health data. Rather than submitting health data to each application, a universal EHR (Electronic Health Record) blockchain can be created to manage personal medical data and accessibility of data by each application. The health data on this EHR ledger can be shared amongst healthcare providers, hospitals, and insurance blockchains, dApps, and applications via XRouter.

Certifications - Certifications and licensing records can be stored on a dedicated blockchain where they could be verified by a dApp built on the Blocknet Protocol. These records can be used to confirm qualifications and grant access or permissions.

XCloud

XCloud can be used to monetize any service with crypto payments without having to re-code or change anything about those existing applications. A good way to think of XCloud is like a decentralized AWS. CoinMarketCap could be connected in a matter of minutes and allow users to access their API for a fee paid in BLOCK, without requiring any signups or KYC.

XCloud sits on top of, and is powered by, XRouter. Services are hosted by Service Nodes and operate in a similar manner as the full node SPV wallets. For further explanation, refer to XRouter Design, Namespacing, Fees, and XRouter Node Scoring.

Service Nodes earn 100% of fees from XBridge, XRouter, and XCloud services. If you'd like to operate your own Service Node, see the Service Node Setup Guide.

Getting Started

The Blocknet Protocol currently requires a synced Blocknet wallet, as well as the synced wallet of any blockchain that will be interacted with. In the future, with the use of XRouter, this will not be required. In addition, configuration files must also be composed.

Wallet Setup

Sample blocknet.conf

https://api.blocknet.co 7/92 2020/11/23 Blocknet | API Documentation

listen=1 server=1 rpcallowip=127.0.0.1 rpcuser=user rpcpassword=pass port=41412 rpcport=41414

1. Download and install the latest Blocknet wallet. 2. Open the wallet, encrypt it, and sync the blockchain. A bootstrap is also available for faster syncing. 3. Compose blocknet.conf as seen in the sample. 4. Set an RPC username and password in blocknet.conf . 5. If using the XBridge API, see XBridge Setup. 6. If using the XRouter API, see XRouter Setup.

XBridge Setup

1. Follow the XBridge Setup Guide. 2. If you would just like to view orders without having the other wallets installed (view order books only, no trading), add dxnowallets=1 to your blocknet.conf or ShowAllOrders=true to the header of your xbridge.conf . 3. If any of the wallets are still open, they must be restarted in order to activate the new configurations. 4. Open, sync, and unlock the Blocknet wallet, as well as whichever blockchains will be interacted with. 5. Using the command line(cli), XBridge API calls can now be made. 6. If also using the XRouter API, see XRouter Setup.

Note: Segwit and Bech32 addresses are not currently compatible. Staked (p2pk) inputs are not currently compatible. Integrations of these addresses and inputs are planned.

XRouter Setup

If you would like to operate a Service Node and monetize any microservice, blockchain, API, or cloud tech on your own hardware, in many cases without having to write any code, see the Service Node Setup Guide.

Sample blocknet.conf

xrouterbanscore=-200 listen=1 server=1 rpcallowip=127.0.0.1 rpcuser=user rpcpassword=pass port=41412 rpcport=41414

Sample xrouter.conf

[Main] timeout=30 consensus=1 maxfee=0.5 tls=1

[BTC] maxfee=0.03

[xrGetBlockCount] maxfee=0.02 consensus=6

[SYS::xrGetBlockCount] maxfee=0.02

Note: If you would like to utilize XRouter without syncing the Blocknet chain, see the C++ library sample project for help getting started. If you would just like to test and play around with XRouter you can also check out the XRouter Service Explorer.

1. In blocknet.conf : Use xrouterbanscore to specify the score a Service Node must drop below before it is banned. The default value is -200 . Service Nodes are banned for a 24hr period, after which they'll start with a score of -25 . 2. Restart the Blocknet wallet. 3. Compose xrouter.conf as seen in the sample. All settings are optional. timeout - Defines how long (in seconds) your client waits for a response from a Service Node. The default value is 30 . consensus - The number of Service Nodes that are used to route calls and use the majority response from for consensus. This can be overridden when making calls via the node_count parameter. The default value is 1 . maxfee - The maximum fee you are willing to pay for calls. Service Nodes with fees higher than your specified max fee will not be queried. The default value is 0 (i.e. free calls only). For now, all fees are paid in BLOCK. https://api.blocknet.co 8/92 2020/11/23 Blocknet | API Documentation

tls - Enables TLS support for XRouter Enterprise (EXR) nodes. 4. Values set under [Main] override the default values and become the new default settings for all subsections that don't have the respective setting specified. Subsection settings override [Main] and default settings. Blockchain-specific subsections have the highest priority and override all other settings. The setting hierarchy from highiest priority to lowest priority is as follows: [BTC::xrGetBlockCount] > [BTC] > [xrGetBlockCount] > [Main] > default. The higher priority settings override the lower priority settings. 5. Use xrReloadConfigs to apply changes to xrouter.conf without needing to restart the client. 6. Using the command line(cli), XRouter API calls can now be made. To begin you can use xrGetNetworkServices to view the supported SPV wallets (designated by the xr:: namespace). To use services (designated by the xrs:: namespace), see XCloud Setup. 7. If also using the XBridge API, see XBridge Setup.

XCloud Setup

If you would like to operate a Service Node and monetize any microservice, blockchain, API, or cloud tech on your own hardware, in many cases without having to write any code, see the Service Node Setup Guide.

Sample xrouter.conf

[Main] timeout=30 consensus=1 maxfee=0.5

[xrs::ServiceName] maxfee=0.1 timeout=10 consensus=5

1. Setup XRouter. This is required since XCloud is built on top of XRouter. 2. In xrouter.conf , add settings for the services you would like to use. The subsection heading used the service name with the namespace as it's shown in the services array in the xrGetNetworkServices response. All settings are optional. timeout - Defines how long (in seconds) your client waits for a response from a Service Node. The default value is 30 . consensus - The number of Service Nodes that are used to route calls and use the majority response from for consensus. This can be overridden when making calls via the node_count parameter. The default value is 1 . maxfee - The maximum fee you are willing to pay for calls. Service Nodes with fees higher than your specified max fee will not be queried. The default value is 0 (i.e. free calls only). For now, all fees are paid in BLOCK. 3. Values set under [Main] override the default values and become the new default settings for all subsections that don't have the respective setting specified. Service settings override [Main] and default settings. The setting hierarchy from highiest priority to lowest priority is as follows: [xrs::ServiceName] > [Main] > default. The higher priority settings override the lower priority settings. 4. Use xrReloadConfigs to apply changes to xrouter.conf without needing to restart the client. 5. Using the command line(cli) or console, XCloud API calls can now be made. To begin, use xrGetNetworkServices to view the calls under services and use xrService or xrServiceConsensus to make the call. 6. If also using the XBridge API, see XBridge Setup.

XBridge API

The following set of calls are used to conduct decentralized and trustless exchanges over the Blocknet network.

See XBridge Setup for instructions on setting up your environment for use with XBridge.

Call Description

dxMakeOrder Create an exact order

dxMakePartialOrder Create a partial order

dxTakeOrder Take an existing order

dxCancelOrder Cancel your own order

dxGetOrder Returns order details by ID

dxGetOrders Returns all orders with details

dxGetOrderBook Returns open orders

dxGetMyOrders Returns all your own orders with details

dxFlushCancelledOrders Removes your cancelled orders

dxGetOrderFills Returns all recent filled orders

dxGetOrderHistory Returns the OHLCV data my market

dxGetTradingData Returns on-chain trading records

dxGetLocalTokens Returns all assets connected locally

dxGetNetworkTokens Returns all assets connected on the network https://api.blocknet.co 9/92 2020/11/23 Blocknet | API Documentation

Call Description

dxGetTokenBalances Returns available balances for your assets

dxGetNewTokenAddress Returns a newly generated address

dxGetUtxos Returns compatible UTXOs for asset

dxSplitAddress Splits UTXOs in a specified address

dxSplitInputs Splits specified UTXOs

dxLoadXBridgeConf Reloads the xbridge.conf

Status Codes XBridge order status codes

Error Codes Error codes

dxMakeOrder

Sample Data

{ "maker": "SYS", "maker_size": "0.100", "maker_address": "SVTbaYZ8oApVn3uNyimst3GKyvvfzXQgdK", "taker": "LTC", "taker_size": "0.01", "taker_address": "LVvFhzRoMRGTtGihHp7jVew3YoZRX8y35Z", "type": "exact" }

This call is used to create a new exact order. Exact orders must be taken for the full order amount. For partial orders, see dxMakePartialOrder.

INPUT SELECTION

Note: XBridge will first attempt use funds from the specified maker address. If this address does not have sufficient funds to cover the order, then it will pull funds from other addresses in the wallet. Change is deposited to the address with the largest input used. There are plans to add the capability of strictly only using funds from the specified address.

TRADEABLE ASSETS

You can only create orders for assets supported by your node (view with dxGetLocalTokens) and the network (view with dxGetNetworkTokens). If an asset is not showing for dxGetLocalTokens, it has not been properly configured (refer back to #2 in XBridge Setup).

FEES

There are no fees to make orders, but there are transaction fees for the maker asset's native network.

REQUEST PARAMETERS

Sample Request

blocknet-cli dxMakeOrder SYS 0.100 SVTbaYZ8oApVn3uNyimst3GKyvvfzXQgdK LTC 0.01 LVvFhzRoMRGTtGihHp7jVew3YoZRX8y35Z exact

dxMakeOrder [maker] [maker_size] [maker_address] [taker] [taker_size] [taker_address] [type] [dryrun](optional)

Parameter Type Description

maker string Maker trading asset; the ticker of the asset being sold by the maker.

maker_size string(float) Maker trading size. String is used to preserve precision.

maker_address string Maker address containing the outgoing asset.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

taker_size string(float) Taker trading size. String is used to preserve precision.

taker_address string Maker address for receiving the incoming asset.

This is the order type. type string exact : Matches a specific order. For partial orders, see dxMakePartialOrder.

(Optional Parameter) dryrun string dryrun : Validate the order without actually submitting the order to the network.

RESPONSE PARAMETERS

 200 OK https://api.blocknet.co 10/92 2020/11/23 Blocknet | API Documentation

Sample 200 Response

{ "id": "4306aa07113c4562ffa6278ecd9a3990ead53a0227f74ddd9122272e453ae07d", "maker": "SYS", "maker_size": "0.100", "maker_address": "SVTbaYZ8oApVn3uNyimst3GKyvvfzXQgdK", "taker": "LTC", "taker_size": "0.01", "taker_address": "LVvFhzRoMRGTtGihHp7jVew3YoZRX8y35Z", "updated_at": "2018-01-16T00:00:00.00000Z", "created_at": "2018-01-15T18:15:30.12345Z", "block_id": "38729344720578447445023782734923740427863289632489723984723", "order_type": "exact", "partial_minimum": "0.000000", "partial_repost": false, "status": "created" }

Key Type Description

id string The order ID.

maker string Maker trading asset; the ticker of the asset being sold by the maker.

maker_size string(float) Maker trading size. String is used to preserve precision.

maker_address string Maker address for sending the outgoing asset.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

taker_size string(float) Taker trading size. String is used to preserve precision.

taker_address string Maker address for receiving the incoming asset.

updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.

created_at string ISO 8601 datetime, with microseconds, of when the order was created.

block_id string The block hash of the current block on the Blocknet blockchain at the time the order was created.

order_type string The order type.

partial_minimum string The minimum amount that can be taken. This applies to partial order types and will show 0 on exact order types. See dxMakePartialOrder for more details.

partial_repost string Whether the order will be reposted or not. This applies to partial order types and will show false for exact order types. See dxMakePartialOrder for more details.

status string View order status codes

Sample 400 Response

{ "error": "Invalid parameters: Minimum supported size is 0.000001", "code": 1025, "name": "dxMakeOrder" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxMakeOrder" }

 500 Internal Server Error https://api.blocknet.co 11/92 2020/11/23 Blocknet | API Documentation

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1011 400 Invalid maker symbol

1012 400 Invalid taker symbol

1018 400 Unable to connect to wallet

1024 400 Size must be greater than 0

1025 400 Invalid parameters

1026 400 Bad address

1002 500 Internal server error

dxMakePartialOrder

Sample Data

{ "maker": "SYS", "maker_size": "1", "maker_address": "SVTbaYZ8oApVn3uNyimst3GKyvvfzXQgdK", "taker": "LTC", "taker_size": "0.1", "taker_address": "LVvFhzRoMRGTtGihHp7jVew3YoZRX8y35Z", "minimum_size": "0.2", "repost": true }

This call is used to create a new partial order. Partial orders don't require the entire order to be filled. For exact orders, see dxMakeOrder.

INPUT CREATION/SELECTION

When a partial order is created, multiple inputs will be selected or generated (see details below). Using multiple inputs is optimal for allowing partial orders of varying sizes while minimizing the amount of change (change is not reposted). This maximizes the amount remaining that can be immediately reposted.

The way input selection/generation is done depends on your total maker_size and minimum_size . XBridge will first attempt to find existing inputs that are properly sized for the order. If needed, existing inputs will automatically be split into the proper size at the time the order is posted. While the inputs are being generated, the order will remain in the new state. Once the generated inputs have 1 confirmation the order will proceed to the open state. View order states.

It is planned to extend this call to allow you to specify exactly which inputs you would like to use in an order so you can utilize your own strategies and pre-generate inputs so you can post orders immediately.

Note: XBridge will first attempt use funds from the specified maker address. If this address does not have sufficient funds to cover the order, then it will pull funds from other addresses in the wallet. Change is deposited to the address with the largest input used. There are plans to add the capability of strictly only using funds from the specified address.

TRADEABLE ASSETS

You can only create orders for assets supported by your node (view with dxGetLocalTokens) and the network (view with dxGetNetworkTokens). If an asset is not showing for dxGetLocalTokens, it has not been properly configured (refer back to #2 in XBridge Setup).

FEES

There are no fees to make orders, but there are transaction fees for the maker asset's native network.

REQUEST PARAMETERS

Sample Request

blocknet-cli dxMakePartialOrder SYS 1 SVTbaYZ8oApVn3uNyimst3GKyvvfzXQgdK LTC 0.1 LVvFhzRoMRGTtGihHp7jVew3YoZRX8y35Z 0.2 true

dxMakePartialOrder [maker] [maker_size] [maker_address] [taker] [taker_size] [taker_address] [minimum_size] [repost](optional) [dryrun](optional)

Parameter Type Description https://api.blocknet.co 12/92 2020/11/23 Blocknet | API Documentation

Parameter Type Description

maker string Maker trading asset; the ticker of the asset being sold by the maker.

maker_size string(float) Maker trading size. String is used to preserve precision.

maker_address string Maker address for sending the outgoing asset.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

taker_size string(float) Taker trading size. String is used to preserve precision.

taker_address string Maker address for receiving the incoming asset.

minimum_size string(float) The minimum maker amount that can be traded in the partial order.

(Optional Parameter) Defaults to true . repost string true : Receive filled orders for both the maker and taker assets as specified, as well as the inverse with the maker asset as the taker and the taker asset as the maker.

When the order is partially taken, the remainder will be reposted. This will happen continuously as long as the remaining size is greater than the specified minimum_size . false : When the order is partially taken, the remaining amount will not be reposted. dryrun | string | (Optional Parameter) dryrun : Validate the order without actually submitting the order to the network.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "id": "4306a107113c4562afa6273ecd9a3990ead53a0227f74ddd9122272e453ae07d", "maker": "SYS", "maker_size": "1.000000", "maker_address": "SVTbaYZ8olpVn3uNyImst3GKyrvfzXQgdK", "taker": "LTC", "taker_size": "0.100000", "taker_address": "LVvFhZroMRGTtg1hHp7jVew3YoZRX8y35Z", "updated_at": "2018-01-16T00:00:00.00000Z", "created_at": "2018-01-15T18:15:30.12345Z", "block_id": "38729344720548447445023782734923740427863289632489723984723", "order_type": "partial", "partial_minimum": "0.200000", "partial_repost": true, "status": "created" }

Key Type Description

id string The order ID. When partial orders are reposted they are given a new order ID.

maker string Maker trading asset; the ticker of the asset being sold by the maker.

maker_size string(float) Maker trading size. String is used to preserve precision.

maker_address string Maker address for sending the outgoing asset.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

taker_size string(float) Taker trading size. String is used to preserve precision.

taker_address string Maker address for receiving the incoming asset.

updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.

created_at string ISO 8601 datetime, with microseconds, of when the order was created.

block_id string The block hash of the current block on the Blocknet blockchain at the time the order was created.

order_type string The order type.

partial_minimum string The minimum amount that can be taken. This applies to partial order types and will show 0 on exact order types.

partial_repost string Whether the order will be reposted or not. This only applies to partial order types and will always show false if you are not the maker.

status string View order status codes

Sample 400 Response

{ "error": "Invalid parameters: Minimum supported size is 0.000001", "code": 1025, https://api.blocknet.co 13/92 2020/11/23 Blocknet | API Documentation

"name": "dxMakePartialOrder" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxMakePartialOrder" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1011 400 Invalid maker symbol

1012 400 Invalid taker symbol

1018 400 Unable to connect to wallet

1024 400 Size must be greater than 0

1025 400 Invalid parameters

1026 400 Bad address

1002 500 Internal server error

dxTakeOrder

Sample Data

{ "id": "4306aa07113c4562ffa6278ecd9a3990ead53a0227f74ddd9122272e453ae07d", "send_address": "LVvFhzRoMRGTtGihHp7jVew3YoZRX8y35Z", "receive_address": "SVTbaYZ8oApVn3uNyimst3GKyvvfzXQgdK", "dryrun": "dryrun" }

This call is used to take an order. Taking your own order is not supported. You can only take orders if the maker and taker assets are supported by your node (view with dxGetLocalTokens). If an asset is not showing for dxGetLocalTokens, it has not been properly configured (refer back to #2 in XBridge Setup).

Taking an order has a 0.015 BLOCK fee. There are also transaction fees for the taker asset's native network. If the taker asset is BLOCK, there needs to be at least two UXTOs - one or more to cover the 0.015 BLOCK fee and one or more to cover the traded amount.

Note: XBridge will first attempt use funds from the specified send address. If this address does not have sufficient funds to cover the order, then it will pull funds from other addresses in the wallet. Change is deposited to the address with the largest input used. There are plans to add the capability of strictly only using funds from the specified address.

REQUEST PARAMETERS https://api.blocknet.co 14/92 2020/11/23 Blocknet | API Documentation

Sample Request

blocknet-cli dxTakeOrder 4306aa07113c4562ffa6278ecd9a3990ead53a0227f74ddd9122272e453ae07d LVvFhzRoMRGTtGihHp7jVew3YoZRX8y35Z SVTbaYZ8oApVn3uNyimst3GKyvvfzXQgdK

dxTakeOrder [order_id] [send_address] [receive_address] [amount](optional) [dryrun](optional)

Parameter Type Description

order_id string ID of order being filled.

send_address string Taker address for sending the outgoing asset.

receive_address string Taker address for receiving the incoming asset.

(Optional Parameter) amount string The amount to take (only applies to partial orders).

(Optional Parameter) dryrun string dryrun : Validate the order without actually submitting the order to the network.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "id": "4306aa07113c4562ffa6278ecd9a3990ead53a0227f74ddd9122272e453ae07d", "maker": "SYS", "maker_size": "0.100", "taker": "LTC", "taker_size": "0.01", "updated_at": "1970-01-01T00:00:00.00000Z", "created_at": "2018-01-15T18:15:30.12345Z", "order_type": "exact", "partial_minimum": "0.000000", "partial_repost": false, "status": "accepting" }

Key Type Description

id string The order ID.

maker string Maker trading asset; the ticker of the asset being sold by the maker.

maker_size string(float) Maker trading size. String is used to preserve precision.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

taker_size string(float) Taker trading size. String is used to preserve precision.

updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.

created_at string ISO 8601 datetime, with microseconds, of when the order was created.

status string View order status codes.

Sample 400 Response

{ "error": "Transaction 4306aa07113c4562ffa6278ecd9a3990ead53a0227f74ddd9122272e453ae07d not found", "code": 1021, "name": "dxTakeOrder" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response https://api.blocknet.co 15/92 2020/11/23 Blocknet | API Documentation

{ "error": "Internal error occurred", "code": 1002, "name": "dxTakeOrder" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1011 400 Invalid maker symbol

1012 400 Invalid taker symbol

1020 400 Invalid order

1021 400 Invalid order id

1025 400 Invalid parameters

1026 400 Bad address

1002 500 Internal server error

dxCancelOrder

Sample Data

{ "id": "91d0ea83edc79b9a2041c51d08037cff87c181efb311a095dfdd4edbcc7993a9" }

This call is used to cancel one of your own orders, which automatically rolls back the order if a trade is in process. Upon closing the client, open orders are automatically cancelled.

REQUEST PARAMETERS

Sample Request

blocknet-cli dxCancelOrder 91d0ea83edc79b9a2041c51d08037cff87c181efb311a095dfdd4edbcc7993a9

dxCancelOrder [order_id]

Parameter Type Description

id string ID of order being cancelled.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "id": "91d0ea83edc79b9a2041c51d08037cff87c181efb311a095dfdd4edbcc7993a9", "maker": "SYS", "maker_size": "0.100", "maker_address": "SVTbaYZ8oApVn3uNyimst3GKyvvfzXQgdK", "taker": "LTC", "taker_size": "0.01", https://api.blocknet.co 16/92 2020/11/23 Blocknet | API Documentation

"taker_address": "LVvFhzRoMRGTtGihHp7jVew3YoZRX8y35Z", "updated_at": "1970-01-01T00:00:00.00000Z", "created_at": "2018-01-15T18:15:30.12345Z", "status": "canceled" }

Key Type Description

id string The order ID.

maker string Sending asset of party cancelling the order.

maker_size string(float) Sending trading size. String is used to preserve precision.

maker_address string Address for sending the outgoing asset.

taker string Receiving asset of party cancelling the order.

taker_size string(float) Receiving trading size. String is used to preserve precision.

taker_address string Address for receiving the incoming asset.

updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.

created_at string ISO 8601 datetime, with microseconds, of when the order was created.

status string View order status codes

Sample 400 Response

{ "error": "Invalid order id", "code": 1021, "name": "dxCancelOrder" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxCancelOrder" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1021 400 Invalid order id

1025 400 Invalid parameters

1002 500 Internal server error https://api.blocknet.co 17/92 2020/11/23 Blocknet | API Documentation

dxGetOrder

Sample Data

{ "id": "6be548bc46a3dcc69b6d56529948f7e679dd96657f85f5870a017e005caa050a" }

This call is used to retrieve order info.

REQUEST PARAMETERS

Sample Request

blocknet-cli dxGetOrder 6be548bc46a3dcc69b6d56529948f7e679dd96657f85f5870a017e005caa050a

dxGetOrder [order_id]

Parameter Type Description

id string ID of order of interest.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "id": "6be548bc46a3dcc69b6d56529948f7e679dd96657f85f5870a017e005caa050a", "maker": "SYS", "maker_size": "0.100", "taker": "LTC", "taker_size": "0.01", "updated_at": "1970-01-01T00:00:00.00000Z", "created_at": "2018-01-15T18:15:30.12345Z", "order_type": "exact", "partial_minimum": "0.000000", "partial_repost": false, "status": "open" }

Key Type Description

id string The order ID.

maker string Maker trading asset; the ticker of the asset being sold by the maker.

maker_size string(float) Maker trading size. String is used to preserve precision.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

taker_size string(float) Taker trading size. String is used to preserve precision.

updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.

created_at string ISO 8601 datetime, with microseconds, of when the order was created.

order_type string The order type.

partial_minimum string The minimum amount that can be taken. This applies to partial order types and will show 0 on exact order types.

partial_repost string Whether the order will be reposted or not. This applies to partial order types and will show false if you are not the maker of this order.

status string View order status codes

Sample 400 Response

{ "error": "Invalid order id", "code": 1021, "name": "dxGetOrder" }

 400 Bad Request https://api.blocknet.co 18/92 2020/11/23 Blocknet | API Documentation

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxGetOrder" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1021 400 Invalid order id

1025 400 Invalid parameters

1002 500 Internal server error

dxGetOrders

This call is used to retrieve all orders of every market pair.

Note: This call will only return orders for markets with both assets supported by your node (view with dxGetLocalTokens). To bypass this and view all orders, set ShowAllOrders=true in your xbridge.conf header and reload it with dxLoadXBridgeConf.

REQUEST PARAMETERS

Request

blocknet-cli dxGetOrders

dxGetOrders

This call does not take parameters.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ { "id": "91d0ea83edc79b9a2041c51d08037cff87c181efb311a095dfdd4edbcc7993a9", "maker": "SYS", "maker_size": "100.000000", "taker": "LTC", "taker_size": "10.500000", "updated_at": "2018-01-15T18:25:05.12345Z", "created_at": "2018-01-15T18:15:30.12345Z", "order_type": "partial", "partial_minimum": "10.000000", https://api.blocknet.co 19/92 2020/11/23 Blocknet | API Documentation

"partial_repost": false, "status": "open" }, { "id": "a1f40d53f75357eb914554359b207b7b745cf096dbcb028eb77b7b7e4043c6b4", "maker": "SYS", "maker_size": "0.100000", "taker": "LTC", "taker_size": "0.010000", "updated_at": "2018-01-15T18:25:05.12345Z", "created_at": "2018-01-15T18:15:30.12345Z", "order_type": "exact", "partial_minimum": "0.000000", "partial_repost": false, "status": "open" }, { "id": "6be548bc46a3dcc69b6d56529948f7e679dd96657f85f5870a017e005caa050a", "maker": "SYS", "maker_size": "4.000000", "taker": "LTC", "taker_size": "0.400000", "updated_at": "2018-01-15T18:25:05.12345Z", "created_at": "2018-01-15T18:15:30.12345Z", "order_type": "partial", "partial_minimum": "0.400000", "partial_repost": false, "status": "open" } ]

Key Type Description

Array array An array of all orders with each order having the following parameters.

id string The order ID.

maker string Maker trading asset; the ticker of the asset being sold by the maker.

maker_size string(float) Maker trading size. String is used to preserve precision.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

taker_size string(float) Taker trading size. String is used to preserve precision.

updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.

created_at string ISO 8601 datetime, with microseconds, of when the order was created.

order_type string The order type.

partial_minimum string The minimum amount that can be taken. This applies to partial order types and will show 0 on exact order types.

partial_repost string Whether the order will be reposted or not. This applies to partial order types and will show false if you are not the maker of this order.

status string View order status codes

Sample 400 Response

{ "error": "Invalid parameters: This function does not accept any parameters", "code": 1025, "name": "dxGetOrders" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", https://api.blocknet.co 20/92 2020/11/23 Blocknet | API Documentation

"code": 1002, "name": "dxGetOrders" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1025 400 Invalid parameters

1002 500 Internal server error

dxGetOrderBook

Sample Data

{ "detail": 1, "maker": "LTC", "taker": "SYS", "max_orders": 100 }

This call is used to retrieve open orders at various detail levels: Detail 1 - Retrieves the best bid and ask. Detail 2 - Retrieves a list of aggregated orders. This is useful for charting. Detail 3 - Retrieves a list of non-aggregated orders. This is useful for bot trading. Detail 4 - Retrieves the best bid and ask with the order GUIDs.

Note: This call will only return orders for markets with both assets supported by your node (view with dxGetLocalTokens). To bypass this and view all orders, set ShowAllOrders=true in your xbridge.conf header and reload it with dxLoadXBridgeConf.

REQUEST PARAMETERS

Sample Request

blocknet-cli dxGetOrderBook 1 LTC SYS 100

dxGetOrderBook [detail] [maker] [taker] [max_orders](optional)

Parameter Type Description

detail int Detail level: 1 , 2 , 3 , 4

maker string Maker trading asset; the ticker of the asset being sold by the maker.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

(Optional Parameter) Defaults to 50 . max_orders int The maximum total orders to display for bids and asks combined. Odd values are rounded up 1. Quantity is split evenly between bids and asks.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response (Detail 1)

{ "detail": 1, https://api.blocknet.co 21/92 2020/11/23 Blocknet | API Documentation

"maker": "LTC", "taker": "SYS", "bids": [ //[ price, size, quantity ], [ "253", "15", 1 ], ], "asks": [ //[ price, size, quantity ], [ "253.01", "15", 3 ], ] }

Detail 1 Retrieves the best bid and ask.

Key Type Description

detail int Detail level: 1

maker string Maker trading asset; the ticker of the asset being sold by the maker.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

bids array An array of the best bids.

- price string(float) The highest bid price for the asset. String is used to preserve precision.

- size string(float) The size of bid orders at this price. String is used to preserve precision.

- quantity int The total bid orders at this price.

asks array An array of the best asks.

- price string(float) The lowest ask price for the asset. String is used to preserve precision.

- size string(float) The size of ask orders at this price. String is used to preserve precision.

- quantity int The total ask orders at this price.

Sample 200 Response (Detail 2)

{ "detail": 2, "maker": "LTC", "taker": "SYS", "bids": [ //[ price, size, quantity ], [ "253.00", "15.00", 1 ] ], "asks": [ //[ price, size, quantity ], [ "254.15", "15.01", 3 ] ] }

Detail 2 Retrieves a list of aggregated orders. This is useful for charting.

Key Type Description

detail int Detail level: 2

maker string Maker trading asset; the ticker of the asset being sold by the maker.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

bids array An array of bids.

- price string(float) The bid price for the asset. String is used to preserve precision.

- size string(float) The size of bid orders at this price. String is used to preserve precision.

- quantity int The total bid orders at this price.

asks array An array of asks.

- price string(float) The ask price for the asset. String is used to preserve precision.

- size string(float) The size of ask orders at this price. String is used to preserve precision.

- quantity int The total ask orders at this price. https://api.blocknet.co 22/92 2020/11/23 Blocknet | API Documentation

Sample 200 Response (Detail 3)

{ "detail": 3, "maker": "LTC", "taker": "SYS", "bids": [ //[ price, size, order_id ], [ "253.00", "15.00", "0cc2e8a7222f1416cda996031ca21f67b53431614e89651887bc300499a6f83e" ] ], "asks": [ //[ price, size, order_id ], [ "254.15", "15.01", "b20f0028eb77b7b745c1953f7521cbef31f40d5543595196d7eb911db43c6434" ], [ "254.15", "15.01", "920f53f7521cbef3c64343b0020d554196d7eb98eb7735911db45b7b745c11f4" ], [ "254.15", "15.01", "1dbbf31f7b745c12120f0028eb7795196dbcbe4043c6434d554953f75357eb91" ] ] }

Detail 3 Retrieves a list of non-aggregated orders. This is useful for bot trading.

Key Type Description

detail int Detail level: 3

maker string Maker trading asset; the ticker of the asset being sold by the maker.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

bids array An array of bids.

- price string(float) The highest bid price for the asset. String is used to preserve precision.

- size string(float) The size of the bid order. String is used to preserve precision.

- order_id string The ID of the bid order.

asks array An array of asks.

- price string(float) The lowest ask price for the asset. String is used to preserve precision.

- size string(float) The size of the ask order. String is used to preserve precision.

- order_id string The ID of the ask order.

Sample 200 Response (Detail 4)

{ "detail": 4, "maker": "LTC", "taker": "SYS", "bids": [ //[ price, size, [order_ids] ], [ "253.00", "15", [ "920f53f7521cbef3c64343b0020d554196d7eb98eb7735911db45b7b745c11f4" ] ], ], "asks": [ //[ price, size, [order_ids] ], [ "254.00", "15", [ "32f5a551-3da6-4ff0-8ae6-0b60535c5237", "b20f0028eb77b7b745c1953f7521cbef31f40d5543595196d7eb911db43c6434", "a1f40d53f75357eb914554359b207b7b74 ] }

Detail 4 Retrieves the best bid and ask with the order GUIDs.

Key Type Description

detail int Detail level: 4

maker string Maker trading asset; the ticker of the asset being sold by the maker.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

bids array An array of the best bids.

- price string(float) The highest bid price for the asset. String is used to preserve precision.

- size string(float) The size of bid orders at this price. String is used to preserve precision.

- order_ids array An array of ID for bid orders at this price. https://api.blocknet.co 23/92 2020/11/23 Blocknet | API Documentation

Key Type Description

asks array An array of the best asks.

- price string(float) The lowest ask price for the asset. String is used to preserve precision.

- size string(float) The size of ask orders at this price. String is used to preserve precision.

- order_ids array An array of ID for ask orders at this price.

Sample 400 Response

{ "error": "Invalid detail level", "code": 1015, "name": "dxGetOrderBook" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxGetOrderBook" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1004 400 Bad request

1011 400 Invalid maker symbol

1012 400 Invalid taker symbol

1015 400 Invalid detail level

1025 400 Invalid parameters

1002 500 Internal server error

dxGetMyOrders

This call is used to retrieve all of your orders (of all states) from the local client. It will only return orders from your current session.

REQUEST PARAMETERS

Request https://api.blocknet.co 24/92 2020/11/23 Blocknet | API Documentation

blocknet-cli dxGetMyOrders

dxGetMyOrders

This call does not take parameters.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ { "id": "91d0ea83edc79b9a2041c51d08037cff87c181efb311a095dfdd4edbcc7993a9", "maker": "SYS", "maker_size": "100.000000", "taker": "LTC", "taker_size": "10.500000", "updated_at": "2018-01-15T18:25:05.12345Z", "created_at": "2018-01-15T18:15:30.12345Z", "order_type": "partial", "partial_minimum": "10.000000", "partial_repost": true, "status": "open" }, { "id": "a1f40d53f75357eb914554359b207b7b745cf096dbcb028eb77b7b7e4043c6b4", "maker": "SYS", "maker_size": "0.100000", "taker": "LTC", "taker_size": "0.010000", "updated_at": "2018-01-15T18:25:05.12345Z", "created_at": "2018-01-15T18:15:30.12345Z", "order_type": "exact", "partial_minimum": "0.000000", "partial_repost": false, "status": "open" }, { "id": "6be548bc46a3dcc69b6d56529948f7e679dd96657f85f5870a017e005caa050a", "maker": "SYS", "maker_size": "4.000000", "taker": "LTC", "taker_size": "0.400000", "updated_at": "2018-01-15T18:25:05.12345Z", "created_at": "2018-01-15T18:15:30.12345Z", "order_type": "partial", "partial_minimum": "0.400000", "partial_repost": false, "status": "open" } ]

Key Type Description

Array array An array of all orders with each order having the following parameters.

id string The order ID.

maker string Maker trading asset; the ticker of the asset being sold by the maker.

maker_size string(float) Maker trading size. String is used to preserve precision.

maker_address string Address for sending the outgoing asset.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

taker_size string(float) Taker trading size. String is used to preserve precision.

taker_address string Address for receiving the incoming asset.

updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.

created_at string ISO 8601 datetime, with microseconds, of when the order was created.

order_type string The order type.

partial_minimum string The minimum amount that can be taken. This applies to partial order types and will show 0 on exact order types. https://api.blocknet.co 25/92 2020/11/23 Blocknet | API Documentation

Key Type Description

partial_repost string Whether the order will be reposted or not. This applies to partial order types and will show false for exact order types.

status string View order status codes

Sample 400 Response

{ "error": "Invalid parameters: This function does not accept any parameters", "code": 1025, "name": "dxGetMyOrders" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxGetMyOrders" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1025 400 Invalid parameters

1002 500 Internal server error

dxFlushCancelledOrders

Sample Data

{ "ageMillis": 600000 }

This call is used to remove your cancelled orders that are older than the specified amount of time.

REQUEST PARAMETERS

Sample Request

blocknet-cli dxFlushCancelledOrders 600000

dxFlushCancelledOrders [ageMillis](optional) https://api.blocknet.co 26/92 2020/11/23 Blocknet | API Documentation

Parameter Type Description

(Optional Parameter) Defaults to 0 . ageMillis int Remove cancelled orders older than this amount of milliseconds. If 0 , all cancelled orders will be removed.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "ageMillis": 0, "now": "20191126T024005.352285", "durationMicrosec": 0, "flushedOrders": [ { "id": "582a02ada05c8a4bb39b34de0eb54767bcb95a7792e5865d3a0babece4715f47", "txtime": "20191126T023945.855058", "use_count": 1 }, { "id": "a508cd8d110bdc0b1fd819a89d94cdbf702e3aa40edbe654af5d556ff3c43a0a", "txtime": "20191126T023956.270409", "use_count": 1 } ] }

Key Type Description

ageMillis int The millisecond value specified when making the call.

now* string ISO 8601 datetime, with microseconds, of when the call was executed.

durationMicrosec* int The amount of time in milliseconds it took to process the call.

flushedOrders array Array of cancelled orders that were removed.

id string The order ID.

txtime string ISO 8601 datetime, with microseconds, of when the order was created.

use_count* int This value is strictly for debugging purposes.

* For debugging purposes

Sample 400 Response

{ "error": "Invalid parameters: ageMillis must be an integer >= 0", "code": 1025, "name": "dxFlushCancelledOrders" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxFlushCancelledOrders" }

 500 Internal Server Error https://api.blocknet.co 27/92 2020/11/23 Blocknet | API Documentation

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1011 400 Invalid maker symbol

1012 400 Invalid taker symbol

1025 400 Invalid parameters

1002 500 Internal server error

dxGetOrderFills

Sample Data

{ "maker": "SYS", "taker": "LTC", "combined": false }

This call is used to retrieve all recent filled orders by a given trade pair. It will only return orders that have been filled in your current session.

REQUEST PARAMETERS

Sample Request

blocknet-cli dxGetOrderFills SYS LTC false

dxGetOrderFills [maker] [taker] [combined](optional)

Parameter Type Description

maker string Maker trading asset; the ticker of the asset being sold by the maker.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

(Optional Parameter) Defaults to true . combines bool true : Receive filled orders for both the maker and taker assets as specified, as well as the inverse with the maker asset as the taker and the taker asset as the maker. false : Receive filled orders only with the maker and taker assets as specified.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ { "id": "a1f40d53f75357eb914554359b207b7b745cf096dbcb028eb77b7b7e4043c6b4", "time": "2018-01-16T13:15:05.12345Z", "maker": "SYS", "maker_size": "101.00000000", "taker": "LTC", "taker_size": "0.01000000" }, { "id": "91d0ea83edc79b9a2041c51d08037cff87c181efb311a095dfdd4edbcc7993a9", "time": "2018-01-16T13:15:05.12345Z", "maker": "LTC", "maker_size": "0.01000000", "taker": "SYS", https://api.blocknet.co 28/92 2020/11/23 Blocknet | API Documentation

"taker_size": "101.00000000" } ]

Key Type Description

Array array Array of orders sorted by date descending (most recent filled trade first).

id string The order ID.

time string Time the order was filled.

maker string Maker trading asset; the ticker of the asset being sold by the maker.

maker_size string(float) Maker trading size. String is used to preserve precision.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

taker_size string(float) Taker trading size. String is used to preserve precision.

Sample 400 Response

{ "error": "Invalid parameters: (maker) (taker) (combined, default=true)[optional]", "code": 1025, "name": "dxGetOrderFills" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxGetOrderFills" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1011 400 Invalid maker symbol

1012 400 Invalid taker symbol

1025 400 Invalid parameters

1002 500 Internal server error

dxGetOrderHistory https://api.blocknet.co 29/92 2020/11/23 Blocknet | API Documentation

Sample Data

{ "maker": "SYS", "taker": "LTC", "start_time": 1540660180, "end_time": 1540660420, "granularity": 60 }

This call is used to retrieve the OHLCV data by trade pair for a specified time range and interval. It can return the order history for any compatible asset since all trade history is stored on-chain.

REQUEST PARAMETERS

Sample Request

blocknet-cli dxGetOrderHistory SYS LTC 1540660180 1540660420 60 true

dxGetOrderHistory [maker] [taker] [start_time] [end_time] [granularity] [order_ids](optional) [with_inverse](optional) [limit](optional)

Parameter Type Description

maker string Maker trading asset; the ticker of the asset being sold by the maker.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

start_time int The Unix time in seconds for the start time boundary to search.

end_time int End Unix time in seconds for the end time boundary to search.

Time interval slice in seconds: granularity int 60 , 300 , 900 , 3600 , 21600 , 86400

(Optional Parameter) Defaults to false . order_ids bool true : Receive the GUIDs of all filled orders in each slice. false : Do not receive the order GUIDs.

(Optional Parameter) Defaults to false . with_inverse bool false : Returns the orders in the specified market pair. true : Returns the orders in the inverse pair too, e.g. LTC SYS -> SYS LTC would be returned as well.

(Optional Parameter) Defaults to 2147483647 . limit int The max number of interval slices returned.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ //[ time, low, high, open, close, volume, id(s) ], [ "2018-01-16T13:15:05.12345Z", 1.10, 2.0, 1.10, 1.4, 1000, [ "0cc2e8a7222f1416cda996031ca21f67b53431614e89651887bc300499a6f83e" ] ], [ "2018-01-16T14:15:05.12345Z", 0, 0, 0, 0, 0, [] ], [ "2018-01-16T15:15:05.12345Z", 1.12, 2.2, 1.10, 1.4, 1000, [ "91d0ea83edc79b9a2041c51d08037cff87c181efb311a095dfdd4edbcc7993a9", "0cc2e8a7222f1416cda996031ca21f67b [ "2018-01-16T16:15:05.12345Z", 1.14, 2.0, 1.10, 1.4, 1000, [ "a1f40d53f75357eb914554359b207b7b745cf096dbcb028eb77b7b7e4043c6b4" ] ], [ "2018-01-16T17:15:05.12345Z", 1.15, 2.0, 1.10, 1.4, 1000, [ "6be548bc46a3dcc69b6d56529948f7e679dd96657f85f5870a017e005caa050a" ] ] ]

Key Type Description

time string ISO 8601 datetime, with microseconds, of the time at the beginning of the time slice.

low float64 Exchange rate lower bound within the time slice.

high float64 Exchange rate upper bound within the time slice.

open float64 Exchange rate of first filled order at the beginning of the time slice.

close float64 Exchange rate of last filled order at the end of the time slice.

volume int64 Total volume of the taker asset within the time slice.

order_ids array Array of GUIDs of all filled orders within the time slice.

Sample 400 Response

https://api.blocknet.co 30/92 2020/11/23 Blocknet | API Documentation

{ "error": "Invalid parameters: granularity=6 must be one of: 60,300,900,3600,21600,86400", "code": 1025, "name": "dxGetOrderHistory" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxGetOrderHistory" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1004 400 Bad request

1011 400 Invalid maker symbol

1012 400 Invalid taker symbol

1025 400 Invalid parameters

1002 500 Internal server error

dxGetTradingData

This call returns the XBridge trading records. This information is pulled from on-chain history so pulling a large amount of blocks will result in longer response times.

This call replaces the gettradingdata call, which will be deprecated. Please update to use dxGetTradingData as soon as possible

REQUEST PARAMETERS

Sample Request

blocknet-cli dxGetTradingData 1440

dxGetTradingData [blocks](optional) [errors](optional)

Parameter Type Description

(Optional Parameter) Defaults to 43200 . blocks int Number of blocks to return trade records for (60s block time).

(Optional Parameter) Defaults to false . errors bool Shows an error if an error is detected. This may be useful if you're building a custom client and change the on-chain order history data format. https://api.blocknet.co 31/92 2020/11/23 Blocknet | API Documentation

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ { "timestamp" : 1559970139, "fee_txid" : "4b409e5c5fb1986930cf7c19afec2c89ac2ad4fddc13c1d5479b66ddf4a8fefb", "nodepubkey" : "Bqtms8j1zrE65kcpsEorE5JDzDaHidMtLG", "id" : "9eb57bac331eab34f3daefd8364cdb2bb05259c407d805d0bd0c", "taker" : "BLOCK", "taker_size" : 0.001111, "maker" : "SYS", "maker_size" : 0.001000 }, { "timestamp" : 1559970139, "fee_txid" : "3de7479e8a88ebed986d3b7e7e135291d3fd10e4e6d4c6238663db42c5019286", "nodepubkey" : "Bqtms8j1zrE65kcpsEorE5JDzDaHidMtLG", "id" : "fd0fed3ee9fe557d5735768c9bdcd4ab2908165353e0f0cef0d5", "taker" : "BLOCK", "taker_size" : 0.001577, "maker" : "SYS", "maker_size" : 0.001420 }, { "timestamp" : 1559970139, "fee_txid" : "9cc4a0dae46f2f1849b3ab6f93ea1c59aeaf0e95662d90398814113f12127eae", "nodepubkey" : "BbrQKtutGBLuWHvq26EmHKuNaztnfBFWVB", "id" : "f74c614489bd77efe545c239d1f9a57363c5428e7401b2018d350", "taker" : "BLOCK", "taker_size" : 0.000231, "maker" : "SYS", "maker_size" : 0.001100 } ]

Key Type Description

timestamp int Unix epoch timestamp of when the trade took place.

fee_txid string The Blocknet trade fee transaction ID.

nodepubkey string Service Node that received the trade fee.

id string XBridge transaction ID.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

taker_size int Taker trading size.

maker string Maker trading asset; the ticker of the asset being sold by the maker.

maker_size int Maker trading size.

dxGetLocalTokens

This call is used to retrieve all the assets supported by your node. If an asset is not showing for dxGetLocalTokens, it has not been properly configured (refer back to #2 in XBridge Setup).

REQUEST PARAMETERS

Request

blocknet-cli dxGetLocalTokens

dxGetLocalTokens

This call does not take parameters.

RESPONSE PARAMETERS

 200 OK https://api.blocknet.co 32/92 2020/11/23 Blocknet | API Documentation

Sample 200 Response

[ "BLOCK", "LTC", "MONA", "SYS" ]

Key Type Description

Array array An array of all the assets supported by the local client.

Sample 400 Response

{ "error": "Bad request", "code": 1004, "name": "dxGetLocalTokens" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxGetLocalTokens" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1004 400 Bad request

1025 400 Invalid parameters

1002 500 Internal server error

dxGetNetworkTokens

This call is used to retrieve all the assets currently supported by the network. This list may differ from the compatibility list due to assets being unofficially supported or assets not being supported by any nodes on the network.

REQUEST PARAMETERS

Request https://api.blocknet.co 33/92 2020/11/23 Blocknet | API Documentation

blocknet-cli dxGetNetworkTokens

dxGetNetworkTokens

This call does not take parameters.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ "LTC", "SYS", "MONA", "BLOCK" ]

Key Type Description

Array array An array of all the assets supported by the network.

Sample 400 Response

{ "error": "Bad request", "code": 1004, "name": "dxGetNetworkTokens" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxGetNetworkTokens" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1004 400 Bad request

1025 400 Invalid parameters

1002 500 Internal server error https://api.blocknet.co 34/92 2020/11/23 Blocknet | API Documentation

dxGetTokenBalances

This call is used to retrieve the asset available balances for all connected wallets on the local client. This will only return balances for the assets supported by your node (view with dxGetLocalTokens). If an asset is not showing for dxGetLocalTokens, it has not been properly configured (refer back to #2 in XBridge Setup).

Note: These balances do not include Segwit UTXOs or those being used in open or in process orders. XBridge works best with pre-sliced UTXOs so that your entire wallet balance is capable of multiple simultaneous trades. Use dxSplitInputs or dxSplitAddress to generate trading inputs.

REQUEST PARAMETERS

Request

blocknet-cli dxGetTokenBalances

dxGetTokenBalances

This call does not take parameters.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "LTC": "0.568942", "SYS": "1050.128493", "MONA": "3.452", "BLOCK": "250.83492174" }

Key Type Description

Object object Key-value object of the assets and respective balances.

-- key string The asset symbol.

-- value string(float) The available wallet balance amount. String is used to preserve precision.

Sample 400 Response

{ "error": "Bad request", "code": 1004, "name": "dxGetTokenBalances" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxGetTokenBalances" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code https://api.blocknet.co 35/92 2020/11/23 Blocknet | API Documentation

Key Type Description

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1004 400 Bad request

1025 400 Invalid parameters

1002 500 Internal server error

dxGetNewTokenAddress

Sample Data

{ "asset": "SYS" }

This call is used to generate a new address for the specified asset.

Note: This call will only work for the assets supported by your node (view with dxGetLocalTokens). If an asset is not showing for dxGetLocalTokens, it has not been properly configured (refer back to #2 in XBridge Setup).

REQUEST PARAMETERS

Sample Request

blocknet-cli dxGetNewTokenAddress SYS

dxGetNewTokenAddress [asset]

Parameter Type Description

asset string The ticker of the asset you want to generate an address for.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ "SVTbaYZ8oApVn3uNyimst3GKyvvfzXQgdK" ]

Key Type Description

Array array An array containing the newly generated address for the given asset.

Sample 400 Response

{ "error": "Bad request", "code": 1004, "name": "dxGetNewTokenAddress" }

 400 Bad Request

Key Type Description

error string Error message https://api.blocknet.co 36/92 2020/11/23 Blocknet | API Documentation

Key Type Description

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxGetNewTokenAddress" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1004 400 Bad request

1025 400 Invalid parameters

1002 500 Internal server error

dxGetUtxos

Sample Data

{ "asset": "BLOCK" }

Returns all compatible and unlocked UTXOs for the specified asset. Currently only P2PKH UTXOs are supported (Segwit UTXOs not supported).

Note: You can only view UTXOs for assets supported by your node (view with dxGetLocalTokens). If an asset is not showing for dxGetLocalTokens, it has not been properly configured (refer back to #2 in XBridge Setup).

REQUEST PARAMETERS

Sample Request

blocknet-cli dxGetUtxos BLOCK

dxGetUtxos [asset] [include_used](optional)

Parameter Type Description

asset string The ticker of the asset you want to view UTXOs for.

(Optional Parameter) Defaults to false . include_used bool true : Include UTXOs used in existing orders. false : Only show UXTOs not used in existing orders.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response https://api.blocknet.co 37/92 2020/11/23 Blocknet | API Documentation

[ { "txid": "c019edf2a71efcfc9b1ec50cd0d9db54c55b74acd0bcc81cefd6ffbba359a210", "vout": 2, "amount": "3.26211780", "address": "BrPHj12ZSm7roD2gvrjRG2gD4TzeP1YDXG", "scriptPubKey": "7b1ef56a92cec50cd0d147876a914ffd6fcbb4c5724a4057de", "confirmations": 11904, "orderid": "" }, { "txid": "a91c224c0725745cd0bcc81cefd6ffbba3f6cc36956cd566c50cd0d9db5c55b7", "vout": 0, "amount": "2.44485198", "address": "BJYS5dd4Mx5bFxfYDX136SLrv5kGCZaUtF", "scriptPubKey": "7e36ab914fc645b2b9fd5ce704f54bc34a59a56c9671eb355b", "confirmations": 20690, "orderid": "e1b0f4bf05e6c47506abf5d717c95baa1b6de79dd1758673a8cdd171ddad6578" }, { "txid": "01f74e6d7e5eade3e555fea978ec1be1cd9006406a4054ba1f74e6d349c67586", "vout": 0, "amount": "0.18996410", "address": "BZJjXdv3XSJcJc132gDi136SLrv5kdd4Mx", "scriptPubKey": "7a47f87fb0bcc81cefd6ffbeb596b786fcfe45878d41fe2110", "confirmations": 142995, "orderid": "" } ]

Key Type Description

txid string Transaction ID of the UTXO.

vout int Vout index of the UTXO.

amount string UTXO amount.

address string UTXO address.

scriptPubKey string UTXO address script pubkey.

confirmations int UTXO blockchain confirmation count.

orderid string The order ID if the UTXO is currently being used in an order.

Sample 400 Response

{ "error": "Unable to connect to wallet", "code": 1018, "name": "dxGetUtxos" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxGetUtxos" }

 500 Internal Server Error

Key Type Description https://api.blocknet.co 38/92 2020/11/23 Blocknet | API Documentation

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1018 400 Unable to connect to wallet

1002 500 Internal server error

dxSplitAddress

Sample Data

{ "asset": "BLOCK", "split_amount": "4", "address": "BWQrvmuHB4C68KH5V7fcn9bFtWN8y5hBmR" }

Splits unused coin in the given address into the specified size. Left over amounts end up in change. UTXOs being used in existing orders will not be included by the splitter (see dxGetUtxos).

Note: You can only split UTXOs for assets supported by your node (view with dxGetLocalTokens). If an asset is not showing for dxGetLocalTokens, it has not been properly configured (refer back to #2 in XBridge Setup).

REQUEST PARAMETERS

Sample Request

blocknet-cli dxSplitAddress BLOCK 4 BWQrvmuHB4C68KH5V7fcn9bFtWN8y5hBmR

dxSplitAddress [asset] [split_amount] [address] [include_fees](optional) [show_rawtx](optional) [submit](optional)

Parameter Type Description

asset string The ticker of the asset you want to split UTXOs for.

split_amount string The desired output size. For example, an address with a balance of 10 and split amount of 2.5 would yield 4 UTXOs at 2.5 each.

address string The address to split UTXOs in. Only coin in this address will be split.

(Optional Parameter) Defaults to true . include_fees bool true : Include the trade P2SH deposit fees in the split UTXO (add deposit fee to spit_amount value. false : Ignore the deposit fees and make the split UTXO exactly for the split_amount .

(Optional Parameter) Defaults to false . show_rawtx bool true : Include the raw transaction in the response (can be submitted manually). false : Omit the raw transaction from the response.

(Optional Parameter) Defaults to true . submit bool true : Submit the raw transaction to the network. false : Do not submit the raw transaction to the network.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "token": "BLOCK", "include_fees": true, "split_amount_requested": "4.0", "split_amount_with_fees": "4.00040000", "split_utxo_count": 6, "split_total": "24.44852981", https://api.blocknet.co 39/92 2020/11/23 Blocknet | API Documentation

"txid": "7f87cba104b3c19f6e25fbc82b3cde5d73714e01d6a54943d3c8fb07ce315db4", "rawtx": "" }

Key Type Description

token string The asset you are splitting UTXOs for.

include_fees bool Whether you requested to include the fees.

split_amount_requested string The requested split amount.

split_amount_with_fees string(float) The requested split amount with fees included.

split_utxo_count int The amount of resulting split UTXOs.

split_total string(float) The total amount of in the address prior to splitting.

txid string The hex string of the splitting transaction.

rawtx string The hex string of the raw splitting transaction.

Sample 400 Response

{ "error": "Unable to connect to wallet", "code": 1018, "name": "dxSplitAddress" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxSplitAddress" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1018 400 Unable to connect to wallet

1002 500 Internal server error

dxSplitInputs

Sample Data https://api.blocknet.co 40/92 2020/11/23 Blocknet | API Documentation

{ "asset": "BLOCK", "split_amount": "4", "address": "BWQrvmuHB4C68KH5V7fcn9bFtWN8y5hBmR" "include_fees": true, "show_rawtx": false, "submit": true, "utxos": [{"txid":"7a54943d3cf87cba104c82b3cde5d7371b3c19f6e25fb4e01d68fb07ce315db4","vout":0},...] }

Splits specified UTXOs into the given size and address. Left over amounts end up in change. UTXOs being used in existing orders will not be included by the splitter (see dxGetUtxos).

Note: You can only split UTXOs for assets supported by your node (view with dxGetLocalTokens). If an asset is not showing for dxGetLocalTokens, it has not been properly configured (refer back to #2 in XBridge Setup).

REQUEST PARAMETERS

Sample Request

blocknet-cli dxSplitInputs BLOCK 4 BWQrvmuHB4C68KH5V7fcn9bFtWN8y5hBmR true false true [{"txid":"7a54943d3cf87cba104c82b3cde5d7371b3c19f6e25fb4e01d68fb07ce315db4","vou

dxSplitInputs [asset] [split_amount] [address] [include_fees] [show_rawtx] [submit] [utxos]

Parameter Type Description

asset string The ticker of the asset you want to split UTXOs for.

split_amount string The desired output size. For example, an address with a balance of 10 and split amount of 2.5 would yield 4 UTXOs at 2.5 each.

address string The address split UTXOs and change will be sent to.

true : Include the trade P2SH deposit fees in the split UTXO (add deposit fee to spit_amount value. include_fees bool false : Ignore the deposit fees and make the split UTXO exactly for the split_amount .

true : Include the raw transaction in the response (can be submitted manually). show_rawtx bool false : Omit the raw transaction from the response.

true : Submit the raw transaction to the network. submit bool false : Do not submit the raw transaction to the network.

utxos array A JSON array of UTXO input objects.

- txid string The UTXO transaction ID.

- vout int The UTXO output index.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "token": "BLOCK", "include_fees": true, "split_amount_requested": "4.0", "split_amount_with_fees": "4.00040000", "split_utxo_count": 6, "split_total": "24.44852981", "txid": "7f87cba104b3c19f6e25fbc82b3cde5d73714e01d6a54943d3c8fb07ce315db4", "rawtx": "" }

Key Type Description

token string The asset you are splitting UTXOs for.

include_fees bool Whether you requested to include the fees.

split_amount_requested string The requested split amount.

split_amount_with_fees string(float) The requested split amount with fees included.

split_utxo_count int The amount of resulting split UTXOs.

split_total string(float) The total amount of in the address prior to splitting.

txid string The hex string of the splitting transaction. https://api.blocknet.co 41/92 2020/11/23 Blocknet | API Documentation

Key Type Description

rawtx string The hex string of the raw splitting transaction.

Sample 400 Response

{ "error": "Unable to connect to wallet", "code": 1018, "name": "dxSplitInputs" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxSplitInputs" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1018 400 Unable to connect to wallet

1002 500 Internal server error

dxLoadXBridgeConf

This call is used to reload xbridge.conf to run newly configured settings without needing to restart the Blocknet client.

Note: This may disrupt trades in progress.

REQUEST PARAMETERS

Request

blocknet-cli dxLoadXBridgeConf

dxLoadXBridgeConf

This call does not take parameters.

RESPONSE PARAMETERS

 200 OK https://api.blocknet.co 42/92 2020/11/23 Blocknet | API Documentation

200 Response

true

Type Description

bool true : Successfully reloaded file.

Sample 400 Response

{ "error": "Bad request", "code": 1004, "name": "dxLoadXBridgeConf" }

 400 Bad Request

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

Sample 500 Response

{ "error": "Internal error occurred", "code": 1002, "name": "dxLoadXBridgeConf" }

 500 Internal Server Error

Key Type Description

error string Error message

code int Error code

name string Name of the RPC function

 Error Codes

Code Type Error

1001 401 Unauthorized

1004 400 Bad request

1025 400 Invalid parameters

1002 500 Internal server error

Status Codes

The XBridge API uses the following order status codes:

Status Description

new New order, not yet broadcasted

open Open order, waiting for taker

accepting Taker accepting order

hold Counterparties acknowledge each other https://api.blocknet.co 43/92 2020/11/23 Blocknet | API Documentation

Status Description

initialized Counterparties agree on order

created Swap process starting

commited Swap finalized

finished Order complete

expired Order expired

offline Maker or taker went offline

canceled Order was canceled

invalid Problem detected with the order

rolled back Trade failed, funds being rolled back

rollback failed Funds unsuccessfully redeemed in failed trade

Error Codes

The XBridge API uses the following error codes:

Code Type Error

1004 400 Bad request

1011 400 Invalid maker symbol

1012 400 Invalid taker symbol

1015 400 Invalid detail level

1016 400 Invalid time

1017 400 Invalid asset

1018 400 Unable to connect to wallet

1019 400 Insufficient funds

1020 400 Funds not signed for

1021 400 Invalid order ID

1022 400 Unknown session

1023 400 Revert transaction failed

1024 400 Invalid amount

1025 400 Invalid parameters

1026 400 Invalid address

1027 400 Invalid signature

1028 400 Invalid state

1029 400 Not an exchange node

1030 400 Dust amount

1031 400 Insufficient funds

1032 400 Unsupported asset

1024 400 Size must be greater than 0

1001 401 Unauthorized

1002 500 Internal server error

XRouter API

https://api.blocknet.co 44/92 2020/11/23 Blocknet | API Documentation

The following set of calls are used to communicate and interact with blockchains remotely over the Blocknet network via XRouter.

See XRouter Setup for instructions on setting up your environment for use with XRouter.

Call Description

xrGetNetworkServices Returns supported XRouter services

xrUpdateNetworkServices Returns latest Service Node list

xrConnect Pre-connect to XRouter nodes

xrConnectedNodes Returns connected node services and fees

xrGetBlockCount Returns a blockchain's block height

xrGetBlockHash Returns a block number's hash

xrGetBlock Returns a block hash's block number

xrGetBlocks Returns block hashes for multiple block numbers

xrDecodeRawTransaction Returns decoded transaction HEX

xrGetTransaction Returns transaction data for transaction ID

xrGetTransactions Returns transaction data for multiple transaction IDs

xrSendTransaction Submit a signed transaction to the network

xrService Use to interact with XCloud services

xrServiceConsensus Use to interact with XCloud services with consensus

xrGetReply Returns prior response associated with UUID

xrShowConfigs Returns all node configs received as raw text

xrReloadConfigs Applies changes made to your configs

xrStatus Returns your XRouter configurations

xrGetNetworkServices

This call is used to view the XRouter services currently supported on the network, along with the number of nodes supporting each service. XRouter SPV calls use the xr:: namespace. XCloud services use the xrs:: namespace and can be called using xrService and xrServiceConsensus.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrGetNetworkServices

xrGetNetworkServices

This call does not take parameters.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "reply": { "spvwallets": [ "xr::BLOCK", "xr::BTC", "xr::LTC", "xr::MNP", "xr::SYS", "xr::TBLOCK" ], "services": [ "xrs::BTCgetbestblockhash", "xrs::BTCgetblockhash", "xrs::BTCgettransaction", "xrs::SYSgetbestblockhash", "xrs::SYSgetblock", "xrs::SYSgetgovernance "nodecounts": { "xr::BLOCK": 27, "xr::BTC": 13, "xr::LTC": 21, "xr::MNP": 1, "xr::SYS": 9, "xrs::BTCgetbestblockhash": 12, "xrs::BTCgetblockhash": 12, "xrs::BTCgettransaction": 5, "xrs::SYSgetbestblockhash": 7, "xrs::SYSgetblock": 6, "xrs::SYSgetgovernanceinfo": 4, https://api.blocknet.co 45/92 2020/11/23 Blocknet | API Documentation

"xrs::SYSgetmempool": 4, "xrs::SYSlistoffers": 4, "xrs::SYSofferinfo": 4, "xrs::twilio": 1 } }, "uuid": "cd408df7-0ff8-4e29-b5cf-0148af83f93a" }

Key Type Description

reply object An object containing information on supported services.

spvwallets array An array of supported SPV wallets, represented by the asset's ticker.

services array An array of supported XCloud services.

nodecounts object An object of supported SPV wallets and XCloud services with how many nodes support each.

-- key string The SPV wallet or XCloud service with it's namespace.

-- value int The amount of nodes supporting each respective service.

uuid string The response ID, which can be used to view this response again with xrGetReply.

xrUpdateNetworkServices

This call is used to query a random set of connected peers for the latest Service Node list. If node_count is specified the call will query up to the specified number. By default 1 service node is queried for services. If fewer service nodes with the ability to share the list are found then only those found will be queried.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrUpdateNetworkServices 5

xrUpdateNetworkServices [node_count](optional)

Parameter Type Description

(Optional Parameter) node_count int Defaults to 1 if no consensus= setting in xrouter.conf

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

true

Type Description

bool A confirmation that the latest Service Node list was received.

xrConnect

Sample Data

{ "service": "SYS" }

This optional call is used to connect to XRouter nodes with the specified service. It is no longer needed to use this command prior to making a call. All node configs are now automatically downloaded. See xrConnectedNodes to review a detailed list of nodes, their service offerings, and how much they are charging for their services.

REQUEST PARAMETERS

Sample Requests

https://api.blocknet.co 46/92 2020/11/23 Blocknet | API Documentation

// Connect to one XRouter node supporting SYS blocknet-cli xrConnect xr::SYS

// Connect to two XRouter nodes supporting SYS blocknet-cli xrConnect xr::SYS 2

// Connect to one XRouter node supporting XCloud service twilio blocknet-cli xrConnect xrs::twilio

xrConnect [service] [node_count](optional)

Parameter Type Description

service string Service name including the namespace (xr::[spv_call] or xrs::[xcloud_service]).

(Optional Parameter) node_count int Defaults to 1 if no consensus= setting in xrouter.conf . The number of nodes to pre-connect to that will be used to route calls. The most common response (i.e. the response with the most consensus) will be returned as reply .

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

// Sample response for xrConnect SYS 2 { "reply": [ { "nodepubkey": "02c6c79a75846fd9bb064788b03145e347fa5464558fa9030ebb009df2833369f0", "score": 0, "banned": false, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "spvwallets": [ "MNP", "SYS" ], "spvconfigs": [ { "spvwallet": "MNP", "commands": [ { "command": "xrGetConfig", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlockCount", "fee": 0.000000, "requestlimit": 10, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlockHash", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlock", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetTransaction", "fee": 0.000000, "requestlimit": 50, https://api.blocknet.co 47/92 2020/11/23 Blocknet | API Documentation

"fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrSendTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlocks", "fee": 0.100000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetTransactions", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrDecodeRawTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false } ] }, { "spvwallet": "SYS", "commands": [ { "command": "xrGetConfig", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlockCount", "fee": 0.100000, "requestlimit": 10, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlockHash", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlock", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false https://api.blocknet.co 48/92 2020/11/23 Blocknet | API Documentation

}, { "command": "xrGetTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrSendTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlocks", "fee": 0.100000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetTransactions", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrDecodeRawTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false } ] } ], "feedefault": 0.000000, "fees": { "xrGetBlockCount": 0.000000, "xrGetBlocks": 0.100000 }, "services": { "SYSgetbestblockhash": { "parameters": "", "fee": 0.100000, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "requestlimit": -1, "fetchlimit": 50, "timeout": 30, "disabled": false }, "SYSgetgovernanceinfo": { "parameters": "", "fee": 0.100000, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "requestlimit": -1, "fetchlimit": 50, "timeout": 30, "disabled": false } } }, { "nodepubkey": "0370874cad6252bb94afa9a253c90122760ce2862e623b515e57bfe0697f3fc515", "score": 0, "banned": false, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "spvwallets": [ "BLOCK", "BTC", "LTC", "SYS" ], https://api.blocknet.co 49/92 2020/11/23 Blocknet | API Documentation

"spvconfigs": [ { "spvwallet": "BLOCK", "commands": [ { "command": "xrGetConfig", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockCount", "fee": 0.000000, "requestlimit": -1, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockHash", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlock", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrSendTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlocks", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransactions", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrDecodeRawTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, https://api.blocknet.co 50/92 2020/11/23 Blocknet | API Documentation

"timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false } ] }, { "spvwallet": "BTC", "commands": [ { "command": "xrGetConfig", "fee": 0.200000, "requestlimit": 100, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockCount", "fee": 0.200000, "requestlimit": 100, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockHash", "fee": 0.200000, "requestlimit": 100, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlock", "fee": 0.200000, "requestlimit": 100, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransaction", "fee": 0.200000, "requestlimit": 100, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrSendTransaction", "fee": 0.200000, "requestlimit": 100, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlocks", "fee": 0.200000, "requestlimit": 100, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransactions", "fee": 0.200000, "requestlimit": 100, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, https://api.blocknet.co 51/92 2020/11/23 Blocknet | API Documentation

{ "command": "xrDecodeRawTransaction", "fee": 0.200000, "requestlimit": 100, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false } ] }, { "spvwallet": "LTC", "commands": [ { "command": "xrGetConfig", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockCount", "fee": 0.000000, "requestlimit": -1, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockHash", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlock", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrSendTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlocks", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransactions", "fee": 0.000000, "requestlimit": 50, https://api.blocknet.co 52/92 2020/11/23 Blocknet | API Documentation

"fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrDecodeRawTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false } ] }, { "spvwallet": "SYS", "commands": [ { "command": "xrGetConfig", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockCount", "fee": 0.000000, "requestlimit": -1, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockHash", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlock", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrSendTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlocks", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false https://api.blocknet.co 53/92 2020/11/23 Blocknet | API Documentation

}, { "command": "xrGetTransactions", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrDecodeRawTransaction", "fee": 0.000000, "requestlimit": 50, "fetchlimit" : 50, "timeout" : 30, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false } ] } ], "feedefault": 0.000000, "fees": { "BTC": 0.200000, "xrGetBlockCount": 0.000000 }, "services": { "BTCgetbestblockhash": { "parameters": "", "fee": 0.000000, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "requestlimit": 50, "fetchlimit": 50, "timeout": 30, "disabled": false }, "BTCgetblockhash": { "parameters": "int", "fee": 0.000000, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "requestlimit": 50, "fetchlimit": 50, "timeout": 30, "disabled": false }, "BTCgettransaction": { "parameters": "string", "fee": 0.000000, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "requestlimit": 50, "fetchlimit": 50, "timeout": 30, "disabled": false }, "SYSgetbestblockhash": { "parameters": "", "fee": 0.000000, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "requestlimit": 10, "fetchlimit": 50, "timeout": 30, "disabled": false } } } ], "uuid": "88A16FDB-464D-470B-94CD-D827E63285CC" }

Key Type Description

reply array An array of nodes providing the specified service, along with their configs.

nodepubkey string The node ID.

The node's score based on quality of service. A score of -200 will ban the node for a 24hr period. You can change the ban threshold with the xrouterbanscore setting in blo score int cknet.conf . See node scoring for more details.

https://api.blocknet.co 54/92 2020/11/23 Blocknet | API Documentation

Key Type Description

Signifies if the node is currently banned. banned bool true : Node is banned. false : Node is not banned. See node scoring for more details.

paymentaddress string The node's payment address.

spvwallets array An array of supported SPV wallets, represented by the asset's ticker.

spvconfigs array An array of each SPV wallets and command configurations.

spvwallet string The SPV wallet that the configurations under commands pertains to.

commands array An array of each SPV wallet command and respective configurations.

command string The SPV command.

fee float The command fee, overrides the feedefault and fees values. This priority has already been accounted for in this value.

The minimum time allowed between calls in milliseconds. A value of -1 means there is no limit. If you exceed this value you will be penalized and eventually banned by this requestlimit int specific node.

paymentaddress string The node's payment address for this specific command.

Signifies if the node has disabled this command. disabled bool true : Call is disabled and not supported. false : Call is enabled and supported.

feedefault float The node's default service fee. This fee is overridden by the values specified in fees , SPV command configuration fee , and XCloud service command configuration fee .

fees object Object of SPV commands and respective fees. These values are overridden by the SPV wallet-specific configuration fee .

services object Object of the node's XCloud service calls with respective properties.

parameters string Information on the parameters the command takes.

fee float The service command fee. This overrides the feedefault value.

paymentaddress string The node's payment address for this specific command.

The minimum time allowed between calls in milliseconds. A value of -1 means there is no limit. If you exceed this value you will be penalized and eventually banned by this requestlimit int specific node.

The maximum number of records returned. This pertains to calls such as xrGetBlocks and xrGetTransactions where multiple records are returned. A value of -1 means there is fetchlimit int no limit. A value of 0 means no blocks will be processed.

timeout int The value for timeout you set in xrouter.conf for this call. Defines how long (in seconds) your client waits for a response from a Service Node. The default value is 30 .

uuid string The response ID, which can be used to view this response again with xrGetReply.

xrConnectedNodes

This call is used to list all the data about current and previously connected nodes. This information includes supported SPV wallets, SPV calls, services, fees, and other service settings.

REQUEST PARAMETERS

Sample Requests

blocknet-cli xrConnectedNodes

xrConnectedNodes

This call does not take parameters.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "reply": [ { "nodepubkey": "02c6c79a75846fd9bb064788b03145e347fa5464558fa9030ebb009df2833369f0", "score": 0, "banned": false, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", https://api.blocknet.co 55/92 2020/11/23 Blocknet | API Documentation

"spvwallets": [ "MNP", "SYS" ], "spvconfigs": [ { "spvwallet": "MNP", "commands": [ { "command": "xrGetConfig", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlockCount", "fee": 0.000000, "requestlimit": 10, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlockHash", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlock", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrSendTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlocks", "fee": 0.100000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetTransactions", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrDecodeRawTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false } ] }, { "spvwallet": "SYS", "commands": [ { "command": "xrGetConfig", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { https://api.blocknet.co 56/92 2020/11/23 Blocknet | API Documentation

"command": "xrGetBlockCount", "fee": 0.100000, "requestlimit": 10, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlockHash", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlock", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrSendTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetBlocks", "fee": 0.100000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrGetTransactions", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false }, { "command": "xrDecodeRawTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "disabled": false } ] } ], "feedefault": 0.000000, "fees": { "xrGetBlockCount": 0.000000, "xrGetBlocks": 0.100000 }, "services": { "SYSgetbestblockhash": { "parameters": "", "fee": 0.100000, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "requestlimit": -1, "fetchlimit": 50, "timeout": 30, "disabled": false }, "SYSgetgovernanceinfo": { "parameters": "", "fee": 0.100000, "paymentaddress": "B8zc9PuDJC3XaF7UkQ2CnRDCmXiCs9bDuS", "requestlimit": -1, "fetchlimit": 50, "timeout": 30, "disabled": false https://api.blocknet.co 57/92 2020/11/23 Blocknet | API Documentation

} } }, { "nodepubkey": "0370874cad6252bb94afa9a253c90122760ce2862e623b515e57bfe0697f3fc515", "score": 0, "banned": false, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "spvwallets": [ "BLOCK", "BTC", "LTC", "SYS" ], "spvconfigs": [ { "spvwallet": "BLOCK", "commands": [ { "command": "xrGetConfig", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockCount", "fee": 0.000000, "requestlimit": -1, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockHash", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlock", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrSendTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlocks", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransactions", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrDecodeRawTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false } ] }, { "spvwallet": "BTC", "commands": [ https://api.blocknet.co 58/92 2020/11/23 Blocknet | API Documentation

{ "command": "xrGetConfig", "fee": 0.200000, "requestlimit": 100, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockCount", "fee": 0.200000, "requestlimit": 100, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockHash", "fee": 0.200000, "requestlimit": 100, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlock", "fee": 0.200000, "requestlimit": 100, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransaction", "fee": 0.200000, "requestlimit": 100, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrSendTransaction", "fee": 0.200000, "requestlimit": 100, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlocks", "fee": 0.200000, "requestlimit": 100, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransactions", "fee": 0.200000, "requestlimit": 100, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrDecodeRawTransaction", "fee": 0.200000, "requestlimit": 100, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false } ] }, { "spvwallet": "LTC", "commands": [ { "command": "xrGetConfig", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockCount", "fee": 0.000000, "requestlimit": -1, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false https://api.blocknet.co 59/92 2020/11/23 Blocknet | API Documentation

}, { "command": "xrGetBlockHash", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlock", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrSendTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlocks", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransactions", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrDecodeRawTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false } ] }, { "spvwallet": "SYS", "commands": [ { "command": "xrGetConfig", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockCount", "fee": 0.000000, "requestlimit": -1, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlockHash", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlock", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", https://api.blocknet.co 60/92 2020/11/23 Blocknet | API Documentation

"disabled": false }, { "command": "xrGetTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrSendTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetBlocks", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrGetTransactions", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false }, { "command": "xrDecodeRawTransaction", "fee": 0.000000, "requestlimit": 50, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "disabled": false } ] } ], "feedefault": 0.000000, "fees": { "BTC": 0.200000, "xrGetBlockCount": 0.000000 }, "services": { "BTCgetbestblockhash": { "parameters": "", "fee": 0.000000, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "requestlimit": 50, "fetchlimit": 50, "timeout": 30, "disabled": false }, "BTCgetblockhash": { "parameters": "int", "fee": 0.000000, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "requestlimit": 50, "fetchlimit": 50, "timeout": 30, "disabled": false }, "BTCgettransaction": { "parameters": "string", "fee": 0.000000, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "requestlimit": 50, "fetchlimit": 50, "timeout": 30, "disabled": false }, "SYSgetbestblockhash": { "parameters": "", "fee": 0.000000, "paymentaddress": "BGyvu6uHJ9WLftPgwHeAU5HwmgGmpB3Juh", "requestlimit": 10, "fetchlimit": 50, "timeout": 30, "disabled": false https://api.blocknet.co 61/92 2020/11/23 Blocknet | API Documentation

} } } ], "uuid": "88A16FDB-464D-470B-94CD-D827E63285CC" }

Key Type Description

reply array An array of nodes providing the specified service.

nodepubkey string The node ID.

The node's score based on quality of service. A score of -200 will ban the node for a 24hr period. You can change the ban threshold with the xrouterbanscore setting in blo score int cknet.conf . See node scoring for more details.

Signifies if the node is currently banned. banned bool true : Node is banned. false : Node is not banned. See node scoring for more details.

paymentaddress string The node's payment address.

spvwallets array An array of supported SPV wallets, represented by the asset's ticker.

spvconfigs array An array of each SPV wallets and command configurations.

spvwallet string The SPV wallet that the configurations under commands pertains to.

commands array An array of each SPV wallet command and respective configurations.

command string The SPV command.

fee float The SPV command fee. This overrides the feedefault and fees values.

The minimum time allowed between calls in milliseconds. A value of -1 means there is no limit. If you exceed this value you will be penalized and eventually banned by this requestlimit int specific node.

paymentaddress string The node's payment address for this specific command.

Signifies if the node has disabled this command. disabled bool true : Call is disabled and not supported. false : Call is enabled and supported.

feedefault float The node's default service fee. This fee is overridden by the values specified in fees , SPV command configuration fee , and XCloud service command configuration fee .

fees object Object of SPV commands and respective fees. These values are overridden by the SPV wallet-specific configuration fee .

services object Object of the node's XCloud service calls with respective properties.

parameters string Information on the parameters the command takes.

fee float The service command fee. This overrides the feedefault value.

paymentaddress string The node's payment address for this specific command.

The minimum time allowed between calls in milliseconds. A value of -1 means there is no limit. If you exceed this value you will be penalized and eventually banned by this requestlimit int specific node.

The maximum number of records returned. This pertains to calls such as xrGetBlocks and xrGetTransactions where multiple records are returned. A value of -1 means there is fetchlimit int no limit. A value of 0 means no blocks will be processed.

timeout int The value for timeout you set in xrouter.conf for this call. Defines how long (in seconds) your client waits for a response from a Service Node. The default value is 30 .

uuid string The response ID, which can be used to view this response again with xrGetReply.

xrGetBlockCount

Sample Data

{ "blockchain": "SYS" }

This call is used to retrieve the current block height of the longest chain for the specified blockchain. It requires the blockchain to be SPV wallet supported.

REQUEST PARAMETERS

Sample Request

https://api.blocknet.co 62/92 2020/11/23 Blocknet | API Documentation

blocknet-cli xrGetBlockCount SYS 2

xrGetBlockCount [blockchain] [node_count](optional)

Parameter Type Description

blockchain string The blockchain, represented by the asset's ticker (BTC, LTC, SYS, etc.).

(Optional Parameter) node_count int Defaults to 1 if no consensus= setting in xrouter.conf . The number of nodes that will be used to route calls. The most common response (i.e. the response with the most consensus) will be returned as reply .

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "reply": 482107, "uuid": "34d0998e-a950-4fd8-b1d6-7571c83abb50" }

Key Type Description

reply int The latest block number of the specified blockchain. If using a node_count greater than 1, this returns the most common reply. Use xrGetReply to view each nodes individual response.

uuid string The response ID, which can be used to view this response again with xrGetReply.

xrGetBlockHash

Sample Data

{ "blockchain": "SYS", "block_number": 91510 }

This call is used to retrieve the block hash of the specified block and blockchain.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrGetBlockHash SYS 482107 2

xrGetBlockHash [blockchain] [block_number] [node_count](optional)

Parameter Type Description

blockchain string The blockchain, represented by the asset's ticker (BTC, LTC, SYS, etc.).

block_number string The block number or hex for the block hash of interest.

(Optional Parameter) node_count int Defaults to 1 if no consensus= setting in xrouter.conf . The number of nodes that will be used to route calls. The most common response (i.e. the response with the most consensus) will be returned as reply .

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "reply": "52583afcd857e45234e7c8981804b36d13a7b3025c17f3535c3e724542590a79", "uuid": "3c84d025-8a03-4b64-848f-99892fe481ff" }

Key Type Description https://api.blocknet.co 63/92 2020/11/23 Blocknet | API Documentation

Key Type Description

reply string The block hash of the specified block and blockchain. If using a node_count greater than 1, this returns the most common reply. Use xrGetReply to view each nodes individual response.

uuid string The response ID, which can be used to view this response again with xrGetReply.

xrGetBlock

Sample Data

{ "blockchain": "SYS", "block_hash": "0cf18712db68be85793dc06cd0a4fbc8edb166157e6847bb3c9f55d462b02837" }

This call is used to retrieve the block data for the specified block hash and blockchain.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrGetBlock SYS 0cf18712db68be85793dc06cd0a4fbc8edb166157e6847bb3c9f55d462b02837 2

xrGetBlock [blockchain] [block_hash] [node_count](optional)

Parameter Type Description

blockchain string The blockchain, represented by the asset's ticker (BTC, LTC, SYS, etc.).

block_hash string The block hash for the block of interest.

(Optional Parameter) node_count int Defaults to 1 if no consensus= setting in xrouter.conf . The number of nodes that will be used to route calls. The most common response (i.e. the response with the most consensus) will be returned as reply .

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "reply": { "hash": "0cf18712db68be85793dc06cd0a4fbc8edb166157e6847bb3c9f55d462b02837", "confirmations": 390700, "size": 734, "height": 91510, "version": 805306624, "versionHex": "30000100", "merkleroot": "55554df0ea7f66552beffe433d2c2f620bada79063a343ffc23c60c67cdf028f", "tx": [ "55554df0ea7f66552beffe433d2c2f620bada79063a343ffc23c60c67cdf028f" ], "time": 1530894673, "mediantime": 1530894336, "nonce": 0, "bits": "180761db", "difficulty": 148937676133.261200, "chainwork": "00000000000000000000000000000000000000000028ad56864c458781e21970", "auxpow": { "tx": { "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5703dd3408142f5669614254432f626d67706f6f6c2e636f6d2f2cfabe6d6d75654a "txid": "c8fc123672fffb3c6a45b94bdd30afc114f282742338809380bc84fe8666d489", "size": 172, "version": 1, "locktime": 0, "vin": [ { "coinbase": "03dd3408142f5669614254432f626d67706f6f6c2e636f6d2f2cfabe6d6d75654ab7a6b163e7a04e56e43f8e7ca0087f11e8bd6c3c72c69732e84953287804000000000000001 "sequence": 4294967295 } ], "vout": [ { "value": 12.500546, "valueSat": 1250054592, "n": 0, https://api.blocknet.co 64/92 2020/11/23 Blocknet | API Documentation

"scriptPubKey": { "asm": "OP_DUP OP_HASH160 f1c075a01882ae0972f95d3a4177c86c852b7d91 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914f1c075a01882ae0972f95d3a4177c86c852b7d9188ac", "reqSigs": 1, "type": "pubkeyhash", "addresses": [ "SjLGSPfmF3kVPA6A213hShYc4aRtiWZ8Wu" ] } } ], "blockhash": "000000000000000004bdb8e3fdf28ffc528f4e6b1871a6177579cbd4dabde955" }, "index": 0, "chainindex": 2, "merklebranch": [ "a67d749dfa7006b9d66d2284b20a64ebcb8c2e5aae18e355c790b90a060a30c1", "9ab5c057ecf43aa0552c21be4f86b1c9b248fe2dd0821bee38e5a25a22c49c25", "ec11f "chainmerklebranch": [ "89af0bc973bc0308f14c5c50c3d75f68783eab40a4688064cd56cfaed977d138", "5360cbf0991b4b0e09d589631c232d1f229104faad9e65375695230c47bc2493" ], "parentblock": "0000002024653d98f3eace4b66b6269fa9205e08b647e23cf7880e0000000000000000003feae4c877b2f8b73f6f92a589ed8870fe98abb3551f1539373597f5b44514ada9993f5b }, "previousblockhash": "ba53d715abf76ac8adc025120ffb48b2331f3a1b9b7d01167ffd7dcd23934390", "nextblockhash": "cd3a236542491089bffd8ba49cbe1d11a20dd4c4ad188307027e60c710732409" }, "uuid": "5404cc31-2b01-48eb-8599-e6adcd8f9216" }

Key Type Description

An object containing the block data for the specified block hash and blockchain. If using a node_count greater than 1, this returns the most common reply. Use xrGetReply to view each reply object nodes individual response.

uuid string The response ID, which can be used to view this response again with xrGetReply.

xrGetBlocks

Sample Data

{ "blockchain": "SYS", "block_hash1": "0cf18712db68be85793dc06cd0a4fbc8edb166157e6847bb3c9f55d462b02837", "block_hash2": "52583afcd857e45234e7c8981804b36d13a7b3025c17f3535c3e724542590a79" }

This call is used to retrieve block data for multiple block hashes on the specified blockchain. Currently the maximum request is 50 blocks, although a node may set this limit to less.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrGetBlocks SYS "0cf18712db68be85793dc06cd0a4fbc8edb166157e6847bb3c9f55d462b02837,52583afcd857e45234e7c8981804b36d13a7b3025c17f3535c3e724542590a79" 2

xrGetBlocks [blockchain] [block_hashes] [node_count](optional)

Parameter Type Description

blockchain string The blockchain, represented by the asset's ticker (BTC, LTC, SYS, etc.).

block_hashes string A comma-demilited string of block hashes for the blocks of interest. The hashes must be separated by a comma with no spaces.

(Optional Parameter) node_count int Defaults to 1 if no consensus= setting in xrouter.conf . The number of nodes that will be used to route calls. The most common response (i.e. the response with the most consensus) will be returned as reply .

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "reply": [ { "hash": "0cf18712db68be85793dc06cd0a4fbc8edb166157e6847bb3c9f55d462b02837", "confirmations": 390700, "size": 734, "height": 91510, "version": 805306624, https://api.blocknet.co 65/92 2020/11/23 Blocknet | API Documentation

"versionHex": "30000100", "merkleroot": "55554df0ea7f66552beffe433d2c2f620bada79063a343ffc23c60c67cdf028f", "tx": [ "55554df0ea7f66552beffe433d2c2f620bada79063a343ffc23c60c67cdf028f" ], "time": 1530894673, "mediantime": 1530894336, "nonce": 0, "bits": "180761db", "difficulty": 148937676133.261200, "chainwork": "00000000000000000000000000000000000000000028ad56864c458781e21970", "auxpow": { "tx": { "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5703dd3408142f5669614254432f626d67706f6f6c2e636f6d2f2cfabe6d6d75654 "txid": "c8fc123672fffb3c6a45b94bdd30afc114f282742338809380bc84fe8666d489", "size": 172, "version": 1, "locktime": 0, "vin": [ { "coinbase": "03dd3408142f5669614254432f626d67706f6f6c2e636f6d2f2cfabe6d6d75654ab7a6b163e7a04e56e43f8e7ca0087f11e8bd6c3c72c69732e849532878040000000000000 "sequence": 4294967295 } ], "vout": [ { "value": 12.500546, "valueSat": 1250054592, "n": 0, "scriptPubKey": { "asm": "OP_DUP OP_HASH160 f1c075a01882ae0972f95d3a4177c86c852b7d91 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914f1c075a01882ae0972f95d3a4177c86c852b7d9188ac", "reqSigs": 1, "type": "pubkeyhash", "addresses": [ "SjLGSPfmF3kVPA6A213hShYc4aRtiWZ8Wu" ] } } ], "blockhash": "000000000000000004bdb8e3fdf28ffc528f4e6b1871a6177579cbd4dabde955" }, "index": 0, "chainindex": 2, "merklebranch": [ "a67d749dfa7006b9d66d2284b20a64ebcb8c2e5aae18e355c790b90a060a30c1", "9ab5c057ecf43aa0552c21be4f86b1c9b248fe2dd0821bee38e5a25a22c49c25", "ec1 "chainmerklebranch": [ "89af0bc973bc0308f14c5c50c3d75f68783eab40a4688064cd56cfaed977d138", "5360cbf0991b4b0e09d589631c232d1f229104faad9e65375695230c47bc2493" "parentblock": "0000002024653d98f3eace4b66b6269fa9205e08b647e23cf7880e0000000000000000003feae4c877b2f8b73f6f92a589ed8870fe98abb3551f1539373597f5b44514ada9993f }, "previousblockhash": "ba53d715abf76ac8adc025120ffb48b2331f3a1b9b7d01167ffd7dcd23934390", "nextblockhash": "cd3a236542491089bffd8ba49cbe1d11a20dd4c4ad188307027e60c710732409" }, { "hash": "52583afcd857e45234e7c8981804b36d13a7b3025c17f3535c3e724542590a79", "confirmations": 115, "size": 1073, "height": 482107, "version": 805306624, "versionHex": "30000100", "merkleroot": "d1de796d10826dcc97af3d9683711da0f8e8aad996277034bd9b11631ce0d1f2", "tx": [ "d1de796d10826dcc97af3d9683711da0f8e8aad996277034bd9b11631ce0d1f2" ], "time": 1555482589, "mediantime": 1555482282, "nonce": 0, "bits": "1805ec8b", "difficulty": 185600202264.865814, "chainwork": "000000000000000000000000000000000000000000f8bf3057c91ffc80efc4fc", "auxpow": { "tx": { "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5b0355ba08182f5669614254432f4d696e65642062792067656e6469722f2cfabe "txid": "94ce9c796176df4cbe67695c0bfcd63587b1b664e23b716233980dc07d2874d7", "size": 223, "version": 1, "locktime": 0, "vin": [ { "coinbase": "0355ba08182f5669614254432f4d696e65642062792067656e6469722f2cfabe6d6daa2651dfd7b34e3cf5b87fd5ab3b70a78d23194d2269c502280de7193d73790f1000000 "sequence": 4294967295 } ], "vout": [ { "value": 12.745918, "valueSat": 1274591750, "n": 0, "scriptPubKey": { https://api.blocknet.co 66/92 2020/11/23 Blocknet | API Documentation

"asm": "OP_DUP OP_HASH160 536ffa992491508dca0354e52f32a3a7a679a53a OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914536ffa992491508dca0354e52f32a3a7a679a53a88ac", "reqSigs": 1, "type": "pubkeyhash", "addresses": [ "SUuBGCD7Ff3C2ozR6osYguPeXNho98S5qR" ] } }, { "value": 0.000000, "valueSat": 0, "n": 1, "scriptPubKey": { "asm": "OP_RETURN aa21a9ed6e46f58e0097a34b65b4d332ebde4a0cedb300fab27549b3ee1c09fd2d7875d3", "hex": "6a24aa21a9ed6e46f58e0097a34b65b4d332ebde4a0cedb300fab27549b3ee1c09fd2d7875d3", "type": "nulldata" } } ], "blockhash": "000000000000000000bcf15d287a324f073b1e0239452a6d4d513c27dc73150a" }, "index": 0, "chainindex": 14, "merklebranch": [ "b468e6225dbecfbbf9f86cc8414afb70ae1fade27008e5f8080f74341dbc103c", "c5ec7ac7fb9405564c2afffcd0279c8237a883f0e414011cfe4439572fd8f476", "727 "chainmerklebranch": [ "0000000000000000000000000000000000000000000000000000000000000000", "f98c4e9736d8eb8bb46299798906695c755369a3df99a93ffdded1713f1cf6e2", "parentblock": "000000208100da1ca9afee2f159a537c64aa7fcfce77dbdce07009000000000000000000d63acfaac8ae4bc195f8ba076f306c45ec06a8a740a182263e96732d842984cee6c7b6 }, "previousblockhash": "abe70792116fd7806b211b6d67cc6bfa1490aa0dea71587d0bbbe9ee435c9c2a", "nextblockhash": "2d7adca3fe7a51018b909aa1c63a7669a75a6729a2da66a08de19d4f13e66032" } ], "uuid": "5404cc31-2b01-48eb-8599-e6adcd8f9216" }

Key Type Description

An array containing objects of the block data for each requested block on the specified blockchain. If using a node_count greater than 1, this returns the most common reply. Use reply array xrGetReply to view each nodes individual response.

uuid string The response ID, which can be used to view this response again with xrGetReply.

xrDecodeRawTransaction

Sample Data

{ "spvwallet": "SYS", "tx_hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff640363b1082cfabe6d6df75a401bb4e29d77b2162d476557c4bc879380dad926e44c1b2 }

This call is used to decode a specified bockchain transaction HEX. It requires the blockchain to be SPV wallet supported.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrDecodeRawTransaction SYS 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff640363b1082cfabe6d6df75a401bb4e29d77b2162d47

xrDecodeRawTransaction [blockchain] [tx_hex] [node_count](optional)

Parameter Type Description

blockchain string The blockchain, represented by the asset's ticker (BTC, LTC, SYS, etc.).

tx_hex string The raw transaction HEX to decode.

(Optional Parameter) node_count int Defaults to 1 if no consensus= setting in xrouter.conf . The number of nodes that will be used to route calls. The most common response (i.e. the response with the most consensus) will be returned as reply .

RESPONSE PARAMETERS

 200 OK https://api.blocknet.co 67/92 2020/11/23 Blocknet | API Documentation

Sample 200 Response

{ "reply": { "txid": "aa1838dee180e5c4ad5041ded25aa5d88c41bedb1c339b42f54dbad0e7563c5e", "size": 294, "version": 1, "locktime": 992777948, "vin": [ { "coinbase": "0363b1082cfabe6d6df75a401bb4e29d77b2162d476557c4bc879380dad926e44c1b2a7c49893a3cc108000000f09f909f000f4d696e6564206279206c616e6361630000000000000 "sequence": 0 } ], "vout": [ { "value": 12.612785, "valueSat": 1261278512, "n": 0, "scriptPubKey": { "asm": "OP_DUP OP_HASH160 c825a1ecf2a6830c4401620c3a16f1995057c2ab OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914c825a1ecf2a6830c4401620c3a16f1995057c2ab88ac", "reqSigs": 1, "type": "pubkeyhash", "addresses": [ "SfYHFxiGv4mRtUfQVHxfMWknEt53Bjj286" ] } }, { "value": 0.000000, "valueSat": 0, "n": 1, "scriptPubKey": { "asm": "OP_RETURN aa21a9ed2ac560369b71e58f0618a79d2f03bcf7283945e20eef7813de376a6f503448c1 0000000000000000", "hex": "6a24aa21a9ed2ac560369b71e58f0618a79d2f03bcf7283945e20eef7813de376a6f503448c1080000000000000000", "type": "nulldata" } }, { "value": 0.000000, "valueSat": 0, "n": 2, "scriptPubKey": { "asm": "OP_RETURN 52534b424c4f434b3a81c66dc456024e97e518ac2ab3ec51bf85b294b9a140c6e9376a040607edc39d", "hex": "6a4c2952534b424c4f434b3a81c66dc456024e97e518ac2ab3ec51bf85b294b9a140c6e9376a040607edc39d", "type": "nulldata" } } ] }, "uuid": "95e612f1-3505-493d-8097-452052223417" }

Key Type Description

reply object An object containing the decoded transaction data. If using a node_count greater than 1, this returns the most common reply. Use xrGetReply to view each nodes individual response.

uuid string The response ID, which can be used to view this response again with xrGetReply.

xrGetTransaction

Sample Data

{ "blockchain": "SYS", "tx_id": "9e5db236f75babe4e28c17f0ed1eddbcfdb5bde8a69750e1a4952d110c620e51" }

This call is used to retrieve the transaction data for the specified transaction ID (hash) and blockchain.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrGetTransaction SYS 9e5db236f75babe4e28c17f0ed1eddbcfdb5bde8a69750e1a4952d110c620e51 2 https://api.blocknet.co 68/92 2020/11/23 Blocknet | API Documentation

xrGetTransaction [blockchain] [tx_id] [node_count](optional)

Parameter Type Description

blockchain string The blockchain, represented by the asset's ticker (BTC, LTC, SYS, etc.).

tx_id string The transaction ID (hash) for the transaction of interest.

(Optional Parameter) node_count int Defaults to 1 if no consensus= setting in xrouter.conf . The number of nodes that will be used to route calls. The most common response (i.e. the response with the most consensus) will be returned as reply .

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "reply": { "txid": "9e5db236f75babe4e28c17f0ed1eddbcfdb5bde8a69750e1a4952d110c620e51", "size": 192, "version": 2, "locktime": 0, "vin": [ { "txid": "10f28315098fff366e2dfba23afacc10ddb5ac30a403d6396cc2d35739f06a79", "vout": 1, "scriptSig": { "asm": "30450221008d807ad2585d4775e57c105d16f12f5eb7925a3f8f66b077f7944ec74e421ed9022067105602af2705d4456ccd68db8b4eb327cdb5e55e7de98d7ba9f1213a75a1ad[ALL] "hex": "4830450221008d807ad2585d4775e57c105d16f12f5eb7925a3f8f66b077f7944ec74e421ed9022067105602af2705d4456ccd68db8b4eb327cdb5e55e7de98d7ba9f1213a75a1ad0121 }, "sequence": 4294967295 } ], "vout": [ { "value": 1.430000, "valueSat": 143000000, "n": 0, "scriptPubKey": { "asm": "OP_DUP OP_HASH160 7be755600f2fd9f3518be6ededb38e2498f51ff5 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a9147be755600f2fd9f3518be6ededb38e2498f51ff588ac", "reqSigs": 1, "type": "pubkeyhash", "addresses": [ "SYb9Gmcwj1aXUV86cKpnCD8SR7hvZgbKTP" ] } } ] }, "uuid": "cd7c9b1a-8fd5-46a7-84af-98c0f8850148" }

Key Type Description

An object containing the transaction data for the specified transaction ID and blockchain. If using a node_count greater than 1, this returns the most common reply. Use xrGetReply to view reply object each nodes individual response.

uuid string The response ID, which can be used to view this response again with xrGetReply.

xrGetTransactions

Sample Data

{ "blockchain": "SYS", "tx_id1": "f7efcb33c817153dbea86b827380ffce108c6c8e4707356e874d98d0426339bd", "tx_id2": "f63543bb90800a601065d6f6d8380d8a98ac1a9f208921febde4eb0168e6fd8e", }

This call is used to retrieve transaction data for multiple transaction IDs (hashes) on the specified blockchain. Currently the maximum request is 50 transactions, although a node may set this limit to less.

REQUEST PARAMETERS https://api.blocknet.co 69/92 2020/11/23 Blocknet | API Documentation

Sample Request

blocknet-cli xrGetTransactions SYS "f7efcb33c817153dbea86b827380ffce108c6c8e4707356e874d98d0426339bd,f63543bb90800a601065d6f6d8380d8a98ac1a9f208921febde4eb0168e6fd8e"

xrGetTransactions [blockchain] [tx_ids] [node_count](optional)

Parameter Type Description

blockchain string The blockchain, represented by the asset's ticker (BTC, LTC, SYS, etc.).

tx_ids string A comma-delimited list of transaction IDs (hashes) for the transactions of interest. The hashes must be separated by a comma with no spaces.

(Optional Parameter) node_count int Defaults to 1 if no consensus= setting in xrouter.conf . The number of nodes that will be used to route calls. The most common response (i.e. the response with the most consensus) will be returned as reply .

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "reply": [ { "txid": "f7efcb33c817153dbea86b827380ffce108c6c8e4707356e874d98d0426339bd", "size": 135, "version": 2, "locktime": 0, "vin": [ { "coinbase": "03dc1a070101", "sequence": 4294967295 } ], "vout": [ { "value": 8.662500, "valueSat": 866250000, "n": 0, "scriptPubKey": { "asm": "02bcff8305d8bb9e536c5bc31c4ad74cbd15ac9d138d5d756f12099c96d541f14c OP_CHECKSIG", "hex": "2102bcff8305d8bb9e536c5bc31c4ad74cbd15ac9d138d5d756f12099c96d541f14cac", "reqSigs": 1, "type": "pubkey", "addresses": [ "SiibszzNJSGAFTAKqWZKyEkkf4Wq4pYH7c" ] } }, { "value": 25.987500, "valueSat": 2598750000, "n": 1, "scriptPubKey": { "asm": "OP_DUP OP_HASH160 a47209c6649cf99e6db2e1bde99b44ce10c76e52 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914a47209c6649cf99e6db2e1bde99b44ce10c76e5288ac", "reqSigs": 1, "type": "pubkeyhash", "addresses": [ "ScHWTpAFNo93Jv1RAfMBFp9VZCjpLq82Rf" ] } } ] }, { "txid": "f63543bb90800a601065d6f6d8380d8a98ac1a9f208921febde4eb0168e6fd8e", "size": 135, "version": 2, "locktime": 0, "vin": [ { "coinbase": "03dd1a070101", "sequence": 4294967295 } ], "vout": [ { "value": 8.662500, "valueSat": 866250000, "n": 0, https://api.blocknet.co 70/92 2020/11/23 Blocknet | API Documentation

"scriptPubKey": { "asm": "0248d791d1b048e8fc79da7ba9f6c0a44fe14641d13a772ff25dc60103580d1a3e OP_CHECKSIG", "hex": "210248d791d1b048e8fc79da7ba9f6c0a44fe14641d13a772ff25dc60103580d1a3eac", "reqSigs": 1, "type": "pubkey", "addresses": [ "ScdSb9g4b77DsA9vLipDYP8V1zEP1ru4d8" ] } }, { "value": 27.546750, "valueSat": 2754675000, "n": 1, "scriptPubKey": { "asm": "OP_DUP OP_HASH160 3ed09824728101512565c187fdd061df0cc1cac5 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a9143ed09824728101512565c187fdd061df0cc1cac588ac", "reqSigs": 1, "type": "pubkeyhash", "addresses": [ "ST28p81wqsSL6of7Em9mZGvVonVBfM36wX" ] } } ] } ], "uuid": "c778c124-af28-48b6-b3c4-22f2c5518b8b" }

Key Type Description

An array containing objects with the transaction data for each requested transaction on the specified blockchain. If using a node_count greater than 1, this returns the most common reply. reply array Use xrGetReply to view each nodes individual response.

uuid string The response ID, which can be used to view this response again with xrGetReply.

xrSendTransaction

Sample Data

{ "blockchain": "SYS", "signed_tx_hex": "0200000001ce2faed018f4776b41245f78695fdabcc68567b64d13851a7f8277693a23f3e0000000006b483045022100d6e0f7c193e0ae5168e0e8c87a29837f4b8be5c5cdcfa2826a }

This call is used to submit a locally signed transaction on the specified blockchain.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrSendTransaction SYS 0200000001ce2faed018f4776b41245f78695fdabcc68567b64d13851a7f8277693a23f3e0000000006b483045022100d6e0f7c193e0ae5168e0e8c87a29837f4b8

xrSendTransaction [blockchain] [signed_tx_hex] [node_count](optional)

Parameter Type Description

blockchain string The blockchain, represented by the asset's ticker (BTC, LTC, SYS, etc.).

signed_tx_hex string The signed transaction HEX.

(Optional Parameter) node_count int Defaults to 1 if no consensus= setting in xrouter.conf . The number of nodes that will be used to route calls. The most common response (i.e. the response with the most consensus) will be returned as reply .

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "reply": "9f978c91840adbc4e074395f8f793cb7369c48e2ce831a10c32090bf71ae29ae", "uuid": "ACA0874C-C45F-4F40-94AD-794A7E18085A" } https://api.blocknet.co 71/92 2020/11/23 Blocknet | API Documentation

Key Type Description

reply object The transaction hash of the sent transaction.

xrGetReply

Sample Data

{ "uuid": "3243a24b-3e9d-40d1-8c33-37a57878ce85" }

This call is used to look up responses from previous XRouter calls without having to request them from the network. There are no fees for this call.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrGetReply 3243a24b-3e9d-40d1-8c33-37a57878ce85

xrGetReply [uuid]

Parameter Type Description

uuid string The UUID of the response you want to look up.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "allreplies": [ { "reply": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048", "nodepubkey": "02c6c79a75846fd9bb064788b03145e347fa5464558fa9030ebb009df2833369f0", "score": 35, "address": "BqCtHRHmUVqkvqD7GhXVuHchzm77cLuXs1", "exr": true }, { "reply": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048", "nodepubkey": "0370874cad6252bb94afa9a253c90122760ce2862e623b515e57bfe0697f3fc515", "score": 80, "address": "Bqshd156VexPDKELxido2S2pDvqrRzSCi4", "exr": true } ], "mostcommon": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048", "mostcommoncount": 2, "uuid": "3c84d025-8a03-4b64-848f-99892fe481ff" }

Key Type Description

allreplies array An array of objects with responses from each node. This can be useful if you wanted to do your own analysis or filtering of the responses.

reply int The node's response for the respective UUID call.

nodepubkey string The node ID.

The respective nodes score based on quality of service A score of -200 will ban the node for a 24hr period. You can change the ban threshold with the xrouterbanscore score int setting in blocknet.conf.

address string The Service Node's payment address.

exr bool Whether the Service Node is an Enterprise XRouter node EXR nodes have greater throughput and service capabilities.

mostcommon string The most common response (i.e. the response with the most consensus). This is the value returned for reply when making the originating call.

mostcommoncount int The amount of nodes that responded with the mostcommon reply.

uuid string The response ID, which can be used to view this response again with xrGetReply. https://api.blocknet.co 72/92 2020/11/23 Blocknet | API Documentation

xrShowConfigs

This call is used to show the configurations received from all nodes as raw text.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrShowConfigs

xrShowConfigs

This call does not take parameters.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ { "nodepubkey" : "03ca15d619cf36fdc043892b12a3881dd08f2d3905e2ff399ac39cf34b28a995c7", "paymentaddress" : "BiBbLf8wDyYcSAzsX1SNzZKrc2zZQjS2pa", "config" : "[Main]\nwallets=BTC,ETH,LTC,BLOCK,CRW,MERGE,TRC\nmaxfee=0\n[BTC::xrGetBlocks]\n#fee=0.1\n#clientrequestlimit=-1\ndisabled=0\nfetchlimit=50\n\n\n", "plugins" : { } }, { "nodepubkey" : "0252d7959e25a8f1a15b4e3e487d310211534dd71ca3316abe463d40a5cf0d67ca", "paymentaddress" : "BXhndtvEEM5Yh9UEPzrzpBLksjZReGV6Kv",

"config" : "[Main]\nwallets=BLOCK,LTC,BTC,PIVX,MON\nmaxfee=0\nconsensus=1\ntimeout=30\npaymentaddress=BXhndtvEEM5Yh9UEPzrzpBLksjZReGV6Kv\n\n\n", "plugins" : { } } ]

Key Type Description

Array array An array of objects containing the configurations for each node you are connected to.

nodepubkey string The node ID.

paymentaddress string The node's payment address, may also be specific per command.

config string The raw text contents of xrouter.conf .

plugins obj An object containing the raw configuration text contents for each of this node's plugins.

xrReloadConfigs

This call is used to reload xrouter.conf and all associated plugin configs after changes have been made to apply newly configured settings without needing to restart the Blocknet client.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrReloadConfigs

xrReloadConfigs

This call does not take parameters.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

true

https://api.blocknet.co 73/92 2020/11/23 Blocknet | API Documentation

Key Type Description

true bool A confirmation that xrouter.conf has been reloaded.

xrStatus

This call is used to print your XRouter configuration and has two different outputs depending on if this call is made from a user client or a Service Node.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrStatus

xrStatus

This call does not take parameters.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response (User Client)

{ "xrouter": true, "servicenode": false, "config": "[Main]\ntimeout=30\nconsensus=1\nmaxfee=0.5" }

USER CLIENT

Key Type Description

Signifies XRouter activation. xrouter bool true : XRouter is enabled. false : XRouter is disabled.

Signifies if your client is a Service Node. servicenode bool true : Client is a Service Node. false : Client is not a Service Node.

config string The raw text contents of your xrouter.conf .

Sample 200 Response (Service Node)

{ "nodepubkey": "03f1bf0087e5a0036176560493fb05fedb0eb841993536c6a86c78687c4e73a527", "score": 0, "banned": false, "paymentaddress": "B2B8HVr7BuxBXx7JTqmPgUZJ11CGcL9vtS", "spvwallets": [ "SYS" ], "spvconfigs": [ { "spvwallet": "SYS", "commands": [ { "command": "xrGetConfig", "fee": 0.00000000, "requestlimit": -1, "paymentaddress": "B2B8HVr7BuxBXx7JTqmPgUZJ11CGcL9vtS", "disabled": false }, { "command": "xrGetBlockCount", "fee": 0.00000000, "requestlimit": -1, "paymentaddress": "B2B8HVr7BuxBXx7JTqmPgUZJ11CGcL9vtS", "disabled": false }, { "command": "xrGetBlockHash", "fee": 0.00000000, https://api.blocknet.co 74/92 2020/11/23 Blocknet | API Documentation

"requestlimit": -1, "paymentaddress": "B2B8HVr7BuxBXx7JTqmPgUZJ11CGcL9vtS", "disabled": false }, { "command": "xrGetBlock", "fee": 0.00000000, "requestlimit": -1, "paymentaddress": "B2B8HVr7BuxBXx7JTqmPgUZJ11CGcL9vtS", "disabled": false }, { "command": "xrGetTransaction", "fee": 0.00000000, "requestlimit": -1, "paymentaddress": "B2B8HVr7BuxBXx7JTqmPgUZJ11CGcL9vtS", "disabled": false }, { "command": "xrSendTransaction", "fee": 0.00000000, "requestlimit": -1, "paymentaddress": "B2B8HVr7BuxBXx7JTqmPgUZJ11CGcL9vtS", "disabled": false }, { "command": "xrGetBlocks", "fee": 0.00000000, "requestlimit": -1, "paymentaddress": "B2B8HVr7BuxBXx7JTqmPgUZJ11CGcL9vtS", "disabled": false }, { "command": "xrGetTransactions", "fee": 0.00000000, "requestlimit": -1, "paymentaddress": "B2B8HVr7BuxBXx7JTqmPgUZJ11CGcL9vtS", "disabled": false }, { "command": "xrDecodeRawTransaction", "fee": 0.00000000, "requestlimit": -1, "paymentaddress": "B2B8HVr7BuxBXx7JTqmPgUZJ11CGcL9vtS", "disabled": false } ] } ], "feedefault": 0.00000000, "fees": { }, "services": { "SYSlistoffers": { "parameters": "", "fee": 0.00000000, "paymentaddress": "B2B8HVr7BuxBXx7JTqmPgUZJ11CGcL9vtS", "requestlimit": -1, "fetchlimit": 50, "timeout": 30, "disabled": false } }, "xrouter": true, "servicenode": true, "config": "[Main]\nwallets=SYS\nplugins=hanniabu\nmaxfee=0.5\npaymentaddress=B2B8HVr7BuxBXx7JTqmPgUZJ11CGcL9vtS\n", "plugins": { "SYSlistoffers": "parameters=\nprivate::type=rpc\nprivate::rpcip=127.0.0.1\nprivate::rpcport=8370\nprivate::rpcuser=username\nprivate::rpcpassword=password\npri } }

SERVICE NODE

This is the output presented from a Service Node client.

Key Type Description

nodepubkey string Your node ID.

score int Not applicable when viewing your own score. https://api.blocknet.co 75/92 2020/11/23 Blocknet | API Documentation

Key Type Description

paymentaddress string Your node's general payment address.

spvwallets array An array of SPV wallets you're supporting, represented by the asset's ticker.

spvconfigs array An array of each SPV wallets and command configurations.

spvwallet string The SPV wallet that the configurations under commands pertains to.

commands array An array of each SPV wallet command and respective configurations.

command string The SPV command.

fee float The command fee, overrides the feedefault and fees values. This priority has already been accounted for in this value.

The minimum time allowed between calls in milliseconds. A value of -1 means there is no limit. If a client exceeds this value they will be penalized and eventually banned by requestlimit int your node.

paymentaddress string Your node's payment address for this specific command.

Signifies if your node has disabled this command. disabled bool true : Call is disabled and not supported. false : Call is enabled and supported.

feedefault float Your node's default service fee. This fee is overridden by the values specified in fees , SPV command configuration fee , and XCloud service command configuration fee .

fees object Object of SPV commands and respective fees. These values are overridden by the SPV wallet-specific configuration fee .

services object Object of your node's XCloud service calls with respective properties.

parameters string Information on the parameters the command takes.

fee float The service command fee. This overrides the feedefault value.

paymentaddress string Your node's payment address for this specific command.

The minimum time allowed between calls in milliseconds. A value of -1 means there is no limit. If a client exceeds this value they will be penalized and eventually banned by requestlimit int your node.

fetchlimit int The maximum number of blocks processed. A value of -1 means there is no limit. A value of 0 means no blocks will be processed.

The value for timeout you set in xrouter.conf for this call. Defines how long (in seconds) your client waits for a response from another Service Node. The default value is 3 timeout int 0 .

Signifies if your node has disabled this service. disabled bool true : Call is disabled and not supported. false : Call is enabled and supported.

Signifies XRouter activation. xrouter bool true : XRouter is enabled. false : XRouter is disabled.

Signifies if your client is a Service Node. servicenode bool true : Client is a Service Node. false : Client is not a Service Node.

config string The raw text contents of your xrouter.conf .

plugins object An object of each service you have setup and the raw text contents of the respective config file in the plugins folder within the Blocknet data directory.

XCloud API

The following set of calls are used to communicate and interact with XCloud services remotely over the Blocknet network via XRouter. XCloud consists of services that are powered by XRouter and are therefore interacted with using a subset of commands from the XRouter API.

You can use the XCloud Services forum category as an alternative medium for discovering services, learning more about each service, and finding instructions on how to interact with the service. A simple list of services can also be found on blockdx.co.

See XCloud Setup for instructions on setting up your environment for use with XCloud.

Call Description

xrGetNetworkServices Returns supported services

xrUpdateNetworkServices Returns latest Service Node list

xrConnect Pre-connect to XRouter nodes

xrConnectedNodes Returns connected node services and fees https://api.blocknet.co 76/92 2020/11/23 Blocknet | API Documentation

Call Description

xrService* Use to interact with XCloud services

xrServiceConsensus* Use to interact with XCloud services with consensus

xrGetReply Returns prior response associated with UUID

xrShowConfigs Returns all node configs received as raw text

xrUpdateConfigs Requests latest configs from nodes

xrReloadConfigs Applies changes made to your configs

xrStatus Returns your XRouter configurations

xrService

Sample Data

{ "service": "BTCgetbestblockhash" }

This call is used to send a request to an XCloud service. XCloud is a decentralized oracle and microservice cloud network powered by XRouter that allows for interaction with microservices, blockchains, off-chain APIs, and cloud tech that's hosted by Service Nodes. If you'd like to operate your own Service Node, see the Service Node Setup Guide.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrService SYSgetbestblockhash

xrService [service] [param1 param2 paramN]

Parameter Type Description

service string The service name without the namespace (xcloud_service, not xrs::[xcloud_service]).

(Optional Parameter) paramN unknown Refer to service documentation for parameter requirements. Information about an XCloud service can be viewed in the service configuration. Use xrConnect to find a node with the service, then use xrConnectedNodes to review the service information.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "reply" : "6a29264f48a40cc88f7c56cdc5fd4c62d1daa7f83b204fdcd4a022d8676438c2", "error" : null, "uuid" : "54b6ec00-8b06-4c2c-9e56-acdff4da69fe" }

Key Type Description

reply unknown The service's response data.

error object The native error response if an error occurred, otherwise a successful response will contain a null error.

uuid string The response ID, which can be used to view this response again with xrGetReply.

xrServiceConsensus

Sample Data

{ "service": "SYSgetbestblockhash" } https://api.blocknet.co 77/92 2020/11/23 Blocknet | API Documentation

This call is used to send a request to an XCloud service, along with a specified amount of nodes for consensus. XCloud is a decentralized oracle and microservice cloud network powered by XRouter that allows for interaction with microservices, blockchains, off-chain APIs, and cloud tech that's hosted by Service Nodes. If you'd like to operate your own Service Node, see the Service Node Setup Guide.

REQUEST PARAMETERS

Sample Request

blocknet-cli xrServiceConsensus 1 SYSgetbestblockhash

xrServiceConsensus [node_count] [service] [param1 param2 paramN]

Parameter Type Description

node_count int The number of nodes that will be used to route calls. The most common response (i.e. the response with the most consensus) will be returned as reply .

service string The service name without the namespace (xcloud_service, not xrs::[xcloud_service]).

(Optional Parameter) paramN unknown Refer to service documentation for parameter requirements. Information about an XCloud service can be viewed in the service configuration. Use xrConnect to find a node with the service, then use xrConnectedNodes to review the service information.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "reply" : "6a29264f48a40cc88f7c56cdc5fd4c62d1daa7f83b204fdcd4a022d8676438c2", "error" : null, "uuid" : "54b6ec00-8b06-4c2c-9e56-acdff4da69fe" }

Key Type Description

reply unknown The service's response data. If using a node_count greater than 1, this returns the most common reply. Use xrGetReply to view each nodes individual response.

uuid string The response ID, which can be used to view this response again with xrGetReply.

Core API

The following set of calls are select, useful core API calls used to interact with the Blocknet blockchain.

Call Description

getnetworkinfo Returns network info

listproposals Returns a list governance proposals

servicenodelist Returns a list of registered Service Nodes

getnetworkinfo

This call is used to retrieve an object containing various state info regarding P2P networking.

REQUEST PARAMETERS

Sample Request

blocknet-cli getnetworkinfo

getnetworkinfo

This call does not take parameters.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response https://api.blocknet.co 78/92 2020/11/23 Blocknet | API Documentation

{ "version": 4000100, "subversion": "/Blocknet:4.0.1/", "protocolversion": 70713, "xbridgeprotocolversion": 51, "xrouterprotocolversion": 50, "localservices": "000000000000040d", "localrelay": true, "timeoffset": -3, "networkactive": true, "connections": 12, "networks": [ { "name": "ipv4", "limited": false, "reachable": true, "proxy": "", "proxy_randomize_credentials": false }, { "name": "ipv6", "limited": false, "reachable": true, "proxy": "", "proxy_randomize_credentials": false }, { "name": "onion", "limited": true, "reachable": false, "proxy": "", "proxy_randomize_credentials": false } ], "relayfee": 0.00010000, "incrementalfee": 0.00001000, "localaddresses": [ ], "warnings": "" }

Parameter Type Description

version int The wallet version (i.e. 4000100 = v4.0.1.)

subversion string The wallet version string.

protocolversion int The consensus protocol version.

xbridgeprotocolversion int The XBridge protocol version.

xrouterprotocolversion int The XRouter protocol version.

connections int The number of peers your client has.

warnings string Any network of blockchain workings.

* Only a limited portion of the response is described

listproposals

Sample Data

{ "sinceblock": 45000 }

This call is used to retrieves a list of proposals since the specified block. By default this returns proposals for the current and upcoming proposals.

REQUEST PARAMETERS

Sample Request

blocknet-cli listproposals 45000

listproposals [sinceblock](optional) https://api.blocknet.co 79/92 2020/11/23 Blocknet | API Documentation

Parameter Type Description

(Optional Parameter) sinceblock int Defaults to 0 Specifies the block number of how far back to pull proposals from. A value of 0 will return the proposals for the current and upcoming Superblock.

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ { "hash": "06dfa870ac90cc5c683b6a2752b2346a10012c0c3afa1a9fc0f9c1b3d823a209", "name": "sample-proposal-name", "superblock": 1339200, "amount": 1200, "address": "Bc6Vqzdo2hdexPDRELxVuH2pDvqhiCtHRz", "url": "https://google.com", "description": "This is a sample proposal for an example.", "votes_yes": 87, "votes_no": 3, "votes_abstain": 0, "status": "passing" } ]

Parameter Type Description

Array array A list of details on all returned proposals.

Object object An object containing the details of each respective proposal.

hash string The HEX string of the proposal hash.

name string The name of the proposal.

superblock int The Superblock the proposal has been submitted for.

amount int The amount of BLOCK funding being requested by the proposal.

address string The address that your propsal will be paid out to if it passes.

url string The URL of your proposal description.

description string A short description of the proposal.

votes_yes int The number of yes votes.

votes_no int The number of no votes.

votes_abstain int The number of abstained votes.

The current status of the proposal. passing : Active and passing. failing : Active and failing. status string passed : Finished and passed. failed : Finished and failed. pending : Active future proposal.

servicenodelist

This call is used to retrieve a list of all Service Nodes registered on the Blocknet network.

REQUEST PARAMETERS

Sample Request

blocknet-cli servicenodelist

servicenodelist

This call does not take parameters.

RESPONSE PARAMETERS https://api.blocknet.co 80/92 2020/11/23 Blocknet | API Documentation

 200 OK

Sample 200 Response

[ { "snodekey": "0b38bfac90cc5c683b6a27f952b2346a1009fc0f9c1a0790809f185ab27b14ecc6", "tier": "SPV", "address": "BUVqkvqD7GCtHRHmchhXVuHqzm77cLuXs1", "timelastseen": 1581082882, "timelastseenstr": "2020-02-07T13:41:22.000Z", "exr": false, "status": "offline", "score": 0, "services": [ "BLOCK", "BTC", "", "DGB", "DYN", "GIN", "KLKS", "xr", "xr::BLOCK", "xr::BTC", "xr::LTC" ] }, { "snodekey": "0d9f04d506df6a870b3d823ab209a281c95112c0c53afa1a222e051857822a9c95", "tier": "SPV", "address": "B1KELxido2Sqshd2pDvqr56VexPDRzSCi4", "timelastseen": 1581087561, "timelastseenstr": "2020-02-07T14:59:21.000Z", "exr": true, "status": "running", "score": 0, "services": [ "BLOCK", "BTC", "xr", "xr::BLOCK", "xr::BTC",, "xr::ETH", "xr::LTC", "xr::XST", "xr::ZEN",, "xrs::eth_accounts", "xrs::eth_blockNumber", "xrs::eth_call", "xrs::eth_chainId", "xrs::eth_estimateGas", "xrs::eth_gasPrice", "xrs::eth_getBalance", "xrs::eth_getBlockByHash", "xrs::eth_getBlockByNumber", "xrs::eth_getBlockTransactionCountByHash", "xrs::eth_getBlockTransactionCountByNumber", "xrs::ltc_getbestblockhash", "xrs::sc_consensus", "xrs::sc_consensusblock", "xrs::xmr_get_block_count", "xrs::xmr_on_get_block_hash", "xrs::xst_getbestblockhash", "xrs::zen_getbestblockhash" ] } ]

Parameter Type Description

Array array A list of information on all registered Service Nodes.

Object object An object containing information on each respective Service Node.

snodekey string The Service Node's pubkey.

tier string The tier of this Service Node (currently only SPV is supported). https://api.blocknet.co 81/92 2020/11/23 Blocknet | API Documentation

Parameter Type Description

address string The Service Node's BLOCK address.

timelastseen int The Unix time the Service Node was last seen.

timelastseenstr string The ISO 8601 datetime the Service Node was last seen.

exr bool Whether the Service Node is an Enterprise XRouter node. EXR nodes have greater throughput and service capabilities.

status string The status of the Service Node ( running , offline ).

score array The Service Node's local reputation score.

services string An array of services the Service Node is supporting.

Web Endpoints

The following set of calls can be used to access data via web endpoints.

Call Description

ticker (1.0) XBridge 24hr trade summary (static list)

ticker (2.0) XBridge 24hr trade summary (dynamic list)

history XBridge 24hr trade history

status XBridge asset availability

servicenodelist Returns a list of registered Service Nodes

dxgetnetworktokens Returns online XBridge assets

dxgetorders Returns all network orders with details

xrgetnetworkservices Returns supported XRouter services

ticker (1.0)

This call is used to view the XBridge trade summary for the past 24 hours and includes values of the inverse market. It is hard-coded to only include the following markets: BLOCK-LTC, LTC-BLOCK, LTC-SYS, SYS- LTC.

Use ticker (2.0) for a dynamic list that updates with whichever markets have had trades in the past 24 hours.

ENDPOINT

https://data.blocknet.co/api/v1.0/ticker

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ { "symbol": "BLOCK-LTC", "open": 0.022216, "high": 0.022240, "low": 0.019437, "close": 0.019437, "volume": 27.945614, "lastprice": 0.019437, "timestamp": 1564444800 }, { "symbol": "LTC-BLOCK", "open": 45.012306, "high": 51.447171, "low": 44.96224, "close": 51.447171, "volume": 0.586885, "lastprice": 51.447171, https://api.blocknet.co 82/92 2020/11/23 Blocknet | API Documentation

"timestamp": 1564444800 }, { "symbol": "SYS-LTC", "open": 0.022216, "high": 0.022240, "low": 0.019437, "close": 0.019437, "volume": 27.945614, "lastprice": 0.019437, "timestamp": 1564444800 }, { "symbol": "LTC-SYS", "open": 45.012306, "high": 51.447171, "low": 44.96224, "close": 51.447171, "volume": 0.586885, "lastprice": 51.447171, "timestamp": 1564444800 } ]

Parameter Type Description

symbol string The market in maker-taker format. Use the status call to view the associated blockchain name for each ticker and the availabiity status.

open int Rolling 24hr opning trade price.

high int Highest trade price in the past 24hrs.

low int Lowest trade price in the past 24hrs.

close int Rolling 24hr closing trade price.

volume int Rolling 24hr trade volume denominated in the maker (first asset in the market pair).

ticker (2.0)

This call is used to view a dynamic list of the XBridge trade summary for the past 24 hours and does not include values of the inverse market. Only markets that have had trades in the past 24 hours it will be included.

ENDPOINT

https://data.blocknet.co/api/v2.0/ticker

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "BLOCK-LTC": { "volume": "548.12435100", "price": "44.72284723252284837351528359", "open": "44.72284723252284837351528359", "high": "55.86592178770949720670391061", "low": "44.63642193485968680902170911", "close": "44.93061261235648931280709984", "timestamp": 1563219207 }, "LTC-BLOCK": { "volume": "29.70000000", "price": "0.022", "open": "0.022", "high": "0.022", "low": "0.022", "close": "0.022", "timestamp": 1563176655 }, "BTC-BLOCK": { "volume": "0.68000000", "price": "0.00021", "open": "0.00021", "high": "0.00021", https://api.blocknet.co 83/92 2020/11/23 Blocknet | API Documentation

"low": "0.0002", "close": "0.0002", "timestamp": 1563175709 } }

Parameter Type Description

Object object The market in maker-taker format and associated data. Use the status call to view the associated blockchain name for each ticker and the availabiity status.

volume string Rolling 24hr trade volume denominated in the maker (first asset in the market pair).

price string The last trade price.

open string Rolling 24hr opning trade price.

high string Highest trade price in the past 24hrs.

low string Lowest trade price in the past 24hrs.

close string Rolling 24hr closing trade price.

timestamp int The Unix epoch timestamp of when the last trade took place.

history

This call is used to view the XBridge trade history for the past 24 hours.

ENDPOINT

https://data.blocknet.co/api/v2.0/history

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ { "timestamp": 1559970139, "txid": "4b409e5c5fb1986930cf7c19afec2c89ac2ad4fddc13c1d5479b66ddf4a8fefb", "to": "Bqtms8j1zrE65kcpsEorE5JDzDaHidMtLG", "xid": "9eb57bac331eab34f3daefd8364cdb2bb05259c407d805d0bd0c", "from": "BLOCK", "fromAmount": 0.001111, "to": "SYS", "toAmount": 0.001000 }, { "timestamp": 1559970139, "txid": "3de7479e8a88ebed986d3b7e7e135291d3fd10e4e6d4c6238663db42c5019286", "to": "Bqtms8j1zrE65kcpsEorE5JDzDaHidMtLG", "xid": "fd0fed3ee9fe557d5735768c9bdcd4ab2908165353e0f0cef0d5", "from": "BLOCK", "fromAmount": 0.001577, "to": "SYS", "toAmount": 0.001420 }, { "timestamp": 1559970139, "txid": "9cc4a0dae46f2f1849b3ab6f93ea1c59aeaf0e95662d90398814113f12127eae", "to": "BbrQKtutGBLuWHvq26EmHKuNaztnfBFWVB", "xid": "f74c614489bd77efe545c239d1f9a57363c5428e7401b2018d350", "from": "BLOCK", "fromAmount": 0.000231, "to": "SYS", "toAmount": 0.001100 } ] [{ "timestamp":1564516002, "txid":"9f9592e4e5954645e8093c51e63cee73832b000e47dac45d8580deea3ebff8ef", "to":"BLOCK", "xid":"ca2c928552682d762d54b3cb124f9b663a7752faae11d13a", "from":"LTC", "fromAmount":"0.07393600", https://api.blocknet.co 84/92 2020/11/23 Blocknet | API Documentation

"toAmount":"3.80379800"

},{"timestamp":1564515003,"txid":"fe7dac3f28ea7873aebc210ebb2fe77e60c8cd75204e2b37fb3ef0dac4a6213b","to":"BLOCK","xid":"6b169c7d40459411709a04405d3cd00d039ca7896153

Parameter Type Description

timestamp int Unix epoch timestamp of when the trade took place.

txid string Blocknet trade fee transaction ID.

to string Service Node that received the trade fee.

xid string XBridge transaction ID.

from string Taker trading asset; the ticker of the asset being sold by the taker.

fromAmount int Taker trading size.

to string Maker trading asset; the ticker of the asset being sold by the maker.

toAmount int Maker trading size.

status

This call is used to view XBridge asset availability for trading and associated blockchain name for each ticker. It is hard-coded to only include assets for the markets returned in ticker (1.0).

To view a full list of supported assets for trading, use dxgetnetworktokens.

ENDPOINT

https://data.blocknet.co/api/v2.0/status

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "BLOCK": { "id":1, "name": "Blocknet", "frozen":0 }, "LTC": { "id":2, "name": "", "frozen":0 }, "SYS": { "id":3, "name": "Syscoin", "frozen":0 } }

Parameter Type Description

Object object An object with the ticker's blockchain name, ID, and availability status.

id int The asset's ID number.

name string The asset's blockchain name.

frozen bool Online status. If 0 , the asset is online. If 1 , the asset is offline. Both assets of a market pair must show 0 for the market to be available for trading.

servicenodelist (web)

This call is used to retrieve a list of all Service Nodes registered on the Blocknet network.

ENDPOINT

https://data.blocknet.co/api/v1.0/servicenodelist https://api.blocknet.co 85/92 2020/11/23 Blocknet | API Documentation

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ { "snodekey": "0b38bfac90cc5c683b6a27f952b2346a1009fc0f9c1a0790809f185ab27b14ecc6", "tier": "SPV", "address": "BUVqkvqD7GCtHRHmchhXVuHqzm77cLuXs1", "timelastseen": 1581082882, "timelastseenstr": "2020-02-07T13:41:22.000Z", "exr": false, "status": "offline", "score": 0, "services": [ "BLOCK", "BTC", "DASH", "DGB", "DYN", "GIN", "KLKS", "xr", "xr::BLOCK", "xr::BTC", "xr::LTC" ] }, { "snodekey": "0d9f04d506df6a870b3d823ab209a281c95112c0c53afa1a222e051857822a9c95", "tier": "SPV", "address": "B1KELxido2Sqshd2pDvqr56VexPDRzSCi4", "timelastseen": 1581087561, "timelastseenstr": "2020-02-07T14:59:21.000Z", "exr": true, "status": "running", "score": 0, "services": [ "BLOCK", "BTC", "xr", "xr::BLOCK", "xr::BTC",, "xr::ETH", "xr::LTC", "xr::XST", "xr::ZEN",, "xrs::eth_accounts", "xrs::eth_blockNumber", "xrs::eth_call", "xrs::eth_chainId", "xrs::eth_estimateGas", "xrs::eth_gasPrice", "xrs::eth_getBalance", "xrs::eth_getBlockByHash", "xrs::eth_getBlockByNumber", "xrs::eth_getBlockTransactionCountByHash", "xrs::eth_getBlockTransactionCountByNumber", "xrs::ltc_getbestblockhash", "xrs::sc_consensus", "xrs::sc_consensusblock", "xrs::xmr_get_block_count", "xrs::xmr_on_get_block_hash", "xrs::xst_getbestblockhash", "xrs::zen_getbestblockhash" ] } ]

Parameter Type Description

Array array A list of information on all registered Service Nodes.

Object object An object containing information on each respective Service Node.

snodekey string The Service Node's pubkey. https://api.blocknet.co 86/92 2020/11/23 Blocknet | API Documentation

Parameter Type Description

tier string The tier of this Service Node (currently only SPV is supported).

address string The Service Node's BLOCK address.

timelastseen int The Unix time the Service Node was last seen.

timelastseenstr string The ISO 8601 datetime the Service Node was last seen.

exr bool Whether the Service Node is an Enterprise XRouter node. EXR nodes have greater throughput and service capabilities.

status string The status of the Service Node ( running , offline ).

score array The Service Node's local reputation score.

services string An array of services the Service Node is supporting.

dxgetnetworktokens (web)

This call is used to retrieve all the assets currently supported by the network for XBridge. This list may differ from the compatibility list due to assets being unofficially supported or assets not being supported by any nodes on the network.

ENDPOINT

https://data.blocknet.co/api/v2.0/dxgetnetworktokens

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ "LTC", "SYS", "MONA", "BLOCK" ]

Parameter Type Description

Array array An array of all the assets supported by the network for trading.

dxgetorders (web)

This call is used to retrieve all orders of every market pair. Unlike with dxGetOrders, it will return all orders on the network.

ENDPOINT

https://data.blocknet.co/api/v2.0/dxgetorders

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

[ { "id": "91d0ea83edc79b9a2041c51d08037cff87c181efb311a095dfdd4edbcc7993a9", "maker": "SYS", "maker_size": "0.100", "taker": "LTC", "taker_size": "0.01", "updated_at": "2018-01-15T18:25:05.12345Z", "created_at": "2018-01-15T18:15:30.12345Z", "status": "finished" }, { "id": "a1f40d53f75357eb914554359b207b7b745cf096dbcb028eb77b7b7e4043c6b4", "maker": "SYS", https://api.blocknet.co 87/92 2020/11/23 Blocknet | API Documentation

"maker_size": "0.100", "taker": "LTC", "taker_size": "0.01", "updated_at": "2018-01-15T18:25:05.12345Z", "created_at": "2018-01-15T18:15:30.12345Z", "status": "finished" }, { "id": "6be548bc46a3dcc69b6d56529948f7e679dd96657f85f5870a017e005caa050a", "maker": "SYS", "maker_size": "0.100", "taker": "LTC", "taker_size": "0.01", "updated_at": "2018-01-15T18:25:05.12345Z", "created_at": "2018-01-15T18:15:30.12345Z", "status": "finished" } ]

Parameter Type Description

Array array An array of all orders with each order having the following parameters.

id string The order ID.

maker string Maker trading asset; the ticker of the asset being sold by the maker.

maker_size string(float) Maker trading size. String is used to preserve precision.

taker string Taker trading asset; the ticker of the asset being sold by the taker.

taker_size string(float) Taker trading size. String is used to preserve precision.

updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.

created_at string ISO 8601 datetime, with microseconds, of when the order was created.

status string View order status codes

xrgetnetworkservices (web)

This call is used to view the XRouter services currently supported on the network, along with the number of nodes supporting each service. XRouter SPV calls use the xr:: namespace and XCloud services use the xrs:: namespace.

ENDPOINT

https://data.blocknet.co/api/v2.0/xrgetnetworkservices

RESPONSE PARAMETERS

 200 OK

Sample 200 Response

{ "reply": { "spvwallets": [ "xr::BLOCK", "xr::BTC", "xr::LTC", "xr::MNP", "xr::SYS", "xr::TBLOCK" ], "services": [ "xrs::BTCgetbestblockhash", "xrs::BTCgetblockhash", "xrs::BTCgettransaction", "xrs::SYSgetbestblockhash", "xrs::SYSgetblock", "xrs::SYSgetgovernance "nodecounts": { "xr::BLOCK": 27, "xr::BTC": 13, "xr::LTC": 21, "xr::MNP": 1, "xr::SYS": 9, "xrs::BTCgetbestblockhash": 12, "xrs::BTCgetblockhash": 12, "xrs::BTCgettransaction": 5, "xrs::SYSgetbestblockhash": 7, "xrs::SYSgetblock": 6, "xrs::SYSgetgovernanceinfo": 4, "xrs::SYSgetmempool": 4, "xrs::SYSlistoffers": 4, "xrs::SYSofferinfo": 4, "xrs::twilio": 1 } }, https://api.blocknet.co 88/92 2020/11/23 Blocknet | API Documentation

"uuid": "cd408df7-0ff8-4e29-b5cf-0148af83f93a" }

Parameter Type Description

reply object An object containing information on supported services.

spvwallets array An array of supported SPV wallets, represented by the asset's ticker.

services array An array of supported XCloud services.

nodecounts object An object of supported SPV wallets and XCloud services with how many nodes support each.

-- key string The SPV wallet or XCloud service with it's namespace.

-- value int The amount of nodes supporting each respective service.

uuid string The response ID, which can be used to view this response again with xrGetReply (not supported via web API).

Changelog

This API documentation will be continuously updated to improve descriptions, instructions, and overall clarity on how to use the API and begin building on the Blocknet Protocol. An overview of changes can be viewed below. For a more detailed view of changes, see the site's Github repository.

To receive notifications and stay informed on important developer updates and changes relating to the Blocknet Protocol, subscribe to the developer notification emailing list.

Updates

7/20/2020

• Wallet v4.3.x release

• Added dxMakePartialOrder call

• Added dxGetUtxos call

• Added dxSplitAddress call

• Added dxSplitInputs call

• Added xrUpdateNetworkServices call

• Added servicenodelist web endpoint

• Updated xrConnect description to note it's no longer required

• Updated dxMakeOrder response details

• Updated dxTakeOrder response details

• Updated servicenodelist core response details

• Updated dxGetOrders response details

• Updated dxGetOrder response details

• Updated dxGetMyOrders response details

• Updated xrGetReply response to include all_replies

• Updated all XRouter call responses to remove all_replies (added to xrGetReply)

5/11/2020

• Wallet v4.2.x release

• Added dxgetorders web endpoint

• Added XRouter Service Explorer link

• Added C++ library guide link

• Added tls setting to xrouter.conf setup

• Added dxnowallets and ShowAllOrders setting to the XBridge Setup

• Updated dxGetTradingData response details

https://api.blocknet.co 89/92 2020/11/23 Blocknet | API Documentation

4/20/2020

• Wallet v4.1.x release

• Added status to listproposals response details

2/7/2020

• Wallet v4.0.x release

• Added dxFlushCancelledOrders call

• Added dxGetTradingData call

• Removed gettradingdata call, in progress towards being deprecated

• Updated blocknetdx.conf references to blocknet.conf

• Updated blocknetdx-cli references to blocknet-cli

• Remove xrUpdateConfigs call, replaced by servicenodesendping

• Remove xrouter=1 from XRouter setup

• Added selective Core API calls

11/26/2019

• Wallet v3.14.1 release

• Added dxGetNewTokenAddress call

• Updated XBridge Setup to note that Segwit/Bech32 address and p2pk inputs are not yet compatible

• Updated dxMakeOrder and dxTakeOrder to note usage of funds are not restricted to the speficied address

• Corrected xrGetBlocks and xrGetTransactions to include quotes in the string array

• Updated XBridge order IDs in examples to be representative of real IDs

8/2/2019

• Updated the xrConnect output to include the added fetchlimit and timeout settings with the returned configs

• Updated the ticker (1.0) call output to include lastprice and timestamp

• Added clarification ticker (1.0) description on inverse market data inclusion

7/12/2019

• Updated XBridge Setup to reference the guide in the documentation portal

• Added ticker (2.0) call

7/5/2019

• Added gettradingdata call

• Added Web API section and calls

5/9/2019

• Updated Github links from /BlocknetDX to /blocknetdx

• Updated Blocknet repo links from /BlockDX to /blocknet

4/18/2019

• Updated XRouter setup instructions

• Updated XBridge setup instructions

• Added XCloud setup instructions

• Updated XBridge API descriptions

• Updated XRouter API for beta release

• Added XCloud API for beta release

• Updated XBridge confirmations info for clarifications

• Updated XRouter intro to include node scoring information

• Added XCloud introduction https://api.blocknet.co 90/92 2020/11/23 Blocknet | API Documentation

3/5/2019

• Updated links to Github to reflect change in repository names

• Updated link to compatible blockchains

• Updated XRouter [confirmations] to [node_count]

• Updated XRouter [block] to [block_number]

• Updated language from token to asset

12/7/2018

• Updated Introduction Service Node description

• Updated 'coin' verbiage to 'token'

• Updated description of how XBridge orderbooks are decentralized

• Updated order statuses for dxMakeOrder, dxCancelOrder, dxGetOrder, dxGetOrders, dxGetMyOrders to remove signed , include initiated , and improve hold description

• Updated XBridge Error Codes

• Updated sample 400 response for dxGetOrders, dxGetMyOrders, dxGetOrderFills, dxGetOrderHistory

• Updated dxTakeOrder, dxGetOrders, dxGetMyOrders, and dxGetOrderBook description for improved clarity

• Updated dxGetOrderFills sample response to not include maker_txid , taker_txid , and block_id

• Updated dxGetOrderHistory parameters and removed 'not yet supported' comment

• Updated dxGetNetworkTokens to remove 'not yet supported' comment

• Updated dxGetTokenBalances description to clarify it returns available balances

• Updated dxGetOrderBook max_orders description and sample responses with better examples

• Consolidated order status codes to a single location

• Updated Status Codes to include rolled back and rollback failed

• Added dxLoadXBridgeConf call

• Added historic versioning, which can be viewed next to each changelog date

• Corrected XRouter confirmations data type from 'string' to 'int'

8/31/2018

• Updated XBridge design details and diagrams to reflect fee switch from maker to taker

• Updated mentions of XBridge from 0.005 BLOCK to 0.015 BLOCK

• Added reference for atomic swap type in XBridge introduction

8/21/2018

• Added information on the design of XBridge and XRouter

• Added hyperlink to site branding leading to the site root

8/10/2018

• Added additonal information on the Blocknet Protocol, XBridge, and XRouter

• Added information on configuration and setup needed to use the API

• Moved Error Codes to under the XBridge API category

• Updated the xrGetBalanceUpdate description for better clarity

• Updated xrGetBalance, dxGetOrderHistory, and dxGetNetworkTokens descriptions to reflect the level of support

• Updated XBridge order statuses and added explanations

• Added a changelog

• Added developer newsletter link in changelog and sidebar

• Updated sidebar links

• Updated design

8/3/2018

• Added documentation for XRouter CLI API calls https://api.blocknet.co 91/92 2020/11/23 Blocknet | API Documentation

6/4/2018

• API documentation went live

• Includes documentation for XBridge CLI API calls

Wallet v4.3.x

https://api.blocknet.co 92/92