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

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,443 +1,44 @@
1
- /**
2
- * DEX Helper Utilities
3
- *
4
- * Shared formatting and validation functions for DEX tools.
5
- * Reduces duplication across quote, position, volume, and swap tools.
6
- *
7
- * Contains:
8
- * - Quote response formatting (SwapQuoteResult, DexPoolQuoteResult)
9
- * - Liquidity position formatting
10
- * - Wallet validation
11
- * - Volume trend analysis
12
- * - Token asset mapping
13
- * - Handler factories for quote tools
14
- */
15
- import type { SwapQuoteResult, DexPoolQuoteResult, LaunchpadSDK, LiquidityPosition, DexToken, GetLiquidityPositionsResult, GSwapTokenAsset } from '@gala-chain/launchpad-sdk';
1
+ /** Shared formatting and argument helpers for the v6 GSwap MCP tools. */
2
+ import type { GSwap, Position, PriceIn, Slot0, TradingSymbol } from '@gala-chain/gswap-sdk';
3
+ import type { LaunchpadSDK } from '@gala-chain/launchpad-sdk';
16
4
  import type { MCPTool } from '../../types/mcp.js';
17
- /**
18
- * Format a swap quote response with standardized fields.
19
- *
20
- * Handles SwapQuoteResult (from getSwapQuote* methods).
21
- * Adds optional calculationMode for context.
22
- *
23
- * @param quote - The quote result to format (SwapQuoteResult)
24
- * @param mode - Optional calculation mode (e.g., 'local', 'external')
25
- * @returns Formatted response object with common quote fields
26
- */
27
- export declare function formatQuoteResponse(quote: SwapQuoteResult, mode?: string): object;
28
- /**
29
- * Format a DEX pool quote response with additional pool data.
30
- *
31
- * Handles DexPoolQuoteResult (from calculateDexPoolQuote* methods).
32
- * Includes price tracking and optionally cached data indicator.
33
- *
34
- * @param quote - The pool quote result to format (DexPoolQuoteResult)
35
- * @param tokens - Tuple of [fromToken, toToken] symbols
36
- * @param mode - Calculation mode ('local' or 'external')
37
- * @param usedCachedData - Whether cached pool data was used (optional)
38
- * @returns Formatted response object with pool quote fields
39
- */
40
- export declare function formatDexPoolQuoteResponse(quote: DexPoolQuoteResult, tokens: [fromToken: string, toToken: string], mode: 'local' | 'external', usedCachedData?: boolean): object;
41
- /**
42
- * Options for formatting a position
43
- */
44
- export interface FormatPositionOptions {
45
- /** Include owner address */
46
- includeOwner?: boolean;
47
- /** Include timestamps (createdAt, updatedAt) */
48
- includeTimestamps?: boolean;
49
- }
50
- /**
51
- * Formatted position data for MCP responses
52
- */
53
- export interface FormattedPosition {
54
- positionId: string;
55
- token0: string | Record<string, unknown>;
56
- token1: string | Record<string, unknown>;
57
- feeTier?: number;
58
- liquidity: string;
59
- amount0?: string | undefined;
60
- amount1?: string | undefined;
61
- feeAmount0?: string | undefined;
62
- feeAmount1?: string | undefined;
63
- tickLower: number;
64
- tickUpper: number;
65
- ownerAddress?: string | undefined;
66
- createdAt?: string | undefined;
67
- updatedAt?: string | undefined;
68
- }
69
- /**
70
- * Format a single liquidity position for MCP response.
71
- *
72
- * Core formatting function used by all position-related tools.
73
- * Extracts and maps position fields consistently with optional metadata.
74
- *
75
- * @param position - SDK position object (LiquidityPosition)
76
- * @param options - Optional formatting options (includeOwner, includeTimestamps)
77
- * @returns Formatted position object with standardized fields
78
- *
79
- * @example
80
- * // Basic formatting (for list responses)
81
- * formatPosition(pos);
82
- *
83
- * // With metadata (for detail responses)
84
- * formatPosition(pos, { includeOwner: true, includeTimestamps: true });
85
- */
86
- export declare function formatPosition(position: LiquidityPosition, options?: FormatPositionOptions): FormattedPosition;
87
- /**
88
- * Format liquidity position data for MCP response.
89
- *
90
- * Convenience wrapper around formatPosition for array mapping.
91
- * Handles null/undefined positions gracefully.
92
- *
93
- * @param positions - Array of position objects (LiquidityPosition) to format
94
- * @param options - Optional formatting options passed to each position
95
- * @returns Formatted positions array with standardized fields
96
- */
97
- export declare function formatPositions(positions: LiquidityPosition[], options?: FormatPositionOptions): FormattedPosition[];
98
- /**
99
- * Validate that a wallet is configured.
100
- *
101
- * Checks if SDK has a valid wallet address configured by attempting to get address.
102
- * Used before wallet-required operations.
103
- *
104
- * @param sdk - LaunchpadSDK instance
105
- * @throws Error if wallet not configured
106
- */
107
- export declare function validateWalletConfigured(sdk: LaunchpadSDK): void;
108
- /**
109
- * Format volume trend analysis.
110
- *
111
- * Extracts trend direction and percentage change for volume metrics.
112
- * Used for consistent volume summary formatting across tools.
113
- *
114
- * @param volume1d - 1-day volume
115
- * @param volume7d - 7-day volume
116
- * @param volume30d - 30-day volume
117
- * @param delta1d - 1-day delta change value
118
- * @param delta7d - 7-day delta change value
119
- * @param delta30d - 30-day delta change value
120
- * @returns Formatted trend analysis object
121
- */
122
- export declare function formatVolumeTrends(volume1d: number, volume7d: number, volume30d: number, delta1d: number, delta7d: number, delta30d: number): object;
123
- /**
124
- * Formatted asset data for MCP responses
125
- */
126
- interface FormattedAsset {
127
- symbol: string;
128
- name?: string | undefined;
129
- description?: string | undefined;
130
- image?: string | undefined;
131
- balance: string;
132
- decimals: number;
133
- verified?: boolean | undefined;
134
- compositeKey?: string | undefined;
135
- }
136
- /**
137
- * Map token asset fields for consistent asset formatting.
138
- *
139
- * Extracts and formats token asset metadata with rich information.
140
- * Used for consistent asset mapping across multiple tools.
141
- *
142
- * @param assets - Array of asset objects to map
143
- * @returns Formatted assets array with standardized fields
144
- */
145
- export declare function mapTokenAssets(assets: GSwapTokenAsset[]): FormattedAsset[];
146
- /**
147
- * Valid GalaSwap fee tiers in basis points.
148
- * Used for validation and display formatting.
149
- */
150
- export declare const VALID_FEE_TIERS: readonly [500, 3000, 10000];
151
- /**
152
- * Type representing a valid fee tier value.
153
- */
154
- export type FeeTier = (typeof VALID_FEE_TIERS)[number];
155
- /**
156
- * Format a fee tier as a percentage string.
157
- *
158
- * Converts basis points to percentage for human-readable display.
159
- * Uses proper formula: fee / 10000 to get decimal, then format as percentage.
160
- *
161
- * @param fee - Fee tier in basis points (500, 3000, or 10000)
162
- * @returns Formatted percentage string (e.g., "0.05%", "0.30%", "1.00%")
163
- *
164
- * @example
165
- * formatFeeTierPercent(500) // "0.05%"
166
- * formatFeeTierPercent(3000) // "0.30%"
167
- * formatFeeTierPercent(10000) // "1.00%"
168
- */
169
- export declare function formatFeeTierPercent(fee: number): string;
170
- /**
171
- * Format an array of fee tiers as percentage strings.
172
- *
173
- * Convenience wrapper for formatting multiple fee tiers.
174
- * Common use case: pool info response with available fee tiers.
175
- *
176
- * @param tiers - Array of fee tiers in basis points
177
- * @returns Array of formatted percentage strings
178
- *
179
- * @example
180
- * formatFeeTiersPercent([500, 3000, 10000])
181
- * // ["0.05%", "0.30%", "1.00%"]
182
- */
183
- export declare function formatFeeTiersPercent(tiers: number[]): string[];
184
- /**
185
- * Validate that a fee tier is valid.
186
- *
187
- * Checks if the provided fee tier is one of the valid GalaSwap fee tiers.
188
- * Throws an error with helpful message if invalid.
189
- *
190
- * @param fee - Fee tier to validate
191
- * @throws Error if fee tier is not 500, 3000, or 10000
192
- *
193
- * @example
194
- * validateFeeTier(3000); // OK
195
- * validateFeeTier(1000); // throws Error
196
- */
197
- export declare function validateFeeTier(fee: number): asserts fee is FeeTier;
198
- /**
199
- * Token pair parameters extracted from MCP tool args.
200
- */
201
5
  export interface TokenPairParams {
202
6
  token0: string;
203
7
  token1: string;
204
8
  fee: number;
205
9
  }
