UNPKG

@gala-chain/launchpad-mcp-server

Version:

MCP server for Gala Launchpad - 102 tools (pool management, event watchers, GSwap DEX trading, price history, token creation, wallet management, DEX pool discovery, liquidity positions, token locks, locked token queries, composite pool data, cross-chain b

53 lines 2.12 kB
"use strict"; /** * Watch for New Launchpad Token Creation Tool */ Object.defineProperty(exports, "__esModule", { value: true }); exports.onLaunchpadTokenCreationTool = void 0; const response_formatter_js_1 = require("../../utils/response-formatter.js"); const error_handler_js_1 = require("../../utils/error-handler.js"); exports.onLaunchpadTokenCreationTool = { name: 'gala_launchpad_on_launchpad_token_creation', description: 'Watch for new launchpad token creation events in real-time', inputSchema: { type: 'object', properties: { creatorAddress: { type: 'string', description: 'Only notify about tokens created by this address (optional)', }, intervalMs: { type: 'number', description: 'Poll interval in milliseconds (default: 30000 / 30 seconds)', }, durationSeconds: { type: 'number', description: 'How long to watch for new tokens in seconds (default: 60)', }, }, }, handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => { const durationSeconds = args.durationSeconds ?? 60; const durationMs = durationSeconds * 1000; // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Launchpad token type is internal SDK type const tokens = []; return new Promise((resolve) => { const unsubscribe = sdk.onLaunchpadTokenCreation((token) => { tokens.push(token); }, { creatorAddress: args.creatorAddress, intervalMs: args.intervalMs, }); // Stop watching after duration setTimeout(() => { unsubscribe(); resolve((0, response_formatter_js_1.formatSuccess)({ tokensDetected: tokens.length, durationSeconds, tokens, })); }, durationMs); }); }), }; //# sourceMappingURL=onLaunchpadTokenCreation.js.map