REST API methods for the data service

Transactions

Set of methods that allows to show lists of transactions according to the parameters and filters being set.

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

Set of methods that allows to show information about token assets available in the blockchain.

GET /assets

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

Method Response:

[
  {
    "index": 0,
    "id": "string",
    "name": "string",
    "description": "string",
    "reissuable": true,
    "quantity": 0,
    "decimals": 0
  }
]

POST /assets/count

Returns a list of token assets available in the blockchain.

Method Response:

{
    "count": 0
}

GET /assets/{id}

Returns information about the user as per user’s {id}.

Method Response:

{
  "index": 0,
  "id": "string",
  "name": "string",
  "description": "string",
  "reissuable": true,
  "quantity": 0,
  "decimals": 0
}

Users

Set of methods that allows to show information about users (blockchain participants) according to parameters and filters being set.

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"
    ]
  }
]

GET /users/count

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

Method Response:

{
  "count": 0
}

GET /users/{userAddressOrAlias}

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

Method Response:

{
  "address": "string",
  "aliases": [
    "string"
  ],
  "registration_date": "string",
  "permissions": [
    "string"
  ]
}

GET /users/contract-id/{contractId}

Returns a list of users that have ever called a smart contract with a specified {contractId}.

Method Response:

{
  "address": "string",
  "aliases": [
    "string"
  ],
  "registration_date": "string",
  "permissions": [
    "string"
  ]
}

POST /users/by-addresses

Returns a list of users for a specified set of addresses.

Method Response:

[
  {
    "index": 0,
    "id": "string",
    "name": "string",
    "description": "string",
    "reissuable": true,
    "quantity": 0,
    "decimals": 0
  }
]

Blocks

GET /blocks/at/{height}

Returns the block at the specified height.

Method Response:

{
  "version": 0,
  "timestamp": 0,
  "reference": "string",
  "features": [
    0
  ],
  "generator": "string",
  "signature": "string",
  "blocksize": 0,
  "transactionsCount": 0,
  "fee": 0,
  "height": 0,
  "transactions": [
    {
      "id": "string",
      "type": 0,
      "height": 0,
      "fee": 0,
      "sender": "string",
      "senderPublicKey": "string",
      "signature": "string",
      "timestamp": 0,
      "version": 0
    }
  ]

Smart contracts

Set of methods that allows to show information on Docker smart-contracts available in the blockchain.

GET /contracts

Returns a list of smart contracts in the blockchain according to the specified parameters and filters.

Method Response:

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

GET /contracts/count

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

Method Response:

{
  "count": 0
}

GET /transactions/id/{id}

Returns information about a smart contract according to its {id}.

Note

This method is able to return the smart contract state with the use of the /state endpoint. In order to return the state in a correct way, the method has to process the lastIndex and limit parameters to limit the number of entries to be returned. Example for a curl query: curl -X GET "https://<your-address>/dataServiceAddress/contracts/id/{id}/state?lastIndex=0&limit=50&q="

Method Response:

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

GET /contracts/id/{id}/versions

Returns a version history of a smart contract according to its {id}.

Method Response:

[
  {
    "version": 0,
    "image": "string",
    "imageHash": "string",
    "timestamp": "string"
  }
]

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

Returns a history of changes of a smart contract key according to its {id} and {key}.

Method Response:

{
  "total": 777,
  "data": [
    {
      "key": "some_key",
      "type": "integer",
      "value": "777",
      "timestamp": 1559347200000,
      "height": 14024
    }
  ]
}

GET /contracts/senders-count

Returns a number of unique participants sending transactions 104 for smart contract call.

Method Response:

{
  "count": 777
}

GET /contracts/calls

Returns a list of 104 transactions with their parameters and results.

Method Response:

[
  {
    "id": "string",
    "type": 0,
    "height": 0,
    "fee": 0,
    "sender": "string",
    "senderPublicKey": "string",
    "signature": "string",
    "timestamp": 0,
    "version": 0,
    "contract_id": "string",
    "contract_name": "string",
    "contract_version": "string",
    "image": "string",
    "fee_asset": "string",
    "finished": "string",
    "params": [
      {
        "tx_id": "string",
        "param_key": "string",
        "param_type": "string",
        "param_value_integer": 0,
        "param_value_boolean": true,
        "param_value_binary": "string",
        "param_value_string": "string",
        "position_in_tx": 0,
        "contract_id": "string",
        "sender": "string"
      }
    ],
    "results": [
      {
        "tx_id": "string",
        "result_key": "string",
        "result_type": "string",
        "result_value_integer": 0,
        "result_value_boolean": true,
        "result_value_binary": "string",
        "result_value_string": "string",
        "position_in_tx": 0,
        "contract_id": "string",
        "time_stamp": "string"
      }
    ]
  }
]

Access groups and privacy

Set of methods that allows to show information on access groups and nodes in the blockchain.

GET /privacy/groups

Returns a list of access groups in the blockchain.

Method Response:

[
  {
    "id": "string",
    "name": 0,
    "description": "string",
    "createdAt": "string"
  }
]

GET /privacy/groups/count

Returns a number of access groups in the blockchain.

Method Response:

{
  "count": 0
}

GET /privacy/groups/{address}

Returns a list of access groups containing a specified {address}.

Method Response:

[
  {
    "id": "string",
    "name": 0,
    "description": "string",
    "createdAt": "string"
  }
]

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

Returns a list of access groups that include a specified {address} as a recipient.

Method Response:

[
  {
    "id": "string",
    "name": 0,
    "description": "string",
    "createdAt": "string"
  }
]

GET /privacy/groups/{address}/count

Returns a number of access groups that include a specified {address}.

Method Response:

{
  "count": 0
}

GET /privacy/groups/id/{id}

Returns information about the group according to its {id}.

Method Response:

{
  "id": "string",
  "name": 0,
  "description": "string",
  "createdAt": "string"
}

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

Returns a history of changes of an access group according to its {id} (as a list of sent 112-114 transactions with their descriptions).

Method Response:

{
  "id": "string",
  "name": 0,
  "description": "string",
  "createdAt": "string"
}

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

Returns a number of sent 112-114 transactions that have changed an access group with a specified {id}.

Method Response:

{
  "id": "string",
  "name": 0,
  "description": "string",
  "createdAt": "string"
}

GET /privacy/nodes

Returns a list of nodes in the blockchain.

Method Response:

[
  {
    "id": "string",
    "name": 0,
    "description": "string",
    "createdAt": "string"
  }
]

GET /privacy/nodes/count

Returns a number of available nodes in the blockchain.

Method Response:

{
  "count": 0
}

GET /privacy/nodes/publicKey/{targetPublicKey}

Returns information on a node according to its public key {targetPublicKey}.

Method Response:

[
  {
    "id": "string",
    "name": 0,
    "description": "string",
    "createdAt": "string"
  }
]

GET /privacy/nodes/address/{address}

Returns information on a node according to its {address}.

Method Response:

[
  {
    "id": "string",
    "name": 0,
    "description": "string",
    "createdAt": "string"
  }
]

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
  }
]

Leasing functions

GET /leasing/calc

Returns leasing payouts for a specified block heights.

Method Response:

{
  "payouts": [
    {
      "leaser": "3P1EiJnPxFxGyhN9sucXfB2rhQ1ws4cmuS5",
      "payout": 234689
    }
  ],
  "totalSum": 4400000,
  "totalBlocks": 1600
}

Data Service utilities

GET /info

Returns information about the data service in use.

Method Response:

{
  "version": "string",
  "buildId": "string",
  "gitCommit": "string"
}

GET /status

Returns information about the status of the data service.

Method Response:

{
  "status": "string"
}

Statistics and monitoring functions

GET /stats/transactions

Returns information on accomplished transactions within a specified time period.

Method Response:

{
  "aggregation": "day",
  "data": [
    {
      "date": "2020-03-01T00:00:00.000Z",
      "transactions": [
        {
          "type": 104,
          "count": 100
        }
      ]
    }
  ]
}

