swap_build
Build an UNSIGNED swap transaction on X1 — XNT <-> APEX and other listed pairs. Returns base64 you sign with your own key and broadcast yourself; this server never holds your keys and never signs for you. Use mint addresses, or the string "native" for XNT. APEX mint is Du6Z596DwGnfUcMSyRHSBQzNybiQKu8GESVfruEv9Jqr. Check priceImpact before signing — thin pools move hard. Free; you pay only the network fee.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount of tokenIn, in whole tokens (not raw units). | |
| wallet | Yes | Your X1 wallet public key — it will be the fee payer and signer. | |
| tokenIn | Yes | Mint address to spend, or "native" for XNT. | |
| slippage | No | Slippage tolerance as a fraction. Default 0.01 (1%). | |
| tokenOut | Yes | Mint address to receive, or "native" for XNT. |