@gala-chain/launchpad-sdk 5.0.3 → 5.0.4-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/EXAMPLES.md +141 -7
  2. package/README.md +68 -36
  3. package/dist/ai-docs.json +7357 -0
  4. package/dist/index.cjs.js +1 -1
  5. package/dist/index.d.ts +70 -11
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.esm.js +1 -1
  8. package/dist/index.js +1 -1
  9. package/dist/src/LaunchpadSDK.d.ts +3288 -214
  10. package/dist/src/LaunchpadSDK.d.ts.map +1 -1
  11. package/dist/src/api/LaunchpadAPI.d.ts +21 -41
  12. package/dist/src/api/LaunchpadAPI.d.ts.map +1 -1
  13. package/dist/src/api/dto/BurnTokensDto.d.ts.map +1 -1
  14. package/dist/src/api/dto/LockTokenDto.d.ts.map +1 -1
  15. package/dist/src/api/dto/TransferTokenDto.d.ts.map +1 -1
  16. package/dist/src/api/dto/UnlockTokenDto.d.ts.map +1 -1
  17. package/dist/src/auth/JwtAuth.d.ts +145 -0
  18. package/dist/src/auth/JwtAuth.d.ts.map +1 -0
  19. package/dist/src/auth/SessionAuthService.d.ts +146 -0
  20. package/dist/src/auth/SessionAuthService.d.ts.map +1 -0
  21. package/dist/src/auth/SignatureAuth.d.ts.map +1 -1
  22. package/dist/src/bridge/BridgeService.d.ts.map +1 -1
  23. package/dist/src/bridge/GalaConnectClient.d.ts.map +1 -1
  24. package/dist/src/bridge/constants/tokens.d.ts +4 -3
  25. package/dist/src/bridge/constants/tokens.d.ts.map +1 -1
  26. package/dist/src/bridge/index.d.ts +1 -0
  27. package/dist/src/bridge/index.d.ts.map +1 -1
  28. package/dist/src/bridge/strategies/BridgeStrategy.d.ts.map +1 -1
  29. package/dist/src/bridge/strategies/EthereumBridgeStrategy.d.ts +1 -38
  30. package/dist/src/bridge/strategies/EthereumBridgeStrategy.d.ts.map +1 -1
  31. package/dist/src/bridge/strategies/SolanaBridgeStrategy.d.ts +1 -21
  32. package/dist/src/bridge/strategies/SolanaBridgeStrategy.d.ts.map +1 -1
  33. package/dist/src/bridge/types/bridge.dto.d.ts +15 -2
  34. package/dist/src/bridge/types/bridge.dto.d.ts.map +1 -1
  35. package/dist/src/bridge/utils/RateLimiter.d.ts +1 -1
  36. package/dist/src/bridge/utils/RateLimiter.d.ts.map +1 -1
  37. package/dist/src/bridge/utils/address-formatter.d.ts +25 -0
  38. package/dist/src/bridge/utils/address-formatter.d.ts.map +1 -0
  39. package/dist/src/bridge/utils/addressValidation.d.ts +200 -0
  40. package/dist/src/bridge/utils/addressValidation.d.ts.map +1 -0
  41. package/dist/src/bridge/utils/balanceHelpers.d.ts +215 -0
  42. package/dist/src/bridge/utils/balanceHelpers.d.ts.map +1 -0
  43. package/dist/src/bridge/utils/bridgeErrors.d.ts +98 -0
  44. package/dist/src/bridge/utils/bridgeErrors.d.ts.map +1 -0
  45. package/dist/src/bridge/utils/bridgeOutHelpers.d.ts +68 -0
  46. package/dist/src/bridge/utils/bridgeOutHelpers.d.ts.map +1 -0
  47. package/dist/src/bridge/utils/bridgePayload.d.ts +107 -0
  48. package/dist/src/bridge/utils/bridgePayload.d.ts.map +1 -0
  49. package/dist/src/bridge/utils/bridgeStatusParser.d.ts +75 -0
  50. package/dist/src/bridge/utils/bridgeStatusParser.d.ts.map +1 -0
  51. package/dist/src/bridge/utils/eip712Helpers.d.ts +66 -0
  52. package/dist/src/bridge/utils/eip712Helpers.d.ts.map +1 -0
  53. package/dist/src/bridge/utils/index.d.ts +9 -0
  54. package/dist/src/bridge/utils/index.d.ts.map +1 -1
  55. package/dist/src/bridge/utils/retry.d.ts +16 -0
  56. package/dist/src/bridge/utils/retry.d.ts.map +1 -1
  57. package/dist/src/bridge/utils/strategyDelegation.d.ts +69 -0
  58. package/dist/src/bridge/utils/strategyDelegation.d.ts.map +1 -0
  59. package/dist/src/bridge/utils/tokenIdUtils.d.ts +7 -0
  60. package/dist/src/bridge/utils/tokenIdUtils.d.ts.map +1 -1
  61. package/dist/src/bridge/utils/tokenMath.d.ts.map +1 -1
  62. package/dist/src/bridge/utils/tokenMetadataResolver.d.ts +97 -0
  63. package/dist/src/bridge/utils/tokenMetadataResolver.d.ts.map +1 -0
  64. package/dist/src/constants/endpoints.d.ts +453 -0
  65. package/dist/src/constants/endpoints.d.ts.map +1 -1
  66. package/dist/src/constants/error-messages.d.ts +1 -1
  67. package/dist/src/constants/error-messages.d.ts.map +1 -1
  68. package/dist/src/constants/jwt.d.ts +41 -0
  69. package/dist/src/constants/jwt.d.ts.map +1 -0
  70. package/dist/src/constants/sdk-defaults.d.ts +37 -0
  71. package/dist/src/constants/sdk-defaults.d.ts.map +1 -0
  72. package/dist/src/constants/version.generated.d.ts +1 -1
  73. package/dist/src/constants/version.generated.d.ts.map +1 -1
  74. package/dist/src/helpers/sdk.d.ts.map +1 -1
  75. package/dist/src/helpers/wallet.d.ts +4 -3
  76. package/dist/src/helpers/wallet.d.ts.map +1 -1
  77. package/dist/src/index.d.ts +70 -11
  78. package/dist/src/index.d.ts.map +1 -1
  79. package/dist/src/schemas/files.d.ts +2 -2
  80. package/dist/src/schemas/launchpad.d.ts +40 -8
  81. package/dist/src/schemas/launchpad.d.ts.map +1 -1
  82. package/dist/src/schemas/pagination.d.ts +7 -7
  83. package/dist/src/schemas/primitives.d.ts.map +1 -1
  84. package/dist/src/schemas/trade.d.ts +6 -6
  85. package/dist/src/schemas/user.d.ts +4 -4
  86. package/dist/src/schemas/validators.d.ts +15 -7
  87. package/dist/src/schemas/validators.d.ts.map +1 -1
  88. package/dist/src/services/AbstractCacheService.d.ts +227 -0
  89. package/dist/src/services/AbstractCacheService.d.ts.map +1 -0
  90. package/dist/src/services/AbstractTokenFetchService.d.ts +150 -0
  91. package/dist/src/services/AbstractTokenFetchService.d.ts.map +1 -0
  92. package/dist/src/services/ApiKeyService.d.ts +205 -0
  93. package/dist/src/services/ApiKeyService.d.ts.map +1 -0
  94. package/dist/src/services/BanService.d.ts +195 -0
  95. package/dist/src/services/BanService.d.ts.map +1 -0
  96. package/dist/src/services/BaseService.d.ts +50 -3
  97. package/dist/src/services/BaseService.d.ts.map +1 -1
  98. package/dist/src/services/BatchedCacheService.d.ts +132 -0
  99. package/dist/src/services/BatchedCacheService.d.ts.map +1 -0
  100. package/dist/src/services/BridgeableTokenCache.d.ts +32 -98
  101. package/dist/src/services/BridgeableTokenCache.d.ts.map +1 -1
  102. package/dist/src/services/BridgeableTokenService.d.ts +18 -13
  103. package/dist/src/services/BridgeableTokenService.d.ts.map +1 -1
  104. package/dist/src/services/BundleService.d.ts.map +1 -1
  105. package/dist/src/services/BundlerClientFactory.d.ts +32 -0
  106. package/dist/src/services/BundlerClientFactory.d.ts.map +1 -0
  107. package/dist/src/services/ChatMessagesService.d.ts +152 -0
  108. package/dist/src/services/ChatMessagesService.d.ts.map +1 -0
  109. package/dist/src/services/CommentService.d.ts +119 -0
  110. package/dist/src/services/CommentService.d.ts.map +1 -0
  111. package/dist/src/services/CommentsService.d.ts +155 -0
  112. package/dist/src/services/CommentsService.d.ts.map +1 -0
  113. package/dist/src/services/ContentFlagService.d.ts +212 -0
  114. package/dist/src/services/ContentFlagService.d.ts.map +1 -0
  115. package/dist/src/services/ContentReactionService.d.ts +175 -0
  116. package/dist/src/services/ContentReactionService.d.ts.map +1 -0
  117. package/dist/src/services/DexBackendClient.d.ts.map +1 -1
  118. package/dist/src/services/DexPoolService.d.ts +3 -3
  119. package/dist/src/services/DexPoolService.d.ts.map +1 -1
  120. package/dist/src/services/DexQuoteService.d.ts.map +1 -1
  121. package/dist/src/services/DexService.d.ts +2 -5
  122. package/dist/src/services/DexService.d.ts.map +1 -1
  123. package/dist/src/services/GSwapAssetService.d.ts +80 -0
  124. package/dist/src/services/GSwapAssetService.d.ts.map +1 -0
  125. package/dist/src/services/GSwapLiquidityMutationService.d.ts +140 -0
  126. package/dist/src/services/GSwapLiquidityMutationService.d.ts.map +1 -0
  127. package/dist/src/services/GSwapLiquidityQueryService.d.ts +87 -0
  128. package/dist/src/services/GSwapLiquidityQueryService.d.ts.map +1 -0
  129. package/dist/src/services/GSwapPoolCalculationService.d.ts +200 -0
  130. package/dist/src/services/GSwapPoolCalculationService.d.ts.map +1 -0
  131. package/dist/src/services/GSwapPoolQueryService.d.ts +116 -0
  132. package/dist/src/services/GSwapPoolQueryService.d.ts.map +1 -0
  133. package/dist/src/services/GSwapService.d.ts +14 -0
  134. package/dist/src/services/GSwapService.d.ts.map +1 -1
  135. package/dist/src/services/GSwapSwapService.d.ts +68 -0
  136. package/dist/src/services/GSwapSwapService.d.ts.map +1 -0
  137. package/dist/src/services/GalaChainBalanceService.d.ts +155 -0
  138. package/dist/src/services/GalaChainBalanceService.d.ts.map +1 -0
  139. package/dist/src/services/GalaChainGatewayClient.d.ts +32 -1
  140. package/dist/src/services/GalaChainGatewayClient.d.ts.map +1 -1
  141. package/dist/src/services/GalaChainLockService.d.ts +144 -0
  142. package/dist/src/services/GalaChainLockService.d.ts.map +1 -0
  143. package/dist/src/services/GalaChainService.d.ts +23 -106
  144. package/dist/src/services/GalaChainService.d.ts.map +1 -1
  145. package/dist/src/services/GalaChainTokenService.d.ts +108 -0
  146. package/dist/src/services/GalaChainTokenService.d.ts.map +1 -0
  147. package/dist/src/services/GalaChainTransferService.d.ts +205 -0
  148. package/dist/src/services/GalaChainTransferService.d.ts.map +1 -0
  149. package/dist/src/services/ImageService.d.ts +24 -8
  150. package/dist/src/services/ImageService.d.ts.map +1 -1
  151. package/dist/src/services/LaunchpadService.d.ts +77 -5
  152. package/dist/src/services/LaunchpadService.d.ts.map +1 -1
  153. package/dist/src/services/ModeratorService.d.ts +269 -0
  154. package/dist/src/services/ModeratorService.d.ts.map +1 -0
  155. package/dist/src/services/MultiPoolStateManager.d.ts +4 -6
  156. package/dist/src/services/MultiPoolStateManager.d.ts.map +1 -1
  157. package/dist/src/services/NetworkKeyedCacheService.d.ts +185 -0
  158. package/dist/src/services/NetworkKeyedCacheService.d.ts.map +1 -0
  159. package/dist/src/services/OverseerService.d.ts +322 -0
  160. package/dist/src/services/OverseerService.d.ts.map +1 -0
  161. package/dist/src/services/PoolCacheManager.d.ts +2 -2
  162. package/dist/src/services/PoolCacheManager.d.ts.map +1 -1
  163. package/dist/src/services/PoolService.d.ts +61 -7
  164. package/dist/src/services/PoolService.d.ts.map +1 -1
  165. package/dist/src/services/PoolStateManager.d.ts +2 -2
  166. package/dist/src/services/PoolStateManager.d.ts.map +1 -1
  167. package/dist/src/services/PriceHistoryService.d.ts.map +1 -1
  168. package/dist/src/services/SignatureService.d.ts.map +1 -1
  169. package/dist/src/services/StreamChatService.d.ts +378 -0
  170. package/dist/src/services/StreamChatService.d.ts.map +1 -0
  171. package/dist/src/services/StreamTokenServiceBase.d.ts +371 -0
  172. package/dist/src/services/StreamTokenServiceBase.d.ts.map +1 -0
  173. package/dist/src/services/StreamWebSocketService.d.ts +268 -0
  174. package/dist/src/services/StreamWebSocketService.d.ts.map +1 -0
  175. package/dist/src/services/StreamingEventService.d.ts +431 -0
  176. package/dist/src/services/StreamingEventService.d.ts.map +1 -0
  177. package/dist/src/services/StreamingService.d.ts +547 -0
  178. package/dist/src/services/StreamingService.d.ts.map +1 -0
  179. package/dist/src/services/SwapEventQueue.d.ts +2 -2
  180. package/dist/src/services/SwapEventQueue.d.ts.map +1 -1
  181. package/dist/src/services/TokenBanService.d.ts +214 -0
  182. package/dist/src/services/TokenBanService.d.ts.map +1 -0
  183. package/dist/src/services/TokenClassKeyService.d.ts.map +1 -1
  184. package/dist/src/services/TokenMetadataCache.d.ts +36 -27
  185. package/dist/src/services/TokenMetadataCache.d.ts.map +1 -1
  186. package/dist/src/services/TokenMetadataService.d.ts +24 -4
  187. package/dist/src/services/TokenMetadataService.d.ts.map +1 -1
  188. package/dist/src/services/TokenResolverService.d.ts.map +1 -1
  189. package/dist/src/services/TradeService.d.ts +73 -0
  190. package/dist/src/services/TradeService.d.ts.map +1 -1
  191. package/dist/src/services/UserService.d.ts +56 -3
  192. package/dist/src/services/UserService.d.ts.map +1 -1
  193. package/dist/src/services/WebSocketService.d.ts +3 -3
  194. package/dist/src/services/WebSocketService.d.ts.map +1 -1
  195. package/dist/src/services/WrapService.d.ts +18 -5
  196. package/dist/src/services/WrapService.d.ts.map +1 -1
  197. package/dist/src/services/WrappableTokenCache.d.ts +8 -36
  198. package/dist/src/services/WrappableTokenCache.d.ts.map +1 -1
  199. package/dist/src/services/WrappableTokenService.d.ts +18 -12
  200. package/dist/src/services/WrappableTokenService.d.ts.map +1 -1
  201. package/dist/src/services/shared/cache-helpers.d.ts +188 -0
  202. package/dist/src/services/shared/cache-helpers.d.ts.map +1 -0
  203. package/dist/src/services/shared/http-helpers.d.ts +146 -0
  204. package/dist/src/services/shared/http-helpers.d.ts.map +1 -0
  205. package/dist/src/services/shared/pagination-helpers.d.ts +157 -0
  206. package/dist/src/services/shared/pagination-helpers.d.ts.map +1 -0
  207. package/dist/src/services/shared/service-validators.d.ts +137 -0
  208. package/dist/src/services/shared/service-validators.d.ts.map +1 -0
  209. package/dist/src/services/shared/websocket-helpers.d.ts +158 -0
  210. package/dist/src/services/shared/websocket-helpers.d.ts.map +1 -0
  211. package/dist/src/test-constants.d.ts +29 -0
  212. package/dist/src/test-constants.d.ts.map +1 -0
  213. package/dist/src/types/api-key.dto.d.ts +300 -0
  214. package/dist/src/types/api-key.dto.d.ts.map +1 -0
  215. package/dist/src/types/backend-responses.d.ts +12 -0
  216. package/dist/src/types/backend-responses.d.ts.map +1 -1
  217. package/dist/src/types/ban.dto.d.ts +413 -0
  218. package/dist/src/types/ban.dto.d.ts.map +1 -0
  219. package/dist/src/types/burn.dto.d.ts +21 -0
  220. package/dist/src/types/burn.dto.d.ts.map +1 -1
  221. package/dist/src/types/chat-messages.dto.d.ts +193 -0
  222. package/dist/src/types/chat-messages.dto.d.ts.map +1 -0
  223. package/dist/src/types/comment.dto.d.ts +180 -0
  224. package/dist/src/types/comment.dto.d.ts.map +1 -0
  225. package/dist/src/types/comments.dto.d.ts +210 -0
  226. package/dist/src/types/comments.dto.d.ts.map +1 -0
  227. package/dist/src/types/common.d.ts +369 -0
  228. package/dist/src/types/common.d.ts.map +1 -1
  229. package/dist/src/types/constraints.d.ts +374 -0
  230. package/dist/src/types/constraints.d.ts.map +1 -0
  231. package/dist/src/types/content-flag.dto.d.ts +310 -0
  232. package/dist/src/types/content-flag.dto.d.ts.map +1 -0
  233. package/dist/src/types/content-reactions.dto.d.ts +132 -0
  234. package/dist/src/types/content-reactions.dto.d.ts.map +1 -0
  235. package/dist/src/types/dex-pool.dto.d.ts +13 -37
  236. package/dist/src/types/dex-pool.dto.d.ts.map +1 -1
  237. package/dist/src/types/dto.d.ts +8 -0
  238. package/dist/src/types/dto.d.ts.map +1 -1
  239. package/dist/src/types/galachain-api.types.d.ts +30 -0
  240. package/dist/src/types/galachain-api.types.d.ts.map +1 -1
  241. package/dist/src/types/gswap-responses.types.d.ts.map +1 -1
  242. package/dist/src/types/launchpad.dto.d.ts +234 -131
  243. package/dist/src/types/launchpad.dto.d.ts.map +1 -1
  244. package/dist/src/types/launchpad.validation.d.ts.map +1 -1
  245. package/dist/src/types/lock.dto.d.ts +20 -35
  246. package/dist/src/types/lock.dto.d.ts.map +1 -1
  247. package/dist/src/types/moderator.dto.d.ts +581 -0
  248. package/dist/src/types/moderator.dto.d.ts.map +1 -0
  249. package/dist/src/types/options.dto.d.ts +25 -115
  250. package/dist/src/types/options.dto.d.ts.map +1 -1
  251. package/dist/src/types/overseer.dto.d.ts +420 -0
  252. package/dist/src/types/overseer.dto.d.ts.map +1 -0
  253. package/dist/src/types/pool.dto.d.ts +106 -0
  254. package/dist/src/types/pool.dto.d.ts.map +1 -0
  255. package/dist/src/types/result.types.d.ts +3 -2
  256. package/dist/src/types/result.types.d.ts.map +1 -1
  257. package/dist/src/types/session-auth.dto.d.ts +91 -0
  258. package/dist/src/types/session-auth.dto.d.ts.map +1 -0
  259. package/dist/src/types/stream-chat.dto.d.ts +815 -0
  260. package/dist/src/types/stream-chat.dto.d.ts.map +1 -0
  261. package/dist/src/types/streaming-events.dto.d.ts +586 -0
  262. package/dist/src/types/streaming-events.dto.d.ts.map +1 -0
  263. package/dist/src/types/streaming.dto.d.ts +1141 -0
  264. package/dist/src/types/streaming.dto.d.ts.map +1 -0
  265. package/dist/src/types/token-ban.dto.d.ts +195 -0
  266. package/dist/src/types/token-ban.dto.d.ts.map +1 -0
  267. package/dist/src/types/trade.dto.d.ts +21 -61
  268. package/dist/src/types/trade.dto.d.ts.map +1 -1
  269. package/dist/src/types/trades-query.dto.d.ts +127 -0
  270. package/dist/src/types/trades-query.dto.d.ts.map +1 -0
  271. package/dist/src/types/transfer.dto.d.ts +20 -15
  272. package/dist/src/types/transfer.dto.d.ts.map +1 -1
  273. package/dist/src/types/user.dto.d.ts +185 -73
  274. package/dist/src/types/user.dto.d.ts.map +1 -1
  275. package/dist/src/types/wrappable-token.dto.d.ts +6 -2
  276. package/dist/src/types/wrappable-token.dto.d.ts.map +1 -1
  277. package/dist/src/utils/LiquidityEventExtractor.d.ts.map +1 -1
  278. package/dist/src/utils/Logger.d.ts.map +1 -1
  279. package/dist/src/utils/MonitoringMetrics.d.ts.map +1 -1
  280. package/dist/src/utils/PoolKeyNormalizer.d.ts.map +1 -1
  281. package/dist/src/utils/ReconnectionManager.d.ts +142 -0
  282. package/dist/src/utils/ReconnectionManager.d.ts.map +1 -0
  283. package/dist/src/utils/SignatureHelper.d.ts +9 -0
  284. package/dist/src/utils/SignatureHelper.d.ts.map +1 -1
  285. package/dist/src/utils/SwapEventExtractor.d.ts.map +1 -1
  286. package/dist/src/utils/adapters.d.ts.map +1 -1
  287. package/dist/src/utils/address-formatter.d.ts +317 -0
  288. package/dist/src/utils/address-formatter.d.ts.map +1 -0
  289. package/dist/src/utils/agent-config.d.ts.map +1 -1
  290. package/dist/src/utils/amount-validator.d.ts +268 -0
  291. package/dist/src/utils/amount-validator.d.ts.map +1 -0
  292. package/dist/src/utils/api-patterns.d.ts +347 -0
  293. package/dist/src/utils/api-patterns.d.ts.map +1 -0
  294. package/dist/src/utils/array-helpers.d.ts +115 -0
  295. package/dist/src/utils/array-helpers.d.ts.map +1 -0
  296. package/dist/src/utils/async-patterns.d.ts +272 -0
  297. package/dist/src/utils/async-patterns.d.ts.map +1 -0
  298. package/dist/src/utils/auto-pagination.d.ts +195 -2
  299. package/dist/src/utils/auto-pagination.d.ts.map +1 -1
  300. package/dist/src/utils/bignumber-helpers.d.ts +119 -13
  301. package/dist/src/utils/bignumber-helpers.d.ts.map +1 -1
  302. package/dist/src/utils/bignumber-pool-cache.d.ts.map +1 -1
  303. package/dist/src/utils/bondingCurveCalculations.d.ts.map +1 -1
  304. package/dist/src/utils/cacheWarmingHelpers.d.ts +2 -2
  305. package/dist/src/utils/cacheWarmingHelpers.d.ts.map +1 -1
  306. package/dist/src/utils/data-transform-patterns.d.ts +393 -0
  307. package/dist/src/utils/data-transform-patterns.d.ts.map +1 -0
  308. package/dist/src/utils/date-utils.d.ts +166 -0
  309. package/dist/src/utils/date-utils.d.ts.map +1 -1
  310. package/dist/src/utils/delimiter-parser.d.ts +139 -0
  311. package/dist/src/utils/delimiter-parser.d.ts.map +1 -0
  312. package/dist/src/utils/error-factories.d.ts +346 -1
  313. package/dist/src/utils/error-factories.d.ts.map +1 -1
  314. package/dist/src/utils/error-handling-patterns.d.ts +390 -0
  315. package/dist/src/utils/error-handling-patterns.d.ts.map +1 -0
  316. package/dist/src/utils/error-patterns.d.ts +360 -0
  317. package/dist/src/utils/error-patterns.d.ts.map +1 -0
  318. package/dist/src/utils/error-utils.d.ts +250 -0
  319. package/dist/src/utils/error-utils.d.ts.map +1 -1
  320. package/dist/src/utils/error-wrapper.d.ts +208 -0
  321. package/dist/src/utils/error-wrapper.d.ts.map +1 -0
  322. package/dist/src/utils/errors.d.ts +70 -0
  323. package/dist/src/utils/errors.d.ts.map +1 -1
  324. package/dist/src/utils/http-factory.d.ts +36 -0
  325. package/dist/src/utils/http-factory.d.ts.map +1 -0
  326. package/dist/src/utils/http.d.ts.map +1 -1
  327. package/dist/src/utils/load-env.d.ts.map +1 -1
  328. package/dist/src/utils/multipart.d.ts.map +1 -1
  329. package/dist/src/utils/numeric-patterns.d.ts +289 -0
  330. package/dist/src/utils/numeric-patterns.d.ts.map +1 -0
  331. package/dist/src/utils/numeric-wrappers.d.ts +146 -0
  332. package/dist/src/utils/numeric-wrappers.d.ts.map +1 -0
  333. package/dist/src/utils/object-extractors.d.ts +115 -0
  334. package/dist/src/utils/object-extractors.d.ts.map +1 -0
  335. package/dist/src/utils/object-patterns.d.ts +81 -0
  336. package/dist/src/utils/object-patterns.d.ts.map +1 -0
  337. package/dist/src/utils/pagination-helpers.d.ts +230 -0
  338. package/dist/src/utils/pagination-helpers.d.ts.map +1 -0
  339. package/dist/src/utils/pool-pair-parser.d.ts +3 -1
  340. package/dist/src/utils/pool-pair-parser.d.ts.map +1 -1
  341. package/dist/src/utils/pool-state-validator.d.ts.map +1 -1
  342. package/dist/src/utils/position-filters.d.ts +1 -2
  343. package/dist/src/utils/position-filters.d.ts.map +1 -1
  344. package/dist/src/utils/query-params.d.ts +0 -16
  345. package/dist/src/utils/query-params.d.ts.map +1 -1
  346. package/dist/src/utils/response-handlers.d.ts +149 -20
  347. package/dist/src/utils/response-handlers.d.ts.map +1 -1
  348. package/dist/src/utils/response-helpers.d.ts +28 -0
  349. package/dist/src/utils/response-helpers.d.ts.map +1 -0
  350. package/dist/src/utils/response-normalizers.d.ts +27 -49
  351. package/dist/src/utils/response-normalizers.d.ts.map +1 -1
  352. package/dist/src/utils/safe-parsers.d.ts +487 -0
  353. package/dist/src/utils/safe-parsers.d.ts.map +1 -0
  354. package/dist/src/utils/service-validators.d.ts +268 -0
  355. package/dist/src/utils/service-validators.d.ts.map +1 -0
  356. package/dist/src/utils/slippage-utils.d.ts.map +1 -1
  357. package/dist/src/utils/string-patterns.d.ts +404 -0
  358. package/dist/src/utils/string-patterns.d.ts.map +1 -0
  359. package/dist/src/utils/string-transforms.d.ts +89 -0
  360. package/dist/src/utils/string-transforms.d.ts.map +1 -0
  361. package/dist/src/utils/string-utils.d.ts +108 -0
  362. package/dist/src/utils/string-utils.d.ts.map +1 -0
  363. package/dist/src/utils/swap-delta-calculator.d.ts.map +1 -1
  364. package/dist/src/utils/tick-crossing-handler.d.ts.map +1 -1
  365. package/dist/src/utils/token-format-converter.d.ts +22 -8
  366. package/dist/src/utils/token-format-converter.d.ts.map +1 -1
  367. package/dist/src/utils/token-parser.d.ts +2 -2
  368. package/dist/src/utils/token-parser.d.ts.map +1 -1
  369. package/dist/src/utils/token-stringification.d.ts +168 -0
  370. package/dist/src/utils/token-stringification.d.ts.map +1 -0
  371. package/dist/src/utils/tokenNameNormalizer.d.ts +96 -0
  372. package/dist/src/utils/tokenNameNormalizer.d.ts.map +1 -0
  373. package/dist/src/utils/tokenNormalizer.d.ts +8 -45
  374. package/dist/src/utils/tokenNormalizer.d.ts.map +1 -1
  375. package/dist/src/utils/transfer-validation.d.ts +1 -1
  376. package/dist/src/utils/transfer-validation.d.ts.map +1 -1
  377. package/dist/src/utils/type-guard-factory.d.ts +260 -0
  378. package/dist/src/utils/type-guard-factory.d.ts.map +1 -0
  379. package/dist/src/utils/unique-key-generator.d.ts +148 -0
  380. package/dist/src/utils/unique-key-generator.d.ts.map +1 -0
  381. package/dist/src/utils/validation-helpers.d.ts +906 -183
  382. package/dist/src/utils/validation-helpers.d.ts.map +1 -1
  383. package/dist/src/utils/validation-patterns.d.ts +745 -0
  384. package/dist/src/utils/validation-patterns.d.ts.map +1 -0
  385. package/dist/src/utils/validation.d.ts +2 -30
  386. package/dist/src/utils/validation.d.ts.map +1 -1
  387. package/dist/src/utils/wallet.d.ts +12 -1
  388. package/dist/src/utils/wallet.d.ts.map +1 -1
  389. package/dist/src/utils/websocket-patterns.d.ts +681 -0
  390. package/dist/src/utils/websocket-patterns.d.ts.map +1 -0
  391. package/dist/src/utils/websocket-validators.d.ts.map +1 -1
  392. package/package.json +86 -19
  393. package/dist/src/bridge/strategies/index.d.ts +0 -9
  394. package/dist/src/bridge/strategies/index.d.ts.map +0 -1
  395. package/dist/src/constants/counts.d.ts +0 -66
  396. package/dist/src/constants/counts.d.ts.map +0 -1
  397. package/dist/src/services/WebSocketManager.d.ts +0 -99
  398. package/dist/src/services/WebSocketManager.d.ts.map +0 -1
  399. package/dist/src/types/eip712-types.d.ts +0 -140
  400. package/dist/src/types/eip712-types.d.ts.map +0 -1
  401. package/dist/src/types/pool-state-manager-config.dto.d.ts +0 -103
  402. package/dist/src/types/pool-state-manager-config.dto.d.ts.map +0 -1
  403. package/dist/src/utils/number-utils.d.ts +0 -94
  404. package/dist/src/utils/number-utils.d.ts.map +0 -1
  405. package/dist/src/utils/precision-math.d.ts +0 -37
  406. package/dist/src/utils/precision-math.d.ts.map +0 -1
