Installation and usage of the platform

REST API: validation of addresses and aliases of network participants

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

The following methods of the addresses group are provided for validating addresses and aliases on the network:

GET /addresses/validate/{addressOrAlias}

Validation of a given address (node or account) or its alias {addressOrAlias} on the blockchain network. The address is validated as a sequence of characters.

Response example for a valid address:

GET /addresses/validate/{addressOrAlias}
{
  "addressOrAlias": "3HSVTtjim3FmV21HWQ1LurMhFzjut7Aa1Ac",
  "valid": true
}

Response example for an invalid address:

GET /addresses/validate/{addressOrAlias}
{
  "addressOrAlias": "3NkZd8Xd4KsuPiNVsuhhRNCZE3SqJycqv8d",
  "valid": false,
  "reason": "InvalidAddress(Bad address checksum. Address is corrupted or generated using a different crypto (check 'node.crypto.type' config parameter).)"
}

{
  "error": 199,
  "message": "Invalid address or alias: InvalidAddress(Data from other network: expected: 84(T), actual: 86(V))"
}
{
  "error": 199,
  "message": "Invalid address or alias: GenericError(Alias 'CgqRPcPnexY533gCh2SSvBXh5bca1qMs7KFGntawHGww' length should be between 4 and 30)"
}
{
  "error": 199,
  "message": "Invalid address or alias: AliasDoesNotExist(alias:V:12ssdasads)"
}

POST /addresses/validateMany

Validation of multiple addresses or aliases passed to the addressesOrAliases field as an array. The information in the response for each address is identical to the GET /addresses/validate/{addressOrAlias} method response.

Examples of query and response for one address, one existing and one non-existing alias:

POST /addresses/validateMany:

Query:

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

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: -.0123456789@_abcdefghijklmnopqrstuvwxyz)"
    }
  ]
}
See also