get_gasless_status
Check the status of a submitted gasless swap transaction by providing the trade hash and blockchain ID to monitor execution progress.
Instructions
Get the status of a submitted gasless swap
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tradeHash | Yes | Trade hash from gasless swap submission | |
| chainId | Yes | Blockchain ID where the trade was submitted |
Implementation Reference
- src/toolService.js:545-565 (handler)Main handler function for the get_gasless_status tool. Validates input parameters (tradeHash, chainId), calls the AgService to fetch status, and formats the response with additional metadata for the MCP protocol.async getGaslessStatus(params) { const { tradeHash, chainId } = params; if (!tradeHash || !chainId) { throw new Error("Missing required parameters: tradeHash, chainId"); } const result = await this.agg.getGaslessStatus(tradeHash, chainId); return { message: `Gasless swap status for ${tradeHash} retrieved successfully`, data: result, summary: `Status: ${result.status || "unknown"}`, gaslessInfo: { tradeHash, chainId, isGasless: true, relayerManaged: true, }, }; }
- src/index.js:726-742 (schema)Input schema and description for the get_gasless_status tool, registered in the ListToolsRequestHandler response.name: TOOL_NAMES.GET_GASLESS_STATUS, description: "Get the status of a submitted gasless swap", inputSchema: { type: "object", properties: { tradeHash: { type: "string", description: "Trade hash from gasless swap submission", }, chainId: { type: "integer", description: "Blockchain ID where the trade was submitted", }, }, required: ["tradeHash", "chainId"], }, },
- src/index.js:1150-1152 (registration)Dispatch/registration in the CallToolRequestHandler switch statement that routes calls to toolService.getGaslessStatus.case TOOL_NAMES.GET_GASLESS_STATUS: result = await toolService.getGaslessStatus(args); break;
- src/services/agService.js:186-204 (helper)Core helper function in AgService that makes the HTTP request to the aggregator API endpoint /api/swap/gasless/status/{tradeHash} to retrieve the actual status data.async getGaslessStatus(tradeHash, chainId) { try { const response = await fetch(`${this.baseUrl}/api/swap/gasless/status/${tradeHash}?chainId=${chainId}`); 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 status request failed'); } return data.data; } catch (error) { throw new Error(`Failed to get gasless status: ${error.message}`); } }
- src/constants.js:14-14 (helper)Constant definition for the tool name used throughout the codebase.GET_GASLESS_STATUS: "get_gasless_status",