@gala-chain/launchpad-sdk 8.1.0 → 9.0.0-rc.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 (252) hide show
  1. package/CHANGELOG.md +362 -0
  2. package/EXAMPLES.md +95 -681
  3. package/MIGRATING-TO-9.0.md +301 -0
  4. package/README.md +46 -17
  5. package/dist/LaunchpadSDK.d.ts +138 -413
  6. package/dist/LaunchpadSDK.d.ts.map +1 -1
  7. package/dist/api/LaunchpadAPI.d.ts +5 -37
  8. package/dist/api/LaunchpadAPI.d.ts.map +1 -1
  9. package/dist/auth/SignatureAuth.d.ts +2 -2
  10. package/dist/auth/SignatureAuth.d.ts.map +1 -1
  11. package/dist/auth/types.d.ts +1 -1
  12. package/dist/auth/types.d.ts.map +1 -1
  13. package/dist/config/environments.d.ts +7 -2
  14. package/dist/config/environments.d.ts.map +1 -1
  15. package/dist/constants/decimals.d.ts +0 -23
  16. package/dist/constants/decimals.d.ts.map +1 -1
  17. package/dist/constants/endpoints.d.ts +0 -7
  18. package/dist/constants/endpoints.d.ts.map +1 -1
  19. package/dist/constants/version.generated.d.ts +1 -1
  20. package/dist/constants/version.generated.d.ts.map +1 -1
  21. package/dist/helpers/sdk.d.ts.map +1 -1
  22. package/dist/index.browser.d.ts +8 -22
  23. package/dist/index.browser.d.ts.map +1 -1
  24. package/dist/index.browser.esm.js +1 -1
  25. package/dist/index.cjs +1 -1
  26. package/dist/index.esm.js +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/index.node.d.ts +4 -5
  29. package/dist/index.node.d.ts.map +1 -1
  30. package/dist/launchpad/bundle-submission.d.ts +1 -9
  31. package/dist/launchpad/bundle-submission.d.ts.map +1 -1
  32. package/dist/launchpad/transport.d.ts +2 -1
  33. package/dist/launchpad/transport.d.ts.map +1 -1
  34. package/dist/native.cjs +1 -1
  35. package/dist/native.d.ts +3 -4
  36. package/dist/native.d.ts.map +1 -1
  37. package/dist/native.esm.js +1 -1
  38. package/dist/schemas/user.d.ts +0 -15
  39. package/dist/schemas/user.d.ts.map +1 -1
  40. package/dist/services/AbstractCacheService.d.ts +2 -2
  41. package/dist/services/GalaChainBalanceService.d.ts +17 -89
  42. package/dist/services/GalaChainBalanceService.d.ts.map +1 -1
  43. package/dist/services/GalaChainLockService.d.ts +19 -20
  44. package/dist/services/GalaChainLockService.d.ts.map +1 -1
  45. package/dist/services/GalaChainService.d.ts +28 -15
  46. package/dist/services/GalaChainService.d.ts.map +1 -1
  47. package/dist/services/GalaChainTokenService.d.ts +25 -53
  48. package/dist/services/GalaChainTokenService.d.ts.map +1 -1
  49. package/dist/services/GalaChainTransferService.d.ts +42 -41
  50. package/dist/services/GalaChainTransferService.d.ts.map +1 -1
  51. package/dist/services/LaunchpadPriceService.d.ts +66 -0
  52. package/dist/services/LaunchpadPriceService.d.ts.map +1 -0
  53. package/dist/services/NftCollectionService.d.ts +22 -6
  54. package/dist/services/NftCollectionService.d.ts.map +1 -1
  55. package/dist/services/TokenResolverService.d.ts +5 -5
  56. package/dist/services/TokenResolverService.d.ts.map +1 -1
  57. package/dist/services/gateway-transport.d.ts +32 -0
  58. package/dist/services/gateway-transport.d.ts.map +1 -0
  59. package/dist/services/gateway-writes.d.ts +83 -0
  60. package/dist/services/gateway-writes.d.ts.map +1 -0
  61. package/dist/signing/index.d.ts +2 -3
  62. package/dist/signing/index.d.ts.map +1 -1
  63. package/dist/signing/signers.d.ts +7 -8
  64. package/dist/signing/signers.d.ts.map +1 -1
  65. package/dist/signing/types.d.ts +7 -10
  66. package/dist/signing/types.d.ts.map +1 -1
  67. package/dist/types/burn.dto.d.ts +4 -2
  68. package/dist/types/burn.dto.d.ts.map +1 -1
  69. package/dist/types/common.d.ts +2 -23
  70. package/dist/types/common.d.ts.map +1 -1
  71. package/dist/types/dto.d.ts +0 -5
  72. package/dist/types/dto.d.ts.map +1 -1
  73. package/dist/types/launchpad.dto.d.ts +0 -257
  74. package/dist/types/launchpad.dto.d.ts.map +1 -1
  75. package/dist/types/lock.dto.d.ts +12 -7
  76. package/dist/types/lock.dto.d.ts.map +1 -1
  77. package/dist/types/options.dto.d.ts +8 -34
  78. package/dist/types/options.dto.d.ts.map +1 -1
  79. package/dist/types/user.dto.d.ts +7 -62
  80. package/dist/types/user.dto.d.ts.map +1 -1
  81. package/dist/utils/address-formatter.d.ts +10 -2
  82. package/dist/utils/address-formatter.d.ts.map +1 -1
  83. package/dist/utils/agent-config.d.ts +9 -4
  84. package/dist/utils/agent-config.d.ts.map +1 -1
  85. package/dist/utils/auto-pagination.d.ts +6 -239
  86. package/dist/utils/auto-pagination.d.ts.map +1 -1
  87. package/dist/utils/bignumber-helpers.d.ts +3 -2
  88. package/dist/utils/bignumber-helpers.d.ts.map +1 -1
  89. package/dist/utils/delimiter-parser.d.ts +0 -13
  90. package/dist/utils/delimiter-parser.d.ts.map +1 -1
  91. package/dist/utils/error-patterns.d.ts +0 -47
  92. package/dist/utils/error-patterns.d.ts.map +1 -1
  93. package/dist/utils/error-wrapper.d.ts +5 -5
  94. package/dist/utils/errors.d.ts +0 -308
  95. package/dist/utils/errors.d.ts.map +1 -1
  96. package/dist/utils/http.d.ts +15 -3
  97. package/dist/utils/http.d.ts.map +1 -1
  98. package/dist/utils/token-format-converter.d.ts +1 -1
  99. package/dist/utils/token-parser.d.ts +6 -127
  100. package/dist/utils/token-parser.d.ts.map +1 -1
  101. package/dist/utils/token-stringification.d.ts +7 -7
  102. package/dist/utils/token-stringification.d.ts.map +1 -1
  103. package/dist/utils/tokenNameNormalizer.d.ts +2 -2
  104. package/dist/utils/tokenNormalizer.d.ts +5 -29
  105. package/dist/utils/tokenNormalizer.d.ts.map +1 -1
  106. package/dist/utils/unique-key-generator.d.ts +7 -134
  107. package/dist/utils/unique-key-generator.d.ts.map +1 -1
  108. package/dist/utils/validation-helpers.d.ts +3 -5
  109. package/dist/utils/validation-helpers.d.ts.map +1 -1
  110. package/package.json +47 -87
  111. package/dist/api/dto/BurnTokensDto.d.ts +0 -77
  112. package/dist/api/dto/BurnTokensDto.d.ts.map +0 -1
  113. package/dist/api/dto/LockTokenDto.d.ts +0 -85
  114. package/dist/api/dto/LockTokenDto.d.ts.map +0 -1
  115. package/dist/api/dto/TransferTokenDto.d.ts +0 -64
  116. package/dist/api/dto/TransferTokenDto.d.ts.map +0 -1
  117. package/dist/api/dto/UnlockTokenDto.d.ts +0 -74
  118. package/dist/api/dto/UnlockTokenDto.d.ts.map +0 -1
  119. package/dist/bridge/BridgeService.d.ts +0 -484
  120. package/dist/bridge/BridgeService.d.ts.map +0 -1
  121. package/dist/bridge/GalaConnectClient.d.ts +0 -170
  122. package/dist/bridge/GalaConnectClient.d.ts.map +0 -1
  123. package/dist/bridge/constants/index.d.ts +0 -7
  124. package/dist/bridge/constants/index.d.ts.map +0 -1
  125. package/dist/bridge/constants/tokens.d.ts +0 -212
  126. package/dist/bridge/constants/tokens.d.ts.map +0 -1
  127. package/dist/bridge/index.d.ts +0 -24
  128. package/dist/bridge/index.d.ts.map +0 -1
  129. package/dist/bridge/public-types.d.ts +0 -2
  130. package/dist/bridge/public-types.d.ts.map +0 -1
  131. package/dist/bridge/strategies/BridgeStrategy.d.ts +0 -204
  132. package/dist/bridge/strategies/BridgeStrategy.d.ts.map +0 -1
  133. package/dist/bridge/strategies/EthereumBridgeStrategy.d.ts +0 -178
  134. package/dist/bridge/strategies/EthereumBridgeStrategy.d.ts.map +0 -1
  135. package/dist/bridge/strategies/SolanaBridgeStrategy.d.ts +0 -236
  136. package/dist/bridge/strategies/SolanaBridgeStrategy.d.ts.map +0 -1
  137. package/dist/bridge/types/bridge.dto.d.ts +0 -772
  138. package/dist/bridge/types/bridge.dto.d.ts.map +0 -1
  139. package/dist/bridge/types/bridgeable-token.dto.d.ts +0 -209
  140. package/dist/bridge/types/bridgeable-token.dto.d.ts.map +0 -1
  141. package/dist/bridge/types/eip712.d.ts +0 -66
  142. package/dist/bridge/types/eip712.d.ts.map +0 -1
  143. package/dist/bridge/types/index.d.ts +0 -8
  144. package/dist/bridge/types/index.d.ts.map +0 -1
  145. package/dist/bridge/utils/RateLimiter.d.ts +0 -34
  146. package/dist/bridge/utils/RateLimiter.d.ts.map +0 -1
  147. package/dist/bridge/utils/address-formatter.d.ts +0 -25
  148. package/dist/bridge/utils/address-formatter.d.ts.map +0 -1
  149. package/dist/bridge/utils/addressValidation.d.ts +0 -200
  150. package/dist/bridge/utils/addressValidation.d.ts.map +0 -1
  151. package/dist/bridge/utils/balanceHelpers.d.ts +0 -215
  152. package/dist/bridge/utils/balanceHelpers.d.ts.map +0 -1
  153. package/dist/bridge/utils/bridgeErrors.d.ts +0 -98
  154. package/dist/bridge/utils/bridgeErrors.d.ts.map +0 -1
  155. package/dist/bridge/utils/bridgeOutHelpers.d.ts +0 -68
  156. package/dist/bridge/utils/bridgeOutHelpers.d.ts.map +0 -1
  157. package/dist/bridge/utils/bridgePayload.d.ts +0 -98
  158. package/dist/bridge/utils/bridgePayload.d.ts.map +0 -1
  159. package/dist/bridge/utils/bridgeStatusParser.d.ts +0 -76
  160. package/dist/bridge/utils/bridgeStatusParser.d.ts.map +0 -1
  161. package/dist/bridge/utils/eip712Helpers.d.ts +0 -66
  162. package/dist/bridge/utils/eip712Helpers.d.ts.map +0 -1
  163. package/dist/bridge/utils/index.d.ts +0 -19
  164. package/dist/bridge/utils/index.d.ts.map +0 -1
  165. package/dist/bridge/utils/retry.d.ts +0 -112
  166. package/dist/bridge/utils/retry.d.ts.map +0 -1
  167. package/dist/bridge/utils/strategyDelegation.d.ts +0 -126
  168. package/dist/bridge/utils/strategyDelegation.d.ts.map +0 -1
  169. package/dist/bridge/utils/tokenIdUtils.d.ts +0 -86
  170. package/dist/bridge/utils/tokenIdUtils.d.ts.map +0 -1
  171. package/dist/bridge/utils/tokenMath.d.ts +0 -39
  172. package/dist/bridge/utils/tokenMath.d.ts.map +0 -1
  173. package/dist/bridge/utils/tokenMetadataResolver.d.ts +0 -97
  174. package/dist/bridge/utils/tokenMetadataResolver.d.ts.map +0 -1
  175. package/dist/helpers/wallet.d.ts +0 -151
  176. package/dist/helpers/wallet.d.ts.map +0 -1
  177. package/dist/react/WalletContext.d.ts +0 -60
  178. package/dist/react/WalletContext.d.ts.map +0 -1
  179. package/dist/react/index.d.ts +0 -65
  180. package/dist/react/index.d.ts.map +0 -1
  181. package/dist/react/types.d.ts +0 -76
  182. package/dist/react/types.d.ts.map +0 -1
  183. package/dist/react/useWallet.d.ts +0 -123
  184. package/dist/react/useWallet.d.ts.map +0 -1
  185. package/dist/react/useWalletConnection.d.ts +0 -89
  186. package/dist/react/useWalletConnection.d.ts.map +0 -1
  187. package/dist/react/useWalletDetection.d.ts +0 -81
  188. package/dist/react/useWalletDetection.d.ts.map +0 -1
  189. package/dist/react.cjs +0 -1
  190. package/dist/react.esm.js +0 -1
  191. package/dist/services/AbstractTokenFetchService.d.ts +0 -150
  192. package/dist/services/AbstractTokenFetchService.d.ts.map +0 -1
  193. package/dist/services/BatchedCacheService.d.ts +0 -133
  194. package/dist/services/BatchedCacheService.d.ts.map +0 -1
  195. package/dist/services/BridgeableTokenCache.d.ts +0 -120
  196. package/dist/services/BridgeableTokenCache.d.ts.map +0 -1
  197. package/dist/services/BridgeableTokenService.d.ts +0 -218
  198. package/dist/services/BridgeableTokenService.d.ts.map +0 -1
  199. package/dist/services/DexService.d.ts +0 -440
  200. package/dist/services/DexService.d.ts.map +0 -1
  201. package/dist/services/NetworkKeyedCacheService.d.ts +0 -185
  202. package/dist/services/NetworkKeyedCacheService.d.ts.map +0 -1
  203. package/dist/services/PriceHistoryService.d.ts +0 -209
  204. package/dist/services/PriceHistoryService.d.ts.map +0 -1
  205. package/dist/services/WrapService.d.ts +0 -171
  206. package/dist/services/WrapService.d.ts.map +0 -1
  207. package/dist/services/WrappableTokenCache.d.ts +0 -100
  208. package/dist/services/WrappableTokenCache.d.ts.map +0 -1
  209. package/dist/services/WrappableTokenService.d.ts +0 -130
  210. package/dist/services/WrappableTokenService.d.ts.map +0 -1
  211. package/dist/setup.d.ts +0 -8
  212. package/dist/setup.d.ts.map +0 -1
  213. package/dist/tokens/transfers.d.ts +0 -95
  214. package/dist/tokens/transfers.d.ts.map +0 -1
  215. package/dist/types/galachain-api.types.d.ts +0 -297
  216. package/dist/types/galachain-api.types.d.ts.map +0 -1
  217. package/dist/types/priceHistory.dto.d.ts +0 -134
  218. package/dist/types/priceHistory.dto.d.ts.map +0 -1
  219. package/dist/types/token.types.d.ts +0 -359
  220. package/dist/types/token.types.d.ts.map +0 -1
  221. package/dist/types/wrappable-token.dto.d.ts +0 -305
  222. package/dist/types/wrappable-token.dto.d.ts.map +0 -1
  223. package/dist/utils/crypto-compat.d.ts +0 -40
  224. package/dist/utils/crypto-compat.d.ts.map +0 -1
  225. package/dist/utils/load-env.d.ts +0 -31
  226. package/dist/utils/load-env.d.ts.map +0 -1
  227. package/dist/utils/token-instance-key.d.ts +0 -57
  228. package/dist/utils/token-instance-key.d.ts.map +0 -1
  229. package/dist/utils/wallet.d.ts +0 -166
  230. package/dist/utils/wallet.d.ts.map +0 -1
  231. package/dist/wallet/ExternalWalletProvider.d.ts +0 -90
  232. package/dist/wallet/ExternalWalletProvider.d.ts.map +0 -1
  233. package/dist/wallet/GalaWalletProvider.d.ts +0 -122
  234. package/dist/wallet/GalaWalletProvider.d.ts.map +0 -1
  235. package/dist/wallet/PrivateKeyProvider.d.ts +0 -90
  236. package/dist/wallet/PrivateKeyProvider.d.ts.map +0 -1
  237. package/dist/wallet/detection.d.ts +0 -107
  238. package/dist/wallet/detection.d.ts.map +0 -1
  239. package/dist/wallet/event-handlers.d.ts +0 -50
  240. package/dist/wallet/event-handlers.d.ts.map +0 -1
  241. package/dist/wallet/index.d.ts +0 -51
  242. package/dist/wallet/index.d.ts.map +0 -1
  243. package/dist/wallet/signing-operation.d.ts +0 -19
  244. package/dist/wallet/signing-operation.d.ts.map +0 -1
  245. package/dist/wallet/typed-data-helpers.d.ts +0 -68
  246. package/dist/wallet/typed-data-helpers.d.ts.map +0 -1
  247. package/dist/wallet/types.d.ts +0 -267
  248. package/dist/wallet/types.d.ts.map +0 -1
  249. package/dist/wallet/utils.d.ts +0 -117
  250. package/dist/wallet/utils.d.ts.map +0 -1
  251. package/dist/wallet.cjs +0 -1
  252. package/dist/wallet.esm.js +0 -1
