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
{"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.
{"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.
Reports a send made straight from the device wallet, with its commission transaction. Unpaid commission is taken from the U Xa balance later.
Balances
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
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
{"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
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.
Only withdrawals that are still waiting for approval or queued can be cancelled.
Transfer to another user
{"asset": "btc", "to": "@alice", "amount": "0.01", "note": "Dinner"}
Instant and final. Accepts an email or a username.
Swap
{"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
The ledger, newest first, with the deposit, withdrawal, transfer or swap behind each entry.
Security
Turning the whitelist on, and adding or removing addresses, needs a current authenticator code.