@gala-chain/launchpad-sdk 5.0.2-beta.1 → 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.
- package/EXAMPLES.md +141 -7
- package/README.md +68 -36
- package/dist/ai-docs.json +7357 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +70 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/src/LaunchpadSDK.d.ts +3288 -214
- package/dist/src/LaunchpadSDK.d.ts.map +1 -1
- package/dist/src/api/LaunchpadAPI.d.ts +21 -41
- package/dist/src/api/LaunchpadAPI.d.ts.map +1 -1
- package/dist/src/api/dto/BurnTokensDto.d.ts.map +1 -1
- package/dist/src/api/dto/LockTokenDto.d.ts.map +1 -1
- package/dist/src/api/dto/TransferTokenDto.d.ts.map +1 -1
- package/dist/src/api/dto/UnlockTokenDto.d.ts.map +1 -1
- package/dist/src/auth/JwtAuth.d.ts +145 -0
- package/dist/src/auth/JwtAuth.d.ts.map +1 -0
- package/dist/src/auth/SessionAuthService.d.ts +146 -0
- package/dist/src/auth/SessionAuthService.d.ts.map +1 -0
- package/dist/src/auth/SignatureAuth.d.ts.map +1 -1
- package/dist/src/bridge/BridgeService.d.ts.map +1 -1
- package/dist/src/bridge/GalaConnectClient.d.ts.map +1 -1
- package/dist/src/bridge/constants/tokens.d.ts +4 -3
- package/dist/src/bridge/constants/tokens.d.ts.map +1 -1
- package/dist/src/bridge/index.d.ts +1 -0
- package/dist/src/bridge/index.d.ts.map +1 -1
- package/dist/src/bridge/strategies/BridgeStrategy.d.ts.map +1 -1
- package/dist/src/bridge/strategies/EthereumBridgeStrategy.d.ts +1 -38
- package/dist/src/bridge/strategies/EthereumBridgeStrategy.d.ts.map +1 -1
- package/dist/src/bridge/strategies/SolanaBridgeStrategy.d.ts +1 -21
- package/dist/src/bridge/strategies/SolanaBridgeStrategy.d.ts.map +1 -1
- package/dist/src/bridge/types/bridge.dto.d.ts +15 -2
- package/dist/src/bridge/types/bridge.dto.d.ts.map +1 -1
- package/dist/src/bridge/utils/RateLimiter.d.ts +1 -1
- package/dist/src/bridge/utils/RateLimiter.d.ts.map +1 -1
- package/dist/src/bridge/utils/address-formatter.d.ts +25 -0
- package/dist/src/bridge/utils/address-formatter.d.ts.map +1 -0
- package/dist/src/bridge/utils/addressValidation.d.ts +200 -0
- package/dist/src/bridge/utils/addressValidation.d.ts.map +1 -0
- package/dist/src/bridge/utils/balanceHelpers.d.ts +215 -0
- package/dist/src/bridge/utils/balanceHelpers.d.ts.map +1 -0
- package/dist/src/bridge/utils/bridgeErrors.d.ts +98 -0
- package/dist/src/bridge/utils/bridgeErrors.d.ts.map +1 -0
- package/dist/src/bridge/utils/bridgeOutHelpers.d.ts +68 -0
- package/dist/src/bridge/utils/bridgeOutHelpers.d.ts.map +1 -0
- package/dist/src/bridge/utils/bridgePayload.d.ts +107 -0
- package/dist/src/bridge/utils/bridgePayload.d.ts.map +1 -0
- package/dist/src/bridge/utils/bridgeStatusParser.d.ts +75 -0
- package/dist/src/bridge/utils/bridgeStatusParser.d.ts.map +1 -0
- package/dist/src/bridge/utils/eip712Helpers.d.ts +66 -0
- package/dist/src/bridge/utils/eip712Helpers.d.ts.map +1 -0
- package/dist/src/bridge/utils/index.d.ts +9 -0
- package/dist/src/bridge/utils/index.d.ts.map +1 -1
- package/dist/src/bridge/utils/retry.d.ts +16 -0
- package/dist/src/bridge/utils/retry.d.ts.map +1 -1
- package/dist/src/bridge/utils/strategyDelegation.d.ts +69 -0
- package/dist/src/bridge/utils/strategyDelegation.d.ts.map +1 -0
- package/dist/src/bridge/utils/tokenIdUtils.d.ts +7 -0
- package/dist/src/bridge/utils/tokenIdUtils.d.ts.map +1 -1
- package/dist/src/bridge/utils/tokenMath.d.ts.map +1 -1
- package/dist/src/bridge/utils/tokenMetadataResolver.d.ts +97 -0
- package/dist/src/bridge/utils/tokenMetadataResolver.d.ts.map +1 -0
- package/dist/src/constants/endpoints.d.ts +453 -0
- package/dist/src/constants/endpoints.d.ts.map +1 -1
- package/dist/src/constants/error-messages.d.ts +1 -1
- package/dist/src/constants/error-messages.d.ts.map +1 -1
- package/dist/src/constants/jwt.d.ts +41 -0
- package/dist/src/constants/jwt.d.ts.map +1 -0
- package/dist/src/constants/sdk-defaults.d.ts +37 -0
- package/dist/src/constants/sdk-defaults.d.ts.map +1 -0
- package/dist/src/constants/version.generated.d.ts +1 -1
- package/dist/src/helpers/sdk.d.ts.map +1 -1
- package/dist/src/helpers/wallet.d.ts +4 -3
- package/dist/src/helpers/wallet.d.ts.map +1 -1
- package/dist/src/index.d.ts +70 -11
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/schemas/files.d.ts +2 -2
- package/dist/src/schemas/launchpad.d.ts +40 -8
- package/dist/src/schemas/launchpad.d.ts.map +1 -1
- package/dist/src/schemas/pagination.d.ts +7 -7
- package/dist/src/schemas/primitives.d.ts.map +1 -1
- package/dist/src/schemas/trade.d.ts +6 -6
- package/dist/src/schemas/user.d.ts +4 -4
- package/dist/src/schemas/validators.d.ts +15 -7
- package/dist/src/schemas/validators.d.ts.map +1 -1
- package/dist/src/services/AbstractCacheService.d.ts +227 -0
- package/dist/src/services/AbstractCacheService.d.ts.map +1 -0
- package/dist/src/services/AbstractTokenFetchService.d.ts +150 -0
- package/dist/src/services/AbstractTokenFetchService.d.ts.map +1 -0
- package/dist/src/services/ApiKeyService.d.ts +205 -0
- package/dist/src/services/ApiKeyService.d.ts.map +1 -0
- package/dist/src/services/BanService.d.ts +195 -0
- package/dist/src/services/BanService.d.ts.map +1 -0
- package/dist/src/services/BaseService.d.ts +50 -3
- package/dist/src/services/BaseService.d.ts.map +1 -1
- package/dist/src/services/BatchedCacheService.d.ts +132 -0
- package/dist/src/services/BatchedCacheService.d.ts.map +1 -0
- package/dist/src/services/BridgeableTokenCache.d.ts +32 -98
- package/dist/src/services/BridgeableTokenCache.d.ts.map +1 -1
- package/dist/src/services/BridgeableTokenService.d.ts +18 -13
- package/dist/src/services/BridgeableTokenService.d.ts.map +1 -1
- package/dist/src/services/BundleService.d.ts.map +1 -1
- package/dist/src/services/BundlerClientFactory.d.ts +32 -0
- package/dist/src/services/BundlerClientFactory.d.ts.map +1 -0
- package/dist/src/services/ChatMessagesService.d.ts +152 -0
- package/dist/src/services/ChatMessagesService.d.ts.map +1 -0
- package/dist/src/services/CommentService.d.ts +119 -0
- package/dist/src/services/CommentService.d.ts.map +1 -0
- package/dist/src/services/CommentsService.d.ts +155 -0
- package/dist/src/services/CommentsService.d.ts.map +1 -0
- package/dist/src/services/ContentFlagService.d.ts +212 -0
- package/dist/src/services/ContentFlagService.d.ts.map +1 -0
- package/dist/src/services/ContentReactionService.d.ts +175 -0
- package/dist/src/services/ContentReactionService.d.ts.map +1 -0
- package/dist/src/services/DexBackendClient.d.ts.map +1 -1
- package/dist/src/services/DexPoolService.d.ts +3 -3
- package/dist/src/services/DexPoolService.d.ts.map +1 -1
- package/dist/src/services/DexQuoteService.d.ts.map +1 -1
- package/dist/src/services/DexService.d.ts +2 -5
- package/dist/src/services/DexService.d.ts.map +1 -1
- package/dist/src/services/GSwapAssetService.d.ts +80 -0
- package/dist/src/services/GSwapAssetService.d.ts.map +1 -0
- package/dist/src/services/GSwapLiquidityMutationService.d.ts +140 -0
- package/dist/src/services/GSwapLiquidityMutationService.d.ts.map +1 -0
- package/dist/src/services/GSwapLiquidityQueryService.d.ts +87 -0
- package/dist/src/services/GSwapLiquidityQueryService.d.ts.map +1 -0
- package/dist/src/services/GSwapPoolCalculationService.d.ts +200 -0
- package/dist/src/services/GSwapPoolCalculationService.d.ts.map +1 -0
- package/dist/src/services/GSwapPoolQueryService.d.ts +116 -0
- package/dist/src/services/GSwapPoolQueryService.d.ts.map +1 -0
- package/dist/src/services/GSwapService.d.ts +14 -0
- package/dist/src/services/GSwapService.d.ts.map +1 -1
- package/dist/src/services/GSwapSwapService.d.ts +68 -0
- package/dist/src/services/GSwapSwapService.d.ts.map +1 -0
- package/dist/src/services/GalaChainBalanceService.d.ts +155 -0
- package/dist/src/services/GalaChainBalanceService.d.ts.map +1 -0
- package/dist/src/services/GalaChainGatewayClient.d.ts +32 -1
- package/dist/src/services/GalaChainGatewayClient.d.ts.map +1 -1
- package/dist/src/services/GalaChainLockService.d.ts +144 -0
- package/dist/src/services/GalaChainLockService.d.ts.map +1 -0
- package/dist/src/services/GalaChainService.d.ts +23 -106
- package/dist/src/services/GalaChainService.d.ts.map +1 -1
- package/dist/src/services/GalaChainTokenService.d.ts +108 -0
- package/dist/src/services/GalaChainTokenService.d.ts.map +1 -0
- package/dist/src/services/GalaChainTransferService.d.ts +205 -0
- package/dist/src/services/GalaChainTransferService.d.ts.map +1 -0
- package/dist/src/services/ImageService.d.ts +24 -8
- package/dist/src/services/ImageService.d.ts.map +1 -1
- package/dist/src/services/LaunchpadService.d.ts +77 -5
- package/dist/src/services/LaunchpadService.d.ts.map +1 -1
- package/dist/src/services/ModeratorService.d.ts +269 -0
- package/dist/src/services/ModeratorService.d.ts.map +1 -0
- package/dist/src/services/MultiPoolStateManager.d.ts +4 -6
- package/dist/src/services/MultiPoolStateManager.d.ts.map +1 -1
- package/dist/src/services/NetworkKeyedCacheService.d.ts +185 -0
- package/dist/src/services/NetworkKeyedCacheService.d.ts.map +1 -0
- package/dist/src/services/OverseerService.d.ts +322 -0
- package/dist/src/services/OverseerService.d.ts.map +1 -0
- package/dist/src/services/PoolCacheManager.d.ts +2 -2
- package/dist/src/services/PoolCacheManager.d.ts.map +1 -1
- package/dist/src/services/PoolService.d.ts +61 -7
- package/dist/src/services/PoolService.d.ts.map +1 -1
- package/dist/src/services/PoolStateManager.d.ts +2 -2
- package/dist/src/services/PoolStateManager.d.ts.map +1 -1
- package/dist/src/services/PriceHistoryService.d.ts.map +1 -1
- package/dist/src/services/SignatureService.d.ts.map +1 -1
- package/dist/src/services/StreamChatService.d.ts +378 -0
- package/dist/src/services/StreamChatService.d.ts.map +1 -0
- package/dist/src/services/StreamTokenServiceBase.d.ts +371 -0
- package/dist/src/services/StreamTokenServiceBase.d.ts.map +1 -0
- package/dist/src/services/StreamWebSocketService.d.ts +268 -0
- package/dist/src/services/StreamWebSocketService.d.ts.map +1 -0
- package/dist/src/services/StreamingEventService.d.ts +431 -0
- package/dist/src/services/StreamingEventService.d.ts.map +1 -0
- package/dist/src/services/StreamingService.d.ts +547 -0
- package/dist/src/services/StreamingService.d.ts.map +1 -0
- package/dist/src/services/SwapEventQueue.d.ts +2 -2
- package/dist/src/services/SwapEventQueue.d.ts.map +1 -1
- package/dist/src/services/TokenBanService.d.ts +214 -0
- package/dist/src/services/TokenBanService.d.ts.map +1 -0
- package/dist/src/services/TokenClassKeyService.d.ts.map +1 -1
- package/dist/src/services/TokenMetadataCache.d.ts +36 -27
- package/dist/src/services/TokenMetadataCache.d.ts.map +1 -1
- package/dist/src/services/TokenMetadataService.d.ts +24 -4
- package/dist/src/services/TokenMetadataService.d.ts.map +1 -1
- package/dist/src/services/TokenResolverService.d.ts.map +1 -1
- package/dist/src/services/TradeService.d.ts +73 -0
- package/dist/src/services/TradeService.d.ts.map +1 -1
- package/dist/src/services/UserService.d.ts +56 -3
- package/dist/src/services/UserService.d.ts.map +1 -1
- package/dist/src/services/WebSocketService.d.ts +3 -3
- package/dist/src/services/WebSocketService.d.ts.map +1 -1
- package/dist/src/services/WrapService.d.ts +18 -5
- package/dist/src/services/WrapService.d.ts.map +1 -1
- package/dist/src/services/WrappableTokenCache.d.ts +8 -36
- package/dist/src/services/WrappableTokenCache.d.ts.map +1 -1
- package/dist/src/services/WrappableTokenService.d.ts +18 -12
- package/dist/src/services/WrappableTokenService.d.ts.map +1 -1
- package/dist/src/services/shared/cache-helpers.d.ts +188 -0
- package/dist/src/services/shared/cache-helpers.d.ts.map +1 -0
- package/dist/src/services/shared/http-helpers.d.ts +146 -0
- package/dist/src/services/shared/http-helpers.d.ts.map +1 -0
- package/dist/src/services/shared/pagination-helpers.d.ts +157 -0
- package/dist/src/services/shared/pagination-helpers.d.ts.map +1 -0
- package/dist/src/services/shared/service-validators.d.ts +137 -0
- package/dist/src/services/shared/service-validators.d.ts.map +1 -0
- package/dist/src/services/shared/websocket-helpers.d.ts +158 -0
- package/dist/src/services/shared/websocket-helpers.d.ts.map +1 -0
- package/dist/src/test-constants.d.ts +29 -0
- package/dist/src/test-constants.d.ts.map +1 -0
- package/dist/src/types/api-key.dto.d.ts +300 -0
- package/dist/src/types/api-key.dto.d.ts.map +1 -0
- package/dist/src/types/backend-responses.d.ts +12 -0
- package/dist/src/types/backend-responses.d.ts.map +1 -1
- package/dist/src/types/ban.dto.d.ts +413 -0
- package/dist/src/types/ban.dto.d.ts.map +1 -0
- package/dist/src/types/burn.dto.d.ts +21 -0
- package/dist/src/types/burn.dto.d.ts.map +1 -1
- package/dist/src/types/chat-messages.dto.d.ts +193 -0
- package/dist/src/types/chat-messages.dto.d.ts.map +1 -0
- package/dist/src/types/comment.dto.d.ts +180 -0
- package/dist/src/types/comment.dto.d.ts.map +1 -0
- package/dist/src/types/comments.dto.d.ts +210 -0
- package/dist/src/types/comments.dto.d.ts.map +1 -0
- package/dist/src/types/common.d.ts +369 -0
- package/dist/src/types/common.d.ts.map +1 -1
- package/dist/src/types/constraints.d.ts +374 -0
- package/dist/src/types/constraints.d.ts.map +1 -0
- package/dist/src/types/content-flag.dto.d.ts +310 -0
- package/dist/src/types/content-flag.dto.d.ts.map +1 -0
- package/dist/src/types/content-reactions.dto.d.ts +132 -0
- package/dist/src/types/content-reactions.dto.d.ts.map +1 -0
- package/dist/src/types/dex-pool.dto.d.ts +13 -37
- package/dist/src/types/dex-pool.dto.d.ts.map +1 -1
- package/dist/src/types/dto.d.ts +8 -0
- package/dist/src/types/dto.d.ts.map +1 -1
- package/dist/src/types/galachain-api.types.d.ts +30 -0
- package/dist/src/types/galachain-api.types.d.ts.map +1 -1
- package/dist/src/types/gswap-responses.types.d.ts.map +1 -1
- package/dist/src/types/launchpad.dto.d.ts +234 -131
- package/dist/src/types/launchpad.dto.d.ts.map +1 -1
- package/dist/src/types/launchpad.validation.d.ts.map +1 -1
- package/dist/src/types/lock.dto.d.ts +20 -35
- package/dist/src/types/lock.dto.d.ts.map +1 -1
- package/dist/src/types/moderator.dto.d.ts +581 -0
- package/dist/src/types/moderator.dto.d.ts.map +1 -0
- package/dist/src/types/options.dto.d.ts +25 -115
- package/dist/src/types/options.dto.d.ts.map +1 -1
- package/dist/src/types/overseer.dto.d.ts +420 -0
- package/dist/src/types/overseer.dto.d.ts.map +1 -0
- package/dist/src/types/pool.dto.d.ts +106 -0
- package/dist/src/types/pool.dto.d.ts.map +1 -0
- package/dist/src/types/result.types.d.ts +3 -2
- package/dist/src/types/result.types.d.ts.map +1 -1
- package/dist/src/types/session-auth.dto.d.ts +91 -0
- package/dist/src/types/session-auth.dto.d.ts.map +1 -0
- package/dist/src/types/stream-chat.dto.d.ts +815 -0
- package/dist/src/types/stream-chat.dto.d.ts.map +1 -0
- package/dist/src/types/streaming-events.dto.d.ts +586 -0
- package/dist/src/types/streaming-events.dto.d.ts.map +1 -0
- package/dist/src/types/streaming.dto.d.ts +1141 -0
- package/dist/src/types/streaming.dto.d.ts.map +1 -0
- package/dist/src/types/token-ban.dto.d.ts +195 -0
- package/dist/src/types/token-ban.dto.d.ts.map +1 -0
- package/dist/src/types/trade.dto.d.ts +21 -61
- package/dist/src/types/trade.dto.d.ts.map +1 -1
- package/dist/src/types/trades-query.dto.d.ts +127 -0
- package/dist/src/types/trades-query.dto.d.ts.map +1 -0
- package/dist/src/types/transfer.dto.d.ts +20 -15
- package/dist/src/types/transfer.dto.d.ts.map +1 -1
- package/dist/src/types/user.dto.d.ts +185 -73
- package/dist/src/types/user.dto.d.ts.map +1 -1
- package/dist/src/types/wrappable-token.dto.d.ts +6 -2
- package/dist/src/types/wrappable-token.dto.d.ts.map +1 -1
- package/dist/src/utils/LiquidityEventExtractor.d.ts.map +1 -1
- package/dist/src/utils/Logger.d.ts.map +1 -1
- package/dist/src/utils/MonitoringMetrics.d.ts.map +1 -1
- package/dist/src/utils/PoolKeyNormalizer.d.ts.map +1 -1
- package/dist/src/utils/ReconnectionManager.d.ts +142 -0
- package/dist/src/utils/ReconnectionManager.d.ts.map +1 -0
- package/dist/src/utils/SignatureHelper.d.ts +9 -0
- package/dist/src/utils/SignatureHelper.d.ts.map +1 -1
- package/dist/src/utils/SwapEventExtractor.d.ts.map +1 -1
- package/dist/src/utils/adapters.d.ts.map +1 -1
- package/dist/src/utils/address-formatter.d.ts +317 -0
- package/dist/src/utils/address-formatter.d.ts.map +1 -0
- package/dist/src/utils/agent-config.d.ts.map +1 -1
- package/dist/src/utils/amount-validator.d.ts +268 -0
- package/dist/src/utils/amount-validator.d.ts.map +1 -0
- package/dist/src/utils/api-patterns.d.ts +347 -0
- package/dist/src/utils/api-patterns.d.ts.map +1 -0
- package/dist/src/utils/array-helpers.d.ts +115 -0
- package/dist/src/utils/array-helpers.d.ts.map +1 -0
- package/dist/src/utils/async-patterns.d.ts +272 -0
- package/dist/src/utils/async-patterns.d.ts.map +1 -0
- package/dist/src/utils/auto-pagination.d.ts +195 -2
- package/dist/src/utils/auto-pagination.d.ts.map +1 -1
- package/dist/src/utils/bignumber-helpers.d.ts +119 -13
- package/dist/src/utils/bignumber-helpers.d.ts.map +1 -1
- package/dist/src/utils/bignumber-pool-cache.d.ts.map +1 -1
- package/dist/src/utils/bondingCurveCalculations.d.ts.map +1 -1
- package/dist/src/utils/cacheWarmingHelpers.d.ts +2 -2
- package/dist/src/utils/cacheWarmingHelpers.d.ts.map +1 -1
- package/dist/src/utils/data-transform-patterns.d.ts +393 -0
- package/dist/src/utils/data-transform-patterns.d.ts.map +1 -0
- package/dist/src/utils/date-utils.d.ts +166 -0
- package/dist/src/utils/date-utils.d.ts.map +1 -1
- package/dist/src/utils/delimiter-parser.d.ts +139 -0
- package/dist/src/utils/delimiter-parser.d.ts.map +1 -0
- package/dist/src/utils/error-factories.d.ts +346 -1
- package/dist/src/utils/error-factories.d.ts.map +1 -1
- package/dist/src/utils/error-handling-patterns.d.ts +390 -0
- package/dist/src/utils/error-handling-patterns.d.ts.map +1 -0
- package/dist/src/utils/error-patterns.d.ts +360 -0
- package/dist/src/utils/error-patterns.d.ts.map +1 -0
- package/dist/src/utils/error-utils.d.ts +250 -0
- package/dist/src/utils/error-utils.d.ts.map +1 -1
- package/dist/src/utils/error-wrapper.d.ts +208 -0
- package/dist/src/utils/error-wrapper.d.ts.map +1 -0
- package/dist/src/utils/errors.d.ts +70 -0
- package/dist/src/utils/errors.d.ts.map +1 -1
- package/dist/src/utils/http-factory.d.ts +36 -0
- package/dist/src/utils/http-factory.d.ts.map +1 -0
- package/dist/src/utils/http.d.ts.map +1 -1
- package/dist/src/utils/load-env.d.ts.map +1 -1
- package/dist/src/utils/multipart.d.ts.map +1 -1
- package/dist/src/utils/numeric-patterns.d.ts +289 -0
- package/dist/src/utils/numeric-patterns.d.ts.map +1 -0
- package/dist/src/utils/numeric-wrappers.d.ts +146 -0
- package/dist/src/utils/numeric-wrappers.d.ts.map +1 -0
- package/dist/src/utils/object-extractors.d.ts +115 -0
- package/dist/src/utils/object-extractors.d.ts.map +1 -0
- package/dist/src/utils/object-patterns.d.ts +81 -0
- package/dist/src/utils/object-patterns.d.ts.map +1 -0
- package/dist/src/utils/pagination-helpers.d.ts +230 -0
- package/dist/src/utils/pagination-helpers.d.ts.map +1 -0
- package/dist/src/utils/pool-pair-parser.d.ts +3 -1
- package/dist/src/utils/pool-pair-parser.d.ts.map +1 -1
- package/dist/src/utils/pool-state-validator.d.ts.map +1 -1
- package/dist/src/utils/position-filters.d.ts +1 -2
- package/dist/src/utils/position-filters.d.ts.map +1 -1
- package/dist/src/utils/query-params.d.ts +0 -16
- package/dist/src/utils/query-params.d.ts.map +1 -1
- package/dist/src/utils/response-handlers.d.ts +149 -20
- package/dist/src/utils/response-handlers.d.ts.map +1 -1
- package/dist/src/utils/response-helpers.d.ts +28 -0
- package/dist/src/utils/response-helpers.d.ts.map +1 -0
- package/dist/src/utils/response-normalizers.d.ts +27 -49
- package/dist/src/utils/response-normalizers.d.ts.map +1 -1
- package/dist/src/utils/safe-parsers.d.ts +487 -0
- package/dist/src/utils/safe-parsers.d.ts.map +1 -0
- package/dist/src/utils/service-validators.d.ts +268 -0
- package/dist/src/utils/service-validators.d.ts.map +1 -0
- package/dist/src/utils/slippage-utils.d.ts.map +1 -1
- package/dist/src/utils/string-patterns.d.ts +404 -0
- package/dist/src/utils/string-patterns.d.ts.map +1 -0
- package/dist/src/utils/string-transforms.d.ts +89 -0
- package/dist/src/utils/string-transforms.d.ts.map +1 -0
- package/dist/src/utils/string-utils.d.ts +108 -0
- package/dist/src/utils/string-utils.d.ts.map +1 -0
- package/dist/src/utils/swap-delta-calculator.d.ts.map +1 -1
- package/dist/src/utils/tick-crossing-handler.d.ts.map +1 -1
- package/dist/src/utils/token-format-converter.d.ts +22 -8
- package/dist/src/utils/token-format-converter.d.ts.map +1 -1
- package/dist/src/utils/token-parser.d.ts +2 -2
- package/dist/src/utils/token-parser.d.ts.map +1 -1
- package/dist/src/utils/token-stringification.d.ts +168 -0
- package/dist/src/utils/token-stringification.d.ts.map +1 -0
- package/dist/src/utils/tokenNameNormalizer.d.ts +96 -0
- package/dist/src/utils/tokenNameNormalizer.d.ts.map +1 -0
- package/dist/src/utils/tokenNormalizer.d.ts +8 -45
- package/dist/src/utils/tokenNormalizer.d.ts.map +1 -1
- package/dist/src/utils/transfer-validation.d.ts +1 -1
- package/dist/src/utils/transfer-validation.d.ts.map +1 -1
- package/dist/src/utils/type-guard-factory.d.ts +260 -0
- package/dist/src/utils/type-guard-factory.d.ts.map +1 -0
- package/dist/src/utils/unique-key-generator.d.ts +148 -0
- package/dist/src/utils/unique-key-generator.d.ts.map +1 -0
- package/dist/src/utils/validation-helpers.d.ts +906 -183
- package/dist/src/utils/validation-helpers.d.ts.map +1 -1
- package/dist/src/utils/validation-patterns.d.ts +745 -0
- package/dist/src/utils/validation-patterns.d.ts.map +1 -0
- package/dist/src/utils/validation.d.ts +2 -30
- package/dist/src/utils/validation.d.ts.map +1 -1
- package/dist/src/utils/wallet.d.ts +12 -1
- package/dist/src/utils/wallet.d.ts.map +1 -1
- package/dist/src/utils/websocket-patterns.d.ts +681 -0
- package/dist/src/utils/websocket-patterns.d.ts.map +1 -0
- package/dist/src/utils/websocket-validators.d.ts.map +1 -1
- package/package.json +86 -19
- package/dist/src/bridge/strategies/index.d.ts +0 -9
- package/dist/src/bridge/strategies/index.d.ts.map +0 -1
- package/dist/src/constants/counts.d.ts +0 -66
- package/dist/src/constants/counts.d.ts.map +0 -1
- package/dist/src/services/WebSocketManager.d.ts +0 -99
- package/dist/src/services/WebSocketManager.d.ts.map +0 -1
- package/dist/src/types/eip712-types.d.ts +0 -140
- package/dist/src/types/eip712-types.d.ts.map +0 -1
- package/dist/src/types/pool-state-manager-config.dto.d.ts +0 -103
- package/dist/src/types/pool-state-manager-config.dto.d.ts.map +0 -1
- package/dist/src/utils/number-utils.d.ts +0 -94
- package/dist/src/utils/number-utils.d.ts.map +0 -1
- package/dist/src/utils/precision-math.d.ts +0 -37
- package/dist/src/utils/precision-math.d.ts.map +0 -1
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content Flag Service
|
|
3
|
+
*
|
|
4
|
+
* Service for managing content flags/reports on streams, chat messages, and comments.
|
|
5
|
+
*
|
|
6
|
+
* Two-tier system:
|
|
7
|
+
* - Chat/Comment: One-click flag (reason optional) - reviewed by Owner/Moderator
|
|
8
|
+
* - Stream: Modal required (reason required) - reviewed by Admin only
|
|
9
|
+
*
|
|
10
|
+
* @module ContentFlagService
|
|
11
|
+
* @since 5.8.0
|
|
12
|
+
*/
|
|
13
|
+
import { HttpClient } from '../utils/http';
|
|
14
|
+
import type { JwtAuth } from '../auth/JwtAuth';
|
|
15
|
+
import { StreamTokenServiceBase } from './StreamTokenServiceBase';
|
|
16
|
+
import { CreateFlagOptions, CreateFlagResult, ListFlagsOptions, ListGlobalFlagsOptions, FlagListResult, DismissFlagOptions, DismissFlagResult, ActionFlagOptions, ActionFlagResult } from '../types/content-flag.dto';
|
|
17
|
+
/**
|
|
18
|
+
* Service for managing content flags and reports
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* // Create a flag on a chat message (one-click)
|
|
23
|
+
* const result = await sdk.flags.createFlag({
|
|
24
|
+
* tokenName: 'mytoken',
|
|
25
|
+
* contentType: ContentType.CHAT_MESSAGE,
|
|
26
|
+
* contentId: 'msg-123',
|
|
27
|
+
* reportedUserAddress: 'eth|abc...',
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* // List pending flags for review
|
|
31
|
+
* const flags = await sdk.flags.listFlags({
|
|
32
|
+
* tokenName: 'mytoken',
|
|
33
|
+
* status: FlagStatus.PENDING,
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* // Take action on a flag
|
|
37
|
+
* await sdk.flags.actionFlag({
|
|
38
|
+
* flagId: 1,
|
|
39
|
+
* action: FlagAction.DELETE_AND_BAN,
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare class ContentFlagService extends StreamTokenServiceBase {
|
|
44
|
+
/**
|
|
45
|
+
* Creates a new ContentFlagService instance
|
|
46
|
+
*
|
|
47
|
+
* @param http - HTTP client for making requests
|
|
48
|
+
* @param adminApiKey - Optional admin API key for elevated access
|
|
49
|
+
* @param jwtAuth - Optional JWT authentication manager
|
|
50
|
+
* @param debugMode - Enable debug logging
|
|
51
|
+
*/
|
|
52
|
+
constructor(http: HttpClient, adminApiKey?: string, jwtAuth?: JwtAuth, debugMode?: boolean);
|
|
53
|
+
/**
|
|
54
|
+
* Create a content flag/report
|
|
55
|
+
*
|
|
56
|
+
* For chat messages and comments, only contentType/contentId/reportedUserAddress are required.
|
|
57
|
+
* For streams, reason is also required.
|
|
58
|
+
*
|
|
59
|
+
* @param options - Flag creation options
|
|
60
|
+
* @returns Created flag data
|
|
61
|
+
* @throws Error if not authenticated or validation fails
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* // One-click flag on chat message
|
|
66
|
+
* const result = await sdk.flags.createFlag({
|
|
67
|
+
* tokenName: 'mytoken',
|
|
68
|
+
* contentType: ContentType.CHAT_MESSAGE,
|
|
69
|
+
* contentId: 'msg-123',
|
|
70
|
+
* reportedUserAddress: 'eth|abc...',
|
|
71
|
+
* });
|
|
72
|
+
*
|
|
73
|
+
* // Flag with optional reason/details
|
|
74
|
+
* const result = await sdk.flags.createFlag({
|
|
75
|
+
* tokenName: 'mytoken',
|
|
76
|
+
* contentType: ContentType.COMMENT,
|
|
77
|
+
* contentId: 'comment-456',
|
|
78
|
+
* reportedUserAddress: 'eth|abc...',
|
|
79
|
+
* reason: FlagReason.SPAM,
|
|
80
|
+
* details: 'User is posting spam links',
|
|
81
|
+
* });
|
|
82
|
+
*
|
|
83
|
+
* // Stream report (reason required)
|
|
84
|
+
* const result = await sdk.flags.createFlag({
|
|
85
|
+
* tokenName: 'mytoken',
|
|
86
|
+
* contentType: ContentType.STREAM,
|
|
87
|
+
* contentId: 'stream-789',
|
|
88
|
+
* reportedUserAddress: 'eth|abc...',
|
|
89
|
+
* reason: FlagReason.INAPPROPRIATE_CONTENT,
|
|
90
|
+
* details: 'Explicit content',
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
createFlag(options: CreateFlagOptions): Promise<CreateFlagResult>;
|
|
95
|
+
/**
|
|
96
|
+
* List flags for a token with pagination and filtering
|
|
97
|
+
*
|
|
98
|
+
* Authorization varies by content type:
|
|
99
|
+
* - CHAT_MESSAGE/COMMENT: Owner or Moderator (JWT) can view
|
|
100
|
+
* - STREAM: Admin API key only
|
|
101
|
+
*
|
|
102
|
+
* @param options - List options with filters
|
|
103
|
+
* @returns Paginated list of flags
|
|
104
|
+
* @throws Error if not authorized
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* // List all pending flags
|
|
109
|
+
* const result = await sdk.flags.listFlags({
|
|
110
|
+
* tokenName: 'mytoken',
|
|
111
|
+
* status: FlagStatus.PENDING,
|
|
112
|
+
* });
|
|
113
|
+
*
|
|
114
|
+
* // List flags by content type with pagination
|
|
115
|
+
* const result = await sdk.flags.listFlags({
|
|
116
|
+
* tokenName: 'mytoken',
|
|
117
|
+
* contentType: ContentType.CHAT_MESSAGE,
|
|
118
|
+
* page: 1,
|
|
119
|
+
* limit: 50,
|
|
120
|
+
* });
|
|
121
|
+
*
|
|
122
|
+
* // List flags from a specific reporter
|
|
123
|
+
* const result = await sdk.flags.listFlags({
|
|
124
|
+
* tokenName: 'mytoken',
|
|
125
|
+
* reporterAddress: 'eth|abc...',
|
|
126
|
+
* });
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
listFlags(options: ListFlagsOptions): Promise<FlagListResult>;
|
|
130
|
+
/**
|
|
131
|
+
* List ALL flags globally across all tokens
|
|
132
|
+
*
|
|
133
|
+
* This is for overseers and admins to view flags across the entire platform.
|
|
134
|
+
* Use listFlags() for token-specific flag lists.
|
|
135
|
+
*
|
|
136
|
+
* @param options - List options with filters (all optional)
|
|
137
|
+
* @returns Paginated list of flags
|
|
138
|
+
* @throws Error if not authorized (Admin API key or Overseer JWT required)
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```typescript
|
|
142
|
+
* // List all pending flags globally
|
|
143
|
+
* const result = await sdk.flags.listGlobalFlags({
|
|
144
|
+
* status: FlagStatus.PENDING,
|
|
145
|
+
* });
|
|
146
|
+
*
|
|
147
|
+
* // Filter by token name
|
|
148
|
+
* const result = await sdk.flags.listGlobalFlags({
|
|
149
|
+
* tokenName: 'mytoken',
|
|
150
|
+
* status: FlagStatus.PENDING,
|
|
151
|
+
* });
|
|
152
|
+
*
|
|
153
|
+
* // Filter by reporter and reason
|
|
154
|
+
* const result = await sdk.flags.listGlobalFlags({
|
|
155
|
+
* reporterAddress: 'eth|abc...',
|
|
156
|
+
* reason: FlagReason.SPAM,
|
|
157
|
+
* });
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
listGlobalFlags(options?: ListGlobalFlagsOptions): Promise<FlagListResult>;
|
|
161
|
+
/**
|
|
162
|
+
* Dismiss a flag (no action taken)
|
|
163
|
+
*
|
|
164
|
+
* Marks the flag as reviewed but takes no action on the content.
|
|
165
|
+
*
|
|
166
|
+
* @param options - Dismiss options
|
|
167
|
+
* @returns Updated flag data
|
|
168
|
+
* @throws Error if not authorized or flag not found
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* const result = await sdk.flags.dismissFlag({ flagId: 123 });
|
|
173
|
+
* console.log(result.flag.status); // 'DISMISSED'
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
dismissFlag(options: DismissFlagOptions): Promise<DismissFlagResult>;
|
|
177
|
+
/**
|
|
178
|
+
* Take action on a flag
|
|
179
|
+
*
|
|
180
|
+
* Actions available:
|
|
181
|
+
* - DELETE_CONTENT: Remove the flagged content
|
|
182
|
+
* - BAN_USER: Ban the reported user from the token
|
|
183
|
+
* - DELETE_AND_BAN: Both delete content and ban user
|
|
184
|
+
*
|
|
185
|
+
* @param options - Action options
|
|
186
|
+
* @returns Updated flag data with action taken
|
|
187
|
+
* @throws Error if not authorized, flag not found, or action invalid
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```typescript
|
|
191
|
+
* // Delete the flagged content
|
|
192
|
+
* const result = await sdk.flags.actionFlag({
|
|
193
|
+
* flagId: 123,
|
|
194
|
+
* action: FlagAction.DELETE_CONTENT,
|
|
195
|
+
* });
|
|
196
|
+
*
|
|
197
|
+
* // Ban the user
|
|
198
|
+
* const result = await sdk.flags.actionFlag({
|
|
199
|
+
* flagId: 123,
|
|
200
|
+
* action: FlagAction.BAN_USER,
|
|
201
|
+
* });
|
|
202
|
+
*
|
|
203
|
+
* // Delete content and ban user
|
|
204
|
+
* const result = await sdk.flags.actionFlag({
|
|
205
|
+
* flagId: 123,
|
|
206
|
+
* action: FlagAction.DELETE_AND_BAN,
|
|
207
|
+
* });
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
actionFlag(options: ActionFlagOptions): Promise<ActionFlagResult>;
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=ContentFlagService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentFlagService.d.ts","sourceRoot":"","sources":["../../../src/services/ContentFlagService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAQjB,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,kBAAmB,SAAQ,sBAAsB;IAC5D;;;;;;;OAOG;gBAED,IAAI,EAAE,UAAU,EAChB,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,OAAO,EACjB,SAAS,GAAE,OAAe;IAK5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA6BvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC;IAoCnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,cAAc,CAAC;IAkCpF;;;;;;;;;;;;;;OAcG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAgB1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAexE"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content Reaction Service
|
|
3
|
+
*
|
|
4
|
+
* Handles persistent content reactions on pool messages (chat messages and comments).
|
|
5
|
+
* Unlike stream reactions (ephemeral emoji bursts), content reactions are stored
|
|
6
|
+
* and displayed as counts/previews on messages.
|
|
7
|
+
*
|
|
8
|
+
* @category Services
|
|
9
|
+
* @since 5.12.0
|
|
10
|
+
*/
|
|
11
|
+
import { HttpClient } from '../utils/http';
|
|
12
|
+
import { StreamTokenServiceBase } from './StreamTokenServiceBase';
|
|
13
|
+
import type { JwtAuth } from '../auth/JwtAuth';
|
|
14
|
+
import { AddContentReactionOptions, RemoveContentReactionOptions, AddContentReactionResult, RemoveContentReactionResult } from '../types/content-reactions.dto';
|
|
15
|
+
/**
|
|
16
|
+
* Content Reaction Service Class
|
|
17
|
+
*
|
|
18
|
+
* Provides methods for:
|
|
19
|
+
* - Adding reactions to chat messages or comments (authenticated)
|
|
20
|
+
* - Removing reactions (authenticated - reaction owner only)
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const reactionService = new ContentReactionService(httpClient, undefined, jwtAuth);
|
|
25
|
+
*
|
|
26
|
+
* // Add a reaction to a chat message
|
|
27
|
+
* const result = await reactionService.addContentReaction({
|
|
28
|
+
* tokenName: 'mytoken',
|
|
29
|
+
* messageId: 'msg-1703443200000-a1b2c3d4e5f6789012345678901234ab',
|
|
30
|
+
* reactionType: 'heart'
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* // Remove a reaction
|
|
34
|
+
* await reactionService.removeContentReaction({
|
|
35
|
+
* tokenName: 'mytoken',
|
|
36
|
+
* messageId: 'msg-1703443200000-a1b2c3d4e5f6789012345678901234ab',
|
|
37
|
+
* reactionType: 'heart'
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare class ContentReactionService extends StreamTokenServiceBase {
|
|
42
|
+
constructor(http: HttpClient, adminApiKey?: string, jwtAuth?: JwtAuth, debugMode?: boolean);
|
|
43
|
+
/**
|
|
44
|
+
* Validate token name using content reaction constraints
|
|
45
|
+
*/
|
|
46
|
+
private validateReactionTokenName;
|
|
47
|
+
/**
|
|
48
|
+
* Validate message ID format
|
|
49
|
+
*/
|
|
50
|
+
private validateMessageId;
|
|
51
|
+
/**
|
|
52
|
+
* Validate reaction type
|
|
53
|
+
*/
|
|
54
|
+
private validateReactionType;
|
|
55
|
+
/**
|
|
56
|
+
* Add a reaction to a pool message (chat or comment)
|
|
57
|
+
*
|
|
58
|
+
* Requires JWT or API key authentication.
|
|
59
|
+
* Adding the same reaction type again is a no-op (idempotent).
|
|
60
|
+
* Users can have multiple different reaction types on the same message.
|
|
61
|
+
*
|
|
62
|
+
* @param options Options including tokenName, messageId, and reactionType
|
|
63
|
+
* @returns Updated reaction data and whether reaction was newly created
|
|
64
|
+
* @throws ValidationError if parameters are invalid
|
|
65
|
+
* @throws ConfigurationError if authentication is not configured
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* // Add a heart reaction
|
|
70
|
+
* const result = await reactionService.addContentReaction({
|
|
71
|
+
* tokenName: 'mytoken',
|
|
72
|
+
* messageId: 'msg-1703443200000-a1b2c3d4e5f6789012345678901234ab',
|
|
73
|
+
* reactionType: 'heart'
|
|
74
|
+
* });
|
|
75
|
+
* console.log('Created:', result.created);
|
|
76
|
+
* console.log('Total reactions:', result.data.totalCount);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
addContentReaction(options: AddContentReactionOptions): Promise<AddContentReactionResult>;
|
|
80
|
+
/**
|
|
81
|
+
* Remove a reaction from a pool message
|
|
82
|
+
*
|
|
83
|
+
* Requires JWT or API key authentication.
|
|
84
|
+
* Only the user who created the reaction can remove it (no admin override).
|
|
85
|
+
*
|
|
86
|
+
* @param options Options including tokenName, messageId, and reactionType
|
|
87
|
+
* @returns Success indicator
|
|
88
|
+
* @throws ValidationError if parameters are invalid
|
|
89
|
+
* @throws ConfigurationError if authentication is not configured
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* // Remove a heart reaction
|
|
94
|
+
* await reactionService.removeContentReaction({
|
|
95
|
+
* tokenName: 'mytoken',
|
|
96
|
+
* messageId: 'msg-1703443200000-a1b2c3d4e5f6789012345678901234ab',
|
|
97
|
+
* reactionType: 'heart'
|
|
98
|
+
* });
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
removeContentReaction(options: RemoveContentReactionOptions): Promise<RemoveContentReactionResult>;
|
|
102
|
+
/**
|
|
103
|
+
* Add a reaction to a chat message
|
|
104
|
+
*
|
|
105
|
+
* Convenience wrapper for addContentReaction specifically for chat messages.
|
|
106
|
+
*
|
|
107
|
+
* @param options Options including tokenName, messageId, and reactionType
|
|
108
|
+
* @returns Updated reaction data
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* await reactionService.addReactionToChatMessage({
|
|
113
|
+
* tokenName: 'mytoken',
|
|
114
|
+
* messageId: 'msg-1703443200000-a1b2c3d4e5f6789012345678901234ab',
|
|
115
|
+
* reactionType: 'fire'
|
|
116
|
+
* });
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
addReactionToChatMessage(options: AddContentReactionOptions): Promise<AddContentReactionResult>;
|
|
120
|
+
/**
|
|
121
|
+
* Remove a reaction from a chat message
|
|
122
|
+
*
|
|
123
|
+
* Convenience wrapper for removeContentReaction specifically for chat messages.
|
|
124
|
+
*
|
|
125
|
+
* @param options Options including tokenName, messageId, and reactionType
|
|
126
|
+
* @returns Success indicator
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* await reactionService.removeReactionFromChatMessage({
|
|
131
|
+
* tokenName: 'mytoken',
|
|
132
|
+
* messageId: 'msg-1703443200000-a1b2c3d4e5f6789012345678901234ab',
|
|
133
|
+
* reactionType: 'fire'
|
|
134
|
+
* });
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
removeReactionFromChatMessage(options: RemoveContentReactionOptions): Promise<RemoveContentReactionResult>;
|
|
138
|
+
/**
|
|
139
|
+
* Add a reaction to a comment
|
|
140
|
+
*
|
|
141
|
+
* Convenience wrapper for addContentReaction specifically for comments.
|
|
142
|
+
*
|
|
143
|
+
* @param options Options including tokenName, messageId, and reactionType
|
|
144
|
+
* @returns Updated reaction data
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```typescript
|
|
148
|
+
* await reactionService.addReactionToComment({
|
|
149
|
+
* tokenName: 'mytoken',
|
|
150
|
+
* messageId: 'msg-1703443200000-a1b2c3d4e5f6789012345678901234ab',
|
|
151
|
+
* reactionType: 'thumbs_up'
|
|
152
|
+
* });
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
addReactionToComment(options: AddContentReactionOptions): Promise<AddContentReactionResult>;
|
|
156
|
+
/**
|
|
157
|
+
* Remove a reaction from a comment
|
|
158
|
+
*
|
|
159
|
+
* Convenience wrapper for removeContentReaction specifically for comments.
|
|
160
|
+
*
|
|
161
|
+
* @param options Options including tokenName, messageId, and reactionType
|
|
162
|
+
* @returns Success indicator
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```typescript
|
|
166
|
+
* await reactionService.removeReactionFromComment({
|
|
167
|
+
* tokenName: 'mytoken',
|
|
168
|
+
* messageId: 'msg-1703443200000-a1b2c3d4e5f6789012345678901234ab',
|
|
169
|
+
* reactionType: 'thumbs_up'
|
|
170
|
+
* });
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
removeReactionFromComment(options: RemoveContentReactionOptions): Promise<RemoveContentReactionResult>;
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=ContentReactionService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentReactionService.d.ts","sourceRoot":"","sources":["../../../src/services/ContentReactionService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,wBAAwB,EACxB,2BAA2B,EAM5B,MAAM,gCAAgC,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,sBAAuB,SAAQ,sBAAsB;gBAE9D,IAAI,EAAE,UAAU,EAChB,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,OAAO,EACjB,SAAS,GAAE,OAAe;IAS5B;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAIjC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAYzB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAc5B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IA2B/F;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,qBAAqB,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA0BxG;;;;;;;;;;;;;;;;OAgBG;IACG,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAIrG;;;;;;;;;;;;;;;;OAgBG;IACG,6BAA6B,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAQhH;;;;;;;;;;;;;;;;OAgBG;IACG,oBAAoB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAIjG;;;;;;;;;;;;;;;;OAgBG;IACG,yBAAyB,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAG7G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DexBackendClient.d.ts","sourceRoot":"","sources":["../../../src/services/DexBackendClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAEL,4BAA4B,EAE5B,2BAA2B,EAE5B,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"DexBackendClient.d.ts","sourceRoot":"","sources":["../../../src/services/DexBackendClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAEL,4BAA4B,EAE5B,2BAA2B,EAE5B,MAAM,8BAA8B,CAAC;AAQtC;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAa;IAEzB;;;;;;;;;;;;;OAaG;gBACS,IAAI,EAAE,UAAU;IAI5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgEG;IACG,aAAa,CACjB,aAAa,EAAE,MAAM,EACrB,KAAK,GAAE,MAAW,EAClB,MAAM,GAAE,MAAU,GACjB,OAAO,CAAC,4BAA4B,CAAC;IA0GxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IACG,cAAc,CAAC,OAAO,GAAE;QAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;KACX,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAoG7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,OAAO,CAAC,WAAW;CA+BpB"}
|
|
@@ -90,7 +90,7 @@ export declare class DexPoolService extends BaseService {
|
|
|
90
90
|
* });
|
|
91
91
|
*
|
|
92
92
|
* console.log(`Found ${result.total} total pools`);
|
|
93
|
-
* result.
|
|
93
|
+
* result.items.forEach(pool => {
|
|
94
94
|
* console.log(`${pool.poolName}: ${pool.token0Price} / ${pool.token1Price}`);
|
|
95
95
|
* });
|
|
96
96
|
* ```
|
|
@@ -122,10 +122,10 @@ export declare class DexPoolService extends BaseService {
|
|
|
122
122
|
* });
|
|
123
123
|
*
|
|
124
124
|
* console.log(`Total pools: ${allPools.total}`);
|
|
125
|
-
* console.log(`Priced pools: ${allPools.
|
|
125
|
+
* console.log(`Priced pools: ${allPools.items.filter(p => p.token0Price).length}`);
|
|
126
126
|
*
|
|
127
127
|
* // Find top GALA pools with prices
|
|
128
|
-
* const galaPools = allPools.
|
|
128
|
+
* const galaPools = allPools.items
|
|
129
129
|
* .filter(p => p.poolName.includes('GALA') && p.token0Price)
|
|
130
130
|
* .slice(0, 10);
|
|
131
131
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DexPoolService.d.ts","sourceRoot":"","sources":["../../../src/services/DexPoolService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EAErB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"DexPoolService.d.ts","sourceRoot":"","sources":["../../../src/services/DexPoolService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EAErB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAInD;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C,mCAAmC;IACnC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAE3C,uDAAuD;IACvD,OAAO,CAAC,YAAY,CAA2B;IAE/C,sDAAsD;IACtD,OAAO,CAAC,kBAAkB,CAAa;IAEvC;;;;;;;;OAQG;gBAED,IAAI,EAAE,UAAU,EAChB,iBAAiB,EAAE,MAAM,EACzB,YAAY,GAAE,YAAY,GAAG,SAAqB,EAClD,kBAAkB,GAAE,MAAU,EAC9B,SAAS,GAAE,OAAe;IAQ5B;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAI5C;;;;OAIG;IACH,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAKhD;;;;;;;;;;;;;OAaG;YACW,sBAAsB;IAoHpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,cAAc,CAAC;IA8EhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,gBAAgB,CACpB,OAAO,GAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAM,GACzD,OAAO,CAAC,cAAc,CAAC;CAsC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DexQuoteService.d.ts","sourceRoot":"","sources":["../../../src/services/DexQuoteService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"DexQuoteService.d.ts","sourceRoot":"","sources":["../../../src/services/DexQuoteService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAWhD,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,4BAA4B,EAC5B,kBAAkB,EAEnB,MAAM,6BAA6B,CAAC;AAMrC;;GAEG;AACH,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,6BAA6B,CAA4C;IAEjF;;;;;;;;;;;;;;;OAeG;gBAED,IAAI,EAAE,UAAU,EAChB,gBAAgB,EAAE,MAAM,EACxB,SAAS,GAAE,OAAe,EAC1B,cAAc,GAAE,MAAc;IAOhC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,mCAAmC;IA4C3C;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,mBAAmB;IAc3B;;;;;;;;;;;OAWG;IAEH,OAAO,CAAC,oBAAoB;IAU5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiDG;IACH,gCAAgC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAO3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkDG;IACG,sBAAsB,CAC1B,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,uBAAuB,CAAC;IAkEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoFG;IACG,qCAAqC,CACzC,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,kBAAkB,CAAC;IAmE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2EG;IACG,wCAAwC,CAC5C,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,kBAAkB,CAAC;IAsE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+CG;IACG,gCAAgC,CACpC,OAAO,EAAE,4BAA4B,EACrC,IAAI,GAAE,OAAO,GAAG,UAAoB,GACnC,OAAO,CAAC,kBAAkB,CAAC;CAM/B"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* and calculate spot prices for launchpad tokens.
|
|
7
7
|
*/
|
|
8
8
|
import { HttpClient } from '../utils/http';
|
|
9
|
+
import { LoggerBase } from './BaseService';
|
|
9
10
|
import { TokenSpotPrice, GalaChainTokenDetails, DexSeason, LeaderboardResult, DexAggregatedVolumeSummary } from '../types/launchpad.dto';
|
|
10
11
|
import { CalculateBuyAmountOptions, FetchTokenSpotPriceParams } from '../types/options.dto';
|
|
11
12
|
import { AmountCalculationResult } from '../types/launchpad.dto';
|
|
@@ -28,11 +29,10 @@ import type { TokenId } from '../types/common';
|
|
|
28
29
|
* @category Services
|
|
29
30
|
* @since 1.0.0
|
|
30
31
|
*/
|
|
31
|
-
export declare class DexService {
|
|
32
|
+
export declare class DexService extends LoggerBase {
|
|
32
33
|
private readonly dexBackendHttp?;
|
|
33
34
|
private readonly cache?;
|
|
34
35
|
private readonly galaChainService?;
|
|
35
|
-
private readonly logger;
|
|
36
36
|
constructor(dexBackendHttp?: HttpClient | undefined, cache?: TokenMetadataCache | undefined, galaChainService?: GalaChainService | undefined, debugMode?: boolean);
|
|
37
37
|
/**
|
|
38
38
|
* Fetch USD spot price for DEX tokens with tokenId
|
|
@@ -134,9 +134,6 @@ export declare class DexService {
|
|
|
134
134
|
* - Higher supply = higher price (built-in scarcity)
|
|
135
135
|
* - 1 GALA buys fewer tokens as supply grows
|
|
136
136
|
*
|
|
137
|
-
* @deprecated Use LaunchpadSDK.fetchTokenPrice({tokenName}) instead. Will be removed in v4.0.0
|
|
138
|
-
* This method is kept for backward compatibility with existing code that calls it directly.
|
|
139
|
-
*
|
|
140
137
|
* @param tokenName Launchpad token name (e.g., 'anime', 'demonkpop')
|
|
141
138
|
* @param calculateBuyAmount Callback to calculate buy amount via bonding curve
|
|
142
139
|
* @param fetchPoolDetails Optional callback to check graduation status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DexService.d.ts","sourceRoot":"","sources":["../../../src/services/DexService.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"DexService.d.ts","sourceRoot":"","sources":["../../../src/services/DexService.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,SAAS,EAET,iBAAiB,EACjB,0BAA0B,EAE3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAiBjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,UAAW,SAAQ,UAAU;IAEtC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBAFjB,cAAc,CAAC,EAAE,UAAU,YAAA,EAC3B,KAAK,CAAC,EAAE,kBAAkB,YAAA,EAC1B,gBAAgB,CAAC,EAAE,gBAAgB,YAAA,EACpD,SAAS,GAAE,OAAe;IAK5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACG,eAAe,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,cAAc,CAAC;IA0BjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;YACW,uBAAuB;IAmGrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,4BAA4B,CAChC,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAO,CAAC,uBAAuB,CAAC,EAE5F,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,GACrD,OAAO,CAAC,cAAc,CAAC;IA2E1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACG,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAkDzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,kBAAkB,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IA0EhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACG,qBAAqB,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAkBxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+DG;IACG,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAwFjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACG,0BAA0B,IAAI,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAWrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoDG;IACG,+BAA+B,IAAI,OAAO,CAAC,0BAA0B,CAAC;CAqC7E"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GSwapAssetService - User Asset and Token Discovery
|
|
3
|
+
*
|
|
4
|
+
* Provides asset and token query operations:
|
|
5
|
+
* - User asset queries (getUserAssets, getAllUserAssets)
|
|
6
|
+
* - Token discovery (fetchAvailableDexTokens, fetchAllAvailableDexTokens)
|
|
7
|
+
*
|
|
8
|
+
* This service handles user portfolio queries and DEX token discovery.
|
|
9
|
+
*/
|
|
10
|
+
import type { AxiosInstance } from 'axios';
|
|
11
|
+
import { LoggerBase } from './BaseService';
|
|
12
|
+
import type { UserAsset, DexToken, FetchAvailableDexTokensOptions, AvailableDexTokensResult } from '../types/gswap.dto';
|
|
13
|
+
/**
|
|
14
|
+
* Configuration for GSwapAssetService
|
|
15
|
+
*/
|
|
16
|
+
export interface GSwapAssetServiceConfig {
|
|
17
|
+
dexBackendBaseUrl: string;
|
|
18
|
+
dexBackendHttp?: AxiosInstance;
|
|
19
|
+
debugMode?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Asset and token query operations for GSwap DEX
|
|
23
|
+
*
|
|
24
|
+
* @since 5.15.0
|
|
25
|
+
*/
|
|
26
|
+
export declare class GSwapAssetService extends LoggerBase {
|
|
27
|
+
private dexBackendBaseUrl;
|
|
28
|
+
private dexBackendHttp;
|
|
29
|
+
constructor(config: GSwapAssetServiceConfig);
|
|
30
|
+
/**
|
|
31
|
+
* Parse token string to TokenClassKey with flexible format handling
|
|
32
|
+
* Handles plain symbols (GALA), pipe-delimited (GALA|Unit|none|none), etc.
|
|
33
|
+
*/
|
|
34
|
+
private parseTokenFlexible;
|
|
35
|
+
/**
|
|
36
|
+
* Transform raw token from API response to DexToken
|
|
37
|
+
*/
|
|
38
|
+
private transformRawTokenToDexToken;
|
|
39
|
+
/**
|
|
40
|
+
* Transform raw token from API response to UserAsset
|
|
41
|
+
*/
|
|
42
|
+
private transformRawTokenToUserAsset;
|
|
43
|
+
/**
|
|
44
|
+
* Get user's DEX token assets (paginated)
|
|
45
|
+
*
|
|
46
|
+
* @param walletAddress User wallet address
|
|
47
|
+
* @param limit Max results per page (default 20)
|
|
48
|
+
* @param page Page number (1-based, default 1)
|
|
49
|
+
* @returns User assets with balances
|
|
50
|
+
*/
|
|
51
|
+
getUserAssets(walletAddress: string, limit?: number, page?: number): Promise<{
|
|
52
|
+
assets: UserAsset[];
|
|
53
|
+
count: number;
|
|
54
|
+
page: number;
|
|
55
|
+
limit: number;
|
|
56
|
+
hasMore: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Get all user's DEX token assets (auto-paginated)
|
|
60
|
+
*
|
|
61
|
+
* @param walletAddress User wallet address
|
|
62
|
+
* @returns All user assets with balances
|
|
63
|
+
*/
|
|
64
|
+
getAllUserAssets(walletAddress: string): Promise<UserAsset[]>;
|
|
65
|
+
/**
|
|
66
|
+
* Fetch available DEX tokens (paginated)
|
|
67
|
+
*
|
|
68
|
+
* @param options Query options (search, limit, page)
|
|
69
|
+
* @returns Available tokens with pagination info
|
|
70
|
+
*/
|
|
71
|
+
fetchAvailableDexTokens(options?: FetchAvailableDexTokensOptions): Promise<AvailableDexTokensResult>;
|
|
72
|
+
/**
|
|
73
|
+
* Fetch all available DEX tokens (auto-paginated)
|
|
74
|
+
*
|
|
75
|
+
* @param options Query options (search only, no pagination)
|
|
76
|
+
* @returns All available tokens
|
|
77
|
+
*/
|
|
78
|
+
fetchAllAvailableDexTokens(options?: Omit<FetchAvailableDexTokensOptions, 'page' | 'limit'>): Promise<DexToken[]>;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=GSwapAssetService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GSwapAssetService.d.ts","sourceRoot":"","sources":["../../../src/services/GSwapAssetService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAS3C,OAAO,KAAK,EACV,SAAS,EACT,QAAQ,EACR,8BAA8B,EAC9B,wBAAwB,EACzB,MAAM,oBAAoB,CAAC;AAsB5B;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,UAAU;IAC/C,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,cAAc,CAAgB;gBAE1B,MAAM,EAAE,uBAAuB;IAY3C;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAiBnC;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAgCpC;;;;;;;OAOG;IACG,aAAa,CACjB,aAAa,EAAE,MAAM,EACrB,KAAK,GAAE,MAAW,EAClB,IAAI,GAAE,MAAU,GACf,OAAO,CAAC;QACT,MAAM,EAAE,SAAS,EAAE,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IAsCF;;;;;OAKG;IACG,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAmCnE;;;;;OAKG;IACG,uBAAuB,CAC3B,OAAO,GAAE,8BAAmC,GAC3C,OAAO,CAAC,wBAAwB,CAAC;IAsCpC;;;;;OAKG;IACG,0BAA0B,CAC9B,OAAO,GAAE,IAAI,CAAC,8BAA8B,EAAE,MAAM,GAAG,OAAO,CAAM,GACnE,OAAO,CAAC,QAAQ,EAAE,CAAC;CAqCvB"}
|