@@ -1,150 +0,0 @@
1
- /**
2
- * Abstract Token Fetch Service Base Class
3
- *
4
- * Provides common patterns for services that fetch and cache token data
5
- * from the DEX API with pagination support.
6
- *
7
- * ## Features
8
- * - Paginated fetch with offset/limit
9
- * - Auto-pagination via autoPaginateOffset
10
- * - Cache integration (via subclass-provided cache)
11
- * - Response transformation abstraction
12
- * - Common error handling
13
- *
14
- * ## Subclass Responsibilities
15
- * - Implement `buildApiParams()` for API-specific parameters
16
- * - Implement `transformApiResponse()` for response transformation
17
- * - Implement cache-specific methods (network-keyed or simple)
18
- * - Provide domain-specific public API methods
19
- *
20
- * ## Key Pattern
21
- * This base class consolidates ~150 lines of duplicate code between
22
- * BridgeableTokenService and WrappableTokenService by abstracting:
23
- * - API request structure
24
- * - Pagination handling
25
- * - Cache warming patterns
26
- * - Error handling
27
- *
28
- * @category Services
29
- * @since 5.11.0
30
- * @template TApiResponse - Raw API response item type
31
- * @template TToken - Transformed token type for SDK use
32
- */
33
- import type { OffsetPaginationFetchResult } from '../utils/auto-pagination.js';
34
- import type { HttpClient } from '../utils/http.js';
35
- import { Logger } from '../utils/Logger.js';
36
- /** Maximum tokens per API request (backend limit) */
37
- export declare const DEFAULT_MAX_LIMIT = 1000;
38
- /** Default limit for paginated requests */
39
- export declare const DEFAULT_LIMIT = 1000;
40
- /**
41
- * Base options for paginated token fetches
42
- */
43
- export interface BaseTokenFetchOptions {
44
- /** Offset for pagination (default: 0) */
45
- offset?: number;
46
- /** Limit per page (default: 1000, max: 1000) */
47
- limit?: number;
48
- }
49
- /**
50
- * Base result for paginated token fetches
51
- */
52
- export interface BaseTokenFetchResult<T> {
53
- /** Array of transformed tokens */
54
- tokens: T[];
55
- /** Timestamp when data was fetched */
56
- fetchedAt: number;
57
- /** Number of tokens returned */
58
- tokenCount: number;
59
- }
60
- /**
61
- * API response wrapper type (tokens array in response)
62
- */
63
- export interface TokensApiResponse<TApiResponse> {
64
- tokens: TApiResponse[];
65
- }
66
- /**
67
- * Abstract base class for token fetch services
68
- *
69
- * Consolidates common patterns for fetching and caching token data
70
- * from the DEX API. Subclasses provide API-specific parameters and
71
- * transformation logic.
72
- *
73
- * @template TApiResponse - Raw API response item type
74
- * @template TToken - Transformed token type for SDK use
75
- */
76
- export declare abstract class AbstractTokenFetchService<TApiResponse, TToken> {
77
- protected readonly dexApiHttp: HttpClient;
78
- protected readonly logger: Logger;
79
- constructor(dexApiHttp: HttpClient, debugMode?: boolean, loggerContext?: string);
80
- /**
81
- * Build API request parameters
82
- *
83
- * Subclasses implement this to add API-specific query parameters.
84
- * The context parameter allows passing request-specific data (e.g., network)
85
- * to avoid race conditions with mutable instance state.
86
- *
87
- * @param context - Optional context for building parameters (e.g., { network: 'ETHEREUM' })
88
- * @returns Record of query parameters for the API request
89
- */
90
- protected abstract buildApiParams(context?: Record<string, unknown>): Record<string, string | number | boolean>;
91
- /**
92
- * Transform API response items to SDK format
93
- *
94
- * Subclasses implement this to convert raw API responses to typed SDK objects.
95
- *
96
- * @param apiTokens - Raw API response tokens
97
- * @returns Array of transformed tokens
98
- */
99
- protected abstract transformApiResponse(apiTokens: TApiResponse[]): TToken[];
100
- /**
101
- * Get the API endpoint URL
102
- *
103
- * @returns API endpoint path (default: /v1/tokens)
104
- */
105
- protected getApiEndpoint(): string;
106
- /**
107
- * Get the maximum limit for API requests
108
- *
109
- * @returns Maximum items per request
110
- */
111
- protected getMaxLimit(): number;
112
- /**
113
- * Get the default limit for API requests
114
- *
115
- * @returns Default items per request
116
- */
117
- protected getDefaultLimit(): number;
118
- /**
119
- * Execute a paginated API request
120
- *
121
- * Core method that performs the HTTP request with pagination parameters.
122
- * Used by both single-page and auto-paginated fetches.
123
- *
124
- * @param offset - Offset for pagination
125
- * @param limit - Number of items to fetch
126
- * @param context - Optional context for building parameters (e.g., { network: 'ETHEREUM' })
127
- * @returns Promise resolving to transformed tokens
128
- * @throws ValidationError if API response structure is invalid
129
- */
130
- protected executePaginatedRequest(offset: number, limit: number, context?: Record<string, unknown>): Promise<OffsetPaginationFetchResult<TToken>>;
131
- /**
132
- * Auto-paginate through all API results
133
- *
134
- * Fetches all pages of results automatically.
135
- * Subclasses call this from their fetchAll methods.
136
- *
137
- * @param context - Optional context for building parameters (e.g., { network: 'ETHEREUM' })
138
- * @returns Promise resolving to all transformed tokens
139
- */
140
- protected autoPaginateFetch(context?: Record<string, unknown>): Promise<TToken[]>;
141
- /**
142
- * Handle API errors consistently
143
- *
144
- * @param error - Error from API call
145
- * @param message - Error message prefix
146
- * @throws Transformed error with proper type
147
- */
148
- protected handleError(error: unknown, message: string): never;
149
- }
150
- //# sourceMappingURL=AbstractTokenFetchService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AbstractTokenFetchService.d.ts","sourceRoot":"","sources":["../../src/services/AbstractTokenFetchService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAI/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAEtC,2CAA2C;AAC3C,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,kCAAkC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,MAAM,EAAE,CAAC;IAOvF;;;;;;OAMG;IACH,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK;CAG9D"}
@@ -1,133 +0,0 @@
1
- /**
2
- * Batched Cache Service Base Class
3
- *
4
- * Intermediate abstraction for caches that operate on batches of items
5
- * (setAll, merge) rather than individual key-value pairs. Extends
6
- * AbstractCacheService with common batch operation patterns.
7
- *
8
- * ## Features
9
- * - Batch set operations (setAll - replace all)
10
- * - Batch merge operations (merge - add/update without removing)
11
- * - Timestamp tracking for cache freshness
12
- * - Common normalization via normalizeTokenKey()
13
- *
14
- * ## Subclass Responsibilities
15
- * - Override setAll/merge if custom indexing needed (e.g., network-partitioned caches)
16
- * - Implement getStats() for domain-specific statistics
17
- * - Optionally add domain-specific lookup methods
18
- *
19
- * @category Services
20
- * @since 5.10.0
21
- * @template V - Value type stored in cache
22
- * @template S - Statistics type (must extend BaseCacheStats)
23
- */
24
- import type { BaseCacheStats } from './AbstractCacheService.js';
25
- import { AbstractCacheService } from './AbstractCacheService.js';
26
- /**
27
- * Batched cache service with common token cache operations
28
- *
29
- * Provides reusable setAll/merge operations for token-like caches.
30
- * Subclasses must define how to extract the key from each item.
31
- *
32
- * @template V - Value type stored in cache (must have a key field)
33
- * @template S - Statistics type (must extend BaseCacheStats)
34
- */
35
- export declare abstract class BatchedCacheService<V, S extends BaseCacheStats = BaseCacheStats> extends AbstractCacheService<string, V, S> {
36
- /** Timestamp when cache was last populated */
37
- protected lastFetchedAt: number | null;
38
- constructor(debugMode?: boolean);
39
- /**
40
- * Normalize key for consistent cache lookups
41
- *
42
- * Uses the common tokenNameNormalizer for uppercase, trimmed keys.
43
- *
44
- * @param key - Raw key to normalize
45
- * @returns Normalized key string
46
- */
47
- protected normalizeKey(key: string): string;
48
- /**
49
- * Extract the cache key from an item
50
- *
51
- * Subclasses must implement this to define how items are keyed.
52
- * For token caches, this is typically stringifiedTokenClassKey or symbol.
53
- *
54
- * @param item - Item to extract key from
55
- * @returns Key string for cache storage
56
- */
57
- protected abstract extractKey(item: V): string;
58
- /**
59
- * Check if cache is populated
60
- *
61
- * @returns True if cache has items
62
- */
63
- hasItems(): boolean;
64
- /**
65
- * Get all cached items
66
- *
67
- * @returns Array of cached items (empty if not cached)
68
- */
69
- getAllItems(): V[];
70
- /**
71
- * Set all items (replaces existing cache)
72
- *
73
- * @param items - Array of items to cache
74
- */
75
- setAll(items: V[]): void;
76
- /**
77
- * Add items to cache (merges with existing)
78
- *
79
- * Used for pagination - adds new items without replacing existing.
80
- *
81
- * @param items - Array of items to add
82
- */
83
- merge(items: V[]): void;
84
- /**
85
- * Get fetch timestamp
86
- *
87
- * @returns Timestamp when cache was last updated, or null if never fetched
88
- */
89
- getFetchTimestamp(): number | null;
90
- /**
91
- * Clear cache and reset timestamp
92
- */
93
- clear(): void;
94
- /**
95
- * Get item by normalized key
96
- *
97
- * @param key - Key to look up (will be normalized)
98
- * @returns Item if found, undefined if not cached
99
- */
100
- getByKey(key: string): V | undefined;
101
- /**
102
- * Check if item exists by key
103
- *
104
- * @param key - Key to check (will be normalized)
105
- * @returns True if item is cached
106
- */
107
- hasKey(key: string): boolean;
108
- /**
109
- * Build base statistics (helper for subclasses)
110
- *
111
- * Provides common stats fields that most batched caches need.
112
- * Subclasses can extend this with domain-specific stats.
113
- *
114
- * @returns Base statistics with totalItems, isPopulated, lastFetchedAt
115
- *
116
- * @example Extending in subclass
117
- * ```typescript
118
- * public getStats(): MyCacheStats {
119
- * return {
120
- * ...this.buildBaseStats(),
121
- * tokenCount: this.cache.size, // alias
122
- * customMetric: this.calculateCustomMetric(),
123
- * };
124
- * }
125
- * ```
126
- */
127
- protected buildBaseStats(): {
128
- totalItems: number;
129
- isPopulated: boolean;
130
- lastFetchedAt: number | null;
131
- };
132
- }
133
- //# sourceMappingURL=BatchedCacheService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BatchedCacheService.d.ts","sourceRoot":"","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AAE;CAOhH"}
@@ -1,120 +0,0 @@
1
- /**
2
- * Bridgeable Token Cache Service
3
- *
4
- * Permanent in-memory cache for bridgeable tokens fetched from DEX API.
5
- * Bridgeable tokens are immutable - once a token is bridgeable to a network,
6
- * its contract address never changes.
7
- *
8
- * ## Cache Architecture
9
- * - **Primary Index**: Map<network, Map<symbol, token>> - O(1) by symbol
10
- * - **Secondary Index**: Map<network, Map<tokenId, token>> - O(1) by tokenId
11
- * - **Persistence**: Entire SDK lifetime (never expires)
12
- * - **Memory**: ~500-800 bytes per token (plus ~50 bytes per index entry)
13
- *
14
- * ## Key Features
15
- * - Separate caches per network (Ethereum, Solana)
16
- * - Case-insensitive symbol and tokenId lookups
17
- * - Dual O(1) lookups: by symbol or by stringifiedTokenClassKey
18
- * - Tracks fetch timestamps for debugging
19
- * - No eviction (bridgeable tokens are permanent)
20
- *
21
- * @category Services
22
- * @since 3.33.0
23
- * @refactored 5.12.0 - Now extends NetworkKeyedCacheService for DRY compliance
24
- */
25
- import type { BridgeableNetwork, BridgeableToken } from '../bridge/types/bridgeable-token.dto.js';
26
- import { NetworkKeyedCacheService, type NetworkKeyedCacheStats } from './NetworkKeyedCacheService.js';
27
- /**
28
- * Cache statistics for monitoring and debugging
29
- */
30
- export interface BridgeableTokenCacheStats extends NetworkKeyedCacheStats<BridgeableNetwork> {
31
- /** Total tokens across all networks (alias for totalItems) */
32
- totalTokens: number;
33
- /** Token count per network (alias for itemsByNetwork) */
34
- tokensByNetwork: Record<BridgeableNetwork, number>;
35
- }
36
- /**
37
- * Bridgeable Token Cache
38
- *
39
- * High-performance permanent cache for bridgeable token data.
40
- * Tokens are organized by network for efficient lookups during bridge operations.
41
- *
42
- * Extends NetworkKeyedCacheService for common network-keyed cache patterns.
43
- *
44
- * @example Basic usage
45
- * ```typescript
46
- * const cache = new BridgeableTokenCache();
47
- *
48
- * // Cache tokens for Ethereum
49
- * cache.set('ETHEREUM', ethereumTokens);
50
- *
51
- * // Check if cached
52
- * if (cache.has('ETHEREUM')) {
53
- * const tokens = cache.getAll('ETHEREUM');
54
- * }
55
- *
56
- * // Get specific token by symbol
57
- * const gala = cache.getBySymbol('ETHEREUM', 'GALA');
58
- *
59
- * // Get specific token by tokenId
60
- * const token = cache.getByTokenId('ETHEREUM', 'GALA|Unit|none|none');
61
- * ```
62
- */
63
- export declare class BridgeableTokenCache extends NetworkKeyedCacheService<BridgeableToken, BridgeableNetwork, BridgeableTokenCacheStats> {
64
- constructor(debugMode?: boolean);
65
- /**
66
- * Extract the primary key from a bridgeable token (symbol)
67
- *
68
- * @param token - Bridgeable token
69
- * @returns Token symbol as primary key
70
- */
71
- protected extractPrimaryKey(token: BridgeableToken): string;
72
- /**
73
- * Extract the secondary key from a bridgeable token (tokenId)
74
- *
75
- * @param token - Bridgeable token
76
- * @returns stringifiedTokenClassKey as secondary key
77
- */
78
- protected extractSecondaryKey(token: BridgeableToken): string;
79
- /**
80
- * Get a specific token by symbol
81
- *
82
- * @param network - Network to search
83
- * @param symbol - Token symbol (case-insensitive)
84
- * @returns Bridgeable token or undefined if not found
85
- */
86
- getBySymbol(network: BridgeableNetwork, symbol: string): BridgeableToken | undefined;
87
- /**
88
- * Get a token by its stringified TokenClassKey (tokenId)
89
- *
90
- * Uses the secondary tokenId index for O(1) lookup performance.
91
- *
92
- * @param network - Network to search
93
- * @param tokenId - Stringified TokenClassKey (e.g., "GALA|Unit|none|none")
94
- * @returns Bridgeable token or undefined if not found
95
- */
96
- getByTokenId(network: BridgeableNetwork, tokenId: string): BridgeableToken | undefined;
97
- /**
98
- * Get contract address for a token on a network
99
- *
100
- * @param network - Network to search
101
- * @param symbol - Token symbol (case-insensitive)
102
- * @returns Contract address or undefined if not found
103
- */
104
- getContractAddress(network: BridgeableNetwork, symbol: string): string | undefined;
105
- /**
106
- * Check if a token is bridgeable to a network
107
- *
108
- * @param network - Network to check
109
- * @param symbol - Token symbol (case-insensitive)
110
- * @returns True if token is cached and bridgeable to network
111
- */
112
- isTokenBridgeable(network: BridgeableNetwork, symbol: string): boolean;
113
- /**
114
- * Get cache statistics
115
- *
116
- * @returns Cache statistics including token counts and timestamps
117
- */
118
- getStats(): BridgeableTokenCacheStats;
119
- }
120
- //# sourceMappingURL=BridgeableTokenCache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BridgeableTokenCache.d.ts","sourceRoot":"","sources":["../../src/services/BridgeableTokenCache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAC,eAAe,EAAE,MAAM,yCAAyC,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAAE,KAAK,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEtG;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,sBAAsB,CAAC,iBAAiB,CAAC;IAC1F,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,eAAe,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;CACpD;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,oBAAqB,SAAQ,wBAAwB,CAChE,eAAe,EACf,iBAAiB,EACjB,yBAAyB,CAC1B;gBACa,SAAS,GAAE,OAAe;IAItC;;;;;OAKG;IACH,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM;IAI3D;;;;;OAKG;IACH,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM;IAI7D;;;;;;OAMG;IACI,WAAW,CAAC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAI3F;;;;;;;;OAQG;IACI,YAAY,CAAC,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAI7F;;;;;;OAMG;IACI,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IASzF;;;;;;OAMG;IACI,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAI7E;;;;OAIG;IACI,QAAQ,IAAI,yBAAyB;CAU7C"}
@@ -1,218 +0,0 @@
1
- /**
2
- * Bridgeable Token Service
3
- *
4
- * Service for fetching and caching bridgeable tokens from the DEX API.
5
- * Provides methods to query which tokens can be bridged to Ethereum or Solana,
6
- * and retrieves their contract addresses dynamically.
7
- *
8
- * ## Key Features
9
- * - Dynamic token discovery (no hardcoded contract addresses)
10
- * - Permanent caching (bridgeable tokens never change)
11
- * - Lazy loading (fetches only when needed)
12
- * - Environment-aware (STAGE vs PROD URLs determine network)
13
- *
14
- * ## Caching Strategy
15
- * - Tokens are cached permanently after first fetch
16
- * - Separate caches per network (Ethereum, Solana)
17
- * - Cache persists for entire SDK lifetime
18
- * - No fallback - API failure throws error
19
- *
20
- * @category Services
21
- * @since 3.33.0
22
- */
23
- import type { BridgeableNetwork, BridgeableToken, BridgeableTokenApiResponse, FetchBridgeableTokensOptions, FetchBridgeableTokensResult, IsTokenBridgeableOptions, IsTokenBridgeableResult } from '../bridge/types/bridgeable-token.dto.js';
24
- import type { TokenId } from '../types/common.js';
25
- import type { HttpClient } from '../utils/http.js';
26
- import { AbstractTokenFetchService } from './AbstractTokenFetchService.js';
27
- import { BridgeableTokenCache } from './BridgeableTokenCache.js';
28
- /**
29
- * BridgeableTokenService
30
- *
31
- * Fetches and caches bridgeable token information from the DEX API.
32
- * Provides efficient lookups for bridge operations.
33
- *
34
- * @example Basic usage
35
- * ```typescript
36
- * const service = new BridgeableTokenService(dexApiHttp, true);
37
- *
38
- * // Fetch all Ethereum-bridgeable tokens
39
- * const result = await service.fetchAllBridgeableTokensByNetwork('ETHEREUM');
40
- * console.log(`Found ${result.tokenCount} tokens`);
41
- *
42
- * // Check if a specific token is bridgeable (pipe-delimited format)
43
- * const isBridgeable = await service.isTokenBridgeableToNetwork({
44
- * tokenId: 'GALA|Unit|none|none',
45
- * network: 'ETHEREUM'
46
- * });
47
- * console.log(`GALA bridgeable to Ethereum: ${isBridgeable.isBridgeable}`);
48
- *
49
- * // Or use TokenClassKey object format
50
- * const result = await service.isTokenBridgeableToEthereum({
51
- * collection: 'Token', category: 'Unit', type: 'GALA', additionalKey: 'none'
52
- * });
53
- *
54
- * // Get contract address for a token
55
- * const address = await service.getContractAddress('GWETH', 'ETHEREUM');
56
- * console.log(`GWETH Ethereum address: ${address}`);
57
- * ```
58
- */
59
- export declare class BridgeableTokenService extends AbstractTokenFetchService<BridgeableTokenApiResponse, BridgeableToken> {
60
- private readonly cache;
61
- constructor(dexApiHttp: HttpClient, debugMode?: boolean);
62
- /**
63
- * Build API request parameters for bridgeable tokens
64
- *
65
- * @param context - Context containing network for the request
66
- * @returns Query parameters with canBridgeTo filter
67
- */
68
- protected buildApiParams(context?: Record<string, unknown>): Record<string, string | number | boolean>;
69
- /**
70
- * Transform API response tokens to SDK format
71
- *
72
- * @param apiTokens - Raw API response tokens
73
- * @returns Array of transformed bridgeable tokens
74
- */
75
- protected transformApiResponse(apiTokens: BridgeableTokenApiResponse[]): BridgeableToken[];
76
- /**
77
- * Fetch bridgeable tokens for a network with pagination
78
- *
79
- * @param options - Fetch options including network and pagination parameters
80
- * @returns Promise resolving to fetch result with tokens array
81
- * @throws NetworkError if API request fails
82
- */
83
- fetchBridgeableTokensByNetwork(options: FetchBridgeableTokensOptions): Promise<FetchBridgeableTokensResult>;
84
- /**
85
- * Fetch ALL bridgeable tokens for a network (auto-pagination)
86
- *
87
- * Returns cached data if available, otherwise fetches from API.
88
- * Automatically handles pagination to retrieve all tokens.
89
- *
90
- * @param network - Network to fetch tokens for
91
- * @returns Promise resolving to fetch result with all tokens
92
- * @throws NetworkError if API request fails
93
- */
94
- fetchAllBridgeableTokensByNetwork(network: BridgeableNetwork): Promise<FetchBridgeableTokensResult>;
95
- /**
96
- * Convenience: Fetch all tokens bridgeable to Ethereum
97
- *
98
- * @returns Promise resolving to fetch result with Ethereum-bridgeable tokens
99
- */
100
- fetchAllTokensBridgeableToEthereum(): Promise<FetchBridgeableTokensResult>;
101
- /**
102
- * Convenience: Fetch all tokens bridgeable to Solana
103
- *
104
- * @returns Promise resolving to fetch result with Solana-bridgeable tokens
105
- */
106
- fetchAllTokensBridgeableToSolana(): Promise<FetchBridgeableTokensResult>;
107
- /**
108
- * Check if a token is bridgeable to a network
109
- *
110
- * Uses cache for efficient lookup. If network not cached, fetches first.
111
- *
112
- * @param options - Token identifier and target network
113
- * @returns Promise resolving to bridgeability result
114
- *
115
- * @example
116
- * ```typescript
117
- * // Pipe-delimited format (REQUIRED for strings)
118
- * await service.isTokenBridgeableToNetwork({
119
- * tokenId: 'GALA|Unit|none|none',
120
- * network: 'ETHEREUM'
121
- * });
122
- *
123
- * // TokenClassKey object format
124
- * await service.isTokenBridgeableToNetwork({
125
- * tokenId: { collection: 'Token', category: 'Unit', type: 'GALA', additionalKey: 'none' },
126
- * network: 'SOLANA'
127
- * });
128
- * ```
129
- */
130
- isTokenBridgeableToNetwork(options: IsTokenBridgeableOptions): Promise<IsTokenBridgeableResult>;
131
- /**
132
- * Convenience: Check if token is bridgeable to Ethereum
133
- *
134
- * @param tokenId - Token identifier (pipe-delimited string or TokenClassKey object)
135
- * @returns Promise resolving to bridgeability result
136
- *
137
- * @example
138
- * ```typescript
139
- * // Pipe-delimited format
140
- * await service.isTokenBridgeableToEthereum('GALA|Unit|none|none');
141
- *
142
- * // TokenClassKey object
143
- * await service.isTokenBridgeableToEthereum({
144
- * collection: 'Token', category: 'Unit', type: 'GWETH', additionalKey: 'eth:0x...'
145
- * });
146
- * ```
147
- */
148
- isTokenBridgeableToEthereum(tokenId: TokenId): Promise<IsTokenBridgeableResult>;
149
- /**
150
- * Convenience: Check if token is bridgeable to Solana
151
- *
152
- * @param tokenId - Token identifier (pipe-delimited string or TokenClassKey object)
153
- * @returns Promise resolving to bridgeability result
154
- *
155
- * @example
156
- * ```typescript
157
- * // Pipe-delimited format
158
- * await service.isTokenBridgeableToSolana('GALA|Unit|none|none');
159
- *
160
- * // TokenClassKey object
161
- * await service.isTokenBridgeableToSolana({
162
- * collection: 'Token', category: 'Unit', type: 'GSOL', additionalKey: 'sol:...'
163
- * });
164
- * ```
165
- */
166
- isTokenBridgeableToSolana(tokenId: TokenId): Promise<IsTokenBridgeableResult>;
167
- /**
168
- * Get token by symbol from cache (or fetch if not cached)
169
- *
170
- * @param symbol - Token symbol (case-insensitive)
171
- * @param network - Network to search
172
- * @returns Promise resolving to bridgeable token or undefined
173
- */
174
- getTokenBySymbol(symbol: string, network: BridgeableNetwork): Promise<BridgeableToken | undefined>;
175
- /**
176
- * Get token by stringified TokenClassKey (tokenId) from cache (or fetch if not cached)
177
- *
178
- * @param tokenId - Stringified TokenClassKey (e.g., "GALA|Unit|none|none")
179
- * @param network - Network to search
180
- * @returns Promise resolving to bridgeable token or undefined
181
- */
182
- getTokenByTokenId(tokenId: string, network: BridgeableNetwork): Promise<BridgeableToken | undefined>;
183
- /**
184
- * Get contract address for a token on a network
185
- *
186
- * @param symbol - Token symbol (case-insensitive)
187
- * @param network - Target network
188
- * @returns Promise resolving to contract address or undefined
189
- */
190
- getContractAddress(symbol: string, network: BridgeableNetwork): Promise<string | undefined>;
191
- /**
192
- * Get all supported token symbols for a network
193
- *
194
- * @param network - Network to get symbols for
195
- * @returns Promise resolving to array of token symbols
196
- */
197
- getSupportedTokenSymbols(network: BridgeableNetwork): Promise<string[]>;
198
- /**
199
- * Preload bridgeable tokens for both networks
200
- *
201
- * Fetches and caches tokens for Ethereum and Solana in parallel.
202
- * Useful for eager loading to avoid latency on first bridge operation.
203
- */
204
- preload(): Promise<void>;
205
- /**
206
- * Get cache statistics
207
- *
208
- * @returns Cache statistics including token counts and timestamps
209
- */
210
- getCacheStats(): ReturnType<BridgeableTokenCache['getStats']>;
211
- /**
212
- * Clear cache for a network or all networks
213
- *
214
- * @param network - Optional network to clear (clears all if not provided)
215
- */
216
- clearCache(network?: BridgeableNetwork): void;
217
- }
218
- //# sourceMappingURL=BridgeableTokenService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BridgeableTokenService.d.ts","sourceRoot":"","sources":["../../src/services/BridgeableTokenService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,sBAAuB,SAAQ,yBAAyB,CACnE,0BAA0B,EAC1B,eAAe,CAChB;IACC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuB;gBAEjC,UAAU,EAAE,UAAU,EAAE,SAAS,GAAE,OAAe;IAK9D;;;;;OAKG;IACH,SAAS,CAAC,cAAc,CACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAM5C;;;;;OAKG;IACH,SAAS,CAAC,oBAAoB,CAAC,SAAS,EAAE,0BAA0B,EAAE,GAAG,eAAe,EAAE;IAuD1F;;;;;;OAMG;IACG,8BAA8B,CAClC,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,2BAA2B,CAAC;IAkCvC;;;;;;;;;OASG;IACG,iCAAiC,CACrC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