swapTon · TON Token Swap
may change things: you confirm before it runsExecute a TON token swap using CoffeeSwap aggregator. Returns transaction parameters for the user to sign and execute. tokenIn and tokenOut must be different addresses.
Input schema
{
"type": "object",
"properties": {
"tokenIn": {
"type": "string",
"description": "Input token address (use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native token TON)"
},
"tokenOut": {
"type": "string",
"description": "Output token address (use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native token TON)"
},
"amount": {
"type": "string",
"description": "Amount to swap in decimal format (e.g., \"10.5\"). Must be a positive number. Use \"-1\" to swap entire balance (only with isExactIn=true)."
},
"isExactIn": {
"type": "boolean",
"description": "If true, swap exact input amount and receive variable output. If false, swap variable input to receive exact output amount. Default: true."
},
"slippage": {
"description": "Slippage tolerance percentage (e.g., \"0.1\" for 0.1%). Default: 1%. Maximum: 25%.",
"type": "string"
},
"userAddress": {
"type": "string",
"description": "The wallet address of the user"
}
},
"required": [
"tokenIn",
"tokenOut",
"amount",
"isExactIn",
"userAddress"
],
"additionalProperties": false
}