@gala-chain/launchpad-mcp-server 1.24.1 → 1.25.0

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 +30 -0
  2. package/dist/generated/version.d.ts +1 -1
  3. package/dist/generated/version.js +1 -1
  4. package/dist/tools/index.d.ts +2 -2
  5. package/dist/tools/index.js +3 -3
  6. package/dist/tools/pools/index.d.ts.map +1 -1
  7. package/dist/tools/pools/index.js +4 -0
  8. package/dist/tools/pools/index.js.map +1 -1
  9. package/dist/tools/pools/onDexPoolCreation.d.ts +6 -0
  10. package/dist/tools/pools/onDexPoolCreation.d.ts.map +1 -0
  11. package/dist/tools/pools/onDexPoolCreation.js +60 -0
  12. package/dist/tools/pools/onDexPoolCreation.js.map +1 -0
  13. package/dist/tools/pools/onLaunchpadTokenCreation.d.ts +6 -0
  14. package/dist/tools/pools/onLaunchpadTokenCreation.d.ts.map +1 -0
  15. package/dist/tools/pools/onLaunchpadTokenCreation.js +54 -0
  16. package/dist/tools/pools/onLaunchpadTokenCreation.js.map +1 -0
  17. package/package.json +2 -2
  18. package/docs/AI-AGENT-PATTERNS.md +0 -555
  19. package/docs/CONSTRAINTS-REFERENCE.md +0 -454
  20. package/docs/PROMPT-TOOL-MAPPING.md +0 -352
  21. package/docs/examples/default-values-pattern.md +0 -240
  22. package/docs/examples/tool-factory-pattern.md +0 -217
  23. package/jest.config.js +0 -94
  24. package/src/__tests__/integration/fetchTokenDetails.integration.test.ts +0 -258
  25. package/src/__tests__/integration/poolTools.integration.test.ts +0 -185
  26. package/src/__tests__/server.test.ts +0 -255
  27. package/src/constants/mcpToolNames.ts +0 -183
  28. package/src/index.ts +0 -19
  29. package/src/prompts/__tests__/promptStructure.test.ts +0 -187
  30. package/src/prompts/__tests__/registry.test.ts +0 -349
  31. package/src/prompts/analysis.ts +0 -380
  32. package/src/prompts/balances.ts +0 -182
  33. package/src/prompts/create-token.ts +0 -123
  34. package/src/prompts/creation-utils.ts +0 -103
  35. package/src/prompts/dex-trading.ts +0 -86
  36. package/src/prompts/discover-tokens.ts +0 -86
  37. package/src/prompts/explore-dex-pools.ts +0 -138
  38. package/src/prompts/index.ts +0 -178
  39. package/src/prompts/liquidity-positions.ts +0 -237
  40. package/src/prompts/pools.ts +0 -496
  41. package/src/prompts/portfolio.ts +0 -208
  42. package/src/prompts/social.ts +0 -94
  43. package/src/prompts/trading-calculations.ts +0 -414
  44. package/src/prompts/trading.ts +0 -160
  45. package/src/prompts/transfers.ts +0 -97
  46. package/src/prompts/utility-tools.ts +0 -266
  47. package/src/prompts/utility.ts +0 -77
  48. package/src/prompts/utils/handlerHelpers.ts +0 -55
  49. package/src/prompts/utils/textTemplates.ts +0 -73
  50. package/src/prompts/utils/workflowTemplates.ts +0 -511
  51. package/src/schemas/common-schemas.ts +0 -393
  52. package/src/scripts/test-all-prompts.ts +0 -184
  53. package/src/server.ts +0 -367
  54. package/src/tools/__tests__/dex-tools.test.ts +0 -562
  55. package/src/tools/__tests__/liquidity-positions.test.ts +0 -673
  56. package/src/tools/balance/index.ts +0 -174
  57. package/src/tools/creation/index.ts +0 -182
  58. package/src/tools/dex/fetchAllDexPools.ts +0 -45
  59. package/src/tools/dex/fetchDexPools.ts +0 -58
  60. package/src/tools/dex/index.ts +0 -231
  61. package/src/tools/dex/liquidity-positions.ts +0 -547
  62. package/src/tools/index.ts +0 -94
  63. package/src/tools/pools/fetchAllPools.ts +0 -47
  64. package/src/tools/pools/fetchAllPriceHistory.ts +0 -119
  65. package/src/tools/pools/fetchPoolDetails.ts +0 -27
  66. package/src/tools/pools/fetchPoolDetailsForCalculation.ts +0 -22
  67. package/src/tools/pools/fetchPools.ts +0 -47
  68. package/src/tools/pools/fetchPriceHistory.ts +0 -124
  69. package/src/tools/pools/fetchTokenDetails.ts +0 -77
  70. package/src/tools/pools/index.ts +0 -284
  71. package/src/tools/social/index.ts +0 -64
  72. package/src/tools/trading/index.ts +0 -605
  73. package/src/tools/transfers/index.ts +0 -75
  74. package/src/tools/utils/clearCache.ts +0 -36
  75. package/src/tools/utils/createWallet.ts +0 -19
  76. package/src/tools/utils/explainSdkUsage.ts +0 -1446
  77. package/src/tools/utils/getAddress.ts +0 -12
  78. package/src/tools/utils/getCacheInfo.ts +0 -14
  79. package/src/tools/utils/getConfig.ts +0 -21
  80. package/src/tools/utils/getEnvironment.ts +0 -17
  81. package/src/tools/utils/getEthereumAddress.ts +0 -12
  82. package/src/tools/utils/getUrlByTokenName.ts +0 -12
  83. package/src/tools/utils/getVersion.ts +0 -25
  84. package/src/tools/utils/getWallet.ts +0 -25
  85. package/src/tools/utils/hasWallet.ts +0 -15
  86. package/src/tools/utils/index.ts +0 -37
  87. package/src/tools/utils/isTokenGraduated.ts +0 -16
  88. package/src/tools/utils/setWallet.ts +0 -41
  89. package/src/tools/utils/switchEnvironment.ts +0 -28
  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 -303
  98. package/src/utils/tool-registry.ts +0 -296
  99. package/src/utils/validation.ts +0 -429
  100. package/tests/wallet-management-integration.test.ts +0 -284
  101. package/tsconfig.json +0 -23
