@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
package/dist/utils/errors.d.ts
CHANGED
|
@@ -121,12 +121,47 @@ export declare class ValidationError extends Error {
|
|
|
121
121
|
export declare class TokenRestrictedError extends ValidationError {
|
|
122
122
|
constructor(message: string);
|
|
123
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* What a server answered a failed request with, as a {@link NetworkError} carries it.
|
|
126
|
+
*
|
|
127
|
+
* The launchpad backend (NestJS, `GlobalExceptionFilter`) answers an error with
|
|
128
|
+
* `{ status, error: true, message }` (an `HttpException`: validation failures, `sendResult`
|
|
129
|
+
* refusals, guards) or `{ statusCode, message }` (its `CustomError`, an upload over 4 MB, an
|
|
130
|
+
* unhandled 500). `message` is the text the backend means the user to read.
|
|
131
|
+
*
|
|
132
|
+
* @since 9.0.0
|
|
133
|
+
*/
|
|
134
|
+
export interface NetworkErrorServerAnswer {
|
|
135
|
+
/**
|
|
136
|
+
* The body's `message`. An array of strings (NestJS class-validator messages) is joined with
|
|
137
|
+
* `,`, exactly as `String(array)` shows it.
|
|
138
|
+
*/
|
|
139
|
+
serverMessage?: string | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* The body's `error` when it is a string (NestJS's default `"Bad Request"`, another host's error
|
|
142
|
+
* name). The launchpad backend sends `error: true`, which is no text: then this is absent and
|
|
143
|
+
* the boolean is in {@link body}.
|
|
144
|
+
*/
|
|
145
|
+
serverError?: string | undefined;
|
|
146
|
+
/** The body's `details`, when it has them (the launchpad backend sends none today). */
|
|
147
|
+
details?: unknown;
|
|
148
|
+
/** The whole body as received: parsed JSON, or the text of a non-JSON answer (a proxy's HTML). */
|
|
149
|
+
body?: unknown;
|
|
150
|
+
}
|
|
151
|
+
/** The {@link NetworkErrorServerAnswer} of a response body. */
|
|
152
|
+
export declare function serverAnswerOfBody(body: unknown): NetworkErrorServerAnswer;
|
|
124
153
|
/**
|
|
125
154
|
* Error thrown when network operations fail
|
|
126
155
|
*
|
|
127
156
|
* This error is used for HTTP request failures, API communication errors,
|
|
128
|
-
* and network connectivity issues. It captures the HTTP status code
|
|
129
|
-
*
|
|
157
|
+
* and network connectivity issues. It captures the HTTP status code, the
|
|
158
|
+
* server's answer ({@link NetworkErrorServerAnswer}: `serverMessage`,
|
|
159
|
+
* `serverError`, `details`, `body`) and the original error for debugging.
|
|
160
|
+
*
|
|
161
|
+
* Wrapping keeps the answer: a NetworkError made from an axios error reads
|
|
162
|
+
* its response, and one made from another NetworkError (a service adding its
|
|
163
|
+
* context to the HTTP client's error) takes that error's answer.
|
|
164
|
+
* `handleNetworkError` (the `withErrorHandling` wrap) also takes its status.
|
|
130
165
|
*
|
|
131
166
|
* @example HTTP request failure
|
|
132
167
|
* ```typescript
|
|
@@ -137,32 +172,40 @@ export declare class TokenRestrictedError extends ValidationError {
|
|
|
137
172
|
* );
|
|
138
173
|
* ```
|
|
139
174
|
*
|
|
140
|
-
* @example
|
|
175
|
+
* @example Showing the backend's own text
|
|
141
176
|
* ```typescript
|
|
142
177
|
* try {
|
|
143
|
-
* await
|
|
178
|
+
* await sdk.updateProfile({ fullName: 'x' });
|
|
144
179
|
* } catch (error) {
|
|
145
180
|
* if (error instanceof NetworkError) {
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* } else if (error.statusCode && error.statusCode >= 500) {
|
|
149
|
-
* console.log('Server error, retry later');
|
|
150
|
-
* }
|
|
181
|
+
* toast(error.serverMessage ?? 'Something went wrong');
|
|
182
|
+
* if (error.statusCode === 404) console.log('Resource not found');
|
|
151
183
|
* }
|
|
152
184
|
* }
|
|
153
185
|
* ```
|
|
154
186
|
*/
|
|
155
187
|
export declare class NetworkError extends Error {
|
|
188
|
+
/** The HTTP status (404, 500, ...), when known. */
|
|
156
189
|
statusCode?: number | undefined;
|
|
190
|
+
/** The error this one wraps (an axios error, or the NetworkError of the HTTP client). */
|
|
157
191
|
originalError?: Error | undefined;
|
|
192
|
+
/** The body's `message` (see {@link NetworkErrorServerAnswer.serverMessage}). @since 9.0.0 */
|
|
193
|
+
readonly serverMessage?: string | undefined;
|
|
194
|
+
/** The body's `error` when it is a string. @since 9.0.0 */
|
|
195
|
+
readonly serverError?: string | undefined;
|
|
196
|
+
/** The body's `details`. @since 9.0.0 */
|
|
197
|
+
readonly details?: unknown;
|
|
198
|
+
/** The whole response body. @since 9.0.0 */
|
|
199
|
+
readonly body?: unknown;
|
|
158
200
|
/**
|
|
159
201
|
* Creates a new NetworkError
|
|
160
202
|
*
|
|
161
203
|
* @param message - Human-readable error message describing what failed
|
|
162
204
|
* @param statusCode - Optional HTTP status code (404, 500, etc.)
|
|
163
205
|
* @param originalError - Optional original error that caused this failure
|
|
206
|
+
* @param answer - The server's answer; default the one behind `originalError`
|
|
164
207
|
*/
|
|
165
|
-
constructor(message: string, statusCode?: number
|
|
208
|
+
constructor(message: string, statusCode?: number, originalError?: Error, answer?: NetworkErrorServerAnswer);
|
|
166
209
|
}
|
|
167
210
|
/**
|
|
168
211
|
* Error thrown when SDK configuration is invalid
|
|
@@ -242,312 +285,4 @@ export declare class TransactionError extends Error {
|
|
|
242
285
|
*/
|
|
243
286
|
constructor(message: string, transactionId?: string | undefined, code?: string | undefined);
|
|
244
287
|
}
|
|
245
|
-
/**
|
|
246
|
-
* Error thrown when GSwap SDK quote operations fail
|
|
247
|
-
*
|
|
248
|
-
* This error is thrown during quote generation (exact input or exact output).
|
|
249
|
-
* It preserves the original GSwap SDK error for detailed diagnostics.
|
|
250
|
-
*
|
|
251
|
-
* @example Quote generation failure
|
|
252
|
-
* ```typescript
|
|
253
|
-
* throw new GSwapQuoteError(
|
|
254
|
-
* 'Failed to get quote for GALA to GUSDC swap',
|
|
255
|
-
* originalGSwapError,
|
|
256
|
-
* 'POOL_NOT_FOUND'
|
|
257
|
-
* );
|
|
258
|
-
* ```
|
|
259
|
-
*
|
|
260
|
-
* @example Catching quote errors
|
|
261
|
-
* ```typescript
|
|
262
|
-
* try {
|
|
263
|
-
* const quote = await sdk.dex.quoting.quoteExactInput('GALA', 'GUSDC', '100');
|
|
264
|
-
* } catch (error) {
|
|
265
|
-
* if (error instanceof GSwapQuoteError) {
|
|
266
|
-
* console.log(`Quote failed: ${error.message}`);
|
|
267
|
-
* console.log(`GSwap error: ${error.code}`);
|
|
268
|
-
* // Implement user notification
|
|
269
|
-
* }
|
|
270
|
-
* }
|
|
271
|
-
* ```
|
|
272
|
-
*/
|
|
273
|
-
export declare class GSwapQuoteError extends Error {
|
|
274
|
-
originalError: unknown;
|
|
275
|
-
code?: string | undefined;
|
|
276
|
-
/**
|
|
277
|
-
* Creates a new GSwapQuoteError
|
|
278
|
-
*
|
|
279
|
-
* @param message - Human-readable error message describing what failed
|
|
280
|
-
* @param originalError - The original error from GSwap SDK
|
|
281
|
-
* @param code - Optional error code from GSwap SDK for programmatic handling
|
|
282
|
-
*/
|
|
283
|
-
constructor(message: string, originalError: unknown, code?: string | undefined);
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Error thrown when GSwap SDK swap execution fails
|
|
287
|
-
*
|
|
288
|
-
* This error is thrown during token swap execution (buy/sell operations).
|
|
289
|
-
* It preserves the original GSwap SDK error and transaction details.
|
|
290
|
-
*
|
|
291
|
-
* @example Swap execution failure
|
|
292
|
-
* ```typescript
|
|
293
|
-
* throw new GSwapSwapError(
|
|
294
|
-
* 'Token swap failed: insufficient balance',
|
|
295
|
-
* originalGSwapError,
|
|
296
|
-
* 'txHash123',
|
|
297
|
-
* 'INSUFFICIENT_BALANCE'
|
|
298
|
-
* );
|
|
299
|
-
* ```
|
|
300
|
-
*
|
|
301
|
-
* @example Catching swap errors
|
|
302
|
-
* ```typescript
|
|
303
|
-
* try {
|
|
304
|
-
* const submitted = await sdk.dex.swaps.swap(tokenIn, tokenOut, fee, swapAmount);
|
|
305
|
-
* const result = await submitted.confirm();
|
|
306
|
-
* } catch (error) {
|
|
307
|
-
* if (error instanceof GSwapSwapError) {
|
|
308
|
-
* console.log(`Swap failed: ${error.message}`);
|
|
309
|
-
* if (error.transactionHash) {
|
|
310
|
-
* console.log(`TX: ${error.transactionHash}`);
|
|
311
|
-
* }
|
|
312
|
-
* }
|
|
313
|
-
* }
|
|
314
|
-
* ```
|
|
315
|
-
*/
|
|
316
|
-
export declare class GSwapSwapError extends Error {
|
|
317
|
-
originalError: unknown;
|
|
318
|
-
transactionHash?: string | undefined;
|
|
319
|
-
code?: string | undefined;
|
|
320
|
-
/**
|
|
321
|
-
* Creates a new GSwapSwapError
|
|
322
|
-
*
|
|
323
|
-
* @param message - Human-readable error message describing what failed
|
|
324
|
-
* @param originalError - The original error from GSwap SDK
|
|
325
|
-
* @param transactionHash - Optional transaction hash for transaction tracking
|
|
326
|
-
* @param code - Optional error code from GSwap SDK for programmatic handling
|
|
327
|
-
*/
|
|
328
|
-
constructor(message: string, originalError: unknown, transactionHash?: string | undefined, code?: string | undefined);
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Error thrown when GSwap SDK pool operations fail
|
|
332
|
-
*
|
|
333
|
-
* This error is thrown when pool-related queries fail, including:
|
|
334
|
-
* - Pool information retrieval
|
|
335
|
-
* - Available token swaps querying
|
|
336
|
-
* - Pool data access errors
|
|
337
|
-
*
|
|
338
|
-
* @example Pool query failure
|
|
339
|
-
* ```typescript
|
|
340
|
-
* throw new GSwapPoolError(
|
|
341
|
-
* 'Pool not found for GALA/GUSDC pair',
|
|
342
|
-
* originalGSwapError,
|
|
343
|
-
* 'GALA',
|
|
344
|
-
* 'GUSDC',
|
|
345
|
-
* 'POOL_NOT_FOUND'
|
|
346
|
-
* );
|
|
347
|
-
* ```
|
|
348
|
-
*
|
|
349
|
-
* @example Catching pool errors
|
|
350
|
-
* ```typescript
|
|
351
|
-
* try {
|
|
352
|
-
* const poolInfo = await service.getPoolInfo('GALA', 'GUSDC');
|
|
353
|
-
* } catch (error) {
|
|
354
|
-
* if (error instanceof GSwapPoolError) {
|
|
355
|
-
* console.log(`Pool error: ${error.message}`);
|
|
356
|
-
* if (error.code === 'POOL_NOT_FOUND') {
|
|
357
|
-
* console.log(`No pool for ${error.tokenA}/${error.tokenB}`);
|
|
358
|
-
* }
|
|
359
|
-
* }
|
|
360
|
-
* }
|
|
361
|
-
* ```
|
|
362
|
-
*/
|
|
363
|
-
export declare class GSwapPoolError extends Error {
|
|
364
|
-
originalError: unknown;
|
|
365
|
-
tokenA?: string | undefined;
|
|
366
|
-
tokenB?: string | undefined;
|
|
367
|
-
code?: string | undefined;
|
|
368
|
-
/**
|
|
369
|
-
* Creates a new GSwapPoolError
|
|
370
|
-
*
|
|
371
|
-
* @param message - Human-readable error message describing what failed
|
|
372
|
-
* @param originalError - The original error from GSwap SDK
|
|
373
|
-
* @param tokenA - Optional token A symbol in the pool pair
|
|
374
|
-
* @param tokenB - Optional token B symbol in the pool pair
|
|
375
|
-
* @param code - Optional error code from GSwap SDK for programmatic handling
|
|
376
|
-
*/
|
|
377
|
-
constructor(message: string, originalError: unknown, tokenA?: string | undefined, tokenB?: string | undefined, code?: string | undefined);
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Error thrown when GSwap SDK asset/balance operations fail
|
|
381
|
-
*
|
|
382
|
-
* This error is thrown when asset-related queries fail, including:
|
|
383
|
-
* - User asset/balance retrieval
|
|
384
|
-
* - Portfolio data access errors
|
|
385
|
-
* - Asset validation failures
|
|
386
|
-
*
|
|
387
|
-
* @example Asset query failure
|
|
388
|
-
* ```typescript
|
|
389
|
-
* throw new GSwapAssetError(
|
|
390
|
-
* 'Failed to fetch user assets',
|
|
391
|
-
* originalGSwapError,
|
|
392
|
-
* 'userAddress123',
|
|
393
|
-
* 'NETWORK_ERROR'
|
|
394
|
-
* );
|
|
395
|
-
* ```
|
|
396
|
-
*
|
|
397
|
-
* @example Catching asset errors
|
|
398
|
-
* ```typescript
|
|
399
|
-
* try {
|
|
400
|
-
* const assets = await service.getUserAssets(walletAddress);
|
|
401
|
-
* } catch (error) {
|
|
402
|
-
* if (error instanceof GSwapAssetError) {
|
|
403
|
-
* console.log(`Asset query failed: ${error.message}`);
|
|
404
|
-
* console.log(`Wallet: ${error.walletAddress}`);
|
|
405
|
-
* }
|
|
406
|
-
* }
|
|
407
|
-
* ```
|
|
408
|
-
*/
|
|
409
|
-
export declare class GSwapAssetError extends Error {
|
|
410
|
-
originalError: unknown;
|
|
411
|
-
walletAddress?: string | undefined;
|
|
412
|
-
code?: string | undefined;
|
|
413
|
-
/**
|
|
414
|
-
* Creates a new GSwapAssetError
|
|
415
|
-
*
|
|
416
|
-
* @param message - Human-readable error message describing what failed
|
|
417
|
-
* @param originalError - The original error from GSwap SDK
|
|
418
|
-
* @param walletAddress - Optional wallet address being queried
|
|
419
|
-
* @param code - Optional error code from GSwap SDK for programmatic handling
|
|
420
|
-
*/
|
|
421
|
-
constructor(message: string, originalError: unknown, walletAddress?: string | undefined, code?: string | undefined);
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Error thrown when GSwap SDK liquidity position operations fail
|
|
425
|
-
*
|
|
426
|
-
* This error is thrown when position management operations fail, including:
|
|
427
|
-
* - Position queries (getUserPositions, getPosition, getPositionById)
|
|
428
|
-
* - Liquidity addition (addLiquidityByPrice, addLiquidityByTicks)
|
|
429
|
-
* - Liquidity removal (removeLiquidity)
|
|
430
|
-
* - Fee collection (collectPositionFees)
|
|
431
|
-
* - Position estimation (estimateRemoveLiquidity)
|
|
432
|
-
*
|
|
433
|
-
* @example Position operation failure
|
|
434
|
-
* ```typescript
|
|
435
|
-
* throw new GSwapPositionError(
|
|
436
|
-
* 'Failed to add liquidity to GALA/GUSDC pool',
|
|
437
|
-
* originalGSwapError,
|
|
438
|
-
* 'INSUFFICIENT_BALANCE'
|
|
439
|
-
* );
|
|
440
|
-
* ```
|
|
441
|
-
*
|
|
442
|
-
* @example Catching position errors
|
|
443
|
-
* ```typescript
|
|
444
|
-
* try {
|
|
445
|
-
* const result = await service.addLiquidityByPrice({ token0: 'GALA', token1: 'GUSDC', ... });
|
|
446
|
-
* } catch (error) {
|
|
447
|
-
* if (error instanceof GSwapPositionError) {
|
|
448
|
-
* console.log(`Position operation failed: ${error.message}`);
|
|
449
|
-
* console.log(`Error code: ${error.code}`);
|
|
450
|
-
* // Implement user notification or recovery logic
|
|
451
|
-
* }
|
|
452
|
-
* }
|
|
453
|
-
* ```
|
|
454
|
-
*/
|
|
455
|
-
export declare class GSwapPositionError extends Error {
|
|
456
|
-
originalError: unknown;
|
|
457
|
-
code?: string | undefined;
|
|
458
|
-
/**
|
|
459
|
-
* Creates a new GSwapPositionError
|
|
460
|
-
*
|
|
461
|
-
* @param message - Human-readable error message describing what failed
|
|
462
|
-
* @param originalError - The original error from GSwap SDK
|
|
463
|
-
* @param code - Optional error code from GSwap SDK for programmatic handling
|
|
464
|
-
*/
|
|
465
|
-
constructor(message: string, originalError: unknown, code?: string | undefined);
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* Error thrown when DEX quote operations fail
|
|
469
|
-
*
|
|
470
|
-
* This error is thrown during DEX quote calculations (local and external),
|
|
471
|
-
* composite pool data fetching, and related operations. It captures the
|
|
472
|
-
* operation context for debugging and recovery.
|
|
473
|
-
*
|
|
474
|
-
* @example Quote calculation failure
|
|
475
|
-
* ```typescript
|
|
476
|
-
* throw new DexQuoteError(
|
|
477
|
-
* 'Failed to calculate quote for GALA/BENE swap',
|
|
478
|
-
* {
|
|
479
|
-
* fromToken: 'GALA|Unit|none|none',
|
|
480
|
-
* toToken: 'Token|Unit|BENE|client:123',
|
|
481
|
-
* amount: '1000'
|
|
482
|
-
* }
|
|
483
|
-
* );
|
|
484
|
-
* ```
|
|
485
|
-
*
|
|
486
|
-
* @example Catching quote errors
|
|
487
|
-
* ```typescript
|
|
488
|
-
* try {
|
|
489
|
-
* const quote = await sdk.calculateDexPoolQuoteExactAmountLocal({
|
|
490
|
-
* compositePoolData: composite,
|
|
491
|
-
* fromToken: 'GALA|Unit|none|none',
|
|
492
|
-
* toToken: 'Token|Unit|BENE|client:123',
|
|
493
|
-
* amount: '1000'
|
|
494
|
-
* });
|
|
495
|
-
* } catch (error) {
|
|
496
|
-
* if (error instanceof DexQuoteError) {
|
|
497
|
-
* console.log(`Quote failed: ${error.message}`);
|
|
498
|
-
* if (error.context) {
|
|
499
|
-
* console.log(`Tokens: ${error.context.fromToken} → ${error.context.toToken}`);
|
|
500
|
-
* }
|
|
501
|
-
* }
|
|
502
|
-
* }
|
|
503
|
-
* ```
|
|
504
|
-
*/
|
|
505
|
-
export declare class DexQuoteError extends ValidationError {
|
|
506
|
-
context?: unknown | undefined;
|
|
507
|
-
/**
|
|
508
|
-
* Creates a new DexQuoteError
|
|
509
|
-
*
|
|
510
|
-
* @param message - Human-readable error message describing what failed
|
|
511
|
-
* @param context - Optional context object with operation details (tokens, amounts, etc.)
|
|
512
|
-
*/
|
|
513
|
-
constructor(message: string, context?: unknown | undefined);
|
|
514
|
-
}
|
|
515
|
-
/**
|
|
516
|
-
* Error thrown when a DEX pool is not found
|
|
517
|
-
*
|
|
518
|
-
* This error is thrown when attempting to access or fetch data for a DEX pool
|
|
519
|
-
* that does not exist, typically during composite pool data retrieval or pool
|
|
520
|
-
* discovery operations.
|
|
521
|
-
*
|
|
522
|
-
* @example Pool not found
|
|
523
|
-
* ```typescript
|
|
524
|
-
* throw new DexPoolNotFoundError(
|
|
525
|
-
* 'Pool not found: GALA/BENE with fee 3000'
|
|
526
|
-
* );
|
|
527
|
-
* ```
|
|
528
|
-
*
|
|
529
|
-
* @example Catching pool not found errors
|
|
530
|
-
* ```typescript
|
|
531
|
-
* try {
|
|
532
|
-
* const composite = await sdk.dex.pools.getCompositePool(
|
|
533
|
-
* 'GALA|Unit|none|none',
|
|
534
|
-
* 'Token|Unit|BENE|client:123',
|
|
535
|
-
* 3000
|
|
536
|
-
* );
|
|
537
|
-
* } catch (error) {
|
|
538
|
-
* if (error instanceof DexPoolNotFoundError) {
|
|
539
|
-
* console.log('Pool does not exist. Create it first with liquidity.');
|
|
540
|
-
* // Implement pool creation or alternative routing
|
|
541
|
-
* }
|
|
542
|
-
* }
|
|
543
|
-
* ```
|
|
544
|
-
*/
|
|
545
|
-
export declare class DexPoolNotFoundError extends ValidationError {
|
|
546
|
-
/**
|
|
547
|
-
* Creates a new DexPoolNotFoundError
|
|
548
|
-
*
|
|
549
|
-
* @param message - Human-readable error message describing which pool was not found
|
|
550
|
-
*/
|
|
551
|
-
constructor(message: string);
|
|
552
|
-
}
|
|
553
288
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],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AAC;IACjD,yCAAyC;IACzC,SAAgB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClC,4CAA4C;IAC5C,SAAgB,IAAI,CAAC,EAAE,OAAO,CAAC;IAE/B;;;;;;;OAOG;gBAED,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,KAAK,EACrB,MAAM,GAAE,wBAAwD;CAWnE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IASlC,KAAK,CAAC,EAAE,MAAM;IARvB;;;;;OAKG;gBAED,OAAO,EAAE,MAAM,EACR,KAAK,CAAC,EAAE,MAAM,YAAA;CAKxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IAUhC,aAAa,CAAC,EAAE,MAAM;IACtB,IAAI,CAAC,EAAE,MAAM;IAVtB;;;;;;OAMG;gBAED,OAAO,EAAE,MAAM,EACR,aAAa,CAAC,EAAE,MAAM,YAAA,EACtB,IAAI,CAAC,EAAE,MAAM,YAAA;CAKvB"}
|
package/dist/utils/http.d.ts
CHANGED
|
@@ -1,23 +1,46 @@
|
|
|
1
|
+
import type { LaunchpadSession } from '../auth/session';
|
|
1
2
|
import type { SignatureAuth } from '../auth/SignatureAuth';
|
|
2
3
|
import type { HttpResponseWithMeta, RequestConfig, SDKConfig } from '../types/common';
|
|
3
4
|
import type { EIP712Domain, EIP712Types } from '../types/trade.dto';
|
|
4
5
|
/**
|
|
5
6
|
* HTTP client with optional signature authentication
|
|
6
7
|
*
|
|
7
|
-
* This client
|
|
8
|
-
*
|
|
8
|
+
* This client adds the `Sign` header to every request using wallet signatures generated by
|
|
9
|
+
* SignatureAuth when a wallet is configured and `signRequests` is on (the default). Clients for
|
|
10
|
+
* hosts other than the launchpad backend turn it off.
|
|
9
11
|
*
|
|
10
12
|
* In read-only mode (no wallet), the client skips authentication headers
|
|
11
13
|
* and allows querying public data endpoints.
|
|
12
14
|
*/
|
|
15
|
+
/** Options of an {@link HttpClient} beyond its base URL, timeout and headers. */
|
|
16
|
+
export interface HttpClientOptions {
|
|
17
|
+
/** Add the wallet-signed `Sign` header to every request (the launchpad backend only). */
|
|
18
|
+
readonly signRequests: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The app's launchpad-backend session: the bearer of every request, the handler of a 401 (one
|
|
21
|
+
* retry with the token it returns) and, unless it says `credentials: 'omit'`, credentialed requests.
|
|
22
|
+
*/
|
|
23
|
+
readonly session?: LaunchpadSession | undefined;
|
|
24
|
+
}
|
|
13
25
|
export declare class HttpClient {
|
|
14
26
|
private readonly axios;
|
|
15
27
|
private readonly auth;
|
|
28
|
+
private readonly signRequests;
|
|
29
|
+
private readonly session;
|
|
16
30
|
private readonly debug;
|
|
17
31
|
private readonly logger;
|
|
18
32
|
private requestInterceptorId;
|
|
19
33
|
private responseInterceptorId;
|
|
20
|
-
|
|
34
|
+
/**
|
|
35
|
+
* @param auth Signature auth: the request signer for the launchpad backend, and the wallet identity
|
|
36
|
+
* (`getAddress`, `signTypedData`) other services read from this client
|
|
37
|
+
* @param config Base URL, timeout and headers
|
|
38
|
+
* @param options `signRequests: false` keeps the `Sign` header off every request. Only the launchpad
|
|
39
|
+
* backend authenticates with it; the GalaChain gateway, dex-api, the swap backend and the bundler
|
|
40
|
+
* ignore it, and signing each request costs a wallet signature (a prompt for browser wallets).
|
|
41
|
+
* `session` (launchpad backend only) makes the app's session the source of every bearer.
|
|
42
|
+
*/
|
|
43
|
+
constructor(auth: SignatureAuth | undefined, config?: SDKConfig, options?: HttpClientOptions);
|
|
21
44
|
/**
|
|
22
45
|
* Makes an authenticated HTTP request and returns body only (legacy default).
|
|
23
46
|
*
|
|
@@ -35,6 +58,16 @@ export declare class HttpClient {
|
|
|
35
58
|
* @returns Promise with data, headers (lowercase keys), and status
|
|
36
59
|
*/
|
|
37
60
|
requestWithMeta<T = unknown>(config: RequestConfig): Promise<HttpResponseWithMeta<T>>;
|
|
61
|
+
/**
|
|
62
|
+
* The axios request of `config`, with `bearer` (the app session's token) as its Authorization.
|
|
63
|
+
* Built afresh for a retry, so the retry carries the same body, params and headers.
|
|
64
|
+
*/
|
|
65
|
+
private toAxiosConfig;
|
|
66
|
+
/**
|
|
67
|
+
* Send `axiosConfig`; when it went out under the app session and was answered 401, hand the 401
|
|
68
|
+
* to the session and retry once with the token it returns (none: the 401 stands).
|
|
69
|
+
*/
|
|
70
|
+
private sendWithSession;
|
|
38
71
|
/**
|
|
39
72
|
* Makes a GET request
|
|
40
73
|
*/
|
package/dist/utils/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/utils/http.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/utils/http.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAEV,oBAAoB,EACpB,aAAa,EACb,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAyFpE;;;;;;;;;GASG;AACH,iFAAiF;AACjF,MAAM,WAAW,iBAAiB;IAChC,yFAAyF;IACzF,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACjD;AAaD,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA4B;IACjD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAU;IACvC,OAAO,CAAC,QAAQ,CAAC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":["../../src/utils/message-validators.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"message-validators.d.ts","sourceRoot":"","sources":["../../src/utils/message-validators.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAgB3G"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @category Utilities
|
|
8
8
|
* @since 6.5.0
|
|
9
9
|
*/
|
|
10
|
+
import type { PageInfo } from '../types/common';
|
|
10
11
|
/**
|
|
11
12
|
* Pagination query parameters
|
|
12
13
|
*
|
|
@@ -158,4 +159,20 @@ export declare function calculateTotalPages(total: number, limit: number): numbe
|
|
|
158
159
|
* @since 6.5.0
|
|
159
160
|
*/
|
|
160
161
|
export declare function hasMorePages(currentOffset: number, limit: number, total: number): boolean;
|
|
162
|
+
/**
|
|
163
|
+
* The {@link PageInfo} of a launchpad-backend list answer's `data.pageInfo`
|
|
164
|
+
* (`{ hasNextPage, endCursor, hasPreviousPage, startCursor }`), keys kept as the backend names
|
|
165
|
+
* them. A missing or malformed `pageInfo` is a last page (`hasNextPage: false`); a field of the
|
|
166
|
+
* wrong type is left out rather than passed on.
|
|
167
|
+
*
|
|
168
|
+
* @since 9.0.0
|
|
169
|
+
*/
|
|
170
|
+
export declare function pageInfoOf(backendPageInfo: unknown): PageInfo;
|
|
171
|
+
/**
|
|
172
|
+
* The cursor of the page after `pageInfo`, or `undefined` when there is none: no next page, no
|
|
173
|
+
* `endCursor`, or (a malformed answer) the cursor that was just used, which would repeat forever.
|
|
174
|
+
*
|
|
175
|
+
* @since 9.0.0
|
|
176
|
+
*/
|
|
177
|
+
export declare function nextCursorOf(pageInfo: PageInfo, usedCursor: string | undefined): string | undefined;
|
|
161
178
|
//# sourceMappingURL=pagination-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/pagination-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"pagination-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/pagination-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAIhD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;CACf;AAGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,MAA0C,GAChD,eAAe,CAUjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,cAAc,CAAC,EAAE,MAAM,GACtB,IAAI,CASN;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,QAAQ,GAAE,MAAU,EACpB,QAAQ,GAAE,MAAkD,GAC3D,MAAM,CAER;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAuBxE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,OAAO,CAST;AAMD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,eAAe,EAAE,OAAO,GAAG,QAAQ,CAY7D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAInG"}
|
|
@@ -76,10 +76,10 @@ export declare function mergeSafePaginationOptions(base: Partial<BasePaginationO
|
|
|
76
76
|
* ```typescript
|
|
77
77
|
* const nextPageOptions = addCursorToPagination(
|
|
78
78
|
* { pageSize: 50 },
|
|
79
|
-
* pageInfo.
|
|
79
|
+
* pageInfo.endCursor ?? undefined
|
|
80
80
|
* );
|
|
81
81
|
* // Result: { pageSize: 50, cursor: 'abc123' } or { pageSize: 50 }
|
|
82
|
-
* // depending on whether
|
|
82
|
+
* // depending on whether endCursor is set
|
|
83
83
|
* ```
|
|
84
84
|
*
|
|
85
85
|
* @since 8.0.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-handlers.d.ts","sourceRoot":"","sources":["../../src/utils/response-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"response-handlers.d.ts","sourceRoot":"","sources":["../../src/utils/response-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH;;GAEG;AACH,UAAU,eAAe,CAAC,CAAC,GAAG,OAAO;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;CACV;AAED;;;GAGG;AACH,UAAU,OAAO,CAAC,CAAC,GAAG,OAAO;IAC3B,IAAI,CAAC,EAAE,CAAC,CAAC;CACV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,OAAO,EACzC,QAAQ,EAAE,OAAO,GAChB,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,CAOxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,GAAG,OAAO,EAC/C,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,EAC5B,mBAAmB,EAAE,MAAM,EAC3B,WAAW,GAAE,OAAe,GAC3B,IAAI,CAsBN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,GAAG,OAAO,EAC7C,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GACtC,CAAC,GAAG,SAAS,CAKf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,GAAG,OAAO,EAChD,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,EACvC,YAAY,GAAE,MAAoC,GACjD,CAAC,CAYH"}
|
|
@@ -115,22 +115,22 @@ export declare function validateOptionalNumber(value: unknown, field: string, mi
|
|
|
115
115
|
/**
|
|
116
116
|
* Validates token name with constraints (required field)
|
|
117
117
|
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
118
|
+
* Validates a token name against the rule of the route it is sent to (no default: the caller names
|
|
119
|
+
* the route's constraint, see `types/constraints`).
|
|
120
120
|
*
|
|
121
121
|
* @param value Value to validate
|
|
122
|
-
* @param field Field name for error messages
|
|
123
|
-
* @param constraint
|
|
122
|
+
* @param field Field name for error messages
|
|
123
|
+
* @param constraint The route's token name constraint
|
|
124
124
|
* @throws {ValidationError} If token name is invalid
|
|
125
125
|
*
|
|
126
126
|
* @example
|
|
127
127
|
* ```typescript
|
|
128
|
-
* validateTokenNameWithConstraints(options.tokenName, 'tokenName');
|
|
128
|
+
* validateTokenNameWithConstraints(options.tokenName, 'tokenName', TOKEN_NAME_DTO_CONSTRAINT);
|
|
129
129
|
* ```
|
|
130
130
|
*
|
|
131
131
|
* @since 6.18.0
|
|
132
132
|
*/
|
|
133
|
-
export declare function validateTokenNameWithConstraints(value: unknown, field
|
|
133
|
+
export declare function validateTokenNameWithConstraints(value: unknown, field: string, constraint: TokenNameConstraint): asserts value is string;
|
|
134
134
|
/**
|
|
135
135
|
* Validates a status filter value (optional)
|
|
136
136
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-validators.d.ts","sourceRoot":"","sources":["../../src/utils/service-validators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"service-validators.d.ts","sourceRoot":"","sources":["../../src/utils/service-validators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAUhE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAO7F;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAmB9F;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAE9F;AAED;;;;;;;;;;;;;;;;;;;;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BAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,IAAI,IAAI,GAAG,MAAM,GAAG,MAAM,CAO3G;AAiBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,KAAK,IAAI,MAAM,CAQzB"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These convert FORMATS ONLY. A token class key carries no symbol and a symbol carries no class
|
|
5
5
|
* key, so nothing here infers one from the other: a bare symbol is never expanded into a key.
|
|
6
|
-
* For symbol/metadata use GalaChainService.fetchTokenClassFromChain() or
|
|
6
|
+
* For symbol/metadata use GalaChainService.fetchTokenClassFromChain() or GalaChainService.fetchTokenDetails().
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|