@gala-chain/launchpad-mcp-server 1.18.0 → 1.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +185 -0
  2. package/README.md +83 -3
  3. package/dist/generated/version.d.ts +1 -1
  4. package/dist/generated/version.js +1 -1
  5. package/dist/prompts/create-token.d.ts +15 -0
  6. package/dist/prompts/create-token.d.ts.map +1 -0
  7. package/dist/prompts/create-token.js +106 -0
  8. package/dist/prompts/create-token.js.map +1 -0
  9. package/dist/prompts/dex-trading.d.ts +18 -0
  10. package/dist/prompts/dex-trading.d.ts.map +1 -0
  11. package/dist/prompts/dex-trading.js +83 -0
  12. package/dist/prompts/dex-trading.js.map +1 -0
  13. package/dist/prompts/discover-tokens.d.ts +15 -0
  14. package/dist/prompts/discover-tokens.d.ts.map +1 -0
  15. package/dist/prompts/discover-tokens.js +78 -0
  16. package/dist/prompts/discover-tokens.js.map +1 -0
  17. package/dist/prompts/index.d.ts +9 -4
  18. package/dist/prompts/index.d.ts.map +1 -1
  19. package/dist/prompts/index.js +20 -3
  20. package/dist/prompts/index.js.map +1 -1
  21. package/dist/prompts/utils/workflowTemplates.d.ts +28 -0
  22. package/dist/prompts/utils/workflowTemplates.d.ts.map +1 -1
  23. package/dist/prompts/utils/workflowTemplates.js +136 -0
  24. package/dist/prompts/utils/workflowTemplates.js.map +1 -1
  25. package/dist/tools/dex/index.d.ts +14 -0
  26. package/dist/tools/dex/index.d.ts.map +1 -0
  27. package/dist/tools/dex/index.js +202 -0
  28. package/dist/tools/dex/index.js.map +1 -0
  29. package/dist/tools/index.d.ts +1 -1
  30. package/dist/tools/index.d.ts.map +1 -1
  31. package/dist/tools/index.js +18 -12
  32. package/dist/tools/index.js.map +1 -1
  33. package/dist/tools/utils/explainSdkUsage.d.ts.map +1 -1
  34. package/dist/tools/utils/explainSdkUsage.js +94 -1
  35. package/dist/tools/utils/explainSdkUsage.js.map +1 -1
  36. package/dist/utils/validation.d.ts +18 -0
  37. package/dist/utils/validation.d.ts.map +1 -1
  38. package/dist/utils/validation.js +35 -0
  39. package/dist/utils/validation.js.map +1 -1
  40. package/package.json +3 -3
  41. package/docs/AI-AGENT-PATTERNS.md +0 -555
  42. package/docs/CONSTRAINTS-REFERENCE.md +0 -454
  43. package/docs/PROMPT-TOOL-MAPPING.md +0 -352
  44. package/docs/examples/default-values-pattern.md +0 -240
  45. package/docs/examples/tool-factory-pattern.md +0 -217
  46. package/jest.config.js +0 -94
  47. package/src/__tests__/integration/fetchTokenDetails.integration.test.ts +0 -258
  48. package/src/__tests__/integration/poolTools.integration.test.ts +0 -185
  49. package/src/constants/mcpToolNames.ts +0 -141
  50. package/src/index.ts +0 -19
  51. package/src/prompts/__tests__/promptStructure.test.ts +0 -114
  52. package/src/prompts/__tests__/registry.test.ts +0 -145
  53. package/src/prompts/analysis.ts +0 -429
  54. package/src/prompts/index.ts +0 -127
  55. package/src/prompts/portfolio.ts +0 -242
  56. package/src/prompts/trading.ts +0 -191
  57. package/src/prompts/utility.ts +0 -43
  58. package/src/prompts/utils/workflowTemplates.ts +0 -344
  59. package/src/schemas/common-schemas.ts +0 -393
  60. package/src/scripts/test-all-prompts.ts +0 -184
  61. package/src/server.ts +0 -277
  62. package/src/tools/balance/index.ts +0 -174
  63. package/src/tools/creation/index.ts +0 -182
  64. package/src/tools/index.ts +0 -80
  65. package/src/tools/pools/fetchAllPools.ts +0 -47
  66. package/src/tools/pools/fetchAllPriceHistory.ts +0 -119
  67. package/src/tools/pools/fetchPoolDetails.ts +0 -27
  68. package/src/tools/pools/fetchPoolDetailsForCalculation.ts +0 -22
  69. package/src/tools/pools/fetchPools.ts +0 -47
  70. package/src/tools/pools/fetchPriceHistory.ts +0 -124
  71. package/src/tools/pools/fetchTokenDetails.ts +0 -77
  72. package/src/tools/pools/index.ts +0 -284
  73. package/src/tools/social/index.ts +0 -64
  74. package/src/tools/trading/index.ts +0 -605
  75. package/src/tools/transfers/index.ts +0 -75
  76. package/src/tools/utils/clearCache.ts +0 -36
  77. package/src/tools/utils/createWallet.ts +0 -19
  78. package/src/tools/utils/explainSdkUsage.ts +0 -1420
  79. package/src/tools/utils/getAddress.ts +0 -12
  80. package/src/tools/utils/getCacheInfo.ts +0 -14
  81. package/src/tools/utils/getConfig.ts +0 -11
  82. package/src/tools/utils/getEthereumAddress.ts +0 -12
  83. package/src/tools/utils/getUrlByTokenName.ts +0 -12
  84. package/src/tools/utils/getVersion.ts +0 -25
  85. package/src/tools/utils/getWallet.ts +0 -25
  86. package/src/tools/utils/hasWallet.ts +0 -15
  87. package/src/tools/utils/index.ts +0 -33
  88. package/src/tools/utils/isTokenGraduated.ts +0 -16
  89. package/src/tools/utils/setWallet.ts +0 -41
  90. package/src/types/mcp.ts +0 -72
  91. package/src/utils/__tests__/validation.test.ts +0 -147
  92. package/src/utils/constraints.ts +0 -155
  93. package/src/utils/default-values.ts +0 -208
  94. package/src/utils/error-handler.ts +0 -69
  95. package/src/utils/error-templates.ts +0 -273
  96. package/src/utils/response-formatter.ts +0 -51
  97. package/src/utils/tool-factory.ts +0 -257
  98. package/src/utils/tool-registry.ts +0 -296
  99. package/src/utils/validation.ts +0 -336
  100. package/tests/wallet-management-integration.test.ts +0 -284
  101. package/tsconfig.json +0 -23
