get_gasless_quote
Generate executable quotes for token swaps without paying gas fees by providing EIP-712 signature data for blockchain trading operations.
Instructions
Get executable quote for a gasless token swap with EIP-712 signature data
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainId | Yes | Blockchain ID (e.g., 8453 for Base) | |
| buyToken | Yes | Contract address of token to buy | |
| sellToken | Yes | Contract address of token to sell | |
| sellAmount | Yes | Amount of sellToken in base units | |
| taker | No | Address executing the trade (required for gasless quotes, uses USER_ADDRESS from env if not provided) | |
| slippageBps | No | Maximum acceptable slippage in basis points (optional, min: 30) |
Implementation Reference
- src/services/agService.js:139-158 (helper)AgService helper: Makes HTTP request to aggregator's /api/swap/gasless/quote endpoint and handles response/error
async getGaslessQuote(params) { try { const queryParams = new URLSearchParams(params); const response = await fetch(`${this.baseUrl}/api/swap/gasless/quote?${queryParams}`); 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 quote request failed'); } return data.data; } catch (error) { throw new Error(`Failed to get gasless quote: ${error.message}`); } }