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

243 lines (239 loc) 10.7 kB
"use strict"; /** * Utility Tools Prompts * * Slash commands for utility and system operations */ Object.defineProperty(exports, "__esModule", { value: true }); exports.utilityToolPrompts = exports.cleanupPrompt = exports.getEnvironmentPrompt = exports.setWalletPrompt = exports.getWalletPrompt = exports.hasWalletPrompt = exports.clearCachePrompt = exports.getCacheInfoPrompt = exports.explainSdkUsagePrompt = exports.getUrlByTokenNamePrompt = exports.getConfigPrompt = exports.getEthereumAddressPrompt = exports.getAddressPrompt = exports.createWalletPrompt = void 0; const mcpToolNames_js_1 = require("../constants/mcpToolNames.js"); const handlerHelpers_js_1 = require("./utils/handlerHelpers.js"); const textTemplates_js_1 = require("./utils/textTemplates.js"); /** * Create Wallet - Generate new wallet */ exports.createWalletPrompt = { name: 'galachain-launchpad:create-wallet', description: 'Generate a new wallet with random private key', handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({ operation: 'Create a new wallet with random private key.', toolName: mcpToolNames_js_1.MCP_TOOLS.CREATE_WALLET, actionDescription: 'generate new wallet address, random private key, and wallet credentials for authentication', displayFormat: 'Display the wallet details with a security warning about private key storage.', })), }; /** * Get Address - Get GalaChain address */ exports.getAddressPrompt = { name: 'galachain-launchpad:get-address', description: 'Get the GalaChain address format of authenticated wallet', handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({ operation: 'Get the GalaChain format address of the authenticated wallet.', toolName: mcpToolNames_js_1.MCP_TOOLS.GET_ADDRESS, actionDescription: 'retrieve the address in GalaChain format (eth|0x...)', displayFormat: 'Display the wallet address.', })), }; /** * Get Ethereum Address - Get Ethereum address */ exports.getEthereumAddressPrompt = { name: 'galachain-launchpad:get-ethereum-address', description: 'Get the standard Ethereum address format of authenticated wallet', handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({ operation: 'Get the standard Ethereum format address of the authenticated wallet.', toolName: mcpToolNames_js_1.MCP_TOOLS.GET_ETHEREUM_ADDRESS, actionDescription: 'retrieve the address in Ethereum format (0x...)', displayFormat: 'Display the wallet address.', })), }; /** * Get Config - View SDK configuration */ exports.getConfigPrompt = { name: 'galachain-launchpad:get-config', description: 'View current SDK and MCP server configuration', handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({ operation: 'Get the current SDK and MCP server configuration.', toolName: mcpToolNames_js_1.MCP_TOOLS.GET_CONFIG, actionDescription: 'retrieve environment, base URLs, timeout settings, feature flags, effective slippage tolerance factors, and current MCP server state', displayFormat: 'Display the configuration in a readable format.', })), }; /** * Get URL by Token Name - Generate launchpad URL */ exports.getUrlByTokenNamePrompt = { name: 'galachain-launchpad:get-url-by-token-name', description: 'Get the launchpad frontend URL for a token', arguments: [ { name: 'tokenName', description: 'Token name (e.g., anime)', required: true, }, ], handler: (args) => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({ operation: 'Get the launchpad frontend URL for a token.', parameters: { token_name: `Token: ${args.tokenName}`, }, toolName: mcpToolNames_js_1.MCP_TOOLS.GET_URL_BY_TOKEN_NAME, actionDescription: 'generate the URL', displayFormat: 'Display the complete launchpad URL for viewing/trading the token.', })), }; /** * Explain SDK Usage - SDK documentation helper */ exports.explainSdkUsagePrompt = { name: 'galachain-launchpad:explain-sdk-usage', description: 'Get detailed SDK usage examples for a topic', arguments: [ { name: 'topic', description: 'Topic: buy-tokens, sell-tokens, pool-graduation, fetch-pools, balances, dex-trading, liquidity-positions, price-history, token-details, token-distribution, token-creation, profile-management, multi-wallet, transfers, error-handling, installation, local-calculations, mcp-to-sdk-mapping', required: true, }, ], handler: (args) => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({ operation: `Get detailed SDK usage examples for topic: ${args.topic}.`, toolName: mcpToolNames_js_1.MCP_TOOLS.EXPLAIN_SDK_USAGE, actionDescription: 'retrieve complete runnable code examples', displayFormat: 'Display the examples with explanations for integrating the SDK directly.', })), }; /** * Get Cache Info - Cache statistics */ exports.getCacheInfoPrompt = { name: 'galachain-launchpad:get-cache-info', description: 'Get token metadata cache statistics', handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({ operation: 'Get token metadata cache statistics.', toolName: mcpToolNames_js_1.MCP_TOOLS.GET_CACHE_INFO, actionDescription: 'retrieve total tokens cached, cache size in bytes, and timestamp of oldest entry', displayFormat: 'Display the cache information.', })), }; /** * Clear Cache - Cache management */ exports.clearCachePrompt = { name: 'galachain-launchpad:clear-cache', description: 'Clear token metadata cache', arguments: [ { name: 'tokenName', description: 'Token name to clear (optional, clears all if not provided)', required: false, }, ], handler: (args) => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({ operation: 'Clear token metadata cache.', parameters: { token_name: args.tokenName ? `Token: ${args.tokenName}` : 'Clearing entire cache', }, toolName: mcpToolNames_js_1.MCP_TOOLS.CLEAR_CACHE, actionDescription: 'clear the cache', displayFormat: 'Display confirmation of cache clearing.', })), }; /** * Has Wallet - Check wallet status */ exports.hasWalletPrompt = { name: 'galachain-launchpad:has-wallet', description: 'Check if a wallet is configured in the MCP server', handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({ operation: 'Check wallet configuration status.', toolName: mcpToolNames_js_1.MCP_TOOLS.HAS_WALLET, actionDescription: 'determine whether a wallet is configured and whether MCP server is in full-access or read-only mode', displayFormat: 'Display the wallet status clearly.', })), }; /** * Get Wallet - Get wallet instance */ exports.getWalletPrompt = { name: 'galachain-launchpad:get-wallet', description: 'Get the currently configured wallet instance', handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({ operation: 'Get the currently configured wallet instance.', toolName: mcpToolNames_js_1.MCP_TOOLS.GET_WALLET, actionDescription: 'retrieve wallet object if available (null if in read-only mode)', displayFormat: 'Display the wallet information.', })), }; /** * Set Wallet - Configure wallet */ exports.setWalletPrompt = { name: 'galachain-launchpad:set-wallet', description: 'Configure a wallet for signing operations', arguments: [ { name: 'privateKey', description: 'Private key in hex format (0x + 64 hex characters)', required: true, }, ], handler: (args) => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({ operation: 'Configure wallet for signing operations.', parameters: { private_key: `Private Key: ${args.privateKey.substring(0, 10)}...${args.privateKey.substring(60)}`, }, toolName: mcpToolNames_js_1.MCP_TOOLS.SET_WALLET, actionDescription: 'configure the wallet', displayFormat: 'Display confirmation that wallet is configured for full-access mode.', })), }; /** * Get Environment - Current environment query */ exports.getEnvironmentPrompt = { name: 'galachain-launchpad:get-environment', description: 'Get the current MCP server environment', handler: () => (0, handlerHelpers_js_1.createPromptResponse)((0, textTemplates_js_1.createSimpleOperationText)({ operation: 'Get the current MCP server environment.', toolName: mcpToolNames_js_1.MCP_TOOLS.GET_ENVIRONMENT, actionDescription: 'retrieve the active environment', displayFormat: 'Display the current environment (production, development, or testing).', })), }; /** * Cleanup - Release SDK resources */ exports.cleanupPrompt = { name: 'galachain-launchpad:cleanup', description: 'Clean up SDK resources (HTTP interceptors, WebSocket connections) to prevent memory leaks', handler: () => (0, handlerHelpers_js_1.createPromptResponse)(`Clean up SDK resources to prevent memory leaks. **When to use:** - After long-running operations (monitoring, event watching) - Before shutting down applications - When switching environments - After extended trading sessions **Use:** gala_launchpad_cleanup **This releases:** - HTTP interceptors - WebSocket connections - Cached resources Result: SDK is cleaned up and ready for next initialization.`), }; exports.utilityToolPrompts = [ exports.createWalletPrompt, exports.getAddressPrompt, exports.getEthereumAddressPrompt, exports.getConfigPrompt, exports.getUrlByTokenNamePrompt, exports.explainSdkUsagePrompt, exports.getCacheInfoPrompt, exports.clearCachePrompt, exports.hasWalletPrompt, exports.getWalletPrompt, exports.setWalletPrompt, exports.getEnvironmentPrompt, exports.cleanupPrompt, ]; //# sourceMappingURL=utility-tools.js.map