Platform installation and usage

REST API: information about network participants

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

There are three groups of methods for obtaining information about network participants:

  • addresses – the methods designed to get information about the network members’ addresses or aliases;

  • alias – getting the participant’s address by the alias set for him or the alias by the participant’s address;

  • leasing – the GET leasing/active/{address} query that outputs a list of leasing transactions in which the address or alias was involved as a sender or receiver.

addresses group

The addresses group methods are designed to retrieve information about the network members’ addresses or aliases.

Note

You can also use the gRPC methods of the AddressPublicService service to get information about the network members` addresses.

GET addresses

Obtaining all participants` addresses, whose key pairs are stored in the keystore of the node.

Response example:

GET addresses:
[
  "3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8",
  "3Mx2afTZ2KbRrLNbytyzTtXukZvqEB8SkW7"
]

Note

You can also use the GetAddresses gRPC method to obtain all the members` addresses whose key pairs are stored in the node keystore.

GET addresses/seq/{from}/{to}

Obtaining addresses of the participants, which are stored in the keystore of a node in a given range: from the address {from} to the address {to}.

The format of the method response is identical to that of GET addresses.

GET addresses/balance/{address}

Getting the balance for the {address} address or alias.

Response example:

GET addresses/balance/{address}:
{
  "address": "3N3keodUiS8WLEw9W4BKDNxgNdUpwSnpb3K",
  "confirmations": 0,
  "balance": 100945889661986
}

POST addresses/balance/details

Get detailed balance information for the list of addresses or aliases, which is specified as an array in the addresses field when prompted.

Parameters returned in the method response:

  • regular – number of tokens owned directly by the participant (R);

  • available – participant’s total balance, excluding funds leased by the participant (A = R - L);

  • effective – participant’s total balance, including funds leased to the participant and minus funds that the participant himself has leased (E = R + F - L);

  • generating – participant’s generating balance, including leased funds, for the last 1,000 blocks.

Variables in parentheses: L – funds leased by the participant to other participants, F – funds leased by the participant from other participants.

Response example for one address:

POST addresses/balance/details:
[
  {
    "address": "3M4Bxh2VfzKFXqiQB8bDgRfVnPWrZUQ2MEF",
    "regular": 59899999999400000,
    "generating": 59899999999400000,
    "available": 59899999999400000,
    "effective": 59899999999400000
  }
]

GET addresses/balance/details/{address}

Get detailed balance information for an individual address or alias. The information in the response is identical to the POST addresses/balance/details method.

Response example:

GET addresses/balance/details/{address}:
[
  {
    "address": "3N65yEf31ojBZUvpu4LCo7n8D73juFtheUJ",
    "regular": 0,
    "generating": 0,
    "available": 0,
    "effective": 0
  }
]

GET addresses/effectiveBalance/{address}

Obtaining the total balance of the address or alias, including leased funds.

Response example:

GET addresses/effectiveBalance/{address}:
{
   "address": "3GLWx8yUFcNSL3DER8kZyE4TpyAyNiEYsKG",
   "confirmations": 0,
   "balance": 1240001592820000
}

GET addresses/effectiveBalance/{address}/{confirmations}

Retrieves the balance for address or alias {address} after the number of confirmations >= {confirmations}. The participant’s total balance is returned, including funds leased to the participant.

Response example for confirmations >= 1:

GET addresses/effectiveBalance/{address}/{confirmations}:
{
  "address": "3N65yEf31ojBZUvpu4LCo7n8D73juFtheUJ",
  "confirmations": 1,
  "balance": 0
}

GET addresses/generatingBalance/{address}/at/{height}

Obtaining the address or alias generating balance at the specified block height {height}.

Response example:

GET addresses​/generatingBalance​/{address}​/at​/{height}:
{
  "address": "3NkZd8Xd4KsuPiNVsuphRNCZE3SqJycqv8d",
  "generatingBalance": 1011543800600
}

GET addresses/scriptInfo/{address}

Obtaining data about the script installed on the address or alias.

Parameters returned in the method response:

  • address – address in base58 format;

  • script – script body in base64 format;

  • scriptText – the source code of the script;

  • complexity – complexity of the script;

Script complexity – a number from 1 to 100 representing the amount of computing resources required to execute the script.

Response example:

GET addresses/scriptInfo/{address}:
{
  "address": "3N3keodUiS8WLEw9W4BKDNxgNdUpwSnpb3K",
  "script": "3rbFDtbPwAvSp2vBvqGfGR9nRS1nBVnfuSCN3HxSZ7fVRpt3tuFG5JSmyTmvHPxYf34SocMRkRKFgzTtXXnnv7upRHXJzZrLSQo8tUW6yMtEiZ",
  "scriptText": "ScriptV1(BLOCK(LET(x,CONST_LONG(1)),FUNCTION_CALL(FunctionHeader(==,List(LONG, LONG)),List(FUNCTION_CALL(FunctionHeader(+,List(LONG, LONG)),List(REF(x,LONG), CONST_LONG(1)),LONG), CONST_LONG(2)),BOOLEAN),BOOLEAN))",
  "complexity": 11,
}

GET addresses/publicKey/{publicKey}

The method returns the participant’s address based on its public key.

Response example:

GET addresses/publicKey/{publicKey}:
{
  "address": "3N4WaaaNAVLMQgVKTRSePgwBuAKvZTjAQbq"
}

GET addresses/data/{address}

The method returns data written to the specified address or alias using transaction 12.

Response example:

GET addresses/data/{address}:
[
  {
    "key": "4yR7b6Gv2rzLrhYBHpgVCmLH42raPGTF4Ggi1N36aWnY",
    "type": "integer",
    "value": 1500000
  }
]

Note

You can also use the gRPC GetAddressData method to retrieve data written to the specified address using Data Transaction.

GET addresses/data/{address}/{key}

The method returns data recorded at the specified address or alias with {key} key. This key is specified in the transaction 12 in the data.key field.

Response example:

GET addresses/data/{address}/{key}:
{
  "key": "4yR7b6Gv2rzLrhYBHpgVCmLH42raPGTF4Ggi1N36aWnY",
  "type": "integer",
  "value": 1500000
}

Note

You can also use the gRPC GetAddressDataByKey method to retrieve data written to the specified address using Data Transaction with the {key} key.

alias group

Use the REST methods of the alias group to get the member’s address from the alias set for the member or the alias from the member’s address.

Note

You can also use the gRPC methods of the AliasPublicService service to get information about the addresses and aliases of the network members.

GET alias/by-alias/{alias}

Obtaining a participant’s address by his {alias}.

Response example:

GET alias/by-alias/{alias}:
{
     "address": "address:3Mx2afTZ2KbRrLNbytyzTtXukZvqEB8SkW7"
}

Note

You can also use the gRPC AddressByAlias method to get the address of a network member by his alias.

GET alias/by-address/{address}

Obtaining a participant’s alias from his {address}.

Response example:

GET alias/by-alias/{alias}:
[
    "alias:participant1",
]

Note

You can also use the gRPC AliasesByAddress method to get the alias of a network member by his address.

leasing group

GET leasing/active/{address}

The method returns the list of lease creation transactions in which the address or alias specified as the {address} was involved as sender or receiver. The 8. Lease Transaction and 105. ExecutedContract Transaction with Lease operation type (assetOperation.operationType = lease) are taken into account.

Response example with one transaction:

GET alias/by-alias/{alias}:
[
  {
    "type": 8,
    "id": "2jWhz6uGYsgvfoMzNR5EEGdi9eafyCA2zLFfkM4NP6T7",
    "sender": "3PP6vdkEWoif7AZDtSeSDtZcwiqSfhmwttE",
    "senderPublicKey": "DW9NKLYeyoEWDqJKhWv87EdFfTqpFtJBWoCqfCVwRhsY",
    "fee": 100000,
    "timestamp": 1544390280347,
    "signature": "25kpwh7nYjRUtfbAbWYRyMDPCUCoyMoUuWTJ6vZQrXsZYXbdiWHa9iGscTTGnPFyegP82sNSfM2bXNX3K7p6D3HD",
    "version": 1,
    "amount": 31377465877,
    "recipient": "3P3RD3yJW2gQ9dSVwVVDVCQiFWqaLtZcyzH",
    "height": 1298747
  }
]
See also