@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.
- package/CHANGELOG.md +30 -0
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +3 -3
- package/dist/tools/pools/index.d.ts.map +1 -1
- package/dist/tools/pools/index.js +4 -0
- package/dist/tools/pools/index.js.map +1 -1
- package/dist/tools/pools/onDexPoolCreation.d.ts +6 -0
- package/dist/tools/pools/onDexPoolCreation.d.ts.map +1 -0
- package/dist/tools/pools/onDexPoolCreation.js +60 -0
- package/dist/tools/pools/onDexPoolCreation.js.map +1 -0
- package/dist/tools/pools/onLaunchpadTokenCreation.d.ts +6 -0
- package/dist/tools/pools/onLaunchpadTokenCreation.d.ts.map +1 -0
- package/dist/tools/pools/onLaunchpadTokenCreation.js +54 -0
- package/dist/tools/pools/onLaunchpadTokenCreation.js.map +1 -0
- package/package.json +2 -2
- package/docs/AI-AGENT-PATTERNS.md +0 -555
- package/docs/CONSTRAINTS-REFERENCE.md +0 -454
- package/docs/PROMPT-TOOL-MAPPING.md +0 -352
- package/docs/examples/default-values-pattern.md +0 -240
- package/docs/examples/tool-factory-pattern.md +0 -217
- package/jest.config.js +0 -94
- package/src/__tests__/integration/fetchTokenDetails.integration.test.ts +0 -258
- package/src/__tests__/integration/poolTools.integration.test.ts +0 -185
- package/src/__tests__/server.test.ts +0 -255
- package/src/constants/mcpToolNames.ts +0 -183
- package/src/index.ts +0 -19
- package/src/prompts/__tests__/promptStructure.test.ts +0 -187
- package/src/prompts/__tests__/registry.test.ts +0 -349
- package/src/prompts/analysis.ts +0 -380
- package/src/prompts/balances.ts +0 -182
- package/src/prompts/create-token.ts +0 -123
- package/src/prompts/creation-utils.ts +0 -103
- package/src/prompts/dex-trading.ts +0 -86
- package/src/prompts/discover-tokens.ts +0 -86
- package/src/prompts/explore-dex-pools.ts +0 -138
- package/src/prompts/index.ts +0 -178
- package/src/prompts/liquidity-positions.ts +0 -237
- package/src/prompts/pools.ts +0 -496
- package/src/prompts/portfolio.ts +0 -208
- package/src/prompts/social.ts +0 -94
- package/src/prompts/trading-calculations.ts +0 -414
- package/src/prompts/trading.ts +0 -160
- package/src/prompts/transfers.ts +0 -97
- package/src/prompts/utility-tools.ts +0 -266
- package/src/prompts/utility.ts +0 -77
- package/src/prompts/utils/handlerHelpers.ts +0 -55
- package/src/prompts/utils/textTemplates.ts +0 -73
- package/src/prompts/utils/workflowTemplates.ts +0 -511
- package/src/schemas/common-schemas.ts +0 -393
- package/src/scripts/test-all-prompts.ts +0 -184
- package/src/server.ts +0 -367
- package/src/tools/__tests__/dex-tools.test.ts +0 -562
- package/src/tools/__tests__/liquidity-positions.test.ts +0 -673
- package/src/tools/balance/index.ts +0 -174
- package/src/tools/creation/index.ts +0 -182
- package/src/tools/dex/fetchAllDexPools.ts +0 -45
- package/src/tools/dex/fetchDexPools.ts +0 -58
- package/src/tools/dex/index.ts +0 -231
- package/src/tools/dex/liquidity-positions.ts +0 -547
- package/src/tools/index.ts +0 -94
- package/src/tools/pools/fetchAllPools.ts +0 -47
- package/src/tools/pools/fetchAllPriceHistory.ts +0 -119
- package/src/tools/pools/fetchPoolDetails.ts +0 -27
- package/src/tools/pools/fetchPoolDetailsForCalculation.ts +0 -22
- package/src/tools/pools/fetchPools.ts +0 -47
- package/src/tools/pools/fetchPriceHistory.ts +0 -124
- package/src/tools/pools/fetchTokenDetails.ts +0 -77
- package/src/tools/pools/index.ts +0 -284
- package/src/tools/social/index.ts +0 -64
- package/src/tools/trading/index.ts +0 -605
- package/src/tools/transfers/index.ts +0 -75
- package/src/tools/utils/clearCache.ts +0 -36
- package/src/tools/utils/createWallet.ts +0 -19
- package/src/tools/utils/explainSdkUsage.ts +0 -1446
- package/src/tools/utils/getAddress.ts +0 -12
- package/src/tools/utils/getCacheInfo.ts +0 -14
- package/src/tools/utils/getConfig.ts +0 -21
- package/src/tools/utils/getEnvironment.ts +0 -17
- package/src/tools/utils/getEthereumAddress.ts +0 -12
- package/src/tools/utils/getUrlByTokenName.ts +0 -12
- package/src/tools/utils/getVersion.ts +0 -25
- package/src/tools/utils/getWallet.ts +0 -25
- package/src/tools/utils/hasWallet.ts +0 -15
- package/src/tools/utils/index.ts +0 -37
- package/src/tools/utils/isTokenGraduated.ts +0 -16
- package/src/tools/utils/setWallet.ts +0 -41
- package/src/tools/utils/switchEnvironment.ts +0 -28
- package/src/types/mcp.ts +0 -72
- package/src/utils/__tests__/validation.test.ts +0 -147
- package/src/utils/constraints.ts +0 -155
- package/src/utils/default-values.ts +0 -208
- package/src/utils/error-handler.ts +0 -69
- package/src/utils/error-templates.ts +0 -273
- package/src/utils/response-formatter.ts +0 -51
- package/src/utils/tool-factory.ts +0 -303
- package/src/utils/tool-registry.ts +0 -296
- package/src/utils/validation.ts +0 -429
- package/tests/wallet-management-integration.test.ts +0 -284
- package/tsconfig.json +0 -23
|
@@ -1,511 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workflow Template Utilities
|
|
3
|
-
*
|
|
4
|
-
* Reusable templates for common workflow patterns in prompts.
|
|
5
|
-
* Reduces duplication and ensures consistency across slash commands.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { MCP_TOOLS } from '../../constants/mcpToolNames.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Configuration for trading workflow generation
|
|
12
|
-
*/
|
|
13
|
-
export interface TradingWorkflowConfig {
|
|
14
|
-
operation: 'buy' | 'sell' | 'graduate';
|
|
15
|
-
tokenName: string;
|
|
16
|
-
amount?: string;
|
|
17
|
-
amountType?: 'gala' | 'tokens';
|
|
18
|
-
slippage?: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Create a complete trading workflow with all standard steps
|
|
23
|
-
*
|
|
24
|
-
* @param config - Trading workflow configuration
|
|
25
|
-
* @returns Formatted workflow text with numbered steps
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```typescript
|
|
29
|
-
* const workflow = createTradingWorkflow({
|
|
30
|
-
* operation: 'buy',
|
|
31
|
-
* tokenName: 'anime',
|
|
32
|
-
* amount: '100',
|
|
33
|
-
* amountType: 'gala',
|
|
34
|
-
* slippage: '1'
|
|
35
|
-
* });
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export function createTradingWorkflow(config: TradingWorkflowConfig): string {
|
|
39
|
-
const { operation, tokenName, amount, amountType, slippage = '1' } = config;
|
|
40
|
-
|
|
41
|
-
switch (operation) {
|
|
42
|
-
case 'buy':
|
|
43
|
-
return createBuyWorkflow(tokenName, amount!, amountType!, slippage);
|
|
44
|
-
case 'sell':
|
|
45
|
-
return createSellWorkflow(tokenName, amount!, slippage);
|
|
46
|
-
case 'graduate':
|
|
47
|
-
return createGraduationWorkflow(tokenName, slippage);
|
|
48
|
-
default:
|
|
49
|
-
throw new Error(`Unknown operation: ${operation}`);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Create buy tokens workflow
|
|
55
|
-
*/
|
|
56
|
-
function createBuyWorkflow(
|
|
57
|
-
tokenName: string,
|
|
58
|
-
amount: string,
|
|
59
|
-
amountType: 'gala' | 'tokens',
|
|
60
|
-
slippage: string
|
|
61
|
-
): string {
|
|
62
|
-
const slippageFactor = parseFloat(slippage) / 100;
|
|
63
|
-
const typeParam = amountType === 'gala' ? 'native' : 'exact';
|
|
64
|
-
const amountLabel = amountType === 'gala' ? 'GALA to spend' : 'Tokens to buy';
|
|
65
|
-
|
|
66
|
-
return `Help me buy tokens on Gala Launchpad:
|
|
67
|
-
|
|
68
|
-
Token: ${tokenName}
|
|
69
|
-
${amountLabel}: ${amount}
|
|
70
|
-
Slippage tolerance: ${slippage}%
|
|
71
|
-
|
|
72
|
-
Please follow this workflow:
|
|
73
|
-
|
|
74
|
-
1. Calculate buy amount using ${MCP_TOOLS.CALCULATE_BUY_AMOUNT}:
|
|
75
|
-
- tokenName: "${tokenName}"
|
|
76
|
-
- amount: "${amount}"
|
|
77
|
-
- type: "${typeParam}" (${amountType === 'gala' ? 'spending GALA' : 'buying exact tokens'})
|
|
78
|
-
|
|
79
|
-
2. Show me the breakdown:
|
|
80
|
-
- Tokens I'll receive
|
|
81
|
-
- Transaction fee
|
|
82
|
-
- Gas fee
|
|
83
|
-
- Reverse bonding curve fee
|
|
84
|
-
- Total cost
|
|
85
|
-
|
|
86
|
-
3. Ask for confirmation before executing
|
|
87
|
-
|
|
88
|
-
4. If I confirm, execute the buy using ${MCP_TOOLS.BUY_TOKENS} with:
|
|
89
|
-
- expectedAmount from calculation
|
|
90
|
-
- maxAcceptableReverseBondingCurveFee from calculation
|
|
91
|
-
- slippageToleranceFactor: ${slippageFactor}
|
|
92
|
-
|
|
93
|
-
5. After purchase, show transaction ID and verify balance`;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Create sell tokens workflow
|
|
98
|
-
*/
|
|
99
|
-
function createSellWorkflow(
|
|
100
|
-
tokenName: string,
|
|
101
|
-
amount: string,
|
|
102
|
-
slippage: string
|
|
103
|
-
): string {
|
|
104
|
-
const slippageFactor = parseFloat(slippage) / 100;
|
|
105
|
-
|
|
106
|
-
return `Help me sell tokens on Gala Launchpad:
|
|
107
|
-
|
|
108
|
-
Token: ${tokenName}
|
|
109
|
-
Tokens to sell: ${amount}
|
|
110
|
-
Slippage tolerance: ${slippage}%
|
|
111
|
-
|
|
112
|
-
Please follow this workflow:
|
|
113
|
-
|
|
114
|
-
1. Check my token balance using ${MCP_TOOLS.FETCH_TOKEN_BALANCE}
|
|
115
|
-
|
|
116
|
-
2. Calculate sell amount using ${MCP_TOOLS.CALCULATE_SELL_AMOUNT}:
|
|
117
|
-
- tokenName: "${tokenName}"
|
|
118
|
-
- amount: "${amount}"
|
|
119
|
-
- type: "exact" (selling exact token amount)
|
|
120
|
-
|
|
121
|
-
3. Show me the breakdown:
|
|
122
|
-
- GALA I'll receive
|
|
123
|
-
- Transaction fee
|
|
124
|
-
- Gas fee
|
|
125
|
-
- Reverse bonding curve fee
|
|
126
|
-
- Net proceeds
|
|
127
|
-
|
|
128
|
-
4. Ask for confirmation before executing
|
|
129
|
-
|
|
130
|
-
5. If I confirm, execute the sell using ${MCP_TOOLS.SELL_TOKENS} with:
|
|
131
|
-
- expectedAmount from calculation
|
|
132
|
-
- maxAcceptableReverseBondingCurveFee from calculation
|
|
133
|
-
- slippageToleranceFactor: ${slippageFactor}
|
|
134
|
-
|
|
135
|
-
6. After sale, show transaction ID and verify updated balance`;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Create token graduation workflow
|
|
140
|
-
*/
|
|
141
|
-
function createGraduationWorkflow(tokenName: string, slippage: string): string {
|
|
142
|
-
const slippageFactor = parseFloat(slippage) / 100;
|
|
143
|
-
|
|
144
|
-
return `Help me graduate the token "${tokenName}" on Gala Launchpad:
|
|
145
|
-
|
|
146
|
-
Slippage tolerance: ${slippage}%
|
|
147
|
-
|
|
148
|
-
Please follow this workflow:
|
|
149
|
-
|
|
150
|
-
1. Check if token is already graduated using ${MCP_TOOLS.FETCH_POOL_DETAILS}
|
|
151
|
-
- If saleStatus is "Completed", inform me it's already graduated
|
|
152
|
-
|
|
153
|
-
2. Fetch optimized pool details using ${MCP_TOOLS.FETCH_POOL_DETAILS_FOR_CALCULATION}
|
|
154
|
-
|
|
155
|
-
3. Calculate graduation cost using ${MCP_TOOLS.CALCULATE_BUY_AMOUNT_FOR_GRADUATION} with:
|
|
156
|
-
- calculateAmountMode: "local"
|
|
157
|
-
- currentSupply from pool details
|
|
158
|
-
|
|
159
|
-
4. Show me the breakdown:
|
|
160
|
-
- GALA required to graduate: [amount field - this is GALA cost, NOT token quantity!]
|
|
161
|
-
- Transaction fee
|
|
162
|
-
- Gas fee
|
|
163
|
-
- Total cost
|
|
164
|
-
|
|
165
|
-
5. Check my GALA balance using ${MCP_TOOLS.FETCH_GALA_BALANCE}
|
|
166
|
-
- Verify I have enough GALA for graduation
|
|
167
|
-
|
|
168
|
-
6. Ask for confirmation before executing
|
|
169
|
-
|
|
170
|
-
7. If I confirm, execute graduation using ${MCP_TOOLS.GRADUATE_TOKEN} with:
|
|
171
|
-
- tokenName: "${tokenName}"
|
|
172
|
-
- slippageToleranceFactor: ${slippageFactor}
|
|
173
|
-
- calculateAmountMode: "local"
|
|
174
|
-
- currentSupply from pool details (optimization!)
|
|
175
|
-
|
|
176
|
-
8. After graduation:
|
|
177
|
-
- Show transaction ID
|
|
178
|
-
- Verify pool status changed to "Completed"
|
|
179
|
-
- Get frontend URL using ${MCP_TOOLS.GET_URL_BY_TOKEN_NAME}
|
|
180
|
-
|
|
181
|
-
IMPORTANT: The "amount" field in graduation calculations is GALA cost, not token quantity!`;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Format a list of steps with numbers
|
|
186
|
-
*
|
|
187
|
-
* @param steps - Array of step descriptions
|
|
188
|
-
* @returns Formatted steps with numbering
|
|
189
|
-
*
|
|
190
|
-
* @example
|
|
191
|
-
* ```typescript
|
|
192
|
-
* formatWorkflowSteps([
|
|
193
|
-
* 'Fetch pool details',
|
|
194
|
-
* 'Calculate price',
|
|
195
|
-
* 'Show results'
|
|
196
|
-
* ]);
|
|
197
|
-
* // Returns:
|
|
198
|
-
* // "1. Fetch pool details
|
|
199
|
-
* // 2. Calculate price
|
|
200
|
-
* // 3. Show results"
|
|
201
|
-
* ```
|
|
202
|
-
*/
|
|
203
|
-
export function formatWorkflowSteps(steps: string[]): string {
|
|
204
|
-
return steps.map((step, index) => `${index + 1}. ${step}`).join('\n\n');
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Create a standard confirmation step for destructive operations
|
|
209
|
-
*
|
|
210
|
-
* @param operation - Operation name (e.g., 'buy', 'sell', 'graduate')
|
|
211
|
-
* @returns Confirmation step text
|
|
212
|
-
*/
|
|
213
|
-
export function createConfirmationStep(operation: string): string {
|
|
214
|
-
return `Ask for confirmation before executing the ${operation} operation`;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Create a standard verification step after transaction
|
|
219
|
-
*
|
|
220
|
-
* @param operation - Operation name
|
|
221
|
-
* @param verifications - Array of verification checks to perform
|
|
222
|
-
* @returns Verification step text
|
|
223
|
-
*/
|
|
224
|
-
export function createVerificationStep(
|
|
225
|
-
operation: string,
|
|
226
|
-
verifications: string[]
|
|
227
|
-
): string {
|
|
228
|
-
const checks = verifications
|
|
229
|
-
.map((check, index) => ` ${String.fromCharCode(97 + index)}. ${check}`)
|
|
230
|
-
.join('\n');
|
|
231
|
-
|
|
232
|
-
return `After ${operation} completes:\n${checks}`;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Create an optimized performance note for LOCAL calculations
|
|
237
|
-
*
|
|
238
|
-
* @returns Performance optimization guidance text
|
|
239
|
-
*/
|
|
240
|
-
export function createPerformanceNote(): string {
|
|
241
|
-
return `Use the performance optimization pattern from SDK v3.9.0 to minimize network calls.`;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Create a cost breakdown display template
|
|
246
|
-
*
|
|
247
|
-
* @param operation - Operation type for context
|
|
248
|
-
* @returns Cost breakdown template text
|
|
249
|
-
*/
|
|
250
|
-
export function createCostBreakdown(operation: 'buy' | 'sell' | 'graduate'): string {
|
|
251
|
-
switch (operation) {
|
|
252
|
-
case 'buy':
|
|
253
|
-
return `Show me the breakdown:
|
|
254
|
-
- Tokens I'll receive
|
|
255
|
-
- Transaction fee
|
|
256
|
-
- Gas fee
|
|
257
|
-
- Reverse bonding curve fee
|
|
258
|
-
- Total cost`;
|
|
259
|
-
case 'sell':
|
|
260
|
-
return `Show me the breakdown:
|
|
261
|
-
- GALA I'll receive
|
|
262
|
-
- Transaction fee
|
|
263
|
-
- Gas fee
|
|
264
|
-
- Reverse bonding curve fee
|
|
265
|
-
- Net proceeds`;
|
|
266
|
-
case 'graduate':
|
|
267
|
-
return `Show me the breakdown:
|
|
268
|
-
- GALA required to graduate
|
|
269
|
-
- Transaction fee
|
|
270
|
-
- Gas fee
|
|
271
|
-
- Total cost`;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Create a balance check step
|
|
277
|
-
*
|
|
278
|
-
* @param assetType - Type of asset to check ('GALA' or token name)
|
|
279
|
-
* @returns Balance check step text
|
|
280
|
-
*/
|
|
281
|
-
export function createBalanceCheckStep(assetType: 'GALA' | string): string {
|
|
282
|
-
if (assetType === 'GALA') {
|
|
283
|
-
return `Check my GALA balance using ${MCP_TOOLS.FETCH_GALA_BALANCE}`;
|
|
284
|
-
}
|
|
285
|
-
return `Check my ${assetType} token balance using ${MCP_TOOLS.FETCH_TOKEN_BALANCE}`;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Create analysis workflow for token evaluation
|
|
290
|
-
*
|
|
291
|
-
* @param tokenName - Token to analyze
|
|
292
|
-
* @returns Complete analysis workflow
|
|
293
|
-
*/
|
|
294
|
-
export function createAnalysisWorkflow(tokenName: string): string {
|
|
295
|
-
return `Analyze the token "${tokenName}" using the Gala Launchpad MCP server:
|
|
296
|
-
|
|
297
|
-
1. Fetch optimized pool details using ${MCP_TOOLS.FETCH_POOL_DETAILS_FOR_CALCULATION}
|
|
298
|
-
2. Calculate current USD spot price using LOCAL mode with the currentSupply
|
|
299
|
-
3. Calculate graduation cost using LOCAL mode with the currentSupply
|
|
300
|
-
4. Show remaining tokens and pool status (saleStatus)
|
|
301
|
-
5. Calculate pool progress percentage: (currentSupply / maxSupply * 100)
|
|
302
|
-
|
|
303
|
-
${createPerformanceNote()}
|
|
304
|
-
|
|
305
|
-
Provide a brief analysis including:
|
|
306
|
-
- Current token price in USD
|
|
307
|
-
- Total GALA required to graduate the pool
|
|
308
|
-
- How close the token is to graduation (percentage)
|
|
309
|
-
- Whether this would be a good time to buy or wait`;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Create portfolio analysis workflow
|
|
314
|
-
*
|
|
315
|
-
* @returns Complete portfolio analysis workflow
|
|
316
|
-
*/
|
|
317
|
-
export function createPortfolioWorkflow(): string {
|
|
318
|
-
return `Analyze my complete Gala Launchpad portfolio:
|
|
319
|
-
|
|
320
|
-
1. Get GALA balance using ${MCP_TOOLS.FETCH_GALA_BALANCE}
|
|
321
|
-
|
|
322
|
-
2. Get all tokens I'm holding using ${MCP_TOOLS.FETCH_TOKENS_HELD}
|
|
323
|
-
- Use pagination if needed to get all tokens
|
|
324
|
-
|
|
325
|
-
3. For each token, calculate USD value using optimized pattern:
|
|
326
|
-
a. Fetch pool details once: ${MCP_TOOLS.FETCH_POOL_DETAILS_FOR_CALCULATION}
|
|
327
|
-
b. Calculate spot price: ${MCP_TOOLS.FETCH_LAUNCHPAD_TOKEN_SPOT_PRICE} with LOCAL mode
|
|
328
|
-
c. Multiply token balance by spot price for USD value
|
|
329
|
-
|
|
330
|
-
4. Calculate GALA USD value using ${MCP_TOOLS.FETCH_GALA_SPOT_PRICE}
|
|
331
|
-
|
|
332
|
-
5. Present a comprehensive portfolio summary:
|
|
333
|
-
- GALA balance and USD value
|
|
334
|
-
- Each token holding with:
|
|
335
|
-
* Token name
|
|
336
|
-
* Balance
|
|
337
|
-
* USD spot price
|
|
338
|
-
* Total USD value
|
|
339
|
-
- Total portfolio value in USD
|
|
340
|
-
- Top 3 holdings by value
|
|
341
|
-
- Number of different tokens held
|
|
342
|
-
|
|
343
|
-
${createPerformanceNote()}`;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* Create token creation workflow
|
|
348
|
-
*
|
|
349
|
-
* @param args - Token creation arguments (name, symbol, description, etc.)
|
|
350
|
-
* @returns Complete token creation workflow
|
|
351
|
-
*/
|
|
352
|
-
export function createCreateTokenWorkflow(args: {
|
|
353
|
-
tokenName: string;
|
|
354
|
-
tokenSymbol: string;
|
|
355
|
-
description: string;
|
|
356
|
-
imagePath?: string;
|
|
357
|
-
websiteUrl?: string;
|
|
358
|
-
twitterUrl?: string;
|
|
359
|
-
telegramUrl?: string;
|
|
360
|
-
preBuyGala?: string;
|
|
361
|
-
}): string {
|
|
362
|
-
const steps: string[] = [];
|
|
363
|
-
|
|
364
|
-
steps.push(`Validate token name "${args.tokenName}" is available using ${MCP_TOOLS.CHECK_TOKEN_NAME}`);
|
|
365
|
-
steps.push(`Validate token symbol "${args.tokenSymbol}" is available using ${MCP_TOOLS.CHECK_TOKEN_SYMBOL}`);
|
|
366
|
-
steps.push(`Check launch fee using ${MCP_TOOLS.FETCH_LAUNCH_TOKEN_FEE}`);
|
|
367
|
-
steps.push(`Check my GALA balance using ${MCP_TOOLS.FETCH_GALA_BALANCE}`);
|
|
368
|
-
|
|
369
|
-
if (args.imagePath) {
|
|
370
|
-
steps.push(
|
|
371
|
-
`Upload token image from path "${args.imagePath}" using ${MCP_TOOLS.UPLOAD_TOKEN_IMAGE}`
|
|
372
|
-
);
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
if (args.preBuyGala) {
|
|
376
|
-
steps.push(
|
|
377
|
-
`Calculate initial buy for ${args.preBuyGala} GALA using ${MCP_TOOLS.CALCULATE_INITIAL_BUY}`
|
|
378
|
-
);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
steps.push(`Show complete cost breakdown:`);
|
|
382
|
-
steps.push(` - Launch fee`);
|
|
383
|
-
if (args.preBuyGala) {
|
|
384
|
-
steps.push(` - Pre-buy GALA amount`);
|
|
385
|
-
}
|
|
386
|
-
steps.push(` - Estimated total cost`);
|
|
387
|
-
steps.push(`Ask for confirmation before proceeding`);
|
|
388
|
-
|
|
389
|
-
steps.push(`If confirmed, launch token using ${MCP_TOOLS.LAUNCH_TOKEN} with:`);
|
|
390
|
-
steps.push(` - tokenName: "${args.tokenName}"`);
|
|
391
|
-
steps.push(` - tokenSymbol: "${args.tokenSymbol}"`);
|
|
392
|
-
steps.push(` - tokenDescription: "${args.description}"`);
|
|
393
|
-
if (args.imagePath) {
|
|
394
|
-
steps.push(` - tokenImage: [from uploaded image]`);
|
|
395
|
-
}
|
|
396
|
-
if (args.websiteUrl) {
|
|
397
|
-
steps.push(` - websiteUrl: "${args.websiteUrl}"`);
|
|
398
|
-
}
|
|
399
|
-
if (args.twitterUrl) {
|
|
400
|
-
steps.push(` - twitterUrl: "${args.twitterUrl}"`);
|
|
401
|
-
}
|
|
402
|
-
if (args.telegramUrl) {
|
|
403
|
-
steps.push(` - telegramUrl: "${args.telegramUrl}"`);
|
|
404
|
-
}
|
|
405
|
-
if (args.preBuyGala) {
|
|
406
|
-
steps.push(` - preBuyQuantity: [from calculation]`);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
steps.push(`After launch:`);
|
|
410
|
-
steps.push(` a. Get frontend URL using ${MCP_TOOLS.GET_URL_BY_TOKEN_NAME}`);
|
|
411
|
-
steps.push(` b. Verify token was created successfully`);
|
|
412
|
-
steps.push(` c. Provide token details and launch link`);
|
|
413
|
-
|
|
414
|
-
return `Help me create a new token on Gala Launchpad:
|
|
415
|
-
|
|
416
|
-
Token Name: ${args.tokenName}
|
|
417
|
-
Token Symbol: ${args.tokenSymbol}
|
|
418
|
-
Description: ${args.description}
|
|
419
|
-
${args.websiteUrl ? `Website: ${args.websiteUrl}` : ''}
|
|
420
|
-
${args.twitterUrl ? `Twitter: ${args.twitterUrl}` : ''}
|
|
421
|
-
${args.telegramUrl ? `Telegram: ${args.telegramUrl}` : ''}
|
|
422
|
-
${args.preBuyGala ? `Pre-buy GALA: ${args.preBuyGala}` : 'No pre-buy'}
|
|
423
|
-
|
|
424
|
-
Please follow this workflow:
|
|
425
|
-
|
|
426
|
-
${formatWorkflowSteps(steps)}
|
|
427
|
-
|
|
428
|
-
IMPORTANT: At least one social URL (website, Twitter, or Telegram) should be provided for token creation.`;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* Create token discovery workflow
|
|
433
|
-
*
|
|
434
|
-
* @param args - Discovery arguments (type, filters)
|
|
435
|
-
* @returns Complete discovery workflow
|
|
436
|
-
*/
|
|
437
|
-
export function createDiscoverTokensWorkflow(args: {
|
|
438
|
-
type: 'recent' | 'popular' | 'near-graduation';
|
|
439
|
-
minProgress?: string;
|
|
440
|
-
maxPrice?: string;
|
|
441
|
-
limit: number;
|
|
442
|
-
}): string {
|
|
443
|
-
const steps: string[] = [];
|
|
444
|
-
|
|
445
|
-
// Fetch pools
|
|
446
|
-
if (args.type === 'near-graduation') {
|
|
447
|
-
steps.push(`Fetch all pools using ${MCP_TOOLS.FETCH_ALL_POOLS} with type: 'recent'`);
|
|
448
|
-
} else {
|
|
449
|
-
steps.push(`Fetch ${args.type} pools using ${MCP_TOOLS.FETCH_ALL_POOLS} with type: '${args.type}'`);
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
// Calculate prices
|
|
453
|
-
steps.push(
|
|
454
|
-
`For each pool, calculate USD spot price using ${MCP_TOOLS.FETCH_LAUNCHPAD_TOKEN_SPOT_PRICE} with LOCAL mode for speed`
|
|
455
|
-
);
|
|
456
|
-
|
|
457
|
-
// Filter by progress if requested
|
|
458
|
-
if (args.type === 'near-graduation' || args.minProgress) {
|
|
459
|
-
steps.push(`Filter tokens by graduation progress (min: ${args.minProgress || '90'}%)`);
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
// Filter by price if requested
|
|
463
|
-
if (args.maxPrice) {
|
|
464
|
-
steps.push(`Filter tokens by maximum USD price: $${args.maxPrice}`);
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
// Sort and present
|
|
468
|
-
if (args.type === 'near-graduation') {
|
|
469
|
-
steps.push(`Sort by graduation progress (highest first)`);
|
|
470
|
-
} else if (args.type === 'popular') {
|
|
471
|
-
steps.push(`Sort by trading volume (highest first)`);
|
|
472
|
-
} else {
|
|
473
|
-
steps.push(`Sort by creation date (newest first)`);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
steps.push(`Present top ${args.limit} results with:`);
|
|
477
|
-
steps.push(` - Token name and symbol`);
|
|
478
|
-
steps.push(` - Current USD price`);
|
|
479
|
-
steps.push(` - 24h volume (if available)`);
|
|
480
|
-
steps.push(` - Graduation progress percentage`);
|
|
481
|
-
steps.push(` - Quick investment analysis`);
|
|
482
|
-
|
|
483
|
-
steps.push(`Suggest 2-3 most interesting opportunities based on filters`);
|
|
484
|
-
|
|
485
|
-
let typeDescription = '';
|
|
486
|
-
if (args.type === 'recent') {
|
|
487
|
-
typeDescription = 'Recently launched tokens';
|
|
488
|
-
} else if (args.type === 'popular') {
|
|
489
|
-
typeDescription = 'Most popular tokens by volume';
|
|
490
|
-
} else {
|
|
491
|
-
typeDescription = 'Tokens close to graduating the bonding curve';
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
return `Help me discover tokens on Gala Launchpad:
|
|
495
|
-
|
|
496
|
-
Discovery Type: ${typeDescription}
|
|
497
|
-
${args.minProgress ? `Min Graduation Progress: ${args.minProgress}%` : ''}
|
|
498
|
-
${args.maxPrice ? `Max Price: $${args.maxPrice}` : ''}
|
|
499
|
-
Limit: ${args.limit} tokens
|
|
500
|
-
|
|
501
|
-
Please follow this workflow:
|
|
502
|
-
|
|
503
|
-
${formatWorkflowSteps(steps)}
|
|
504
|
-
|
|
505
|
-
${createPerformanceNote()}
|
|
506
|
-
|
|
507
|
-
After presenting the results, ask if I'd like to:
|
|
508
|
-
- Analyze any specific token further (use /analyze-token)
|
|
509
|
-
- Buy tokens from the discovery list
|
|
510
|
-
- Set alerts for tokens near graduation`;
|
|
511
|
-
}
|