206
- /**
207
- * Token pair with tick range parameters extracted from MCP tool args.
208
- */
209
10
  export interface TokenPairWithTicksParams extends TokenPairParams {
210
11
  tickLower: number;
211
12
  tickUpper: number;
212
13
  }
213
- /**
214
- * Extract token pair parameters (token0, token1, fee) from MCP args.
215
- *
216
- * Eliminates repetitive type casting across DEX tools.
217
- * Used in pool queries, quotes, and liquidity operations.
218
- *
219
- * @param args - MCP tool args object
220
- * @returns Typed token pair parameters
221
- *
222
- * @example
223
- * const { token0, token1, fee } = extractTokenPairParams(args);
224
- * await sdk.fetchCompositePoolData({ token0, token1, fee });
225
- */
226
14
  export declare function extractTokenPairParams(args: Record<string, unknown>): TokenPairParams;
227
- /**
228
- * Extract token pair with tick range parameters from MCP args.
229
- *
230
- * Extends extractTokenPairParams with tick boundaries for concentrated liquidity.
231
- * Used in position queries, liquidity add/remove, and fee estimation.
232
- *
233
- * @param args - MCP tool args object
234
- * @returns Typed token pair with tick parameters
235
- *
236
- * @example
237
- * const params = extractTokenPairWithTicksParams(args);
238
- * await sdk.getSwapLiquidityPosition(owner, params);
239
- */
240
15
  export declare function extractTokenPairWithTicksParams(args: Record<string, unknown>): TokenPairWithTicksParams;
