@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.
- package/CHANGELOG.md +837 -0
- package/EXAMPLES.md +95 -681
- package/MIGRATING-TO-9.0.md +343 -0
- package/README.md +46 -17
- package/dist/LaunchpadSDK.d.ts +536 -616
- package/dist/LaunchpadSDK.d.ts.map +1 -1
- package/dist/api/LaunchpadAPI.d.ts +6 -176
- package/dist/api/LaunchpadAPI.d.ts.map +1 -1
- package/dist/auth/SessionAuthService.d.ts +32 -2
- package/dist/auth/SessionAuthService.d.ts.map +1 -1
- package/dist/auth/SignatureAuth.d.ts +2 -2
- package/dist/auth/SignatureAuth.d.ts.map +1 -1
- package/dist/auth/session.d.ts +59 -0
- package/dist/auth/session.d.ts.map +1 -0
- package/dist/auth/types.d.ts +7 -2
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/config/environments.d.ts +7 -2
- package/dist/config/environments.d.ts.map +1 -1
- package/dist/constants/decimals.d.ts +0 -23
- package/dist/constants/decimals.d.ts.map +1 -1
- package/dist/constants/endpoints.d.ts +19 -8
- package/dist/constants/endpoints.d.ts.map +1 -1
- package/dist/constants/enums.d.ts +19 -0
- package/dist/constants/enums.d.ts.map +1 -1
- package/dist/constants/version.generated.d.ts +1 -1
- package/dist/constants/version.generated.d.ts.map +1 -1
- package/dist/errors/LaunchpadSDKError.d.ts +18 -0
- package/dist/errors/LaunchpadSDKError.d.ts.map +1 -1
- package/dist/helpers/sdk.d.ts.map +1 -1
- package/dist/index.browser.d.ts +40 -45
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.esm.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.node.d.ts +4 -5
- package/dist/index.node.d.ts.map +1 -1
- package/dist/launchpad/bundle-submission.d.ts +57 -10
- package/dist/launchpad/bundle-submission.d.ts.map +1 -1
- package/dist/launchpad/create-sale-validation.d.ts +19 -0
- package/dist/launchpad/create-sale-validation.d.ts.map +1 -0
- package/dist/launchpad/transport.d.ts +33 -2
- package/dist/launchpad/transport.d.ts.map +1 -1
- package/dist/launchpad/writes.d.ts +37 -11
- package/dist/launchpad/writes.d.ts.map +1 -1
- package/dist/native.cjs +1 -1
- package/dist/native.d.ts +4 -5
- package/dist/native.d.ts.map +1 -1
- package/dist/native.esm.js +1 -1
- package/dist/schemas/launchpad.d.ts +3 -2
- package/dist/schemas/launchpad.d.ts.map +1 -1
- package/dist/schemas/primitives.d.ts +12 -2
- package/dist/schemas/primitives.d.ts.map +1 -1
- package/dist/schemas/user.d.ts +3 -18
- package/dist/schemas/user.d.ts.map +1 -1
- package/dist/schemas/validators.d.ts +3 -3
- package/dist/services/AbstractCacheService.d.ts +2 -2
- package/dist/services/ApiKeyService.d.ts +1 -1
- package/dist/services/BanService.d.ts +1 -1
- package/dist/services/ChartService.d.ts.map +1 -1
- package/dist/services/ContentReactionService.d.ts +6 -18
- package/dist/services/ContentReactionService.d.ts.map +1 -1
- package/dist/services/EventsQueryService.d.ts +47 -0
- package/dist/services/EventsQueryService.d.ts.map +1 -0
- package/dist/services/GalaChainBalanceService.d.ts +17 -89
- package/dist/services/GalaChainBalanceService.d.ts.map +1 -1
- package/dist/services/GalaChainLockService.d.ts +19 -20
- package/dist/services/GalaChainLockService.d.ts.map +1 -1
- package/dist/services/GalaChainService.d.ts +28 -15
- package/dist/services/GalaChainService.d.ts.map +1 -1
- package/dist/services/GalaChainTokenService.d.ts +25 -53
- package/dist/services/GalaChainTokenService.d.ts.map +1 -1
- package/dist/services/GalaChainTransferService.d.ts +42 -41
- package/dist/services/GalaChainTransferService.d.ts.map +1 -1
- package/dist/services/HealthService.d.ts +33 -0
- package/dist/services/HealthService.d.ts.map +1 -0
- package/dist/services/ImageService.d.ts +3 -3
- package/dist/services/ImageService.d.ts.map +1 -1
- package/dist/services/LaunchpadPriceService.d.ts +66 -0
- package/dist/services/LaunchpadPriceService.d.ts.map +1 -0
- package/dist/services/LaunchpadService.d.ts +34 -42
- package/dist/services/LaunchpadService.d.ts.map +1 -1
- package/dist/services/MessagesService.d.ts +12 -44
- package/dist/services/MessagesService.d.ts.map +1 -1
- package/dist/services/ModeratorService.d.ts +2 -2
- package/dist/services/ModeratorService.d.ts.map +1 -1
- package/dist/services/NftCollectionService.d.ts +22 -6
- package/dist/services/NftCollectionService.d.ts.map +1 -1
- package/dist/services/OverseerService.d.ts +3 -3
- package/dist/services/OverseerService.d.ts.map +1 -1
- package/dist/services/PlatformStatsService.d.ts +1 -2
- package/dist/services/PlatformStatsService.d.ts.map +1 -1
- package/dist/services/PoolService.d.ts +28 -65
- package/dist/services/PoolService.d.ts.map +1 -1
- package/dist/services/RestrictedNamesService.d.ts +1 -1
- package/dist/services/RestrictedNamesService.d.ts.map +1 -1
- package/dist/services/StreamChatService.d.ts +8 -19
- package/dist/services/StreamChatService.d.ts.map +1 -1
- package/dist/services/StreamTokenServiceBase.d.ts +2 -1
- package/dist/services/StreamTokenServiceBase.d.ts.map +1 -1
- package/dist/services/StreamWebSocketService.d.ts +423 -451
- package/dist/services/StreamWebSocketService.d.ts.map +1 -1
- package/dist/services/StreamingService.d.ts +14 -15
- package/dist/services/StreamingService.d.ts.map +1 -1
- package/dist/services/TokenBanService.d.ts +1 -1
- package/dist/services/TokenResolverService.d.ts +5 -5
- package/dist/services/TokenResolverService.d.ts.map +1 -1
- package/dist/services/TradeService.d.ts +13 -9
- package/dist/services/TradeService.d.ts.map +1 -1
- package/dist/services/TradingQuotesService.d.ts.map +1 -1
- package/dist/services/UserService.d.ts +64 -20
- package/dist/services/UserService.d.ts.map +1 -1
- package/dist/services/gateway-transport.d.ts +32 -0
- package/dist/services/gateway-transport.d.ts.map +1 -0
- package/dist/services/gateway-writes.d.ts +83 -0
- package/dist/services/gateway-writes.d.ts.map +1 -0
- package/dist/services/realtime/event-catalog.d.ts +456 -0
- package/dist/services/realtime/event-catalog.d.ts.map +1 -0
- package/dist/services/shared/pagination-helpers.d.ts +22 -5
- package/dist/services/shared/pagination-helpers.d.ts.map +1 -1
- package/dist/services/shared/service-validators.d.ts.map +1 -1
- package/dist/signing/index.d.ts +2 -3
- package/dist/signing/index.d.ts.map +1 -1
- package/dist/signing/signers.d.ts +64 -9
- package/dist/signing/signers.d.ts.map +1 -1
- package/dist/signing/types.d.ts +7 -10
- package/dist/signing/types.d.ts.map +1 -1
- package/dist/types/api-key.dto.d.ts +1 -1
- package/dist/types/ban.dto.d.ts +21 -16
- package/dist/types/ban.dto.d.ts.map +1 -1
- package/dist/types/burn.dto.d.ts +4 -2
- package/dist/types/burn.dto.d.ts.map +1 -1
- package/dist/types/chat-messages.dto.d.ts +10 -72
- package/dist/types/chat-messages.dto.d.ts.map +1 -1
- package/dist/types/comments.dto.d.ts +8 -78
- package/dist/types/comments.dto.d.ts.map +1 -1
- package/dist/types/common.d.ts +42 -85
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/constraints.d.ts +47 -23
- package/dist/types/constraints.d.ts.map +1 -1
- package/dist/types/content-flag.dto.d.ts +5 -1
- package/dist/types/content-flag.dto.d.ts.map +1 -1
- package/dist/types/content-reactions.dto.d.ts +0 -4
- package/dist/types/content-reactions.dto.d.ts.map +1 -1
- package/dist/types/dto.d.ts +0 -5
- package/dist/types/dto.d.ts.map +1 -1
- package/dist/types/engagement-stats.dto.d.ts +16 -27
- package/dist/types/engagement-stats.dto.d.ts.map +1 -1
- package/dist/types/events.dto.d.ts +89 -0
- package/dist/types/events.dto.d.ts.map +1 -1
- package/dist/types/global-feed.dto.d.ts +23 -164
- package/dist/types/global-feed.dto.d.ts.map +1 -1
- package/dist/types/health.dto.d.ts +32 -0
- package/dist/types/health.dto.d.ts.map +1 -0
- package/dist/types/launchpad.dto.d.ts +77 -323
- package/dist/types/launchpad.dto.d.ts.map +1 -1
- package/dist/types/lock.dto.d.ts +12 -7
- package/dist/types/lock.dto.d.ts.map +1 -1
- package/dist/types/messages.dto.d.ts +168 -118
- package/dist/types/messages.dto.d.ts.map +1 -1
- package/dist/types/moderator.dto.d.ts +1 -1
- package/dist/types/options.dto.d.ts +8 -36
- package/dist/types/options.dto.d.ts.map +1 -1
- package/dist/types/overseer.dto.d.ts +2 -1
- package/dist/types/overseer.dto.d.ts.map +1 -1
- package/dist/types/platform-stats.dto.d.ts +3 -3
- package/dist/types/realtime-events.dto.d.ts +340 -0
- package/dist/types/realtime-events.dto.d.ts.map +1 -0
- package/dist/types/restricted-names.dto.d.ts +2 -2
- package/dist/types/restricted-names.dto.d.ts.map +1 -1
- package/dist/types/stream-chat.dto.d.ts +15 -14
- package/dist/types/stream-chat.dto.d.ts.map +1 -1
- package/dist/types/streaming.dto.d.ts +73 -104
- package/dist/types/streaming.dto.d.ts.map +1 -1
- package/dist/types/token-ban.dto.d.ts.map +1 -1
- package/dist/types/token-config.dto.d.ts +34 -19
- package/dist/types/token-config.dto.d.ts.map +1 -1
- package/dist/types/trades-query.dto.d.ts +8 -24
- package/dist/types/trades-query.dto.d.ts.map +1 -1
- package/dist/types/user.dto.d.ts +133 -112
- package/dist/types/user.dto.d.ts.map +1 -1
- package/dist/types/websocket-events.dto.d.ts +5 -5
- package/dist/types/websocket-events.dto.d.ts.map +1 -1
- package/dist/utils/address-formatter.d.ts +25 -2
- package/dist/utils/address-formatter.d.ts.map +1 -1
- package/dist/utils/agent-config.d.ts +9 -4
- package/dist/utils/agent-config.d.ts.map +1 -1
- package/dist/utils/auto-pagination.d.ts +7 -240
- package/dist/utils/auto-pagination.d.ts.map +1 -1
- package/dist/utils/bignumber-helpers.d.ts +3 -2
- package/dist/utils/bignumber-helpers.d.ts.map +1 -1
- package/dist/utils/delimiter-parser.d.ts +0 -13
- package/dist/utils/delimiter-parser.d.ts.map +1 -1
- package/dist/utils/error-factories.d.ts +4 -3
- package/dist/utils/error-factories.d.ts.map +1 -1
- package/dist/utils/error-patterns.d.ts +0 -47
- package/dist/utils/error-patterns.d.ts.map +1 -1
- package/dist/utils/error-wrapper.d.ts +5 -5
- package/dist/utils/errors.d.ts +53 -318
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/http.d.ts +36 -3
- package/dist/utils/http.d.ts.map +1 -1
- package/dist/utils/message-validators.d.ts.map +1 -1
- package/dist/utils/pagination-helpers.d.ts +17 -0
- package/dist/utils/pagination-helpers.d.ts.map +1 -1
- package/dist/utils/pagination-validation.d.ts +2 -2
- package/dist/utils/response-handlers.d.ts.map +1 -1
- package/dist/utils/service-validators.d.ts +6 -6
- package/dist/utils/service-validators.d.ts.map +1 -1
- package/dist/utils/token-format-converter.d.ts +1 -1
- package/dist/utils/token-parser.d.ts +6 -127
- package/dist/utils/token-parser.d.ts.map +1 -1
- package/dist/utils/token-stringification.d.ts +7 -7
- package/dist/utils/token-stringification.d.ts.map +1 -1
- package/dist/utils/tokenNameNormalizer.d.ts +2 -2
- package/dist/utils/tokenNormalizer.d.ts +5 -29
- package/dist/utils/tokenNormalizer.d.ts.map +1 -1
- package/dist/utils/unique-key-generator.d.ts +7 -134
- package/dist/utils/unique-key-generator.d.ts.map +1 -1
- package/dist/utils/validation-helpers.d.ts +21 -64
- package/dist/utils/validation-helpers.d.ts.map +1 -1
- package/dist/utils/validation.d.ts +4 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/package.json +47 -87
- package/dist/api/dto/BurnTokensDto.d.ts +0 -77
- package/dist/api/dto/BurnTokensDto.d.ts.map +0 -1
- package/dist/api/dto/LockTokenDto.d.ts +0 -85
- package/dist/api/dto/LockTokenDto.d.ts.map +0 -1
- package/dist/api/dto/TransferTokenDto.d.ts +0 -64
- package/dist/api/dto/TransferTokenDto.d.ts.map +0 -1
- package/dist/api/dto/UnlockTokenDto.d.ts +0 -74
- package/dist/api/dto/UnlockTokenDto.d.ts.map +0 -1
- package/dist/bridge/BridgeService.d.ts +0 -484
- package/dist/bridge/BridgeService.d.ts.map +0 -1
- package/dist/bridge/GalaConnectClient.d.ts +0 -170
- package/dist/bridge/GalaConnectClient.d.ts.map +0 -1
- package/dist/bridge/constants/index.d.ts +0 -7
- package/dist/bridge/constants/index.d.ts.map +0 -1
- package/dist/bridge/constants/tokens.d.ts +0 -212
- package/dist/bridge/constants/tokens.d.ts.map +0 -1
- package/dist/bridge/index.d.ts +0 -24
- package/dist/bridge/index.d.ts.map +0 -1
- package/dist/bridge/public-types.d.ts +0 -2
- package/dist/bridge/public-types.d.ts.map +0 -1
- package/dist/bridge/strategies/BridgeStrategy.d.ts +0 -204
- package/dist/bridge/strategies/BridgeStrategy.d.ts.map +0 -1
- package/dist/bridge/strategies/EthereumBridgeStrategy.d.ts +0 -178
- package/dist/bridge/strategies/EthereumBridgeStrategy.d.ts.map +0 -1
- package/dist/bridge/strategies/SolanaBridgeStrategy.d.ts +0 -236
- package/dist/bridge/strategies/SolanaBridgeStrategy.d.ts.map +0 -1
- package/dist/bridge/types/bridge.dto.d.ts +0 -772
- package/dist/bridge/types/bridge.dto.d.ts.map +0 -1
- package/dist/bridge/types/bridgeable-token.dto.d.ts +0 -209
- package/dist/bridge/types/bridgeable-token.dto.d.ts.map +0 -1
- package/dist/bridge/types/eip712.d.ts +0 -66
- package/dist/bridge/types/eip712.d.ts.map +0 -1
- package/dist/bridge/types/index.d.ts +0 -8
- package/dist/bridge/types/index.d.ts.map +0 -1
- package/dist/bridge/utils/RateLimiter.d.ts +0 -34
- package/dist/bridge/utils/RateLimiter.d.ts.map +0 -1
- package/dist/bridge/utils/address-formatter.d.ts +0 -25
- package/dist/bridge/utils/address-formatter.d.ts.map +0 -1
- package/dist/bridge/utils/addressValidation.d.ts +0 -200
- package/dist/bridge/utils/addressValidation.d.ts.map +0 -1
- package/dist/bridge/utils/balanceHelpers.d.ts +0 -215
- package/dist/bridge/utils/balanceHelpers.d.ts.map +0 -1
- package/dist/bridge/utils/bridgeErrors.d.ts +0 -98
- package/dist/bridge/utils/bridgeErrors.d.ts.map +0 -1
- package/dist/bridge/utils/bridgeOutHelpers.d.ts +0 -68
- package/dist/bridge/utils/bridgeOutHelpers.d.ts.map +0 -1
- package/dist/bridge/utils/bridgePayload.d.ts +0 -98
- package/dist/bridge/utils/bridgePayload.d.ts.map +0 -1
- package/dist/bridge/utils/bridgeStatusParser.d.ts +0 -76
- package/dist/bridge/utils/bridgeStatusParser.d.ts.map +0 -1
- package/dist/bridge/utils/eip712Helpers.d.ts +0 -66
- package/dist/bridge/utils/eip712Helpers.d.ts.map +0 -1
- package/dist/bridge/utils/index.d.ts +0 -19
- package/dist/bridge/utils/index.d.ts.map +0 -1
- package/dist/bridge/utils/retry.d.ts +0 -112
- package/dist/bridge/utils/retry.d.ts.map +0 -1
- package/dist/bridge/utils/strategyDelegation.d.ts +0 -126
- package/dist/bridge/utils/strategyDelegation.d.ts.map +0 -1
- package/dist/bridge/utils/tokenIdUtils.d.ts +0 -86
- package/dist/bridge/utils/tokenIdUtils.d.ts.map +0 -1
- package/dist/bridge/utils/tokenMath.d.ts +0 -39
- package/dist/bridge/utils/tokenMath.d.ts.map +0 -1
- package/dist/bridge/utils/tokenMetadataResolver.d.ts +0 -97
- package/dist/bridge/utils/tokenMetadataResolver.d.ts.map +0 -1
- package/dist/helpers/wallet.d.ts +0 -151
- package/dist/helpers/wallet.d.ts.map +0 -1
- package/dist/react/WalletContext.d.ts +0 -60
- package/dist/react/WalletContext.d.ts.map +0 -1
- package/dist/react/index.d.ts +0 -65
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/types.d.ts +0 -76
- package/dist/react/types.d.ts.map +0 -1
- package/dist/react/useWallet.d.ts +0 -123
- package/dist/react/useWallet.d.ts.map +0 -1
- package/dist/react/useWalletConnection.d.ts +0 -89
- package/dist/react/useWalletConnection.d.ts.map +0 -1
- package/dist/react/useWalletDetection.d.ts +0 -81
- package/dist/react/useWalletDetection.d.ts.map +0 -1
- package/dist/react.cjs +0 -1
- package/dist/react.esm.js +0 -1
- package/dist/services/AbstractTokenFetchService.d.ts +0 -150
- package/dist/services/AbstractTokenFetchService.d.ts.map +0 -1
- package/dist/services/BatchedCacheService.d.ts +0 -133
- package/dist/services/BatchedCacheService.d.ts.map +0 -1
- package/dist/services/BridgeableTokenCache.d.ts +0 -120
- package/dist/services/BridgeableTokenCache.d.ts.map +0 -1
- package/dist/services/BridgeableTokenService.d.ts +0 -218
- package/dist/services/BridgeableTokenService.d.ts.map +0 -1
- package/dist/services/DexService.d.ts +0 -440
- package/dist/services/DexService.d.ts.map +0 -1
- package/dist/services/NetworkKeyedCacheService.d.ts +0 -185
- package/dist/services/NetworkKeyedCacheService.d.ts.map +0 -1
- package/dist/services/PriceHistoryService.d.ts +0 -209
- package/dist/services/PriceHistoryService.d.ts.map +0 -1
- package/dist/services/StreamingEventService.d.ts +0 -441
- package/dist/services/StreamingEventService.d.ts.map +0 -1
- package/dist/services/WrapService.d.ts +0 -171
- package/dist/services/WrapService.d.ts.map +0 -1
- package/dist/services/WrappableTokenCache.d.ts +0 -100
- package/dist/services/WrappableTokenCache.d.ts.map +0 -1
- package/dist/services/WrappableTokenService.d.ts +0 -130
- package/dist/services/WrappableTokenService.d.ts.map +0 -1
- package/dist/setup.d.ts +0 -8
- package/dist/setup.d.ts.map +0 -1
- package/dist/tokens/transfers.d.ts +0 -95
- package/dist/tokens/transfers.d.ts.map +0 -1
- package/dist/types/comment.dto.d.ts +0 -176
- package/dist/types/comment.dto.d.ts.map +0 -1
- package/dist/types/galachain-api.types.d.ts +0 -297
- package/dist/types/galachain-api.types.d.ts.map +0 -1
- package/dist/types/priceHistory.dto.d.ts +0 -134
- package/dist/types/priceHistory.dto.d.ts.map +0 -1
- package/dist/types/streaming-events.dto.d.ts +0 -605
- package/dist/types/streaming-events.dto.d.ts.map +0 -1
- package/dist/types/token.types.d.ts +0 -359
- package/dist/types/token.types.d.ts.map +0 -1
- package/dist/types/wrappable-token.dto.d.ts +0 -305
- package/dist/types/wrappable-token.dto.d.ts.map +0 -1
- package/dist/utils/crypto-compat.d.ts +0 -40
- package/dist/utils/crypto-compat.d.ts.map +0 -1
- package/dist/utils/load-env.d.ts +0 -31
- package/dist/utils/load-env.d.ts.map +0 -1
- package/dist/utils/token-instance-key.d.ts +0 -57
- package/dist/utils/token-instance-key.d.ts.map +0 -1
- package/dist/utils/wallet.d.ts +0 -166
- package/dist/utils/wallet.d.ts.map +0 -1
- package/dist/wallet/ExternalWalletProvider.d.ts +0 -90
- package/dist/wallet/ExternalWalletProvider.d.ts.map +0 -1
- package/dist/wallet/GalaWalletProvider.d.ts +0 -122
- package/dist/wallet/GalaWalletProvider.d.ts.map +0 -1
- package/dist/wallet/PrivateKeyProvider.d.ts +0 -90
- package/dist/wallet/PrivateKeyProvider.d.ts.map +0 -1
- package/dist/wallet/detection.d.ts +0 -107
- package/dist/wallet/detection.d.ts.map +0 -1
- package/dist/wallet/event-handlers.d.ts +0 -50
- package/dist/wallet/event-handlers.d.ts.map +0 -1
- package/dist/wallet/index.d.ts +0 -51
- package/dist/wallet/index.d.ts.map +0 -1
- package/dist/wallet/signing-operation.d.ts +0 -19
- package/dist/wallet/signing-operation.d.ts.map +0 -1
- package/dist/wallet/typed-data-helpers.d.ts +0 -68
- package/dist/wallet/typed-data-helpers.d.ts.map +0 -1
- package/dist/wallet/types.d.ts +0 -267
- package/dist/wallet/types.d.ts.map +0 -1
- package/dist/wallet/utils.d.ts +0 -117
- package/dist/wallet/utils.d.ts.map +0 -1
- package/dist/wallet.cjs +0 -1
- package/dist/wallet.esm.js +0 -1
|
@@ -29,8 +29,7 @@
|
|
|
29
29
|
* collection: "GALA",
|
|
30
30
|
* category: "Unit",
|
|
31
31
|
* additionalKey: "none",
|
|
32
|
-
* type: "none"
|
|
33
|
-
* instance: "0"
|
|
32
|
+
* type: "none"
|
|
34
33
|
* });
|
|
35
34
|
*
|
|
36
35
|
* // Transfer tokens
|
|
@@ -43,18 +42,18 @@
|
|
|
43
42
|
* });
|
|
44
43
|
* ```
|
|
45
44
|
*/
|
|
46
|
-
import type
|
|
45
|
+
import { type GalaChainTokenClass, type GalaChainTokenClassKey, type GalaChainTokenDetails } from '@gala-chain/gala-core-sdk';
|
|
47
46
|
import type { AxiosInstance } from 'axios';
|
|
48
47
|
import type { Wallet } from 'ethers';
|
|
49
48
|
import type { BurnTokensData, BurnTokensResult } from '../types/burn.dto';
|
|
50
|
-
import type {
|
|
51
|
-
import type { TokenClassWithSupply } from '../types/launchpad.dto';
|
|
49
|
+
import type { TokenId } from '../types/common';
|
|
52
50
|
import type { LockTokensData, LockTokensResult, UnlockTokensData, UnlockTokensResult } from '../types/lock.dto';
|
|
53
51
|
import type { GalaChainTransferReceipt, TransferGalaData, TransferTokenData } from '../types/transfer.dto';
|
|
54
52
|
import type { TokenBalanceResult } from '../types/user.dto';
|
|
55
53
|
import type { HttpClient } from '../utils/http';
|
|
56
54
|
import { BaseService } from './BaseService';
|
|
57
55
|
import type { BalanceQueryParams } from './GalaChainBalanceService';
|
|
56
|
+
import type { GatewayWriter } from './gateway-writes';
|
|
58
57
|
import type { TokenResolverService } from './TokenResolverService';
|
|
59
58
|
/**
|
|
60
59
|
* GalaChain Service for blockchain operations (Facade Pattern)
|
|
@@ -75,8 +74,9 @@ export declare class GalaChainService extends BaseService {
|
|
|
75
74
|
* @param tokenResolver - Token resolver service for vault address resolution
|
|
76
75
|
* @param debug - Enable debug logging (default: false)
|
|
77
76
|
* @param publicAxios - Unauthenticated axios instance for public token queries
|
|
77
|
+
* @param writer - For an SDK with no wallet: the signer and declared identity of its token writes
|
|
78
78
|
*/
|
|
79
|
-
constructor(http: HttpClient, wallet: Wallet | undefined, tokenResolver: TokenResolverService, debug?: boolean, publicAxios?: AxiosInstance);
|
|
79
|
+
constructor(http: HttpClient, wallet: Wallet | undefined, tokenResolver: TokenResolverService, debug?: boolean, publicAxios?: AxiosInstance, writer?: GatewayWriter);
|
|
80
80
|
/**
|
|
81
81
|
* Fetches GALA balance for a user from GalaChain
|
|
82
82
|
*
|
|
@@ -93,8 +93,7 @@ export declare class GalaChainService extends BaseService {
|
|
|
93
93
|
* collection: "GALA",
|
|
94
94
|
* category: "Unit",
|
|
95
95
|
* additionalKey: "none",
|
|
96
|
-
* type: "none"
|
|
97
|
-
* instance: "0"
|
|
96
|
+
* type: "none"
|
|
98
97
|
* });
|
|
99
98
|
* ```
|
|
100
99
|
*/
|
|
@@ -117,8 +116,7 @@ export declare class GalaChainService extends BaseService {
|
|
|
117
116
|
* collection: "ANIME",
|
|
118
117
|
* category: "Unit",
|
|
119
118
|
* additionalKey: "none",
|
|
120
|
-
* type: "none"
|
|
121
|
-
* instance: "0"
|
|
119
|
+
* type: "none"
|
|
122
120
|
* });
|
|
123
121
|
*
|
|
124
122
|
* // Check lock details
|
|
@@ -139,7 +137,7 @@ export declare class GalaChainService extends BaseService {
|
|
|
139
137
|
* Supports both native tokens (GALA, etc.) and wrapped DEX tokens.
|
|
140
138
|
*
|
|
141
139
|
* @param tokenId Token identifier (string or TokenClassKey format)
|
|
142
|
-
* @returns Promise<
|
|
140
|
+
* @returns Promise<GalaChainTokenClass> Complete token metadata from GalaChain
|
|
143
141
|
* @throws ValidationError if tokenId validation fails
|
|
144
142
|
* @throws Error if token fetch fails or token not found
|
|
145
143
|
*
|
|
@@ -160,7 +158,22 @@ export declare class GalaChainService extends BaseService {
|
|
|
160
158
|
* console.log(`Symbol: ${gusdc.symbol}`); // "GUSDC"
|
|
161
159
|
* ```
|
|
162
160
|
*/
|
|
163
|
-
fetchTokenClassFromChain(tokenId: string |
|
|
161
|
+
fetchTokenClassFromChain(tokenId: string | GalaChainTokenClassKey): Promise<GalaChainTokenClass>;
|
|
162
|
+
/**
|
|
163
|
+
* A token's details (symbol, decimals, name, image, description, network, contract address) from
|
|
164
|
+
* its GalaChain token class, as gala-core-sdk's `tokenDetailsOf` maps them.
|
|
165
|
+
*
|
|
166
|
+
* @param tokenId Token identifier (pipe string, class key or instance key)
|
|
167
|
+
* @returns The token's details
|
|
168
|
+
* @throws NetworkError if the read fails or the token class is not found
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* const details = await galaChainService.fetchTokenDetails('GUSDC|Unit|none|none');
|
|
173
|
+
* console.log(details.symbol, details.decimals);
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
fetchTokenDetails(tokenId: TokenId): Promise<GalaChainTokenDetails>;
|
|
164
177
|
/**
|
|
165
178
|
* Fetch supply information for one or more token classes from GalaChain
|
|
166
179
|
*
|
|
@@ -171,7 +184,7 @@ export declare class GalaChainService extends BaseService {
|
|
|
171
184
|
* - Token metadata (symbol, decimals, name)
|
|
172
185
|
*
|
|
173
186
|
* @param tokenClasses - Array of token class keys to query
|
|
174
|
-
* @returns Promise<
|
|
187
|
+
* @returns Promise<GalaChainTokenClass[]> Array of token classes with supply information
|
|
175
188
|
* @throws {ValidationError} if tokenClasses array is empty
|
|
176
189
|
* @throws {Error} if network request fails or GalaChain returns error status
|
|
177
190
|
*
|
|
@@ -185,7 +198,7 @@ export declare class GalaChainService extends BaseService {
|
|
|
185
198
|
* console.log(`${supplies[0].symbol}: ${supplies[0].totalSupply}`);
|
|
186
199
|
* ```
|
|
187
200
|
*/
|
|
188
|
-
fetchTokenClassesWithSupply(tokenClasses:
|
|
201
|
+
fetchTokenClassesWithSupply(tokenClasses: GalaChainTokenClassKey[]): Promise<GalaChainTokenClass[]>;
|
|
189
202
|
/**
|
|
190
203
|
* Transfer GALA tokens between wallets
|
|
191
204
|
*
|
|
@@ -256,7 +269,7 @@ export declare class GalaChainService extends BaseService {
|
|
|
256
269
|
*
|
|
257
270
|
* @throws {TransferError} When token name cannot be resolved
|
|
258
271
|
*/
|
|
259
|
-
resolveTokenClassKey(tokenName: string): Promise<
|
|
272
|
+
resolveTokenClassKey(tokenName: string): Promise<GalaChainTokenClassKey>;
|
|
260
273
|
/**
|
|
261
274
|
* Lock tokens on GalaChain (batch operation)
|
|
262
275
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalaChainService.d.ts","sourceRoot":"","sources":["../../src/services/GalaChainService.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"GalaChainService.d.ts","sourceRoot":"","sources":["../../src/services/GalaChainService.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GalaChain Token Service
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* - Token supply information queries
|
|
10
|
-
* - Support for both native and wrapped tokens
|
|
4
|
+
* Token classes from GalaChain (metadata and supply). The reads themselves (`FetchTokenClasses`,
|
|
5
|
+
* `FetchTokenClassesWithSupply`, the answer's checks) are `@gala-chain/gala-core-sdk`'s
|
|
6
|
+
* `GatewayReads`; this service keeps launchpad's token-id spellings, results and error contract on
|
|
7
|
+
* top of it, and sends the reads through the SDK's unauthenticated gateway axios instance exactly
|
|
8
|
+
* as before.
|
|
11
9
|
*
|
|
12
10
|
* @example
|
|
13
11
|
* ```typescript
|
|
14
12
|
* const tokenService = new GalaChainTokenService(http, debug, publicAxios);
|
|
15
13
|
*
|
|
16
|
-
* // Fetch native GALA token metadata
|
|
17
14
|
* const gala = await tokenService.fetchTokenClassFromChain('GALA|Unit|none|none');
|
|
18
15
|
* console.log(`Symbol: ${gala.symbol}`); // "GALA"
|
|
19
16
|
*
|
|
20
|
-
* // Fetch token supply information
|
|
21
17
|
* const supplies = await tokenService.fetchTokenClassesWithSupply([
|
|
22
18
|
* { collection: 'GALA', category: 'Unit', type: 'none', additionalKey: 'none' }
|
|
23
19
|
* ]);
|
|
@@ -26,10 +22,8 @@
|
|
|
26
22
|
* @category Services
|
|
27
23
|
* @since 5.15.0
|
|
28
24
|
*/
|
|
29
|
-
import type
|
|
25
|
+
import { type GalaChainTokenClass, type GalaChainTokenClassKey } from '@gala-chain/gala-core-sdk';
|
|
30
26
|
import type { AxiosInstance } from 'axios';
|
|
31
|
-
import type { TokenClassKey } from '../types/common';
|
|
32
|
-
import type { TokenClassWithSupply } from '../types/launchpad.dto';
|
|
33
27
|
import type { HttpClient } from '../utils/http';
|
|
34
28
|
import { BaseService } from './BaseService';
|
|
35
29
|
/**
|
|
@@ -48,62 +42,40 @@ export declare class GalaChainTokenService extends BaseService {
|
|
|
48
42
|
*/
|
|
49
43
|
constructor(http: HttpClient, debug?: boolean, publicAxios?: AxiosInstance | undefined);
|
|
50
44
|
/**
|
|
51
|
-
* Fetch token
|
|
52
|
-
*
|
|
53
|
-
* Queries the authoritative GalaChain token registry for complete token metadata
|
|
54
|
-
* including symbol, decimals, name, image, and description. This is the source
|
|
55
|
-
* of truth for all tokens on GalaChain (both native and wrapped).
|
|
56
|
-
*
|
|
57
|
-
* Supports both native tokens (GALA, etc.) and wrapped DEX tokens.
|
|
45
|
+
* Fetch a token class from GalaChain (`FetchTokenClasses`): the authoritative registry of every
|
|
46
|
+
* token (native and wrapped), with its symbol, decimals, name, image and description.
|
|
58
47
|
*
|
|
59
|
-
* @param tokenId Token identifier (string or TokenClassKey
|
|
60
|
-
* @returns Promise<
|
|
48
|
+
* @param tokenId Token identifier (pipe string, 4 or 5 parts, or TokenClassKey object)
|
|
49
|
+
* @returns Promise<GalaChainTokenClass> The token class
|
|
61
50
|
* @throws ValidationError if tokenId validation fails
|
|
62
|
-
* @throws
|
|
51
|
+
* @throws NetworkError if the token is not found (404) or the fetch fails
|
|
63
52
|
*
|
|
64
53
|
* @example
|
|
65
54
|
* ```typescript
|
|
66
|
-
* // Fetch native GALA token metadata
|
|
67
55
|
* const gala = await tokenService.fetchTokenClassFromChain('GALA|Unit|none|none');
|
|
68
56
|
* console.log(`Symbol: ${gala.symbol}`); // "GALA"
|
|
69
57
|
* console.log(`Decimals: ${gala.decimals}`); // 8
|
|
70
|
-
*
|
|
71
|
-
* // Fetch wrapped token metadata
|
|
72
|
-
* const gusdc = await tokenService.fetchTokenClassFromChain({
|
|
73
|
-
* collection: 'GUSDC',
|
|
74
|
-
* category: 'Unit',
|
|
75
|
-
* type: 'none',
|
|
76
|
-
* additionalKey: 'none'
|
|
77
|
-
* });
|
|
78
|
-
* console.log(`Symbol: ${gusdc.symbol}`); // "GUSDC"
|
|
79
58
|
* ```
|
|
80
59
|
*/
|
|
81
|
-
fetchTokenClassFromChain(tokenId: string |
|
|
60
|
+
fetchTokenClassFromChain(tokenId: string | GalaChainTokenClassKey): Promise<GalaChainTokenClass>;
|
|
82
61
|
/**
|
|
83
62
|
* Fetch supply information for one or more token classes from GalaChain
|
|
63
|
+
* (`FetchTokenClassesWithSupply`): total and maximum supply, burned amount, known mint supplies
|
|
64
|
+
* and the class metadata, one class per key in the order asked.
|
|
84
65
|
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* - Total burned amount
|
|
88
|
-
* - Mint-related supply metrics
|
|
89
|
-
* - Token metadata (symbol, decimals, name)
|
|
90
|
-
*
|
|
91
|
-
* @param tokenClasses - Array of token class keys to query
|
|
92
|
-
* @returns Promise<TokenClassWithSupply[]> Array of token classes with supply information
|
|
66
|
+
* @param tokenClasses - Array of token class keys to query (1 to 1000)
|
|
67
|
+
* @returns Promise<GalaChainTokenClass[]> The token classes with their supply figures
|
|
93
68
|
* @throws {ValidationError} if tokenClasses array is empty
|
|
94
|
-
* @throws {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* console.log(`${supplies[0].symbol}: ${supplies[0].totalSupply}`);
|
|
104
|
-
* ```
|
|
69
|
+
* @throws {NetworkError} if a class is not found, the request fails or GalaChain refuses it
|
|
70
|
+
*/
|
|
71
|
+
fetchTokenClassesWithSupply(tokenClasses: GalaChainTokenClassKey[]): Promise<GalaChainTokenClass[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Runs a core read through the public gateway axios instance. When core refuses the gateway's
|
|
74
|
+
* 2xx answer, `legacyChecks` re-reads that same answer and throws launchpad's own error for it
|
|
75
|
+
* (the error launchpad has always thrown); should it not, `notFound` (for a missing class) or
|
|
76
|
+
* core's error stands (fail closed: an answer core refused is never returned).
|
|
105
77
|
*/
|
|
106
|
-
|
|
78
|
+
private readPublic;
|
|
107
79
|
private handleTokenServiceError;
|
|
108
80
|
}
|
|
109
81
|
//# sourceMappingURL=GalaChainTokenService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalaChainTokenService.d.ts","sourceRoot":"","sources":["../../src/services/GalaChainTokenService.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"GalaChainTokenService.d.ts","sourceRoot":"","sources":["../../src/services/GalaChainTokenService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAgB5C;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,WAAW;IAWlD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IAV/B;;;;;;OAMG;gBAED,IAAI,EAAE,UAAU,EAChB,KAAK,GAAE,OAAe,EACL,WAAW,CAAC,EAAE,aAAa,YAAA;IAK9C;;;;;;;;;;;;;;;OAeG;IACG,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAsBtG;;;;;;;;;OASG;IACG,2BAA2B,CAC/B,YAAY,EAAE,sBAAsB,EAAE,GACrC,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAoBjC;;;;;OAKG;YACW,UAAU;IAwBxB,OAAO,CAAC,uBAAuB;CAuBhC"}
|
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
* Service responsible for token transfer and burn operations on GalaChain.
|
|
5
5
|
* Extracted from GalaChainService for single responsibility.
|
|
6
6
|
*
|
|
7
|
+
* The writes themselves are `@gala-chain/gala-core-sdk`'s `GatewayWrites` (DTO, signature, the
|
|
8
|
+
* POST and the reading of GalaChain's answer); this service keeps the launchpad API on top of it:
|
|
9
|
+
* its input checks, launchpad token-name resolution, its result shapes and its error classes.
|
|
10
|
+
*
|
|
7
11
|
* Features:
|
|
8
|
-
* - GALA transfers
|
|
12
|
+
* - GALA transfers
|
|
9
13
|
* - Generic token transfers (launchpad and standard tokens)
|
|
10
14
|
* - Token burning (irreversible)
|
|
11
15
|
* - Token class key resolution
|
|
@@ -36,43 +40,28 @@
|
|
|
36
40
|
* @category Services
|
|
37
41
|
* @since 5.15.0
|
|
38
42
|
*/
|
|
39
|
-
import type
|
|
43
|
+
import { type GalaChainTokenClassKey } from '@gala-chain/gala-core-sdk';
|
|
40
44
|
import type { BurnTokensData, BurnTokensResult } from '../types/burn.dto';
|
|
41
|
-
import type { TokenClassKey } from '../types/common';
|
|
42
45
|
import type { GalaChainTransferReceipt, TransferGalaData, TransferTokenData } from '../types/transfer.dto';
|
|
43
|
-
import
|
|
44
|
-
import { BaseService } from './BaseService';
|
|
45
|
-
import type { TokenResolverService } from './TokenResolverService';
|
|
46
|
+
import { GatewayWriteService } from './gateway-writes';
|
|
46
47
|
/**
|
|
47
48
|
* GalaChain Transfer Service
|
|
48
49
|
*
|
|
49
50
|
* Handles all token transfer and burn operations on GalaChain.
|
|
50
51
|
*/
|
|
51
|
-
export declare class GalaChainTransferService extends
|
|
52
|
-
private readonly wallet;
|
|
53
|
-
private readonly tokenResolver;
|
|
54
|
-
private readonly nativeSigner;
|
|
55
|
-
/**
|
|
56
|
-
* Initialize GalaChain Transfer Service
|
|
57
|
-
*
|
|
58
|
-
* @param http - HTTP client configured for GalaChain gateway
|
|
59
|
-
* @param wallet - Ethers wallet for signing transactions (optional for read-only operations)
|
|
60
|
-
* @param tokenResolver - Token resolver service for vault address resolution
|
|
61
|
-
* @param debug - Enable debug logging (default: false)
|
|
62
|
-
*/
|
|
63
|
-
constructor(http: HttpClient, wallet: Wallet | undefined, tokenResolver: TokenResolverService, debug?: boolean);
|
|
52
|
+
export declare class GalaChainTransferService extends GatewayWriteService {
|
|
64
53
|
/**
|
|
65
54
|
* Transfer GALA tokens between wallets
|
|
66
55
|
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
56
|
+
* Signs a TransferToken write for GALA with the wallet's key (native GalaChain signing) and
|
|
57
|
+
* submits it to the GalaChain gateway.
|
|
69
58
|
*
|
|
70
59
|
* @param data - Transfer data including recipient and amount
|
|
71
|
-
* @returns
|
|
60
|
+
* @returns The receipt: the chain transaction id and, when the gateway sends it, the block
|
|
72
61
|
*
|
|
73
62
|
* @example
|
|
74
63
|
* ```typescript
|
|
75
|
-
* const transactionId = await transferService.transferGala({
|
|
64
|
+
* const { transactionId } = await transferService.transferGala({
|
|
76
65
|
* recipientAddress: 'eth|1234567890abcdef1234567890abcdef12345678',
|
|
77
66
|
* amount: '1' // 1 GALA
|
|
78
67
|
* });
|
|
@@ -86,15 +75,15 @@ export declare class GalaChainTransferService extends BaseService {
|
|
|
86
75
|
/**
|
|
87
76
|
* Transfer launchpad tokens between wallets
|
|
88
77
|
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
78
|
+
* Signs a TransferToken write with the wallet's key (native GalaChain signing) and submits it
|
|
79
|
+
* to the GalaChain gateway.
|
|
91
80
|
*
|
|
92
81
|
* @param data - Transfer data including recipient, token name, and amount
|
|
93
|
-
* @returns
|
|
82
|
+
* @returns The receipt: the chain transaction id and, when the gateway sends it, the block
|
|
94
83
|
*
|
|
95
84
|
* @example
|
|
96
85
|
* ```typescript
|
|
97
|
-
* const transactionId = await transferService.transferToken({
|
|
86
|
+
* const { transactionId } = await transferService.transferToken({
|
|
98
87
|
* to: 'eth|9876543210fedcba9876543210fedcba98765432',
|
|
99
88
|
* tokenName: 'tinyevil',
|
|
100
89
|
* amount: '100000000'
|
|
@@ -130,7 +119,7 @@ export declare class GalaChainTransferService extends BaseService {
|
|
|
130
119
|
*
|
|
131
120
|
* @throws {TransferError} When token name cannot be resolved
|
|
132
121
|
*/
|
|
133
|
-
resolveTokenClassKey(tokenName: string): Promise<
|
|
122
|
+
resolveTokenClassKey(tokenName: string): Promise<GalaChainTokenClassKey>;
|
|
134
123
|
/**
|
|
135
124
|
* Permanently burn tokens on GalaChain
|
|
136
125
|
*
|
|
@@ -141,7 +130,7 @@ export declare class GalaChainTransferService extends BaseService {
|
|
|
141
130
|
* Supports batch burning of multiple token types in a single transaction.
|
|
142
131
|
*
|
|
143
132
|
* @param data - Burn data containing tokens array with amounts
|
|
144
|
-
* @returns Result with transaction ID and burned token details
|
|
133
|
+
* @returns Result with transaction ID, block (when the gateway sends it) and burned token details
|
|
145
134
|
* @throws {BurnError} When validation fails or burn operation is rejected
|
|
146
135
|
*
|
|
147
136
|
* @example
|
|
@@ -173,33 +162,45 @@ export declare class GalaChainTransferService extends BaseService {
|
|
|
173
162
|
* Validate burn tokens data
|
|
174
163
|
*/
|
|
175
164
|
private validateBurnTokensData;
|
|
165
|
+
/**
|
|
166
|
+
* The token instance a launchpad input names: `tokenId` (string, class key or instance key)
|
|
167
|
+
* first, else `tokenName` through the launchpad resolver, else `missing()`.
|
|
168
|
+
*/
|
|
169
|
+
private tokenInstanceOf;
|
|
176
170
|
/**
|
|
177
171
|
* Resolve token name to tokenInstance object for transfers
|
|
178
172
|
* Uses TokenResolverService to get vault address, then parses it to extract tokenInstance components
|
|
179
173
|
*/
|
|
180
174
|
private resolveTokenInstance;
|
|
181
175
|
/**
|
|
182
|
-
*
|
|
176
|
+
* The launchpad receipt of a transfer, from the gateway's answer (and core's receipt, when core
|
|
177
|
+
* accepted it). Called with no receipt when core refused the answer: it then throws the error
|
|
178
|
+
* this service has always thrown for that answer.
|
|
183
179
|
*
|
|
184
180
|
* If the body carries GalaChain's `{ Status, Data }` envelope, `Status` is checked FIRST and
|
|
185
|
-
* throws on anything but success (1) -- before
|
|
186
|
-
*
|
|
187
|
-
*
|
|
181
|
+
* throws on anything but success (1) -- before any transaction id is trusted. A gateway proxy can
|
|
182
|
+
* set `x-transaction-id` independent of whether the chain call actually succeeded, so it must
|
|
183
|
+
* never be treated as its own success signal. Checked on `Status` alone, NOT `Status` + `Data`:
|
|
184
|
+
* GalaChain's error envelope (`{ Status, Message, ErrorCode, ErrorKey, ErrorPayload }`) has no
|
|
185
|
+
* `Data`.
|
|
188
186
|
*
|
|
189
187
|
* Priority for transactionId once Status (if present) has passed:
|
|
190
|
-
* 1.
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
188
|
+
* 1. core's: the `x-transaction-id` header (the real chain hash -- use for Chainmeter), else a
|
|
189
|
+
* top-level `transactionId` of the body (legacy)
|
|
190
|
+
* 2. Body.Data[].transactionId / txnId / etc.
|
|
191
|
+
* 3. Operation success stub only if Status:1 with no hash (should be rare)
|
|
194
192
|
*
|
|
195
|
-
* blockNumber from
|
|
193
|
+
* blockNumber from the gateway's `x-block-number` header when present.
|
|
196
194
|
*
|
|
197
195
|
* @private
|
|
198
196
|
*/
|
|
199
197
|
private extractTransferResult;
|
|
200
|
-
/**
|
|
201
|
-
|
|
202
|
-
|
|
198
|
+
/**
|
|
199
|
+
* The launchpad result of a burn, from the gateway's answer (and core's receipt, when core
|
|
200
|
+
* accepted it). Called with no receipt when core refused the answer: it then throws the error
|
|
201
|
+
* this service has always thrown for that answer.
|
|
202
|
+
*/
|
|
203
|
+
private burnResultOf;
|
|
203
204
|
/**
|
|
204
205
|
* Extract burn result from GalaChain response
|
|
205
206
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalaChainTransferService.d.ts","sourceRoot":"","sources":["../../src/services/GalaChainTransferService.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"GalaChainTransferService.d.ts","sourceRoot":"","sources":["../../src/services/GalaChainTransferService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAkE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExI,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAGjB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,KAAK,EACV,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAuB/B,OAAO,EAEL,mBAAmB,EAIpB,MAAM,kBAAkB,CAAC;AA2B1B;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,mBAAmB;IAO/D;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAgC7E;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAqC/E;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IA8B9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAuCjE;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAuBhC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAmDjC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IA6C9B;;;OAGG;YACW,eAAe;IAmB7B;;;OAGG;YACW,oBAAoB;IAyBlC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,CAAC,qBAAqB;IA8E7B;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAqBpB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAwCzB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA2E3B;;OAEG;IACH,OAAO,CAAC,eAAe;CAyCxB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Health Service
|
|
3
|
+
*
|
|
4
|
+
* The launchpad backend's dependency health check.
|
|
5
|
+
*
|
|
6
|
+
* @category Services
|
|
7
|
+
* @since 9.0.0
|
|
8
|
+
*/
|
|
9
|
+
import type { HealthCheckResponse } from '../types/health.dto';
|
|
10
|
+
import { BaseService } from './BaseService';
|
|
11
|
+
/**
|
|
12
|
+
* Reads `GET /health`. Public: no Authorization header is sent.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const health = await new HealthService(httpClient).getHealth();
|
|
17
|
+
* console.log(health.status, health.database?.status);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class HealthService extends BaseService {
|
|
21
|
+
/**
|
|
22
|
+
* The backend's health: overall `status` and the state of database, redis, mux, rabbitmq and
|
|
23
|
+
* the GalaChain query / launchpad-contract probes.
|
|
24
|
+
*
|
|
25
|
+
* A critical dependency being down answers HTTP 503, which throws a `NetworkError`
|
|
26
|
+
* (`statusCode` 503, the backend's answer in `body`).
|
|
27
|
+
*
|
|
28
|
+
* @throws NetworkError when the request fails or the body has no `data`
|
|
29
|
+
* @since 9.0.0
|
|
30
|
+
*/
|
|
31
|
+
getHealth(): Promise<HealthCheckResponse>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=HealthService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HealthService.d.ts","sourceRoot":"","sources":["../../src/services/HealthService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;GAQG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;OASG;IACG,SAAS,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAQhD"}
|
|
@@ -29,7 +29,7 @@ import { BaseService } from './BaseService';
|
|
|
29
29
|
* // Upload token image
|
|
30
30
|
* const imageUrl = await imageService.uploadImageByTokenName({
|
|
31
31
|
* tokenName: 'mytoken',
|
|
32
|
-
* options: { file: imageFile
|
|
32
|
+
* options: { file: imageFile }
|
|
33
33
|
* });
|
|
34
34
|
* console.log('Image uploaded:', imageUrl);
|
|
35
35
|
* ```
|
|
@@ -48,7 +48,7 @@ import { BaseService } from './BaseService';
|
|
|
48
48
|
*
|
|
49
49
|
* const imageUrl = await imageService.uploadImageByTokenName({
|
|
50
50
|
* tokenName: 'anime',
|
|
51
|
-
* options: { file
|
|
51
|
+
* options: { file }
|
|
52
52
|
* });
|
|
53
53
|
* }
|
|
54
54
|
* ```
|
|
@@ -60,7 +60,7 @@ import { BaseService } from './BaseService';
|
|
|
60
60
|
* const imageBuffer = fs.readFileSync('./token-logo.png');
|
|
61
61
|
* const imageUrl = await imageService.uploadImageByTokenName({
|
|
62
62
|
* tokenName: 'GDOG',
|
|
63
|
-
* options: { file: imageBuffer
|
|
63
|
+
* options: { file: imageBuffer }
|
|
64
64
|
* });
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageService.d.ts","sourceRoot":"","sources":["../../src/services/ImageService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"ImageService.d.ts","sourceRoot":"","sources":["../../src/services/ImageService.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAM/C,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAM1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIhD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;OAYG;gBACS,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,SAAS,GAAE,OAAe;IAI3E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwFG;IACG,sBAAsB,CAC1B,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,MAAM,CAAC;CAgDnB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Launchpad token USD spot price.
|
|
3
|
+
*
|
|
4
|
+
* The one price launchpad-sdk computes itself: a launchpad token's USD price, from the launchpad
|
|
5
|
+
* backend's bonding curve (tokens per 1 GALA) and GALA's USD price, or, once the token graduated,
|
|
6
|
+
* its USD price on the swap backend. The swap backend (dex-backend) `GET /market/price` read here is
|
|
7
|
+
* launchpad-backend-adjacent and deliberately thin: GALA's price and a graduated launchpad token's
|
|
8
|
+
* price, nothing else. Every other DEX price (any token by class key, GALA on its own, price series)
|
|
9
|
+
* is gswap-sdk's `gSwap.market` (`getPrice`, `getPrices`, `getPriceSeries`).
|
|
10
|
+
*/
|
|
11
|
+
import type { GalaChainTokenDetails } from '@gala-chain/gala-core-sdk';
|
|
12
|
+
import type { AmountCalculationResult, TokenSpotPrice } from '../types/launchpad.dto';
|
|
13
|
+
import type { CalculateBuyAmountOptions } from '../types/options.dto';
|
|
14
|
+
import type { HttpClient } from '../utils/http';
|
|
15
|
+
import { LoggerBase } from './BaseService';
|
|
16
|
+
import type { TokenMetadataCache } from './TokenMetadataCache';
|
|
17
|
+
/**
|
|
18
|
+
* Computes launchpad token USD spot prices (bonding curve, or the swap backend once graduated).
|
|
19
|
+
*
|
|
20
|
+
* @category Services
|
|
21
|
+
*/
|
|
22
|
+
export declare class LaunchpadPriceService extends LoggerBase {
|
|
23
|
+
private readonly dexBackendHttp?;
|
|
24
|
+
private readonly cache?;
|
|
25
|
+
private readonly fetchTokenDetails?;
|
|
26
|
+
/**
|
|
27
|
+
* @param dexBackendHttp The swap backend client (`GET /market/price`)
|
|
28
|
+
* @param cache Token symbols already known
|
|
29
|
+
* @param fetchTokenDetails Reads a token's GalaChain token class details (its symbol), at call time
|
|
30
|
+
* @param debugMode Debug logging
|
|
31
|
+
*/
|
|
32
|
+
constructor(dexBackendHttp?: HttpClient | undefined, cache?: TokenMetadataCache | undefined, fetchTokenDetails?: ((tokenId: string) => Promise<GalaChainTokenDetails>) | undefined, debugMode?: boolean);
|
|
33
|
+
/**
|
|
34
|
+
* A launchpad token's USD spot price.
|
|
35
|
+
*
|
|
36
|
+
* - Graduated (`isGraduated` from `fetchPoolDetails`): the token's price on the swap backend.
|
|
37
|
+
* - Otherwise (or when graduation cannot be read): `GALA USD price / tokens bought with 1 GALA`
|
|
38
|
+
* on the bonding curve.
|
|
39
|
+
*
|
|
40
|
+
* @param tokenName Launchpad token name (e.g. 'anime')
|
|
41
|
+
* @param calculateBuyAmount The bonding-curve buy calculation (tokens for 1 GALA)
|
|
42
|
+
* @param fetchPoolDetails Optional pool read used to detect graduation
|
|
43
|
+
* @returns The token's symbol and USD price
|
|
44
|
+
* @throws ValidationError if `tokenName` is empty
|
|
45
|
+
* @throws NetworkError if the calculation or a price read fails
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const price = await service.fetchLaunchpadTokenSpotPrice('anime', calculateBuyAmount, fetchPoolDetails);
|
|
50
|
+
* console.log(`${price.symbol}: $${price.price}`);
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
fetchLaunchpadTokenSpotPrice(tokenName: string, calculateBuyAmount: (options: CalculateBuyAmountOptions) => Promise<AmountCalculationResult>, fetchPoolDetails?: (tokenName: string) => Promise<unknown>): Promise<TokenSpotPrice>;
|
|
54
|
+
/**
|
|
55
|
+
* The symbol of a token, from the token metadata cache or the GalaChain token class; never
|
|
56
|
+
* derived from the class key. GALA's is fixed.
|
|
57
|
+
*/
|
|
58
|
+
private resolveAuthoritativeSymbol;
|
|
59
|
+
/**
|
|
60
|
+
* A token's USD price on the swap backend (`GET /market/price?assetIds=<$ key>`), with its
|
|
61
|
+
* authoritative symbol. The backend answers each asset under its symbol and under the id asked
|
|
62
|
+
* for (recorded on prod and stage); one asset is asked for, so a sole entry is its entry.
|
|
63
|
+
*/
|
|
64
|
+
private fetchMarketUsdPrice;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=LaunchpadPriceService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LaunchpadPriceService.d.ts","sourceRoot":"","sources":["../../src/services/LaunchpadPriceService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAA0B,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAG/F,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAItE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAMhD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAK/D;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,UAAU;IAQjD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IATrC;;;;;OAKG;gBAEgB,cAAc,CAAC,EAAE,UAAU,YAAA,EAC3B,KAAK,CAAC,EAAE,kBAAkB,YAAA,EAC1B,iBAAiB,CAAC,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,aAAA,EACxF,SAAS,GAAE,OAAe;IAK5B;;;;;;;;;;;;;;;;;;;OAmBG;IACG,4BAA4B,CAChC,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAO,CAAC,uBAAuB,CAAC,EAC5F,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GACzD,OAAO,CAAC,cAAc,CAAC;IA8D1B;;;OAGG;YACW,0BAA0B;IA8BxC;;;;OAIG;YACW,mBAAmB;CA4ClC"}
|