@gala-chain/launchpad-sdk 8.1.0 → 9.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. package/CHANGELOG.md +837 -0
  2. package/EXAMPLES.md +95 -681
  3. package/MIGRATING-TO-9.0.md +343 -0
  4. package/README.md +46 -17
  5. package/dist/LaunchpadSDK.d.ts +536 -616
  6. package/dist/LaunchpadSDK.d.ts.map +1 -1
  7. package/dist/api/LaunchpadAPI.d.ts +6 -176
  8. package/dist/api/LaunchpadAPI.d.ts.map +1 -1
  9. package/dist/auth/SessionAuthService.d.ts +32 -2
  10. package/dist/auth/SessionAuthService.d.ts.map +1 -1
  11. package/dist/auth/SignatureAuth.d.ts +2 -2
  12. package/dist/auth/SignatureAuth.d.ts.map +1 -1
  13. package/dist/auth/session.d.ts +59 -0
  14. package/dist/auth/session.d.ts.map +1 -0
  15. package/dist/auth/types.d.ts +7 -2
  16. package/dist/auth/types.d.ts.map +1 -1
  17. package/dist/config/environments.d.ts +7 -2
  18. package/dist/config/environments.d.ts.map +1 -1
  19. package/dist/constants/decimals.d.ts +0 -23
  20. package/dist/constants/decimals.d.ts.map +1 -1
  21. package/dist/constants/endpoints.d.ts +19 -8
  22. package/dist/constants/endpoints.d.ts.map +1 -1
  23. package/dist/constants/enums.d.ts +19 -0
  24. package/dist/constants/enums.d.ts.map +1 -1
  25. package/dist/constants/version.generated.d.ts +1 -1
  26. package/dist/constants/version.generated.d.ts.map +1 -1
  27. package/dist/errors/LaunchpadSDKError.d.ts +18 -0
  28. package/dist/errors/LaunchpadSDKError.d.ts.map +1 -1
  29. package/dist/helpers/sdk.d.ts.map +1 -1
  30. package/dist/index.browser.d.ts +40 -45
  31. package/dist/index.browser.d.ts.map +1 -1
  32. package/dist/index.browser.esm.js +1 -1
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.esm.js +1 -1
  35. package/dist/index.js +1 -1
  36. package/dist/index.node.d.ts +4 -5
  37. package/dist/index.node.d.ts.map +1 -1
  38. package/dist/launchpad/bundle-submission.d.ts +57 -10
  39. package/dist/launchpad/bundle-submission.d.ts.map +1 -1
  40. package/dist/launchpad/create-sale-validation.d.ts +19 -0
  41. package/dist/launchpad/create-sale-validation.d.ts.map +1 -0
  42. package/dist/launchpad/transport.d.ts +33 -2
  43. package/dist/launchpad/transport.d.ts.map +1 -1
  44. package/dist/launchpad/writes.d.ts +37 -11
  45. package/dist/launchpad/writes.d.ts.map +1 -1
  46. package/dist/native.cjs +1 -1
  47. package/dist/native.d.ts +4 -5
  48. package/dist/native.d.ts.map +1 -1
  49. package/dist/native.esm.js +1 -1
  50. package/dist/schemas/launchpad.d.ts +3 -2
  51. package/dist/schemas/launchpad.d.ts.map +1 -1
  52. package/dist/schemas/primitives.d.ts +12 -2
  53. package/dist/schemas/primitives.d.ts.map +1 -1
  54. package/dist/schemas/user.d.ts +3 -18
  55. package/dist/schemas/user.d.ts.map +1 -1
  56. package/dist/schemas/validators.d.ts +3 -3
  57. package/dist/services/AbstractCacheService.d.ts +2 -2
  58. package/dist/services/ApiKeyService.d.ts +1 -1
  59. package/dist/services/BanService.d.ts +1 -1
  60. package/dist/services/ChartService.d.ts.map +1 -1
  61. package/dist/services/ContentReactionService.d.ts +6 -18
  62. package/dist/services/ContentReactionService.d.ts.map +1 -1
  63. package/dist/services/EventsQueryService.d.ts +47 -0
  64. package/dist/services/EventsQueryService.d.ts.map +1 -0
  65. package/dist/services/GalaChainBalanceService.d.ts +17 -89
  66. package/dist/services/GalaChainBalanceService.d.ts.map +1 -1
  67. package/dist/services/GalaChainLockService.d.ts +19 -20
  68. package/dist/services/GalaChainLockService.d.ts.map +1 -1
  69. package/dist/services/GalaChainService.d.ts +28 -15
  70. package/dist/services/GalaChainService.d.ts.map +1 -1
  71. package/dist/services/GalaChainTokenService.d.ts +25 -53
  72. package/dist/services/GalaChainTokenService.d.ts.map +1 -1
  73. package/dist/services/GalaChainTransferService.d.ts +42 -41
  74. package/dist/services/GalaChainTransferService.d.ts.map +1 -1
  75. package/dist/services/HealthService.d.ts +33 -0
  76. package/dist/services/HealthService.d.ts.map +1 -0
  77. package/dist/services/ImageService.d.ts +3 -3
  78. package/dist/services/ImageService.d.ts.map +1 -1
  79. package/dist/services/LaunchpadPriceService.d.ts +66 -0
  80. package/dist/services/LaunchpadPriceService.d.ts.map +1 -0
  81. package/dist/services/LaunchpadService.d.ts +34 -42
  82. package/dist/services/LaunchpadService.d.ts.map +1 -1
  83. package/dist/services/MessagesService.d.ts +12 -44
  84. package/dist/services/MessagesService.d.ts.map +1 -1
  85. package/dist/services/ModeratorService.d.ts +2 -2
  86. package/dist/services/ModeratorService.d.ts.map +1 -1
  87. package/dist/services/NftCollectionService.d.ts +22 -6
  88. package/dist/services/NftCollectionService.d.ts.map +1 -1
  89. package/dist/services/OverseerService.d.ts +3 -3
  90. package/dist/services/OverseerService.d.ts.map +1 -1
  91. package/dist/services/PlatformStatsService.d.ts +1 -2
  92. package/dist/services/PlatformStatsService.d.ts.map +1 -1
  93. package/dist/services/PoolService.d.ts +28 -65
  94. package/dist/services/PoolService.d.ts.map +1 -1
  95. package/dist/services/RestrictedNamesService.d.ts +1 -1
  96. package/dist/services/RestrictedNamesService.d.ts.map +1 -1
  97. package/dist/services/StreamChatService.d.ts +8 -19
  98. package/dist/services/StreamChatService.d.ts.map +1 -1
  99. package/dist/services/StreamTokenServiceBase.d.ts +2 -1
  100. package/dist/services/StreamTokenServiceBase.d.ts.map +1 -1
  101. package/dist/services/StreamWebSocketService.d.ts +423 -451
  102. package/dist/services/StreamWebSocketService.d.ts.map +1 -1
  103. package/dist/services/StreamingService.d.ts +14 -15
  104. package/dist/services/StreamingService.d.ts.map +1 -1
  105. package/dist/services/TokenBanService.d.ts +1 -1
  106. package/dist/services/TokenResolverService.d.ts +5 -5
  107. package/dist/services/TokenResolverService.d.ts.map +1 -1
  108. package/dist/services/TradeService.d.ts +13 -9
  109. package/dist/services/TradeService.d.ts.map +1 -1
  110. package/dist/services/TradingQuotesService.d.ts.map +1 -1
  111. package/dist/services/UserService.d.ts +64 -20
  112. package/dist/services/UserService.d.ts.map +1 -1
  113. package/dist/services/gateway-transport.d.ts +32 -0
  114. package/dist/services/gateway-transport.d.ts.map +1 -0
  115. package/dist/services/gateway-writes.d.ts +83 -0
  116. package/dist/services/gateway-writes.d.ts.map +1 -0
  117. package/dist/services/realtime/event-catalog.d.ts +456 -0
  118. package/dist/services/realtime/event-catalog.d.ts.map +1 -0
  119. package/dist/services/shared/pagination-helpers.d.ts +22 -5
  120. package/dist/services/shared/pagination-helpers.d.ts.map +1 -1
  121. package/dist/services/shared/service-validators.d.ts.map +1 -1
  122. package/dist/signing/index.d.ts +2 -3
  123. package/dist/signing/index.d.ts.map +1 -1
  124. package/dist/signing/signers.d.ts +64 -9
  125. package/dist/signing/signers.d.ts.map +1 -1
  126. package/dist/signing/types.d.ts +7 -10
  127. package/dist/signing/types.d.ts.map +1 -1
  128. package/dist/types/api-key.dto.d.ts +1 -1
  129. package/dist/types/ban.dto.d.ts +21 -16
  130. package/dist/types/ban.dto.d.ts.map +1 -1
  131. package/dist/types/burn.dto.d.ts +4 -2
  132. package/dist/types/burn.dto.d.ts.map +1 -1
  133. package/dist/types/chat-messages.dto.d.ts +10 -72
  134. package/dist/types/chat-messages.dto.d.ts.map +1 -1
  135. package/dist/types/comments.dto.d.ts +8 -78
  136. package/dist/types/comments.dto.d.ts.map +1 -1
  137. package/dist/types/common.d.ts +42 -85
  138. package/dist/types/common.d.ts.map +1 -1
  139. package/dist/types/constraints.d.ts +47 -23
  140. package/dist/types/constraints.d.ts.map +1 -1
  141. package/dist/types/content-flag.dto.d.ts +5 -1
  142. package/dist/types/content-flag.dto.d.ts.map +1 -1
  143. package/dist/types/content-reactions.dto.d.ts +0 -4
  144. package/dist/types/content-reactions.dto.d.ts.map +1 -1
  145. package/dist/types/dto.d.ts +0 -5
  146. package/dist/types/dto.d.ts.map +1 -1
  147. package/dist/types/engagement-stats.dto.d.ts +16 -27
  148. package/dist/types/engagement-stats.dto.d.ts.map +1 -1
  149. package/dist/types/events.dto.d.ts +89 -0
  150. package/dist/types/events.dto.d.ts.map +1 -1
  151. package/dist/types/global-feed.dto.d.ts +23 -164
  152. package/dist/types/global-feed.dto.d.ts.map +1 -1
  153. package/dist/types/health.dto.d.ts +32 -0
  154. package/dist/types/health.dto.d.ts.map +1 -0
  155. package/dist/types/launchpad.dto.d.ts +77 -323
  156. package/dist/types/launchpad.dto.d.ts.map +1 -1
  157. package/dist/types/lock.dto.d.ts +12 -7
  158. package/dist/types/lock.dto.d.ts.map +1 -1
  159. package/dist/types/messages.dto.d.ts +168 -118
  160. package/dist/types/messages.dto.d.ts.map +1 -1
  161. package/dist/types/moderator.dto.d.ts +1 -1
  162. package/dist/types/options.dto.d.ts +8 -36
  163. package/dist/types/options.dto.d.ts.map +1 -1
  164. package/dist/types/overseer.dto.d.ts +2 -1
  165. package/dist/types/overseer.dto.d.ts.map +1 -1
  166. package/dist/types/platform-stats.dto.d.ts +3 -3
  167. package/dist/types/realtime-events.dto.d.ts +340 -0
  168. package/dist/types/realtime-events.dto.d.ts.map +1 -0
  169. package/dist/types/restricted-names.dto.d.ts +2 -2
  170. package/dist/types/restricted-names.dto.d.ts.map +1 -1
  171. package/dist/types/stream-chat.dto.d.ts +15 -14
  172. package/dist/types/stream-chat.dto.d.ts.map +1 -1
  173. package/dist/types/streaming.dto.d.ts +73 -104
  174. package/dist/types/streaming.dto.d.ts.map +1 -1
  175. package/dist/types/token-ban.dto.d.ts.map +1 -1
  176. package/dist/types/token-config.dto.d.ts +34 -19
  177. package/dist/types/token-config.dto.d.ts.map +1 -1
  178. package/dist/types/trades-query.dto.d.ts +8 -24
  179. package/dist/types/trades-query.dto.d.ts.map +1 -1
  180. package/dist/types/user.dto.d.ts +133 -112
  181. package/dist/types/user.dto.d.ts.map +1 -1
  182. package/dist/types/websocket-events.dto.d.ts +5 -5
  183. package/dist/types/websocket-events.dto.d.ts.map +1 -1
  184. package/dist/utils/address-formatter.d.ts +25 -2
  185. package/dist/utils/address-formatter.d.ts.map +1 -1
  186. package/dist/utils/agent-config.d.ts +9 -4
  187. package/dist/utils/agent-config.d.ts.map +1 -1
  188. package/dist/utils/auto-pagination.d.ts +7 -240
  189. package/dist/utils/auto-pagination.d.ts.map +1 -1
  190. package/dist/utils/bignumber-helpers.d.ts +3 -2
  191. package/dist/utils/bignumber-helpers.d.ts.map +1 -1
  192. package/dist/utils/delimiter-parser.d.ts +0 -13
  193. package/dist/utils/delimiter-parser.d.ts.map +1 -1
  194. package/dist/utils/error-factories.d.ts +4 -3
  195. package/dist/utils/error-factories.d.ts.map +1 -1
  196. package/dist/utils/error-patterns.d.ts +0 -47
  197. package/dist/utils/error-patterns.d.ts.map +1 -1
  198. package/dist/utils/error-wrapper.d.ts +5 -5
  199. package/dist/utils/errors.d.ts +53 -318
  200. package/dist/utils/errors.d.ts.map +1 -1
  201. package/dist/utils/http.d.ts +36 -3
  202. package/dist/utils/http.d.ts.map +1 -1
  203. package/dist/utils/message-validators.d.ts.map +1 -1
  204. package/dist/utils/pagination-helpers.d.ts +17 -0
  205. package/dist/utils/pagination-helpers.d.ts.map +1 -1
  206. package/dist/utils/pagination-validation.d.ts +2 -2
  207. package/dist/utils/response-handlers.d.ts.map +1 -1
  208. package/dist/utils/service-validators.d.ts +6 -6
  209. package/dist/utils/service-validators.d.ts.map +1 -1
  210. package/dist/utils/token-format-converter.d.ts +1 -1
  211. package/dist/utils/token-parser.d.ts +6 -127
  212. package/dist/utils/token-parser.d.ts.map +1 -1
  213. package/dist/utils/token-stringification.d.ts +7 -7
  214. package/dist/utils/token-stringification.d.ts.map +1 -1
  215. package/dist/utils/tokenNameNormalizer.d.ts +2 -2
  216. package/dist/utils/tokenNormalizer.d.ts +5 -29
  217. package/dist/utils/tokenNormalizer.d.ts.map +1 -1
  218. package/dist/utils/unique-key-generator.d.ts +7 -134
  219. package/dist/utils/unique-key-generator.d.ts.map +1 -1
  220. package/dist/utils/validation-helpers.d.ts +21 -64
  221. package/dist/utils/validation-helpers.d.ts.map +1 -1
  222. package/dist/utils/validation.d.ts +4 -1
  223. package/dist/utils/validation.d.ts.map +1 -1
  224. package/package.json +47 -87
  225. package/dist/api/dto/BurnTokensDto.d.ts +0 -77
  226. package/dist/api/dto/BurnTokensDto.d.ts.map +0 -1
  227. package/dist/api/dto/LockTokenDto.d.ts +0 -85
  228. package/dist/api/dto/LockTokenDto.d.ts.map +0 -1
  229. package/dist/api/dto/TransferTokenDto.d.ts +0 -64
  230. package/dist/api/dto/TransferTokenDto.d.ts.map +0 -1
  231. package/dist/api/dto/UnlockTokenDto.d.ts +0 -74
  232. package/dist/api/dto/UnlockTokenDto.d.ts.map +0 -1
  233. package/dist/bridge/BridgeService.d.ts +0 -484
  234. package/dist/bridge/BridgeService.d.ts.map +0 -1
  235. package/dist/bridge/GalaConnectClient.d.ts +0 -170
  236. package/dist/bridge/GalaConnectClient.d.ts.map +0 -1
  237. package/dist/bridge/constants/index.d.ts +0 -7
  238. package/dist/bridge/constants/index.d.ts.map +0 -1
  239. package/dist/bridge/constants/tokens.d.ts +0 -212
  240. package/dist/bridge/constants/tokens.d.ts.map +0 -1
  241. package/dist/bridge/index.d.ts +0 -24
  242. package/dist/bridge/index.d.ts.map +0 -1
  243. package/dist/bridge/public-types.d.ts +0 -2
  244. package/dist/bridge/public-types.d.ts.map +0 -1
  245. package/dist/bridge/strategies/BridgeStrategy.d.ts +0 -204
  246. package/dist/bridge/strategies/BridgeStrategy.d.ts.map +0 -1
  247. package/dist/bridge/strategies/EthereumBridgeStrategy.d.ts +0 -178
  248. package/dist/bridge/strategies/EthereumBridgeStrategy.d.ts.map +0 -1
  249. package/dist/bridge/strategies/SolanaBridgeStrategy.d.ts +0 -236
  250. package/dist/bridge/strategies/SolanaBridgeStrategy.d.ts.map +0 -1
  251. package/dist/bridge/types/bridge.dto.d.ts +0 -772
  252. package/dist/bridge/types/bridge.dto.d.ts.map +0 -1
  253. package/dist/bridge/types/bridgeable-token.dto.d.ts +0 -209
  254. package/dist/bridge/types/bridgeable-token.dto.d.ts.map +0 -1
  255. package/dist/bridge/types/eip712.d.ts +0 -66
  256. package/dist/bridge/types/eip712.d.ts.map +0 -1
  257. package/dist/bridge/types/index.d.ts +0 -8
  258. package/dist/bridge/types/index.d.ts.map +0 -1
  259. package/dist/bridge/utils/RateLimiter.d.ts +0 -34
  260. package/dist/bridge/utils/RateLimiter.d.ts.map +0 -1
  261. package/dist/bridge/utils/address-formatter.d.ts +0 -25
  262. package/dist/bridge/utils/address-formatter.d.ts.map +0 -1
  263. package/dist/bridge/utils/addressValidation.d.ts +0 -200
  264. package/dist/bridge/utils/addressValidation.d.ts.map +0 -1
  265. package/dist/bridge/utils/balanceHelpers.d.ts +0 -215
  266. package/dist/bridge/utils/balanceHelpers.d.ts.map +0 -1
  267. package/dist/bridge/utils/bridgeErrors.d.ts +0 -98
  268. package/dist/bridge/utils/bridgeErrors.d.ts.map +0 -1
  269. package/dist/bridge/utils/bridgeOutHelpers.d.ts +0 -68
  270. package/dist/bridge/utils/bridgeOutHelpers.d.ts.map +0 -1
  271. package/dist/bridge/utils/bridgePayload.d.ts +0 -98
  272. package/dist/bridge/utils/bridgePayload.d.ts.map +0 -1
  273. package/dist/bridge/utils/bridgeStatusParser.d.ts +0 -76
  274. package/dist/bridge/utils/bridgeStatusParser.d.ts.map +0 -1
  275. package/dist/bridge/utils/eip712Helpers.d.ts +0 -66
  276. package/dist/bridge/utils/eip712Helpers.d.ts.map +0 -1
  277. package/dist/bridge/utils/index.d.ts +0 -19
  278. package/dist/bridge/utils/index.d.ts.map +0 -1
  279. package/dist/bridge/utils/retry.d.ts +0 -112
  280. package/dist/bridge/utils/retry.d.ts.map +0 -1
  281. package/dist/bridge/utils/strategyDelegation.d.ts +0 -126
  282. package/dist/bridge/utils/strategyDelegation.d.ts.map +0 -1
  283. package/dist/bridge/utils/tokenIdUtils.d.ts +0 -86
  284. package/dist/bridge/utils/tokenIdUtils.d.ts.map +0 -1
  285. package/dist/bridge/utils/tokenMath.d.ts +0 -39
  286. package/dist/bridge/utils/tokenMath.d.ts.map +0 -1
  287. package/dist/bridge/utils/tokenMetadataResolver.d.ts +0 -97
  288. package/dist/bridge/utils/tokenMetadataResolver.d.ts.map +0 -1
  289. package/dist/helpers/wallet.d.ts +0 -151
  290. package/dist/helpers/wallet.d.ts.map +0 -1
  291. package/dist/react/WalletContext.d.ts +0 -60
  292. package/dist/react/WalletContext.d.ts.map +0 -1
  293. package/dist/react/index.d.ts +0 -65
  294. package/dist/react/index.d.ts.map +0 -1
  295. package/dist/react/types.d.ts +0 -76
  296. package/dist/react/types.d.ts.map +0 -1
  297. package/dist/react/useWallet.d.ts +0 -123
  298. package/dist/react/useWallet.d.ts.map +0 -1
  299. package/dist/react/useWalletConnection.d.ts +0 -89
  300. package/dist/react/useWalletConnection.d.ts.map +0 -1
  301. package/dist/react/useWalletDetection.d.ts +0 -81
  302. package/dist/react/useWalletDetection.d.ts.map +0 -1
  303. package/dist/react.cjs +0 -1
  304. package/dist/react.esm.js +0 -1
  305. package/dist/services/AbstractTokenFetchService.d.ts +0 -150
  306. package/dist/services/AbstractTokenFetchService.d.ts.map +0 -1
  307. package/dist/services/BatchedCacheService.d.ts +0 -133
  308. package/dist/services/BatchedCacheService.d.ts.map +0 -1
  309. package/dist/services/BridgeableTokenCache.d.ts +0 -120
  310. package/dist/services/BridgeableTokenCache.d.ts.map +0 -1
  311. package/dist/services/BridgeableTokenService.d.ts +0 -218
  312. package/dist/services/BridgeableTokenService.d.ts.map +0 -1
  313. package/dist/services/DexService.d.ts +0 -440
  314. package/dist/services/DexService.d.ts.map +0 -1
  315. package/dist/services/NetworkKeyedCacheService.d.ts +0 -185
  316. package/dist/services/NetworkKeyedCacheService.d.ts.map +0 -1
  317. package/dist/services/PriceHistoryService.d.ts +0 -209
  318. package/dist/services/PriceHistoryService.d.ts.map +0 -1
  319. package/dist/services/StreamingEventService.d.ts +0 -441
  320. package/dist/services/StreamingEventService.d.ts.map +0 -1
  321. package/dist/services/WrapService.d.ts +0 -171
  322. package/dist/services/WrapService.d.ts.map +0 -1
  323. package/dist/services/WrappableTokenCache.d.ts +0 -100
  324. package/dist/services/WrappableTokenCache.d.ts.map +0 -1
  325. package/dist/services/WrappableTokenService.d.ts +0 -130
  326. package/dist/services/WrappableTokenService.d.ts.map +0 -1
  327. package/dist/setup.d.ts +0 -8
  328. package/dist/setup.d.ts.map +0 -1
  329. package/dist/tokens/transfers.d.ts +0 -95
  330. package/dist/tokens/transfers.d.ts.map +0 -1
  331. package/dist/types/comment.dto.d.ts +0 -176
  332. package/dist/types/comment.dto.d.ts.map +0 -1
  333. package/dist/types/galachain-api.types.d.ts +0 -297
  334. package/dist/types/galachain-api.types.d.ts.map +0 -1
  335. package/dist/types/priceHistory.dto.d.ts +0 -134
  336. package/dist/types/priceHistory.dto.d.ts.map +0 -1
  337. package/dist/types/streaming-events.dto.d.ts +0 -605
  338. package/dist/types/streaming-events.dto.d.ts.map +0 -1
  339. package/dist/types/token.types.d.ts +0 -359
  340. package/dist/types/token.types.d.ts.map +0 -1
  341. package/dist/types/wrappable-token.dto.d.ts +0 -305
  342. package/dist/types/wrappable-token.dto.d.ts.map +0 -1
  343. package/dist/utils/crypto-compat.d.ts +0 -40
  344. package/dist/utils/crypto-compat.d.ts.map +0 -1
  345. package/dist/utils/load-env.d.ts +0 -31
  346. package/dist/utils/load-env.d.ts.map +0 -1
  347. package/dist/utils/token-instance-key.d.ts +0 -57
  348. package/dist/utils/token-instance-key.d.ts.map +0 -1
  349. package/dist/utils/wallet.d.ts +0 -166
  350. package/dist/utils/wallet.d.ts.map +0 -1
  351. package/dist/wallet/ExternalWalletProvider.d.ts +0 -90
  352. package/dist/wallet/ExternalWalletProvider.d.ts.map +0 -1
  353. package/dist/wallet/GalaWalletProvider.d.ts +0 -122
  354. package/dist/wallet/GalaWalletProvider.d.ts.map +0 -1
  355. package/dist/wallet/PrivateKeyProvider.d.ts +0 -90
  356. package/dist/wallet/PrivateKeyProvider.d.ts.map +0 -1
  357. package/dist/wallet/detection.d.ts +0 -107
  358. package/dist/wallet/detection.d.ts.map +0 -1
  359. package/dist/wallet/event-handlers.d.ts +0 -50
  360. package/dist/wallet/event-handlers.d.ts.map +0 -1
  361. package/dist/wallet/index.d.ts +0 -51
  362. package/dist/wallet/index.d.ts.map +0 -1
  363. package/dist/wallet/signing-operation.d.ts +0 -19
  364. package/dist/wallet/signing-operation.d.ts.map +0 -1
  365. package/dist/wallet/typed-data-helpers.d.ts +0 -68
  366. package/dist/wallet/typed-data-helpers.d.ts.map +0 -1
  367. package/dist/wallet/types.d.ts +0 -267
  368. package/dist/wallet/types.d.ts.map +0 -1
  369. package/dist/wallet/utils.d.ts +0 -117
  370. package/dist/wallet/utils.d.ts.map +0 -1
  371. package/dist/wallet.cjs +0 -1
  372. package/dist/wallet.esm.js +0 -1
@@ -7,13 +7,13 @@
7
7
  * - Dollar with $ in collection: "$MUSIC$Unit$none$none" (parses from END)
8
8
  *
9
9
  * CRITICAL SECURITY NOTE:
10
- * Plain strings like "GALA" are REJECTED by default - they are not valid token formats!
11
- * Token formats MUST be explicitly delimited with | or $.
12
- * This prevents dangerous assumptions about token structure.
10
+ * Plain strings like "GALA" are not token formats: a caller detects the delimiter
11
+ * (`isPipeDelimited` / `isDollarDelimited`) and parses with the matching parser.
12
+ * The object guard for a token class key is gala-core-sdk's `isTokenClassKey`.
13
13
  *
14
14
  * @packageDocumentation
15
15
  */
16
- import type { TokenClassKey } from '../types/common';
16
+ import type { GalaChainTokenClassKey } from '@gala-chain/gala-core-sdk';
17
17
  /**
18
18
  * PERFORMANCE CHARACTERISTICS:
19
19
  *
@@ -21,10 +21,6 @@ import type { TokenClassKey } from '../types/common';
21
21
  * - Pipe-delimited tokens: Direct split() call, minimal string operations
22
22
  * - Dollar-delimited tokens: Reverse algorithm, ~2x string operations
23
23
  *
24
- * Slow-path (format detection):
25
- * - Plain strings without delimiters: Requires fallback logic
26
- * - Type validation: Object instanceof checks for already-parsed tokens
27
- *
28
24
  * Recommendation: Pre-detect format when parsing large token batches:
29
25
  * ```typescript
30
26
  * import { isPipeDelimited, isDollarDelimited } from './token-parser';
@@ -36,61 +32,12 @@ import type { TokenClassKey } from '../types/common';
36
32
  * }
37
33
  * ```
38
34
  */
39
- /**
40
- * Parse token from ANY format (pipe/dollar delimited) into TokenClassKey
41
- *
42
- * Accepts:
43
- * - Pipe format: "GALA|Unit|none|none"
44
- * - Dollar format: "GALA$Unit$none$none"
45
- * - Dollar with $ in collection: "$MUSIC$Unit$none$none"
46
- * - TokenClassKey objects: { collection, category, type, additionalKey }
47
- *
48
- * REJECTS:
49
- * - Plain strings like "GALA" (DANGEROUS - no delimiters!)
50
- * - Null/undefined values
51
- * - Invalid formats
52
- *
53
- * ⚠️ SECURITY ENFORCEMENT (v3.33.0+):
54
- * Plain token strings are NO LONGER accepted. All tokens must use explicit delimiters.
55
- * This is a breaking change to enforce secure token format validation.
56
- *
57
- * @param token Token string to parse
58
- * @returns TokenClassKey with { collection, category, type, additionalKey }
59
- * @throws ValidationError if format is invalid or if plain string is provided
60
- *
61
- * @example
62
- * ```typescript
63
- * // Pipe-delimited (RECOMMENDED)
64
- * parseToken("GALA|Unit|none|none")
65
- * // → { collection: "GALA", category: "Unit", type: "none", additionalKey: "none" }
66
- *
67
- * // Dollar-delimited
68
- * parseToken("GALA$Unit$none$none")
69
- * // → { collection: "GALA", category: "Unit", type: "none", additionalKey: "none" }
70
- *
71
- * // Dollar with $ in collection (EDGE CASE)
72
- * parseToken("$MUSIC$Unit$none$none")
73
- * // → { collection: "$MUSIC", category: "Unit", type: "none", additionalKey: "none" }
74
- *
75
- * // TokenClassKey object
76
- * parseToken({ collection: "GALA", category: "Unit", type: "none", additionalKey: "none" })
77
- * // → { collection: "GALA", category: "Unit", type: "none", additionalKey: "none" }
78
- *
79
- * // Plain string - PERMANENTLY REJECTED
80
- * parseToken("GALA") // Throws ValidationError
81
- * ```
82
- *
83
- * @since 3.32.0
84
- * @updated 3.33.0 - Removed allowPlainStrings parameter, enforce strict delimiter-only parsing
85
- */
86
- export declare function parseToken(token: string | TokenClassKey | undefined | null): TokenClassKey;
87
35
  /**
88
36
  * Parse pipe-delimited token: "GALA|Unit|none|none"
89
37
  *
90
- * @internal Used by parseToken()
91
38
  * @throws ValidationError if format is invalid
92
39
  */
93
- export declare function parsePipeDelimitedToken(token: string): TokenClassKey;
40
+ export declare function parsePipeDelimitedToken(token: string): GalaChainTokenClassKey;
94
41
  /**
95
42
  * REVERSE-PARSING ALGORITHM FOR DOLLAR-DELIMITED TOKENS
96
43
  *
@@ -140,10 +87,9 @@ export declare function parsePipeDelimitedToken(token: string): TokenClassKey;
140
87
  * - Last 3 parts (from right): category, type, additionalKey
141
88
  * - Everything else: collection
142
89
  *
143
- * @internal Used by parseToken()
144
90
  * @throws ValidationError if format is invalid
145
91
  */
146
- export declare function parseDollarDelimitedToken(token: string): TokenClassKey;
92
+ export declare function parseDollarDelimitedToken(token: string): GalaChainTokenClassKey;
147
93
  /**
148
94
  * Check if token string is in pipe-delimited format
149
95
  *
@@ -165,71 +111,4 @@ export declare function isPipeDelimited(token: string): boolean;
165
111
  * ```
166
112
  */
167
113
  export declare function isDollarDelimited(token: string): boolean;
168
- /**
169
- * Check if token is in ANY valid delimited format (pipe or dollar)
170
- *
171
- * @example
172
- * ```typescript
173
- * isDelimited("GALA|Unit|none|none") // → true
174
- * isDelimited("GALA$Unit$none$none") // → true
175
- * isDelimited("GALA") // → false
176
- * ```
177
- */
178
- export declare function isDelimited(token: string): boolean;
179
- /**
180
- * Check if a value is a valid token format (string OR TokenClassKey object)
181
- *
182
- * @param token Token to validate
183
- * @returns true if token is valid format (pipe/dollar delimited OR TokenClassKey object)
184
- *
185
- * @example
186
- * ```typescript
187
- * isValidTokenFormat("GALA|Unit|none|none") // → true
188
- * isValidTokenFormat("GALA$Unit$none$none") // → true
189
- * isValidTokenFormat({ collection: "GALA", ... }) // → true
190
- * isValidTokenFormat("GALA") // → false (plain string, not delimited)
191
- * ```
192
- */
193
- export declare function isValidTokenFormat(token: unknown): boolean;
194
- /**
195
- * Check if token is a plain symbol string (NOT a delimited format)
196
- *
197
- * Plain token symbols are simple strings like "GALA", "USDC", etc.
198
- * These are REJECTED by default by parseToken() for security reasons.
199
- * Use parseToken(symbol, true) to parse plain symbols.
200
- *
201
- * @param token Token to check
202
- * @returns true if token is plain symbol (no delimiters)
203
- *
204
- * @example
205
- * ```typescript
206
- * isPlainTokenSymbol("GALA") // → true
207
- * isPlainTokenSymbol("GALA|Unit|none|none") // → false
208
- * isPlainTokenSymbol("GALA$Unit$none$none") // → false
209
- * ```
210
- *
211
- * @security WARNING: Plain tokens are inherently ambiguous!
212
- * Always use delimited formats when possible.
213
- */
214
- export declare function isPlainTokenSymbol(token: unknown): boolean;
215
- /**
216
- * Type guard: Check if value is a TokenClassKey object
217
- *
218
- * @param token Value to check
219
- * @returns true if token is a valid TokenClassKey object with all required properties
220
- *
221
- * @example
222
- * ```typescript
223
- * const value: string | TokenClassKey = getToken();
224
- *
225
- * if (isTokenClassKey(value)) {
226
- * // TypeScript now knows value is TokenClassKey
227
- * console.log(value.collection, value.category, value.type, value.additionalKey);
228
- * } else {
229
- * // value is string
230
- * console.log(parseToken(value));
231
- * }
232
- * ```
233
- */
234
- export declare function isTokenClassKey(token: unknown): token is TokenClassKey;
235
114
  //# sourceMappingURL=token-parser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-parser.d.ts","sourceRoot":"","sources":["../../src/utils/token-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AASrD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,GAAG,IAAI,GAC/C,aAAa,CAyCf;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAGpE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAGtE;AAGD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAe1D;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE1D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAqBtE"}
1
+ {"version":3,"file":"token-parser.d.ts","sourceRoot":"","sources":["../../src/utils/token-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAOxE;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB,CAG7E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB,CAG/E;AAGD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAExD"}
@@ -4,7 +4,7 @@
4
4
  * @category Utilities
5
5
  * @since 6.6.0
6
6
  */
7
- import type { TokenClassKey, TokenInstanceKey } from '../types/common';
7
+ import type { GalaChainTokenClassKey, GalaChainTokenInstanceKey } from '@gala-chain/gala-core-sdk';
8
8
  /**
9
9
  * Convert a TokenClassKey to pipe-delimited string format
10
10
  *
@@ -37,7 +37,7 @@ import type { TokenClassKey, TokenInstanceKey } from '../types/common';
37
37
  *
38
38
  * @since 6.6.0
39
39
  */
40
- export declare function stringifyTokenClassKey(token: TokenClassKey): string;
40
+ export declare function stringifyTokenClassKey(token: GalaChainTokenClassKey): string;
41
41
  /**
42
42
  * Convert a TokenInstanceKey to pipe-delimited string format (with instance)
43
43
  *
@@ -63,7 +63,7 @@ export declare function stringifyTokenClassKey(token: TokenClassKey): string;
63
63
  *
64
64
  * @since 6.6.0
65
65
  */
66
- export declare function stringifyTokenInstanceKey(token: TokenInstanceKey): string;
66
+ export declare function stringifyTokenInstanceKey(token: GalaChainTokenInstanceKey): string;
67
67
  /**
68
68
  * Convert either TokenClassKey or TokenInstanceKey to string
69
69
  *
@@ -88,7 +88,7 @@ export declare function stringifyTokenInstanceKey(token: TokenInstanceKey): stri
88
88
  *
89
89
  * @since 6.6.0
90
90
  */
91
- export declare function stringifyToken(token: TokenClassKey | TokenInstanceKey): string;
91
+ export declare function stringifyToken(token: GalaChainTokenClassKey | GalaChainTokenInstanceKey): string;
92
92
  /**
93
93
  * Convert TokenClassKey to dollar-delimited string format
94
94
  *
@@ -113,7 +113,7 @@ export declare function stringifyToken(token: TokenClassKey | TokenInstanceKey):
113
113
  *
114
114
  * @since 6.7.0
115
115
  */
116
- export declare function stringifyTokenClassKeyDollar(token: TokenClassKey): string;
116
+ export declare function stringifyTokenClassKeyDollar(token: GalaChainTokenClassKey): string;
117
117
  /**
118
118
  * Convert TokenInstanceKey to dollar-delimited string format (with instance)
119
119
  *
@@ -139,7 +139,7 @@ export declare function stringifyTokenClassKeyDollar(token: TokenClassKey): stri
139
139
  *
140
140
  * @since 6.7.0
141
141
  */
142
- export declare function stringifyTokenInstanceKeyDollar(token: TokenInstanceKey): string;
142
+ export declare function stringifyTokenInstanceKeyDollar(token: GalaChainTokenInstanceKey): string;
143
143
  /**
144
144
  * Convert TokenClassKey to dollar-delimited string format with prefix
145
145
  *
@@ -163,5 +163,5 @@ export declare function stringifyTokenInstanceKeyDollar(token: TokenInstanceKey)
163
163
  *
164
164
  * @since 6.7.0
165
165
  */
166
- export declare function stringifyTokenClassKeyDollarPrefixed(token: TokenClassKey): string;
166
+ export declare function stringifyTokenClassKeyDollarPrefixed(token: GalaChainTokenClassKey): string;
167
167
  //# sourceMappingURL=token-stringification.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-stringification.d.ts","sourceRoot":"","sources":["../../src/utils/token-stringification.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAEnE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAEzE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,GAAG,MAAM,CAK9E;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAEzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAE/E;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAEjF"}
1
+ {"version":3,"file":"token-stringification.d.ts","sourceRoot":"","sources":["../../src/utils/token-stringification.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEnG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAE5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,yBAAyB,GAAG,MAAM,CAElF;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,sBAAsB,GAAG,yBAAyB,GAAG,MAAM,CAKhG;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAElF;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,yBAAyB,GAAG,MAAM,CAExF;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAE1F"}
@@ -35,8 +35,8 @@ export declare function normalizeTokenName(tokenName: string): string;
35
35
  /**
36
36
  * Normalizes a token identifier for consistent cache keys.
37
37
  *
38
- * Used by cache services (BridgeableTokenCache, WrappableTokenCache) for
39
- * case-insensitive lookups of token symbols and tokenIds.
38
+ * Used by the cache services (AbstractCacheService) for case-insensitive lookups of token
39
+ * symbols and tokenIds.
40
40
  *
41
41
  * Current normalizations:
42
42
  * - `.trim()` - Remove leading/trailing whitespace
@@ -4,8 +4,8 @@
4
4
  * This module provides utilities for normalizing different token identifier formats
5
5
  * into a consistent TokenInstanceKey format that can be used with GalaChain APIs.
6
6
  */
7
- import type { TokenClassKey, TokenId, TokenInstanceKey } from '../types/common';
8
- import { isTokenClassKey as isTokenClassKeyStrict } from './token-parser';
7
+ import { type GalaChainTokenClassKey, type GalaChainTokenInstanceKey } from '@gala-chain/gala-core-sdk';
8
+ import type { TokenId } from '../types/common';
9
9
  /**
10
10
  * Normalizes any token identifier format to TokenInstanceKey
11
11
  *
@@ -39,31 +39,7 @@ import { isTokenClassKey as isTokenClassKeyStrict } from './token-parser';
39
39
  * // → Same object returned
40
40
  * ```
41
41
  */
42
- export declare function normalizeToTokenInstanceKey(tokenId: TokenId): TokenInstanceKey;
43
- /**
44
- * Type guard to check if a TokenId is a TokenInstanceKey object
45
- *
46
- * @param tokenId Token identifier to check
47
- * @returns True if tokenId is a TokenInstanceKey object
48
- */
49
- export declare function isTokenInstanceKey(tokenId: TokenId): tokenId is TokenInstanceKey;
50
- /**
51
- * Strict type guard that validates all TokenClassKey fields are non-empty strings.
52
- *
53
- * Re-export of `isTokenClassKey` from `./token-parser` for convenience.
54
- * This is the recommended function for validating TokenClassKey objects.
55
- *
56
- * @see isTokenClassKey from './token-parser' for the canonical implementation
57
- * @since 6.6.1
58
- */
59
- export { isTokenClassKeyStrict };
60
- /**
61
- * Type guard to check if a TokenId is a string
62
- *
63
- * @param tokenId Token identifier to check
64
- * @returns True if tokenId is a string
65
- */
66
- export declare function isTokenIdString(tokenId: TokenId): tokenId is string;
42
+ export declare function normalizeToTokenInstanceKey(tokenId: TokenId): GalaChainTokenInstanceKey;
67
43
  /**
68
44
  * Validates that a TokenId has all required fields
69
45
  *
@@ -94,7 +70,7 @@ export declare function validateTokenId(tokenId: TokenId): void;
94
70
  *
95
71
  * @since 3.32.0
96
72
  */
97
- export declare function parseVaultAddressToTokenClassKey(vaultAddress: string): TokenClassKey;
73
+ export declare function parseVaultAddressToTokenClassKey(vaultAddress: string): GalaChainTokenClassKey;
98
74
  /**
99
75
  * Parses a vault address into a TokenInstanceKey
100
76
  *
@@ -115,7 +91,7 @@ export declare function parseVaultAddressToTokenClassKey(vaultAddress: string):
115
91
  *
116
92
  * @since 3.32.0
117
93
  */
118
- export declare function parseVaultAddressToTokenInstance(vaultAddress: string): TokenInstanceKey;
94
+ export declare function parseVaultAddressToTokenInstance(vaultAddress: string): GalaChainTokenInstanceKey;
119
95
  /**
120
96
  * Extracts the launchpad token symbol (carried in `type` of the shared `Token` collection) from a
121
97
  * launchpad vault address. Throws for any other collection: a symbol cannot be derived from a class key.
@@ -1 +1 @@
1
- {"version":3,"file":"tokenNormalizer.d.ts","sourceRoot":"","sources":["../../src/utils/tokenNormalizer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIhF,OAAO,EAEL,eAAe,IAAI,qBAAqB,EAEzC,MAAM,gBAAgB,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAsE9E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,gBAAgB,CAOhF;AAED;;;;;;;;GAQG;AACH,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,MAAM,CAEnE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CActD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gCAAgC,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAGpF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gCAAgC,CAAC,YAAY,EAAE,MAAM,GAAG,gBAAgB,CAMvF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAYxE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAMjE"}
1
+ {"version":3,"file":"tokenNormalizer.d.ts","sourceRoot":"","sources":["../../src/utils/tokenNormalizer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAO/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,yBAAyB,CAsEvF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CActD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gCAAgC,CAAC,YAAY,EAAE,MAAM,GAAG,sBAAsB,CAG7F;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gCAAgC,CAAC,YAAY,EAAE,MAAM,GAAG,yBAAyB,CAMhG;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAYxE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAMjE"}
@@ -1,147 +1,20 @@
1
1
  /**
2
- * GalaChain Unique Operation Key Generator
2
+ * The uniqueKey of a launchpad bundle trade (BundleService buy/sell).
3
3
  *
4
- * Generates unique identifiers for GalaChain bundle transactions and operations
5
- * that require idempotency keys. Consolidated from 14+ duplicated patterns across
6
- * transfer and lock/unlock operations.
4
+ * A generic GalaChain uniqueKey is gala-core-sdk's `createUniqueKey(prefix)` (CSPRNG,
5
+ * `<prefix><uuid v4>`); launchpad-sdk 9.0 removed its own `generateUniqueKey`, which duplicated it.
7
6
  *
8
7
  * @category Utilities
9
8
  * @since 6.14.0
10
9
  */
11
10
  /**
12
- * Generate a unique operation key for GalaChain bundle transactions.
13
- *
14
- * Creates a deterministic yet unique identifier combining:
15
- * - Timestamp (millisecond precision)
16
- * - Cryptographically random suffix (derived from a UUID v4, ~104 bits of entropy)
17
- *
18
- * Format: `galaconnect-operation-{timestamp}_{randomSuffix}`
19
- *
20
- * Used for idempotency across:
21
- * - Token transfers (uniqueKey parameter)
22
- * - Token locks/unlocks (uniqueKey parameter)
23
- * - Token burns (uniqueKey parameter)
24
- * - Any operation requiring request deduplication
25
- *
26
- * @returns Unique operation key in format `galaconnect-operation-{timestamp}_{randomSuffix}`
27
- *
28
- * @example Basic usage
29
- * ```typescript
30
- * import { generateUniqueKey } from '@gala-chain/launchpad-sdk';
31
- *
32
- * const key = generateUniqueKey();
33
- * console.log(key); // 'galaconnect-operation-1735857234567_abc123'
34
- *
35
- * // Use in transfer operation
36
- * await sdk.transferGala({
37
- * recipientAddress: 'eth|0x...',
38
- * amount: '100',
39
- * uniqueKey: generateUniqueKey()
40
- * });
41
- * ```
42
- *
43
- * @example With explicit key
44
- * ```typescript
45
- * // For operations where you control the idempotency key
46
- * const operationKey = `my-operation-${Date.now()}`;
47
- * await sdk.transferToken({
48
- * to: 'eth|0x...',
49
- * tokenName: 'anime',
50
- * amount: '1000',
51
- * uniqueKey: operationKey
52
- * });
53
- * ```
54
- *
55
- * @see {@link https://docs.galachain.com/idempotency GalaChain Idempotency}
56
- */
57
- export declare function generateUniqueKey(): string;
58
- /**
59
- * Generate a unique operation key for GalaSwap bundle (buy/sell) transactions.
60
- *
61
- * Same shape and entropy guarantees as {@link generateUniqueKey}, but uses the
62
- * `galaswap-operation-` prefix GalaSwap trade operations are identified by
63
- * (`UNIQUE_KEY_CONSTRAINT.PATTERN` accepts either prefix).
11
+ * Generate a unique operation key for GalaSwap bundle (buy/sell) transactions:
12
+ * `galaswap-operation-{timestamp}_{randomSuffix}`, the suffix 26 hex digits of a UUID v4
13
+ * (~104 bits; never `Math.random()`: a collision would let GalaChain treat two different trades as
14
+ * retries of one), within `UNIQUE_KEY_CONSTRAINT.MAX_LENGTH` (64) and its `PATTERN`.
64
15
  *
65
16
  * @returns Unique operation key in format `galaswap-operation-{timestamp}_{randomSuffix}`
66
17
  * @since 6.14.0
67
18
  */
68
19
  export declare function generateSwapOperationKey(): string;
69
- /**
70
- * Generate unique operation key with UUID, timestamp, and wallet address
71
- *
72
- * Creates a unique identifier for GalaSwap operations combining:
73
- * - Prefix (customizable, defaults to 'galaswap-operation')
74
- * - UUID v4 for global uniqueness
75
- * - Timestamp (millisecond precision)
76
- * - Wallet address for context
77
- *
78
- * Format: `{prefix}-${uuid}-${timestamp}-${walletAddress}`
79
- *
80
- * Used for idempotent GalaSwap operations including:
81
- * - Liquidity additions (add/remove)
82
- * - Swap executions
83
- * - Fee collections
84
- * - Bundle transactions
85
- *
86
- * @param walletAddress The wallet address associated with the operation (required)
87
- * @param prefix Optional custom prefix (defaults to 'galaswap-operation')
88
- * @returns Unique operation key combining UUID, timestamp, and wallet address
89
- *
90
- * @example Basic usage with default prefix
91
- * ```typescript
92
- * import { generateOperationKey } from '@gala-chain/launchpad-sdk';
93
- *
94
- * const operationKey = generateOperationKey('eth|0x1234567890abcdef...');
95
- * console.log(operationKey);
96
- * // 'galaswap-operation-550e8400-e29b-41d4-a716-446655440000-1735857234567-eth|0x1234...'
97
- * ```
98
- *
99
- * @example With custom prefix
100
- * ```typescript
101
- * import { generateOperationKey } from '@gala-chain/launchpad-sdk';
102
- *
103
- * const operationKey = generateOperationKey(
104
- * 'eth|0x1234567890abcdef...',
105
- * 'custom-swap'
106
- * );
107
- * console.log(operationKey);
108
- * // 'custom-swap-550e8400-e29b-41d4-a716-446655440000-1735857234567-eth|0x1234...'
109
- * ```
110
- *
111
- * @example With an operation that accepts a caller-supplied uniqueKey
112
- * ```typescript
113
- * import { generateOperationKey } from '@gala-chain/launchpad-sdk';
114
- *
115
- * // transferGala/transferToken/lockToken/unlockToken accept an optional
116
- * // uniqueKey for idempotency (sdk.dex.* writes generate their own internally).
117
- * const result = await sdk.transferGala({
118
- * recipientAddress,
119
- * amount: '100',
120
- * uniqueKey: generateOperationKey(walletAddress),
121
- * });
122
- * ```
123
- *
124
- * @example Handling operation idempotency
125
- * ```typescript
126
- * // sdk.dex.swaps.swap() generates its own durable uniqueKey and returns it on the
127
- * // SubmittedTransaction, so recovering an in-flight swap replays confirmation instead
128
- * // of resubmitting with a caller-supplied key:
129
- * let submitted;
130
- * try {
131
- * submitted = await sdk.dex.swaps.swap('GALA', 'GUSDC', 3000, {
132
- * exactIn: '100',
133
- * amountOutMinimum: '95',
134
- * });
135
- * await submitted.confirm();
136
- * } catch (error) {
137
- * if (submitted) {
138
- * // Recover by uniqueKey - does not resubmit, avoids duplicate execution
139
- * await sdk.dex.swaps.confirmSwap(submitted.uniqueKey);
140
- * }
141
- * }
142
- * ```
143
- *
144
- * @since 3.50.0
145
- */
146
- export declare function generateOperationKey(walletAddress: string, prefix?: string): string;
147
20
  //# sourceMappingURL=unique-key-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unique-key-generator.d.ts","sourceRoot":"","sources":["../../src/utils/unique-key-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoBH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAM1C;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,MAAM,EACrB,MAAM,GAAE,MAA6B,GACpC,MAAM,CAIR"}
1
+ {"version":3,"file":"unique-key-generator.d.ts","sourceRoot":"","sources":["../../src/utils/unique-key-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAIjD"}
@@ -7,7 +7,7 @@
7
7
  * @category Utilities
8
8
  * @since 3.6.2
9
9
  */
10
- import { type TokenNameConstraint } from '../types/constraints';
10
+ import type { TokenNameConstraint } from '../types/constraints';
11
11
  import { isEmptyValue as isEmptyValuePrimitive, isNonEmptyString as isNonEmptyStringPrimitive, isNullish as isNullishPrimitive } from './primitives';
12
12
  /**
13
13
  * Pagination bounds structure (required fields)
@@ -275,10 +275,8 @@ export interface MutualExclusivityResult {
275
275
  /**
276
276
  * Validates that exactly one of two parameters is provided (mutual exclusivity)
277
277
  *
278
- * Consolidates 12+ instances of identical validation logic found across services:
279
- * - PriceHistoryService: tokenName XOR tokenId (lines 451-470)
280
- * - DexService: Similar patterns with token identification
281
- * - Other services: Scattered mutual exclusivity validation
278
+ * Consolidates the mutual-exclusivity checks the services used to repeat (e.g. tokenName XOR
279
+ * tokenId for a token identification).
282
280
  *
283
281
  * ## Use Cases
284
282
  *
@@ -322,7 +320,7 @@ export interface MutualExclusivityResult {
322
320
  *
323
321
  * @example Token identifier validation
324
322
  * ```typescript
325
- * // PriceHistoryService.fetchAllPriceHistory() - replaces 20-line validation method
323
+ * // a method that takes a token by name or by id, never both
326
324
  * const { hasA } = validateMutualExclusive(options, 'tokenName', 'tokenId', {
327
325
  * description: 'token identifier'
328
326
  * });
@@ -338,89 +336,48 @@ export declare function validateMutualExclusive(obj: Record<string, unknown>, fi
338
336
  }): MutualExclusivityResult;
339
337
  export type { TokenNameConstraint };
340
338
  /**
341
- * Validates a launchpad token name using configurable constraints
339
+ * Validates a launchpad token name against the rule of the route it is sent to
342
340
  *
343
- * Consolidates duplicate token name validation logic found across multiple DTO files:
344
- * - streaming.dto.ts (validateStreamingTokenName)
345
- * - content-flag.dto.ts (validateFlagTokenName)
346
- * - comment.dto.ts (inline validation)
347
- * - ban.dto.ts (inline validation)
348
- * - moderator.dto.ts (inline validation)
341
+ * There is no default constraint: the rule is the backend route's (`TOKEN_NAME_DTO_CONSTRAINT`,
342
+ * `TOKEN_NAME_PATH_CONSTRAINT`, ... in `types/constraints`), so the caller names it.
349
343
  *
350
- * ## Usage
351
- *
352
- * ### With default constraints (3-20 alphanumeric)
353
- * ```typescript
354
- * validateLaunchpadTokenName(tokenName); // Uses LAUNCHPAD_TOKEN_NAME_CONSTRAINT
355
- * ```
356
- *
357
- * ### With custom constraints from DTO
358
344
  * ```typescript
359
- * import { STREAMING_CONSTRAINTS } from '../types/streaming.dto';
360
- * validateLaunchpadTokenName(tokenName, 'tokenName', STREAMING_CONSTRAINTS.TOKEN_NAME);
361
- * ```
362
- *
363
- * ### With custom field name for error messages
364
- * ```typescript
365
- * validateLaunchpadTokenName(options.tokenName, 'tokenName', BAN_CONSTRAINTS.TOKEN_NAME);
345
+ * validateLaunchpadTokenName(options.tokenName, 'tokenName', TOKEN_NAME_DTO_CONSTRAINT);
366
346
  * ```
367
347
  *
368
348
  * @param tokenName - Token name to validate
369
- * @param field - Field name for error messages (defaults to 'tokenName')
370
- * @param constraint - Token name constraint configuration (defaults to LAUNCHPAD_TOKEN_NAME_CONSTRAINT)
349
+ * @param field - Field name for error messages
350
+ * @param constraint - The route's token name constraint
371
351
  * @throws {ValidationError} If token name is invalid (empty, too short, too long, or invalid format)
372
352
  *
373
353
  * @since 6.4.0
374
354
  */
375
- export declare function validateLaunchpadTokenName(tokenName: string, field?: string, constraint?: TokenNameConstraint): void;
355
+ export declare function validateLaunchpadTokenName(tokenName: string, field: string, constraint: TokenNameConstraint): void;
376
356
  /**
377
357
  * Validates an optional token name (allows undefined/null, but validates if present)
378
358
  *
379
359
  * Use this for optional token name fields that should be validated when provided.
380
- * Consolidates duplicate logic from tokenNameValidator.ts.
381
360
  *
382
361
  * @param tokenName - The token name to validate (may be undefined/null)
383
- * @param field - The field name for error messages (default: 'tokenName')
384
- * @param constraint - Token name constraint (default: LAUNCHPAD_TOKEN_NAME_CONSTRAINT)
362
+ * @param field - The field name for error messages
363
+ * @param constraint - The route's token name constraint
385
364
  * @throws {ValidationError} If token name is provided but invalid
386
365
  *
387
- * @example
388
- * ```typescript
389
- * // No error - undefined is allowed
390
- * validateOptionalTokenName(undefined);
391
- *
392
- * // Throws ValidationError - provided but invalid
393
- * validateOptionalTokenName('ab');
394
- *
395
- * // Success - valid token name
396
- * validateOptionalTokenName('myToken123');
397
- * ```
398
- *
399
366
  * @since 6.12.0
400
367
  */
401
- export declare function validateOptionalTokenName(tokenName: unknown, field?: string, constraint?: TokenNameConstraint): void;
368
+ export declare function validateOptionalTokenName(tokenName: unknown, field: string, constraint: TokenNameConstraint): void;
402
369
  /**
403
370
  * Checks if a token name is valid without throwing
404
371
  *
405
372
  * Use this for conditional checks where you don't want exceptions.
406
- * Consolidates duplicate logic from tokenNameValidator.ts.
407
373
  *
408
374
  * @param tokenName - The token name to check
409
- * @param constraint - Token name constraint (default: LAUNCHPAD_TOKEN_NAME_CONSTRAINT)
375
+ * @param constraint - The route's token name constraint
410
376
  * @returns true if valid, false otherwise
411
377
  *
412
- * @example
413
- * ```typescript
414
- * if (isValidTokenName(userInput)) {
415
- * // Proceed with token lookup
416
- * } else {
417
- * // Show validation error to user
418
- * }
419
- * ```
420
- *
421
378
  * @since 6.12.0
422
379
  */
423
- export declare function isValidTokenName(tokenName: unknown, constraint?: TokenNameConstraint): tokenName is string;
380
+ export declare function isValidTokenName(tokenName: unknown, constraint: TokenNameConstraint): tokenName is string;
424
381
  /**
425
382
  * Validates a token name with constraint-specific error messages
426
383
  *
@@ -428,19 +385,19 @@ export declare function isValidTokenName(tokenName: unknown, constraint?: TokenN
428
385
  * This is the recommended function for service methods.
429
386
  *
430
387
  * @param tokenName - Token name to validate
431
- * @param field - Field name for error messages (default: 'tokenName')
432
- * @param constraint - Token name constraint with MIN_LENGTH, MAX_LENGTH, PATTERN
388
+ * @param field - Field name for error messages
389
+ * @param constraint - The route's token name constraint
433
390
  * @throws {ValidationError} If token name is invalid
434
391
  *
435
392
  * @example
436
393
  * ```typescript
437
- * // Throws: "tokenName must be 3-20 alphanumeric characters"
438
- * validateTokenName('ab', 'tokenName', LAUNCHPAD_TOKEN_NAME_CONSTRAINT);
394
+ * // Throws: "tokenName must be 1-20 letters and digits"
395
+ * validateTokenName('my-token', 'tokenName', TOKEN_NAME_DTO_CONSTRAINT);
439
396
  * ```
440
397
  *
441
398
  * @since 6.12.0
442
399
  */
443
- export declare function validateTokenName(tokenName: unknown, field?: string, constraint?: TokenNameConstraint): void;
400
+ export declare function validateTokenName(tokenName: unknown, field: string, constraint: TokenNameConstraint): void;
444
401
  /**
445
402
  * Field validator configuration for structural type guards
446
403
  *