241
- /**
242
- * Formatted token metadata for MCP responses
243
- */
244
- interface FormattedTokenMetadata {
245
- symbol: string;
246
- name?: string;
247
- description?: string;
248
- image?: string;
249
- decimals: number;
250
- verified?: boolean;
251
- compositeKey?: string;
252
- category?: string;
253
- type?: string;
254
- collection?: string;
255
- }
256
- /**
257
- * Map token metadata for DEX token discovery responses.
258
- *
259
- * Extracts common token metadata fields for consistent formatting.
260
- * Used in fetchAvailableDexTokens and fetchAllAvailableDexTokens.
261
- *
262
- * @param token - SDK token metadata object
263
- * @returns Formatted token metadata object
264
- */
265
- export declare function mapTokenMetadata(token: DexToken): FormattedTokenMetadata;
266
- /**
267
- * Map array of tokens for DEX token discovery responses.
268
- *
269
- * Convenience wrapper around mapTokenMetadata for array mapping.
270
- *
271
- * @param tokens - Array of SDK token metadata objects
272
- * @returns Formatted token metadata array
273
- *
274
- * @example
275
- * const tokens = await sdk.fetchAllAvailableDexTokens({ search });
276
- * return formatSuccess({ tokens: mapTokenMetadataArray(tokens) });
277
- */
278
- export declare function mapTokenMetadataArray(tokens: DexToken[]): FormattedTokenMetadata[];
279
- /**
280
- * Parsed position list result from SDK.
281
- *
282
- * Normalizes the SDK response format which can be either:
283
- * - Array of positions (legacy)
284
- * - Object with items and prices (modern with pricing)
285
- */
286
- export interface ParsedPositionListResult {
287
- /** Array of position objects */
288
- positions: LiquidityPosition[];
289
- /** Map of position prices (empty if pricing not requested) */
290
- prices: Map<string, unknown>;
291
- /** Number of positions with pricing data */
292
- pricesCount: number;
293
- }
294
- /**
295
- * SDK position list result - can be array (legacy) or object with items/prices (modern)
296
- */
297
- type PositionListInput = LiquidityPosition[] | GetLiquidityPositionsResult;
298
- /**
299
- * Parse SDK position list result into normalized format.
300
- *
301
- * Handles both array and object returns for backward compatibility.
302
- * Used by getUserLiquidityPositions and getAllUserLiquidityPositions.
303
- *
304
- * @param result - Raw SDK result (array or object with items/prices)
305
- * @returns Normalized result with positions, prices map, and count
306
- *
307
- * @example
308
- * const { positions, prices, pricesCount } = parsePositionListResult(result);
309
- */
310
- export declare function parsePositionListResult(result: PositionListInput): ParsedPositionListResult;
311
- /**
312
- * Options for formatting position list response.
313
- */
314
- export interface PositionListResponseOptions {
315
- /** Owner address for the positions */
316
- ownerAddress: string;
317
- /** Whether pricing was requested */
318
- withPrices: boolean;
319
- /** Optional suffix for the message (e.g., "(auto-paginated)") */
320
- messageSuffix?: string;
321
- }
322
- /**
323
- * Format position list response with consistent structure.
324
- *
325
- * Consolidates the common response formatting logic used by both
326
- * getUserLiquidityPositions and getAllUserLiquidityPositions tools.
327
- *
328
- * @param parsed - Parsed position list result from parsePositionListResult
329
- * @param options - Formatting options (ownerAddress, withPrices, messageSuffix)
330
- * @returns Formatted response object ready for formatSuccess()
331
- *
332
- * @example
333
- * const parsed = parsePositionListResult(result);
334
- * return formatSuccess(formatPositionListResponse(parsed, {
335
- * ownerAddress: args.ownerAddress,
336
- * withPrices: !!args.withPrices,
337
- * messageSuffix: '(auto-paginated)',
338
- * }));
339
- */
340
- export declare function formatPositionListResponse(parsed: ParsedPositionListResult, options: PositionListResponseOptions): Record<string, unknown>;
341
- /**
342
- * SDK add liquidity result shape (common fields)
343
- *
344
- * Note: liquidity can be string, BigNumber, or bigint depending on SDK version.
345
- * We use `unknown` for flexibility and pass through to response as-is.
346
- *
347
- * Exported for use in handler factories that need to type the responseBuilder parameter.
348
- */
349
- export interface AddLiquidityResult {
350
- transactionId: string;
351
- status?: string;
352
- positionId?: string;
353
- liquidity?: unknown;
354
- amount0?: string;
355
- amount1?: string;
356
- }
357
- /**
358
- * Common add liquidity input args shape
359
- */
360
- interface AddLiquidityInputArgs {
361
- token0: string;
362
- token1: string;
363
- amount0Desired: string;
364
- amount1Desired: string;
365
- }
366
- /**
367
- * Format add liquidity response with consistent structure.
368
- *
369
- * Consolidates the common response fields for addLiquidityByPrice and addLiquidityByTicks.
370
- * Both operations return the same core fields, differing only in range representation.
371
- *
372
- * @param result - SDK add liquidity result
373
- * @param inputArgs - Original input arguments (for fallback amounts)
374
- * @param rangeField - Object with either priceRange or tickRange field
375
- * @returns Formatted response object ready for formatSuccess()
376
- *
377
- * @example
378
- * return formatSuccess(formatAddLiquidityResponse(result, typedArgs, {
379
- * priceRange: `${typedArgs.minPrice} - ${typedArgs.maxPrice}`,
380
- * }));
381
- */
382
- export declare function formatAddLiquidityResponse(result: AddLiquidityResult, inputArgs: AddLiquidityInputArgs, rangeField: {
383
- priceRange: string;
384
- } | {
385
- tickRange: string;
386
- }): Record<string, unknown>;
387
- /**
388
- * Quote handler configuration for creating swap quote tools
389
- */
16
+ export declare function mapTokenAssets(result: unknown): Array<Record<string, unknown>>;
17
+ export declare function mapTokenMetadataArray(tokens: TradingSymbol[]): Array<Record<string, unknown>>;
18
+ export declare function formatFeeTierPercent(fee: number): string;
19
+ export declare function formatFeeTiersPercent(fees: number[]): string[];
390
20
  export interface SwapQuoteConfig {
391
- /** Tool name (e.g., 'gala_launchpad_get_swap_quote_exact_input') */
392
21
  name: string;
393
- /** Tool description */
394
22
  description: string;
395
- /** Amount description override */
396
23
  amountDescription: string;
397
- /** SDK method to call */
398
- sdkMethod: 'getSwapQuoteExactInput' | 'getSwapQuoteExactOutput';
24
+ exactOutput: boolean;
399
25
  }