GET /stats/contracts

Returns information on smart contract call transactions performed within a specified time period.

Method Response:

{
  "aggregation": "day",
  "data": [
    {
      "date": "2020-03-01T00:00:00.000Z",
      "transactions": [
        {
          "type": 104,
          "count": 100
        }
      ]
    }
  ]
}

GET /stats/tokens

Returns information on token turnover in the blockchain within a specified time period.

Method Response:

{
  "aggregation": "day",
  "data": [
    {
      "date": "2020-03-01T00:00:00.000Z",
      "sum": "12000.001"
    }
  ]
}

GET /stats/addresses-active

Returns addresses that have been active within a specified time period.

Method Response:

{
  "aggregation": "day",
  "data": [
    {
      "date": "2020-03-01T00:00:00.000Z",
      "senders": "12",
      "recipients": "12"
    }
  ]
}

GET /stats/addresses-top

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

Method Response:

{
  "aggregation": "day",
  "data": [
    {
      "date": "2020-03-01T00:00:00.000Z",
      "senders": "12",
      "recipients": "12"
    }
  ]
}

GET /stats/nodes-top

Returns node addresses that have created the most number of blocks within a specified time period.

Method Response:

{
  "limit": "10",
  "data": [
    {
      "generator": "3NdPsjaFC7NeioGVF6X4J5A8FVaxdtKvAba",
      "count": "120",
      "node_name": "Genesis Node #5"
    }
  ]
}

GET /stats/contract-calls

Returns a list of smart contracts that have been called the most number of times within a specified time period.

Method Response:

{
  "limit": "5",
  "data": [
    {
      "contract_id": "Cm9MDf7vpETuzUCsr1n2MVHsEGk4rz3aJp1Ua2UbWBq1",
      "count": "120",
      "contract_name": "oracle_contract",
      "last_call": "60.321"
    }
  ]
}

GET /stats/contract-last-calls

Returns a list of last calls of smart contracts according to their id’s and names.

Method Response:

{
  "limit": "5",
  "data": [
    {
      "contract_id": "Cm9MDf7vpETuzUCsr1n2MVHsEGk4rz3aJp1Ua2UbWBq1",
      "contract_name": "oracle_contract",
      "last_call": "60.321"
    }
  ]
}

GET /stats/contract-types

Returns a list of the blockchain smart contracts according to their image names and hashes.

Method Response:

{
  "limit": "5",
  "data": [
    {
      "id": "Cm9MDf7vpETuzUCsr1n2MVHsEGk4rz3aJp1Ua2UbWBq1",
      "image": "registry.wvservices.com/waves-enterprise-public/oracle-contract:v0.1",
      "image_hash": "936f10207dee466d051fe09669d5688e817d7cdd81990a7e99f71c1f2546a660",
      "count": "60",
      "sum": "6000"
    }
  ]
}

GET /stats/monitoring

Returns information about the network.

Method Response:

{
  "tps": "5",
  "blockAvgSize": "341.391",
  "senders": "50",
  "nodes": "50",
  "blocks": "500000"
}

Anchoring functions

GET /anchoring/rounds

Returns a list of transactions matching the specified parameters and filters.

Method Response:

[
  {
    "height": 0,
    "sideChainTxIds": [
      "string"
    ],
    "mainNetTxIds": [
      "string"
    ],
    "status": "string",
    "errorCode": 0
  }
]

GET /anchoring/round/at/{height}

Returns information about an anchoring round on a specified block {height}.

Method Response:

{
  "height": 0,
  "sideChainTxIds": [
    "string"
  ],
  "mainNetTxIds": [
    "string"
  ],
  "status": "string",
  "errorCode": 0
}

GET /anchoring/info

Returns information about the anchoring in the blockchain.

Method Response:

{
  "height": 0,
  "sideChainTxIds": [
    "string"
  ],
  "mainNetTxIds": [
    "string"
  ],
  "status": "string",
  "errorCode": 0
}