@gala-chain/launchpad-sdk 3.31.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/API.md +524 -4
  2. package/CHANGELOG.md +92 -0
  3. package/EXAMPLES.md +845 -0
  4. package/README.md +421 -14
  5. package/dist/LaunchpadSDK.d.ts +435 -18
  6. package/dist/LaunchpadSDK.d.ts.map +1 -1
  7. package/dist/api/LaunchpadAPI.d.ts.map +1 -1
  8. package/dist/api/dto/TransferTokenDto.d.ts.map +1 -1
  9. package/dist/constants/version.generated.d.ts +1 -1
  10. package/dist/constants/version.generated.d.ts.map +1 -1
  11. package/dist/helpers/sdk.d.ts +1 -0
  12. package/dist/helpers/sdk.d.ts.map +1 -1
  13. package/dist/index.cjs.js +1 -1
  14. package/dist/index.d.ts +10 -3
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.esm.js +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/services/BaseService.d.ts +32 -3
  19. package/dist/services/BaseService.d.ts.map +1 -1
  20. package/dist/services/BundleService.d.ts.map +1 -1
  21. package/dist/services/CommentService.d.ts.map +1 -1
  22. package/dist/services/DexBackendClient.d.ts +46 -0
  23. package/dist/services/DexBackendClient.d.ts.map +1 -0
  24. package/dist/services/DexPoolService.d.ts +54 -12
  25. package/dist/services/DexPoolService.d.ts.map +1 -1
  26. package/dist/services/DexQuoteService.d.ts +288 -0
  27. package/dist/services/DexQuoteService.d.ts.map +1 -0
  28. package/dist/services/DexService.d.ts.map +1 -1
  29. package/dist/services/FaucetService.d.ts.map +1 -1
  30. package/dist/services/GSwapService.d.ts +519 -44
  31. package/dist/services/GSwapService.d.ts.map +1 -1
  32. package/dist/services/GalaChainGatewayClient.d.ts +89 -0
  33. package/dist/services/GalaChainGatewayClient.d.ts.map +1 -0
  34. package/dist/services/GalaChainService.d.ts +26 -0
  35. package/dist/services/GalaChainService.d.ts.map +1 -1
  36. package/dist/services/ImageService.d.ts.map +1 -1
  37. package/dist/services/PoolService.d.ts.map +1 -1
  38. package/dist/services/PoolStateManager.d.ts +176 -0
  39. package/dist/services/PoolStateManager.d.ts.map +1 -0
  40. package/dist/services/PriceHistoryService.d.ts +4 -5
  41. package/dist/services/PriceHistoryService.d.ts.map +1 -1
  42. package/dist/services/SignatureService.d.ts +15 -38
  43. package/dist/services/SignatureService.d.ts.map +1 -1
  44. package/dist/services/TokenClassKeyService.d.ts +3 -4
  45. package/dist/services/TokenClassKeyService.d.ts.map +1 -1
  46. package/dist/services/TokenMetadataCache.d.ts +2 -2
  47. package/dist/services/TokenMetadataCache.d.ts.map +1 -1
  48. package/dist/services/TokenMetadataService.d.ts +3 -3
  49. package/dist/services/TokenMetadataService.d.ts.map +1 -1
  50. package/dist/services/TokenResolverService.d.ts +2 -2
  51. package/dist/services/TokenResolverService.d.ts.map +1 -1
  52. package/dist/services/TradeService.d.ts.map +1 -1
  53. package/dist/services/UserService.d.ts.map +1 -1
  54. package/dist/services/WebSocketService.d.ts +100 -2
  55. package/dist/services/WebSocketService.d.ts.map +1 -1
  56. package/dist/services/__mocks__/logger.mock.d.ts +17 -0
  57. package/dist/services/__mocks__/logger.mock.d.ts.map +1 -0
  58. package/dist/types/common.d.ts +2 -0
  59. package/dist/types/common.d.ts.map +1 -1
  60. package/dist/types/composite-pool.dto.d.ts +103 -0
  61. package/dist/types/composite-pool.dto.d.ts.map +1 -0
  62. package/dist/types/dex-pool.dto.d.ts +56 -5
  63. package/dist/types/dex-pool.dto.d.ts.map +1 -1
  64. package/dist/types/dto.d.ts +6 -6
  65. package/dist/types/dto.d.ts.map +1 -1
  66. package/dist/types/eip712-types.d.ts +140 -0
  67. package/dist/types/eip712-types.d.ts.map +1 -0
  68. package/dist/types/galachain-api.types.d.ts +206 -0
  69. package/dist/types/galachain-api.types.d.ts.map +1 -0
  70. package/dist/types/gswap-responses.types.d.ts +366 -0
  71. package/dist/types/gswap-responses.types.d.ts.map +1 -0
  72. package/dist/types/gswap.dto.d.ts +58 -3
  73. package/dist/types/gswap.dto.d.ts.map +1 -1
  74. package/dist/types/launchpad.dto.d.ts +57 -0
  75. package/dist/types/launchpad.dto.d.ts.map +1 -1
  76. package/dist/types/pool-state-delta.dto.d.ts +246 -0
  77. package/dist/types/pool-state-delta.dto.d.ts.map +1 -0
  78. package/dist/types/pool-state-manager-config.dto.d.ts +103 -0
  79. package/dist/types/pool-state-manager-config.dto.d.ts.map +1 -0
  80. package/dist/utils/SignatureHelper.d.ts.map +1 -1
  81. package/dist/utils/auto-pagination.d.ts +206 -0
  82. package/dist/utils/auto-pagination.d.ts.map +1 -0
  83. package/dist/utils/bignumber-helpers.d.ts +336 -0
  84. package/dist/utils/bignumber-helpers.d.ts.map +1 -0
  85. package/dist/utils/bignumber-pool-cache.d.ts +169 -0
  86. package/dist/utils/bignumber-pool-cache.d.ts.map +1 -0
  87. package/dist/utils/composite-pool-converter.d.ts +121 -0
  88. package/dist/utils/composite-pool-converter.d.ts.map +1 -0
  89. package/dist/utils/errors.d.ts +86 -0
  90. package/dist/utils/errors.d.ts.map +1 -1
  91. package/dist/utils/http.d.ts.map +1 -1
  92. package/dist/utils/load-env.d.ts +31 -0
  93. package/dist/utils/load-env.d.ts.map +1 -0
  94. package/dist/utils/pool-pair-parser.d.ts +55 -0
  95. package/dist/utils/pool-pair-parser.d.ts.map +1 -0
  96. package/dist/utils/pool-state-validator.d.ts +207 -0
  97. package/dist/utils/pool-state-validator.d.ts.map +1 -0
  98. package/dist/utils/position-filters.d.ts +253 -0
  99. package/dist/utils/position-filters.d.ts.map +1 -0
  100. package/dist/utils/swap-delta-calculator.d.ts +231 -0
  101. package/dist/utils/swap-delta-calculator.d.ts.map +1 -0
  102. package/dist/utils/tick-crossing-handler.d.ts +250 -0
  103. package/dist/utils/tick-crossing-handler.d.ts.map +1 -0
  104. package/dist/utils/token-format-converter.d.ts +85 -6
  105. package/dist/utils/token-format-converter.d.ts.map +1 -1
  106. package/dist/utils/token-parser.d.ts +235 -0
  107. package/dist/utils/token-parser.d.ts.map +1 -0
  108. package/dist/utils/tokenNormalizer.d.ts +66 -0
  109. package/dist/utils/tokenNormalizer.d.ts.map +1 -1
  110. package/dist/utils/transfer-validation.d.ts.map +1 -1
  111. package/dist/utils/validation-helpers.d.ts +75 -0
  112. package/dist/utils/validation-helpers.d.ts.map +1 -1
  113. package/package.json +36 -15
  114. package/dist/utils/tokenFormatConverter.d.ts +0 -53
  115. package/dist/utils/tokenFormatConverter.d.ts.map +0 -1
