@gala-chain/launchpad-mcp-server 1.27.2 → 2.0.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 (73) hide show
  1. package/README.md +110 -18
  2. package/dist/generated/version.d.ts +1 -1
  3. package/dist/generated/version.d.ts.map +1 -1
  4. package/dist/generated/version.js +1 -1
  5. package/dist/generated/version.js.map +1 -1
  6. package/dist/prompts/advanced-pools.d.ts +18 -0
  7. package/dist/prompts/advanced-pools.d.ts.map +1 -0
  8. package/dist/prompts/advanced-pools.js +90 -0
  9. package/dist/prompts/advanced-pools.js.map +1 -0
  10. package/dist/prompts/index.d.ts +7 -5
  11. package/dist/prompts/index.d.ts.map +1 -1
  12. package/dist/prompts/index.js +12 -4
  13. package/dist/prompts/index.js.map +1 -1
  14. package/dist/prompts/liquidity-positions.d.ts +12 -0
  15. package/dist/prompts/liquidity-positions.d.ts.map +1 -1
  16. package/dist/prompts/liquidity-positions.js +80 -1
  17. package/dist/prompts/liquidity-positions.js.map +1 -1
  18. package/dist/prompts/monitoring.d.ts +23 -0
  19. package/dist/prompts/monitoring.d.ts.map +1 -0
  20. package/dist/prompts/monitoring.js +169 -0
  21. package/dist/prompts/monitoring.js.map +1 -0
  22. package/dist/schemas/common-schemas.d.ts +42 -0
  23. package/dist/schemas/common-schemas.d.ts.map +1 -1
  24. package/dist/schemas/common-schemas.js +43 -1
  25. package/dist/schemas/common-schemas.js.map +1 -1
  26. package/dist/tools/balance/all-assets.d.ts +9 -0
  27. package/dist/tools/balance/all-assets.d.ts.map +1 -0
  28. package/dist/tools/balance/all-assets.js +104 -0
  29. package/dist/tools/balance/all-assets.js.map +1 -0
  30. package/dist/tools/dex/fetchAllDexPools.d.ts.map +1 -1
  31. package/dist/tools/dex/fetchAllDexPools.js +5 -0
  32. package/dist/tools/dex/fetchAllDexPools.js.map +1 -1
  33. package/dist/tools/dex/index.js +1 -1
  34. package/dist/tools/dex/index.js.map +1 -1
  35. package/dist/tools/dex/liquidity-positions.d.ts +1 -0
  36. package/dist/tools/dex/liquidity-positions.d.ts.map +1 -1
  37. package/dist/tools/dex/liquidity-positions.js +103 -29
  38. package/dist/tools/dex/liquidity-positions.js.map +1 -1
  39. package/dist/tools/dex/pool-price.d.ts +9 -0
  40. package/dist/tools/dex/pool-price.d.ts.map +1 -0
  41. package/dist/tools/dex/pool-price.js +78 -0
  42. package/dist/tools/dex/pool-price.js.map +1 -0
  43. package/dist/tools/dex/pool-quote-calculation.d.ts +9 -0
  44. package/dist/tools/dex/pool-quote-calculation.d.ts.map +1 -0
  45. package/dist/tools/dex/pool-quote-calculation.js +99 -0
  46. package/dist/tools/dex/pool-quote-calculation.js.map +1 -0
  47. package/dist/tools/dex/pool-quote-external.d.ts +10 -0
  48. package/dist/tools/dex/pool-quote-external.d.ts.map +1 -0
  49. package/dist/tools/dex/pool-quote-external.js +84 -0
  50. package/dist/tools/dex/pool-quote-external.js.map +1 -0
  51. package/dist/tools/dex/pool-quote-local.d.ts +10 -0
  52. package/dist/tools/dex/pool-quote-local.d.ts.map +1 -0
  53. package/dist/tools/dex/pool-quote-local.js +84 -0
  54. package/dist/tools/dex/pool-quote-local.js.map +1 -0
  55. package/dist/tools/dex/position-direct.d.ts +9 -0
  56. package/dist/tools/dex/position-direct.d.ts.map +1 -0
  57. package/dist/tools/dex/position-direct.js +65 -0
  58. package/dist/tools/dex/position-direct.js.map +1 -0
  59. package/dist/tools/index.d.ts +9 -9
  60. package/dist/tools/index.js +10 -10
  61. package/dist/tools/pools/composite-pool.d.ts +9 -0
  62. package/dist/tools/pools/composite-pool.d.ts.map +1 -0
  63. package/dist/tools/pools/composite-pool.js +69 -0
  64. package/dist/tools/pools/composite-pool.js.map +1 -0
  65. package/dist/tools/utils/cleanup.d.ts +9 -0
  66. package/dist/tools/utils/cleanup.d.ts.map +1 -0
  67. package/dist/tools/utils/cleanup.js +54 -0
  68. package/dist/tools/utils/cleanup.js.map +1 -0
  69. package/dist/tools/utils/faucet.d.ts +10 -0
  70. package/dist/tools/utils/faucet.d.ts.map +1 -0
  71. package/dist/tools/utils/faucet.js +51 -0
  72. package/dist/tools/utils/faucet.js.map +1 -0
  73. package/package.json +1 -1
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ /**
3
+ * DEX Pool Quote Local Tool
4
+ *
5
+ * Calculate DEX pool swap quotes using LOCAL/offline bonding curve formulas.
6
+ * Provides instant client-side calculation without network call to GalaChain.
7
+ * Requires composite pool data to be fetched first.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.calculateDexPoolQuoteLocalTool = void 0;
11
+ const response_formatter_js_1 = require("../../utils/response-formatter.js");
12
+ const error_handler_js_1 = require("../../utils/error-handler.js");
13
+ // Token schema for quote calculations
14
+ const TOKEN_SCHEMA = {
15
+ type: 'string',
16
+ minLength: 1,
17
+ description: 'Token identifier in delimited format (e.g., "GALA|Unit|none|none" or "Token|Unit|GUSDC|eth:0x...")',
18
+ };
19
+ // Fee tier schema
20
+ const FEE_TIER_SCHEMA = {
21
+ type: 'number',
22
+ enum: [500, 3000, 10000],
23
+ description: 'Fee tier in basis points: 500 (0.05%), 3000 (0.30%), 10000 (1.00%)',
24
+ };
25
+ // Amount schema
26
+ const AMOUNT_SCHEMA = {
27
+ type: 'string',
28
+ pattern: '^\\d+(\\.\\d+)?$',
29
+ description: 'Amount to swap (as decimal string, e.g., "10.5")',
30
+ };
31
+ exports.calculateDexPoolQuoteLocalTool = {
32
+ name: 'gala_launchpad_calculate_dex_pool_quote_local',
33
+ description: 'Calculate DEX pool swap quotes using LOCAL offline formulas (no network call). Instant client-side calculation. Requires fetching composite pool data first with token0, token1, and fee tier.',
34
+ inputSchema: {
35
+ type: 'object',
36
+ properties: {
37
+ token0: TOKEN_SCHEMA,
38
+ token1: TOKEN_SCHEMA,
39
+ fee: FEE_TIER_SCHEMA,
40
+ fromToken: TOKEN_SCHEMA,
41
+ toToken: TOKEN_SCHEMA,
42
+ amount: AMOUNT_SCHEMA,
43
+ },
44
+ required: ['token0', 'token1', 'fee', 'fromToken', 'toToken', 'amount'],
45
+ },
46
+ handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
47
+ // First fetch composite pool data
48
+ const compositeData = await sdk.fetchCompositePoolData({
49
+ token0: args.token0,
50
+ token1: args.token1,
51
+ fee: args.fee,
52
+ });
53
+ // Calculate quote using LOCAL method (instant, offline)
54
+ const quote = await sdk.calculateDexPoolQuoteExactAmountLocal({
55
+ compositePoolData: compositeData,
56
+ fromToken: args.fromToken,
57
+ toToken: args.toToken,
58
+ amount: args.amount,
59
+ });
60
+ // Determine swap direction
61
+ const isToken0ToToken1 = args.fromToken === args.token0;
62
+ const inputAmount = args.amount;
63
+ const outputAmount = isToken0ToToken1 ? quote.amount1 : quote.amount0;
64
+ // Calculate price impact if provided
65
+ const priceImpact = quote.priceImpact || 'N/A';
66
+ const executionPrice = quote.executionPrice || 'N/A';
67
+ return (0, response_formatter_js_1.formatSuccess)({
68
+ poolId: `${args.token0}-${args.token1}-${args.fee}`,
69
+ fromToken: args.fromToken,
70
+ toToken: args.toToken,
71
+ inputAmount: inputAmount,
72
+ outputAmount: outputAmount,
73
+ prices: {
74
+ currentSqrtPrice: quote.currentSqrtPrice,
75
+ newSqrtPrice: quote.newSqrtPrice,
76
+ executionPrice: executionPrice,
77
+ priceImpact: priceImpact,
78
+ },
79
+ calculationMode: 'local',
80
+ message: `LOCAL quote: Swapping ${inputAmount} ${args.fromToken.split('|')[2] || args.fromToken} will yield ${outputAmount} ${args.toToken.split('|')[2] || args.toToken} (instant, offline calculation)`,
81
+ });
82
+ }),
83
+ };
84
+ //# sourceMappingURL=pool-quote-local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool-quote-local.js","sourceRoot":"","sources":["../../../src/tools/dex/pool-quote-local.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAGH,6EAAkE;AAClE,mEAAiE;AAEjE,sCAAsC;AACtC,MAAM,YAAY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direct data access.
5
+ * Useful for portfolio management when you know the specific position ID.
6
+ */
7
+ import type { MCPTool } from '../../types/mcp.js';
8
+ export declare const fetchSwapPositionByIdTool: MCPTool;
9
+ //# sourceMappingURL=position-direct.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position-direct.d.ts","sourceRoot":"","sources":["../../../src/tools/dex/position-direct.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAYlD,eAAO,MAAM,yBAAyB,EAAE,OA+CvC,CAAC"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ /**
3
+ * Swap Position Direct Tool
4
+ *
5
+ * Fetch LP position details by position ID with direct data access.
6
+ * Useful for portfolio management when you know the specific position ID.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.fetchSwapPositionByIdTool = void 0;
10
+ const response_formatter_js_1 = require("../../utils/response-formatter.js");
11
+ const error_handler_js_1 = require("../../utils/error-handler.js");
12
+ const common_schemas_js_1 = require("../../schemas/common-schemas.js");
13
+ // Position ID schema
14
+ const POSITION_ID_SCHEMA = {
15
+ type: 'string',
16
+ minLength: 1,
17
+ description: 'Unique position identifier (e.g., "pos-abc123" or position ID from getSwapLiquidityPositions)',
18
+ };
19
+ exports.fetchSwapPositionByIdTool = {
20
+ name: 'gala_launchpad_fetch_swap_position_by_id',
21
+ description: 'Fetch LP position details by position ID (alternative to compound key lookup). Retrieves specific liquidity position by its unique identifier. Useful when you have the position ID from getSwapLiquidityPositions.',
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ positionId: POSITION_ID_SCHEMA,
26
+ ownerAddress: {
27
+ ...common_schemas_js_1.ADDRESS_SCHEMA,
28
+ description: 'Wallet address that owns the position (e.g., "eth|0x123..." or "0x123...")',
29
+ },
30
+ },
31
+ required: ['positionId', 'ownerAddress'],
32
+ },
33
+ handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
34
+ // Get position by ID
35
+ const position = await sdk.getSwapLiquidityPositionById(args.ownerAddress, args.positionId);
36
+ if (!position) {
37
+ return (0, response_formatter_js_1.formatSuccess)({
38
+ positionId: args.positionId,
39
+ ownerAddress: args.ownerAddress,
40
+ found: false,
41
+ message: `Position ${args.positionId} not found for owner ${args.ownerAddress}`,
42
+ });
43
+ }
44
+ // Format position details for display
45
+ return (0, response_formatter_js_1.formatSuccess)({
46
+ positionId: args.positionId,
47
+ ownerAddress: args.ownerAddress,
48
+ found: true,
49
+ position: {
50
+ token0: position.token0,
51
+ token1: position.token1,
52
+ feeTier: position.feeTier,
53
+ tickLower: position.tickLower,
54
+ tickUpper: position.tickUpper,
55
+ liquidity: position.liquidity,
56
+ amount0: position.amount0,
57
+ amount1: position.amount1,
58
+ feeAmount0: position.feeAmount0,
59
+ feeAmount1: position.feeAmount1,
60
+ },
61
+ message: `Position ${args.positionId} found: ${position.token0}/${position.token1} (fee: ${position.feeTier}, liquidity: ${position.liquidity})`,
62
+ });
63
+ }),
64
+ };
65
+ //# sourceMappingURL=position-direct.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position-direct.js","sourceRoot":"","sources":["../../../src/tools/dex/position-direct.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,6EAAkE;AAClE,mEAAiE;AACjE,uEAAiE;AAEjE,qBAAqB;AACrB,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,+FAA+F;CAC7G,CAAC;AAEW,QAAA,yBAAyB,GAAY;IAChD,IAAI,EAAE,0CAA0C;IAChD,WAAW,EAAE,qNAAqN;IAClO,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE,kBAAkB;YAC9B,YAAY,EAAE;gBACZ,GAAG,kCAAc;gBACjB,WAAW,EAAE,4EAA4E;aAC1F;SACF;QACD,QAAQ,EAAE,CAAC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,CAAC;IACL,CAAC,CAAC;CACH,CAAC"}
@@ -7,15 +7,15 @@
7
7
  * @see src/utils/tool-registry.ts
