@gala-chain/launchpad-mcp-server 5.1.1 → 7.0.0-beta.2

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 (131) hide show
  1. package/README.md +57 -113
  2. package/dist/constants/mcpToolNames.d.ts +2 -2
  3. package/dist/constants/mcpToolNames.d.ts.map +1 -1
  4. package/dist/constants/mcpToolNames.js +1 -1
  5. package/dist/constants/mcpToolNames.js.map +1 -1
  6. package/dist/generated/version.d.ts +1 -1
  7. package/dist/generated/version.d.ts.map +1 -1
  8. package/dist/generated/version.js +1 -1
  9. package/dist/generated/version.js.map +1 -1
  10. package/dist/prompts/analysis.d.ts.map +1 -1
  11. package/dist/prompts/analysis.js +5 -13
  12. package/dist/prompts/analysis.js.map +1 -1
  13. package/dist/prompts/dex-trading.d.ts.map +1 -1
  14. package/dist/prompts/dex-trading.js +10 -8
  15. package/dist/prompts/dex-trading.js.map +1 -1
  16. package/dist/prompts/manifest.d.ts +2 -2
  17. package/dist/prompts/manifest.d.ts.map +1 -1
  18. package/dist/prompts/manifest.js +5 -12
  19. package/dist/prompts/manifest.js.map +1 -1
  20. package/dist/prompts/tier1-token-analysis.d.ts +0 -4
  21. package/dist/prompts/tier1-token-analysis.d.ts.map +1 -1
  22. package/dist/prompts/tier1-token-analysis.js +2 -87
  23. package/dist/prompts/tier1-token-analysis.js.map +1 -1
  24. package/dist/prompts/utility-tools.js +1 -1
  25. package/dist/prompts/utility-tools.js.map +1 -1
  26. package/dist/prompts/utility.d.ts +1 -1
  27. package/dist/prompts/utility.d.ts.map +1 -1
  28. package/dist/prompts/utility.js +7 -8
  29. package/dist/prompts/utility.js.map +1 -1
  30. package/dist/scripts/test-all-prompts.js +2 -44
  31. package/dist/scripts/test-all-prompts.js.map +1 -1
  32. package/dist/server.d.ts +4 -3
  33. package/dist/server.d.ts.map +1 -1
  34. package/dist/server.js +13 -6
  35. package/dist/server.js.map +1 -1
  36. package/dist/tools/chat/index.d.ts +0 -14
  37. package/dist/tools/chat/index.d.ts.map +1 -1
  38. package/dist/tools/chat/index.js +1 -79
  39. package/dist/tools/chat/index.js.map +1 -1
  40. package/dist/tools/creation/index.d.ts.map +1 -1
  41. package/dist/tools/creation/index.js +10 -2
  42. package/dist/tools/creation/index.js.map +1 -1
  43. package/dist/tools/dex/helpers.d.ts +20 -419
  44. package/dist/tools/dex/helpers.d.ts.map +1 -1
  45. package/dist/tools/dex/helpers.js +127 -542
  46. package/dist/tools/dex/helpers.js.map +1 -1
  47. package/dist/tools/dex/index.d.ts +2 -51
  48. package/dist/tools/dex/index.d.ts.map +1 -1
  49. package/dist/tools/dex/index.js +144 -131
  50. package/dist/tools/dex/index.js.map +1 -1
  51. package/dist/tools/dex-liquidity/index.d.ts +1 -9
  52. package/dist/tools/dex-liquidity/index.d.ts.map +1 -1
  53. package/dist/tools/dex-liquidity/index.js +107 -310
  54. package/dist/tools/dex-liquidity/index.js.map +1 -1
  55. package/dist/tools/dex-pools/index.d.ts +1 -50
  56. package/dist/tools/dex-pools/index.d.ts.map +1 -1
  57. package/dist/tools/dex-pools/index.js +69 -173
  58. package/dist/tools/dex-pools/index.js.map +1 -1
  59. package/dist/tools/global-feed/getGlobalFeedStatus.d.ts.map +1 -1
  60. package/dist/tools/global-feed/getGlobalFeedStatus.js +2 -3
  61. package/dist/tools/global-feed/getGlobalFeedStatus.js.map +1 -1
  62. package/dist/tools/global-feed/monitorGlobalFeedEvents.d.ts.map +1 -1
  63. package/dist/tools/global-feed/monitorGlobalFeedEvents.js +2 -3
  64. package/dist/tools/global-feed/monitorGlobalFeedEvents.js.map +1 -1
  65. package/dist/tools/global-feed/subscribeToGlobalFeed.d.ts.map +1 -1
  66. package/dist/tools/global-feed/subscribeToGlobalFeed.js +3 -4
  67. package/dist/tools/global-feed/subscribeToGlobalFeed.js.map +1 -1
  68. package/dist/tools/global-feed/unsubscribeFromGlobalFeed.js +3 -3
  69. package/dist/tools/global-feed/unsubscribeFromGlobalFeed.js.map +1 -1
  70. package/dist/tools/handler-factories.d.ts +27 -15
  71. package/dist/tools/handler-factories.d.ts.map +1 -1
  72. package/dist/tools/handler-factories.js +58 -23
  73. package/dist/tools/handler-factories.js.map +1 -1
  74. package/dist/tools/index.d.ts.map +1 -1
  75. package/dist/tools/index.js +16 -49
  76. package/dist/tools/index.js.map +1 -1
  77. package/dist/tools/manifest.d.ts +3 -3
  78. package/dist/tools/manifest.d.ts.map +1 -1
  79. package/dist/tools/manifest.js +242 -98
  80. package/dist/tools/manifest.js.map +1 -1
  81. package/dist/tools/messages/getPinnedMessage.d.ts +1 -1
  82. package/dist/tools/messages/getPinnedMessage.js +1 -1
  83. package/dist/tools/messages/index.d.ts +1 -1
  84. package/dist/tools/messages/index.js +1 -1
  85. package/dist/tools/messages/pinMessage.d.ts +1 -1
  86. package/dist/tools/messages/pinMessage.js +1 -1
  87. package/dist/tools/messages/unpinMessage.d.ts +1 -1
  88. package/dist/tools/messages/unpinMessage.js +1 -1
  89. package/dist/tools/pagination-handler-factory.d.ts +6 -6
  90. package/dist/tools/pagination-handler-factory.js +6 -6
  91. package/dist/tools/pools/index.d.ts +0 -1
  92. package/dist/tools/pools/index.d.ts.map +1 -1
  93. package/dist/tools/pools/index.js +4 -11
  94. package/dist/tools/pools/index.js.map +1 -1
  95. package/dist/tools/trading/index.d.ts.map +1 -1
  96. package/dist/tools/trading/index.js +37 -4
  97. package/dist/tools/trading/index.js.map +1 -1
  98. package/dist/tools/utils/explainSdkUsage.d.ts +3 -104
  99. package/dist/tools/utils/explainSdkUsage.d.ts.map +1 -1
  100. package/dist/tools/utils/explainSdkUsage.js +301 -7036
  101. package/dist/tools/utils/explainSdkUsage.js.map +1 -1
  102. package/dist/tools/utils/getEnvironment.d.ts +1 -1
  103. package/dist/tools/utils/getEnvironment.js +2 -2
  104. package/dist/tools/utils/getEnvironment.js.map +1 -1
  105. package/dist/tools/utils/switchEnvironment.d.ts +1 -1
  106. package/dist/tools/utils/switchEnvironment.d.ts.map +1 -1
  107. package/dist/tools/utils/switchEnvironment.js +8 -5
  108. package/dist/tools/utils/switchEnvironment.js.map +1 -1
  109. package/dist/utils/error-templates.d.ts +10 -0
  110. package/dist/utils/error-templates.d.ts.map +1 -1
  111. package/dist/utils/error-templates.js +29 -1
  112. package/dist/utils/error-templates.js.map +1 -1
  113. package/dist/utils/pool-filter-builder.d.ts +1 -1
  114. package/dist/utils/pool-filter-builder.js +1 -1
  115. package/dist/utils/response-formatter.d.ts +16 -1
  116. package/dist/utils/response-formatter.d.ts.map +1 -1
  117. package/dist/utils/response-formatter.js +49 -2
  118. package/dist/utils/response-formatter.js.map +1 -1
  119. package/package.json +7 -6
  120. package/dist/tools/chat/getPinnedChatMessage.d.ts +0 -15
  121. package/dist/tools/chat/getPinnedChatMessage.d.ts.map +0 -1
  122. package/dist/tools/chat/getPinnedChatMessage.js +0 -37
  123. package/dist/tools/chat/getPinnedChatMessage.js.map +0 -1
  124. package/dist/tools/chat/pinChatMessage.d.ts +0 -16
  125. package/dist/tools/chat/pinChatMessage.d.ts.map +0 -1
  126. package/dist/tools/chat/pinChatMessage.js +0 -51
  127. package/dist/tools/chat/pinChatMessage.js.map +0 -1
  128. package/dist/tools/chat/unpinChatMessage.d.ts +0 -16
  129. package/dist/tools/chat/unpinChatMessage.d.ts.map +0 -1
  130. package/dist/tools/chat/unpinChatMessage.js +0 -39
  131. package/dist/tools/chat/unpinChatMessage.js.map +0 -1