400
- /**
401
- * Factory function to create swap quote tools with consistent structure.
402
- *
403
- * Eliminates duplication between exactInput and exactOutput quote tools.
404
- * Both tools share identical schema and handler logic, differing only in
405
- * the description and SDK method called.
406
- *
407
- * @param config - Configuration for the quote tool
408
- * @returns MCPTool definition for the swap quote tool
409
- *
410
- * @example
411
- * const exactInputTool = createSwapQuoteTool({
412
- * name: 'gala_launchpad_get_swap_quote_exact_input',
413
- * description: 'Get swap quote for exact input amount.',
414
- * amountDescription: 'Amount of source token to spend',
415
- * sdkMethod: 'getSwapQuoteExactInput',
416
- * });
417
- */
26
+ /** Create a v6 `sdk.dex.quoting` MCP tool. */
418
27
  export declare function createSwapQuoteTool(config: SwapQuoteConfig): MCPTool;
419
- /**
420
- * DEX pool quote handler configuration
421
- */
422
28
  export interface DexPoolQuoteConfig {
423
- /** Tool name */
424
29
  name: string;
425
- /** Tool description */
426
30
  description: string;
427
- /** Calculation mode ('local' for local math, 'external' for a server-computed DEX backend quote) */
428
- mode: 'local' | 'external';
429
- /** Whether to include compositePoolData parameter (for local mode with caching) */
430
- includeCachedDataParam?: boolean;
31
+ exactOutput?: boolean;
431
32
  }
