@gala-chain/launchpad-mcp-server 2.0.0 → 2.0.2-beta.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 (175) hide show
  1. package/.eslintrc.json +68 -8
  2. package/CHANGELOG.md +10 -10
  3. package/README.md +2 -2
  4. package/dist/constants/mcpToolNames.d.ts +21 -2
  5. package/dist/constants/mcpToolNames.d.ts.map +1 -1
  6. package/dist/constants/mcpToolNames.js +17 -3
  7. package/dist/constants/mcpToolNames.js.map +1 -1
  8. package/dist/generated/version.d.ts +1 -1
  9. package/dist/generated/version.d.ts.map +1 -1
  10. package/dist/generated/version.js +1 -1
  11. package/dist/generated/version.js.map +1 -1
  12. package/dist/prompts/advanced-pools.d.ts.map +1 -1
  13. package/dist/prompts/advanced-pools.js.map +1 -1
  14. package/dist/prompts/dex-leaderboard.d.ts +40 -0
  15. package/dist/prompts/dex-leaderboard.d.ts.map +1 -0
  16. package/dist/prompts/dex-leaderboard.js +239 -0
  17. package/dist/prompts/dex-leaderboard.js.map +1 -0
  18. package/dist/prompts/dex-volume.d.ts +19 -0
  19. package/dist/prompts/dex-volume.d.ts.map +1 -0
  20. package/dist/prompts/dex-volume.js +74 -0
  21. package/dist/prompts/dex-volume.js.map +1 -0
  22. package/dist/prompts/index.d.ts +5 -2
  23. package/dist/prompts/index.d.ts.map +1 -1
  24. package/dist/prompts/index.js +11 -2
  25. package/dist/prompts/index.js.map +1 -1
  26. package/dist/prompts/locks.d.ts +16 -0
  27. package/dist/prompts/locks.d.ts.map +1 -0
  28. package/dist/prompts/locks.js +114 -0
  29. package/dist/prompts/locks.js.map +1 -0
  30. package/dist/prompts/monitoring.js.map +1 -1
  31. package/dist/prompts/pools.js +3 -3
  32. package/dist/prompts/pools.js.map +1 -1
  33. package/dist/schemas/common-schemas.d.ts +18 -16
  34. package/dist/schemas/common-schemas.d.ts.map +1 -1
  35. package/dist/schemas/common-schemas.js +8 -0
  36. package/dist/schemas/common-schemas.js.map +1 -1
  37. package/dist/server.d.ts.map +1 -1
  38. package/dist/server.js +3 -1
  39. package/dist/server.js.map +1 -1
  40. package/dist/tools/balance/index.js.map +1 -1
  41. package/dist/tools/creation/index.d.ts.map +1 -1
  42. package/dist/tools/creation/index.js +11 -8
  43. package/dist/tools/creation/index.js.map +1 -1
  44. package/dist/tools/dex/fetchAllDexPools.d.ts.map +1 -1
  45. package/dist/tools/dex/fetchAllDexPools.js +10 -6
  46. package/dist/tools/dex/fetchAllDexPools.js.map +1 -1
  47. package/dist/tools/dex/fetchDexPools.js.map +1 -1
  48. package/dist/tools/dex/index.d.ts.map +1 -1
  49. package/dist/tools/dex/index.js +5 -1
  50. package/dist/tools/dex/index.js.map +1 -1
  51. package/dist/tools/dex/leaderboard.d.ts +38 -0
  52. package/dist/tools/dex/leaderboard.d.ts.map +1 -0
  53. package/dist/tools/dex/leaderboard.js +153 -0
  54. package/dist/tools/dex/leaderboard.js.map +1 -0
  55. package/dist/tools/dex/liquidity-positions.d.ts.map +1 -1
  56. package/dist/tools/dex/liquidity-positions.js +13 -4
  57. package/dist/tools/dex/liquidity-positions.js.map +1 -1
  58. package/dist/tools/dex/volume.d.ts +19 -0
  59. package/dist/tools/dex/volume.d.ts.map +1 -0
  60. package/dist/tools/dex/volume.js +53 -0
  61. package/dist/tools/dex/volume.js.map +1 -0
  62. package/dist/tools/index.d.ts +2 -1
  63. package/dist/tools/index.d.ts.map +1 -1
  64. package/dist/tools/index.js +11 -4
  65. package/dist/tools/index.js.map +1 -1
  66. package/dist/tools/locks/index.d.ts +8 -0
  67. package/dist/tools/locks/index.d.ts.map +1 -0
  68. package/dist/tools/locks/index.js +79 -0
  69. package/dist/tools/locks/index.js.map +1 -0
  70. package/dist/tools/pools/fetchAllPools.d.ts.map +1 -1
  71. package/dist/tools/pools/fetchAllPools.js +8 -5
  72. package/dist/tools/pools/fetchAllPools.js.map +1 -1
  73. package/dist/tools/pools/fetchAllPriceHistory.js +1 -1
  74. package/dist/tools/pools/fetchAllPriceHistory.js.map +1 -1
  75. package/dist/tools/pools/fetchPoolDetails.js.map +1 -1
  76. package/dist/tools/pools/fetchPools.js.map +1 -1
  77. package/dist/tools/pools/fetchPriceHistory.js +1 -1
  78. package/dist/tools/pools/fetchPriceHistory.js.map +1 -1
  79. package/dist/tools/pools/fetchTokenDetails.js +1 -1
  80. package/dist/tools/pools/fetchTokenDetails.js.map +1 -1
  81. package/dist/tools/pools/index.js +1 -1
  82. package/dist/tools/pools/index.js.map +1 -1
  83. package/dist/tools/pools/onDexPoolCreation.d.ts.map +1 -1
  84. package/dist/tools/pools/onDexPoolCreation.js +1 -0
  85. package/dist/tools/pools/onDexPoolCreation.js.map +1 -1
  86. package/dist/tools/pools/onLaunchpadTokenCreation.d.ts.map +1 -1
  87. package/dist/tools/pools/onLaunchpadTokenCreation.js +1 -0
  88. package/dist/tools/pools/onLaunchpadTokenCreation.js.map +1 -1
  89. package/dist/tools/social/index.js.map +1 -1
  90. package/dist/tools/trading/index.js +1 -1
  91. package/dist/tools/trading/index.js.map +1 -1
  92. package/dist/tools/transfers/index.js.map +1 -1
  93. package/dist/tools/utils/clearCache.js.map +1 -1
  94. package/dist/tools/utils/explainSdkUsage.d.ts +10 -0
  95. package/dist/tools/utils/explainSdkUsage.d.ts.map +1 -1
  96. package/dist/tools/utils/explainSdkUsage.js +896 -10
  97. package/dist/tools/utils/explainSdkUsage.js.map +1 -1
  98. package/dist/types/mcp.d.ts +2 -2
  99. package/dist/types/mcp.d.ts.map +1 -1
  100. package/dist/utils/default-values.d.ts.map +1 -1
  101. package/dist/utils/default-values.js +3 -0
  102. package/dist/utils/default-values.js.map +1 -1
  103. package/dist/utils/response-formatter.d.ts.map +1 -1
  104. package/dist/utils/response-formatter.js +1 -0
  105. package/dist/utils/response-formatter.js.map +1 -1
  106. package/dist/utils/tool-factory.d.ts.map +1 -1
  107. package/dist/utils/tool-factory.js +1 -0
  108. package/dist/utils/tool-factory.js.map +1 -1
  109. package/eslint.config.js.bak +113 -0
  110. package/package.json +4 -3
  111. package/dist/prompts/__tests__/promptStructure.test.d.ts +0 -7
  112. package/dist/prompts/__tests__/promptStructure.test.d.ts.map +0 -1
  113. package/dist/prompts/__tests__/promptStructure.test.js +0 -106
  114. package/dist/prompts/__tests__/promptStructure.test.js.map +0 -1
  115. package/dist/prompts/__tests__/registry.test.d.ts +0 -7
  116. package/dist/prompts/__tests__/registry.test.d.ts.map +0 -1
  117. package/dist/prompts/__tests__/registry.test.js +0 -119
  118. package/dist/prompts/__tests__/registry.test.js.map +0 -1
  119. package/dist/scripts/test-all-prompts.d.ts +0 -6
  120. package/dist/scripts/test-all-prompts.d.ts.map +0 -1
  121. package/dist/scripts/test-all-prompts.js +0 -158
  122. package/dist/scripts/test-all-prompts.js.map +0 -1
  123. package/dist/tools/balance/all-assets.d.ts +0 -9
  124. package/dist/tools/balance/all-assets.d.ts.map +0 -1
  125. package/dist/tools/balance/all-assets.js +0 -104
  126. package/dist/tools/balance/all-assets.js.map +0 -1
  127. package/dist/tools/dex/advanced-dex.d.ts +0 -15
  128. package/dist/tools/dex/advanced-dex.d.ts.map +0 -1
  129. package/dist/tools/dex/advanced-dex.js +0 -239
  130. package/dist/tools/dex/advanced-dex.js.map +0 -1
  131. package/dist/tools/dex/pool-price.d.ts +0 -9
  132. package/dist/tools/dex/pool-price.d.ts.map +0 -1
  133. package/dist/tools/dex/pool-price.js +0 -78
  134. package/dist/tools/dex/pool-price.js.map +0 -1
  135. package/dist/tools/dex/pool-quote-calculation.d.ts +0 -9
  136. package/dist/tools/dex/pool-quote-calculation.d.ts.map +0 -1
  137. package/dist/tools/dex/pool-quote-calculation.js +0 -99
  138. package/dist/tools/dex/pool-quote-calculation.js.map +0 -1
  139. package/dist/tools/dex/pool-quote-external.d.ts +0 -10
  140. package/dist/tools/dex/pool-quote-external.d.ts.map +0 -1
  141. package/dist/tools/dex/pool-quote-external.js +0 -84
  142. package/dist/tools/dex/pool-quote-external.js.map +0 -1
  143. package/dist/tools/dex/pool-quote-local.d.ts +0 -10
  144. package/dist/tools/dex/pool-quote-local.d.ts.map +0 -1
  145. package/dist/tools/dex/pool-quote-local.js +0 -84
  146. package/dist/tools/dex/pool-quote-local.js.map +0 -1
  147. package/dist/tools/dex/position-direct.d.ts +0 -9
  148. package/dist/tools/dex/position-direct.d.ts.map +0 -1
  149. package/dist/tools/dex/position-direct.js +0 -65
  150. package/dist/tools/dex/position-direct.js.map +0 -1
  151. package/dist/tools/pools/composite-pool.d.ts +0 -9
  152. package/dist/tools/pools/composite-pool.d.ts.map +0 -1
  153. package/dist/tools/pools/composite-pool.js +0 -69
  154. package/dist/tools/pools/composite-pool.js.map +0 -1
  155. package/dist/tools/pools/fetchAllPrices.d.ts +0 -9
  156. package/dist/tools/pools/fetchAllPrices.d.ts.map +0 -1
  157. package/dist/tools/pools/fetchAllPrices.js +0 -38
  158. package/dist/tools/pools/fetchAllPrices.js.map +0 -1
  159. package/dist/tools/pools/fetchPrices.d.ts +0 -9
  160. package/dist/tools/pools/fetchPrices.d.ts.map +0 -1
  161. package/dist/tools/pools/fetchPrices.js +0 -51
  162. package/dist/tools/pools/fetchPrices.js.map +0 -1
  163. package/dist/tools/utils/cleanup.d.ts +0 -9
  164. package/dist/tools/utils/cleanup.d.ts.map +0 -1
  165. package/dist/tools/utils/cleanup.js +0 -54
  166. package/dist/tools/utils/cleanup.js.map +0 -1
  167. package/dist/tools/utils/faucet.d.ts +0 -10
  168. package/dist/tools/utils/faucet.d.ts.map +0 -1
  169. package/dist/tools/utils/faucet.js +0 -51
  170. package/dist/tools/utils/faucet.js.map +0 -1
  171. package/dist/utils/__tests__/validation.test.d.ts +0 -7
  172. package/dist/utils/__tests__/validation.test.d.ts.map +0 -1
  173. package/dist/utils/__tests__/validation.test.js +0 -122
  174. package/dist/utils/__tests__/validation.test.js.map +0 -1
  175. package/test-mcp.js +0 -89