@@ -1,385 +1,182 @@
1
1
  "use strict";
2
- /**
3
- * DEX Liquidity Position Management Tools
4
- *
5
- * Tools for managing liquidity positions on GalaSwap DEX, including:
6
- * - Querying user positions and position details
7
- * - Estimating liquidity removal
8
- * - Adding liquidity by price or tick range
9
- * - Removing liquidity and collecting fees
10
- */
2
+ /** MCP tools for current-contract GSwap liquidity positions. */
11
3
  Object.defineProperty(exports, "__esModule", { value: true });
12
4
  exports.liquidityPositionTools = exports.collectPositionFeesTool = exports.fetchSwapPositionDirectTool = exports.removeLiquidityTool = exports.addLiquidityByTicksTool = exports.addLiquidityByPriceTool = exports.estimateRemoveLiquidityTool = exports.getLiquidityPositionTool = exports.getLiquidityPositionByIdTool = exports.getAllUserLiquidityPositionsTool = exports.getUserLiquidityPositionsTool = void 0;
5
+ const common_schemas_js_1 = require("../../schemas/common-schemas.js");
13
6
  const response_formatter_js_1 = require("../../utils/response-formatter.js");
14
7
  const error_handler_js_1 = require("../../utils/error-handler.js");
15
- const handler_factories_js_1 = require("../handler-factories.js");
16
- const common_schemas_js_1 = require("../../schemas/common-schemas.js");
17
8
  const helpers_js_1 = require("../dex/helpers.js");
18
- // 1. Get User Liquidity Positions
19
9
  exports.getUserLiquidityPositionsTool = {
20
10
  name: 'gala_launchpad_get_user_liquidity_positions',
21
- description: 'Get REST-backed open liquidity positions for a wallet address with optional pagination and pricing (~1s freshness; no signer required). Bookmark pagination and pricing options are mutually exclusive; use getAllUserLiquidityPositionsTool for pricing with auto-pagination. Restricted tokens return TokenRestrictedError (403), missing pools return a not-found error, and heavy usage may return 429 rate limit.',
22
- inputSchema: {
23
- type: 'object',
24
- properties: {
25
- ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA,
26
- limit: {
27
- type: 'number',
28
- minimum: 1,
29
- maximum: 100,
30
- description: 'Maximum number of positions to return (optional).',
31
- },
32
- bookmark: {
33
- type: 'string',
34
- description: 'Pagination bookmark from previous response (optional). Cannot be used together with withPrices - if you need pricing, use getAllUserLiquidityPositionsTool instead.',
35
- },
36
- withPrices: {
37
- type: 'boolean',
38
- description: 'Whether to fetch REST-backed pricing for each position with ~1s freshness (optional, default: false; no signer required). Cannot be used together with bookmark - if you need pagination, use bookmark without withPrices. Pricing concurrency is controlled by SDK-level pricingConcurrency configuration.',
39
- },
40
- },
41
- required: ['ownerAddress'],
42
- },
11
+ description: 'Get current-contract GSwap liquidity positions owned by an address.',
12
+ inputSchema: { type: 'object', properties: { ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA }, required: ['ownerAddress'] },
43
13
  handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
44
- let result;
45
- // Determine which parameters to pass based on what's provided
46
- if (typeof args.withPrices !== 'undefined' && args.withPrices) {
47
- // When pricing is requested, pass pricing options as 3rd parameter (can't use bookmark with options)
48
- const pricingOptions = { withPrices: true };
49
- result = await sdk.getSwapUserLiquidityPositions(args.ownerAddress, args.limit, pricingOptions);
50
- }
51
- else if (typeof args.bookmark !== 'undefined' && args.bookmark) {
52
- // When only bookmark pagination is used, pass bookmark as 3rd parameter
53
- result = await sdk.getSwapUserLiquidityPositions(args.ownerAddress, args.limit, args.bookmark);
54
- }
55
- else {
56
- // No pagination or pricing, just fetch positions
57
- result = await sdk.getSwapUserLiquidityPositions(args.ownerAddress, args.limit);
58
- }
59
- const parsed = (0, helpers_js_1.parsePositionListResult)(result);
60
- const withPrices = typeof args.withPrices === 'boolean' && args.withPrices === true ? true : false;
61
- return (0, response_formatter_js_1.formatSuccess)((0, helpers_js_1.formatPositionListResponse)(parsed, {
62
- ownerAddress: args.ownerAddress,
63
- withPrices,
64
- }));
14
+ const owner = requiredString(args, 'ownerAddress');
15
+ const positions = await sdk.dex.positions.getUserPositions(owner);
16
+ return (0, response_formatter_js_1.formatSuccess)({ ownerAddress: owner, positions: (0, helpers_js_1.formatPositions)(positions), count: positions.length });
65
17
  }),
66
18
  };
67
- // 2. Get ALL User Liquidity Positions (Auto-Paginated)
68
19
  exports.getAllUserLiquidityPositionsTool = {
69
20
  name: 'gala_launchpad_get_all_user_liquidity_positions',
70
- description: 'Get all REST-backed open liquidity positions for a wallet address with automatic pagination and optional pricing (~1s freshness; no signer required). Restricted tokens return TokenRestrictedError (403), missing pools return a not-found error, and heavy usage may return 429 rate limit.',
71
- inputSchema: {
72
- type: 'object',
73
- properties: {
74
- ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA,
75
- withPrices: {
76
- type: 'boolean',
77
- description: 'Whether to fetch REST-backed pricing for each position with ~1s freshness (optional, default: false; no signer required). Pricing concurrency is controlled by SDK-level pricingConcurrency configuration.',
78
- },
79
- },
80
- required: ['ownerAddress'],
81
- },
82
- handler: (0, handler_factories_js_1.createOptionalParamsHandler)((sdk, params) => sdk.getAllSwapUserLiquidityPositions(params?.ownerAddress, params?.pricingOptions), (args) => ({
83
- ownerAddress: args.ownerAddress,
84
- pricingOptions: typeof args.withPrices === 'boolean' && args.withPrices === true ? { withPrices: true } : undefined,
85
- }), (result, args) => {
86
- const withPrices = typeof args.withPrices === 'boolean' && args.withPrices === true ? true : false;
87
- return (0, helpers_js_1.formatPositionListResponse)((0, helpers_js_1.parsePositionListResult)(result), {
88
- ownerAddress: args.ownerAddress,
89
- withPrices,
90
- messageSuffix: '(auto-paginated)',
91
- });
92
- }),
21
+ description: 'Get all current-contract GSwap liquidity positions owned by an address.',
22
+ inputSchema: { type: 'object', properties: { ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA }, required: ['ownerAddress'] },
23
+ handler: exports.getUserLiquidityPositionsTool.handler,
93
24
  };
94
- // 3. Get Liquidity Position by ID
95
25
  exports.getLiquidityPositionByIdTool = {
96
26
  name: 'gala_launchpad_get_liquidity_position_by_id',
97
- description: 'Get REST-backed liquidity position details by position ID, including tokens, tick range, and accumulated fees (~1s freshness; no signer required). Restricted tokens return TokenRestrictedError (403), a missing pool or position returns a not-found error, and heavy usage may return 429 rate limit.',
27
+ description: 'Get one current-contract GSwap position by its pair, fee, owner, and tick range.',
98
28
  inputSchema: {
99
29
  type: 'object',
100
- properties: {
101
- ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA,
102
- positionId: {
103
- type: 'string',
104
- minLength: 1,
105
- description: 'Unique position identifier.',
106
- },
107
- },
108
- required: ['ownerAddress', 'positionId'],
30
+ properties: { ...common_schemas_js_1.TOKEN_PAIR_WITH_TICKS_SCHEMA, ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA },
31
+ required: ['token0', 'token1', 'fee', 'tickLower', 'tickUpper', 'ownerAddress'],
109
32
  },
110
- handler: (0, handler_factories_js_1.createOptionResultHandler)((sdk, args) => sdk.getSwapLiquidityPositionById(args.ownerAddress, args.positionId), 'Position not found'),
33
+ handler: createPositionLookupHandler(),
111
34
  };
112
- // 4. Get Liquidity Position by Token Pair
113
35
  exports.getLiquidityPositionTool = {
114
36
  name: 'gala_launchpad_get_liquidity_position',
115
- description: 'Get a REST-backed liquidity position for a token pair and price range (~1s freshness; no signer required). Restricted tokens return TokenRestrictedError (403), a missing pool or position returns a not-found error, and heavy usage may return 429 rate limit.',
37
+ description: 'Get one current-contract GSwap position by pair, owner, and tick range.',
116
38
  inputSchema: {
117
39
  type: 'object',
118
- properties: {
119
- ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA,
120
- ...common_schemas_js_1.TOKEN_PAIR_WITH_TICKS_SCHEMA,
121
- },
122
- required: ['ownerAddress', 'token0', 'token1', 'fee', 'tickLower', 'tickUpper'],
40
+ properties: { ...common_schemas_js_1.TOKEN_PAIR_WITH_TICKS_SCHEMA, ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA },
41
+ required: ['token0', 'token1', 'fee', 'tickLower', 'tickUpper', 'ownerAddress'],
123
42
  },
124
- // SDK validates tick spacing - no need for MCP-level validation
125
- handler: (0, handler_factories_js_1.createOptionResultHandler)((sdk, args) => sdk.getSwapLiquidityPosition(args.ownerAddress, (0, helpers_js_1.extractTokenPairWithTicksParams)(args)), 'No position found for specified token pair and tick range'),
43
+ handler: createPositionLookupHandler(),
126
44
  };
127
- // 5. Estimate Liquidity Removal
128
45
  exports.estimateRemoveLiquidityTool = {
129
46
  name: 'gala_launchpad_estimate_remove_liquidity',
130
- description: 'Estimate tokens received when removing liquidity using REST-backed DEX pool state (~1s freshness; no signer required). Returns amount0 and amount1 (underlying token amounts, raw without slippage adjustment). Restricted tokens return TokenRestrictedError (403), a missing pool or position returns a not-found error, and heavy usage may return 429 rate limit.',
47
+ description: 'Estimate token amounts released by a current-contract GSwap liquidity withdrawal.',
131
48
  inputSchema: {
132
49
  type: 'object',
133
- properties: {
134
- ...common_schemas_js_1.TOKEN_PAIR_WITH_TICKS_SCHEMA,
135
- liquidity: {
136
- ...common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA,
137
- description: 'Liquidity amount to estimate removal for.',
138
- },
139
- ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA,
140
- },
141
- required: ['token0', 'token1', 'fee', 'liquidity', 'tickLower', 'tickUpper', 'ownerAddress'],
50
+ properties: { ...common_schemas_js_1.TOKEN_PAIR_WITH_TICKS_SCHEMA, liquidity: common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA, ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA },
51
+ required: ['token0', 'token1', 'fee', 'tickLower', 'tickUpper', 'liquidity', 'ownerAddress'],
142
52
  },
143
- // SDK validates tick spacing - no need for MCP-level validation
144
- handler: (0, handler_factories_js_1.createTransformingHandler)('getSwapEstimateRemoveLiquidity', (args) => ({
145
- ...(0, helpers_js_1.extractTokenPairWithTicksParams)(args),
146
- liquidity: args.liquidity,
147
- owner: args.ownerAddress,
148
- }),
149
- // API only returns amount0 and amount1; other fields are optional
150
- (estimate, args) => ({
151
- amount0: estimate.amount0,
152
- amount1: estimate.amount1,
153
- message: `Removing ${String(args.liquidity)} liquidity would return approximately ${estimate.amount0} ${String(args.token0)} + ${estimate.amount1} ${String(args.token1)}`,
154
- })),
53
+ handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
54
+ const params = (0, helpers_js_1.extractTokenPairWithTicksParams)(args);
55
+ const estimate = await sdk.dex.positions.estimateRemoveLiquidity({ ...params, liquidity: requiredString(args, 'liquidity') });
56
+ return (0, response_formatter_js_1.formatSuccess)({ ...estimate, message: `Estimated withdrawal for ${params.token0}/${params.token1}.` });
57
+ }),
155
58
  };
156
- // 6. Add Liquidity by Price Range
157
59
  exports.addLiquidityByPriceTool = {
158
60
  name: 'gala_launchpad_add_liquidity_by_price',
159
- description: 'Add liquidity to a pool by specifying min/max price boundaries (SDK calculates tick boundaries).',
61
+ description: 'Add liquidity through sdk.dex.positions.addLiquidityByPrice and return confirm() output.',
160
62
  inputSchema: {
161
63
  type: 'object',
162
64
  properties: {
163
65
  ...common_schemas_js_1.TOKEN_PAIR_SCHEMA,
164
- minPrice: {
165
- type: 'string',
166
- description: 'Minimum price boundary (e.g., "0.90").',
167
- },
168
- maxPrice: {
169
- type: 'string',
170
- description: 'Maximum price boundary (e.g., "1.10").',
171
- },
66
+ minPrice: common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA,
67
+ maxPrice: common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA,
172
68
  ...common_schemas_js_1.LIQUIDITY_AMOUNTS_SCHEMA,
69
+ amountIsToken0: { type: 'boolean', description: 'Whether amount is denominated in token0.' },
173
70
  },
174
- required: [
175
- 'token0',
176
- 'token1',
177
- 'fee',
178
- 'minPrice',
179
- 'maxPrice',
180
- 'amount0Desired',
181
- 'amount1Desired',
182
- ],
71
+ required: ['token0', 'token1', 'fee', 'minPrice', 'maxPrice', 'amount0Desired', 'amount1Desired'],
183
72
  },
184
- handler: (0, handler_factories_js_1.createWalletRequiredHandler)('addSwapLiquidityByPrice', (args) => {
185
- // Type assertion is safe here because MCP schema validation ensures args match AddLiquidityByPriceArgs
186
- const typedArgs = args;
187
- return {
188
- token0: typedArgs.token0,
189
- token1: typedArgs.token1,
190
- fee: typedArgs.fee,
191
- minPrice: typedArgs.minPrice,
192
- maxPrice: typedArgs.maxPrice,
193
- amount0Desired: typedArgs.amount0Desired,
194
- amount1Desired: typedArgs.amount1Desired,
195
- amount0Min: typedArgs.amount0Min ?? '0',
196
- amount1Min: typedArgs.amount1Min ?? '0',
197
- };
198
- }, (result, args) => {
199
- // Type assertion is safe here because MCP schema validation ensures args match AddLiquidityByPriceArgs
200
- const typedArgs = args;
201
- return (0, helpers_js_1.formatAddLiquidityResponse)(result, typedArgs, {
202
- priceRange: `${typedArgs.minPrice} - ${typedArgs.maxPrice}`,
73
+ handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
74
+ const pair = (0, helpers_js_1.extractTokenPairParams)(args);
75
+ const { amount, amountIsToken0 } = depositAmount(args);
76
+ const transaction = await sdk.dex.positions.addLiquidityByPrice({
77
+ ...pair,
78
+ minPrice: (0, helpers_js_1.asPriceIn)(requiredString(args, 'minPrice')),
79
+ maxPrice: (0, helpers_js_1.asPriceIn)(requiredString(args, 'maxPrice')),
80
+ amount,
81
+ amountIsToken0,
203
82
  });
83
+ return (0, response_formatter_js_1.formatSuccess)({ ...(await (0, helpers_js_1.formatDexSubmission)(transaction)), token0: pair.token0, token1: pair.token1 });
204
84
  }),
205
85
  };
206
- // 7. Add Liquidity by Tick Range
207
86
  exports.addLiquidityByTicksTool = {
208
87
  name: 'gala_launchpad_add_liquidity_by_ticks',
209
- description: 'Add liquidity to a pool by specifying exact tick boundaries (advanced usage).',
88
+ description: 'Add liquidity through sdk.dex.positions.addLiquidityByTicks and return confirm() output.',
210
89
  inputSchema: {
211
90
  type: 'object',
212
- properties: {
213
- token0: common_schemas_js_1.TOKEN_PAIR_SCHEMA.token0,
214
- token1: common_schemas_js_1.TOKEN_PAIR_SCHEMA.token1,
215
- feeTier: common_schemas_js_1.FEE_TIER_SCHEMA,
216
- tickLower: {
217
- type: 'number',
218
- description: 'Lower tick boundary (must be multiple of tickSpacing).',
219
- },
220
- tickUpper: {
221
- type: 'number',
222
- description: 'Upper tick boundary (must be multiple of tickSpacing).',
223
- },
224
- ...common_schemas_js_1.LIQUIDITY_AMOUNTS_SCHEMA,
225
- },
226
- required: [
227
- 'token0',
228
- 'token1',
229
- 'feeTier',
230
- 'tickLower',
231
- 'tickUpper',
232
- 'amount0Desired',
233
- 'amount1Desired',
234
- ],
91
+ properties: { ...common_schemas_js_1.TOKEN_PAIR_WITH_TICKS_SCHEMA, ...common_schemas_js_1.LIQUIDITY_AMOUNTS_SCHEMA, amountIsToken0: { type: 'boolean', description: 'Whether amount is denominated in token0.' } },
92
+ required: ['token0', 'token1', 'fee', 'tickLower', 'tickUpper', 'amount0Desired', 'amount1Desired'],
235
93
  },
236
- handler: (0, handler_factories_js_1.createWalletRequiredHandler)('addSwapLiquidityByTicks', (args) => {
237
- // Type assertion is safe here because MCP schema validation ensures args match AddLiquidityByTicksArgs
238
- const typedArgs = args;
239
- return {
240
- token0: typedArgs.token0,
241
- token1: typedArgs.token1,
242
- feeTier: typedArgs.feeTier,
243
- tickLower: typedArgs.tickLower,
244
- tickUpper: typedArgs.tickUpper,
245
- amount0Desired: typedArgs.amount0Desired,
246
- amount1Desired: typedArgs.amount1Desired,
247
- amount0Min: typedArgs.amount0Min ?? '0',
248
- amount1Min: typedArgs.amount1Min ?? '0',
249
- };
250
- }, (result, args) => {
251
- // Type assertion is safe here because MCP schema validation ensures args match AddLiquidityByTicksArgs
252
- const typedArgs = args;
253
- return (0, helpers_js_1.formatAddLiquidityResponse)(result, typedArgs, {
254
- tickRange: `${typedArgs.tickLower} - ${typedArgs.tickUpper}`,
255
- });
94
+ handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
95
+ const pair = (0, helpers_js_1.extractTokenPairWithTicksParams)(args);
96
+ const { amount, amountIsToken0 } = depositAmount(args);
97
+ const transaction = await sdk.dex.positions.addLiquidityByTicks({ ...pair, amount, amountIsToken0 });
98
+ return (0, response_formatter_js_1.formatSuccess)({ ...(await (0, helpers_js_1.formatDexSubmission)(transaction)), token0: pair.token0, token1: pair.token1 });
256
99
  }),
257
100
  };
258
- // 8. Remove Liquidity
259
101
  exports.removeLiquidityTool = {
260
102
  name: 'gala_launchpad_remove_liquidity',
261
- description: 'Remove liquidity from an open position and withdraw underlying tokens.',
103
+ description: 'Remove current-contract GSwap liquidity and return confirm() output.',
262
104
  inputSchema: {
263
105
  type: 'object',
264
- properties: {
265
- ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA,
266
- positionId: {
267
- type: 'string',
268
- minLength: 1,
269
- description: 'Position identifier to remove liquidity from.',
270
- },
271
- liquidity: {
272
- ...common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA,
273
- description: 'Amount of liquidity to remove (full liquidity to close position).',
274
- },
275
- amount0Min: {
276
- ...common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA,
277
- description: 'Minimum acceptable amount of token0 to receive.',
278
- },
279
- amount1Min: {
280
- ...common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA,
281
- description: 'Minimum acceptable amount of token1 to receive.',
282
- },
283
- deadline: {
284
- type: 'number',
285
- description: 'Transaction deadline (unix timestamp, optional).',
286
- },
287
- },
288
- required: ['ownerAddress', 'positionId', 'liquidity', 'amount0Min', 'amount1Min'],
106
+ properties: { ...common_schemas_js_1.TOKEN_PAIR_WITH_TICKS_SCHEMA, ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA, liquidity: common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA, amount0: common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA, amount1: common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA },
107
+ required: ['token0', 'token1', 'fee', 'tickLower', 'tickUpper', 'ownerAddress'],
289
108
  },
290
- handler: (0, handler_factories_js_1.createPositionEnrichmentHandler)({
291
- operation: (sdk, position, args) => sdk.removeSwapLiquidity({
292
- token0: position.token0,
293
- token1: position.token1,
294
- fee: position.feeTier,
295
- tickLower: position.tickLower,
296
- tickUpper: position.tickUpper,
297
- liquidity: args.liquidity,
298
- amount0Min: args.amount0Min,
299
- amount1Min: args.amount1Min,
300
- positionId: args.positionId,
301
- }),
302
- responseBuilder: (result, position, args) => ({
303
- transactionId: result.transactionId,
304
- status: result.status,
305
- positionId: args.positionId,
306
- token0: position.token0,
307
- token1: position.token1,
308
- liquidity: args.liquidity,
309
- amount0: result.amount0,
310
- amount1: result.amount1,
311
- message: `Liquidity removed! Received ${result.amount0 ?? '0'} ${position.token0} and ${result.amount1 ?? '0'} ${position.token1}`,
312
- }),
109
+ handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
110
+ const pair = (0, helpers_js_1.extractTokenPairWithTicksParams)(args);
111
+ const transaction = await sdk.dex.positions.removeLiquidity({
112
+ ...pair,
113
+ ...optionalProperty(args, 'amount0'),
114
+ ...optionalProperty(args, 'amount1'),
115
+ });
116
+ return (0, response_formatter_js_1.formatSuccess)({ ...(await (0, helpers_js_1.formatDexSubmission)(transaction)), token0: pair.token0, token1: pair.token1 });
313
117
  }),
314
118
  };
315
- // 9. Fetch Swap Position Direct (compound key lookup - most efficient)
316
119
  exports.fetchSwapPositionDirectTool = {
317
120
  name: 'gala_launchpad_fetch_swap_position_direct',
318
- description: 'Fetch a single REST-backed liquidity position by compound key using token0, token1, fee, and tick range (~1s freshness; no signer required). Restricted tokens return TokenRestrictedError (403), a missing pool or position returns a not-found error, and heavy usage may return 429 rate limit.',
121
+ description: 'Fetch one current-contract GSwap position by its compound pair and tick key.',
319
122
  inputSchema: {
320
123
  type: 'object',
321
- properties: {
322
- ...common_schemas_js_1.TOKEN_PAIR_WITH_TICKS_SCHEMA,
323
- ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA,
324
- },
124
+ properties: { ...common_schemas_js_1.TOKEN_PAIR_WITH_TICKS_SCHEMA, ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA },
325
125
  required: ['token0', 'token1', 'fee', 'tickLower', 'tickUpper', 'ownerAddress'],
326
126
  },
327
- handler: (0, handler_factories_js_1.createOptionResultHandler)((sdk, args) => sdk.fetchSwapPositionDirect({
328
- ...(0, helpers_js_1.extractTokenPairWithTicksParams)(args),
329
- owner: args.ownerAddress,
330
- }), 'No position found for specified compound key'),
127
+ handler: createPositionLookupHandler(),
331
128
  };
332
- // 10. Collect Position Fees
333
129
  exports.collectPositionFeesTool = {
334
130
  name: 'gala_launchpad_collect_position_fees',
335
- description: 'Collect accumulated trading fees from a liquidity position without modifying the position.',
131
+ description: 'Collect current-contract GSwap position fees and return confirm() output.',
336
132
  inputSchema: {
337
133
  type: 'object',
338
- properties: {
339
- ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA,
340
- positionId: {
341
- type: 'string',
342
- minLength: 1,
343
- description: 'Position identifier to collect fees from.',
344
- },
345
- amount0Max: {
346
- ...common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA,
347
- description: 'Maximum amount of token0 fees to collect (optional).',
348
- },
349
- amount1Max: {
350
- ...common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA,
351
- description: 'Maximum amount of token1 fees to collect (optional).',
352
- },
353
- },
354
- required: ['ownerAddress', 'positionId'],
134
+ properties: { ...common_schemas_js_1.TOKEN_PAIR_WITH_TICKS_SCHEMA, ownerAddress: common_schemas_js_1.OWNER_ADDRESS_SCHEMA },
135
+ required: ['token0', 'token1', 'fee', 'tickLower', 'tickUpper', 'ownerAddress'],
355
136
  },
356
- handler: (0, handler_factories_js_1.createPositionEnrichmentHandler)({
357
- operation: (sdk, _position, args) => {
358
- const collectFeesArgs = {
359
- ownerAddress: args.ownerAddress,
360
- positionId: args.positionId,
361
- };
362
- if (args.amount0Max !== undefined) {
363
- collectFeesArgs.amount0Max = args.amount0Max;
364
- }
365
- if (args.amount1Max !== undefined) {
366
- collectFeesArgs.amount1Max = args.amount1Max;
367
- }
368
- return sdk.collectSwapPositionFees(collectFeesArgs);
369
- },
370
- responseBuilder: (result, position, args) => ({
371
- transactionId: result.transactionId,
372
- status: result.status,
373
- positionId: args.positionId,
374
- token0: position.token0,
375
- token1: position.token1,
376
- amount0Collected: result.amount0,
377
- amount1Collected: result.amount1,
378
- message: `Fees collected! ${result.amount0 ?? '0'} ${position.token0} and ${result.amount1 ?? '0'} ${position.token1} harvested.`,
379
- }),
137
+ handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
138
+ const params = (0, helpers_js_1.extractTokenPairWithTicksParams)(args);
139
+ const transaction = await sdk.dex.positions.collectPositionFees(params);
140
+ return (0, response_formatter_js_1.formatSuccess)({ ...(await (0, helpers_js_1.formatDexSubmission)(transaction)), token0: params.token0, token1: params.token1 });
380
141
  }),
381
142
  };
382
- // Export all liquidity position tools
143
+ function createPositionLookupHandler() {
144
+ return (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
145
+ const params = (0, helpers_js_1.extractTokenPairWithTicksParams)(args);
146
+ const owner = requiredString(args, 'ownerAddress');
147
+ const position = await sdk.dex.positions.getPosition({ ...params, owner });
148
+ return (0, response_formatter_js_1.formatSuccess)(position === null ? { found: false } : { found: true, position: (0, helpers_js_1.formatPosition)(position) });
149
+ });
150
+ }
151
+ function depositAmount(args) {
152
+ const explicit = args.amountIsToken0;
153
+ if (typeof explicit === 'boolean') {
154
+ return { amount: requiredString(args, explicit ? 'amount0Desired' : 'amount1Desired'), amountIsToken0: explicit };
155
+ }
156
+ const amount0 = optionalString(args, 'amount0Desired');
157
+ if (amount0 !== undefined && amount0 !== '0')
158
+ return { amount: amount0, amountIsToken0: true };
159
+ const amount1 = optionalString(args, 'amount1Desired');
160
+ if (amount1 !== undefined)
161
+ return { amount: amount1, amountIsToken0: false };
162
+ throw new Error('One of amount0Desired or amount1Desired is required');
163
+ }
164
+ function requiredString(args, name) {
165
+ const value = args[name];
166
+ if (typeof value !== 'string' || value.trim() === '')
167
+ throw new Error(`${name} must be a non-empty string`);
168
+ return value;
169
+ }
170
+ function optionalString(args, name) {
171
+ const value = args[name];
172
+ if (value === undefined)
173
+ return undefined;
174
+ return requiredString(args, name);
175
+ }
176
+ function optionalProperty(args, name) {
177
+ const value = optionalString(args, name);
178
+ return value === undefined ? {} : { [name]: value };
179
+ }
383
180
  exports.liquidityPositionTools = [
384
181
  exports.getUserLiquidityPositionsTool,
385
182
  exports.getAllUserLiquidityPositionsTool,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/dex-liquidity/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAGH,6EAAkE;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