@@ -1,47 +0,0 @@
1
- /**
2
- * Fetch All Pools Tool
3
- *
4
- * Convenience tool that fetches all available pools with automatic pagination.
5
- * Equivalent to calling fetchPools with limit: 0.
6
- */
7
-
8
- import type { MCPTool } from '../../types/mcp.js';
9
- import { formatSuccess } from '../../utils/response-formatter.js';
10
- import { withErrorHandling } from '../../utils/error-handler.js';
11
-
12
- export const fetchAllPoolsTool: MCPTool = {
13
- name: 'gala_launchpad_fetch_all_pools',
14
- description: 'Fetch all available pools with automatic pagination. No page/limit parameters needed - returns ALL pools matching filters.',
15
- inputSchema: {
16
- type: 'object',
17
- properties: {
18
- search: {
19
- type: 'string',
20
- minLength: 1,
21
- maxLength: 100,
22
- description: 'Optional search query (fuzzy match filter)',
23
- },
24
- tokenName: {
25
- type: 'string',
26
- minLength: 3,
27
- maxLength: 20,
28
- pattern: '^[a-zA-Z0-9]{3,20}$',
29
- description: 'Optional token name (exact match filter)',
30
- },
31
- type: {
32
- type: 'string',
33
- enum: ['recent', 'popular'],
34
- description: 'Type of pools to fetch (default: recent)',
35
- },
36
- },
37
- },
38
- handler: withErrorHandling(async (sdk, args) => {
39
- const result = await sdk.fetchAllPools({
40
- ...(args.search && { search: args.search }),
41
- ...(args.tokenName && { tokenName: args.tokenName }),
42
- ...(args.type && { type: args.type }),
43
- });
44
-
45
- return formatSuccess(result);
46
- }),
47
- };
@@ -1,119 +0,0 @@
1
- /**
2
- * Fetch All Price History Tool
3
- *
4
- * Queries all historical token price data from DEX Backend API with automatic pagination.
5
- * Uses the /price-oracle/fetch-price endpoint for complete price history retrieval.
6
- */
7
-
8
- import type { MCPTool } from '../../types/mcp.js';
9
- import { formatSuccess } from '../../utils/response-formatter.js';
10
- import { withErrorHandling } from '../../utils/error-handler.js';
11
-
12
- export const fetchAllPriceHistoryTool: MCPTool = {
13
- name: 'gala_launchpad_fetch_all_price_history',
14
- description: `Fetch all historical price snapshots for DEX tokens from the DEX Backend API with automatic pagination.
15
-
16
- **Endpoint:** \`/price-oracle/fetch-price\`
17
-
18
- **Requirements:**
19
- - DEX Backend API must be configured (dexBackendBaseUrl in SDK config)
20
- - Node.js environment only (not available in browser)
21
- - Either tokenName OR tokenId is required (not both)
22
-
23
- **Token Identification:**
24
- - Use \`tokenName\` for convenience (e.g., "demonkpop") - automatically resolved to full token ID
25
- - Use \`tokenId\` for direct specification (e.g., "Token|Unit|DKP|eth:...")
26
- - Provide exactly ONE of these parameters
27
-
28
- **Use Cases:**
29
- - Complete historical price analysis and charting
30
- - Full price trend identification over time periods
31
- - Comprehensive volatility analysis
32
- - Data export for external analytics
33
-
34
- **Performance:** API-based queries with automatic pagination (max 100 items per page, combined into single result).`,
35
-
36
- inputSchema: {
37
- type: 'object',
38
- properties: {
39
- tokenName: {
40
- type: 'string',
41
- description:
42
- 'Simple token name for convenience (e.g., "demonkpop", "shoewars") - automatically resolves to full token ID. Use this OR tokenId, not both.',
43
- },
44
- tokenId: {
45
- oneOf: [
46
- {
47
- type: 'string',
48
- description:
49
- 'Pipe-delimited format: "collection|category|type|additionalKey" (e.g., "Token|Unit|GUSDC|eth:...")',
50
- },
51
- {
52
- type: 'object',
53
- properties: {
54
- collection: {
55
- type: 'string',
56
- description: 'Token collection (e.g., "Token")',
57
- },
58
- category: {
59
- type: 'string',
60
- description: 'Token category (e.g., "Unit")',
61
- },
62
- type: {
63
- type: 'string',
64
- description: 'Token type (e.g., "GUSDC")',
65
- },
66
- additionalKey: {
67
- type: 'string',
68
- description: 'Additional key (e.g., "eth:0x...")',
69
- },
70
- },
71
- required: ['collection', 'category', 'type', 'additionalKey'],
72
- description: 'TokenClassKey object format',
73
- },
74
- ],
75
- description: 'Token identifier (string or TokenClassKey object). Use this OR tokenName, not both.',
76
- },
77
- from: {
78
- type: 'string',
79
- format: 'date-time',
80
- description: 'Start date for filtering (ISO 8601 format, defaults to 30 days ago)',
81
- },
82
- to: {
83
- type: 'string',
84
- format: 'date-time',
85
- description: 'End date for filtering (ISO 8601 format, defaults to now)',
86
- },
87
- sortOrder: {
88
- type: 'string',
89
- enum: ['ASC', 'DESC'],
90
- description: 'Sort order for results (default: DESC for newest-first)',
91
- },
92
- },
93
- required: [],
94
- },
95
-
96
- handler: withErrorHandling(async (sdk, args) => {
97
- // Convert string dates to Date objects if provided
98
- const options: any = {
99
- sortOrder: args.sortOrder,
100
- };
101
-
102
- // Support both tokenName and tokenId (mutual exclusivity validation happens in SDK)
103
- if (args.tokenName) {
104
- options.tokenName = args.tokenName;
105
- } else {
106
- options.tokenId = args.tokenId;
107
- }
108
-
109
- if (args.from) {
110
- options.from = new Date(args.from);
111
- }
112
- if (args.to) {
113
- options.to = new Date(args.to);
114
- }
115
-
116
- const result = await sdk.fetchAllPriceHistory(options);
117
- return formatSuccess(result);
118
- }),
119
- };
@@ -1,27 +0,0 @@
1
- /**
2
- * Fetch Pool Details Tool
3
- */
4
-
5
- import type { MCPTool } from '../../types/mcp.js';
6
- import { formatSuccess } from '../../utils/response-formatter.js';
7
- import { withErrorHandling } from '../../utils/error-handler.js';
8
-
9
- export const fetchPoolDetailsTool: MCPTool = {
10
- name: 'gala_launchpad_fetch_pool_details',
11
- description: 'Get detailed pool state from GalaChain bonding curve',
12
- inputSchema: {
13
- type: 'object',
14
- properties: {
15
- tokenName: {
16
- type: 'string',
17
- pattern: '^[a-z0-9_-]{2,20}$',
18
- description: 'Token name',
19
- },
20
- },
21
- required: ['tokenName'],
22
- },
23
- handler: withErrorHandling(async (sdk, args) => {
24
- const result = await sdk.fetchPoolDetails(args.tokenName);
25
- return formatSuccess(result);
26
- }),
27
- };
@@ -1,22 +0,0 @@
1
- /**
2
- * Fetch Pool Details for Calculation Tool (73% code reduction via factory pattern)
3
- */
4
-
5
- import { createSimpleTokenFetchTool } from '../../utils/tool-factory.js';
6
-
7
- export const fetchPoolDetailsForCalculationTool = createSimpleTokenFetchTool({
8
- name: 'gala_launchpad_fetch_pool_details_for_calculation',
9
- description: `Get optimized pool details for local bonding curve calculations.
10
-
11
- Returns only essential calculation parameters:
12
- - currentSupply: Current token supply (computed with full precision)
13
- - remainingTokens: Tokens available for purchase
14
- - maxSupply: Maximum token supply
15
- - reverseBondingCurveMaxFeeFactor: Maximum reverse bonding curve fee (normalized to number)
16
- - reverseBondingCurveMinFeeFactor: Minimum reverse bonding curve fee (normalized to number)
17
- - reverseBondingCurveNetFeeFactor: Net fee factor (max - min, for convenience)
18
-
19
- This is more efficient than fetchPoolDetails as it returns only fields needed for calculations.
20
- Perfect for use with calculateBuyAmountLocal and calculateSellAmountLocal.`,
21
- handler: (sdk, tokenName) => sdk.fetchPoolDetailsForCalculation(tokenName),
22
- });
@@ -1,47 +0,0 @@
1
- /**
2
- * Fetch Pools Tool
3
- */
4
-
5
- import type { MCPTool } from '../../types/mcp.js';
6
- import { formatSuccess } from '../../utils/response-formatter.js';
7
- import { withErrorHandling } from '../../utils/error-handler.js';
8
-
9
- export const fetchPoolsTool: MCPTool = {
10
- name: 'gala_launchpad_fetch_pools',
11
- description: 'Fetch token pools from Gala Launchpad with filtering and pagination',
12
- inputSchema: {
13
- type: 'object',
14
- properties: {
15
- type: {
16
- type: 'string',
17
- enum: ['recent', 'popular'],
18
- description: 'Type of pools to fetch (default: recent)',
19
- },
20
- creatorAddress: {
21
- type: 'string',
22
- pattern: '^(0x[a-fA-F0-9]{40}|eth\\|[a-fA-F0-9]{40})$',
23
- description: 'Filter by creator address (optional)',
24
- },
25
- page: {
26
- type: 'number',
27
- minimum: 1,
28
- description: 'Page number (default: 1)',
29
- },
30
- limit: {
31
- type: 'number',
32
- minimum: 1,
33
- maximum: 100,
34
- description: 'Results per page (default: 20)',
35
- },
36
- },
37
- },
38
- handler: withErrorHandling(async (sdk, args) => {
39
- const result = await sdk.fetchPools({
40
- type: args.type || 'recent',
41
- page: args.page || 1,
42
- limit: args.limit || 20,
43
- });
44
-
45
- return formatSuccess(result);
46
- }),
47
- };
@@ -1,124 +0,0 @@
1
- /**
2
- * Fetch Price History Tool
3
- *
4
- * Queries historical token price data from DEX Backend API.
5
- * Uses the /price-oracle/fetch-price endpoint for paginated price history retrieval.
6
- */
7
-
8
- import type { MCPTool } from '../../types/mcp.js';
9
- import { formatSuccess } from '../../utils/response-formatter.js';
10
- import { withErrorHandling } from '../../utils/error-handler.js';
11
- import { PAGE_SCHEMA, createLimitSchema } from '../../schemas/common-schemas.js';
12
-
13
- export const fetchPriceHistoryTool: MCPTool = {
14
- name: 'gala_launchpad_fetch_price_history',
15
- description: `Fetch historical price snapshots for DEX tokens from the DEX Backend API.
16
-
17
- **Endpoint:** \`/price-oracle/fetch-price\`
18
-
19
- **Requirements:**
20
- - DEX Backend API must be configured (dexBackendBaseUrl in SDK config)
21
- - Node.js environment only (not available in browser)
22
- - Either tokenName OR tokenId is required (not both)
23
-
24
- **Token Identification:**
25
- - Use \`tokenName\` for convenience (e.g., "demonkpop") - automatically resolved to full token ID
26
- - Use \`tokenId\` for direct specification (e.g., "Token|Unit|DKP|eth:...")
27
- - Provide exactly ONE of these parameters
28
-
29
- **Use Cases:**
30
- - Historical price analysis and charting
31
- - Price trend identification
32
- - Volatility analysis over time periods
33
- - Data export for external analytics
34
-
35
- **Performance:** API-based queries with pagination support (max 50 items per page).`,
36
-
37
- inputSchema: {
38
- type: 'object',
39
- properties: {
40
- tokenName: {
41
- type: 'string',
42
- description:
43
- 'Simple token name for convenience (e.g., "demonkpop", "shoewars") - automatically resolves to full token ID. Use this OR tokenId, not both.',
44
- },
45
- tokenId: {
46
- oneOf: [
47
- {
48
- type: 'string',
49
- description:
50
- 'Pipe-delimited format: "collection|category|type|additionalKey" (e.g., "Token|Unit|GUSDC|eth:...")',
51
- },
52
- {
53
- type: 'object',
54
- properties: {
55
- collection: {
56
- type: 'string',
57
- description: 'Token collection (e.g., "Token")',
58
- },
59
- category: {
60
- type: 'string',
61
- description: 'Token category (e.g., "Unit")',
62
- },
63
- type: {
64
- type: 'string',
65
- description: 'Token type (e.g., "GUSDC")',
66
- },
67
- additionalKey: {
68
- type: 'string',
69
- description: 'Additional key (e.g., "eth:0x...")',
70
- },
71
- },
72
- required: ['collection', 'category', 'type', 'additionalKey'],
73
- description: 'TokenClassKey object format',
74
- },
75
- ],
76
- description: 'Token identifier (string or TokenClassKey object). Use this OR tokenName, not both.',
77
- },
78
- from: {
79
- type: 'string',
80
- format: 'date-time',
81
- description: 'Start date for filtering (ISO 8601 format, defaults to 30 days ago)',
82
- },
83
- to: {
84
- type: 'string',
85
- format: 'date-time',
86
- description: 'End date for filtering (ISO 8601 format, defaults to now)',
87
- },
88
- sortOrder: {
89
- type: 'string',
90
- enum: ['ASC', 'DESC'],
91
- description: 'Sort order for results (default: DESC for newest-first)',
92
- },
93
- page: PAGE_SCHEMA,
94
- limit: createLimitSchema('priceHistory', 10),
95
- },
96
- required: [],
97
- },
98
-
99
- handler: withErrorHandling(async (sdk, args) => {
100
- // Convert string dates to Date objects if provided
101
- const options: any = {
102
- sortOrder: args.sortOrder,
103
- page: args.page,
104
- limit: args.limit,
105
- };
106
-
107
- // Support both tokenName and tokenId (mutual exclusivity validation happens in SDK)
108
- if (args.tokenName) {
109
- options.tokenName = args.tokenName;
110
- } else {
111
- options.tokenId = args.tokenId;
112
- }
113
-
114
- if (args.from) {
115
- options.from = new Date(args.from);
116
- }
117
- if (args.to) {
118
- options.to = new Date(args.to);
119
- }
120
-
121
- const result = await sdk.fetchPriceHistory(options);
122
- return formatSuccess(result);
123
- }),
124
- };
@@ -1,77 +0,0 @@
1
- /**
2
- * Fetch Token Details Tool
3
- *
4
- * Queries the DEX API platform endpoint to retrieve comprehensive token metadata
5
- * including image, decimals, description, verification status, network information,
6
- * and trading capabilities.
7
- */
8
-
9
- import type { MCPTool } from '../../types/mcp.js';
10
- import { formatSuccess } from '../../utils/response-formatter.js';
11
- import { withErrorHandling } from '../../utils/error-handler.js';
12
-
13
- export const fetchTokenDetailsTool: MCPTool = {
14
- name: 'gala_launchpad_fetch_token_details',
15
- description: `Fetch comprehensive token details from DEX API platform
16
-
17
- **Endpoint:** \`/v1/tokens?tokenclasskeys=...\`
18
-
19
- **Requirements:**
20
- - DEX API platform must be configured (dexApiHttp client)
21
- - Token identifier required in flexible format (string or object)
22
-
23
- **Use Cases:**
24
- - Retrieve complete token metadata and information
25
- - Verify token specifications (decimals, symbol, description)
26
- - Check verification status and trading capabilities
27
- - Access token image and network information
28
- - Analyze token details before trading
29
-
30
- **Flexible Token Identification:**
31
- Supports both pipe-delimited string and object formats for maximum flexibility.`,
32
-
33
- inputSchema: {
34
- type: 'object',
35
- properties: {
36
- tokenId: {
37
- oneOf: [
38
- {
39
- type: 'string',
40
- description:
41
- 'Pipe-delimited format: "collection|category|type|additionalKey" (e.g., "Token|Unit|GUSDC|eth:0x...")',
42
- },
43
- {
44
- type: 'object',
45
- properties: {
46
- collection: {
47
- type: 'string',
48
- description: 'Token collection (e.g., "Token")',
49
- },
50
- category: {
51
- type: 'string',
52
- description: 'Token category (e.g., "Unit")',
53
- },
54
- type: {
55
- type: 'string',
56
- description: 'Token type (e.g., "GUSDC")',
57
- },
58
- additionalKey: {
59
- type: 'string',
60
- description: 'Additional key (e.g., "eth:0x...")',
61
- },
62
- },
63
- required: ['collection', 'category', 'type', 'additionalKey'],
64
- description: 'TokenClassKey object format',
65
- },
66
- ],
67
- description: 'Token identifier in flexible format (string or object)',
68
- },
69
- },
70
- required: ['tokenId'],
71
- },
72
-
73
- handler: withErrorHandling(async (sdk, args) => {
74
- const result = await sdk.fetchTokenDetails(args.tokenId);
75
- return formatSuccess(result);
76
- }),
77
- };