Installation and usage of the platform

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;

  • 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 was involved as a sender or receiver.

addresses group:

GET /addresses

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

Response example:

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

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:

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

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:

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. 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, 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} 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 generating address 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.

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;

  • extraFee – fee for outgoing transactions set by 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,
  "extraFee": 10001
}

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 using transaction 12.

Response example:

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

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:

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

alias group:

GET /alias/by-alias/{alias}

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

Response example:

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

GET /alias/by-address/{address}

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

Response example:

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

leasing group:

GET /leasing/active/{address}

The method returns a list of lease creation transactions in which the address participated as sender or recipient.

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