@@ -0,0 +1,745 @@
1
+ /**
2
+ * Common Validation Patterns for Launchpad SDK
3
+ *
4
+ * Reusable validation utilities that consolidate duplicate patterns
5
+ * found across services and DTOs. Eliminates boilerplate validation code
6
+ * and provides consistent error messages throughout the SDK.
7
+ *
8
+ * @category Utilities
9
+ * @since 6.20.0
10
+ */
11
+ /**
12
+ * Validates numeric values within inclusive bounds (min ≤ value ≤ max)
13
+ *
14
+ * Consolidates 7 instances of numeric range validation found in:
15
+ * - pagination-helpers.ts (page, limit bounds)
16
+ * - dex-service.ts (limit, offset constraints)
17
+ * - liquidity-service.ts (slippage tolerance bounds)
18
+ *
19
+ * ## Replaces Pattern
20
+ *
21
+ * ### Before (Duplicate across services):
22
+ * ```typescript
23
+ * if (page < MIN_PAGE || page > MAX_PAGE) {
24
+ * throw new ValidationError(`Page must be between ${MIN_PAGE} and ${MAX_PAGE}`, 'page');
25
+ * }
26
+ * ```
27
+ *
28
+ * ### After (Single call):
29
+ * ```typescript
30
+ * numericRangeValidation(page, MIN_PAGE, MAX_PAGE, 'page');
31
+ * ```
32
+ *
33
+ * @param value The numeric value to validate
34
+ * @param min Minimum allowed value (inclusive)
35
+ * @param max Maximum allowed value (inclusive)
36
+ * @param fieldName Field name for error messages (e.g., 'page', 'slippageTolerance')
37
+ * @throws {ValidationError} If value is not a number or outside bounds
38
+ *
39
+ * @example Basic pagination validation
40
+ * ```typescript
41
+ * import { numericRangeValidation } from '../utils/validation-patterns';
42
+ *
43
+ * function fetchPools(page: number) {
44
+ * numericRangeValidation(page, 1, 1000, 'page');
45
+ * // Validation passed - proceed with fetch
46
+ * }
47
+ * ```
48
+ *
49
+ * @example With slippage tolerance
50
+ * ```typescript
51
+ * import { numericRangeValidation } from '../utils/validation-patterns';
52
+ *
53
+ * function executeSwap(slippageTolerance: number) {
54
+ * numericRangeValidation(slippageTolerance, 0, 1, 'slippageTolerance');
55
+ * // Validation passed - execute swap
56
+ * }
57
+ * ```
58
+ *
59
+ * @since 6.20.0
60
+ */
61
+ export declare function numericRangeValidation(value: unknown, min: number, max: number, fieldName: string): void;
62
+ /**
63
+ * Validates string length against maximum constraint
64
+ *
65
+ * Consolidates 8 instances of max length validation found in:
66
+ * - streaming.dto.ts (stream descriptions)
67
+ * - content-flag.dto.ts (flag reasons, descriptions)
68
+ * - comment.dto.ts (comment content)
69
+ * - ban.dto.ts (ban reasons)
70
+ *
71
+ * ## Replaces Pattern
72
+ *
73
+ * ### Before (Duplicate across DTOs):
74
+ * ```typescript
75
+ * if (typeof value !== 'string' || value.length > MAX_LENGTH) {
76
+ * throw new ValidationError(`Description must be at most ${MAX_LENGTH} characters`);
77
+ * }
78
+ * ```
79
+ *
80
+ * ### After (Single call):
81
+ * ```typescript
82
+ * stringMaxLengthValidation(description, 500, 'description');
83
+ * ```
84
+ *
85
+ * @param value The string to validate
86
+ * @param maxLength Maximum allowed length
87
+ * @param fieldName Field name for error messages (e.g., 'description', 'reason')
88
+ * @throws {ValidationError} If value is not a string or exceeds max length
89
+ *
90
+ * @example Basic usage with comment content
91
+ * ```typescript
92
+ * import { stringMaxLengthValidation } from '../utils/validation-patterns';
93
+ *
94
+ * function postComment(content: unknown) {
95
+ * stringMaxLengthValidation(content, 1000, 'content');
96
+ * // Validation passed - post comment
97
+ * }
98
+ * ```
99
+ *
100
+ * @example With ban reason
101
+ * ```typescript
102
+ * import { stringMaxLengthValidation } from '../utils/validation-patterns';
103
+ *
104
+ * function createBan(reason: unknown) {
105
+ * stringMaxLengthValidation(reason, 500, 'reason');
106
+ * // Validation passed - create ban
107
+ * }
108
+ * ```
109
+ *
110
+ * @since 6.20.0
111
+ */
112
+ export declare function stringMaxLengthValidation(value: unknown, maxLength: number, fieldName: string): void;
113
+ /**
114
+ * Validates array type and non-empty requirement with type assertion
115
+ *
116
+ * Consolidates 6 instances of array validation found in:
117
+ * - token-service.ts (batch token operations)
118
+ * - lock.dto.ts (batch lock entries)
119
+ * - burn.dto.ts (batch burn entries)
120
+ * - transfer.dto.ts (batch transfer entries)
121
+ *
122
+ * ## Replaces Pattern
123
+ *
124
+ * ### Before (Duplicate across DTOs):
125
+ * ```typescript
126
+ * if (!Array.isArray(arr) || arr.length === 0) {
127
+ * throw new ValidationError('Tokens array is required and must not be empty');
128
+ * }
129
+ * ```
130
+ *
131
+ * ### After (Single call with type assertion):
132
+ * ```typescript
133
+ * arrayNonEmptyValidation<Token>(entries, 'tokens');
134
+ * // entries is now typed as Token[] (type narrowed)
135
+ * ```
136
+ *
137
+ * @template T The element type of the array being validated
138
+ * @param arr The value to validate (should be an array)
139
+ * @param fieldName Field name for error messages (e.g., 'tokens', 'entries')
140
+ * @throws {ValidationError} If arr is not an array or is empty
141
+ *
142
+ * @example Basic batch operation validation
143
+ * ```typescript
144
+ * import { arrayNonEmptyValidation } from '../utils/validation-patterns';
145
+ *
146
+ * interface TokenEntry { tokenName: string; amount: string; }
147
+ *
148
+ * function lockTokens(entries: unknown) {
149
+ * arrayNonEmptyValidation<TokenEntry>(entries, 'tokens');
150
+ * // entries is now TokenEntry[] - safe to iterate
151
+ * entries.forEach(e => console.log(e.tokenName));
152
+ * }
153
+ * ```
154
+ *
155
+ * @example With type narrowing for error handling
156
+ * ```typescript
157
+ * import { arrayNonEmptyValidation } from '../utils/validation-patterns';
158
+ *
159
+ * function processEntries(data: unknown) {
160
+ * try {
161
+ * arrayNonEmptyValidation<CustomType>(data, 'entries');
162
+ * // data is now CustomType[]
163
+ * } catch (error) {
164
+ * if (error instanceof ValidationError) {
165
+ * console.log(error.message); // "Entries array is required and must not be empty"
166
+ * }
167
+ * }
168
+ * }
169
+ * ```
170
+ *
171
+ * @since 6.20.0
172
+ */
173
+ export declare function arrayNonEmptyValidation<T>(arr: unknown, fieldName: string): asserts arr is T[];
174
+ /**
175
+ * Validates integer type, integer check, and positive value constraint
176
+ *
177
+ * Consolidates 4 instances of positive integer validation found in:
178
+ * - comment.dto.ts (parent comment ID)
179
+ * - content-flag.dto.ts (entity ID)
180
+ * - moderator.dto.ts (invite ID)
181
+ * - streaming.dto.ts (asset ID validation)
182
+ *
183
+ * ## Replaces Pattern
184
+ *
185
+ * ### Before (Duplicate across DTOs):
186
+ * ```typescript
187
+ * if (typeof id !== 'number' || !Number.isInteger(id) || id <= 0) {
188
+ * throw new ValidationError('ID must be a positive integer');
189
+ * }
190
+ * ```
191
+ *
192
+ * ### After (Single call):
193
+ * ```typescript
194
+ * positiveIntegerValidation(id, 'id');
195
+ * ```
196
+ *
197
+ * @param value The value to validate
198
+ * @param fieldName Field name for error messages (e.g., 'id', 'count')
199
+ * @throws {ValidationError} If value is not a positive integer
200
+ *
201
+ * @example ID validation
202
+ * ```typescript
203
+ * import { positiveIntegerValidation } from '../utils/validation-patterns';
204
+ *
205
+ * function getComment(commentId: unknown) {
206
+ * positiveIntegerValidation(commentId, 'commentId');
207
+ * // Validation passed - fetch comment
208
+ * }
209
+ * ```
210
+ *
211
+ * @example Count validation
212
+ * ```typescript
213
+ * import { positiveIntegerValidation } from '../utils/validation-patterns';
214
+ *
215
+ * function fetchPaginated(limit: unknown) {
216
+ * positiveIntegerValidation(limit, 'limit');
217
+ * // Validation passed - fetch with limit
218
+ * }
219
+ * ```
220
+ *
221
+ * @since 6.20.0
222
+ */
223
+ export declare function positiveIntegerValidation(value: unknown, fieldName: string): void;
224
+ /**
225
+ * Validates enum membership checking using Object.values() approach
226
+ *
227
+ * Consolidates 5 instances of enum validation found in:
228
+ * - content-flag.dto.ts (ContentType enum)
229
+ * - ban.dto.ts (BanDuration enum)
230
+ * - moderator.dto.ts (ModeratorRole enum)
231
+ * - api-key.dto.ts (ApiKeyRole enum)
232
+ * - streaming.dto.ts (StreamStatus enum)
233
+ *
234
+ * ## Replaces Pattern
235
+ *
236
+ * ### Before (Duplicate across DTOs):
237
+ * ```typescript
238
+ * const validRoles = Object.values(ROLE_ENUM);
239
+ * if (!validRoles.includes(value)) {
240
+ * throw new ValidationError(`Role must be one of: ${validRoles.join(', ')}`);
241
+ * }
242
+ * ```
243
+ *
244
+ * ### After (Single call):
245
+ * ```typescript
246
+ * enumValidationWithObjectValues(value, ROLE_ENUM, 'role');
247
+ * ```
248
+ *
249
+ * @template T The type of the enum object
250
+ * @param value The value to validate
251
+ * @param enumObj The enum object containing valid values
252
+ * @param fieldName Field name for error messages (e.g., 'role', 'status')
253
+ * @throws {ValidationError} If value is not a member of the enum
254
+ *
255
+ * @example Role validation
256
+ * ```typescript
257
+ * import { enumValidationWithObjectValues } from '../utils/validation-patterns';
258
+ *
259
+ * enum ContentType {
260
+ * CHAT_MESSAGE = 'CHAT_MESSAGE',
261
+ * COMMENT = 'COMMENT',
262
+ * STREAM = 'STREAM'
263
+ * }
264
+ *
265
+ * function flagContent(type: unknown) {
266
+ * enumValidationWithObjectValues(type, ContentType, 'contentType');
267
+ * // Validation passed - type is valid enum member
268
+ * }
269
+ * ```
270
+ *
271
+ * @example Status validation
272
+ * ```typescript
273
+ * import { enumValidationWithObjectValues } from '../utils/validation-patterns';
274
+ *
275
+ * enum StreamStatus {
276
+ * LIVE = 'LIVE',
277
+ * OFFLINE = 'OFFLINE',
278
+ * SCHEDULED = 'SCHEDULED'
279
+ * }
280
+ *
281
+ * function setStreamStatus(status: unknown) {
282
+ * enumValidationWithObjectValues(status, StreamStatus, 'status');
283
+ * // Validation passed - status is valid
284
+ * }
285
+ * ```
286
+ *
287
+ * @since 6.20.0
288
+ */
289
+ export declare function enumValidationWithObjectValues<T extends Record<string, string | number>>(value: unknown, enumObj: T, fieldName: string): void;
290
+ /**
291
+ * Validates value against constraint min/max properties
292
+ *
293
+ * Consolidates 5 instances of constraint-based range validation found in:
294
+ * - bonding-curve-service.ts (fee portion constraints)
295
+ * - dex-service.ts (slippage constraints)
296
+ * - liquidity-service.ts (price range constraints)
297
+ * - token-service.ts (decimal constraints)
298
+ *
299
+ * ## Replaces Pattern
300
+ *
301
+ * ### Before (Duplicate across services):
302
+ * ```typescript
303
+ * if (constraint.min && value < constraint.min) {
304
+ * throw new ValidationError(`Must be at least ${constraint.min}`);
305
+ * }
306
+ * if (constraint.max && value > constraint.max) {
307
+ * throw new ValidationError(`Must be at most ${constraint.max}`);
308
+ * }
309
+ * ```
310
+ *
311
+ * ### After (Single call):
312
+ * ```typescript
313
+ * constraintLengthRangeValidation(value, BEE_CONSTRAINT, 'feePortion');
314
+ * ```
315
+ *
316
+ * @param value The value to validate (string or number)
317
+ * @param constraint Constraint object with optional min and max properties
318
+ * @param fieldName Field name for error messages (e.g., 'feePortion', 'decimals')
319
+ * @throws {ValidationError} If value violates constraint bounds
320
+ *
321
+ * @example Fee constraint validation
322
+ * ```typescript
323
+ * import { constraintLengthRangeValidation } from '../utils/validation-patterns';
324
+ *
325
+ * interface FeeConstraint {
326
+ * min?: number;
327
+ * max?: number;
328
+ * }
329
+ *
330
+ * const FEE_CONSTRAINT: FeeConstraint = { min: 0.1, max: 0.5 };
331
+ *
332
+ * function setBondingCurveFee(feePortion: unknown) {
333
+ * constraintLengthRangeValidation(feePortion, FEE_CONSTRAINT, 'feePortion');
334
+ * // Validation passed - fee is within constraints
335
+ * }
336
+ * ```
337
+ *
338
+ * @example Slippage constraint validation
339
+ * ```typescript
340
+ * import { constraintLengthRangeValidation } from '../utils/validation-patterns';
341
+ *
342
+ * const SLIPPAGE_CONSTRAINT = { min: 0, max: 10 };
343
+ *
344
+ * function setSlippageTolerance(tolerance: unknown) {
345
+ * constraintLengthRangeValidation(tolerance, SLIPPAGE_CONSTRAINT, 'slippageTolerance');
346
+ * // Validation passed - slippage is within constraints
347
+ * }
348
+ * ```
349
+ *
350
+ * @since 6.20.0
351
+ */
352
+ export declare function constraintLengthRangeValidation(value: unknown, constraint: {
353
+ min?: number;
354
+ max?: number;
355
+ }, fieldName: string): void;
356
+ /**
357
+ * Validates that minimum value is less than or equal to maximum value
358
+ *
359
+ * Consolidates 3 instances of min/max comparison validation found in:
360
+ * - liquidity-service.ts (tick range validation)
361
+ * - dex-service.ts (price range validation)
362
+ * - bonding-curve-service.ts (fee range validation)
363
+ *
364
+ * ## Replaces Pattern
365
+ *
366
+ * ### Before (Duplicate across services):
367
+ * ```typescript
368
+ * if (minValue > maxValue) {
369
+ * throw new ValidationError('Minimum must be less than or equal to maximum');
370
+ * }
371
+ * ```
372
+ *
373
+ * ### After (Single call):
374
+ * ```typescript
375
+ * minMaxComparisonValidation(minPrice, maxPrice, 'priceRange');
376
+ * ```
377
+ *
378
+ * @param min The minimum value to compare
379
+ * @param max The maximum value to compare
380
+ * @param fieldName Optional field name for error messages (e.g., 'priceRange', 'tickRange')
381
+ * @throws {ValidationError} If min > max
382
+ *
383
+ * @example Tick range validation
384
+ * ```typescript
385
+ * import { minMaxComparisonValidation } from '../utils/validation-patterns';
386
+ *
387
+ * function addLiquidity(minTick: number, maxTick: number) {
388
+ * minMaxComparisonValidation(minTick, maxTick, 'tickRange');
389
+ * // Validation passed - tick range is valid
390
+ * }
391
+ * ```
392
+ *
393
+ * @example Price range validation
394
+ * ```typescript
395
+ * import { minMaxComparisonValidation } from '../utils/validation-patterns';
396
+ *
397
+ * function setPriceRange(minPrice: string, maxPrice: string) {
398
+ * minMaxComparisonValidation(minPrice, maxPrice, 'priceRange');
399
+ * // Validation passed - price range is valid
400
+ * }
401
+ * ```
402
+ *
403
+ * @since 6.20.0
404
+ */
405
+ export declare function minMaxComparisonValidation(min: number | string, max: number | string, fieldName?: string): void;
406
+ /**
407
+ * Validates date type accepting Date, string, or number with NaN validation
408
+ *
409
+ * Consolidates 4 instances of date type validation found in:
410
+ * - price-history-service.ts (date range validation)
411
+ * - monitoring-service.ts (event filter dates)
412
+ * - cache-warming-service.ts (cache expiration dates)
413
+ * - utility-service.ts (timestamp validation)
414
+ *
415
+ * ## Replaces Pattern
416
+ *
417
+ * ### Before (Duplicate across services):
418
+ * ```typescript
419
+ * if (typeof date !== 'object' && typeof date !== 'string' && typeof date !== 'number') {
420
+ * throw new ValidationError('Date must be a Date, string, or number');
421
+ * }
422
+ * if (typeof date === 'number' && isNaN(date)) {
423
+ * throw new ValidationError('Date timestamp must be a valid number');
424
+ * }
425
+ * ```
426
+ *
427
+ * ### After (Single call with type assertion):
428
+ * ```typescript
429
+ * dateTypeValidation(value, 'startDate');
430
+ * // value is now typed as Date | string | number (not NaN)
431
+ * ```
432
+ *
433
+ * @param value The value to validate
434
+ * @param fieldName Field name for error messages (e.g., 'startDate', 'timestamp')
435
+ * @throws {ValidationError} If value is not a valid date type or is NaN
436
+ *
437
+ * @example Date range validation
438
+ * ```typescript
439
+ * import { dateTypeValidation } from '../utils/validation-patterns';
440
+ *
441
+ * function fetchPriceHistory(from: unknown, to: unknown) {
442
+ * dateTypeValidation(from, 'fromDate');
443
+ * dateTypeValidation(to, 'toDate');
444
+ * // Both are now Date | string | number - safe to use
445
+ * }
446
+ * ```
447
+ *
448
+ * @example Event filter validation
449
+ * ```typescript
450
+ * import { dateTypeValidation } from '../utils/validation-patterns';
451
+ *
452
+ * function filterEvents(startTime: unknown) {
453
+ * dateTypeValidation(startTime, 'startTime');
454
+ * // startTime is now Date | string | number
455
+ * const timestamp = new Date(startTime).getTime();
456
+ * }
457
+ * ```
458
+ *
459
+ * @since 6.20.0
460
+ */
461
+ export declare function dateTypeValidation(value: unknown, fieldName: string): asserts value is Date | string | number;
462
+ /**
463
+ * Validates string is not empty or whitespace-only with optional allowEmpty flag
464
+ *
465
+ * Consolidates 5 instances of string emptiness validation found in:
466
+ * - transfer.dto.ts (description validation)
467
+ * - content-flag.dto.ts (reason validation)
468
+ * - comment.dto.ts (content validation)
469
+ * - streaming.dto.ts (title validation)
470
+ * - ban.dto.ts (reason validation)
471
+ *
472
+ * ## Replaces Pattern
473
+ *
474
+ * ### Before (Duplicate across DTOs):
475
+ * ```typescript
476
+ * if (typeof value !== 'string' || value.trim().length === 0) {
477
+ * throw new ValidationError('Reason is required and cannot be empty');
478
+ * }
479
+ * ```
480
+ *
481
+ * ### After (Single call):
482
+ * ```typescript
483
+ * stringEmptyLengthValidation(reason, 'reason', false);
484
+ * ```
485
+ *
486
+ * @param value The value to validate
487
+ * @param fieldName Field name for error messages (e.g., 'reason', 'content')
488
+ * @param allowEmpty Whether to allow empty strings (default: false)
489
+ * @throws {ValidationError} If value is not a string or is empty/whitespace (when not allowed)
490
+ *
491
+ * @example Required string validation
492
+ * ```typescript
493
+ * import { stringEmptyLengthValidation } from '../utils/validation-patterns';
494
+ *
495
+ * function createBan(reason: unknown) {
496
+ * stringEmptyLengthValidation(reason, 'reason', false);
497
+ * // Validation passed - reason is non-empty string
498
+ * }
499
+ * ```
500
+ *
501
+ * @example Optional string validation
502
+ * ```typescript
503
+ * import { stringEmptyLengthValidation } from '../utils/validation-patterns';
504
+ *
505
+ * function updateComment(description: unknown) {
506
+ * stringEmptyLengthValidation(description, 'description', true);
507
+ * // Validation passed - description can be empty or non-empty string
508
+ * }
509
+ * ```
510
+ *
511
+ * @since 6.20.0
512
+ */
513
+ export declare function stringEmptyLengthValidation(value: unknown, fieldName: string, allowEmpty?: boolean): void;
514
+ /**
515
+ * Generic type checking with error factory pattern for flexible error customization
516
+ *
517
+ * Consolidates 4 instances of type checking with custom errors found in:
518
+ * - moderator.dto.ts (complex validation rules)
519
+ * - api-key.dto.ts (role type checking)
520
+ * - streaming.dto.ts (enum type validation)
521
+ * - content-flag.dto.ts (flag type validation)
522
+ *
523
+ * ## Replaces Pattern
524
+ *
525
+ * ### Before (Duplicate across DTOs):
526
+ * ```typescript
527
+ * if (typeof value !== 'string') {
528
+ * throw new ValidationError(`Expected string but got ${typeof value}`);
529
+ * }
530
+ * ```
531
+ *
532
+ * ### After (Single call):
533
+ * ```typescript
534
+ * fieldTypeCheckWithError(value, 'string', 'tokenName');
535
+ * ```
536
+ *
537
+ * @param value The value to check
538
+ * @param expectedType The expected type name (e.g., 'string', 'number', 'object')
539
+ * @param fieldName Field name for error messages (e.g., 'role', 'tokenName')
540
+ * @throws {ValidationError} If value type does not match expected type
541
+ *
542
+ * @example Basic type checking
543
+ * ```typescript
544
+ * import { fieldTypeCheckWithError } from '../utils/validation-patterns';
545
+ *
546
+ * function setRole(role: unknown) {
547
+ * fieldTypeCheckWithError(role, 'string', 'role');
548
+ * // Validation passed - role is a string
549
+ * }
550
+ * ```
551
+ *
552
+ * @example Object type checking
553
+ * ```typescript
554
+ * import { fieldTypeCheckWithError } from '../utils/validation-patterns';
555
+ *
556
+ * function setConfig(config: unknown) {
557
+ * fieldTypeCheckWithError(config, 'object', 'config');
558
+ * // Validation passed - config is an object
559
+ * }
560
+ * ```
561
+ *
562
+ * @since 6.20.0
563
+ */
564
+ export declare function fieldTypeCheckWithError(value: unknown, expectedType: string, fieldName: string): void;
565
+ /**
566
+ * Validates sort direction enum value (ASC or DESC)
567
+ *
568
+ * Consolidates 7 instances of sort direction validation found in:
569
+ * - GSwapPoolQueryService.ts (pool listing sort)
570
+ * - ChatService.ts (message sorting)
571
+ * - CommentsService.ts (comment thread sorting)
572
+ * - OverseersService.ts (list sorting)
573
+ * - BanService.ts (ban list sorting)
574
+ * - ModeratorInviteService.ts (invite list sorting)
575
+ * - common.ts (type definitions)
576
+ *
577
+ * ## Replaces Pattern
578
+ *
579
+ * ### Before (Duplicate across services):
580
+ * ```typescript
581
+ * if (sortDir !== 'ASC' && sortDir !== 'DESC') {
582
+ * throw new ValidationError(`Invalid sort direction: ${sortDir}`);
583
+ * }
584
+ * ```
585
+ *
586
+ * ### After (Single call):
587
+ * ```typescript
588
+ * validateSortOrderDirection(sortDir, 'sortDir');
589
+ * ```
590
+ *
591
+ * @param value The sort direction value to validate ('ASC' or 'DESC')
592
+ * @param fieldName Field name for error messages (e.g., 'sortDir', 'sortOrder')
593
+ * @throws {ValidationError} If value is not 'ASC' or 'DESC'
594
+ *
595
+ * @example Basic sort direction validation
596
+ * ```typescript
597
+ * import { validateSortOrderDirection } from '../utils/validation-patterns';
598
+ *
599
+ * function listComments(options: { sortDir?: string }) {
600
+ * if (options.sortDir) {
601
+ * validateSortOrderDirection(options.sortDir, 'sortDir');
602
+ * }
603
+ * // Validation passed - sortDir is either 'ASC' or 'DESC'
604
+ * }
605
+ * ```
606
+ *
607
+ * @example With service method
608
+ * ```typescript
609
+ * import { validateSortOrderDirection } from '../utils/validation-patterns';
610
+ *
611
+ * async getMessages(tokenName: string, sortDir: string = 'DESC') {
612
+ * validateSortOrderDirection(sortDir, 'sortDir');
613
+ * // Fetch and return messages sorted in the specified direction
614
+ * }
615
+ * ```
616
+ *
617
+ * @since 6.25.0
618
+ */
619
+ export declare function validateSortOrderDirection(value: string, fieldName: string): void;
620
+ /**
621
+ * Validates decimal number within range (handles NaN, Infinity, type checking)
622
+ *
623
+ * Consolidates 5 instances of strict decimal range validation found in:
624
+ * - validation-patterns.ts (utility validation)
625
+ * - GSwapLiquidityMutationService.ts (slippage tolerance)
626
+ * - PoolCalculationService.ts (price impact bounds)
627
+ * - constraints.ts (type definitions)
628
+ * - swapHandler.ts (MCP handler validation)
629
+ *
630
+ * ## Replaces Pattern
631
+ *
632
+ * ### Before (Duplicate across services):
633
+ * ```typescript
634
+ * const num = parseFloat(value);
635
+ * if (isNaN(num) || num < min || num > max) {
636
+ * throw new ValidationError(`${fieldName} must be between ${min} and ${max}`);
637
+ * }
638
+ * ```
639
+ *
640
+ * ### After (Single call):
641
+ * ```typescript
642
+ * validateDecimalRangeStrict(value, min, max, 'slippageTolerance');
643
+ * ```
644
+ *
645
+ * @param value The value to validate (string or number)
646
+ * @param min Minimum allowed value (inclusive)
647
+ * @param max Maximum allowed value (inclusive)
648
+ * @param fieldName Field name for error messages (e.g., 'slippageTolerance', 'priceImpact')
649
+ * @throws {ValidationError} If value is not a valid number within range, or if NaN/Infinity detected
650
+ *
651
+ * @example Slippage tolerance validation
652
+ * ```typescript
653
+ * import { validateDecimalRangeStrict } from '../utils/validation-patterns';
654
+ *
655
+ * function swap(slippage: unknown) {
656
+ * validateDecimalRangeStrict(slippage, 0, 1, 'slippageTolerance');
657
+ * // Validation passed - slippage is a valid decimal between 0 and 1
658
+ * }
659
+ * ```
660
+ *
661
+ * @example Price impact validation
662
+ * ```typescript
663
+ * import { validateDecimalRangeStrict } from '../utils/validation-patterns';
664
+ *
665
+ * function calculateImpact(impactPercent: unknown) {
666
+ * validateDecimalRangeStrict(impactPercent, 0, 100, 'priceImpact');
667
+ * // Validation passed - impact is valid percentage between 0 and 100
668
+ * }
669
+ * ```
670
+ *
671
+ * @since 6.25.0
672
+ */
673
+ export declare function validateDecimalRangeStrict(value: string | number, min: number, max: number, fieldName: string): void;
674
+ /**
675
+ * Validates reverse bonding curve fee portion bounds.
676
+ *
677
+ * Ensures that:
678
+ * - minFee >= 0.1 (minimum fee portion)
679
+ * - maxFee <= 0.5 (maximum fee portion)
680
+ * - minFee <= maxFee (logical ordering)
681
+ *
682
+ * @param minFee - Minimum fee portion (0.1 to 0.5)
683
+ * @param maxFee - Maximum fee portion (0.1 to 0.5)
684
+ * @param fieldName - Field name for error messages
685
+ * @throws {ValidationError} If constraints are violated
686
+ *
687
+ * @example
688
+ * // Valid: min=0.1, max=0.5
689
+ * validateFeePortionConstraints('0.1', '0.5', 'reverseBondingCurve');
690
+ *
691
+ * @example
692
+ * // Invalid: max > 0.5
693
+ * validateFeePortionConstraints(0.1, 0.6, 'feeConfig'); // throws
694
+ *
695
+ * @example
696
+ * // Invalid: min < 0.1
697
+ * validateFeePortionConstraints(0.05, 0.5, 'feeConfig'); // throws
698
+ *
699
+ * @example
700
+ * // Invalid: min > max
701
+ * validateFeePortionConstraints(0.4, 0.2, 'feeConfig'); // throws
702
+ */
703
+ export declare function validateFeePortionConstraints(minFee: string | number, maxFee: string | number, fieldName: string): void;
704
+ /**
705
+ * Validates that min <= max constraint is satisfied.
706
+ *
707
+ * Ensures that a minimum value does not exceed the maximum value.
708
+ * Supports both string and numeric inputs for flexibility.
709
+ *
710
+ * @param min - Minimum value (can be number or string)
711
+ * @param max - Maximum value (can be number or string)
712
+ * @param minLabel - Label for minimum value (e.g., 'minPrice') for error messages
713
+ * @param maxLabel - Label for maximum value (e.g., 'maxPrice') for error messages
714
+ * @throws {ValidationError} If min > max
715
+ *
716
+ * @example
717
+ * // Valid: min < max
718
+ * validateMinMaxRelationship(0.5, 1.0, 'minPrice', 'maxPrice');
719
+ *
720
+ * @example
721
+ * // Valid: min = max
722
+ * validateMinMaxRelationship(100, 100, 'minLiquidity', 'maxLiquidity');
723
+ *
724
+ * @example
725
+ * // Invalid: min > max
726
+ * validateMinMaxRelationship(10, 5, 'startTick', 'endTick'); // throws
727
+ */
728
+ export declare function validateMinMaxRelationship(min: number | string, max: number | string, minLabel: string, maxLabel: string): void;
729
+ /**
730
+ * Validate that a value is included in an allowed set of enum values.
731
+ *
732
+ * @param value - The value to validate (string)
733
+ * @param allowedValues - Array of allowed enum values
734
+ * @param fieldName - The field name for error messages
735
+ * @throws ValidationError if value is not in allowedValues
736
+ *
737
+ * @example
738
+ * validateConstrainedEnumVariant(
739
+ * role,
740
+ * [MODERATOR_ROLE.MODERATOR, MODERATOR_ROLE.TECHNICAL_PRODUCER],
741
+ * 'moderatorRole'
742
+ * );
743
+ */
744
+ export declare function validateConstrainedEnumVariant<T extends Record<string, string> = Record<string, string>>(value: string, allowedValues: T[], fieldName: string): void;
745
+ //# sourceMappingURL=validation-patterns.d.ts.map