swap_build
may change things: you confirm before it runsBuild an UNSIGNED swap transaction on X1 at the best price across XDEX and APEX AMM — direct, or two hops through XNT or APEX in ONE transaction, simulated against your wallet before it is returned. 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. Building is free. When you spend XNT (more than 0.01), the transaction includes a 0.1% platform fee to the APEX buyback wallet, shown as platformFee in the answer; otherwise you pay only the network fee.
Input schema
{
"type": "object",
"properties": {
"tokenIn": {
"type": "string",
"description": "Mint address to spend, or \"native\" for XNT."
},
"tokenOut": {
"type": "string",
"description": "Mint address to receive, or \"native\" for XNT."
},
"amount": {
"type": "number",
"description": "Amount of tokenIn, in whole tokens (not raw units)."
},
"wallet": {
"type": "string",
"description": "Your X1 wallet public key — it will be the fee payer and signer."
},
"slippage": {
"type": "number",
"description": "Slippage tolerance as a fraction. Default 0.01 (1%)."
}
},
"required": [
"tokenIn",
"tokenOut",
"amount",
"wallet"
]
}