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

198 lines (182 loc) 6.67 kB
"use strict"; /** * Portfolio Prompts * * Slash commands for portfolio management on Gala Launchpad */ Object.defineProperty(exports, "__esModule", { value: true }); exports.portfolioPrompts = exports.profilePrompt = exports.balancePrompt = exports.tokensCreatedPrompt = exports.tokensHeldPrompt = exports.portfolioPrompt = void 0; const mcpToolNames_js_1 = require("../constants/mcpToolNames.js"); const workflowTemplates_js_1 = require("./utils/workflowTemplates.js"); const validation_js_1 = require("../utils/validation.js"); const handlerHelpers_js_1 = require("./utils/handlerHelpers.js"); /** * Portfolio - Complete portfolio analysis */ exports.portfolioPrompt = { name: 'galachain-launchpad:portfolio', description: 'Analyze complete portfolio with GALA balance, token holdings, and total USD value', handler: () => [ { role: 'user', content: { type: 'text', text: (0, workflowTemplates_js_1.createPortfolioWorkflow)(), }, }, ], }; /** * Tokens Held - List all token holdings */ exports.tokensHeldPrompt = { name: 'galachain-launchpad:tokens-held', description: 'List all Launchpad tokens currently held with balances', arguments: [ { name: 'search', description: 'Optional search filter for token names (fuzzy match)', required: false, }, { name: 'limit', description: 'Number of tokens to show (default: 20)', required: false, }, ], handler: (args) => { // Validate inputs (0, validation_js_1.validateOptionalLimit)(args.limit, 100); const limit = args.limit || '20'; const searchFilter = args.search ? `- search: "${args.search}" (fuzzy match filter)` : '- No search filter (show all tokens)'; return (0, handlerHelpers_js_1.createPromptResponse)(`Show me all Launchpad tokens I'm currently holding: Use ${mcpToolNames_js_1.MCP_TOOLS.FETCH_TOKENS_HELD} with: ${searchFilter} - limit: ${limit} For each token, display: - Token name - Balance (formatted with decimals) - Whether I created this token (if applicable) Sort by balance (highest to lowest). If I have more tokens than the limit, show pagination info and offer to fetch more.`); }, }; /** * Tokens Created - Show tokens created by user */ exports.tokensCreatedPrompt = { name: 'galachain-launchpad:tokens-created', description: 'List all Launchpad tokens created by the user with their current status', arguments: [ { name: 'search', description: 'Optional search filter for token names (fuzzy match)', required: false, }, { name: 'limit', description: 'Number of tokens to show (default: 20)', required: false, }, ], handler: (args) => { // Validate inputs (0, validation_js_1.validateOptionalLimit)(args.limit, 100); const limit = args.limit || '20'; const searchFilter = args.search ? `- search: "${args.search}" (fuzzy match filter)` : '- No search filter (show all tokens)'; return (0, handlerHelpers_js_1.createPromptResponse)(`Show me all Launchpad tokens I've created: Use ${mcpToolNames_js_1.MCP_TOOLS.FETCH_TOKENS_CREATED} with: ${searchFilter} - limit: ${limit} For each token, display: - Token name and symbol - Current status (check using ${mcpToolNames_js_1.MCP_TOOLS.FETCH_POOL_DETAILS}): * Pool status (Ongoing/Completed) * Current supply * Remaining tokens * Progress percentage - Whether graduated (use ${mcpToolNames_js_1.MCP_TOOLS.IS_TOKEN_GRADUATED}) - Frontend URL (use ${mcpToolNames_js_1.MCP_TOOLS.GET_URL_BY_TOKEN_NAME}) Provide a summary: - Total tokens created - How many are graduated - How many are still in bonding curve phase`); }, }; /** * Balance - Check GALA and specific token balances */ exports.balancePrompt = { name: 'galachain-launchpad:balance', description: 'Check GALA balance and optionally a specific token balance', arguments: [ { name: 'tokenName', description: 'Optional token name to check balance for (e.g., anime)', required: false, }, ], handler: (args) => { // Validate inputs if (args.tokenName) { (0, validation_js_1.validateTokenName)(args.tokenName); } return (0, handlerHelpers_js_1.createPromptResponse)(args.tokenName ? `Check my balances: 1. GALA balance using ${mcpToolNames_js_1.MCP_TOOLS.FETCH_GALA_BALANCE} 2. ${args.tokenName} token balance using ${mcpToolNames_js_1.MCP_TOOLS.FETCH_TOKEN_BALANCE} 3. Calculate USD values: - GALA USD value using ${mcpToolNames_js_1.MCP_TOOLS.FETCH_GALA_SPOT_PRICE} - ${args.tokenName} USD value using ${mcpToolNames_js_1.MCP_TOOLS.FETCH_LAUNCHPAD_TOKEN_SPOT_PRICE} Display: - GALA: [amount] ($[USD value]) - ${args.tokenName}: [amount] ($[USD value]) - Total value: $[combined USD value]` : `Check my GALA balance: Use ${mcpToolNames_js_1.MCP_TOOLS.FETCH_GALA_BALANCE} to get current GALA balance. Use ${mcpToolNames_js_1.MCP_TOOLS.FETCH_GALA_SPOT_PRICE} to calculate USD value. Display: - GALA: [amount] - USD value: $[calculated value] Tip: Add tokenName argument to check a specific token balance.`); }, }; /** * Profile - Show user profile information */ exports.profilePrompt = { name: 'galachain-launchpad:profile', description: 'Show user profile information and activity summary', handler: () => (0, handlerHelpers_js_1.createPromptResponse)(`Show my Gala Launchpad profile: 1. Get profile info using ${mcpToolNames_js_1.MCP_TOOLS.FETCH_PROFILE} - Full name - Profile image URL - Wallet address 2. Get activity summary: - Tokens held count: ${mcpToolNames_js_1.MCP_TOOLS.FETCH_TOKENS_HELD} (limit: 1) for total - Tokens created count: ${mcpToolNames_js_1.MCP_TOOLS.FETCH_TOKENS_CREATED} (limit: 1) for total 3. Get wallet info: - GalaChain address format: ${mcpToolNames_js_1.MCP_TOOLS.GET_ADDRESS} - Ethereum address format: ${mcpToolNames_js_1.MCP_TOOLS.GET_ETHEREUM_ADDRESS} - GALA balance: ${mcpToolNames_js_1.MCP_TOOLS.FETCH_GALA_BALANCE} Display: - Profile details - Activity metrics - Wallet addresses - Current balance`), }; /** * Export all portfolio prompts */ exports.portfolioPrompts = [ exports.portfolioPrompt, exports.tokensHeldPrompt, exports.tokensCreatedPrompt, exports.balancePrompt, exports.profilePrompt, ]; //# sourceMappingURL=portfolio.js.map