@@ -1,237 +0,0 @@
1
- /**
2
- * DEX Liquidity Position Prompts
3
- *
4
- * Slash commands for managing liquidity positions on GalaSwap DEX
5
- */
6
-
7
- import type { MCPPrompt } from '../types/mcp.js';
8
- import { validateNumericAmount } from '../utils/validation.js';
9
- import { createPromptResponse } from './utils/handlerHelpers.js';
10
-
11
- /**
12
- * View My Liquidity Positions - List all open LP positions
13
- *
14
- * This prompt shows all open liquidity positions for the authenticated wallet.
15
- */
16
- export const myPositionsPrompt: MCPPrompt = {
17
- name: 'galachain-launchpad:my-positions',
18
- description:
19
- 'View all your open liquidity positions on GalaSwap DEX with details about each position',
20
- arguments: [],
21
- handler: () =>
22
- createPromptResponse(`I want to view all my open liquidity positions on GalaSwap DEX.
23
-
24
- **Action:**
25
- Show me all my liquidity positions with the following information for each:
26
- - Position ID
27
- - Token pair (token0/token1)
28
- - Fee tier
29
- - Current liquidity amount
30
- - Token amounts locked
31
- - Accumulated trading fees
32
-
33
- **Workflow:**
34
- 1. Fetch all my open positions using gala_launchpad_get_user_liquidity_positions
35
- 2. Display each position with key details
36
- 3. Show total summary (number of positions, total accumulated fees)
37
-
38
- Please use the following MCP tools:
39
- - gala_launchpad_get_user_liquidity_positions: Retrieve all open positions for my wallet
40
-
41
- Proceed with fetching my positions.`),
42
- };
43
-
44
- /**
45
- * Add Liquidity - Create new LP position with guided workflow
46
- *
47
- * Guides through adding liquidity to a pool with price range selection
48
- */
49
- export const addLiquidityPrompt: MCPPrompt = {
50
- name: 'galachain-launchpad:add-liquidity',
51
- description:
52
- 'Add liquidity to a GalaSwap DEX pool. Guides through selecting token pair, price range, and amounts.',
53
- arguments: [
54
- {
55
- name: 'token0',
56
- description: 'First token symbol (e.g., GALA)',
57
- required: true,
58
- },
59
- {
60
- name: 'token1',
61
- description: 'Second token symbol (e.g., GUSDC)',
62
- required: true,
63
- },
64
- {
65
- name: 'amount0',
66
- description: 'Amount of token0 to provide (e.g., 1000)',
67
- required: true,
68
- },
69
- {
70
- name: 'amount1',
71
- description: 'Amount of token1 to provide (e.g., 1000)',
72
- required: true,
73
- },
74
- {
75
- name: 'minPrice',
76
- description: 'Minimum price boundary for LP range (e.g., 0.90)',
77
- required: false,
78
- },
79
- {
80
- name: 'maxPrice',
81
- description: 'Maximum price boundary for LP range (e.g., 1.10)',
82
- required: false,
83
- },
84
- {
85
- name: 'feeTier',
86
- description: 'Fee tier in basis points: 500, 3000, or 10000 (default: 3000)',
87
- required: false,
88
- },
89
- ],
90
- handler: (args) => {
91
- // Validate amounts
92
- validateNumericAmount(args.amount0, 'amount0');
93
- validateNumericAmount(args.amount1, 'amount1');
94
-
95
- const minPrice = args.minPrice || '0.95';
96
- const maxPrice = args.maxPrice || '1.05';
97
- const feeTier = args.feeTier || '3000';
98
-
99
- return createPromptResponse(`I want to add liquidity to the ${args.token0}/${args.token1} pool on GalaSwap DEX.
100
-
101
- **Liquidity Details:**
102
- - Token Pair: ${args.token0} / ${args.token1}
103
- - Amount of ${args.token0}: ${args.amount0}
104
- - Amount of ${args.token1}: ${args.amount1}
105
- - Price Range: ${minPrice} - ${maxPrice}
106
- - Fee Tier: ${feeTier} basis points (${parseInt(feeTier) / 100}%)
107
-
108
- **Workflow:**
109
- 1. Check my wallet balances to ensure I have sufficient tokens
110
- 2. Get pool information for the ${args.token0}/${args.token1} pair
111
- 3. Add liquidity by price range with the specified amounts and price boundaries
112
- 4. Confirm the position was created successfully
113
-
114
- **Important:**
115
- - Price range ${minPrice}-${maxPrice} means liquidity is only provided when the price is in this range
116
- - Lower fee tiers (500 bps) for stablecoins, higher fees (3000-10000 bps) for volatile pairs
117
- - I accept the estimated slippage shown in the quote
118
-
119
- Please use the following MCP tools:
120
- - gala_launchpad_get_swap_user_assets: Check my token balances
121
- - gala_launchpad_get_swap_pool_info: Get ${args.token0}/${args.token1} pool details
122
- - gala_launchpad_add_liquidity_by_price: Add liquidity with price range
123
-
124
- Proceed with adding liquidity.`);
125
- },
126
- };
127
-
128
- /**
129
- * Remove Liquidity - Close or reduce LP position
130
- *
131
- * Guides through removing liquidity from an existing position
132
- */
133
- export const removeLiquidityPrompt: MCPPrompt = {
134
- name: 'galachain-launchpad:remove-liquidity',
135
- description:
136
- 'Remove liquidity from an existing position. Shows estimated tokens and fees to receive.',
137
- arguments: [
138
- {
139
- name: 'positionId',
140
- description: 'Position ID to remove liquidity from',
141
- required: true,
142
- },
143
- {
144
- name: 'percentage',
145
- description: 'Percentage of liquidity to remove (0-100, default: 100 to close position)',
146
- required: false,
147
- },
148
- ],
149
- handler: (args) => {
150
- const percentage = args.percentage || '100';
151
-
152
- return createPromptResponse(`I want to remove ${percentage}% of liquidity from position ${args.positionId}.
153
-
154
- **Removal Details:**
155
- - Position ID: ${args.positionId}
156
- - Removal Amount: ${percentage}% of liquidity
157
- ${percentage === '100' ? '- Action: Close position completely' : '- Action: Reduce position by ' + percentage + '%'}
158
-
159
- **Workflow:**
160
- 1. Get position details (token pair, current liquidity, accumulated fees)
161
- 2. Estimate tokens and fees that will be received when removing
162
- 3. Show the breakdown of what I'll receive
163
- 4. Execute the removal with slippage protection
164
- 5. Verify the position was updated/closed
165
-
166
- **Important:**
167
- - Removing 100% closes the position
168
- - Removing less keeps the position open with reduced liquidity
169
- - Accumulated fees can be collected separately if desired
170
- - Slippage protection ensures I receive acceptable amounts
171
-
172
- Please use the following MCP tools:
173
- - gala_launchpad_get_liquidity_position_by_id: Get position details
174
- - gala_launchpad_estimate_remove_liquidity: Preview what I'll receive
175
- - gala_launchpad_remove_liquidity: Execute the removal
176
-
177
- Proceed with removing liquidity.`);
178
- },
179
- };
180
-
181
- /**
182
- * Collect Fees - Harvest accumulated trading fees
183
- *
184
- * Guides through collecting accumulated fees from a position
185
- */
186
- export const collectFeesPrompt: MCPPrompt = {
187
- name: 'galachain-launchpad:collect-fees',
188
- description:
189
- 'Collect accumulated trading fees from a liquidity position without modifying the position.',
190
- arguments: [
191
- {
192
- name: 'positionId',
193
- description: 'Position ID to collect fees from',
194
- required: true,
195
- },
196
- ],
197
- handler: (args) =>
198
- createPromptResponse(`I want to collect accumulated trading fees from position ${args.positionId}.
199
-
200
- **Fee Collection Details:**
201
- - Position ID: ${args.positionId}
202
- - Action: Harvest accumulated trading fees
203
- - Position Impact: Liquidity remains unchanged, only fees collected
204
-
205
- **Workflow:**
206
- 1. Get position details to show accumulated fees
207
- 2. Show how much in fees is available to collect (in both tokens)
208
- 3. Execute fee collection transaction
209
- 4. Confirm fees were successfully collected
210
-
211
- **Benefits:**
212
- - Passive income from liquidity provision
213
- - Fees accumulate continuously as trades happen
214
- - Can be collected without closing the position
215
- - Frees up rewards to reinvest or use elsewhere
216
-
217
- **Important:**
218
- - Fee collection doesn't affect your liquidity position
219
- - Fees are only earned on trades within your price range
220
- - Fee amounts depend on trading volume and your fee tier
221
-
222
- Please use the following MCP tools:
223
- - gala_launchpad_get_liquidity_position_by_id: Get position details and fee amounts
224
- - gala_launchpad_collect_position_fees: Collect the accumulated fees
225
-
226
- Proceed with collecting fees.`),
227
- };
228
-
229
- /**
230
- * Export all liquidity position prompts
231
- */
232
- export const liquidityPositionPrompts: MCPPrompt[] = [
233
- myPositionsPrompt,
234
- addLiquidityPrompt,
235
- removeLiquidityPrompt,
236
- collectFeesPrompt,
237
- ];