@@ -1,78 +0,0 @@
1
- "use strict";
2
- /**
3
- * Swap Pool Price Tool
4
- *
5
- * Gets the current price for a token pair in the DEX pool.
6
- * Returns spot price, sqrtPrice, tick, and liquidity information.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.getSwapPoolPriceTool = 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 price queries
13
- const PRICE_TOKEN_SCHEMA = {
14
- type: 'string',
15
- minLength: 1,
16
- maxLength: 20,
17
- description: 'Token symbol (e.g., "GALA", "GUSDC")',
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
- exports.getSwapPoolPriceTool = {
26
- name: 'gala_launchpad_get_swap_pool_price',
27
- description: 'Get the current price and state for a DEX pool. Returns spot price (token1 per token0), sqrtPrice, tick, and liquidity information.',
28
- inputSchema: {
29
- type: 'object',
30
- properties: {
31
- token0: PRICE_TOKEN_SCHEMA,
32
- token1: PRICE_TOKEN_SCHEMA,
33
- fee: FEE_TIER_SCHEMA,
34
- },
35
- required: ['token0', 'token1', 'fee'],
36
- },
37
- handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
38
- try {
39
- // Get current pool price using SDK method (requires all 3 params)
40
- const priceData = await sdk.getSwapPoolPrice(args.token0, args.token1, args.fee);
41
- // Calculate human-readable price from sqrtPrice
42
- const sqrtPrice = Number(priceData.sqrtPrice);
43
- const price = (sqrtPrice / (2 ** 96)) ** 2;
44
- // Price is already adjusted in the SDK
45
- const adjustedPrice = price;
46
- return (0, response_formatter_js_1.formatSuccess)({
47
- poolId: `${args.token0}-${args.token1}-${args.fee}`,
48
- price: adjustedPrice.toString(),
49
- priceFormatted: `1 ${args.token0} = ${adjustedPrice.toFixed(6)} ${args.token1}`,
50
- inversePrice: adjustedPrice !== 0 ? (1 / adjustedPrice).toString() : null,
51
- inversePriceFormatted: adjustedPrice !== 0
52
- ? `1 ${args.token1} = ${(1 / adjustedPrice).toFixed(6)} ${args.token0}`
53
- : null,
54
- poolState: {
55
- sqrtPrice: priceData.sqrtPrice,
56
- tick: priceData.tick,
57
- liquidity: priceData.liquidity,
58
- },
59
- poolExists: true,
60
- message: `Current price: 1 ${args.token0} = ${adjustedPrice.toFixed(6)} ${args.token1} (tick: ${priceData.tick})`,
61
- });
62
- }
63
- catch (error) {
64
- // Handle case where pool doesn't exist
65
- if (error instanceof Error && (error.message.includes('pool') || error.message.includes('not found'))) {
66
- return (0, response_formatter_js_1.formatSuccess)({
67
- poolId: `${args.token0}-${args.token1}-${args.fee}`,
68
- poolExists: false,
69
- price: null,
70
- message: `No active pool found for ${args.token0}/${args.token1} with ${args.fee} fee tier. The pool may not exist or tokens may not be graduated to DEX yet.`,
71
- });
72
- }
73
- // Re-throw other errors to be handled by withErrorHandling
74
- throw error;
75
- }
76
- }),
77
- };
78
- //# sourceMappingURL=pool-price.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pool-price.js","sourceRoot":"","sources":["../../../src/tools/dex/pool-price.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,6EAAkE;AAClE,mEAAiE;AAEjE,wCAAwC;AACxC,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,EAAE;IACb,WAAW,EAAE,sCAAsC;CACpD,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,oBAAoB,GAAY;IAC3C,IAAI,EAAE,oCAAoC;IAC1C,WAAW,EAAE,qIAAqI;IAClJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE,k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IAAI;gBACR,SAAS,EAAE;oBACT,SAAS,EAAE,SAAS,CAAC,SAAS;oBAC9B,IAAI,EAAE,SAAS,CAAC,IAAI;oBACpB,SAAS,EAAE,SAAS,CAAC,SAAS;iBAC/B;gBACD,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,oBAAoB,IAAI,CAAC,MAAM,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,WAAW,SAAS,CAAC,IAAI,GAAG;aAClH,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,uCAAuC;YACvC,IAAI,KAAK,YAAY,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;gBACtG,OAAO,IAAA,qCAAa,EAAC;oBACnB,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE;oBACnD,UAAU,EAAE,KAAK;oBACjB,KAAK,EAAE,IAAI;oBACX,OAAO,EAAE,4BAA4B,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,SAAS,IAAI,CAAC,GAAG,8EAA8E;iBAC/J,CAAC,CAAC;YACL,CAAC;YAED,2DAA2D;YAC3D,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC;CACH,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * DEX Pool Quote Calculation Tool
3
- *
4
- * Calculates swap quotes for DEX pools using either local or external calculation modes.
5
- * Requires fetching composite pool data first, then calculating quotes locally or via GalaChain.
6
- */
7
- import type { MCPTool } from '../../types/mcp.js';
8
- export declare const calculateDexPoolQuoteTool: MCPTool;
9
- //# sourceMappingURL=pool-quote-calculation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pool-quote-calculation.d.ts","sourceRoot":"","sources":["../../../src/tools/dex/pool-quote-calculation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAgClD,eAAO,MAAM,yBAAyB,EAAE,OAmEvC,CAAC"}
@@ -1,99 +0,0 @@
1
- "use strict";
2
- /**
3
- * DEX Pool Quote Calculation Tool
4
- *
5
- * Calculates swap quotes for DEX pools using either local or external calculation modes.
6
- * Requires fetching composite pool data first, then calculating quotes locally or via GalaChain.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.calculateDexPoolQuoteTool = 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 schema for quote calculations
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
- // Amount schema
25
- const AMOUNT_SCHEMA = {
26
- type: 'string',
27
- pattern: '^\\d+(\\.\\d+)?$',
28
- description: 'Amount to swap (as decimal string, e.g., "10.5")',
29
- };
30
- // Calculation mode schema
31
- const MODE_SCHEMA = {
32
- type: 'string',
33
- enum: ['local', 'external'],
34
- description: 'Calculation mode: "local" for offline quotes, "external" for GalaChain quotes (default: "local")',
35
- };
36
- exports.calculateDexPoolQuoteTool = {
37
- name: 'gala_launchpad_calculate_dex_pool_quote',
38
- description: 'Calculate DEX pool swap quotes. Specify token pair, fee tier, and amount to get estimated output. Use "local" mode for instant offline quotes or "external" for live GalaChain quotes.',
39
- inputSchema: {
40
- type: 'object',
41
- properties: {
42
- token0: TOKEN_SCHEMA,
43
- token1: TOKEN_SCHEMA,
44
- fee: FEE_TIER_SCHEMA,
45
- fromToken: TOKEN_SCHEMA,
46
- toToken: TOKEN_SCHEMA,
47
- amount: AMOUNT_SCHEMA,
48
- mode: MODE_SCHEMA,
49
- },
50
- required: ['token0', 'token1', 'fee', 'fromToken', 'toToken', 'amount'],
51
- },
52
- handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => {
53
- // Default mode to 'local' if not provided
54
- const calculationMode = args.mode || 'local';
55
- // First fetch composite pool data
56
- const compositeData = await sdk.fetchCompositePoolData({
57
- token0: args.token0,
58
- token1: args.token1,
59
- fee: args.fee,
60
- });
61
- // Calculate quote using the appropriate method
62
- const quote = calculationMode === 'external'
63
- ? await sdk.calculateDexPoolQuoteExactAmountExternal({
64
- compositePoolData: compositeData,
65
- fromToken: args.fromToken,
66
- toToken: args.toToken,
67
- amount: args.amount,
68
- })
69
- : await sdk.calculateDexPoolQuoteExactAmountLocal({
70
- compositePoolData: compositeData,
71
- fromToken: args.fromToken,
72
- toToken: args.toToken,
73
- amount: args.amount,
74
- });
75
- // Determine swap direction
76
- const isToken0ToToken1 = args.fromToken === args.token0;
77
- const inputAmount = args.amount;
78
- const outputAmount = isToken0ToToken1 ? quote.amount1 : quote.amount0;
79
- // Calculate price impact if provided
80
- const priceImpact = quote.priceImpact || 'N/A';
81
- const executionPrice = quote.executionPrice || 'N/A';
82
- return (0, response_formatter_js_1.formatSuccess)({
83
- poolId: `${args.token0}-${args.token1}-${args.fee}`,
84
- fromToken: args.fromToken,
85
- toToken: args.toToken,
86
- inputAmount: inputAmount,
87
- outputAmount: outputAmount,
88
- prices: {
89
- currentSqrtPrice: quote.currentSqrtPrice,
90
- newSqrtPrice: quote.newSqrtPrice,
91
- executionPrice: executionPrice,
92
- priceImpact: priceImpact,
93
- },
94
- calculationMode: calculationMode,
95
- message: `Swapping ${inputAmount} ${args.fromToken.split('|')[2] || args.fromToken} will yield ${outputAmount} ${args.toToken.split('|')[2] || args.toToken}`,
96
- });
97
- }),
98
- };
99
- //# sourceMappingURL=pool-quote-calculation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pool-quote-calculation.js","sourceRoot":"","sources":["../../../src/tools/dex/pool-quote-calculation.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,6EAAkE;AAClE,mEAAiE;AAEjE,sCAAsC;AACtC,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;AAEF,gBAAgB;AAChB,MAAM,aAAa,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,kBAAkB;IAC3B,WAAW,EAAE,kDAAkD;CAChE,CAAC;AAEF,0BAA0B;AAC1B,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;IAC3B,WAAW,EAAE,kGAAkG;CAChH,CAAC;AAEW,QAAA,yBAAyB,GAAY;IAChD,IAAI,EAAE,yCAAyC;IAC/C,WAAW,EAAE,wLAAwL;IACrM,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE,YAAY;YACpB,MAAM,EAAE,YAAY;YACpB,GAAG,EAAE,eAAe;YACpB,SAAS,EAAE,YAAY;YACvB,OAAO,EAAE,YAAY;YACrB,MAAM,EAAE,aAAa;YACrB,IAAI,EAAE,WAAW;SAClB;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC;KACxE;IACD,OAAO,EAAE,IAAA,oCAAiB,EAAC,KAAK,EAAE,GAA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AAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE;YACnD,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,WAAW;YACxB,YAAY,EAAE,YAAY;YAC1B,MAAM,EAAE;gBACN,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;gBACxC,YAAY,EAAE,KAAK,CAAC,YAAY;gBAChC,cAAc,EAAE,cAAc;gBAC9B,WAAW,EAAE,WAAW;aACzB;YACD,eAAe,EAAE,eAAe;YAChC,OAAO,EAAE,YAAY,WAAW,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,eAAe,YAAY,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE;SAC9J,CAAC,CAAC;IACL,CAAC,CAAC;CACH,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * DEX Pool Quote External Tool
3
- *
4
- * Calculate DEX pool swap quotes using EXTERNAL GalaChain network (real-time pricing).
5
- * Provides real-time on-chain quotes directly from the blockchain.
6
- * Slower than local calculation but always reflects current pool state.
7
- */
8
- import type { MCPTool } from '../../types/mcp.js';
9
- export declare const calculateDexPoolQuoteExternalTool: MCPTool;
10
- //# sourceMappingURL=pool-quote-external.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pool-quote-external.d.ts","sourceRoot":"","sources":["../../../src/tools/dex/pool-quote-external.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAyBlD,eAAO,MAAM,iCAAiC,EAAE,OAwD/C,CAAC"}
@@ -1,84 +0,0 @@
1
- "use strict";
2
- /**
3
- * DEX Pool Quote External Tool
4
- *
5
- * Calculate DEX pool swap quotes using EXTERNAL GalaChain network (real-time pricing).
6
- * Provides real-time on-chain quotes directly from the blockchain.
7
- * Slower than local calculation but always reflects current pool state.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.calculateDexPoolQuoteExternalTool = 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.calculateDexPoolQuoteExternalTool = {
32
- name: 'gala_launchpad_calculate_dex_pool_quote_external',
33
- description: 'Calculate DEX pool swap quotes using EXTERNAL GalaChain network (real-time on-chain pricing). Network-dependent, provides current blockchain pricing. Requires fetching composite pool data first.',
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 EXTERNAL method (real-time, on-chain)
54
- const quote = await sdk.calculateDexPoolQuoteExactAmountExternal({
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: 'external',
80
- message: `EXTERNAL quote: Swapping ${inputAmount} ${args.fromToken.split('|')[2] || args.fromToken} will yield ${outputAmount} ${args.toToken.split('|')[2] || args.toToken} (real-time GalaChain network data)`,
81
- });
82
- }),
83
- };
84
- //# sourceMappingURL=pool-quote-external.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pool-quote-external.js","sourceRoot":"","sources":["../../../src/tools/dex/pool-quote-external.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAGH,6EAAkE;AAClE,mEAAiE;AAEjE,sCAAsC;AACtC,MAAM,YAAY,GAAG;IACnB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,oGAAoG;CAClH,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;AAEF,gBAAgB;AAChB,MAAM,aAAa,GAAG;IAC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;QAEtE,qCAAqC;QACrC,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC;QAC/C,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC;QAErD,OAAO,IAAA,qCAAa,EAAC;YACnB,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE;YACnD,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,WAAW;YACxB,YAAY,EAAE,YAAY;YAC1B,MAAM,EAAE;gBACN,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;gBACxC,YAAY,EAAE,KAAK,CAAC,YAAY;gBAChC,cAAc,EAAE,cAAc;gBAC9B,WAAW,EAAE,WAAW;aACzB;YACD,eAAe,EAAE,UAAU;YAC3B,OAAO,EAAE,4BAA4B,WAAW,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,eAAe,YAAY,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,qCAAqC;SACjN,CAAC,CAAC;IACL,CAAC,CAAC;CACH,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * DEX Pool Quote Local Tool
3
- *
4
- * Calculate DEX pool swap quotes using LOCAL/offline bonding curve formulas.
5
- * Provides instant client-side calculation without network call to GalaChain.
6
- * Requires composite pool data to be fetched first.
7
- */
8
- import type { MCPTool } from '../../types/mcp.js';
9
- export declare const calculateDexPoolQuoteLocalTool: MCPTool;
10
- //# sourceMappingURL=pool-quote-local.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pool-quote-local.d.ts","sourceRoot":"","sources":["../../../src/tools/dex/pool-quote-local.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAyBlD,eAAO,MAAM,8BAA8B,EAAE,OAwD5C,CAAC"}
@@ -1,84 +0,0 @@
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
@@ -1 +0,0 @@
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,GAAG;IACnB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,oGAAoG;CAClH,CAAC;AAEF,kBAAkB;AAClB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,IAAI,CAAC,MAAM,CAAC;QACxD,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC;QAChC,MAAM,YAAY,GAAG,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;QAEtE,qCAAqC;QACrC,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC;QAC/C,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC;QAErD,OAAO,IAAA,qCAAa,EAAC;YACnB,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE;YACnD,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,WAAW;YACxB,YAAY,EAAE,YAAY;YAC1B,MAAM,EAAE;gBACN,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;gBACxC,YAAY,EAAE,KAAK,CAAC,YAAY;gBAChC,cAAc,EAAE,cAAc;gBAC9B,WAAW,EAAE,WAAW;aACzB;YACD,eAAe,EAAE,OAAO;YACxB,OAAO,EAAE,yBAAyB,WAAW,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,eAAe,YAAY,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,iCAAiC;SAC1M,CAAC,CAAC;IACL,CAAC,CAAC;CACH,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Swap Position Direct Tool
3
- *
4
- * Fetch LP position details by position ID with 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
@@ -1 +0,0 @@
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"}
@@ -1,65 +0,0 @@
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
@@ -1 +0,0 @@
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,YAAY,EAAE,cAAc,CAAC;KACzC;IACD,OAAO,EAAE,IAAA,oCAAiB,EAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC7C,qBAAqB;QACrB,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,4BAA4B,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAE5F,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,IAAA,qCAAa,EAAC;gBACnB,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,KAAK,EAAE,KAAK;gBACZ,OAAO,EAAE,YAAY,IAAI,CAAC,UAAU,wBAAwB,IAAI,CAAC,YAAY,EAAE;aAChF,CAAC,CAAC;QACL,CAAC;QAED,sCAAsC;QACtC,OAAO,IAAA,qCAAa,EAAC;YACnB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,KAAK,EAAE,IAAI;YACX,QAAQ,EAAE;gBACR,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,SAAS,EAAE,QAAQ,CAAC,SAAS;gBAC7B,SAAS,EAAE,QAAQ,CAAC,SAAS;gBAC7B,SAAS,EAAE,QAAQ,CAAC,SAAS;gBAC7B,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,UAAU,EAAE,QAAQ,CAAC,UAAU;gBAC/B,UAAU,EAAE,QAAQ,CAAC,UAAU;aAChC;YACD,OAAO,EAAE,YAAY,IAAI,CAAC,UAAU,WAAW,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,UAAU,QAAQ,CAAC,OAAO,gBAAgB,QAAQ,CAAC,SAAS,GAAG;SACjJ,CAAC,CAAC;IACL,CAAC,CAAC;CACH,CAAC"}
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,69 +0,0 @@
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
@@ -1 +0,0 @@
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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,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"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Fetch All Latest Prices Tool
3
- *
4
- * Queries all latest token prices from MySQL database with automatic pagination.
5
- * Requires MYSQL_CONNECTION_STRING environment variable to be configured.
6
- */
7
- import type { MCPTool } from '../../types/mcp.js';
8
- export declare const fetchAllPricesTool: MCPTool;
9
- //# sourceMappingURL=fetchAllPrices.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetchAllPrices.d.ts","sourceRoot":"","sources":["../../../src/tools/pools/fetchAllPrices.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAIlD,eAAO,MAAM,kBAAkB,EAAE,OA2BhC,CAAC"}