@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
59 lines • 2.27 kB
JavaScript
;
/**
* Watch for New DEX Pool Creation Tool
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.onDexPoolCreationTool = void 0;
const response_formatter_js_1 = require("../../utils/response-formatter.js");
const error_handler_js_1 = require("../../utils/error-handler.js");
exports.onDexPoolCreationTool = {
name: 'gala_launchpad_on_dex_pool_creation',
description: 'Watch for new DEX pool creation events in real-time',
inputSchema: {
type: 'object',
properties: {
minTVL: {
type: 'number',
description: 'Only notify about pools with TVL >= minTVL (optional)',
},
tokens: {
type: 'array',
items: { type: 'string' },
description: 'Only notify about pools containing these token symbols (optional)',
},
intervalMs: {
type: 'number',
description: 'Poll interval in milliseconds (default: 30000 / 30 seconds)',
},
durationSeconds: {
type: 'number',
description: 'How long to watch for new pools 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 -- DEX pool type is internal SDK type
const pools = [];
return new Promise((resolve) => {
const unsubscribe = sdk.onDexPoolCreation((pool) => {
pools.push(pool);
}, {
minTVL: args.minTVL,
tokens: args.tokens,
intervalMs: args.intervalMs,
});
// Stop watching after duration
setTimeout(() => {
unsubscribe();
resolve((0, response_formatter_js_1.formatSuccess)({
poolsDetected: pools.length,
durationSeconds,
pools,
}));
}, durationMs);
});
}),
};
//# sourceMappingURL=onDexPoolCreation.js.map