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/validateRequest body
| Name | Type | Required | Description |
|---|---|---|---|
currency | string | required | Lowercase currency ticker (e.g. `eth`). |
address | string | required | Wallet address to validate. |
extraId | string | optional | Required 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
| Name | Type | Description |
|---|---|---|
valid | boolean | Whether the address parses correctly for the given currency. |
message | string | Present 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
| Type | When |
|---|---|
validation_error | Body is missing required fields |
unauthenticated | Missing/invalid Authorization header |
rate_limited | Over 30 RPS |
upstream_error | Our liquidity layer returned an error |