Technical description of the platform

REST API: methods of the data service

https://img.shields.io/badge/auth-required-orange.svg

Following API methods are available for the data service:

Assets method group

The methods of the Assets group are used for obtaining of data about token sets (assets).

GET /assets

The method is used for obtaining of a list of assets available in the blockchain. The list consists of transactions for emission of corresponding assets.

Response example:

POST /assets/count

The method returns a number of available assets in the blockchcain.

Response example:

GET /assets/{id}

The method returns information about an available asset according to its {id}.

The response of the method contains following data:

  • index - asset index number;

  • id - asset identifier;

  • name - asset name;

  • description - asset description;

  • reissuable - reissuability of an asset;

  • quantity - number of tokens in an asset;

  • decimals - number of digits after decimal dot in a used token (WEST - 8)

Response example:

Blocks method group

GET /blocks/at/{height}

The method returns content of a block at a defined height.

The response of the method contains following parameters:

  • reference - block hash sum;

  • blocksize - size of a block;

  • features - features activated at the moment of block generation;

  • signature - block signature;

  • fee - total fee for transactions included in a block;

  • generator - block creator address;

  • transactionCount - number of transactions included in a block;

  • transactions - array with bodies of transactions included in a block;

  • version - block version;

  • poa-consensus.overall-skipped-rounds - number of mining rounds to be skipped in case of use of the PoA consensus algorithm;

  • timestamp - block Unix Timestamp (in milliseconds);

  • height - height of block generation.

Response example:

Contracts method group

Methods of the Contracts group are used for obtaining of information about smart contracts of the blockchain.

GET /contracts

The method returns information about all smart contracts installed in the network. For each smart contract, following parameters are returned:

  • contractId - smart contract identifier;

  • image - name of a smart contract Docker image or its absolute path in its registry;

  • imageHash - smart contract hash sum;

  • version - smart contract version;

  • active - status of a smart contract at the moment of a query: true - working, false - not working.

Example of an answer for one smart contract:

GET /contracts/count

The method returns a number of smart contracts on a blockchain that correspond with defined provisions and filters.

Response example:

GET /contracts/id/{id}

The method returns information about a smart contract with a definite {id}.

Response example:

GET /contracts/id/{id}/versions

The method returns version history of a smart contract with a definite {id}.

Example of a response for one version:

GET /contacts/history/{id}/key/{key}

Returns a history of changes of a {key} key for a smart contract with a definite {id}.

Example of a response for one key:

GET /contracts/senders-count

The method returns a number of unique participants that send transactions 104 for smart contract calls.

Response example:

GET /contracts/calls

The method returns a list of 104 transactions for smart contract calls with their parameters and results.

Example of a response for one transaction:

Privacy method group

Methods of the Privacy group are used for obtaining of information about confidential data groups.

GET /privacy/groups

The method returns a list of confidential data groups in the blockchain.

Example of a response for one group:

GET /privacy/groups/count

The method returns a number of confidential data groups in the blockchain.

Response example:

GET /privacy/groups/{address}

The method returns a list of confidential data groups that include a defined {address}.

Example of a response for one group:

GET /privacy/groups/by-recipient/{address}

The method returns a list of privacy data groups that include a defined {address} as a recipient of data.

Example of a response for one group:

GET /privacy/groups/{address}/count

The method returns a number of confidential data groups that include a defined {address}.

Response example:

GET /privacy/groups/id/{id}

The method returns information about a privacy data group with a definite {id}.

Response example:

GET /privacy/groups/id/{id}/history

The method returns a history of changes of a confidential data access group with a definite {id}. The history is returned as a list of sent 112-114 transactions with their descriptions.

Example of a response for one transaction:

GET /privacy/groups/id/{id}/history/count

The method returns a number of 112-114 transactions sent for changing of an access group with a definite {id}.

Response example:

GET /privacy/nodes

The method returns a list of available nodes in the blockchain.

