validateaddress
validateaddress coin address
The validateaddress method checks if an input string is a valid address of the specified coin.
| Parameter* = required | Type | Description |
|---|---|---|
| address* | string | The input string to validate. |
| coin* | string | The coin to validate address for. |
| Parameter* = required | Type | Description |
|---|---|---|
| is_valid* | bool | Whether the input string is a valid coin address. |
| reason | string (optional) | Optional. Only present if not valid. The reason why the input string is not a valid address. |
POST
validateaddress{
"address": "RRnMcSeKiLrNdbp91qNVQwwXx5azD4S4CD",
"coin": "DOC",
"method": "validateaddress",
"userpass": "RPC_UserP@SSW0RD"
}
Response (Response (invalid cash address))
SUCCESS
{
"result": {
"is_valid": false,
"reason": "utxo:415] Checksum verification failed"
}
}
Response (Response (invalid ETH address))
SUCCESS
{
"result": {
"is_valid": false,
"reason": "eth:360] eth:2522] Invalid address checksum"
}
}
Response (Response (valid address))
SUCCESS
{
"result": {
"is_valid": true
}
}