submit_gasless_swap
Execute cryptocurrency swaps without paying gas fees by signing approval and trade messages. This tool processes gasless transactions using pre-approved quote data.
Instructions
Submit a gasless swap by signing approval and trade messages (no gas fees required)
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": {
"quoteData": "<quoteData>"
},
"name": "submit_gasless_swap"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| quoteData | Yes | Quote data from get_gasless_quote | |
| chainId | No | Blockchain ID (optional if included in quoteData) |
Implementation Reference
- src/services/agService.js:160-184 (helper)agService helper method: HTTP POST to aggregator API /api/swap/gasless/submit with signed swap data, handles response and errors.
async submitGaslessSwap(swapData) { try { const response = await fetch(`${this.baseUrl}/api/swap/gasless/submit`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(swapData) }); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } const data = await response.json(); if (!data.success) { throw new Error(data.error || 'Gasless swap submission failed'); } return data.data; } catch (error) { throw new Error(`Failed to submit gasless swap: ${error.message}`); } }