8
8
  */
9
9
  /**
10
- * Enhanced tool registry with validation (76 tools total):
11
- * - Pools: 19 tools (17 + 2 watchers: onDexPoolCreation, onLaunchpadTokenCreation)
12
- * - Trading: 13 tools
13
- * - DEX/GalaSwap: 15 tools (5 swap + 8 liquidity + 2 pool discovery)
14
- * - Balance: 6 tools
15
- * - Creation: 4 tools
16
- * - Social: 2 tools
17
- * - Transfers: 2 tools
18
- * - Utilities: 15 tools (config, version, environment switching, wallet mgmt, etc.)
10
+ * Enhanced tool registry with validation (88 tools total):
11
+ * - Pools: 22 tools (pool operations + 2 watchers: onDexPoolCreation, onLaunchpadTokenCreation)
12
+ * - Trading: 13 tools (buy, sell, calculate amounts, graduation)
13
+ * - DEX/GalaSwap: 22 tools (5 swap + 10 liquidity + 2 pool discovery + 3 quote calc + 2 position mgmt)
14
+ * - Balance: 8 tools (balance queries + supply tracking)
15
+ * - Creation: 4 tools (token creation and launch)
16
+ * - Social: 2 tools (comments and interactions)
17
+ * - Transfers: 2 tools (GALA and token transfers)
18
+ * - Utilities: 17 tools (config, version, environment, wallet, faucet, cleanup, etc.)
19
19
  */