432
- /**
433
- * Factory function to create DEX pool quote tools.
434
- *
435
- * Eliminates duplication between local and external pool quote tools.
436
- * Handles the composite pool data fetching and mode-specific SDK calls.
437
- *
438
- * @param config - Configuration for the pool quote tool
439
- * @returns MCPTool definition for the DEX pool quote tool
440
- */
33
+ /** Create the legacy-named pool quote tool on the v6 quoting service. */
441
34
  export declare function createDexPoolQuoteTool(config: DexPoolQuoteConfig): MCPTool;
442
- export {};
35
+ export declare function formatPosition(position: Position): Record<string, unknown>;
36
+ export declare function formatPositions(positions: Position[]): Array<Record<string, unknown>>;
37
+ export declare function formatPool<T extends {
38
+ fee: number;
39
+ }>(pool: T): Record<string, unknown>;
40
+ export declare function formatSlot0(slot0: Slot0): Record<string, unknown>;
41
+ export declare function formatDexSubmission(value: unknown): Promise<Record<string, unknown>>;
42
+ export declare function asPriceIn(value: string): PriceIn;
43
+ export type { GSwap, LaunchpadSDK };
443
44
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/tools/dex/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,2BAA2B,EAC3B,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAgDlD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAoBjF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,kBAAkB,EACzB,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,EAC5C,IAAI,EAAE,OAAO,GAAG,UAAU,E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