Addresses

Hint

The rules for generating queries to the node are given in module REST API Node.

GET/addresses

Get all addresses of participants whose key pairs are stored in the node keystore.

Method Response:

[
  "3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8",
  "3Mx2afTZ2KbRrLNbytyzTtXukZvqEB8SkW7"
]

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

Gets all addresses of participants whose key pairs are stored in node keystore in the specified range.

Method Response:

[
  "3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8",
  "3Mx2afTZ2KbRrLNbytyzTtXukZvqEB8SkW7"
]

GET/addresses/balance/{address}

Get the balance for the address {address}.

Method Response:

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

POST/addresses/balance/details

Get balances for the address list.

Method Query:

{
   "addresses": [
   "3N65yEf31ojBZUvpu4LCo7n8D73juFtheUJ", "3N11u447zghwj9MemYkrkt9v9xDaMwTY9nG"
   ]
}

GET/addresses/effectivebalance/{address}/{confirmations}

Get the balance for the address {address} after a number of confirmations > = value {confirmations}. Returns the total balance of the participant, including assets transferred to the participant for the leasing.

Method Response:

{
  "address": "3N65yEf31ojBZUvpu4LCo7n8D73juFtheUJ",
  "confirmations": 1,
  "balance": 0
}

GET /addresses/effectiveBalance/{address}

Get the effective balance of the specified address.

Method Response

{
   "address": "3GLWx8yUFcNSL3DER8kZyE4TpyAyNiEYsKG",
   "confirmations": 0,
   "balance": 1240001592820000
}

GET/addresses/balance/details/{address}

Returns detailed information about balance of address {address}.

Method Query:

{
  "addresses": [
    "3N65yEf31ojBZUvpu4LCo7n8D73juFtheUJ"
  ]
}

Method Response:

[
  {
    "address": "3N65yEf31ojBZUvpu4LCo7n8D73juFtheUJ",
    "regular": 0,
    "generating": 0,
    "available": 0,
    "effective": 0
  }
]

Response Options

  • Regular - total balance of participant, including assets transferred for leasing
  • Available - total balance of participant, except for assets transferred for leasing
  • Effective — total balance of participant, including assets transferred to participant for leasing (Available + assets transferred to you for leasing)
  • Generating - minimum balance of participant, including assets transferred to participant for leasing, for the last 1000 blocks (used for mining)

GET/addresses/scriptInfo/{address}

Get information about the script installed on the address {address}.

Method Response:

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

Response Options

  • “address” - address in Base58 format
  • “script” - Base64 representation of the script
  • “scriptText” - source code of the script
  • “complexity” - complexity of the script
  • “extraFee” - fee for outgoing transactions set by the script

POST/addresses/sign/{address}

https://img.shields.io/badge/API--KEY-required-red.svg

Returns the message encoded in BASE58 format signed by address private key {address}, stored in node keystore. The message is first signed and then converted.

Method Query:

{
 "message": "mytext"
}

Method Response:

{
  "message": "wWshKhJj",
  "publicKey": "C1ADP1tNGuSLTiQrfNRPhgXx59nCrwrZFRV4AHpfKBpZ",
  "signature": "62PFG855ThsEHUZ4N8VE8kMyHCK9GWnvtTZ3hq6JHYv12BhP1eRjegA6nSa3DAoTTMammhamadvizDUYZAZtKY9S"
}

POST/addresses/verify/{address}

https://img.shields.io/badge/API--KEY-required-red.svg

Validates signature of a message executed by address {address}, including the one created through POST method/addresses/sign/{address}.

Method Query:

{
  "message": "wWshKhJj",
  "publickey": "C1ADP1tNGuSLTiQrfNRPhgXx59nCrwrZFRV4AHpfKBpZ",
  "signature": "5kwwE9sDZzssoNaoBSJnb8RLqfYGt1NDGbTWWXUeX8b9amRRJN3hr5fhs9vHBq6VES5ng4hqbCUoDEsoQNauRRts"
}

Method Response:

{
  "valid": true
}

POST/addresses/signtext/{address}

https://img.shields.io/badge/API--KEY-required-red.svg

Returns a message signed by address private key {address} stored in the node keystore.

Method Query:

{
  "message": "mytext"
}

Method Response:

{
  "message": "message",
  "publicKey": "C1ADP1tNGuSLTiQrfNRPhgXx59nCrwrZFRV4AHpfKBpZ",
  "signature": "5kVZfWfFmoYn38cJfNhkdct5WCyksMgQ7kjwHK7Zjnrzs9QYRWo6HuJoGc8WRMozdYcAVJvojJnPpArqPvu2uc3u"
}

POST/addresses/verifytext/{address}

https://img.shields.io/badge/API--KEY-required-red.svg

Validates signature of a message executed by address {address}, including the one created through the POSTmethod /addresses/signtext/{address}.

Method Query:

{
  "message": "message",
  "publicKey": "C1ADP1tNGuSLTiQrfNRPhgXx59nCrwrZFRV4AHpfKBpZ",
  "signature": "5kVZfWfFmoYn38cJfNhkdct5WCyksMgQ7kjwHK7Zjnrzs9QYRWo6HuJoGc8WRMozdYcAVJvojJnPpArqPvu2uc3u"
}

Method Response:

{
  "valid": true
}

GET /addresses/validate/{addressOrAlias}

Validates correctness of specified address or its alias {addressOrAlias} in a network blockchain of operating node.

Method Response:

{
  addressOrAlias: "3HSVTtjim3FmV21HWQ1LurMhFzjut7Aa1Ac",
  valid: true
}

POST /addresses/validateMany

Checks the validity of addresses or aliases.

Method Query:

{
  addressesOrAliases: [
    "3HSVTtjim3FmV21HWQ1LurMhFzjut7Aa1Ac",
    "alias:T:asdfghjk",
    "alias:T:1nvAliDAl1ass99911%^&$$$ "
  ]
}

Method Response:

{
  validations: [
    {
      addressOrAlias: "3HSVTtjim3FmV21HWQ1LurMhFzjut7Aa1Ac",
      valid: true
    },
    {
      addressOrAlias: "alias:T:asdfghjk",
      valid: true
    },
    {
      addressOrAlias: "alias:T:1nvAliDAl1ass99911%^&$$$ ",
      valid: false,
      reason: "GenericError(Alias should contain only following characters: [email protected]_abcdefghijklmnopqrstuvwxyz)"
    }
  ]
}

GET /addresses/publicKey/{publicKey}

Returns participant address based on its public key.

Method Response:

{
  "address": "3N4WaaaNAVLMQgVKTRSePgwBuAKvZTjAQbq"
}

GET/addresses/data/{address}

Returns all data recorded to address account {address}.

Method Response:

[
  {
    "key": "4yR7b6Gv2rzLrhYBHpgVCmLH42raPGTF4Ggi1N36aWnY",
    "type": "integer",
    "value": 1500000
  }
]

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

Returns data recorded to address account {address} by key {key}.

Method Response:

{
  "key": "4yR7b6Gv2rzLrhYBHpgVCmLH42raPGTF4Ggi1N36aWnY",
  "type": "integer",
  "value": 1500000
}