20
20
  export declare const registry: import("../utils/tool-registry.js").ToolRegistry;
21
21
  /**
@@ -64,17 +64,17 @@ const toolCategories = [
64
64
  },
65
65
  ];
66
66
  /**
67
- * Enhanced tool registry with validation (76 tools total):
68
- * - Pools: 19 tools (17 + 2 watchers: onDexPoolCreation, onLaunchpadTokenCreation)
69
- * - Trading: 13 tools
70
- * - DEX/GalaSwap: 15 tools (5 swap + 8 liquidity + 2 pool discovery)
71
- * - Balance: 6 tools
72
- * - Creation: 4 tools
73
- * - Social: 2 tools
74
- * - Transfers: 2 tools
75
- * - Utilities: 15 tools (config, version, environment switching, wallet mgmt, etc.)
67
+ * Enhanced tool registry with validation (88 tools total):
68
+ * - Pools: 22 tools (pool operations + 2 watchers: onDexPoolCreation, onLaunchpadTokenCreation)
69
+ * - Trading: 13 tools (buy, sell, calculate amounts, graduation)
70
+ * - DEX/GalaSwap: 22 tools (5 swap + 10 liquidity + 2 pool discovery + 3 quote calc + 2 position mgmt)
71
+ * - Balance: 8 tools (balance queries + supply tracking)
72
+ * - Creation: 4 tools (token creation and launch)
73
+ * - Social: 2 tools (comments and interactions)
74
+ * - Transfers: 2 tools (GALA and token transfers)
75
+ * - Utilities: 17 tools (config, version, environment, wallet, faucet, cleanup, etc.)
76
76
  */
