Skip to content

Wallet API

The endpoints the U Xa app uses for balances, deposits, sends, transfers and swaps. They take the session token from POST /api/v1/auth/email/verify, not a merchant API token.

Sign in with an email code

POST/api/v1/auth/email/start
{"email": "[email protected]", "lang": "en"}

Emails a 6-digit code. It is valid for the minutes in expires_in; ask again after resend_in seconds.

POST/api/v1/auth/email/verify
{"email": "[email protected]", "code": "123456", "terms_accepted": true, "device": "U Xa on Android"}

Returns token and account. A new account is created the first time. terms_accepted must be true for new accounts and when the terms changed (GET /api/v1/terms), otherwise the answer is 422 terms_required. Five wrong codes cancel the code.

Access

Access to an account is always by email code.

POST/api/v1/app/wallet/device-tx

Reports a send made straight from the device wallet, with its commission transaction. Unpaid commission is taken from the U Xa balance later.

Balances

GET/api/v1/app/wallet

Every coin with available and locked amounts (locked is held by withdrawals in progress), US dollar values, pending deposits, the current fee rules and your daily limit.

Deposit address

GET/api/v1/app/wallet/deposit/{asset}

Returns your address for the coin's network. The same address is returned every time. Deposits are credited after the number of confirmations in the response.

Quote a send

POST/api/v1/app/wallet/quote
{"asset": "btc", "amount": "0.1", "kind": "send"}

Returns amount, service_fee, network_fee, recipient_gets, total, whether the balance is enough and whether the withdrawal will wait for approval. Use "kind": "transfer" for a transfer to another user.

Withdraw

POST/api/v1/app/wallet/withdrawals
Idempotency-Key: 2f0c6c1e-6a52-4c1f-9d55-1f0e9b3f7a10

{"asset": "usdt_trc20", "address": "T…", "amount": "100", "totp": "123456"}

The total is taken from available and held in locked until the transaction confirms. Sending the same Idempotency-Key again returns the first withdrawal instead of creating another. totp is required when two-factor is on. Possible errors: insufficient_funds, limit_exceeded, not_whitelisted, account_frozen, withdrawals_paused.

GET/api/v1/app/wallet/withdrawals
POST/api/v1/app/wallet/withdrawals/{id}/cancel

Only withdrawals that are still waiting for approval or queued can be cancelled.

Transfer to another user

GET/api/v1/app/wallet/[email protected]
POST/api/v1/app/wallet/transfers
{"asset": "btc", "to": "@alice", "amount": "0.01", "note": "Dinner"}

Instant and final. Accepts an email or a username.

Swap

POST/api/v1/app/wallet/swap/quote
POST/api/v1/app/wallet/swaps
{"from": "eth", "to": "usdt_erc20", "amount": "0.1", "min_receive": "245.10"}

Runs at the current market price. If the price moved so that you would receive less than min_receive, the swap is refused.

History

GET/api/v1/app/wallet/history?asset=btc&limit=40&before={id}

The ledger, newest first, with the deposit, withdrawal, transfer or swap behind each entry.

Security

POST/api/v1/app/security/totp/setup
POST/api/v1/app/security/totp/enable
POST/api/v1/app/security/totp/disable
GET/api/v1/app/wallet/whitelist
POST/api/v1/app/wallet/whitelist
POST/api/v1/app/wallet/whitelist/mode

Turning the whitelist on, and adding or removing addresses, needs a current authenticator code.