Build an UNSIGNED swap transaction
build_swap_txBuilds an UNSIGNED MultiversX swap transaction for sender to sign with its own wallet. The transaction is verified and rebuilt from verified fields only (receiver = hard-coded OneDex aggregator, or the allowlisted XOXNO router after strict route decoding, capped gas, gasPrice 1e9). Returns the transaction, a human-readable summary, costs, warnings, expiresAt (advisory; minOut is the on-chain protection) and signingLink: a MultiversX Web Wallet URL (wallet.multiversx.com/hook/transaction) with this exact transaction pre-filled, for a human to open, check receiver/amount/token on the wallet screen and confirm there. This server never signs or holds keys.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"tokenIn": "<tokenIn>",
"tokenOut": "<tokenOut>",
"amountIn": "<amountIn>",
"sender": "<sender>"
},
"name": "build_swap_tx"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sender | Yes | Bech32 address (erd1…) of the wallet that will sign | |
| network | No | MultiversX network (default mainnet; devnet only if configured) | mainnet |
| tokenIn | Yes | "EGLD", a token identifier like "ONE-f9954f", or a unique ticker like "USDC" | |
| amountIn | Yes | Amount of tokenIn as a decimal string, e.g. "1.5" (not base units) | |
| tokenOut | Yes | "EGLD", a token identifier like "ONE-f9954f", or a unique ticker like "USDC" | |
| slippageBps | No | Slippage in basis points (100 = 1%, default). Above 500 needs confirmHighSlippage: true; above 2000 is refused. | |
| confirmHighImpact | No | Must be true to accept price impact above 10%, or when the aggregator-based and independent (api.multiversx.com) impacts disagree by more than 5 points | |
| confirmHighSlippage | No | Must be true to accept slippage above 5% |