@@ -10,17 +10,20 @@
10
10
  import { HttpClient } from '../utils/http';
11
11
  import { Logger } from '../utils/Logger';
12
12
  /**
13
- * Abstract base class for SDK services
13
+ * Abstract base class for SDK services with optional HttpClient
14
14
  *
15
15
  * Provides:
16
16
  * - Standardized logger initialization with automatic context naming
17
- * - HttpClient access for all services
17
+ * - Optional HttpClient access for API-based services
18
18
  * - Common initialization pattern across 18+ services
19
19
  *
20
+ * @param http Optional HTTP client for making API requests
21
+ * @param debugMode Enable debug logging (default: false)
22
+ *
20
23
  * @example
21
24
  * ```typescript
22
25
  * export class MyService extends BaseService {
23
- * constructor(http: HttpClient, debugMode: boolean = false) {
26
+ * constructor(http?: HttpClient, debugMode: boolean = false) {
24
27
  * super(http, debugMode);
25
28
  * // Service-specific initialization
26
29
  * }
@@ -37,4 +40,30 @@ export declare abstract class BaseService {
37
40
  protected readonly logger: Logger;
38
41
  constructor(http: HttpClient, debugMode?: boolean);
39
42
  }
43
+ /**
44
+ * Lightweight base class for services without HttpClient
45
+ *
46
+ * Provides:
47
+ * - Standardized logger initialization with automatic context naming
48
+ * - For services that don't need HttpClient (e.g., SignatureService, WebSocketService)
49
+ *
50
+ * @example
51
+ * ```typescript
52
+ * export class MyService extends LoggerBase {
53
+ * constructor(private walletProvider: WalletProvider, debugMode: boolean = false) {
54
+ * super(debugMode);
55
+ * // Service-specific initialization
56
+ * }
57
+ *
58
+ * myMethod() {
59
+ * // Logger is automatically available as this.logger
60
+ * this.logger.debug('Operation started');
61
+ * }
62
+ * }
63
+ * ```
64
+ */
65
+ export declare abstract class LoggerBase {
66
+ protected readonly logger: Logger;
67
+ constructor(debugMode?: boolean);
68
+ }
40
69
  //# sourceMappingURL=BaseService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseService.d.ts","sourceRoot":"","sources":["../../src/services/BaseService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8BAAsB,WAAW;IAGnB,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU;IAF/C,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEH,IAAI,EAAE,UAAU,EAAE,SAAS,GAAE,OAAe;CAO5E"}
