Platform installation and usage
REST API: information about network participants¶
There are three groups of methods for obtaining information about network participants:
addresses
– the methods designed to get information about the network members’ addresses;alias
– getting the participant’s address by the alias set for him or the alias by the participant’s address;leasing
– theGET /leasing/active/{address}
query that outputs a list of leasing transactions in which the address was involved as a sender or receiver.
addresses
group¶
The addresses
group methods are designed to retrieve information about the network members’ addresses.
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:
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}
.
Response example:
POST /addresses/balance/details¶
Get detailed balance information for the list of addresses, 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:
GET /addresses/balance/details/{address}¶
Get detailed balance information for an individual address. The information in the response is identical to the POST /addresses/balance/details
method.
Response example:
GET /addresses/effectiveBalance/{address}¶
Obtaining the total balance of the address, including leased funds.
Response example:
GET /addresses/effectiveBalance/{address}/{confirmations}¶
Retrieves the balance for {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/generatingBalance/{address}/at/{height}¶
Obtaining the generating address balance at the specified block height {height}
.
Response example:
GET /addresses/scriptInfo/{address}¶
Obtaining data about the script installed on the address.
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/publicKey/{publicKey}¶
The method returns the participant’s address based on its public key.
Response example:
GET /addresses/data/{address}¶
The method returns data written to the specified address using transaction 12.
Response example:
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 with {key}
key. This key is specified in the transaction 12 in the data.key
field.
Response example:
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:
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:
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} 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: