@gala-chain/launchpad-mcp-server 2.0.1 → 2.0.2-beta.10
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/.eslintrc.json +68 -8
- package/CHANGELOG.md +10 -10
- package/README.md +24 -22
- package/dist/constants/mcpToolNames.d.ts +21 -2
- package/dist/constants/mcpToolNames.d.ts.map +1 -1
- package/dist/constants/mcpToolNames.js +17 -3
- package/dist/constants/mcpToolNames.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.d.ts.map +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/generated/version.js.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/prompts/advanced-pools.d.ts.map +1 -1
- package/dist/prompts/advanced-pools.js.map +1 -1
- package/dist/prompts/dex-leaderboard.d.ts +40 -0
- package/dist/prompts/dex-leaderboard.d.ts.map +1 -0
- package/dist/prompts/dex-leaderboard.js +239 -0
- package/dist/prompts/dex-leaderboard.js.map +1 -0
- package/dist/prompts/dex-volume.d.ts +19 -0
- package/dist/prompts/dex-volume.d.ts.map +1 -0
- package/dist/prompts/dex-volume.js +74 -0
- package/dist/prompts/dex-volume.js.map +1 -0
- package/dist/prompts/index.d.ts +5 -2
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +11 -2
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/locks.d.ts +16 -0
- package/dist/prompts/locks.d.ts.map +1 -0
- package/dist/prompts/locks.js +114 -0
- package/dist/prompts/locks.js.map +1 -0
- package/dist/prompts/monitoring.js.map +1 -1
- package/dist/prompts/pools.js +3 -3
- package/dist/prompts/pools.js.map +1 -1
- package/dist/schemas/common-schemas.d.ts +18 -16
- package/dist/schemas/common-schemas.d.ts.map +1 -1
- package/dist/schemas/common-schemas.js +8 -0
- package/dist/schemas/common-schemas.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +3 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/balance/index.js.map +1 -1
- package/dist/tools/creation/index.d.ts.map +1 -1
- package/dist/tools/creation/index.js +11 -8
- package/dist/tools/creation/index.js.map +1 -1
- package/dist/tools/dex/fetchAllDexPools.d.ts.map +1 -1
- package/dist/tools/dex/fetchAllDexPools.js +10 -6
- package/dist/tools/dex/fetchAllDexPools.js.map +1 -1
- package/dist/tools/dex/fetchDexPools.js.map +1 -1
- package/dist/tools/dex/index.d.ts +5 -0
- package/dist/tools/dex/index.d.ts.map +1 -1
- package/dist/tools/dex/index.js +238 -2
- package/dist/tools/dex/index.js.map +1 -1
- package/dist/tools/dex/leaderboard.d.ts +38 -0
- package/dist/tools/dex/leaderboard.d.ts.map +1 -0
- package/dist/tools/dex/leaderboard.js +153 -0
- package/dist/tools/dex/leaderboard.js.map +1 -0
- package/dist/tools/dex/liquidity-positions.d.ts.map +1 -1
- package/dist/tools/dex/liquidity-positions.js +13 -4
- package/dist/tools/dex/liquidity-positions.js.map +1 -1
- package/dist/tools/dex/volume.d.ts +19 -0
- package/dist/tools/dex/volume.d.ts.map +1 -0
- package/dist/tools/dex/volume.js +53 -0
- package/dist/tools/dex/volume.js.map +1 -0
- package/dist/tools/index.d.ts +6 -5
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +15 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/locks/index.d.ts +8 -0
- package/dist/tools/locks/index.d.ts.map +1 -0
- package/dist/tools/locks/index.js +79 -0
- package/dist/tools/locks/index.js.map +1 -0
- package/dist/tools/pools/fetchAllPools.d.ts.map +1 -1
- package/dist/tools/pools/fetchAllPools.js +8 -12
- package/dist/tools/pools/fetchAllPools.js.map +1 -1
- package/dist/tools/pools/fetchAllPriceHistory.js +1 -1
- package/dist/tools/pools/fetchAllPriceHistory.js.map +1 -1
- package/dist/tools/pools/fetchPoolDetails.js.map +1 -1
- package/dist/tools/pools/fetchPools.js.map +1 -1
- package/dist/tools/pools/fetchPriceHistory.js +1 -1
- package/dist/tools/pools/fetchPriceHistory.js.map +1 -1
- package/dist/tools/pools/fetchTokenDetails.js +1 -1
- package/dist/tools/pools/fetchTokenDetails.js.map +1 -1
- package/dist/tools/pools/index.js +1 -1
- package/dist/tools/pools/index.js.map +1 -1
- package/dist/tools/pools/onDexPoolCreation.d.ts.map +1 -1
- package/dist/tools/pools/onDexPoolCreation.js +1 -0
- package/dist/tools/pools/onDexPoolCreation.js.map +1 -1
- package/dist/tools/pools/onLaunchpadTokenCreation.d.ts.map +1 -1
- package/dist/tools/pools/onLaunchpadTokenCreation.js +1 -0
- package/dist/tools/pools/onLaunchpadTokenCreation.js.map +1 -1
- package/dist/tools/social/index.js.map +1 -1
- package/dist/tools/trading/index.js +2 -2
- package/dist/tools/trading/index.js.map +1 -1
- package/dist/tools/transfers/index.js.map +1 -1
- package/dist/tools/utils/cleanup.d.ts +2 -2
- package/dist/tools/utils/cleanup.d.ts.map +1 -1
- package/dist/tools/utils/cleanup.js +8 -35
- package/dist/tools/utils/cleanup.js.map +1 -1
- package/dist/tools/utils/clearCache.js.map +1 -1
- package/dist/tools/utils/explainSdkUsage.d.ts +10 -0
- package/dist/tools/utils/explainSdkUsage.d.ts.map +1 -1
- package/dist/tools/utils/explainSdkUsage.js +896 -10
- package/dist/tools/utils/explainSdkUsage.js.map +1 -1
- package/dist/tools/utils/index.d.ts.map +1 -1
- package/dist/tools/utils/index.js +4 -0
- package/dist/tools/utils/index.js.map +1 -1
- package/dist/tools/utils/retrieveFromFaucet.d.ts +9 -0
- package/dist/tools/utils/retrieveFromFaucet.d.ts.map +1 -0
- package/dist/tools/utils/retrieveFromFaucet.js +36 -0
- package/dist/tools/utils/retrieveFromFaucet.js.map +1 -0
- package/dist/types/mcp.d.ts +2 -2
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/utils/default-values.d.ts.map +1 -1
- package/dist/utils/default-values.js +3 -0
- package/dist/utils/default-values.js.map +1 -1
- package/dist/utils/response-formatter.d.ts.map +1 -1
- package/dist/utils/response-formatter.js +1 -0
- package/dist/utils/response-formatter.js.map +1 -1
- package/dist/utils/tool-factory.d.ts.map +1 -1
- package/dist/utils/tool-factory.js +1 -0
- package/dist/utils/tool-factory.js.map +1 -1
- package/eslint.config.js.bak +113 -0
- package/package.json +5 -4
- package/dist/prompts/__tests__/promptStructure.test.d.ts +0 -7
- package/dist/prompts/__tests__/promptStructure.test.d.ts.map +0 -1
- package/dist/prompts/__tests__/promptStructure.test.js +0 -106
- package/dist/prompts/__tests__/promptStructure.test.js.map +0 -1
- package/dist/prompts/__tests__/registry.test.d.ts +0 -7
- package/dist/prompts/__tests__/registry.test.d.ts.map +0 -1
- package/dist/prompts/__tests__/registry.test.js +0 -119
- package/dist/prompts/__tests__/registry.test.js.map +0 -1
- package/dist/scripts/test-all-prompts.d.ts +0 -6
- package/dist/scripts/test-all-prompts.d.ts.map +0 -1
- package/dist/scripts/test-all-prompts.js +0 -158
- package/dist/scripts/test-all-prompts.js.map +0 -1
- package/dist/tools/balance/all-assets.d.ts +0 -9
- package/dist/tools/balance/all-assets.d.ts.map +0 -1
- package/dist/tools/balance/all-assets.js +0 -104
- package/dist/tools/balance/all-assets.js.map +0 -1
- package/dist/tools/dex/advanced-dex.d.ts +0 -15
- package/dist/tools/dex/advanced-dex.d.ts.map +0 -1
- package/dist/tools/dex/advanced-dex.js +0 -239
- package/dist/tools/dex/advanced-dex.js.map +0 -1
- package/dist/tools/dex/pool-price.d.ts +0 -9
- package/dist/tools/dex/pool-price.d.ts.map +0 -1
- package/dist/tools/dex/pool-price.js +0 -78
- package/dist/tools/dex/pool-price.js.map +0 -1
- package/dist/tools/dex/pool-quote-calculation.d.ts +0 -9
- package/dist/tools/dex/pool-quote-calculation.d.ts.map +0 -1
- package/dist/tools/dex/pool-quote-calculation.js +0 -99
- package/dist/tools/dex/pool-quote-calculation.js.map +0 -1
- package/dist/tools/dex/pool-quote-external.d.ts +0 -10
- package/dist/tools/dex/pool-quote-external.d.ts.map +0 -1
- package/dist/tools/dex/pool-quote-external.js +0 -84
- package/dist/tools/dex/pool-quote-external.js.map +0 -1
- package/dist/tools/dex/pool-quote-local.d.ts +0 -10
- package/dist/tools/dex/pool-quote-local.d.ts.map +0 -1
- package/dist/tools/dex/pool-quote-local.js +0 -84
- package/dist/tools/dex/pool-quote-local.js.map +0 -1
- package/dist/tools/dex/position-direct.d.ts +0 -9
- package/dist/tools/dex/position-direct.d.ts.map +0 -1
- package/dist/tools/dex/position-direct.js +0 -65
- package/dist/tools/dex/position-direct.js.map +0 -1
- package/dist/tools/pools/composite-pool.d.ts +0 -9
- package/dist/tools/pools/composite-pool.d.ts.map +0 -1
- package/dist/tools/pools/composite-pool.js +0 -69
- package/dist/tools/pools/composite-pool.js.map +0 -1
- package/dist/tools/pools/fetchAllPrices.d.ts +0 -9
- package/dist/tools/pools/fetchAllPrices.d.ts.map +0 -1
- package/dist/tools/pools/fetchAllPrices.js +0 -38
- package/dist/tools/pools/fetchAllPrices.js.map +0 -1
- package/dist/tools/pools/fetchPrices.d.ts +0 -9
- package/dist/tools/pools/fetchPrices.d.ts.map +0 -1
- package/dist/tools/pools/fetchPrices.js +0 -51
- package/dist/tools/pools/fetchPrices.js.map +0 -1
- package/dist/tools/utils/faucet.d.ts +0 -10
- package/dist/tools/utils/faucet.d.ts.map +0 -1
- package/dist/tools/utils/faucet.js +0 -51
- package/dist/tools/utils/faucet.js.map +0 -1
- package/dist/utils/__tests__/validation.test.d.ts +0 -7
- package/dist/utils/__tests__/validation.test.d.ts.map +0 -1
- package/dist/utils/__tests__/validation.test.js +0 -122
- package/dist/utils/__tests__/validation.test.js.map +0 -1
- package/test-mcp.js +0 -89
package/dist/tools/dex/index.js
CHANGED
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
* Provides quote generation, swap execution, liquidity management, asset management, and pool exploration.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.dexTools = exports.getSwapPoolInfoTool = exports.getSwapUserAssetsTool = exports.executeSwapTool = exports.getSwapQuoteExactOutputTool = exports.getSwapQuoteExactInputTool = void 0;
|
|
10
|
+
exports.dexTools = exports.getAllSwapUserAssetsTool = exports.getSwapPoolPriceTool = exports.calculateDexPoolQuoteExternalTool = exports.calculateDexPoolQuoteLocalTool = exports.fetchCompositePoolDataTool = exports.getSwapPoolInfoTool = exports.getSwapUserAssetsTool = exports.executeSwapTool = exports.getSwapQuoteExactOutputTool = exports.getSwapQuoteExactInputTool = void 0;
|
|
11
11
|
const liquidity_positions_js_1 = require("./liquidity-positions.js");
|
|
12
12
|
const fetchDexPools_js_1 = require("./fetchDexPools.js");
|
|
13
13
|
const fetchAllDexPools_js_1 = require("./fetchAllDexPools.js");
|
|
14
|
+
const leaderboard_js_1 = require("./leaderboard.js");
|
|
15
|
+
const volume_js_1 = require("./volume.js");
|
|
14
16
|
const response_formatter_js_1 = require("../../utils/response-formatter.js");
|
|
15
17
|
const error_handler_js_1 = require("../../utils/error-handler.js");
|
|
16
18
|
const common_schemas_js_1 = require("../../schemas/common-schemas.js");
|
|
@@ -195,7 +197,234 @@ exports.getSwapPoolInfoTool = {
|
|
|
195
197
|
});
|
|
196
198
|
}),
|
|
197
199
|
};
|
|
198
|
-
//
|
|
200
|
+
// Token class key for DEX (full pipe-delimited format)
|
|
201
|
+
const TOKEN_CLASS_KEY_SCHEMA = {
|
|
202
|
+
type: 'string',
|
|
203
|
+
description: 'Full token class key in pipe-delimited format (e.g., "GALA|Unit|none|none" or "Token|Unit|SYMBOL|client:xxx")',
|
|
204
|
+
};
|
|
205
|
+
// 6. Fetch Composite Pool Data
|
|
206
|
+
exports.fetchCompositePoolDataTool = {
|
|
207
|
+
name: 'gala_launchpad_fetch_composite_pool_data',
|
|
208
|
+
description: 'Fetch complete pool state for offline DEX quote calculations. Returns pool liquidity, tick data, and token balances. Use this for bulk pricing operations or when you need multiple quotes for the same pool.',
|
|
209
|
+
inputSchema: {
|
|
210
|
+
type: 'object',
|
|
211
|
+
properties: {
|
|
212
|
+
token0: {
|
|
213
|
+
...TOKEN_CLASS_KEY_SCHEMA,
|
|
214
|
+
description: 'First token class key (e.g., "GALA|Unit|none|none")',
|
|
215
|
+
},
|
|
216
|
+
token1: {
|
|
217
|
+
...TOKEN_CLASS_KEY_SCHEMA,
|
|
218
|
+
description: 'Second token class key (e.g., "Token|Unit|BENE|client:5c806869e7fd0e2384461ce9")',
|
|
219
|
+
},
|
|
220
|
+
fee: FEE_TIER_SCHEMA,
|
|
221
|
+
},
|
|
222
|
+
required: ['token0', 'token1', 'fee'],
|
|
223
|
+
},
|
|
224
|
+
handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
|
|
225
|
+
const composite = await sdk.fetchCompositePoolData({
|
|
226
|
+
token0: args.token0,
|
|
227
|
+
token1: args.token1,
|
|
228
|
+
fee: args.fee,
|
|
229
|
+
});
|
|
230
|
+
return (0, response_formatter_js_1.formatSuccess)({
|
|
231
|
+
token0: args.token0,
|
|
232
|
+
token1: args.token1,
|
|
233
|
+
fee: args.fee,
|
|
234
|
+
token0Decimals: composite.token0Decimals,
|
|
235
|
+
token1Decimals: composite.token1Decimals,
|
|
236
|
+
poolLiquidity: composite.pool.liquidity.toString(),
|
|
237
|
+
tick: composite.pool.tick,
|
|
238
|
+
sqrtPrice: composite.pool.sqrtPrice.toString(),
|
|
239
|
+
tickDataCount: Object.keys(composite.tickDataMap).length,
|
|
240
|
+
message: `Composite pool data fetched for ${args.token0}/${args.token1} (${args.fee / 10000}% fee)`,
|
|
241
|
+
});
|
|
242
|
+
}),
|
|
243
|
+
};
|
|
244
|
+
// 7. Calculate DEX Pool Quote (Local - instant offline calculation)
|
|
245
|
+
exports.calculateDexPoolQuoteLocalTool = {
|
|
246
|
+
name: 'gala_launchpad_calculate_dex_pool_quote_local',
|
|
247
|
+
description: 'Calculate instant DEX quote using local bonding curve math. Auto-fetches pool data unless compositePoolData is provided (for bulk efficiency).',
|
|
248
|
+
inputSchema: {
|
|
249
|
+
type: 'object',
|
|
250
|
+
properties: {
|
|
251
|
+
token0: {
|
|
252
|
+
...TOKEN_CLASS_KEY_SCHEMA,
|
|
253
|
+
description: 'First token in pool (e.g., "GALA|Unit|none|none")',
|
|
254
|
+
},
|
|
255
|
+
token1: {
|
|
256
|
+
...TOKEN_CLASS_KEY_SCHEMA,
|
|
257
|
+
description: 'Second token in pool (e.g., "Token|Unit|BENE|client:xxx")',
|
|
258
|
+
},
|
|
259
|
+
fee: FEE_TIER_SCHEMA,
|
|
260
|
+
fromToken: {
|
|
261
|
+
...TOKEN_CLASS_KEY_SCHEMA,
|
|
262
|
+
description: 'Token to swap FROM',
|
|
263
|
+
},
|
|
264
|
+
toToken: {
|
|
265
|
+
...TOKEN_CLASS_KEY_SCHEMA,
|
|
266
|
+
description: 'Token to swap TO',
|
|
267
|
+
},
|
|
268
|
+
amount: {
|
|
269
|
+
...common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA,
|
|
270
|
+
description: 'Amount of fromToken to swap',
|
|
271
|
+
},
|
|
272
|
+
compositePoolData: {
|
|
273
|
+
type: 'string',
|
|
274
|
+
description: 'Optional: Pre-fetched composite pool data as JSON string from gala_launchpad_fetch_composite_pool_data. If provided, skips fetch for efficiency (ideal for bulk quotes).',
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
required: ['token0', 'token1', 'fee', 'fromToken', 'toToken', 'amount'],
|
|
278
|
+
},
|
|
279
|
+
handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
|
|
280
|
+
// Use provided composite data or fetch it
|
|
281
|
+
let composite;
|
|
282
|
+
if (args.compositePoolData) {
|
|
283
|
+
composite = JSON.parse(args.compositePoolData);
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
composite = await sdk.fetchCompositePoolData({
|
|
287
|
+
token0: args.token0,
|
|
288
|
+
token1: args.token1,
|
|
289
|
+
fee: args.fee,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
// Calculate quote locally
|
|
293
|
+
const quote = await sdk.calculateDexPoolQuoteExactAmountLocal({
|
|
294
|
+
compositePoolData: composite,
|
|
295
|
+
fromToken: args.fromToken,
|
|
296
|
+
toToken: args.toToken,
|
|
297
|
+
amount: args.amount,
|
|
298
|
+
});
|
|
299
|
+
return (0, response_formatter_js_1.formatSuccess)({
|
|
300
|
+
mode: 'local',
|
|
301
|
+
fromToken: args.fromToken,
|
|
302
|
+
toToken: args.toToken,
|
|
303
|
+
inputAmount: quote.amount0,
|
|
304
|
+
outputAmount: quote.amount1,
|
|
305
|
+
currentSqrtPrice: quote.currentSqrtPrice,
|
|
306
|
+
newSqrtPrice: quote.newSqrtPrice,
|
|
307
|
+
priceImpact: quote.priceImpact,
|
|
308
|
+
executionPrice: quote.executionPrice,
|
|
309
|
+
usedCachedData: !!args.compositePoolData,
|
|
310
|
+
message: `Local quote: ${quote.amount0} ${args.fromToken} → ${quote.amount1} ${args.toToken}${args.compositePoolData ? ' (using cached pool data)' : ''}`,
|
|
311
|
+
});
|
|
312
|
+
}),
|
|
313
|
+
};
|
|
314
|
+
// 8. Calculate DEX Pool Quote (External - real-time from blockchain)
|
|
315
|
+
exports.calculateDexPoolQuoteExternalTool = {
|
|
316
|
+
name: 'gala_launchpad_calculate_dex_pool_quote_external',
|
|
317
|
+
description: 'Calculate real-time DEX quote from GalaChain blockchain. Slower than local but always reflects current pool state. Use for final price verification.',
|
|
318
|
+
inputSchema: {
|
|
319
|
+
type: 'object',
|
|
320
|
+
properties: {
|
|
321
|
+
token0: {
|
|
322
|
+
...TOKEN_CLASS_KEY_SCHEMA,
|
|
323
|
+
description: 'First token in pool (e.g., "GALA|Unit|none|none")',
|
|
324
|
+
},
|
|
325
|
+
token1: {
|
|
326
|
+
...TOKEN_CLASS_KEY_SCHEMA,
|
|
327
|
+
description: 'Second token in pool (e.g., "Token|Unit|BENE|client:xxx")',
|
|
328
|
+
},
|
|
329
|
+
fee: FEE_TIER_SCHEMA,
|
|
330
|
+
fromToken: {
|
|
331
|
+
...TOKEN_CLASS_KEY_SCHEMA,
|
|
332
|
+
description: 'Token to swap FROM',
|
|
333
|
+
},
|
|
334
|
+
toToken: {
|
|
335
|
+
...TOKEN_CLASS_KEY_SCHEMA,
|
|
336
|
+
description: 'Token to swap TO',
|
|
337
|
+
},
|
|
338
|
+
amount: {
|
|
339
|
+
...common_schemas_js_1.DECIMAL_AMOUNT_SCHEMA,
|
|
340
|
+
description: 'Amount of fromToken to swap',
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
required: ['token0', 'token1', 'fee', 'fromToken', 'toToken', 'amount'],
|
|
344
|
+
},
|
|
345
|
+
handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
|
|
346
|
+
// Fetch composite pool data first
|
|
347
|
+
const composite = await sdk.fetchCompositePoolData({
|
|
348
|
+
token0: args.token0,
|
|
349
|
+
token1: args.token1,
|
|
350
|
+
fee: args.fee,
|
|
351
|
+
});
|
|
352
|
+
// Calculate quote from blockchain
|
|
353
|
+
const quote = await sdk.calculateDexPoolQuoteExactAmountExternal({
|
|
354
|
+
compositePoolData: composite,
|
|
355
|
+
fromToken: args.fromToken,
|
|
356
|
+
toToken: args.toToken,
|
|
357
|
+
amount: args.amount,
|
|
358
|
+
});
|
|
359
|
+
return (0, response_formatter_js_1.formatSuccess)({
|
|
360
|
+
mode: 'external',
|
|
361
|
+
fromToken: args.fromToken,
|
|
362
|
+
toToken: args.toToken,
|
|
363
|
+
inputAmount: quote.amount0,
|
|
364
|
+
outputAmount: quote.amount1,
|
|
365
|
+
currentSqrtPrice: quote.currentSqrtPrice,
|
|
366
|
+
newSqrtPrice: quote.newSqrtPrice,
|
|
367
|
+
priceImpact: quote.priceImpact,
|
|
368
|
+
executionPrice: quote.executionPrice,
|
|
369
|
+
message: `External quote: ${quote.amount0} ${args.fromToken} → ${quote.amount1} ${args.toToken}`,
|
|
370
|
+
});
|
|
371
|
+
}),
|
|
372
|
+
};
|
|
373
|
+
// 9. Get Swap Pool Price
|
|
374
|
+
exports.getSwapPoolPriceTool = {
|
|
375
|
+
name: 'gala_launchpad_get_swap_pool_price',
|
|
376
|
+
description: 'Get current price, tick, and liquidity for a DEX pool. Use to check if liquidity positions are in-range.',
|
|
377
|
+
inputSchema: {
|
|
378
|
+
type: 'object',
|
|
379
|
+
properties: {
|
|
380
|
+
token0: TOKEN_SYMBOL_SCHEMA,
|
|
381
|
+
token1: TOKEN_SYMBOL_SCHEMA,
|
|
382
|
+
fee: FEE_TIER_SCHEMA,
|
|
383
|
+
},
|
|
384
|
+
required: ['token0', 'token1', 'fee'],
|
|
385
|
+
},
|
|
386
|
+
handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
|
|
387
|
+
const priceData = await sdk.getSwapPoolPrice(args.token0, args.token1, args.fee);
|
|
388
|
+
return (0, response_formatter_js_1.formatSuccess)({
|
|
389
|
+
token0: args.token0,
|
|
390
|
+
token1: args.token1,
|
|
391
|
+
fee: args.fee,
|
|
392
|
+
price: priceData.price,
|
|
393
|
+
tick: priceData.tick,
|
|
394
|
+
liquidity: priceData.liquidity,
|
|
395
|
+
message: `Pool price: ${priceData.price} ${args.token1} per ${args.token0} (tick: ${priceData.tick})`,
|
|
396
|
+
});
|
|
397
|
+
}),
|
|
398
|
+
};
|
|
399
|
+
// 10. Get All Swap User Assets (auto-paginated)
|
|
400
|
+
exports.getAllSwapUserAssetsTool = {
|
|
401
|
+
name: 'gala_launchpad_get_all_swap_user_assets',
|
|
402
|
+
description: 'Get ALL token assets and balances for a wallet (auto-paginates). Complete portfolio view for DEX trading.',
|
|
403
|
+
inputSchema: {
|
|
404
|
+
type: 'object',
|
|
405
|
+
properties: {
|
|
406
|
+
walletAddress: {
|
|
407
|
+
...common_schemas_js_1.ADDRESS_SCHEMA,
|
|
408
|
+
description: 'Wallet address to query (e.g., "0x1234..." or "eth|1234...")',
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
required: ['walletAddress'],
|
|
412
|
+
},
|
|
413
|
+
handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
|
|
414
|
+
const assets = await sdk.getAllSwapUserAssets(args.walletAddress);
|
|
415
|
+
return (0, response_formatter_js_1.formatSuccess)({
|
|
416
|
+
walletAddress: args.walletAddress,
|
|
417
|
+
assetCount: assets.length,
|
|
418
|
+
assets: assets.map((asset) => ({
|
|
419
|
+
symbol: asset.symbol,
|
|
420
|
+
balance: asset.balance,
|
|
421
|
+
decimals: asset.decimals,
|
|
422
|
+
})),
|
|
423
|
+
message: `${assets.length} total assets found for wallet ${args.walletAddress} (fully paginated)`,
|
|
424
|
+
});
|
|
425
|
+
}),
|
|
426
|
+
};
|
|
427
|
+
// Export all DEX tools (2 pool discovery + 4 leaderboard + 1 volume + 10 swap/quote tools + 9 liquidity position tools = 26 tools)
|
|
199
428
|
exports.dexTools = [
|
|
200
429
|
fetchDexPools_js_1.fetchDexPoolsTool,
|
|
201
430
|
fetchAllDexPools_js_1.fetchAllDexPoolsTool,
|
|
@@ -204,6 +433,13 @@ exports.dexTools = [
|
|
|
204
433
|
exports.executeSwapTool,
|
|
205
434
|
exports.getSwapUserAssetsTool,
|
|
206
435
|
exports.getSwapPoolInfoTool,
|
|
436
|
+
exports.fetchCompositePoolDataTool,
|
|
437
|
+
exports.calculateDexPoolQuoteLocalTool,
|
|
438
|
+
exports.calculateDexPoolQuoteExternalTool,
|
|
439
|
+
exports.getSwapPoolPriceTool,
|
|
440
|
+
exports.getAllSwapUserAssetsTool,
|
|
441
|
+
...leaderboard_js_1.leaderboardTools,
|
|
442
|
+
...volume_js_1.volumeTools,
|
|
207
443
|
...liquidity_positions_js_1.liquidityPositionTools,
|
|
208
444
|
];
|
|
209
445
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/dex/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAGH,qEAAkE;AAClE,yDAAu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EX leaderboard rankings and season management.
|
|
5
|
+
* Provides access to seasonal leaderboards, current rankings, and player achievements.
|
|
6
|
+
*/
|
|
7
|
+
import type { MCPTool } from '../../types/mcp.js';
|
|
8
|
+
/**
|
|
9
|
+
* 1. Fetch All DEX Seasons
|
|
10
|
+
*
|
|
11
|
+
* Returns all available DEX leaderboard seasons with start/end dates and rules.
|
|
12
|
+
* Non-paginated endpoint returning complete list of all seasons.
|
|
13
|
+
*/
|
|
14
|
+
export declare const fetchAllDexSeasonsTool: MCPTool;
|
|
15
|
+
/**
|
|
16
|
+
* 2. Fetch Current DEX Season
|
|
17
|
+
*
|
|
18
|
+
* Returns the currently active DEX leaderboard season based on current date/time.
|
|
19
|
+
* Returns null if no season is currently active.
|
|
20
|
+
*/
|
|
21
|
+
export declare const fetchCurrentDexSeasonTool: MCPTool;
|
|
22
|
+
/**
|
|
23
|
+
* 3. Fetch DEX Leaderboard by Season ID
|
|
24
|
+
*
|
|
25
|
+
* Returns the leaderboard rankings for a specific season.
|
|
26
|
+
* Includes player rankings, XP metrics, and mastery achievements.
|
|
27
|
+
*/
|
|
28
|
+
export declare const fetchDexLeaderboardBySeasonIdTool: MCPTool;
|
|
29
|
+
/**
|
|
30
|
+
* 4. Fetch Current DEX Leaderboard
|
|
31
|
+
*
|
|
32
|
+
* Returns the leaderboard for the currently active season.
|
|
33
|
+
* Combines current season detection with leaderboard retrieval.
|
|
34
|
+
* Returns null if no season is currently active.
|
|
35
|
+
*/
|
|
36
|
+
export declare const fetchCurrentDexLeaderboardTool: MCPTool;
|
|
37
|
+
export declare const leaderboardTools: MCPTool[];
|
|
38
|
+
//# sourceMappingURL=leaderboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"leaderboard.d.ts","sourceRoot":"","sources":["../../../src/tools/dex/leaderboard.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,OAiBpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,EAAE,OA2BvC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,EAAE,OA8B/C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,EAAE,OAqC5C,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,OAAO,EAKrC,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DEX Leaderboard Tools
|
|
4
|
+
*
|
|
5
|
+
* Tools for querying DEX leaderboard rankings and season management.
|
|
6
|
+
* Provides access to seasonal leaderboards, current rankings, and player achievements.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.leaderboardTools = exports.fetchCurrentDexLeaderboardTool = exports.fetchDexLeaderboardBySeasonIdTool = exports.fetchCurrentDexSeasonTool = exports.fetchAllDexSeasonsTool = 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
|
+
// Season ID schema for leaderboard queries
|
|
13
|
+
const SEASON_ID_SCHEMA = {
|
|
14
|
+
type: 'number',
|
|
15
|
+
minimum: 1,
|
|
16
|
+
description: 'DEX season identifier (positive integer)',
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* 1. Fetch All DEX Seasons
|
|
20
|
+
*
|
|
21
|
+
* Returns all available DEX leaderboard seasons with start/end dates and rules.
|
|
22
|
+
* Non-paginated endpoint returning complete list of all seasons.
|
|
23
|
+
*/
|
|
24
|
+
exports.fetchAllDexSeasonsTool = {
|
|
25
|
+
name: 'gala_launchpad_fetch_all_dex_seasons',
|
|
26
|
+
description: 'Fetch all DEX leaderboard seasons - returns complete list of seasons with dates and rules',
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {},
|
|
30
|
+
},
|
|
31
|
+
handler: (0, error_handler_js_1.withErrorHandling)(async (sdk) => {
|
|
32
|
+
const seasons = await sdk.fetchAllDexSeasons();
|
|
33
|
+
return (0, response_formatter_js_1.formatSuccess)({
|
|
34
|
+
seasons,
|
|
35
|
+
totalSeasons: seasons.length,
|
|
36
|
+
message: `Retrieved ${seasons.length} DEX seasons`,
|
|
37
|
+
});
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* 2. Fetch Current DEX Season
|
|
42
|
+
*
|
|
43
|
+
* Returns the currently active DEX leaderboard season based on current date/time.
|
|
44
|
+
* Returns null if no season is currently active.
|
|
45
|
+
*/
|
|
46
|
+
exports.fetchCurrentDexSeasonTool = {
|
|
47
|
+
name: 'gala_launchpad_fetch_current_dex_season',
|
|
48
|
+
description: 'Fetch current active DEX leaderboard season - returns null if no season is active',
|
|
49
|
+
inputSchema: {
|
|
50
|
+
type: 'object',
|
|
51
|
+
properties: {},
|
|
52
|
+
},
|
|
53
|
+
handler: (0, error_handler_js_1.withErrorHandling)(async (sdk) => {
|
|
54
|
+
const season = await sdk.fetchCurrentDexSeason();
|
|
55
|
+
if (season === null) {
|
|
56
|
+
return (0, response_formatter_js_1.formatSuccess)({
|
|
57
|
+
currentSeason: null,
|
|
58
|
+
message: 'No active DEX season at this time',
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return (0, response_formatter_js_1.formatSuccess)({
|
|
62
|
+
currentSeason: season,
|
|
63
|
+
message: `Current season: ${season.name} (ID: ${season.id})`,
|
|
64
|
+
seasonDates: {
|
|
65
|
+
start: season.start.toISOString(),
|
|
66
|
+
end: season.end.toISOString(),
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
}),
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* 3. Fetch DEX Leaderboard by Season ID
|
|
73
|
+
*
|
|
74
|
+
* Returns the leaderboard rankings for a specific season.
|
|
75
|
+
* Includes player rankings, XP metrics, and mastery achievements.
|
|
76
|
+
*/
|
|
77
|
+
exports.fetchDexLeaderboardBySeasonIdTool = {
|
|
78
|
+
name: 'gala_launchpad_fetch_dex_leaderboard_by_season_id',
|
|
79
|
+
description: 'Fetch DEX leaderboard for a specific season - returns rankings with XP metrics and achievements',
|
|
80
|
+
inputSchema: {
|
|
81
|
+
type: 'object',
|
|
82
|
+
properties: {
|
|
83
|
+
seasonId: SEASON_ID_SCHEMA,
|
|
84
|
+
},
|
|
85
|
+
required: ['seasonId'],
|
|
86
|
+
},
|
|
87
|
+
handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
|
|
88
|
+
const leaderboard = await sdk.fetchDexLeaderboardBySeasonId(args.seasonId);
|
|
89
|
+
// Get top 5 entries for summary
|
|
90
|
+
const topEntries = leaderboard.entries.slice(0, 5);
|
|
91
|
+
return (0, response_formatter_js_1.formatSuccess)({
|
|
92
|
+
leaderboard,
|
|
93
|
+
totalEntries: leaderboard.entries.length,
|
|
94
|
+
topEntries,
|
|
95
|
+
topPlayer: {
|
|
96
|
+
wallet: leaderboard.entries[0]?.wallet,
|
|
97
|
+
rank: leaderboard.entries[0]?.rank,
|
|
98
|
+
totalXp: leaderboard.entries[0]?.totalXp,
|
|
99
|
+
titles: leaderboard.entries[0]?.masteryTitles.length || 0,
|
|
100
|
+
},
|
|
101
|
+
message: `Leaderboard for season ${args.seasonId}: ${leaderboard.entries.length} players`,
|
|
102
|
+
});
|
|
103
|
+
}),
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* 4. Fetch Current DEX Leaderboard
|
|
107
|
+
*
|
|
108
|
+
* Returns the leaderboard for the currently active season.
|
|
109
|
+
* Combines current season detection with leaderboard retrieval.
|
|
110
|
+
* Returns null if no season is currently active.
|
|
111
|
+
*/
|
|
112
|
+
exports.fetchCurrentDexLeaderboardTool = {
|
|
113
|
+
name: 'gala_launchpad_fetch_current_dex_leaderboard',
|
|
114
|
+
description: 'Fetch current DEX leaderboard for active season - returns null if no active season',
|
|
115
|
+
inputSchema: {
|
|
116
|
+
type: 'object',
|
|
117
|
+
properties: {},
|
|
118
|
+
},
|
|
119
|
+
handler: (0, error_handler_js_1.withErrorHandling)(async (sdk) => {
|
|
120
|
+
const leaderboard = await sdk.fetchCurrentDexLeaderboard();
|
|
121
|
+
if (leaderboard === null) {
|
|
122
|
+
return (0, response_formatter_js_1.formatSuccess)({
|
|
123
|
+
currentLeaderboard: null,
|
|
124
|
+
message: 'No active season - leaderboard unavailable',
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// Get top 5 entries for summary
|
|
128
|
+
const topEntries = leaderboard.entries.slice(0, 5);
|
|
129
|
+
const topPlayer = leaderboard.entries[0];
|
|
130
|
+
return (0, response_formatter_js_1.formatSuccess)({
|
|
131
|
+
leaderboard,
|
|
132
|
+
totalEntries: leaderboard.entries.length,
|
|
133
|
+
topEntries,
|
|
134
|
+
topPlayer: {
|
|
135
|
+
wallet: topPlayer?.wallet,
|
|
136
|
+
rank: topPlayer?.rank,
|
|
137
|
+
totalXp: topPlayer?.totalXp,
|
|
138
|
+
liquidityXp: topPlayer?.liquidityXp,
|
|
139
|
+
tradingXp: topPlayer?.tradingXp,
|
|
140
|
+
titles: topPlayer?.masteryTitles.length || 0,
|
|
141
|
+
},
|
|
142
|
+
message: `Current leaderboard: ${leaderboard.entries.length} active players`,
|
|
143
|
+
});
|
|
144
|
+
}),
|
|
145
|
+
};
|
|
146
|
+
// Export all leaderboard tools
|
|
147
|
+
exports.leaderboardTools = [
|
|
148
|
+
exports.fetchAllDexSeasonsTool,
|
|
149
|
+
exports.fetchCurrentDexSeasonTool,
|
|
150
|
+
exports.fetchDexLeaderboardBySeasonIdTool,
|
|
151
|
+
exports.fetchCurrentDexLeaderboardTool,
|
|
152
|
+
];
|
|
153
|
+
//# sourceMappingURL=leaderboard.js.map
|
|
@@ -0,0 +1 @@
|
|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,GAAc;IACzC,8BAAsB;IACtB,iCAAyB;IACzB,yCAAiC;IACjC,sCAA8B;CAC/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liquidity-positions.d.ts","sourceRoot":"","sources":["../../../src/tools/dex/liquidity-positions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"liquidity-positions.d.ts","sourceRoot":"","sources":["../../../src/tools/dex/liquidity-positions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAgDlD,eAAO,MAAM,6BAA6B,EAAE,OA+E3C,CAAC;AAGF,eAAO,MAAM,gCAAgC,EAAE,OAgD9C,CAAC;AAGF,eAAO,MAAM,4BAA4B,EAAE,OA+C1C,CAAC;AAGF,eAAO,MAAM,wBAAwB,EAAE,OAyDtC,CAAC;AAGF,eAAO,MAAM,2BAA2B,EAAE,OAiDzC,CAAC;AAGF,eAAO,MAAM,uBAAuB,EAAE,OA8ErC,CAAC;AAGF,eAAO,MAAM,uBAAuB,EAAE,OA8ErC,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,OAgEjC,CAAC;AAGF,eAAO,MAAM,uBAAuB,EAAE,OAmDrC,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,OAAO,EAU3C,CAAC"}
|
|
@@ -30,8 +30,10 @@ const FEE_TIER_SCHEMA = {
|
|
|
30
30
|
* Helper function to format position data for MCP response
|
|
31
31
|
* Extracts and maps position fields consistently across multiple tools
|
|
32
32
|
*/
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK position type not fully exported
|
|
33
34
|
function formatPositions(positions) {
|
|
34
35
|
return (positions && Array.isArray(positions))
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK position type not fully exported
|
|
35
37
|
? positions.map((pos) => ({
|
|
36
38
|
positionId: pos.positionId,
|
|
37
39
|
token0: pos.token0,
|
|
@@ -76,19 +78,24 @@ exports.getUserLiquidityPositionsTool = {
|
|
|
76
78
|
required: ['ownerAddress'],
|
|
77
79
|
},
|
|
78
80
|
handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK return type varies by invocation
|
|
79
82
|
let result;
|
|
80
83
|
// Determine which parameters to pass based on what's provided
|
|
81
84
|
if (args.withPrices) {
|
|
82
85
|
// When pricing is requested, pass pricing options as 3rd parameter (can't use bookmark with options)
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK method options not fully typed
|
|
83
87
|
const pricingOptions = { withPrices: true };
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK method overloads not exported
|
|
84
89
|
result = await sdk.getSwapUserLiquidityPositions(args.ownerAddress, args.limit, pricingOptions);
|
|
85
90
|
}
|
|
86
91
|
else if (args.bookmark) {
|
|
87
92
|
// When only bookmark pagination is used, pass bookmark as 3rd parameter
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK method overloads not exported
|
|
88
94
|
result = await sdk.getSwapUserLiquidityPositions(args.ownerAddress, args.limit, args.bookmark);
|
|
89
95
|
}
|
|
90
96
|
else {
|
|
91
97
|
// No pagination or pricing, just fetch positions
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK method overloads not exported
|
|
92
99
|
result = await sdk.getSwapUserLiquidityPositions(args.ownerAddress, args.limit);
|
|
93
100
|
}
|
|
94
101
|
// Handle both array and object returns for backward compatibility
|
|
@@ -129,7 +136,9 @@ exports.getAllUserLiquidityPositionsTool = {
|
|
|
129
136
|
},
|
|
130
137
|
handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
|
|
131
138
|
// Prepare pricing options object if requested
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK method options not fully typed
|
|
132
140
|
const pricingOptions = args.withPrices ? { withPrices: true } : undefined;
|
|
141
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK return type varies by invocation
|
|
133
142
|
const result = await sdk.getAllSwapUserLiquidityPositions(args.ownerAddress, pricingOptions);
|
|
134
143
|
// Handle both array and object returns for backward compatibility
|
|
135
144
|
const positions = Array.isArray(result) ? result : result?.items || [];
|
|
@@ -366,7 +375,7 @@ exports.addLiquidityByPriceTool = {
|
|
|
366
375
|
amount1Min: args.amount1Min || '0',
|
|
367
376
|
});
|
|
368
377
|
return (0, response_formatter_js_1.formatSuccess)({
|
|
369
|
-
transactionId: result.transactionId
|
|
378
|
+
transactionId: result.transactionId,
|
|
370
379
|
status: result.status,
|
|
371
380
|
token0: args.token0,
|
|
372
381
|
token1: args.token1,
|
|
@@ -444,7 +453,7 @@ exports.addLiquidityByTicksTool = {
|
|
|
444
453
|
amount1Min: args.amount1Min || '0',
|
|
445
454
|
});
|
|
446
455
|
return (0, response_formatter_js_1.formatSuccess)({
|
|
447
|
-
transactionId: result.transactionId
|
|
456
|
+
transactionId: result.transactionId,
|
|
448
457
|
status: result.status,
|
|
449
458
|
token0: args.token0,
|
|
450
459
|
token1: args.token1,
|
|
@@ -510,7 +519,7 @@ exports.removeLiquidityTool = {
|
|
|
510
519
|
deadline,
|
|
511
520
|
});
|
|
512
521
|
return (0, response_formatter_js_1.formatSuccess)({
|
|
513
|
-
transactionId: result.transactionId
|
|
522
|
+
transactionId: result.transactionId,
|
|
514
523
|
status: result.status,
|
|
515
524
|
positionId: args.positionId,
|
|
516
525
|
liquidity: args.liquidity,
|
|
@@ -562,7 +571,7 @@ exports.collectPositionFeesTool = {
|
|
|
562
571
|
amount1Max: args.amount1Max,
|
|
563
572
|
});
|
|
564
573
|
return (0, response_formatter_js_1.formatSuccess)({
|
|
565
|
-
transactionId: result.transactionId
|
|
574
|
+
transactionId: result.transactionId,
|
|
566
575
|
status: result.status,
|
|
567
576
|
positionId: args.positionId,
|
|
568
577
|
amount0Collected: result.amount0,
|