1
+ {"version":3,"file":"BaseService.d.ts","sourceRoot":"","sources":["../../src/services/BaseService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,8BAAsB,WAAW;IAGnB,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU;IAF/C,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEH,IAAI,EAAE,UAAU,EAAE,SAAS,GAAE,OAAe;CAO5E;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,8BAAsB,UAAU;IAC9B,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEtB,SAAS,GAAE,OAAe;CAOvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BundleService.d.ts","sourceRoot":"","sources":["../../src/services/BundleService.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AC,QAAQ,CAAC,WAAW;gBAD5B,IAAI,EAAE,UAAU,EACC,WAAW,EAAE,WAAW,EACzC,SAAS,GAAE,OAAe;IAK5B;;;;;;;;;;OAUG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IA0D3E;;;;;;;;;;OAUG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAwD9D"}
1
+ {"version":3,"file":"CommentService.d.ts","sourceRoot":"","sources":["../../src/services/CommentService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAS3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAEL,cAAc,EAKf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAGnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAG3C,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAD5B,IAAI,EAAE,UAAU,EACC,WAAW,EAAE,WAAW,EACzC,SAAS,GAAE,OAAe;IAK5B;;;;;;;;;;OAUG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAqF3E;;;;;;;;;;OAUG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAgE9D"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * DEX Backend API Client
3
+ *
4
+ * HTTP client for DEX Backend API endpoints using injected HttpClient.
5
+ * Ensures proper authentication and error handling via interceptors.
6
+ * Fully typed API interactions with zero `any` types.
7
+ */
8
+ import { HttpClient } from '../utils/http';
9
+ import { DexBackendUserAssetsResponse } from '../types/galachain-api.types';
10
+ /**
11
+ * DEX Backend Client configuration
12
+ */
13
+ export interface DexBackendClientConfig {
14
+ baseUrl: string;
15
+ timeout?: number;
16
+ }
17
+ /**
18
+ * HTTP client for DEX Backend API using injected HttpClient for proper authentication
19
+ */
20
+ export declare class DexBackendClient {
21
+ private http;
22
+ constructor(http: HttpClient);
23
+ /**
24
+ * Get user assets from DEX Backend
25
+ * Endpoint: GET /user/assets
26
+ *
27
+ * Returns all tokens in user's wallet on the DEX
28
+ *
29
+ * @param walletAddress - User's wallet address
30
+ * @param limit - Optional limit on results (default: 20)
31
+ * @param offset - Optional offset for pagination (internally converted to page)
32
+ * @returns List of user's assets with balances
33
+ * @throws ApiError if request fails
34
+ */
35
+ getUserAssets(walletAddress: string, limit?: number, offset?: number): Promise<DexBackendUserAssetsResponse>;
36
+ /**
37
+ * Handle errors from HttpClient or validation
38
+ * Converts various error types to ApiError
39
+ *
40
+ * @param error - Error from HttpClient or validation
41
+ * @param context - Method name for better error messages
42
+ * @returns ApiError with context
43
+ */
44
+ private handleError;
45
+ }
46
+ //# sourceMappingURL=DexBackendClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DexBackendClient.d.ts","sourceRoot":"","sources":["../../src/services/DexBackendClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAEL,4BAA4B,EAE7B,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B;;;;;;;;;;;OAWG;IACG,aAAa,CACjB,aAAa,EAAE,MAAM,EACrB,KAAK,GAAE,MAAW,EAClB,MAAM,GAAE,MAAU,GACjB,OAAO,CAAC,4BAA4B,CAAC;IAoGxC;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW;CA6BpB"}
@@ -2,18 +2,19 @@
2
2
  * DEX Pool Discovery Service
3
3
  *
4
4
  * Service for querying and exploring GalaSwap DEX liquidity pools
5
- * with pagination, filtering, and sorting capabilities.
5
+ * with pagination, filtering, sorting, and quote-based pricing enrichment.
6
6
  *
7
7
  * @packageDocumentation
8
8
  */
9
9
  import { BaseService } from './BaseService';
10
10
  import type { HttpClient } from '../utils/http';
11
11
  import type { DexPoolsResult, FetchDexPoolsOptions } from '../types/dex-pool.dto';
12
+ import type { GSwapService } from './GSwapService';
12
13
  /**
13
14
  * Service for fetching and exploring DEX pools on GalaSwap
14
15
  *
15
- * Handles pagination, filtering, and sorting of liquidity pools
16
- * across all graduated tokens and base tokens.
16
+ * Handles pagination, filtering, sorting, and optional quote-based pricing enrichment
17
+ * of liquidity pools across all graduated tokens and base tokens.
17
18
  *
18
19
  * @category GSwap
19
20
  * @since 3.28.0
@@ -21,14 +22,47 @@ import type { DexPoolsResult, FetchDexPoolsOptions } from '../types/dex-pool.dto
21
22
  export declare class DexPoolService extends BaseService {
22
23
  /** Base URL for DEX backend API */
23
24
  private readonly dexBackendBaseUrl;
25
+ /** GSwap service for quote-based pricing enrichment */
26
+ private gswapService;
27
+ /** Concurrency level for parallel pricing requests */
28
+ private pricingConcurrency;
24
29
  /**
25
30
  * Create a new DexPoolService instance
26
31
  *
27
32
  * @param http HttpClient for making API requests
28
33
  * @param dexBackendBaseUrl Base URL for DEX backend API
34
+ * @param gswapService Optional GSwap service for pricing enrichment
35
+ * @param pricingConcurrency Concurrency level for parallel pricing requests (default: 5)
29
36
  * @param debugMode Enable debug logging
30
37
  */
31
- constructor(http: HttpClient, dexBackendBaseUrl: string, debugMode?: boolean);
38
+ constructor(http: HttpClient, dexBackendBaseUrl: string, gswapService?: GSwapService | undefined, pricingConcurrency?: number, debugMode?: boolean);
39
+ /**
40
+ * Set GSwap service for pricing enrichment
41
+ *
42
+ * @param service GSwap service instance
43
+ */
44
+ setGSwapService(service: GSwapService): void;
45
+ /**
46
+ * Set concurrency level for pricing requests
47
+ *
48
+ * @param concurrency Number of concurrent pricing requests
49
+ */
50
+ setPricingConcurrency(concurrency: number): void;
51
+ /**
52
+ * Enrich pools with quote-based pricing
53
+ *
54
+ * Uses parallel requests with concurrency control to price each pool's tokens
55
+ * against GUSDC (as stable reference) via `getSwapQuoteExactInput()`.
56
+ *
57
+ * Failed pricing requests are caught and logged - pools without prices are still
58
+ * included with all other metrics intact (graceful degradation).
59
+ *
60
+ * @param pools Pools to enrich with pricing
61
+ * @returns Promise resolving to pools with token0Price and token1Price populated
62
+ *
63
+ * @private
64
+ */
65
+ private enrichPoolsWithPricing;
32
66
  /**
33
67
  * Fetch DEX pools with pagination and filtering
34
68
  *
@@ -36,6 +70,7 @@ export declare class DexPoolService extends BaseService {
36
70
  * - Pagination (max 20 per page)
37
71
  * - Sorting by TVL, 30-day volume, or 1-day volume
38
72
  * - Search filtering by token symbols
73
+ * - Optional quote-based pricing enrichment via `withPrices` option
39
74
  *
40
75
  * @param options Fetch options (all optional)
41
76
  * @returns Promise resolving to paginated pool results
@@ -45,16 +80,19 @@ export declare class DexPoolService extends BaseService {
45
80
  *
46
81
  * @example
47
82
  * ```typescript
48
- * // Fetch top 10 pools by volume
83
+ * // Fetch top 10 pools by volume with pricing
49
84
  * const result = await dexPoolService.fetchDexPools({
50
85
  * sortBy: 'volume1d',
51
86
  * sortOrder: 'desc',
52
87
  * limit: 10,
53
- * page: 1
88
+ * page: 1,
89
+ * withPrices: true
54
90
  * });
55
91
  *
56
92
  * console.log(`Found ${result.total} total pools`);
57
- * console.log(`Showing page ${result.page} of ${result.totalPages}`);
93
+ * result.pools.forEach(pool => {
94
+ * console.log(`${pool.poolName}: ${pool.token0Price} / ${pool.token1Price}`);
95
+ * });
58
96
  * ```
59
97
  *
60
98
  * @since 3.28.0
@@ -67,24 +105,28 @@ export declare class DexPoolService extends BaseService {
67
105
  * all available DEX pools. Uses maximum page size (20) for efficiency.
68
106
  *
69
107
  * This is useful when you need complete pool data regardless of result size.
70
- * For large result sets, consider using fetchDexPools() with explicit pagination.
108
+ * For large result sets with pricing, note that the operation may take significant time
109
+ * since all pools must be priced. Consider using fetchDexPools() with explicit pagination
110
+ * and batching if you need to process pricing incrementally.
71
111
  *
72
112
  * @param options Fetch options (no pagination fields)
73
113
  * @returns Promise resolving to all pools with flattened pagination
74
114
  *
75
115
  * @example
76
116
  * ```typescript
77
- * // Fetch all pools sorted by TVL
117
+ * // Fetch all pools sorted by TVL with pricing
78
118
  * const allPools = await dexPoolService.fetchAllDexPools({
79
119
  * sortBy: 'tvl',
80
- * sortOrder: 'desc'
120
+ * sortOrder: 'desc',
121
+ * withPrices: true // Enable pricing for all pools
81
122
  * });
82
123
  *
83
124
  * console.log(`Total pools: ${allPools.total}`);
125
+ * console.log(`Priced pools: ${allPools.pools.filter(p => p.token0Price).length}`);
84
126
  *
85
- * // Find top GALA pools
127
+ * // Find top GALA pools with prices
86
128
  * const galaPools = allPools.pools
87
- * .filter(p => p.poolName.includes('GALA'))
129
+ * .filter(p => p.poolName.includes('GALA') && p.token0Price)
88
130
  * .slice(0, 10);
89
131
  * ```
90
132
  *
@@ -1 +1 @@
1
- {"version":3,"file":"DexPoolService.d.ts","sourceRoot":"","sources":["../../src/services/DexPoolService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,mCAAmC;IACnC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAE3C;;;;;;OAMG;gBAED,IAAI,EAAE,U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;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,cAAc,CAAC;IAgFhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,gBAAgB,CACpB,OAAO,GAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAM,GACzD,OAAO,CAAC,cAAc,CAAC;CAmC3B"}
@@ -0,0 +1,288 @@
1
+ /**
2
+ * DEX Quote Service
3
+ *
4
+ * Handles offline and online DEX quote calculations using composite pool data.
5
+ * Provides three calculation modes:
6
+ * - LOCAL: Client-side calculation (instant, no network)
7
+ * - EXTERNAL: GalaChain network calculation (real-time, slower)
8
+ * - HYBRID: Local with external validation (best of both)
9
+ *
10
+ * @packageDocumentation
11
+ */
12
+ import { BaseService } from './BaseService';
13
+ import type { HttpClient } from '../utils/http';
14
+ import type { FetchCompositePoolDataOptions, CompositePoolDataResult, CalculateDexPoolQuoteOptions, DexPoolQuoteResult } from '../types/composite-pool.dto';
15
+ /**
16
+ * Concurrency constant for parallel composite pool fetching
17
+ */
18
+ export declare const COMPOSITE_POOL_FETCH_CONCURRENCY = 5;
19
+ /**
20
+ * Service for DEX quote calculations with composite pool data
21
+ *
22
+ * Provides offline and online quote calculations using composite pool state from GalaChain.
23
+ * Handles dependency version conflicts between @gala-chain/api and @gala-chain/dex through
24
+ * strategic type assertions validated by BigNumber.js runtime conversions.
25
+ *
26
+ * ## Dependency Version Management
27
+ *
28
+ * **Version Conflicts:**
29
+ * - `@gala-chain/api`: Used for TokenBalance class (imported from this package)
30
+ * - `@gala-chain/dex`: Used for Pool, TickData, CompositePoolDto classes
31
+ * - **Issue**: SDK may depend on different versions of @gala-chain/api than @gala-chain/dex
32
+ * - **Solution**: Type assertions with runtime validation via BigNumber.js
33
+ *
34
+ * **Current Dependency Stack:**
35
+ * ```
36
+ * SDK
37
+ * ├── @gala-chain/api@X.Y.Z (TokenBalance)
38
+ * ├── @gala-chain/dex@A.B.C (Pool, TickData, CompositePoolDto)
39
+ * ├── @gala-chain/connect (GalaChain client)
40
+ * └── axios (HTTP requests)
41
+ *
42
+ * Potential Conflict: @gala-chain/dex depends on different @gala-chain/api version
43
+ * ```
44
+ *
45
+ * **Type Assertion Patterns:**
46
+ * 1. **TokenBalance Construction** - `new TokenBalance(data as any)`
47
+ * - Reason: TokenBalance class definition may differ between versions
48
+ * - Validation: Constructor throws on invalid data
49
+ *
50
+ * 2. **Property Assignment** - `(instance as any).propertyName = value`
51
+ * - Reason: TickData constructor only accepts 2 params; properties set after
52
+ * - Validation: All assignments use BigNumber.js conversion or primitives
53
+ *
54
+ * 3. **CompositePoolDto Construction** - Passing TokenBalance instances
55
+ * - Reason: TokenBalance types may not match exactly between versions
56
+ * - Validation: BigNumber.js validates all numeric conversions
57
+ *
58
+ * **Risk Mitigation:**
59
+ * - ✓ BigNumber.js throws immediately on invalid numbers (NaN, non-numeric strings)
60
+ * - ✓ Pool, TickData, TokenBalance constructors throw on structural errors
61
+ * - ✓ All numeric fields converted to BigNumber before use
62
+ * - ✓ String-to-number conversions validated at instantiation time
63
+ *
64
+ * @category GSwap
65
+ * @since 3.32.0
66
+ * @architecture Uses composition and dependency injection for testability
67
+ * @note Type assertions are isolated to conversion functions; business logic uses proper types
68
+ */
69
+ export declare class DexQuoteService extends BaseService {
70
+ private readonly galaChainBaseUrl;
71
+ private readonly networkTimeout;
72
+ private compositePoolFetchConcurrency;
73
+ /**
74
+ * Initialize DEX Quote Service
75
+ *
76
+ * @param http HttpClient for GalaChain requests
77
+ * @param galaChainBaseUrl Base URL for GalaChain gateway
78
+ * @param debugMode Enable debug logging
79
+ * @param networkTimeout Network timeout in milliseconds (default: 30000ms)
80
+ * @example
81
+ * ```typescript
82
+ * // Use default 30-second timeout
83
+ * const service = new DexQuoteService(http, galaChainBaseUrl, false);
84
+ *
85
+ * // Use custom 60-second timeout for rate-limited APIs
86
+ * const service = new DexQuoteService(http, galaChainBaseUrl, false, 60000);
87
+ * ```
88
+ */
89
+ constructor(http: HttpClient, galaChainBaseUrl: string, debugMode?: boolean, networkTimeout?: number);
90
+ /**
91
+ * Validate input parameters for fetchCompositePoolData
92
+ *
93
+ * @private
94
+ * @param token0 First token in pipe-delimited format
95
+ * @param token1 Second token in pipe-delimited format
96
+ * @param fee Fee tier (500, 3000, or 10000)
97
+ * @throws DexQuoteError if validation fails
98
+ */
99
+ private validateFetchCompositePoolDataInput;
100
+ /**
101
+ * Validate input parameters for quote calculation methods
102
+ *
103
+ * @private
104
+ * @param amount Amount to validate (should be positive numeric string)
105
+ * @throws DexQuoteError if validation fails
106
+ */
107
+ private validateQuoteAmount;
108
+ /**
109
+ * Convert SDK TokenClassKey to DexTokenClassKey for @gala-chain/dex
110
+ *
111
+ * @private
112
+ * @param tokenKey SDK TokenClassKey
113
+ * @returns DexTokenClassKey for use with @gala-chain/dex
114
+ */
115
+ private convertTokenClassKey;
116
+ /**
117
+ * Set concurrency level for parallel composite pool fetching
118
+ *
119
+ * Controls how many composite pool data requests can be in-flight simultaneously.
120
+ * Higher values fetch pools faster but use more network connections. Lower values
121
+ * use fewer connections but take longer to fetch multiple pools.
122
+ *
123
+ * **Default**: 5 concurrent requests
124
+ * **Valid Range**: 1-20 (values outside this range are clamped)
125
+ *
126
+ * @param concurrency Number of concurrent requests (automatically clamped to 1-20)
127
+ *
128
+ * @example Default usage
129
+ * ```typescript
130
+ * // Fetch 3 pools with default concurrency (5)
131
+ * const pools = await Promise.all([
132
+ * sdk.fetchCompositePoolData({ token0: 'GALA|Unit|none|none', token1: 'Token|Unit|BENE|client:123', fee: 3000 }),
133
+ * sdk.fetchCompositePoolData({ token0: 'GALA|Unit|none|none', token1: 'Token|Unit|USDC|eth:0x...', fee: 500 }),
134
+ * sdk.fetchCompositePoolData({ token0: 'Token|Unit|BENE|client:123', token1: 'Token|Unit|USDC|eth:0x...', fee: 3000 }),
135
+ * ]);
136
+ * ```
137
+ *
138
+ * @example Increase concurrency for faster bulk fetching
139
+ * ```typescript
140
+ * // Optimize for fetching many pools (trading bot scenario)
141
+ * service.setCompositePoolFetchConcurrency(15);
142
+ *
143
+ * const pools = await Promise.all(
144
+ * tokenPairs.map(pair => sdk.fetchCompositePoolData(pair))
145
+ * );
146
+ * ```
147
+ *
148
+ * @example Decrease concurrency for rate-limited APIs
149
+ * ```typescript
150
+ * // Optimize for rate-limited GalaChain gateways
151
+ * service.setCompositePoolFetchConcurrency(2);
152
+ *
153
+ * // Fetch pools one-by-one (slow but respects rate limits)
154
+ * for (const pair of tokenPairs) {
155
+ * const composite = await sdk.fetchCompositePoolData(pair);
156
+ * processPool(composite);
157
+ * }
158
+ * ```
159
+ *
160
+ * @example Reset to default
161
+ * ```typescript
162
+ * // Reset concurrency back to default (5)
163
+ * service.setCompositePoolFetchConcurrency(5);
164
+ * ```
165
+ */
166
+ setCompositePoolFetchConcurrency(concurrency: number): void;
167
+ /**
168
+ * Fetch composite pool data from GalaChain
169
+ *
170
+ * Retrieves complete pool state including:
171
+ * - Pool liquidity and price data
172
+ * - Tick data for liquidity calculations
173
+ * - Token balances and decimals
174
+ *
175
+ * @param options Composite pool fetch options (token0/token1 in pipe-delimited format)
176
+ * @returns Complete composite pool data for offline quote calculations
177
+ * @throws DexPoolNotFoundError if pool does not exist
178
+ * @throws DexQuoteError on API or conversion errors
179
+ *
180
+ * @example
181
+ * ```typescript
182
+ * const compositePool = await sdk.fetchCompositePoolData({
183
+ * token0: 'GALA|Unit|none|none',
184
+ * token1: 'Token|Unit|BENE|client:123',
185
+ * fee: 3000 // 0.30%
186
+ * });
187
+ * ```
188
+ */
189
+ fetchCompositePoolData(options: FetchCompositePoolDataOptions): Promise<CompositePoolDataResult>;
190
+ /**
191
+ * Calculate DEX pool quote using LOCAL client-side calculation
192
+ *
193
+ * Instant quotes without network calls. Uses quoteExactAmount from @gala-chain/dex
194
+ * with pre-fetched composite pool data.
195
+ *
196
+ * @param options Quote calculation options (must include compositePoolData)
197
+ * @returns Quote result with amounts and price data
198
+ * @throws DexQuoteError on calculation errors
199
+ *
200
+ * @example
201
+ * ```typescript
202
+ * // Step 1: Fetch composite data (one network call)
203
+ * const composite = await sdk.fetchCompositePoolData({
204
+ * token0: 'GALA|Unit|none|none',
205
+ * token1: 'Token|Unit|BENE|client:123',
206
+ * fee: 3000
207
+ * });
208
+ *
209
+ * // Step 2: Calculate quote (instant, local)
210
+ * const quote = await sdk.calculateDexPoolQuoteExactAmountLocal({
211
+ * compositePoolData: composite,
212
+ * fromToken: 'GALA|Unit|none|none',
213
+ * toToken: 'Token|Unit|BENE|client:123',
214
+ * amount: '1000'
215
+ * });
216
+ * console.log(`Receive: ${quote.amount1} BENE`);
217
+ *
218
+ * // Step 3: More quotes reusing same composite data (instant!)
219
+ * const quote2 = await sdk.calculateDexPoolQuoteExactAmountLocal({
220
+ * compositePoolData: composite,
221
+ * fromToken: 'GALA|Unit|none|none',
222
+ * toToken: 'Token|Unit|BENE|client:123',
223
+ * amount: '5000'
224
+ * });
225
+ * ```
226
+ */
227
+ calculateDexPoolQuoteExactAmountLocal(options: CalculateDexPoolQuoteOptions): Promise<DexPoolQuoteResult>;
228
+ /**
229
+ * Calculate DEX pool quote using EXTERNAL GalaChain network call
230
+ *
231
+ * Real-time quotes from chain. Slower than local but always fresh.
232
+ * Uses QuoteExactAmount chain method directly.
233
+ *
234
+ * @param options Quote calculation options (must include compositePoolData for token info)
235
+ * @returns Quote result from chain
236
+ * @throws DexQuoteError on network or calculation errors
237
+ *
238
+ * @example
239
+ * ```typescript
240
+ * // Fetch composite data to get token ClassKeys
241
+ * const composite = await sdk.fetchCompositePoolData({
242
+ * token0: 'GALA|Unit|none|none',
243
+ * token1: 'Token|Unit|BENE|client:123',
244
+ * fee: 3000
245
+ * });
246
+ *
247
+ * // Get real-time quote from chain
248
+ * const quote = await sdk.calculateDexPoolQuoteExactAmountExternal({
249
+ * compositePoolData: composite,
250
+ * fromToken: 'GALA|Unit|none|none',
251
+ * toToken: 'Token|Unit|BENE|client:123',
252
+ * amount: '1000'
253
+ * });
254
+ * ```
255
+ */
256
+ calculateDexPoolQuoteExactAmountExternal(options: CalculateDexPoolQuoteOptions): Promise<DexPoolQuoteResult>;
257
+ /**
258
+ * Calculate DEX pool quote with automatic mode selection
259
+ *
260
+ * Main method that delegates to local or external based on mode parameter.
261
+ * Defaults to local (instant) calculation.
262
+ *
263
+ * @param options Quote calculation options
264
+ * @param mode 'local' (instant) or 'external' (real-time) - defaults to 'local'
265
+ * @returns Quote result
266
+ *
267
+ * @example
268
+ * ```typescript
269
+ * const quote = await sdk.calculateDexPoolQuoteExactAmount({
270
+ * compositePoolData: composite,
271
+ * fromToken: 'GALA|Unit|none|none',
272
+ * toToken: 'Token|Unit|BENE|client:123',
273
+ * amount: '1000'
274
+ * });
275
+ * // Uses local calculation by default
276
+ *
277
+ * // Or explicitly specify external mode for real-time:
278
+ * const quote = await sdk.calculateDexPoolQuoteExactAmount({
279
+ * compositePoolData: composite,
280
+ * fromToken: 'GALA|Unit|none|none',
281
+ * toToken: 'Token|Unit|BENE|client:123',
282
+ * amount: '1000'
283
+ * }, 'external');
284
+ * ```
285
+ */
286
+ calculateDexPoolQuoteExactAmount(options: CalculateDexPoolQuoteOptions, mode?: 'local' | 'external'): Promise<DexPoolQuoteResult>;
287
+ }
288
+ //# sourceMappingURL=DexQuoteService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DexQuoteService.d.ts","sourceRoot":"","sources":["../../src/services/DexQuoteService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAUhD,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,4BAA4B,EAC5B,kBAAkB,EAEnB,MAAM,6BAA6B,CAAC;AAGrC;;GAEG;AACH,eAAO,MAAM,gCAAgC,IAAI,CA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B,CAAC,EAC5F,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,GACrD,OAAO,CAAC,cAAc,CAAC;IA2E1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;IACG,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAiD1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"FaucetService.d.ts","sourceRoot":"","sources":["../../src/services/FaucetService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,mBAAmB,EAIpB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAc,SAAQ,WAAW;gBAChC,IAAI,EAAE,UAAU,EAAE,SAAS,GAAE,OAAe;IAIxD;;;;;;;;;;;;;;;OAeG;IACG,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB/D;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;CAiBpC"}
1
+ {"version":3,"file":"FaucetService.d.ts","sourceRoot":"","sources":["../../src/services/FaucetService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,mBAAmB,EAIpB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAc,SAAQ,WAAW;gBAChC,IAAI,EAAE,UAAU,EAAE,SAAS,GAAE,OAAe;IAIxD;;;;;;;;;;;;;;;OAeG;IACG,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB/D;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;CAiBpC"}