Example of a response for one node:

GET /privacy/nodes/count

The method returns a number of available nodes in the blockchain.

Response example:

GET /privacy/nodes/publicKey/{targetPublicKey}

The method returns information about a node according to its {targetPublicKey}.

Response example:

GET /privacy/nodes/address/{address}

The method returns information about a node according to its {address}.

Response example:

Transactions method group

Methods of the Transactions group are used for obtaining of information about transactions in the blockchain.

GET /transactions

The method returns a list of transactions corresponding with provisions of a search query and applied filters.

Important

The GET /transactions method returns not more than 500 transactions for one query.

Example of a response for one transaction:

GET /transactions/count

The method returns a number of transactions corresponding with provisions of a search query and applied filters.

Response example:

GET /transactions/{id}

The method returns a transaction according to its {id}.

Response example:

Users method group

Methods of the Users group are used for obtaining of information about participants of the blockchain network.

GET /users

The method returns a list of participants corresponding with provisions of a search query and applied filters.

Example of a response for one participant:

GET /users/count

The method returns a number of participants corresponding with filters applied in the query.

Example of a response for one participant:

GET /users/{userAddressOrAlias}

The method returns information about a participants according to his address or alias.

Response example:

GET /users/contract-id/{contractId}

The method returns a list of participants that have ever called a smart contract with a definite {contractId}.

Example of a response for one participant:

POST /users/by-addresses

The method returns a list of participants for a definite set of addresses.

Example of a response for one participant:

Methods for obtaining of information about data transactions (12)

This group of methods is called via the /api/v1/txIds/ route.

GET /api/v1/txIds/{key}

The method returns a list of identifiers for data transactions that include the defined {key}.

Example of a response for one transaction:

GET /api/v1/txIds/{key}/{value}

The method returns a list of identifiers for data transactions that include defined {key} and {value}.

Example of a response for one transaction:

GET /api/v1/txData/{key}

The method returns bodies of data transactions that include a defined {key}.

Example of a response for one transaction:

GET /api/v1/txData/{key}/{value}

The method returns bodies of data transactions that include defined {key} and {value}.

Example of a response for one transaction:

Leasing method group

GET /leasing/calc

The method returns a total sum for leasing of tokens in a specified block interval.

Response example:

Stats method group

Methods of the Stats group are used for obtaining of statistical data and blockchain monitoring.

GET /stats/transactions

The method returns information about transactions that have been send within a specified time period.

Response example:

GET /stats/contracts

The method returns information about transactions 104 within a specified time period.

Response example:

GET /stats/tokens

The method returns information about turnover of tokens in the blockchain within a specified time period.

Response example:

GET /stats/addresses-active

The method returns addresses that have been active within a specified time period.

Response example:

GET /stats/addresses-top

The method returns addresses that have been the most active senders or recipients within a specified time period.

Response example:

GET /stats/nodes-top

The method returns addresses of nodes that have created the largest number of blocks within a specified time period.

Response example:

GET /stats/contract-calls

The method returns a list of smart contracts that have been mostly called within a specified time period.

Response example:

GET /stats/contract-last-calls

The method returns a list of last smart contract calls according to their IDs and names.

Response example:

GET /stats/contract-types

The method returns a list of blockchain smart contracts according to their images and hashes.

Response example:

GET /stats/monitoring

The method returns general information about the network.

Response example:

Anchoring method group

Methods of the Anchoring group are used for obtaining of information about anchoring rounds.

GET /anchoring/rounds

The method returns a list of transactions that have been sent in anchoring rounds in accordance with specified provisions and filters.

Response example:

GET /anchoring/round/at/{height}

The method returns information about an anchoring round at a specified block {height}.

Response example:

GET /anchoring/info

The method returns information about the blockchain anchoring.

Response example:

Auxiliary methods of the data service

GET /info

The method returns information about a data service in use.

Response example:

GET /status

The method returns information about status of the data service.

Response example: