Data Preparation Service

This service aggregates data from a blockchain into a relational database and provides an API to access that data. Service features are designed to meet the needs of the Waves Enterprise client. Specifying parameters are available for requests.

Usage

Deploy your client and node using the delivery set for service usage. Currently, access to the Data Preparation Service API is limited in the public network.

Specifying parameters

Search

Match search — accepts a string and a range for searching a match.

Match search range:

  • in descriptions of token assets and in messages in transfer transactions;
  • in transaction sums;
  • in blocks;
  • in aliases of senders and recipients of transactions;
  • in addresses of senders and recipients of transactions;
  • in transaction IDs;
  • in token IDs;
  • in transaction signatures;
  • in keys/values of transactions with the data.

Filters

The filters define details of transactions returned by API methods. The following filters are available:

  • By transaction type — a numeric ID of transaction type. ID’s are described in Structure of objects section.

  • By token asset — token assets ID (transaction ID of the token assets issue).

  • By transaction sum (requires specifying transaction type and token asset ID):

    • Transaction sum equals - number;
    • Transaction sum from - number;
    • Transaction sum up to - number.
  • By date (requires both range values):

    • Transaction date from in yyyy-mm-dd format;
    • Transaction date up to yyyy-mm-dd.
  • Permissions — displays permission transactions, requires specifying type of transaction as “Permission”.

  • Index and limit — returns transactions from the database up to the specified index according to the specified limit.

Transactions

GET/transactions

Returns a list of transactions matching the search query criteria and filters applied.

Important

It is returned a maximum of 500 transactions for the API GET /transactions method request.

Method Response:

[
 {
    "id": "string",
    "type": 0,
    "height": 0,
    "fee": 0,
    "sender": "string",
    "senderPublicKey": "string",
    "signature": "string",
    "timestamp": 0,
    "version": 0
 }
]

GET/transactions/count

Returns the number of transactions matching the search query criteria and filters applied.

Method Response:

{
"count": "string"
}

GET/transactions/id/{id}

Returns transaction by ID {id}.

Method Response:

{
"id": "string",
"type": 0,
"height": 0,
"fee": 0,
"sender": "string",
"senderPublicKey": "string",
"signature": "string",
"timestamp": 0,
"version": 0
}

Token assets

GET/assets

Returns a list of token assets available in the blockchain (as token issue transactions).

Method Response:

[
 {
    "id": "string",
    "type": 0,
    "height": 0,
    "fee": 0,
    "sender": "string",
    "senderPublicKey": "string",
    "signature": "string",
    "timestamp": 0,
    "version": 0,
    "assetId": "string",
    "name": "string",
    "description": "string",
    "quantity": 0,
    "decimals": 0,
    "reissuable": true
 }
]

Users

GET/users

Returns a list of users matching the search query criteria and filters applied.

Method Response:

[
 {
    "address": "string",
    "aliases": [
    "string"
    ],
    "registration_date": "string",
    "permissions": [
    "string"
    ],
    "balances": [
    {
    "assetId": "string",
     "amount": 0
    }
    ]
 }
]

GET/users/{userAddress}

Returns information about the user as per user’s address.

Method Response:

{
"address": "string",
"aliases": [
    "string"
],
"registration_date": "string",
"permissions": [
    "string"
],
"balances": [
    {
      "assetId": "string",
    "amount": 0
    }
]
}

Blocks

GET/blocks/{height}

Returns the block at the specified height.

Method Response:

{
 "version": 0,
 "timestamp": 0,
 "reference": "string",
 "nxt-consensus": {
     "base-target": 0,
     "generation-signature": "string"
 },
 "features": [
     0
 ],
 "generator": "string",
 "signature": "string",
 "blocksize": 0,
 "transactionCount": 0,
 "fee": 0,
 "height": 0,
 "transactions": [
     {
     "id": "string",
     "type": 0,
     "height": 0,
     "fee": 0,
     "sender": "string",
     "senderPublicKey": "string",
     "signature": "string",
     "timestamp": 0,
     "version": 0
     }
 ]
 }

Data transactions

GET/api/v1/txids/{key}

Returns a list of data transaction ID’s containing the specified key.

Method Response:

[
{
    "id": "string"
}
]

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

Returns a list of data transaction ID’s containing the specified key and value.

Method Response:

[
{
    "id": "string"
}
]

GET/api/v1/txData/{key}

Returns data transaction bodies containing the specified key.

Method Response:

[
{
 "id": "string",
 "type": "string",
 "height": 0,
 "fee": 0,
 "sender": "string",
 "senderPublicKey": "string",
 "signature": "string",
 "timestamp": 0,
 "version": 0,
 "key": "string",
 "value": "string",
 "position_in_tx": 0
}
]

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

Returns data transaction bodies containing the specified key and value.

Method Response:

[
{
 "id": "string",
 "type": "string",
 "height": 0,
 "fee": 0,
 "sender": "string",
 "senderPublicKey": "string",
 "signature": "string",
 "timestamp": 0,
 "version": 0,
 "key": "string",
 "value": "string",
 "position_in_tx": 0
}
]