# Driving no-KYC exchanger web UIs (ChangeNOW/Exolix) headlessly

Use when the exchanger's API is blocked from the VPS and the swap must run through the browser.

## ChangeNOW (verified working)
- API-FIRST before fighting the UI: `https://vip-api.changenow.io/v2/exchange/estimate?fromCurrency=usdt&fromNetwork=trx&fromAmount=30&toCurrency=bnb&toNetwork=bsc&type=direct&promoCode=&withoutFee=false&isBridge=false` answers plain curl from the VPS (min/max/estimated amount) even when the widget shows "Amount calculation unsuccessful". That UI error is often COSMETIC — payout + Continue still create a valid transaction. To discover a widget's exact endpoints: re-trigger the amount field, then read `performance.getEntriesByType('resource')` for api URLs and replay them with curl.
- `api.changenow.io/v2/*` (min-amount, estimated) returns Not Found/Unauthorized from curl — the working host is `vip-api.changenow.io`.
- Pair preselect via URL params does NOT work; select coins through the DOM instead.
- Coin selectors are `div.combobox--field` (from=0, to=1). Click to open, then type into `input[placeholder='Type a currency']` INSIDE that combobox (`document.querySelectorAll('div.combobox')[i].querySelector(...)`).
- React ignores plain `.value=` assignment and single `input` events. Type char-by-char: native value setter + `KeyboardEvent('keydown')` → setter → `input` event → `keyup` per char. Without keydown/keyup the currency list never filters.
- Result rows are `li.combobox-dropdown-item` filtered by visible text — click the LI, not the inner span.
- Amount field: `div.now-input input`, same char-by-char technique. The second `input[type=text]` is NOT reliably the amount field after re-renders — locate by container class, verify by the quoted-output field updating.
- Recipient/refund fields accept native setter + one `input` event + a keyup. Fields may CLEAR on re-render — re-check values immediately before clicking Continue.
- Changing the amount can leave a DEFAULT amount (e.g. 5000) in the created transaction — always verify the deposit page shows the intended amount before sending funds. If wrong, create a fresh transaction; under-sending to a floating-rate tx is processed at the received amount.

## SimpleSwap / SideShift (fallbacks)
- SimpleSwap: the exchange widget often stays in `*_skeleton` state (zero inputs) in the automated browser — do not fight it; switch exchanger.
- SideShift: `/api/v2/quotes` and `/api/v2/coins` answer plain curl from the VPS (good for rate checks), but order-creation POSTs 404 from curl — orders only via the browser UI.

## Exolix
- Coin dropdown search accepts 'USDT' but may reject 'BNB' in the You-get slot ('Coin not found') — if a pair won't select, switch exchanger instead of fighting the dropdown.

## Payout hygiene
- Send the deposit from the controlled Tron wallet via the existing tronpy script (generic one-shot sender: `~/send_usdt_once.py <addr> <amount>` on /usr/bin/python3); verify TX SUCCESS on-chain (TronGrid throttles — use api.tronstack.io).
- Payout to an EVM address owned via ~/.secrets keys; on arrival verify the balance via BSC RPC before deploying.