77
- exports.registry = (0, tool_registry_js_1.createToolRegistry)(toolCategories, 76);
77
+ exports.registry = (0, tool_registry_js_1.createToolRegistry)(toolCategories, 88);
78
78
  /**
79
79
  * Complete tool array (for backward compatibility)
80
80
  */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Composite Pool Data Tool
3
+ *
4
+ * Fetches complete DEX pool state including tick data for offline quote calculations.
5
+ * Returns pool liquidity, tick map, and token balances for local price simulations.
6
+ */
7
+ import type { MCPTool } from '../../types/mcp.js';
8
+ export declare const fetchCompositePoolDataTool: MCPTool;
9
+ //# sourceMappingURL=composite-pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composite-pool.d.ts","sourceRoot":"","sources":["../../../src/tools/pools/composite-pool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAkBlD,eAAO,MAAM,0BAA0B,EAAE,OA8CxC,CAAC"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ /**
3
+ * Composite Pool Data Tool
4
+ *
5
+ * Fetches complete DEX pool state including tick data for offline quote calculations.
6
+ * Returns pool liquidity, tick map, and token balances for local price simulations.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.fetchCompositePoolDataTool = void 0;
10
+ const response_formatter_js_1 = require("../../utils/response-formatter.js");
11
+ const error_handler_js_1 = require("../../utils/error-handler.js");
12
+ // Token symbol schema for DEX operations
13
+ const TOKEN_SCHEMA = {
14
+ type: 'string',
15
+ minLength: 1,
16
+ description: 'Token identifier (e.g., "GALA|Unit|none|none" or "Token|Unit|GUSDC|eth:0x...")',
17
+ };
18
+ // Fee tier schema
19
+ const FEE_TIER_SCHEMA = {
20
+ type: 'number',
21
+ enum: [500, 3000, 10000],
22
+ description: 'Fee tier in basis points: 500 (0.05%), 3000 (0.30%), 10000 (1.00%)',
23
+ };
24
+ exports.fetchCompositePoolDataTool = {
25
+ name: 'gala_launchpad_fetch_composite_pool_data',
26
+ description: 'Fetch complete DEX pool state for offline quote calculations. Returns pool liquidity, tick data, and token balances required for local price simulations.',
27
+ inputSchema: {
28
+ type: 'object',
29
+ properties: {
30
+ token0: TOKEN_SCHEMA,
31
+ token1: TOKEN_SCHEMA,
32
+ fee: FEE_TIER_SCHEMA,
33
+ gatewayBaseUrl: {
34
+ type: 'string',
35
+ description: 'Optional custom gateway URL (defaults to mainnet)',
36
+ },
37
+ },
38
+ required: ['token0', 'token1', 'fee'],
39
+ },
40
+ handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
41
+ // Fetch composite pool data using SDK method
42
+ const compositeData = await sdk.fetchCompositePoolData({
43
+ token0: args.token0,
44
+ token1: args.token1,
45
+ fee: args.fee,
46
+ gatewayBaseUrl: args.gatewayBaseUrl,
47
+ });
48
+ // Extract key pool metrics
49
+ const poolMetrics = {
50
+ liquidity: compositeData.pool.liquidity,
51
+ sqrtPrice: compositeData.pool.sqrtPrice,
52
+ tick: compositeData.pool.tick,
53
+ feeRate: compositeData.pool.fee,
54
+ token0Balance: compositeData.token0Balance.getQuantityTotal().toString(),
55
+ token1Balance: compositeData.token1Balance.getQuantityTotal().toString(),
56
+ token0Decimals: compositeData.token0Decimals,
57
+ token1Decimals: compositeData.token1Decimals,
58
+ tickCount: Object.keys(compositeData.tickDataMap).length,
59
+ };
60
+ return (0, response_formatter_js_1.formatSuccess)({
61
+ poolId: `${args.token0}-${args.token1}-${args.fee}`,
62
+ pool: poolMetrics,
63
+ hasLiquidity: Number(poolMetrics.liquidity) > 0,
64
+ tickDataAvailable: poolMetrics.tickCount > 0,
65
+ message: `Composite pool data fetched successfully. Pool has ${poolMetrics.tickCount} active ticks with ${poolMetrics.liquidity} total liquidity.`,
66
+ });
67
+ }),
68
+ };
69
+ //# sourceMappingURL=composite-pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composite-pool.js","sourceRoot":"","sources":["../../../src/tools/pools/composite-pool.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,6EAAkE;AAClE,mEAAiE;AAEjE,yCAAyC;AACzC,MAAM,YAAY,GAAG;IACnB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,gFAAgF;CAC9F,CAAC;AAEF,kBAAkB;AAClB,MAAM,eAAe,GAAG;IACtB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC;IACxB,WAAW,EAAE,oEAAoE;CAClF,CAAC;AAEW,QAAA,0BAA0B,GAAY;IACjD,IAAI,EAAE,0CAA0C;IAChD,WAAW,EAAE,2JAA2J;IACxK,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE,YAAY;YACpB,MAAM,EAAE,YAAY;YACpB,GAAG,EAAE,eAAe;YACpB,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mDAAmD;aACjE;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC;KACtC;IACD,OAAO,EAAE,IAAA,oCAAiB,EAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC7C,6CAA6C;QAC7C,MAAM,aAAa,GAAG,MAAM,GAAG,CAAC,sBAAsB,CAAC;YACrD,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,cAAc,EAAE,IAAI,CAAC,cAAc;SACpC,CAAC,CAAC;QAEH,2BAA2B;QAC3B,MAAM,WAAW,GAAG;YAClB,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,SAAS;YACvC,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,SAAS;YACvC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,IAAI;YAC7B,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG;YAC/B,aAAa,EAAE,aAAa,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAE;YACxE,aAAa,EAAE,aAAa,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAE;YACxE,cAAc,EAAE,aAAa,CAAC,cAAc;YAC5C,cAAc,EAAE,aAAa,CAAC,cAAc;YAC5C,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,MAAM;SACzD,CAAC;QAEF,OAAO,IAAA,qCAAa,EAAC;YACnB,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE;YACnD,IAAI,EAAE,WAAW;YACjB,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC;YAC/C,iBAAiB,EAAE,WAAW,CAAC,SAAS,GAAG,CAAC;YAC5C,OAAO,EAAE,sDAAsD,WAAW,CAAC,SAAS,sBAAsB,WAAW,CAAC,SAAS,mBAAmB;SACnJ,CAAC,CAAC;IACL,CAAC,CAAC;CACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Cleanup Tool
3
+ *
4
+ * SDK lifecycle cleanup - clears cache, closes connections, resets state.
5
+ * Called during application shutdown to release resources properly.
6
+ */
7
+ import type { MCPTool } from '../../types/mcp.js';
8
+ export declare const cleanupTool: MCPTool;
9
+ //# sourceMappingURL=cleanup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/cleanup.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,eAAO,MAAM,WAAW,EAAE,OA6CzB,CAAC"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /**
3
+ * Cleanup Tool
4
+ *
5
+ * SDK lifecycle cleanup - clears cache, closes connections, resets state.
6
+ * Called during application shutdown to release resources properly.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.cleanupTool = void 0;
10
+ const error_handler_js_1 = require("../../utils/error-handler.js");
11
+ const response_formatter_js_1 = require("../../utils/response-formatter.js");
12
+ exports.cleanupTool = {
13
+ name: 'gala_launchpad_cleanup',
14
+ description: 'SDK lifecycle cleanup - clears cache, closes connections, and resets state. Use during application shutdown or testing teardown to properly release resources.',
15
+ inputSchema: {
16
+ type: 'object',
17
+ properties: {
18
+ clearCache: {
19
+ type: 'boolean',
20
+ description: 'Whether to clear metadata cache (defaults to true)',
21
+ default: true,
22
+ },
23
+ closeConnections: {
24
+ type: 'boolean',
25
+ description: 'Whether to close WebSocket connections (defaults to true)',
26
+ default: true,
27
+ },
28
+ },
29
+ },
30
+ handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
31
+ const shouldClearCache = args?.clearCache !== false; // Default to true
32
+ const shouldCloseConnections = args?.closeConnections !== false; // Default to true
33
+ const operations = [];
34
+ // Clear cache if requested
35
+ if (shouldClearCache) {
36
+ sdk.clearCache(); // Clears all token metadata
37
+ operations.push('Cache cleared');
38
+ }
39
+ // Close connections if requested (always happens in cleanup)
40
+ if (shouldCloseConnections) {
41
+ await sdk.cleanup(); // Cleanup HTTP interceptors and WebSocket references
42
+ operations.push('Connections closed');
43
+ }
44
+ return (0, response_formatter_js_1.formatSuccess)({
45
+ success: true,
46
+ operations: operations,
47
+ clearedCache: shouldClearCache,
48
+ closedConnections: shouldCloseConnections,
49
+ message: `SDK cleanup completed: ${operations.join(', ')}`,
50
+ note: 'SDK instance is still usable and will reconnect automatically if needed',
51
+ });
52
+ }),
53
+ };
54
+ //# sourceMappingURL=cleanup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../../../src/tools/utils/cleanup.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,mEAAiE;AACjE,6EAAkE;AAGrD,QAAA,WAAW,GAAY;IAClC,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,gKAAgK;IAC7K,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,oDAAoD;gBACjE,OAAO,EAAE,IAAI;aACd;YACD,gBAAgB,EAAE;gBAChB,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,2DAA2D;gBACxE,OAAO,EAAE,IAAI;aACd;SACF;KACF;IACD,OAAO,EAAE,IAAA,oCAAiB,EAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC7C,MAAM,gBAAgB,GAAG,IAAI,EAAE,UAAU,KAAK,KAAK,CAAC,CAAC,kBAAkB;QACvE,MAAM,sBAAsB,GAAG,IAAI,EAAE,gBAAgB,KAAK,KAAK,CAAC,CAAC,kBAAkB;QAEnF,MAAM,UAAU,GAAa,EAAE,CAAC;QAEhC,2BAA2B;QAC3B,IAAI,gBAAgB,EAAE,CAAC;YACrB,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,4BAA4B;YAC9C,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACnC,CAAC;QAED,6DAA6D;QAC7D,IAAI,sBAAsB,EAAE,CAAC;YAC3B,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,qDAAqD;YAC1E,UAAU,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACxC,CAAC;QAED,OAAO,IAAA,qCAAa,EAAC;YACnB,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,UAAU;YACtB,YAAY,EAAE,gBAAgB;YAC9B,iBAAiB,EAAE,sBAAsB;YACzC,OAAO,EAAE,0BAA0B,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC1D,IAAI,EAAE,yEAAyE;SAChF,CAAC,CAAC;IACL,CAAC,CAAC;CACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Faucet Tool
3
+ *
4
+ * Test utility to retrieve GALA tokens from faucet.
5
+ * Only works in development/testing environments (production blocked).
6
+ * Backend provides a fixed amount (5 GALA).
7
+ */
8
+ import type { MCPTool } from '../../types/mcp.js';
9
+ export declare const retrieveFromFaucetTool: MCPTool;
10
+ //# sourceMappingURL=faucet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"faucet.d.ts","sourceRoot":"","sources":["../../../src/tools/utils/faucet.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,eAAO,MAAM,sBAAsB,EAAE,OAyCpC,CAAC"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /**
3
+ * Faucet Tool
4
+ *
5
+ * Test utility to retrieve GALA tokens from faucet.
6
+ * Only works in development/testing environments (production blocked).
7
+ * Backend provides a fixed amount (5 GALA).
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.retrieveFromFaucetTool = void 0;
11
+ const error_handler_js_1 = require("../../utils/error-handler.js");
12
+ const response_formatter_js_1 = require("../../utils/response-formatter.js");
13
+ const common_schemas_js_1 = require("../../schemas/common-schemas.js");
14
+ exports.retrieveFromFaucetTool = {
15
+ name: 'gala_launchpad_retrieve_from_faucet',
16
+ description: 'Test utility to retrieve GALA tokens from faucet (dev/test environments only). Backend provides fixed amount of 5 GALA. Production environment will reject this request.',
17
+ inputSchema: {
18
+ type: 'object',
19
+ properties: {
20
+ recipientAddress: {
21
+ ...common_schemas_js_1.ADDRESS_SCHEMA,
22
+ description: 'Wallet address to receive faucet tokens (defaults to SDK authenticated wallet if not provided)',
23
+ },
24
+ },
25
+ },
26
+ handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
27
+ const recipientAddress = args?.recipientAddress;
28
+ try {
29
+ // Call SDK faucet method (defaults to SDK wallet if no address provided)
30
+ await sdk.retrieveGalaFromFaucet(recipientAddress);
31
+ const finalAddress = recipientAddress || sdk.getAddress();
32
+ return (0, response_formatter_js_1.formatSuccess)({
33
+ success: true,
34
+ recipientAddress: finalAddress,
35
+ amount: '5',
36
+ token: 'GALA',
37
+ message: `Successfully retrieved 5 GALA from faucet to ${finalAddress}`,
38
+ warning: 'This only works in development/testing environments',
39
+ });
40
+ }
41
+ catch (error) {
42
+ // Enhanced error message for production environment
43
+ if (error instanceof Error && error.message.includes('production')) {
44
+ throw new Error('Faucet is only available in development/testing environments. Production environment does not support faucet operations.');
45
+ }
46
+ // Re-throw other errors
47
+ throw error;
48
+ }
49
+ }),
50
+ };
51
+ //# sourceMappingURL=faucet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"faucet.js","sourceRoot":"","sources":["../../../src/tools/utils/faucet.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,mEAAiE;AACjE,6EAAkE;AAClE,uEAAiE;AAGpD,QAAA,sBAAsB,GAAY;IAC7C,IAAI,EAAE,qCAAqC;IAC3C,WAAW,EAAE,0KAA0K;IACvL,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,gBAAgB,EAAE;gBAChB,GAAG,kCAAc;gBACjB,WAAW,EAAE,gGAAgG;aAC9G;SACF;KACF;IACD,OAAO,EAAE,IAAA,oCAAiB,EAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC7C,MAAM,gBAAgB,GAAG,IAAI,EAAE,gBAAgB,CAAC;QAEhD,IAAI,CAAC;YACH,yEAAyE;YACzE,MAAM,GAAG,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;YAEnD,MAAM,YAAY,GAAG,gBAAgB,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC;YAE1D,OAAO,IAAA,qCAAa,EAAC;gBACnB,OAAO,EAAE,IAAI;gBACb,gBAAgB,EAAE,YAAY;gBAC9B,MAAM,EAAE,GAAG;gBACX,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE,gDAAgD,YAAY,EAAE;gBACvE,OAAO,EAAE,qDAAqD;aAC/D,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,oDAAoD;YACpD,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;gBACnE,MAAM,IAAI,KAAK,CACb,0HAA0H,CAC3H,CAAC;YACJ,CAAC;YAED,wBAAwB;YACxB,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC;CACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gala-chain/launchpad-mcp-server",
3
- "version": "1.27.2",
3
+ "version": "2.0.0",
4
4
  "description": "MCP server for Gala Launchpad - 76 tools (pool management, event watchers, GSwap DEX trading, price history, token creation, wallet management, DEX pool discovery) supporting optional wallet (read-only and full-access modes). Production-grade AI agent integration for Claude Desktop with comprehensive validation and 80%+ test coverage",
5
5
  "main": "dist/index.js",
6
6
  "bin": {