@gala-chain/launchpad-sdk 8.0.2 → 9.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +362 -0
- package/EXAMPLES.md +95 -681
- package/MIGRATING-TO-9.0.md +301 -0
- package/README.md +46 -17
- package/dist/LaunchpadSDK.d.ts +150 -419
- package/dist/LaunchpadSDK.d.ts.map +1 -1
- package/dist/api/LaunchpadAPI.d.ts +37 -43
- package/dist/api/LaunchpadAPI.d.ts.map +1 -1
- 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/types.d.ts +1 -1
- 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 +0 -7
- package/dist/constants/endpoints.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/helpers/sdk.d.ts.map +1 -1
- package/dist/index.browser.d.ts +11 -23
- 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 +1 -9
- package/dist/launchpad/bundle-submission.d.ts.map +1 -1
- package/dist/launchpad/sell-fee-ceiling.d.ts +66 -0
- package/dist/launchpad/sell-fee-ceiling.d.ts.map +1 -0
- package/dist/launchpad/transport.d.ts +2 -1
- package/dist/launchpad/transport.d.ts.map +1 -1
- package/dist/launchpad/writes.d.ts +30 -2
- package/dist/launchpad/writes.d.ts.map +1 -1
- package/dist/native.cjs +1 -1
- package/dist/native.d.ts +3 -4
- package/dist/native.d.ts.map +1 -1
- package/dist/native.esm.js +1 -1
- package/dist/schemas/launchpad.d.ts +4 -4
- package/dist/schemas/launchpad.d.ts.map +1 -1
- package/dist/schemas/user.d.ts +0 -15
- package/dist/schemas/user.d.ts.map +1 -1
- package/dist/services/AbstractCacheService.d.ts +2 -2
- package/dist/services/BundleService.d.ts +9 -1
- package/dist/services/BundleService.d.ts.map +1 -1
- 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 -64
- 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/LaunchpadPriceService.d.ts +66 -0
- package/dist/services/LaunchpadPriceService.d.ts.map +1 -0
- package/dist/services/NftCollectionService.d.ts +22 -6
- package/dist/services/NftCollectionService.d.ts.map +1 -1
- package/dist/services/TokenResolverService.d.ts +5 -5
- package/dist/services/TokenResolverService.d.ts.map +1 -1
- package/dist/services/TradingQuotesService.d.ts +3 -5
- package/dist/services/TradingQuotesService.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/signing/index.d.ts +2 -3
- package/dist/signing/index.d.ts.map +1 -1
- package/dist/signing/signers.d.ts +23 -11
- 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/burn.dto.d.ts +4 -2
- package/dist/types/burn.dto.d.ts.map +1 -1
- package/dist/types/common.d.ts +2 -23
- package/dist/types/common.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/launchpad.dto.d.ts +0 -269
- 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/options.dto.d.ts +8 -34
- package/dist/types/options.dto.d.ts.map +1 -1
- package/dist/types/session-auth.dto.d.ts +2 -4
- package/dist/types/session-auth.dto.d.ts.map +1 -1
- package/dist/types/user.dto.d.ts +7 -62
- package/dist/types/user.dto.d.ts.map +1 -1
- package/dist/utils/address-formatter.d.ts +10 -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 +6 -239
- 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-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 +0 -308
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/http.d.ts +15 -3
- package/dist/utils/http.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/trade-quote.d.ts +32 -0
- package/dist/utils/trade-quote.d.ts.map +1 -0
- 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 +3 -5
- package/dist/utils/validation-helpers.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/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/signing/eip712.d.ts +0 -13
- package/dist/signing/eip712.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/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/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/LaunchpadSDK.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
+
import type { GalaChainTokenClass, GalaChainTokenDetails, GalaChainTokenClassKey, HttpRequestor } from '@gala-chain/gala-core-sdk';
|
|
2
|
+
import type { BridgeableNetwork, BridgeFeeEstimate, BridgeInParams, BridgeOutParams, BridgeStatus, BridgeToken, BridgeTransaction, EstimateBridgeFeeParams, EthereumTransactionStatus, EthereumWalletBalanceResult, ExternalChainBalance, FetchBridgeableTokensOptions, FetchBridgeableTokensResult, FetchWrappableTokensOptions, FetchWrappableTokensResult, IsTokenBridgeableOptions, IsTokenBridgeableResult, IsTokenWrappableResult, SolanaTransactionStatus, SolanaWalletBalanceResult, UnwrapTokenOptions, WrappableToken, WrapTokenOptions, WrapUnwrapFeeEstimate, WrapUnwrapResult } from '@gala-chain/gala-core-sdk/bridge';
|
|
1
3
|
import { Wallet } from 'ethers';
|
|
2
|
-
import { GSwap } from '@gala-chain/gswap-sdk';
|
|
3
|
-
import type { BridgeFeeEstimate, BridgeInParams, BridgeOutParams, BridgeStatus, BridgeToken, BridgeTransaction, EstimateBridgeFeeParams, EthereumTransactionStatus, EthereumWalletBalanceResult, ExternalChainBalance, SolanaTransactionStatus, SolanaWalletBalanceResult } from './bridge/types/bridge.dto';
|
|
4
|
-
import type { BridgeableNetwork, FetchBridgeableTokensOptions, FetchBridgeableTokensResult, IsTokenBridgeableOptions, IsTokenBridgeableResult } from './bridge/types/bridgeable-token.dto';
|
|
5
4
|
import type { Environment } from './config/environments';
|
|
6
5
|
import { EventsBatcherService } from './services/EventsBatcherService';
|
|
7
6
|
import type { StreamEventCallbacks } from './services/StreamWebSocketService';
|
|
8
7
|
import { LaunchpadWrites } from './launchpad/writes';
|
|
9
|
-
import type { HttpRequestor } from './launchpad/bundle-submission';
|
|
10
8
|
import type { LaunchpadSigner } from './signing';
|
|
11
|
-
import { TokenWrites } from './tokens/transfers';
|
|
12
9
|
import type { GetAIModerationOptions, GetAIModerationResult, GetAIModerationSettingsResult, GetAIModerationStatusResult, TriggerAIModerationOptions, TriggerAIModerationResult, UpdateAIModerationSettingsOptions, UpdateAIModerationSettingsResult } from './types/ai-moderation.dto';
|
|
13
10
|
import type { ApiKeyData, ApiKeyListResponse, CreateApiKeyOptions, CreateApiKeyResponse, ListApiKeysOptions, UpdateApiKeyOptions } from './types/api-key.dto';
|
|
14
11
|
import type { ActiveUsersResult, BanListResult, BanStatusResult, CreateBanOptions, CreateBanResult, CreateGlobalBanOptions, CreateGlobalBanResult, GetActiveUsersOptions, GetBanStatusOptions, GetGlobalBanOptions, GlobalBanListResult, GlobalBanStatusResult, ListBansOptions, ListGlobalBansOptions, RemoveBanOptions, RemoveBanResult, RemoveGlobalBanOptions, RemoveGlobalBanResult } from './types/ban.dto';
|
|
@@ -17,11 +14,11 @@ import type { FlushResult } from './types/cache-management.dto';
|
|
|
17
14
|
import type { CreateChatMessageOptions, CreateChatMessageResult, GetChatMessagesOptions, GetChatMessagesResult, UpdateChatMessageOptions, UpdateChatMessageResult } from './types/chat-messages.dto';
|
|
18
15
|
import type { GetClientFlagsResult } from './types/client-config.dto';
|
|
19
16
|
import type { CommentsResult, CreateCommentOptions, CreateCommentResult, DeleteCommentResult, GetCommentsOptions, UpdateCommentOptions, UpdateCommentResult } from './types/comments.dto';
|
|
20
|
-
import type { AddressFormat, ApiResponse, SDKConfig,
|
|
17
|
+
import type { AddressFormat, ApiResponse, SDKConfig, TokenId } from './types/common';
|
|
21
18
|
import type { ActionFlagOptions, ActionFlagResult, CreateFlagOptions, CreateFlagResult, DismissFlagOptions, DismissFlagResult, FlagListResult, ListFlagsOptions, ListGlobalFlagsOptions } from './types/content-flag.dto';
|
|
22
19
|
import type { AddContentReactionOptions, AddContentReactionResult, RemoveContentReactionOptions, RemoveContentReactionResult } from './types/content-reactions.dto';
|
|
23
20
|
import type { FetchTokenStatsResult } from './types/engagement-stats.dto';
|
|
24
|
-
import type { AmountCalculationResult,
|
|
21
|
+
import type { AmountCalculationResult, FetchPoolsOptions, GraduationCalculationResult, GraphDataResult, LaunchTokenData, PoolData, PoolsResult, SaleDetailsResult, TokenDistributionResult, TokenHolder, TokenSpotPrice, TradeQuoteParams, UserHolderContext, ValidateTokenResponse } from './types/launchpad.dto';
|
|
25
22
|
import type { LockTokensData, LockTokensResult, UnlockTokensData, UnlockTokensResult } from './types/lock.dto';
|
|
26
23
|
import type { CreateMessageOptions, CreateMessageResult, DeleteMessageResult, FetchMessagesOptions, FetchMessagesResult, GetPinnedMessageResult, MessageStats, PinMessageResult, UpdateMessageOptions, UpdateMessageResult, UpdateTokenConfigOptions } from './types/messages.dto';
|
|
27
24
|
import type { TokenConfigData } from './types/token-config.dto';
|
|
@@ -45,12 +42,10 @@ import type { BalanceUpdatedPayload, ChatMessagePayload, ChatStatusPayload, Conn
|
|
|
45
42
|
import type { EngagementStatsUpdatedEvent } from './types/websocket-events.dto';
|
|
46
43
|
import type { CommentCreatedEvent, HolderCountUpdatedEvent, ModeratorAddedEvent, PoolMetadataUpdatedEvent, TokenBannedEvent, TradeExecutedEvent } from './types/websocket-events.dto';
|
|
47
44
|
import type { GetTokenWeeklyHistoryOptions, GetTokenWeeklyHistoryResult, GetWeeklyChallengeOptions, GetWeeklyChallengeResult } from './types/weekly-challenge.dto';
|
|
48
|
-
import type { FetchWrappableTokensOptions, FetchWrappableTokensResult, IsTokenWrappableResult, UnwrapTokenOptions, WrappableToken, WrapTokenOptions, WrapUnwrapFeeEstimate, WrapUnwrapResult, WrapUnwrapStatusResult } from './types/wrappable-token.dto';
|
|
49
45
|
import { TransactionFailedError, WebSocketError, WebSocketTimeoutError } from './utils/websocket-errors';
|
|
50
|
-
import type
|
|
46
|
+
import { type WalletProvider } from '@gala-chain/gala-core-sdk/providers';
|
|
51
47
|
export { TransactionFailedError, WebSocketError, WebSocketTimeoutError, };
|
|
52
48
|
import type { BuyTokenOptions, CalculateBuyAmountForGraduationOptions, CalculateBuyAmountLocalOptions, CalculateBuyAmountOptions, CalculateSellAmountLocalOptions, CalculateSellAmountOptions, FetchTokensCreatedOptions, FetchTokensHeldOptions, FetchTokenSpotPriceParams, FetchTradesOptions, FetchVolumeDataOptions, GraduateTokenOptions, SellTokenOptions, UploadImageByTokenNameOptions } from './types/options.dto';
|
|
53
|
-
import type { FetchPriceHistoryOptions, PriceHistoryResult } from './types/priceHistory.dto';
|
|
54
49
|
import type { GetPinnedMessageResult as LegacyGetPinnedMessageResult, PinMessageResult as LegacyPinMessageResult, UnpinMessageResult as LegacyUnpinMessageResult } from './types/stream-chat.dto';
|
|
55
50
|
import type { AvailableRolesResponse } from './types/streaming.dto';
|
|
56
51
|
import type { AuthenticatedEvent, BanEnforcementEvent, ChatStatusChangedEvent, ConnectionEvent, ContentFlaggedEvent, ContentReactionAddedEvent, ContentReactionRemovedEvent, DownloadReadyEvent, FlagResolvedEvent, RecordingsCountUpdatedEvent, RecordingStatusChangedEvent, RoomLeftEvent, RoomSubscribedEvent, SimulcastStatusChangedEvent, StreamChatDeletedEvent, StreamChatMessageEvent, StreamChatPinnedEvent, StreamChatUnpinnedEvent, StreamChatUpdatedEvent, StreamControlStatusChangedEvent, StreamCountdownUpdatedEvent, StreamLanguageUpdatedEvent, StreamReactionEvent, StreamStatusChangedEvent, TokenSubscribedEvent, TokenUnsubscribedEvent, UserBannedEvent, UserTypingEvent, UserUnbannedEvent, ViewerCountChangedEvent } from './types/streaming-events.dto';
|
|
@@ -131,7 +126,7 @@ export interface LaunchpadSDKConfig extends SDKConfig {
|
|
|
131
126
|
*
|
|
132
127
|
* @example Using private key (Node.js/CLI)
|
|
133
128
|
* ```typescript
|
|
134
|
-
* import { PrivateKeyProvider } from '@gala-chain/
|
|
129
|
+
* import { PrivateKeyProvider } from '@gala-chain/gala-core-sdk/providers';
|
|
135
130
|
*
|
|
136
131
|
* const provider = new PrivateKeyProvider('0x...');
|
|
137
132
|
* const sdk = new LaunchpadSDK({
|
|
@@ -142,7 +137,7 @@ export interface LaunchpadSDKConfig extends SDKConfig {
|
|
|
142
137
|
*
|
|
143
138
|
* @example Using browser wallet (React/Vue)
|
|
144
139
|
* ```typescript
|
|
145
|
-
* import { ExternalWalletProvider, detectWallets } from '@gala-chain/
|
|
140
|
+
* import { ExternalWalletProvider, detectWallets } from '@gala-chain/gala-core-sdk/providers';
|
|
146
141
|
*
|
|
147
142
|
* const { wallets } = await detectWallets();
|
|
148
143
|
* const provider = new ExternalWalletProvider(wallets[0].provider);
|
|
@@ -292,9 +287,15 @@ export declare class LaunchpadSDK {
|
|
|
292
287
|
/** Default calculation mode for all amount calculations - 'local' for instant client-side bonding curve calculations */
|
|
293
288
|
static readonly DEFAULT_CALCULATE_AMOUNT_MODE: 'local' | 'external';
|
|
294
289
|
private wallet;
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
290
|
+
/** Declared `galaChainAddress` (e.g. a `client|` alias): the construction key's, dropped when the wallet changes. */
|
|
291
|
+
private galaChainAddressOverride;
|
|
292
|
+
/**
|
|
293
|
+
* Declared identity: explicit `walletAddress`, else (without a wallet) the signer's own address.
|
|
294
|
+
* Dropped when the wallet changes (it named the construction key, not the new one).
|
|
295
|
+
*/
|
|
296
|
+
private signerWalletAddress;
|
|
297
|
+
/** The token-write signer and identity of an SDK with no wallet (`{ signer, walletAddress }`). */
|
|
298
|
+
private tokenWriter;
|
|
298
299
|
private readonly auth;
|
|
299
300
|
private readonly jwtAuth;
|
|
300
301
|
private readonly sessionAuth;
|
|
@@ -310,20 +311,24 @@ export declare class LaunchpadSDK {
|
|
|
310
311
|
private readonly maxAcceptableReverseBondingCurveFeeSlippageFactor;
|
|
311
312
|
private readonly calculateAmountMode;
|
|
312
313
|
private readonly logger;
|
|
313
|
-
private readonly dexClient;
|
|
314
314
|
private readonly tokenResolverService;
|
|
315
315
|
private readonly launchpadService;
|
|
316
|
-
|
|
317
|
-
private
|
|
318
|
-
private readonly
|
|
316
|
+
/** Rebuilt whenever the wallet changes: its token writes sign as the wallet it was built with. */
|
|
317
|
+
private galaChainService;
|
|
318
|
+
private readonly priceService;
|
|
319
|
+
/** Signs bundle trades as the wallet: rebuilt when the wallet changes (see onWalletChanged). */
|
|
320
|
+
private bundleService;
|
|
321
|
+
/** The sell fee ceiling resolver every BundleService of this SDK uses. */
|
|
322
|
+
private readonly sellFeeCeiling;
|
|
319
323
|
private readonly websocketService;
|
|
320
|
-
private readonly priceHistoryService;
|
|
321
324
|
private readonly cache;
|
|
322
|
-
|
|
325
|
+
/** Counts wallet changes: a bridge call that started under one wallet never runs under the next. */
|
|
326
|
+
private walletGeneration;
|
|
327
|
+
private _bridgeService;
|
|
323
328
|
private _bridgeableTokenService?;
|
|
324
329
|
private _wrappableTokenService?;
|
|
325
|
-
private _wrapService
|
|
326
|
-
private _galaConnectClient
|
|
330
|
+
private _wrapService;
|
|
331
|
+
private _galaConnectClient;
|
|
327
332
|
private _streamingService;
|
|
328
333
|
private _streamChatService;
|
|
329
334
|
private _streamWebSocketService;
|
|
@@ -360,8 +365,6 @@ export declare class LaunchpadSDK {
|
|
|
360
365
|
private readonly launchpadAPI;
|
|
361
366
|
/** v6 launchpad write surface. */
|
|
362
367
|
readonly launchpad: LaunchpadWrites;
|
|
363
|
-
/** v6 native token write surface. */
|
|
364
|
-
readonly tokens: TokenWrites;
|
|
365
368
|
constructor(config: LaunchpadSDKConfig);
|
|
366
369
|
/**
|
|
367
370
|
* Creates a temporary SDK instance with a different wallet for privateKey override operations.
|
|
@@ -373,18 +376,6 @@ export declare class LaunchpadSDK {
|
|
|
373
376
|
* @throws Error if privateKey format is invalid
|
|
374
377
|
*/
|
|
375
378
|
private createOverrideSdk;
|
|
376
|
-
/**
|
|
377
|
-
* Access the shared GSwap DEX client.
|
|
378
|
-
*
|
|
379
|
-
* @returns The single `@gala-chain/gswap-sdk` client configured with this SDK's signer and hosts.
|
|
380
|
-
*
|
|
381
|
-
* @example
|
|
382
|
-
* ```typescript
|
|
383
|
-
* const quote = await sdk.dex.quoting.quoteExactInput('GALA', 'GUSDC', '1');
|
|
384
|
-
* console.log(quote.amountOut);
|
|
385
|
-
* ```
|
|
386
|
-
*/
|
|
387
|
-
get dex(): GSwap;
|
|
388
379
|
/**
|
|
389
380
|
* Gets the authenticated user's address in backend format
|
|
390
381
|
*
|
|
@@ -480,6 +471,11 @@ export declare class LaunchpadSDK {
|
|
|
480
471
|
* ```
|
|
481
472
|
*/
|
|
482
473
|
validateWallet(): Wallet;
|
|
474
|
+
/**
|
|
475
|
+
* Token writes (transfer, burn, lock, unlock) need the wallet, or (an SDK configured with
|
|
476
|
+
* `{ signer, walletAddress }`) a declared signer and identity. Same error as `validateWallet`.
|
|
477
|
+
*/
|
|
478
|
+
private assertTokenWriter;
|
|
483
479
|
/**
|
|
484
480
|
* Sets or updates the wallet for the SDK
|
|
485
481
|
*
|
|
@@ -516,6 +512,27 @@ export declare class LaunchpadSDK {
|
|
|
516
512
|
* ```
|
|
517
513
|
*/
|
|
518
514
|
setWallet(wallet: Wallet): void;
|
|
515
|
+
/**
|
|
516
|
+
* Everything the SDK built around the previous wallet's key or address follows the new one, so no
|
|
517
|
+
* write signs as, and no request is sent from, an identity the SDK no longer has:
|
|
518
|
+
* - an identity declared at construction (`walletAddress`, `galaChainAddress`) named the
|
|
519
|
+
* construction key: it is dropped, and `getAddress()` is the new wallet's;
|
|
520
|
+
* - the token writes (transfer, burn, lock, unlock) and the bundle trades (`buyTokens`,
|
|
521
|
+
* `sellTokens`) are rebuilt for the new wallet now;
|
|
522
|
+
* - the bridge service, the wrap service and the GalaConnect client (built on first use with the
|
|
523
|
+
* wallet's key and address) are dropped, and the next bridge, wrap or GalaConnect call builds
|
|
524
|
+
* them for the new wallet.
|
|
525
|
+
*/
|
|
526
|
+
private onWalletChanged;
|
|
527
|
+
/** The bundle trading service, signing as the current wallet (none: trading is refused). */
|
|
528
|
+
private createBundleService;
|
|
529
|
+
/**
|
|
530
|
+
* The token writes (transfer, burn, lock, unlock) sign as the wallet the GalaChain service was
|
|
531
|
+
* built with, so the service is rebuilt whenever the wallet changes: a write never signs as, or
|
|
532
|
+
* is made from, an identity the SDK no longer has. A declared `{ signer, walletAddress }` identity
|
|
533
|
+
* from construction no longer applies once the wallet changes (no wallet then means no writes).
|
|
534
|
+
*/
|
|
535
|
+
private rebuildTokenWrites;
|
|
519
536
|
/**
|
|
520
537
|
* Sets or updates the wallet provider for authentication
|
|
521
538
|
*
|
|
@@ -526,7 +543,7 @@ export declare class LaunchpadSDK {
|
|
|
526
543
|
*
|
|
527
544
|
* @example
|
|
528
545
|
* ```typescript
|
|
529
|
-
* import { ExternalWalletProvider, detectWallets } from '@gala-chain/
|
|
546
|
+
* import { ExternalWalletProvider, detectWallets } from '@gala-chain/gala-core-sdk/providers';
|
|
530
547
|
*
|
|
531
548
|
* // Detect available wallets
|
|
532
549
|
* const { wallets } = await detectWallets();
|
|
@@ -1021,74 +1038,47 @@ export declare class LaunchpadSDK {
|
|
|
1021
1038
|
*/
|
|
1022
1039
|
fetchUserHolderContext(tokenName: string, userAddress: string): Promise<UserHolderContext>;
|
|
1023
1040
|
/**
|
|
1024
|
-
* Fetch
|
|
1041
|
+
* Fetch a launchpad token's USD spot price.
|
|
1025
1042
|
*
|
|
1026
|
-
*
|
|
1027
|
-
*
|
|
1028
|
-
* -
|
|
1029
|
-
* - **tokenId** → DEX Backend API `/market/price` (direct pricing)
|
|
1043
|
+
* - A token still on its bonding curve: GALA's USD price divided by the tokens 1 GALA buys
|
|
1044
|
+
* (the launchpad backend's bonding-curve calculation).
|
|
1045
|
+
* - A graduated token: its USD price on the swap backend.
|
|
1030
1046
|
*
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
1047
|
+
* Only launchpad tokens (by name) are priced here. Any token by class key, and GALA itself, is
|
|
1048
|
+
* priced by gswap-sdk: `gSwap.market.getPrice('GALA|Unit|none|none')`.
|
|
1033
1049
|
*
|
|
1034
|
-
* @
|
|
1035
|
-
*
|
|
1036
|
-
* const price = await sdk.fetchTokenPrice({ tokenName: 'galadog' });
|
|
1037
|
-
* console.log(`${price.symbol}: $${price.price.toFixed(6)}`);
|
|
1038
|
-
* // Returns DEX price for graduated tokens, bonding curve price for active tokens
|
|
1039
|
-
* ```
|
|
1050
|
+
* @param params The launchpad token's name
|
|
1051
|
+
* @returns Promise<TokenSpotPrice> The token's symbol and USD price
|
|
1040
1052
|
*
|
|
1041
|
-
* @example
|
|
1053
|
+
* @example
|
|
1042
1054
|
* ```typescript
|
|
1043
|
-
* const price = await sdk.fetchTokenPrice({
|
|
1044
|
-
* tokenId: 'Token|Unit|GDOG|eth:0x...'
|
|
1045
|
-
* });
|
|
1055
|
+
* const price = await sdk.fetchTokenPrice({ tokenName: 'galadog' });
|
|
1046
1056
|
* console.log(`${price.symbol}: $${price.price.toFixed(6)}`);
|
|
1047
1057
|
* ```
|
|
1048
1058
|
*
|
|
1049
|
-
* @throws ValidationError if
|
|
1050
|
-
* @throws
|
|
1051
|
-
* @throws Error if API request fails or token not found
|
|
1059
|
+
* @throws ValidationError if `tokenName` is missing or empty, or a `tokenId` is given
|
|
1060
|
+
* @throws NetworkError if the calculation or a price read fails
|
|
1052
1061
|
*/
|
|
1053
1062
|
fetchTokenPrice(params: FetchTokenSpotPriceParams): Promise<TokenSpotPrice>;
|
|
1054
1063
|
/**
|
|
1055
|
-
* Fetch
|
|
1056
|
-
*
|
|
1057
|
-
* Convenience method for fetching GALA price specifically via the DEX Backend API.
|
|
1058
|
-
* Uses the smart router with the standard GALA token ID.
|
|
1059
|
-
*
|
|
1060
|
-
* @returns Promise<TokenSpotPrice> GALA spot price data with symbol and USD price
|
|
1064
|
+
* Fetch comprehensive token details from GalaChain
|
|
1061
1065
|
*
|
|
1062
|
-
*
|
|
1063
|
-
*
|
|
1064
|
-
* const galaPrice = await sdk.fetchGalaPrice();
|
|
1065
|
-
* console.log(`GALA: $${galaPrice.price.toFixed(6)}`);
|
|
1066
|
-
* ```
|
|
1067
|
-
*
|
|
1068
|
-
* @throws Error if GALA price not available
|
|
1069
|
-
* @throws Error if DEX Backend API client not configured
|
|
1070
|
-
*/
|
|
1071
|
-
fetchGalaPrice(): Promise<TokenSpotPrice>;
|
|
1072
|
-
/**
|
|
1073
|
-
* Fetch comprehensive token details from DEX API platform
|
|
1074
|
-
*
|
|
1075
|
-
* Queries the DEX API platform endpoint to retrieve complete token metadata
|
|
1076
|
-
* including image, decimals, description, verification status, network information,
|
|
1077
|
-
* and trading capabilities.
|
|
1066
|
+
* Reads the token's GalaChain token class (symbol, decimals, name, image, description, network,
|
|
1067
|
+
* contract address).
|
|
1078
1068
|
*
|
|
1079
1069
|
* Supports flexible token identification using either string or object format:
|
|
1080
1070
|
* - String: `'GUSDC|Unit|none|eth:0x...'` (pipe-delimited)
|
|
1081
1071
|
* - Object: `{ collection, category, type, additionalKey }`
|
|
1082
1072
|
*
|
|
1083
1073
|
* @param tokenId Token identifier in flexible format
|
|
1084
|
-
* @returns Promise<
|
|
1074
|
+
* @returns Promise<GalaChainTokenDetails> The token class's details (gala-core-sdk's type)
|
|
1085
1075
|
*
|
|
1086
1076
|
* @example String format
|
|
1087
1077
|
* ```typescript
|
|
1088
1078
|
* const details = await sdk.fetchTokenDetails('GUSDC|Unit|none|none');
|
|
1089
1079
|
* console.log(details.symbol); // 'GUSDC'
|
|
1090
1080
|
* console.log(details.decimals); // 6
|
|
1091
|
-
* console.log(details.
|
|
1081
|
+
* console.log(details.network); // the token's network
|
|
1092
1082
|
* console.log(details.image); // 'https://...'
|
|
1093
1083
|
* ```
|
|
1094
1084
|
*
|
|
@@ -1106,167 +1096,18 @@ export declare class LaunchpadSDK {
|
|
|
1106
1096
|
* @throws {NetworkError} If API request fails or token not found
|
|
1107
1097
|
*/
|
|
1108
1098
|
fetchTokenDetails(tokenId: TokenId): Promise<GalaChainTokenDetails>;
|
|
1109
|
-
/**
|
|
1110
|
-
* Fetch all available DEX leaderboard seasons
|
|
1111
|
-
*
|
|
1112
|
-
* Returns all season configurations with time ranges. Use season IDs
|
|
1113
|
-
* to fetch specific leaderboards with `fetchDexLeaderboardBySeasonId()`.
|
|
1114
|
-
*
|
|
1115
|
-
* @category DEX Leaderboard
|
|
1116
|
-
* @returns Promise<DexSeason[]> Array of all seasons
|
|
1117
|
-
* @throws {NetworkError} If API request fails
|
|
1118
|
-
* @since 3.X.0
|
|
1119
|
-
*
|
|
1120
|
-
* @example
|
|
1121
|
-
* ```typescript
|
|
1122
|
-
* const seasons = await sdk.fetchAllDexSeasons();
|
|
1123
|
-
* console.log(`Found ${seasons.length} seasons`);
|
|
1124
|
-
* seasons.forEach(s => {
|
|
1125
|
-
* console.log(`${s.name}: ${s.start} to ${s.end}`);
|
|
1126
|
-
* });
|
|
1127
|
-
* ```
|
|
1128
|
-
*/
|
|
1129
|
-
fetchAllDexSeasons(): Promise<DexSeason[]>;
|
|
1130
|
-
/**
|
|
1131
|
-
* Find the currently active DEX leaderboard season
|
|
1132
|
-
*
|
|
1133
|
-
* Determines which season is active based on current time falling
|
|
1134
|
-
* between season start and end dates. Returns null if no season
|
|
1135
|
-
* is currently active.
|
|
1136
|
-
*
|
|
1137
|
-
* @category DEX Leaderboard
|
|
1138
|
-
* @returns Promise<DexSeason | null> Current season or null
|
|
1139
|
-
* @throws {NetworkError} If API request fails
|
|
1140
|
-
* @since 3.X.0
|
|
1141
|
-
*
|
|
1142
|
-
* @example
|
|
1143
|
-
* ```typescript
|
|
1144
|
-
* const current = await sdk.fetchCurrentDexSeason();
|
|
1145
|
-
* if (current) {
|
|
1146
|
-
* console.log(`Active: ${current.name} (ID: ${current.id})`);
|
|
1147
|
-
* } else {
|
|
1148
|
-
* console.log('No active season');
|
|
1149
|
-
* }
|
|
1150
|
-
* ```
|
|
1151
|
-
*/
|
|
1152
|
-
fetchCurrentDexSeason(): Promise<DexSeason | null>;
|
|
1153
|
-
/**
|
|
1154
|
-
* Fetch DEX leaderboard for a specific season
|
|
1155
|
-
*
|
|
1156
|
-
* Returns complete leaderboard rankings with XP metrics and achievement titles.
|
|
1157
|
-
* Non-paginated response includes all entries (typically 100 participants).
|
|
1158
|
-
*
|
|
1159
|
-
* **XP Metrics:**
|
|
1160
|
-
* - `totalXp`: Combined liquidity + trading XP
|
|
1161
|
-
* - `liquidityXp`: Points from providing liquidity
|
|
1162
|
-
* - `tradingXp`: Points from trading volume
|
|
1163
|
-
*
|
|
1164
|
-
* **Achievement Titles:**
|
|
1165
|
-
* - Liquidity titles: Pool Explorer, Flow Enabler, Yield Artisan, etc.
|
|
1166
|
-
* - Trading titles: Novice Trader, Rookie Trader, Elite Trader, etc.
|
|
1167
|
-
* - Order indicates tier (1 = entry level, higher = more advanced)
|
|
1168
|
-
*
|
|
1169
|
-
* @category DEX Leaderboard
|
|
1170
|
-
* @param seasonId Season identifier number (must be positive integer)
|
|
1171
|
-
* @returns Promise<LeaderboardResult> Complete leaderboard with rankings and metrics
|
|
1172
|
-
* @throws {RequiredFieldError} If seasonId is invalid
|
|
1173
|
-
* @throws {NetworkError} If API request fails
|
|
1174
|
-
* @since 3.X.0
|
|
1175
|
-
*
|
|
1176
|
-
* @example
|
|
1177
|
-
* ```typescript
|
|
1178
|
-
* // Fetch specific season leaderboard
|
|
1179
|
-
* const leaderboard = await sdk.fetchDexLeaderboardBySeasonId(4);
|
|
1180
|
-
*
|
|
1181
|
-
* // Display top trader
|
|
1182
|
-
* const topTrader = leaderboard.entries[0];
|
|
1183
|
-
* console.log(`Rank 1: ${topTrader.wallet}`);
|
|
1184
|
-
* console.log(`Total XP: ${topTrader.totalXp}`);
|
|
1185
|
-
* console.log(`Distribution: ${topTrader.distributionPercent}%`);
|
|
1186
|
-
*
|
|
1187
|
-
* // Find users with specific titles
|
|
1188
|
-
* const whales = leaderboard.entries.filter(entry =>
|
|
1189
|
-
* entry.masteryTitles.some(t => t.name === 'Protocol Whale')
|
|
1190
|
-
* );
|
|
1191
|
-
* ```
|
|
1192
|
-
*/
|
|
1193
|
-
fetchDexLeaderboardBySeasonId(seasonId: number): Promise<LeaderboardResult>;
|
|
1194
|
-
/**
|
|
1195
|
-
* Fetch leaderboard for the currently active season
|
|
1196
|
-
*
|
|
1197
|
-
* Convenience method that automatically determines the current season
|
|
1198
|
-
* and fetches its leaderboard. Returns null if no season is active.
|
|
1199
|
-
*
|
|
1200
|
-
* Equivalent to:
|
|
1201
|
-
* ```typescript
|
|
1202
|
-
* const season = await sdk.fetchCurrentDexSeason();
|
|
1203
|
-
* return season ? sdk.fetchDexLeaderboardBySeasonId(season.id) : null;
|
|
1204
|
-
* ```
|
|
1205
|
-
*
|
|
1206
|
-
* @category DEX Leaderboard
|
|
1207
|
-
* @returns Promise<LeaderboardResult | null> Current leaderboard or null
|
|
1208
|
-
* @throws {NetworkError} If API request fails
|
|
1209
|
-
* @since 3.X.0
|
|
1210
|
-
*
|
|
1211
|
-
* @example
|
|
1212
|
-
* ```typescript
|
|
1213
|
-
* // Get current leaderboard in one call
|
|
1214
|
-
* const leaderboard = await sdk.fetchCurrentDexLeaderboard();
|
|
1215
|
-
*
|
|
1216
|
-
* if (leaderboard) {
|
|
1217
|
-
* console.log(`Season ${leaderboard.seasonId} leaders:`);
|
|
1218
|
-
* leaderboard.entries.slice(0, 10).forEach(entry => {
|
|
1219
|
-
* console.log(`${entry.rank}. ${entry.wallet}: ${entry.totalXp} XP`);
|
|
1220
|
-
* });
|
|
1221
|
-
* } else {
|
|
1222
|
-
* console.log('No active season');
|
|
1223
|
-
* }
|
|
1224
|
-
* ```
|
|
1225
|
-
*/
|
|
1226
|
-
fetchCurrentDexLeaderboard(): Promise<LeaderboardResult | null>;
|
|
1227
|
-
/**
|
|
1228
|
-
* Fetch DEX aggregated volume summary with trend metrics
|
|
1229
|
-
*
|
|
1230
|
-
* Returns platform-wide trading volume statistics across all DEX pools with
|
|
1231
|
-
* 1-day, 7-day, and 30-day comparisons and percentage changes.
|
|
1232
|
-
*
|
|
1233
|
-
* **Use Cases:**
|
|
1234
|
-
* - Monitor overall DEX trading activity
|
|
1235
|
-
* - Identify volume trends and patterns
|
|
1236
|
-
* - Compare performance across time periods
|
|
1237
|
-
* - Detect market changes (increases/decreases)
|
|
1238
|
-
*
|
|
1239
|
-
* @category DEX Analytics
|
|
1240
|
-
* @returns Promise<DexAggregatedVolumeSummary> Volume metrics with deltas
|
|
1241
|
-
* @throws {NetworkError} If API request fails
|
|
1242
|
-
* @since 4.0.0
|
|
1243
|
-
*
|
|
1244
|
-
* @example
|
|
1245
|
-
* ```typescript
|
|
1246
|
-
* const summary = await sdk.fetchDexAggregatedVolumeSummary();
|
|
1247
|
-
* console.log(`Today's volume: $${summary.volume1d.toFixed(2)}`);
|
|
1248
|
-
* console.log(`7-day change: ${(summary.volume7dDelta * 100).toFixed(2)}%`);
|
|
1249
|
-
*
|
|
1250
|
-
* // Analyze trend direction
|
|
1251
|
-
* if (summary.volume1dDelta > 0) {
|
|
1252
|
-
* console.log('✅ Volume increasing');
|
|
1253
|
-
* } else {
|
|
1254
|
-
* console.log('📉 Volume decreasing');
|
|
1255
|
-
* }
|
|
1256
|
-
* ```
|
|
1257
|
-
*/
|
|
1258
|
-
fetchDexAggregatedVolumeSummary(): Promise<DexAggregatedVolumeSummary>;
|
|
1259
1099
|
/**
|
|
1260
1100
|
* Fetch the current launchpad token launch fee
|
|
1261
1101
|
*
|
|
1262
1102
|
* Returns the GALA fee amount required to launch a new token.
|
|
1263
1103
|
* This fee is dynamic and may vary based on network conditions.
|
|
1264
1104
|
* Call this before launching a token to ensure you have sufficient balance.
|
|
1105
|
+
* Served by the launchpad backend (`GET /v1/trading/fee`, cached 1 hour); identical to
|
|
1106
|
+
* {@link LaunchpadSDK.fetchLaunchpadFee}.
|
|
1265
1107
|
*
|
|
1266
1108
|
* @returns Promise<number> The current launch fee in GALA (e.g., 0.001)
|
|
1267
1109
|
* @throws {Error} Network errors from connection failures or timeouts
|
|
1268
|
-
* @throws {
|
|
1269
|
-
* @throws {Error} API errors when the GalaChain response indicates failure
|
|
1110
|
+
* @throws {ValidationError} If the backend returns an error response
|
|
1270
1111
|
*
|
|
1271
1112
|
* @example
|
|
1272
1113
|
* ```typescript
|
|
@@ -1291,7 +1132,7 @@ export declare class LaunchpadSDK {
|
|
|
1291
1132
|
* - Token metadata (symbol, decimals, name)
|
|
1292
1133
|
*
|
|
1293
1134
|
* @param tokenClasses Array of token class keys to query
|
|
1294
|
-
* @returns Promise<
|
|
1135
|
+
* @returns Promise<GalaChainTokenClass[]> Array of token classes with supply information
|
|
1295
1136
|
* @throws {ValidationError} if tokenClasses array is empty
|
|
1296
1137
|
* @throws {Error} if network request fails
|
|
1297
1138
|
*
|
|
@@ -1318,12 +1159,12 @@ export declare class LaunchpadSDK {
|
|
|
1318
1159
|
* @category Token Data
|
|
1319
1160
|
* @since 3.32.0
|
|
1320
1161
|
*/
|
|
1321
|
-
fetchTokenClassesWithSupply(tokenClasses:
|
|
1162
|
+
fetchTokenClassesWithSupply(tokenClasses: GalaChainTokenClassKey[]): Promise<GalaChainTokenClass[]>;
|
|
1322
1163
|
/**
|
|
1323
1164
|
* Fetch pool details for a token - returns complete bonding curve pool state
|
|
1324
1165
|
*
|
|
1325
1166
|
* Delegates to fetchPoolDetailsForCalculation for normalized fee factors and
|
|
1326
|
-
* computed values, then enriches with full pool data from
|
|
1167
|
+
* computed values, then enriches with full pool data from the launchpad backend.
|
|
1327
1168
|
*
|
|
1328
1169
|
* @param tokenName Token name to fetch pool details for
|
|
1329
1170
|
* @returns Promise<PoolDetailsData>
|
|
@@ -1451,33 +1292,28 @@ export declare class LaunchpadSDK {
|
|
|
1451
1292
|
* market engagement. Data is aggregated by time period with buy/sell breakdowns.
|
|
1452
1293
|
*
|
|
1453
1294
|
* @category Trading Data
|
|
1454
|
-
* @param options - Volume data options
|
|
1455
|
-
* @param options.tokenName - Token name to fetch volume data for
|
|
1456
|
-
* @param options.
|
|
1457
|
-
* @param options.
|
|
1458
|
-
* @param options.
|
|
1459
|
-
* @returns
|
|
1460
|
-
* @throws {ValidationError} If tokenName is
|
|
1295
|
+
* @param options - Volume data options
|
|
1296
|
+
* @param options.tokenName - Token name to fetch volume data for
|
|
1297
|
+
* @param options.from - Start of the range, a Unix timestamp in seconds (at least 173000000)
|
|
1298
|
+
* @param options.to - End of the range, a Unix timestamp in seconds (at least 173000000)
|
|
1299
|
+
* @param options.resolution - The chart resolution the backend aggregates by (at least 1)
|
|
1300
|
+
* @returns `{ dataPoints }`: `{ timestamp, value, ... }` points, as the backend's chart returns them
|
|
1301
|
+
* @throws {ValidationError} If tokenName is invalid, or `from`, `to` or `resolution` is missing
|
|
1302
|
+
* (`MISSING_GRAPH_OPTIONS`) or out of range: all three are required although the type marks
|
|
1303
|
+
* them optional
|
|
1461
1304
|
* @throws {NetworkError} If API request fails
|
|
1462
1305
|
* @since 4.0.4-beta.0
|
|
1463
1306
|
*
|
|
1464
|
-
* @example
|
|
1465
|
-
* ```typescript
|
|
1466
|
-
* const volumeData = await sdk.fetchVolumeData({ tokenName: 'anime' });
|
|
1467
|
-
* console.log(`Total data points: ${volumeData.length}`);
|
|
1468
|
-
* volumeData.forEach(point => {
|
|
1469
|
-
* console.log(`${point.timestamp}: $${point.volume} volume`);
|
|
1470
|
-
* });
|
|
1471
|
-
* ```
|
|
1472
|
-
*
|
|
1473
|
-
* @example Fetch volume for date range
|
|
1307
|
+
* @example Volume over the last 30 days
|
|
1474
1308
|
* ```typescript
|
|
1475
|
-
* const
|
|
1476
|
-
*
|
|
1477
|
-
*
|
|
1478
|
-
*
|
|
1309
|
+
* const now = Math.floor(Date.now() / 1000);
|
|
1310
|
+
* const { dataPoints } = await sdk.fetchVolumeData({
|
|
1311
|
+
* tokenName: 'anime',
|
|
1312
|
+
* from: now - 30 * 24 * 60 * 60,
|
|
1313
|
+
* to: now,
|
|
1314
|
+
* resolution: 5,
|
|
1479
1315
|
* });
|
|
1480
|
-
* console.log(
|
|
1316
|
+
* dataPoints.forEach((point) => console.log(`${point.timestamp}: ${point.value}`));
|
|
1481
1317
|
* ```
|
|
1482
1318
|
*/
|
|
1483
1319
|
fetchVolumeData(options: FetchVolumeDataOptions): Promise<GraphDataResult>;
|
|
@@ -1574,14 +1410,24 @@ export declare class LaunchpadSDK {
|
|
|
1574
1410
|
* ```
|
|
1575
1411
|
*/
|
|
1576
1412
|
fetchGalaBalance(address?: string): Promise<TokenBalanceResult | null>;
|
|
1413
|
+
/**
|
|
1414
|
+
* gala-core-sdk's `./bridge` for a bridge or wrap call (see `loadCoreBridge`). The call was made
|
|
1415
|
+
* with the SDK's wallet of NOW: if the wallet changes while the module loads, the call is refused
|
|
1416
|
+
* rather than run as the next wallet's identity.
|
|
1417
|
+
*
|
|
1418
|
+
* @throws ConfigurationError if `./bridge` (or its optional peers) cannot be loaded, or the wallet
|
|
1419
|
+
* changed meanwhile
|
|
1420
|
+
*/
|
|
1421
|
+
private coreBridge;
|
|
1577
1422
|
/**
|
|
1578
1423
|
* Lazy-initialize BridgeService when first needed.
|
|
1579
1424
|
*
|
|
1580
1425
|
* The BridgeService requires external chain configuration (Ethereum/Solana private keys)
|
|
1581
1426
|
* which may not be available in all SDK usage scenarios. This method provides on-demand
|
|
1582
|
-
* initialization to avoid requiring bridge configuration for non-bridge operations.
|
|
1427
|
+
* initialization to avoid requiring bridge configuration for non-bridge operations. It is built
|
|
1428
|
+
* for the wallet configured at its first use and dropped when the wallet changes.
|
|
1583
1429
|
*
|
|
1584
|
-
* @param
|
|
1430
|
+
* @param bridge gala-core-sdk's `./bridge`, from {@link LaunchpadSDK.coreBridge}
|
|
1585
1431
|
* @returns Configured BridgeService instance
|
|
1586
1432
|
* @throws Error if no wallet is configured for GalaChain operations
|
|
1587
1433
|
*
|
|
@@ -1595,6 +1441,7 @@ export declare class LaunchpadSDK {
|
|
|
1595
1441
|
* and caches it permanently (tokens never change). This allows dynamic
|
|
1596
1442
|
* contract address lookups without hardcoded values.
|
|
1597
1443
|
*
|
|
1444
|
+
* @param bridge gala-core-sdk's `./bridge`, from {@link LaunchpadSDK.coreBridge}
|
|
1598
1445
|
* @returns Configured BridgeableTokenService instance
|
|
1599
1446
|
*
|
|
1600
1447
|
* @internal This is a private helper method for bridgeable token operations
|
|
@@ -1607,6 +1454,7 @@ export declare class LaunchpadSDK {
|
|
|
1607
1454
|
* The service fetches wrappable tokens from DEX API (wrappable=true)
|
|
1608
1455
|
* and caches them permanently for generic queries.
|
|
1609
1456
|
*
|
|
1457
|
+
* @param bridge gala-core-sdk's `./bridge`, from {@link LaunchpadSDK.coreBridge}
|
|
1610
1458
|
* @returns Configured WrappableTokenService instance
|
|
1611
1459
|
*
|
|
1612
1460
|
* @internal This is a private helper method for wrappable token operations
|
|
@@ -1618,6 +1466,7 @@ export declare class LaunchpadSDK {
|
|
|
1618
1466
|
* Lazily initializes the GalaConnectClient on first use.
|
|
1619
1467
|
* Used for bridge and wrap/unwrap operations via the DEX API platform.
|
|
1620
1468
|
*
|
|
1469
|
+
* @param bridge gala-core-sdk's `./bridge`, from {@link LaunchpadSDK.coreBridge}
|
|
1621
1470
|
* @returns Configured GalaConnectClient instance
|
|
1622
1471
|
* @throws Error if wallet is not configured
|
|
1623
1472
|
*
|
|
@@ -1631,8 +1480,9 @@ export declare class LaunchpadSDK {
|
|
|
1631
1480
|
* The service handles cross-channel wrap/unwrap operations
|
|
1632
1481
|
* (e.g., MUSIC → GMUSIC, GMUSIC → MUSIC).
|
|
1633
1482
|
*
|
|
1483
|
+
* @param bridge gala-core-sdk's `./bridge`, from {@link LaunchpadSDK.coreBridge}
|
|
1634
1484
|
* @returns Configured WrapService instance
|
|
1635
|
-
* @throws Error if wallet is
|
|
1485
|
+
* @throws Error if no wallet address is configured (the GalaConnect client needs one)
|
|
1636
1486
|
*
|
|
1637
1487
|
* @internal This is a private helper method for wrap/unwrap operations
|
|
1638
1488
|
*/
|
|
@@ -2060,7 +1910,7 @@ export declare class LaunchpadSDK {
|
|
|
2060
1910
|
* @example Check bridge transaction status
|
|
2061
1911
|
* ```typescript
|
|
2062
1912
|
* const bridgeResult = await sdk.bridgeOut({
|
|
2063
|
-
* tokenId: '
|
|
1913
|
+
* tokenId: 'GALA|Unit|none|none',
|
|
2064
1914
|
* amount: '100',
|
|
2065
1915
|
* destinationChain: 'Ethereum',
|
|
2066
1916
|
* recipientAddress: '0x1234...',
|
|
@@ -2469,30 +2319,32 @@ export declare class LaunchpadSDK {
|
|
|
2469
2319
|
* NOT an external bridge (Ethereum/Solana).
|
|
2470
2320
|
*
|
|
2471
2321
|
* @param options - Wrap options including tokenId and amount
|
|
2472
|
-
* @returns Promise resolving to
|
|
2473
|
-
* @throws
|
|
2474
|
-
*
|
|
2322
|
+
* @returns Promise resolving to the completed wrap
|
|
2323
|
+
* @throws GalaSDKError (`@gala-chain/gala-core-sdk`): `TOKEN_NOT_WRAPPABLE`,
|
|
2324
|
+
* `INVALID_WRAP_DIRECTION` (already on the asset channel), `INVALID_BRIDGE_OPTION` (no wallet),
|
|
2325
|
+
* `BRIDGE_REQUEST_REJECTED` (GalaChain refused it: nothing locked), `BRIDGE_OUT_OUTCOME_UNKNOWN`
|
|
2326
|
+
* (accepted, then failed: never wrap again)
|
|
2475
2327
|
*
|
|
2476
2328
|
* @since 4.0.18
|
|
2477
2329
|
* @category Wrap/Unwrap
|
|
2478
2330
|
*
|
|
2479
2331
|
* @example Wrap MUSIC to GMUSIC
|
|
2480
2332
|
* ```typescript
|
|
2333
|
+
* // token ids are class keys (a bare symbol such as 'MUSIC' is refused)
|
|
2481
2334
|
* const result = await sdk.wrapToken({
|
|
2482
|
-
* tokenId: 'MUSIC',
|
|
2335
|
+
* tokenId: '$MUSIC|Unit|none|none',
|
|
2483
2336
|
* amount: '100'
|
|
2484
2337
|
* });
|
|
2485
2338
|
* console.log(`Wrapped ${result.amount} ${result.fromToken} → ${result.toToken}`);
|
|
2486
2339
|
* console.log(`Transaction: ${result.transactionId}`);
|
|
2487
2340
|
* ```
|
|
2488
2341
|
*
|
|
2489
|
-
* @example With recipient
|
|
2342
|
+
* @example With a recipient
|
|
2490
2343
|
* ```typescript
|
|
2491
2344
|
* const result = await sdk.wrapToken({
|
|
2492
2345
|
* tokenId: '$MUSIC|Unit|none|none',
|
|
2493
2346
|
* amount: '50',
|
|
2494
|
-
* recipient: 'eth|
|
|
2495
|
-
* memo: 'Wrap for DEX trading'
|
|
2347
|
+
* recipient: 'eth|1234...',
|
|
2496
2348
|
* });
|
|
2497
2349
|
* ```
|
|
2498
2350
|
*/
|
|
@@ -2508,9 +2360,9 @@ export declare class LaunchpadSDK {
|
|
|
2508
2360
|
* NOT an external bridge (Ethereum/Solana).
|
|
2509
2361
|
*
|
|
2510
2362
|
* @param options - Unwrap options including tokenId and amount
|
|
2511
|
-
* @returns Promise resolving to
|
|
2512
|
-
* @throws
|
|
2513
|
-
*
|
|
2363
|
+
* @returns Promise resolving to the completed unwrap
|
|
2364
|
+
* @throws GalaSDKError (`@gala-chain/gala-core-sdk`): as {@link wrapToken}
|
|
2365
|
+
* (`INVALID_WRAP_DIRECTION` for a token not on the asset channel)
|
|
2514
2366
|
*
|
|
2515
2367
|
* @since 4.0.18
|
|
2516
2368
|
* @category Wrap/Unwrap
|
|
@@ -2518,7 +2370,7 @@ export declare class LaunchpadSDK {
|
|
|
2518
2370
|
* @example Unwrap GMUSIC to MUSIC
|
|
2519
2371
|
* ```typescript
|
|
2520
2372
|
* const result = await sdk.unwrapToken({
|
|
2521
|
-
* tokenId: 'GMUSIC',
|
|
2373
|
+
* tokenId: '$GMUSIC|Unit|none|none',
|
|
2522
2374
|
* amount: '50'
|
|
2523
2375
|
* });
|
|
2524
2376
|
* console.log(`Unwrapped ${result.amount} ${result.fromToken} → ${result.toToken}`);
|
|
@@ -2531,17 +2383,17 @@ export declare class LaunchpadSDK {
|
|
|
2531
2383
|
* Calculates expected fees for wrapping a token to the asset channel.
|
|
2532
2384
|
* Wrap operations use `cross_channel_authorization` fee type.
|
|
2533
2385
|
*
|
|
2534
|
-
* @param tokenId - Token
|
|
2386
|
+
* @param tokenId - Token class key (pipe-delimited string or TokenClassKey; a bare symbol is refused)
|
|
2535
2387
|
* @param amount - Amount to wrap (decimal string)
|
|
2536
2388
|
* @returns Promise resolving to fee estimate
|
|
2537
|
-
* @throws
|
|
2389
|
+
* @throws GalaSDKError `TOKEN_NOT_WRAPPABLE`, `INVALID_WRAP_DIRECTION`, `INVALID_BRIDGE_AMOUNT`
|
|
2538
2390
|
*
|
|
2539
2391
|
* @since 4.0.18
|
|
2540
2392
|
* @category Wrap/Unwrap
|
|
2541
2393
|
*
|
|
2542
2394
|
* @example Estimate wrap fee
|
|
2543
2395
|
* ```typescript
|
|
2544
|
-
* const estimate = await sdk.estimateWrapFee('MUSIC', '100');
|
|
2396
|
+
* const estimate = await sdk.estimateWrapFee('$MUSIC|Unit|none|none', '100');
|
|
2545
2397
|
* console.log(`Fee: ${estimate.fee} ${estimate.feeToken}`);
|
|
2546
2398
|
* console.log(`Auth type: ${estimate.authorizationType}`);
|
|
2547
2399
|
* ```
|
|
@@ -2553,44 +2405,22 @@ export declare class LaunchpadSDK {
|
|
|
2553
2405
|
* Calculates expected fees for unwrapping a token back to its native channel.
|
|
2554
2406
|
* Unwrap operations use `automatic` fee authorization.
|
|
2555
2407
|
*
|
|
2556
|
-
* @param tokenId - Token
|
|
2408
|
+
* @param tokenId - Token class key (pipe-delimited string or TokenClassKey; a bare symbol is refused)
|
|
2557
2409
|
* @param amount - Amount to unwrap (decimal string)
|
|
2558
2410
|
* @returns Promise resolving to fee estimate
|
|
2559
|
-
* @throws
|
|
2411
|
+
* @throws GalaSDKError `TOKEN_NOT_WRAPPABLE`, `INVALID_WRAP_DIRECTION`, `INVALID_BRIDGE_AMOUNT`
|
|
2560
2412
|
*
|
|
2561
2413
|
* @since 4.0.18
|
|
2562
2414
|
* @category Wrap/Unwrap
|
|
2563
2415
|
*
|
|
2564
2416
|
* @example Estimate unwrap fee
|
|
2565
2417
|
* ```typescript
|
|
2566
|
-
* const estimate = await sdk.estimateUnwrapFee('GMUSIC', '50');
|
|
2418
|
+
* const estimate = await sdk.estimateUnwrapFee('$GMUSIC|Unit|none|none', '50');
|
|
2567
2419
|
* console.log(`Fee: ${estimate.fee} ${estimate.feeToken}`);
|
|
2568
2420
|
* console.log(`Auth type: ${estimate.authorizationType}`);
|
|
2569
2421
|
* ```
|
|
2570
2422
|
*/
|
|
2571
2423
|
estimateUnwrapFee(tokenId: TokenId, amount: string): Promise<WrapUnwrapFeeEstimate>;
|
|
2572
|
-
/**
|
|
2573
|
-
* Get status of a wrap/unwrap transaction
|
|
2574
|
-
*
|
|
2575
|
-
* Polls the bridge status endpoint to check the current state
|
|
2576
|
-
* of a cross-channel wrap or unwrap operation.
|
|
2577
|
-
*
|
|
2578
|
-
* @param transactionId - Transaction ID from wrap/unwrap result
|
|
2579
|
-
* @returns Transaction status
|
|
2580
|
-
*
|
|
2581
|
-
* @since 4.0.18
|
|
2582
|
-
* @category Wrap/Unwrap
|
|
2583
|
-
*
|
|
2584
|
-
* @example Check wrap status
|
|
2585
|
-
* ```typescript
|
|
2586
|
-
* const status = sdk.getWrapStatus(result.transactionId);
|
|
2587
|
-
* console.log(`Status: ${status.status}`);
|
|
2588
|
-
* if (status.status === 'completed') {
|
|
2589
|
-
* console.log(`Completed at: ${new Date(status.completedAt)}`);
|
|
2590
|
-
* }
|
|
2591
|
-
* ```
|
|
2592
|
-
*/
|
|
2593
|
-
getWrapStatus(transactionId: string): WrapUnwrapStatusResult;
|
|
2594
2424
|
/**
|
|
2595
2425
|
* Login with wallet signature to get JWT token.
|
|
2596
2426
|
*
|
|
@@ -6223,7 +6053,7 @@ export declare class LaunchpadSDK {
|
|
|
6223
6053
|
/**
|
|
6224
6054
|
* Fetch the current launchpad fee via backend proxy (cached 1 hour).
|
|
6225
6055
|
*
|
|
6226
|
-
*
|
|
6056
|
+
* Same value as `fetchLaunchTokenFee()` (which delegates here) — no chain call.
|
|
6227
6057
|
*
|
|
6228
6058
|
* @returns Promise resolving to the fee amount in GALA (number)
|
|
6229
6059
|
*
|
|
@@ -6240,8 +6070,7 @@ export declare class LaunchpadSDK {
|
|
|
6240
6070
|
/**
|
|
6241
6071
|
* Fetch sale details (supply, status) for a token via backend proxy (cached 10 seconds).
|
|
6242
6072
|
*
|
|
6243
|
-
*
|
|
6244
|
-
* of vaultAddress. The backend resolves the vaultAddress internally.
|
|
6073
|
+
* Uses tokenName; the backend resolves the vaultAddress internally.
|
|
6245
6074
|
*
|
|
6246
6075
|
* @param tokenName Token name (e.g. 'anime')
|
|
6247
6076
|
* @returns Promise resolving to sale details including supply, quantities, and status
|
|
@@ -6789,33 +6618,6 @@ export declare class LaunchpadSDK {
|
|
|
6789
6618
|
tokenName?: string;
|
|
6790
6619
|
banStatus?: 'BANNED' | 'UNBANNED';
|
|
6791
6620
|
}): () => void;
|
|
6792
|
-
/**
|
|
6793
|
-
* Watch for new DEX pool creation by polling sdk.dex.pools.getPools() and diffing against
|
|
6794
|
-
* the previously-seen pool set.
|
|
6795
|
-
*
|
|
6796
|
-
* There is no push event for this anywhere in the platform (no STREAM_EVENTS entry, no
|
|
6797
|
-
* StreamWebSocketService/StreamingEventService method) - this is the only way to detect new
|
|
6798
|
-
* pools. The first poll only establishes a baseline (every existing pool would otherwise be
|
|
6799
|
-
* reported as "new"); callback only fires for pools that appear on a LATER poll.
|
|
6800
|
-
*
|
|
6801
|
-
* @param callback - Called for each newly-detected pool
|
|
6802
|
-
* @param filters - intervalMs (poll frequency, default 30000), minTVL, tokens (client-side)
|
|
6803
|
-
* @returns Cleanup function that stops polling
|
|
6804
|
-
*
|
|
6805
|
-
* @since 7.1.0
|
|
6806
|
-
* @category WebSocket
|
|
6807
|
-
*/
|
|
6808
|
-
onDexPoolCreation(callback: (pool: {
|
|
6809
|
-
poolRef: string;
|
|
6810
|
-
token0: string;
|
|
6811
|
-
token1: string;
|
|
6812
|
-
fee: number;
|
|
6813
|
-
tvlUsd: number | undefined;
|
|
6814
|
-
}) => void, filters?: {
|
|
6815
|
-
intervalMs?: number;
|
|
6816
|
-
minTVL?: number;
|
|
6817
|
-
tokens?: string[];
|
|
6818
|
-
}): () => void;
|
|
6819
6621
|
/**
|
|
6820
6622
|
* Subscribe to content flagged events (overseer)
|
|
6821
6623
|
*
|
|
@@ -7114,12 +6916,12 @@ export declare class LaunchpadSDK {
|
|
|
7114
6916
|
*
|
|
7115
6917
|
* @example Estimate fee for bridging GALA to Ethereum
|
|
7116
6918
|
* ```typescript
|
|
6919
|
+
* // the fee does not depend on the amount bridged
|
|
7117
6920
|
* const fee = await sdk.estimateBridgeFee({
|
|
7118
6921
|
* tokenId: 'GALA|Unit|none|none',
|
|
7119
6922
|
* destinationChain: 'Ethereum',
|
|
7120
|
-
* amount: '100',
|
|
7121
6923
|
* });
|
|
7122
|
-
* console.log(`Fee: ${fee.
|
|
6924
|
+
* console.log(`Fee: ${fee.estimatedFeeInGala} GALA`);
|
|
7123
6925
|
* ```
|
|
7124
6926
|
*/
|
|
7125
6927
|
estimateBridgeFee(params: EstimateBridgeFeeParams): Promise<BridgeFeeEstimate>;
|
|
@@ -7182,8 +6984,7 @@ export declare class LaunchpadSDK {
|
|
|
7182
6984
|
*
|
|
7183
6985
|
* Checks the current status of a cross-chain bridge transaction.
|
|
7184
6986
|
*
|
|
7185
|
-
* @param transactionHash - Transaction hash to check
|
|
7186
|
-
* @param chainHint - Optional chain hint for faster lookup
|
|
6987
|
+
* @param transactionHash - Transaction hash to check (one GalaConnect status read, any chain)
|
|
7187
6988
|
* @returns Promise resolving to bridge status
|
|
7188
6989
|
*
|
|
7189
6990
|
* @since 4.0.16
|
|
@@ -7191,14 +6992,11 @@ export declare class LaunchpadSDK {
|
|
|
7191
6992
|
*
|
|
7192
6993
|
* @example Check bridge status
|
|
7193
6994
|
* ```typescript
|
|
7194
|
-
* const status = await sdk.getBridgeStatus(
|
|
7195
|
-
* '0x1234...abcd',
|
|
7196
|
-
* 'Ethereum'
|
|
7197
|
-
* );
|
|
6995
|
+
* const status = await sdk.getBridgeStatus('0x1234...abcd');
|
|
7198
6996
|
* console.log(`Status: ${status.status}`);
|
|
7199
6997
|
* ```
|
|
7200
6998
|
*/
|
|
7201
|
-
getBridgeStatus(transactionHash: string
|
|
6999
|
+
getBridgeStatus(transactionHash: string): Promise<BridgeStatus>;
|
|
7202
7000
|
/**
|
|
7203
7001
|
* Get list of tokens supported for bridging.
|
|
7204
7002
|
*
|
|
@@ -7357,7 +7155,7 @@ export declare class LaunchpadSDK {
|
|
|
7357
7155
|
* type: 'exact'
|
|
7358
7156
|
* });
|
|
7359
7157
|
* console.log('GALA needed:', result.amount);
|
|
7360
|
-
* console.log('
|
|
7158
|
+
* console.log('Fees:', result.transactionFee, result.gasFee);
|
|
7361
7159
|
* ```
|
|
7362
7160
|
*
|
|
7363
7161
|
* @example Performance-optimized with local calculation
|
|
@@ -7697,7 +7495,7 @@ export declare class LaunchpadSDK {
|
|
|
7697
7495
|
* **Use simple `tokenName`** (e.g., `"anime"`), NOT full TokenClassKey format.
|
|
7698
7496
|
*
|
|
7699
7497
|
* This method is for **bonding curve tokens only** (pre-graduation). For DEX trading
|
|
7700
|
-
* of graduated tokens, use `
|
|
7498
|
+
* of graduated tokens, use `@gala-chain/gswap-sdk` (`new GSwap({ signer }).swaps.swap()`) with full TokenClassKey format.
|
|
7701
7499
|
*
|
|
7702
7500
|
* ```typescript
|
|
7703
7501
|
* // ✅ CORRECT - Simple token name
|
|
@@ -7818,7 +7616,7 @@ export declare class LaunchpadSDK {
|
|
|
7818
7616
|
* **Use simple `tokenName`** (e.g., `"anime"`), NOT full TokenClassKey format.
|
|
7819
7617
|
*
|
|
7820
7618
|
* This method is for **bonding curve tokens only** (pre-graduation). For DEX trading
|
|
7821
|
-
* of graduated tokens, use `
|
|
7619
|
+
* of graduated tokens, use `@gala-chain/gswap-sdk` (`new GSwap({ signer }).swaps.swap()`) with full TokenClassKey format.
|
|
7822
7620
|
*
|
|
7823
7621
|
* ```typescript
|
|
7824
7622
|
* // ✅ CORRECT - Simple token name
|
|
@@ -8558,79 +8356,6 @@ export declare class LaunchpadSDK {
|
|
|
8558
8356
|
* ```
|
|
8559
8357
|
*/
|
|
8560
8358
|
getManagedTokens(options?: GetManagedTokensOptions): Promise<ManagedTokensResult>;
|
|
8561
|
-
/**
|
|
8562
|
-
* Fetch historical price data for DEX tokens via DEX Backend API
|
|
8563
|
-
*
|
|
8564
|
-
* Retrieves paginated historical price snapshots for a token with optional
|
|
8565
|
-
* date range filtering. This method is Node.js-only and queries the DEX
|
|
8566
|
-
* Backend API for price history data.
|
|
8567
|
-
*
|
|
8568
|
-
* @param options Price history fetch options including token key, dates, and pagination
|
|
8569
|
-
* @returns Promise<PriceHistoryResult> Price snapshots with pagination metadata
|
|
8570
|
-
* @throws ConfigurationError if dexBackendBaseUrl not configured
|
|
8571
|
-
* @throws NetworkError if API request fails
|
|
8572
|
-
* @throws ValidationError if parameters are invalid
|
|
8573
|
-
*
|
|
8574
|
-
* @category Price History
|
|
8575
|
-
* @since 3.13.0
|
|
8576
|
-
*
|
|
8577
|
-
* @example
|
|
8578
|
-
* ```typescript
|
|
8579
|
-
* // Fetch price history for a DEX token
|
|
8580
|
-
* const history = await sdk.fetchPriceHistory({
|
|
8581
|
-
* tokenClassKey: {
|
|
8582
|
-
* collection: 'GUSDC',
|
|
8583
|
-
* category: 'Unit',
|
|
8584
|
-
* type: 'none',
|
|
8585
|
-
* additionalKey: 'none'
|
|
8586
|
-
* },
|
|
8587
|
-
* from: new Date('2024-01-01'),
|
|
8588
|
-
* to: new Date('2024-01-31'),
|
|
8589
|
-
* pageSize: 20
|
|
8590
|
-
* });
|
|
8591
|
-
*
|
|
8592
|
-
* console.log(`Found ${history.snapshots.length} price snapshots`);
|
|
8593
|
-
* console.log(`Total: ${history.total}, Page ${history.page} of ${history.totalPages}`);
|
|
8594
|
-
* ```
|
|
8595
|
-
*/
|
|
8596
|
-
fetchPriceHistory(options: FetchPriceHistoryOptions): Promise<PriceHistoryResult>;
|
|
8597
|
-
/**
|
|
8598
|
-
* Fetch all historical price snapshots for a token (automatic pagination)
|
|
8599
|
-
*
|
|
8600
|
-
* Convenience method that automatically handles pagination by fetching all price history
|
|
8601
|
-
* snapshots across all pages and returning them in a single result. This method internally
|
|
8602
|
-
* loops through pages using the maximum page size (100 items) for efficiency.
|
|
8603
|
-
*
|
|
8604
|
-
* Only available for DEX tokens with price snapshot data on the DEX Backend API.
|
|
8605
|
-
*
|
|
8606
|
-
* @param options Fetch options (pagination is handled automatically)
|
|
8607
|
-
* @returns Promise<PriceHistoryResult> containing all price snapshots in combined result
|
|
8608
|
-
*
|
|
8609
|
-
* @throws NetworkError if API query fails
|
|
8610
|
-
* @throws ValidationError if parameters are invalid
|
|
8611
|
-
*
|
|
8612
|
-
* @category Price History
|
|
8613
|
-
* @since 3.14.0
|
|
8614
|
-
*
|
|
8615
|
-
* @example
|
|
8616
|
-
* ```typescript
|
|
8617
|
-
* // Fetch all price history for a DEX token (automatic pagination)
|
|
8618
|
-
* const allHistory = await sdk.fetchAllPriceHistory({
|
|
8619
|
-
* tokenId: {
|
|
8620
|
-
* collection: 'GUSDC',
|
|
8621
|
-
* category: 'Unit',
|
|
8622
|
-
* type: 'none',
|
|
8623
|
-
* additionalKey: 'none'
|
|
8624
|
-
* },
|
|
8625
|
-
* from: new Date('2024-01-01'),
|
|
8626
|
-
* to: new Date('2024-12-31')
|
|
8627
|
-
* });
|
|
8628
|
-
*
|
|
8629
|
-
* console.log(`Found ${allHistory.snapshots.length} price snapshots`);
|
|
8630
|
-
* console.log(`Total: ${allHistory.total}`);
|
|
8631
|
-
* ```
|
|
8632
|
-
*/
|
|
8633
|
-
fetchAllPriceHistory(options: Omit<FetchPriceHistoryOptions, 'page' | 'limit'>): Promise<PriceHistoryResult>;
|
|
8634
8359
|
/**
|
|
8635
8360
|
* Transfer GALA tokens between wallets
|
|
8636
8361
|
*
|
|
@@ -8712,7 +8437,7 @@ export declare class LaunchpadSDK {
|
|
|
8712
8437
|
*
|
|
8713
8438
|
* @throws {TransferError} When token name cannot be resolved
|
|
8714
8439
|
*/
|
|
8715
|
-
resolveTokenClassKey(tokenName: string): Promise<
|
|
8440
|
+
resolveTokenClassKey(tokenName: string): Promise<GalaChainTokenClassKey>;
|
|
8716
8441
|
/**
|
|
8717
8442
|
* Convert token name to TokenClassKey (explicit alias for resolveTokenClassKey)
|
|
8718
8443
|
*
|
|
@@ -8746,7 +8471,7 @@ export declare class LaunchpadSDK {
|
|
|
8746
8471
|
*
|
|
8747
8472
|
* @throws {TransferError} When token name cannot be resolved
|
|
8748
8473
|
*/
|
|
8749
|
-
convertTokenNameToTokenClassKey(tokenName: string): Promise<
|
|
8474
|
+
convertTokenNameToTokenClassKey(tokenName: string): Promise<GalaChainTokenClassKey>;
|
|
8750
8475
|
/**
|
|
8751
8476
|
* Lock tokens on GalaChain (batch operation)
|
|
8752
8477
|
*
|
|
@@ -8895,6 +8620,12 @@ export declare class LaunchpadSDK {
|
|
|
8895
8620
|
* ```
|
|
8896
8621
|
*/
|
|
8897
8622
|
resolveVaultAddress(tokenName: string): Promise<string | null>;
|
|
8623
|
+
/**
|
|
8624
|
+
* Find the launchpad token name of a vault by searching the pool list for the vault's symbol
|
|
8625
|
+
* and matching the vault address exactly (symbols are not unique across creators).
|
|
8626
|
+
* @internal
|
|
8627
|
+
*/
|
|
8628
|
+
private findTokenNameByVault;
|
|
8898
8629
|
/**
|
|
8899
8630
|
* Get token metadata cache information
|
|
8900
8631
|
*
|