Address validation

Verify a wallet address is well-formed for a given currency before you create a swap. POST /v1/swaps runs this internally too — calling it explicitly here lets you give the user inline feedback as they type.

POST/v1/addresses/validate

Request body

NameTypeRequiredDescription
currencystringrequiredLowercase currency ticker (e.g. `eth`).
addressstringrequiredWallet address to validate.
extraIdstringoptionalRequired for currencies whose `extraIdName` is non-null in `getCurrenciesFull` (e.g. XRP destination tag).

Example

const res = await fetch(`${BASE}/v1/addresses/validate`, {
  method: 'POST',
  headers: { 'Authorization': AUTH, 'Content-Type': 'application/json' },
  body: JSON.stringify({ currency: 'eth', address: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e' }),
});
const { valid, message } = await res.json();

Response

On success:

{ "valid": true }

On failure:

{ "valid": false, "message": "Address is not a valid ETH address" }

Response fields

NameTypeDescription
validbooleanWhether the address parses correctly for the given currency.
messagestringPresent only when `valid: false`. Human-readable reason.

Notes

  • This is a syntactic check — it confirms the address parses correctly for the target chain. It does not verify the address is funded or under user control.
  • Validation is also performed automatically by POST /v1/swaps. Calling this endpoint first lets you fail fast with a friendlier error before the swap creation.

Errors

TypeWhen
validation_errorBody is missing required fields
unauthenticatedMissing/invalid Authorization header
rate_limitedOver 30 RPS
upstream_errorOur liquidity layer returned an error