@gala-chain/launchpad-sdk 9.0.0-rc.0 → 9.0.0-rc.2
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 +500 -10
- package/EXAMPLES.md +1 -1
- package/MIGRATING-TO-9.0.md +43 -1
- package/README.md +1 -1
- package/dist/LaunchpadSDK.d.ts +414 -219
- package/dist/LaunchpadSDK.d.ts.map +1 -1
- package/dist/api/LaunchpadAPI.d.ts +2 -140
- 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/session.d.ts +59 -0
- package/dist/auth/session.d.ts.map +1 -0
- package/dist/auth/types.d.ts +6 -1
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/constants/endpoints.d.ts +19 -1
- 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/errors/LaunchpadSDKError.d.ts +18 -0
- package/dist/errors/LaunchpadSDKError.d.ts.map +1 -1
- package/dist/index.browser.d.ts +36 -27
- 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/launchpad/bundle-submission.d.ts +57 -2
- 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 +31 -1
- 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 +1 -1
- 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 -3
- package/dist/schemas/validators.d.ts +3 -3
- 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/GalaChainLockService.d.ts.map +1 -1
- 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.map +1 -1
- 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/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 +31 -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/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/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/signers.d.ts +57 -1
- package/dist/signing/signers.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/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 +40 -62
- 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/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 +99 -66
- package/dist/types/launchpad.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 +1 -3
- 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 +126 -50
- 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 +15 -0
- package/dist/utils/address-formatter.d.ts.map +1 -1
- package/dist/utils/auto-pagination.d.ts +1 -1
- package/dist/utils/auto-pagination.d.ts.map +1 -1
- package/dist/utils/error-factories.d.ts +8 -7
- package/dist/utils/error-factories.d.ts.map +1 -1
- package/dist/utils/errors.d.ts +54 -11
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/http.d.ts +24 -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/validation-helpers.d.ts +18 -59
- 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 +3 -3
- package/dist/services/StreamingEventService.d.ts +0 -441
- package/dist/services/StreamingEventService.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/streaming-events.dto.d.ts +0 -605
- package/dist/types/streaming-events.dto.d.ts.map +0 -1
package/dist/LaunchpadSDK.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { GalaChainTokenClass, GalaChainTokenDetails, GalaChainTokenClassKey, HttpRequestor } from '@gala-chain/gala-core-sdk';
|
|
2
|
+
import type * as CoreBridgeModule from '@gala-chain/gala-core-sdk/bridge';
|
|
2
3
|
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';
|
|
3
4
|
import { Wallet } from 'ethers';
|
|
5
|
+
import { type LaunchpadSession } from './auth/session';
|
|
4
6
|
import type { Environment } from './config/environments';
|
|
5
7
|
import { EventsBatcherService } from './services/EventsBatcherService';
|
|
6
|
-
import type { StreamEventCallbacks } from './services/
|
|
8
|
+
import type { StreamEventCallbacks } from './services/realtime/event-catalog';
|
|
9
|
+
import type { RealtimeListener, Unsubscribe } from './services/StreamWebSocketService';
|
|
10
|
+
import { StreamWebSocketService } from './services/StreamWebSocketService';
|
|
11
|
+
import { type SocketFactory } from './launchpad/bundle-submission';
|
|
7
12
|
import { LaunchpadWrites } from './launchpad/writes';
|
|
8
13
|
import type { LaunchpadSigner } from './signing';
|
|
9
14
|
import type { GetAIModerationOptions, GetAIModerationResult, GetAIModerationSettingsResult, GetAIModerationStatusResult, TriggerAIModerationOptions, TriggerAIModerationResult, UpdateAIModerationSettingsOptions, UpdateAIModerationSettingsResult } from './types/ai-moderation.dto';
|
|
@@ -20,8 +25,8 @@ import type { AddContentReactionOptions, AddContentReactionResult, RemoveContent
|
|
|
20
25
|
import type { FetchTokenStatsResult } from './types/engagement-stats.dto';
|
|
21
26
|
import type { AmountCalculationResult, FetchPoolsOptions, GraduationCalculationResult, GraphDataResult, LaunchTokenData, PoolData, PoolsResult, SaleDetailsResult, TokenDistributionResult, TokenHolder, TokenSpotPrice, TradeQuoteParams, UserHolderContext, ValidateTokenResponse } from './types/launchpad.dto';
|
|
22
27
|
import type { LockTokensData, LockTokensResult, UnlockTokensData, UnlockTokensResult } from './types/lock.dto';
|
|
23
|
-
import type { CreateMessageOptions, CreateMessageResult, DeleteMessageResult, FetchMessagesOptions, FetchMessagesResult,
|
|
24
|
-
import type { TokenConfigData } from './types/token-config.dto';
|
|
28
|
+
import type { CreateMessageOptions, CreateMessageResult, DeleteMessageResult, FetchMessagesOptions, FetchMessagesResult, MessageStats, MessageType, PinMessageResult, PinnedMessageResult, UpdateMessageOptions, UpdateMessageResult } from './types/messages.dto';
|
|
29
|
+
import type { TokenConfigData, UpdateTokenConfigOptions } from './types/token-config.dto';
|
|
25
30
|
import type { ClaimModeratorInviteOptions, ClaimModeratorInviteResult, CreateModeratorInviteOptions, CreateModeratorInviteResult, GetModeratedTokensOptions, ListModeratorInvitesOptions, ModeratedTokensResult, ModeratorInviteListResult, PublicInviteInfo, UpdateInviteRoleOptions, UpdateInviteRoleResult, UpdateModeratorInviteOptions, UpdateModeratorInviteResult } from './types/moderator.dto';
|
|
26
31
|
import type { ClaimCollectionParams, ClaimCollectionResult, CreateTokenClassParams, CreateTokenClassResult, EstimateMintFeeParams, EstimateNftFeesParams, FetchTokenClassesParams, MintNftParams, MintNftResult, NftBalance, NftCollectionAuthorization, NftFeeEstimate, NftTokenClassWithSupply } from './types/nft.dto';
|
|
27
32
|
import type { GetNotificationPreferencesResult, RegisterPushTokenParams, RegisterPushTokenResult, UnregisterPushTokenResult, UpdateNotificationPreferencesParams, UpdateNotificationPreferencesResult } from './types/notification.dto';
|
|
@@ -29,26 +34,26 @@ import type { GetHomeOEmbedJsonResult, GetHomeOEmbedOptions, GetPoolOEmbedJsonRe
|
|
|
29
34
|
import type { BanStatsResponse, CreateOverseerDirectOptions, CreateOverseerInviteOptions, FlagStatsResponse, InviteStatsResponse, ListOverseerInvitesOptions, ListOverseersOptions, ListUsersOptions, Overseer, OverseerInviteWithUrl, OverseerStatusResponse, OverseerSummaryResponse, PaginatedOverseerInvites, PaginatedOverseers, PublicOverseerInviteInfo, TokenBanStatsResponse, UsersListResponse, UserStatsResponse, UserSummaryResponse } from './types/overseer.dto';
|
|
30
35
|
import type { PlatformConfig, UpdatePlatformConfigOptions } from './types/platform-config.dto';
|
|
31
36
|
import type { GetPlatformStatsResult } from './types/platform-stats.dto';
|
|
37
|
+
import type { EventStats, QueryEventsOptions, QueryEventsResult } from './types/events.dto';
|
|
38
|
+
import type { HealthCheckResponse } from './types/health.dto';
|
|
32
39
|
import type { GetRestrictedNamesResult, UpdateRestrictedNamesRequest, UpdateRestrictedNamesResult } from './types/restricted-names.dto';
|
|
33
40
|
import type { TokenLaunchResult, TradeResult } from './types/result.types';
|
|
34
|
-
import type { LoginResponse, RefreshResponse, SessionInfo } from './types/session-auth.dto';
|
|
41
|
+
import type { LoginRequest, LoginResponse, RefreshResponse, SessionInfo } from './types/session-auth.dto';
|
|
35
42
|
import type { AddSimulcastTargetOptions, AddSimulcastTargetResult, FetchRecordingsOptions, GetStreamRoleOptions, GetTokenAccessOptions, GlobalStreamingStatus, RecordingDownloadResult, RecordingsResult, ResetStreamKeyResult, SimulcastTargetsResult, StartStreamResult, StreamCredentialsResult, StreamRoleResponse, StreamSubscribedEvent, TokenAccessResult } from './types/streaming.dto';
|
|
36
43
|
import type { BanTokenOptions, BanTokenResult, GetTokenBanOptions, ListTokenBansOptions, TokenBanListResult, TokenBanStatusResult, UnbanTokenOptions, UnbanTokenResult } from './types/token-ban.dto';
|
|
37
44
|
import type { PoolDetailsData, TradesResult } from './types/trade.dto';
|
|
38
45
|
import type { GetTradesOptions, TradesQueryResult } from './types/trades-query.dto';
|
|
39
46
|
import type { GalaChainTransferReceipt, TransferGalaData, TransferTokenData } from './types/transfer.dto';
|
|
40
|
-
import type { AllReferralsResult, AvailableBalanceResult, FetchReferralsOptions, FetchReferralsSummaryOptions, FetchTokenBalanceOptions, GetManagedTokensOptions, LockedBalanceResult, ManagedTokensResult, ReferralsResult, ReferralsSummaryResult, ReferralUrlResult, TokenBalanceResult, UpdateProfileData, UploadProfileImageOptions, UserTokenListResult } from './types/user.dto';
|
|
47
|
+
import type { AllReferralsResult, AvailableBalanceResult, FetchReferralsOptions, FetchReferralsSummaryOptions, FetchTokenBalanceOptions, GetManagedTokensOptions, LockedBalanceResult, ManagedTokensResult, PublicUserProfile, ReferralCode, ReferralsResult, ReferralsSummaryResult, ReferralUrlResult, TokenBalanceResult, UpdateProfileData, UploadProfileImageOptions, UserGalaBalance, UserTokenListResult } from './types/user.dto';
|
|
41
48
|
import type { BalanceUpdatedPayload, ChatMessagePayload, ChatStatusPayload, ConnectedClient, ConnectedClientsResponse, DownloadReadyPayload, FeatureStatusPayload, GetConnectedClientsOptions, ModeratorAddedPayload, ModeratorRemovedPayload, RecordingsCountUpdatedPayload, EmitWebSocketEventRequest, RecordingStatusPayload, SiteConfigChangedPayload, StreamCountdownPayload, StreamStatusPayload, TokenBannedPayload, TokenUnbannedPayload, TradeExecutedPayload, TypingIndicatorPayload, UserProfileUpdatedPayload, ViewerCountPayload } from './types/websocket-admin.dto';
|
|
42
|
-
import type { EngagementStatsUpdatedEvent } from './types/websocket-events.dto';
|
|
43
49
|
import type { CommentCreatedEvent, HolderCountUpdatedEvent, ModeratorAddedEvent, PoolMetadataUpdatedEvent, TokenBannedEvent, TradeExecutedEvent } from './types/websocket-events.dto';
|
|
44
50
|
import type { GetTokenWeeklyHistoryOptions, GetTokenWeeklyHistoryResult, GetWeeklyChallengeOptions, GetWeeklyChallengeResult } from './types/weekly-challenge.dto';
|
|
45
51
|
import { TransactionFailedError, WebSocketError, WebSocketTimeoutError } from './utils/websocket-errors';
|
|
46
52
|
import { type WalletProvider } from '@gala-chain/gala-core-sdk/providers';
|
|
47
53
|
export { TransactionFailedError, WebSocketError, WebSocketTimeoutError, };
|
|
48
54
|
import type { BuyTokenOptions, CalculateBuyAmountForGraduationOptions, CalculateBuyAmountLocalOptions, CalculateBuyAmountOptions, CalculateSellAmountLocalOptions, CalculateSellAmountOptions, FetchTokensCreatedOptions, FetchTokensHeldOptions, FetchTokenSpotPriceParams, FetchTradesOptions, FetchVolumeDataOptions, GraduateTokenOptions, SellTokenOptions, UploadImageByTokenNameOptions } from './types/options.dto';
|
|
49
|
-
import type {
|
|
55
|
+
import type { ChatStatusResponse, GetPinnedMessageResult, UnpinMessageResult } from './types/stream-chat.dto';
|
|
50
56
|
import type { AvailableRolesResponse } from './types/streaming.dto';
|
|
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';
|
|
52
57
|
/**
|
|
53
58
|
* Configuration for initializing the Launchpad SDK
|
|
54
59
|
*
|
|
@@ -101,10 +106,45 @@ export type LaunchpadSDKConfigResponse = Omit<LaunchpadSDKConfig, 'wallet' | 'wa
|
|
|
101
106
|
export interface LaunchpadSDKConfig extends SDKConfig {
|
|
102
107
|
/** Native or typed-data signer used by the v6 write surfaces. */
|
|
103
108
|
signer?: LaunchpadSigner;
|
|
109
|
+
/**
|
|
110
|
+
* An app-owned launchpad-backend session (a browser app's httpOnly-cookie JWT session). Every
|
|
111
|
+
* launchpad-backend request then takes its bearer from the session, a 401 is handed to the session
|
|
112
|
+
* (one retry with the token it returns), those requests carry the browser's cookies, and the SDK
|
|
113
|
+
* stores no token: log in with {@link LaunchpadSDK.loginWithSignature}, refresh with
|
|
114
|
+
* {@link LaunchpadSDK.refreshToken}, end it with {@link LaunchpadSDK.logout}. Exclusive with
|
|
115
|
+
* `accessToken`. Pair it with `signer` + `walletAddress` (never `wallet` / `walletProvider`, which
|
|
116
|
+
* sign every request).
|
|
117
|
+
*
|
|
118
|
+
* @since 9.0.0
|
|
119
|
+
*/
|
|
120
|
+
session?: LaunchpadSession;
|
|
104
121
|
/** Registered GalaChain address used as the write sender and bundler header. */
|
|
105
122
|
walletAddress?: string;
|
|
106
123
|
/** Fetch-compatible requestor used by v6 write surfaces and tests. */
|
|
107
124
|
httpRequestor?: HttpRequestor;
|
|
125
|
+
/**
|
|
126
|
+
* The app's own bundler socket (socket.io to the bundle backend, with the app's reconnect
|
|
127
|
+
* settings), for the confirmation of `sdk.launchpad` writes. Called once per `wait()` with the
|
|
128
|
+
* bundle base URL; the SDK adds its listener for the bundle's event on the socket returned and
|
|
129
|
+
* removes it when the wait ends, and never disconnects it. Without it each `wait()` opens a socket
|
|
130
|
+
* of its own and closes it afterwards.
|
|
131
|
+
*
|
|
132
|
+
* @since 9.0.0
|
|
133
|
+
*/
|
|
134
|
+
bundleSocketFactory?: SocketFactory;
|
|
135
|
+
/**
|
|
136
|
+
* Loads gala-core-sdk's `./bridge`, which the bridge and wrap methods (`bridgeOut`, `bridgeIn`,
|
|
137
|
+
* `wrapToken`, `getSupportedBridgeTokens`, the external-chain balances, ...) run on:
|
|
138
|
+
* `bridge: () => import('@gala-chain/gala-core-sdk/bridge')`. That module loads `ethers`,
|
|
139
|
+
* `@solana/web3.js` and `@solana/spl-token` (core's optional peers), so launchpad-sdk never
|
|
140
|
+
* names it itself: an app that does not pass this loader bundles and installs no Solana, and its
|
|
141
|
+
* bridge and wrap calls throw a `ConfigurationError` naming this option. Loaded once per SDK, at
|
|
142
|
+
* the first such call; a failed load (the peers are not installed) is a `ConfigurationError`
|
|
143
|
+
* naming them, tried again at the next call.
|
|
144
|
+
*
|
|
145
|
+
* @since 9.0.0
|
|
146
|
+
*/
|
|
147
|
+
bridge?: CoreBridgeLoader;
|
|
108
148
|
/**
|
|
109
149
|
* The ethers wallet for authentication (optional)
|
|
110
150
|
* - Required for: Trading (buy/sell), transfers, token creation, profile updates
|
|
@@ -265,6 +305,26 @@ export interface LaunchpadSDKConfig extends SDKConfig {
|
|
|
265
305
|
* ```
|
|
266
306
|
*/
|
|
267
307
|
streamWebSocketUrl?: string;
|
|
308
|
+
/**
|
|
309
|
+
* How many times the stream socket retries a lost connection before giving up (default 5;
|
|
310
|
+
* `Infinity` never gives up, which is what a long-lived browser app wants).
|
|
311
|
+
*
|
|
312
|
+
* @since 9.0.0
|
|
313
|
+
*/
|
|
314
|
+
streamReconnectAttempts?: number;
|
|
315
|
+
/**
|
|
316
|
+
* The stream socket's delay before its first reconnection attempt in ms (default 2000; the delay
|
|
317
|
+
* grows toward `streamReconnectDelayMax`).
|
|
318
|
+
*
|
|
319
|
+
* @since 9.0.0
|
|
320
|
+
*/
|
|
321
|
+
streamReconnectDelay?: number;
|
|
322
|
+
/**
|
|
323
|
+
* The longest delay between the stream socket's reconnection attempts in ms (socket.io's default 5000).
|
|
324
|
+
*
|
|
325
|
+
* @since 9.0.0
|
|
326
|
+
*/
|
|
327
|
+
streamReconnectDelayMax?: number;
|
|
268
328
|
/**
|
|
269
329
|
* Optional Admin API key for stream management operations.
|
|
270
330
|
*
|
|
@@ -277,6 +337,16 @@ export interface LaunchpadSDKConfig extends SDKConfig {
|
|
|
277
337
|
*/
|
|
278
338
|
streamAdminApiKey?: string;
|
|
279
339
|
}
|
|
340
|
+
/** gala-core-sdk's `./bridge` module. */
|
|
341
|
+
type CoreBridge = typeof CoreBridgeModule;
|
|
342
|
+
/**
|
|
343
|
+
* Loads gala-core-sdk's `./bridge` for the bridge and wrap methods: `LaunchpadSDKConfig.bridge`.
|
|
344
|
+
* Pass `() => import('@gala-chain/gala-core-sdk/bridge')` (a page without a bundler: a function
|
|
345
|
+
* resolving to the bridge module it loaded itself; gala-core-sdk ships no script-tag build of it).
|
|
346
|
+
*
|
|
347
|
+
* @since 9.0.0
|
|
348
|
+
*/
|
|
349
|
+
export type CoreBridgeLoader = () => Promise<CoreBridge>;
|
|
280
350
|
export declare class LaunchpadSDK {
|
|
281
351
|
/** Default slippage tolerance factor (15%) - Higher for volatile bonding curve tokens */
|
|
282
352
|
static readonly DEFAULT_SLIPPAGE_TOLERANCE_FACTOR = 0.15;
|
|
@@ -324,6 +394,8 @@ export declare class LaunchpadSDK {
|
|
|
324
394
|
private readonly cache;
|
|
325
395
|
/** Counts wallet changes: a bridge call that started under one wallet never runs under the next. */
|
|
326
396
|
private walletGeneration;
|
|
397
|
+
/** The load of gala-core-sdk's `./bridge` through `config.bridge`; cleared when it fails. */
|
|
398
|
+
private coreBridgeLoad;
|
|
327
399
|
private _bridgeService;
|
|
328
400
|
private _bridgeableTokenService?;
|
|
329
401
|
private _wrappableTokenService?;
|
|
@@ -332,16 +404,6 @@ export declare class LaunchpadSDK {
|
|
|
332
404
|
private _streamingService;
|
|
333
405
|
private _streamChatService;
|
|
334
406
|
private _streamWebSocketService;
|
|
335
|
-
/** Per-token room refcount shared across every watchTokenRoomEvent() event type, so the
|
|
336
|
-
* room is only left via unsubscribeFromStream() once nothing is still watching it. */
|
|
337
|
-
private _tokenRoomRefCounts;
|
|
338
|
-
/** Fan-out listener sets, keyed by `${eventKey}:${tokenName}`, so concurrent watchers of the
|
|
339
|
-
* SAME event+token never clobber each other's single roomCallbacks slot on StreamWebSocketService. */
|
|
340
|
-
private _tokenRoomListeners;
|
|
341
|
-
/** The single real subscribeXxx() unsubscribe per `${eventKey}:${tokenName}`, shared by every
|
|
342
|
-
* watcher of that key so whichever watcher leaves LAST releases it (not just the first one). */
|
|
343
|
-
private _tokenRoomUnsubscribers;
|
|
344
|
-
private _streamingEventService;
|
|
345
407
|
private _banService;
|
|
346
408
|
private _tokenBanService;
|
|
347
409
|
private _aiModerationService;
|
|
@@ -358,6 +420,8 @@ export declare class LaunchpadSDK {
|
|
|
358
420
|
private _weeklyChallengeService;
|
|
359
421
|
private _oembedService;
|
|
360
422
|
private _platformStatsService;
|
|
423
|
+
private _healthService;
|
|
424
|
+
private _eventsQueryService;
|
|
361
425
|
private _notificationService;
|
|
362
426
|
private _clientConfigService;
|
|
363
427
|
private readonly nftCollectionService;
|
|
@@ -747,6 +811,10 @@ export declare class LaunchpadSDK {
|
|
|
747
811
|
* (reverse bonding curve fees, vault addresses) for every pool returned. This enables
|
|
748
812
|
* instant local calculations without additional API calls.
|
|
749
813
|
*
|
|
814
|
+
* Options are those `GET /v1/tokens` accepts: `type` RECENT / POPULAR / RECORDINGS /
|
|
815
|
+
* SECONDS_STREAMED and `streamStatus` IDLE / ACTIVE / DISABLED (any case), `pageSize` 1 to 100
|
|
816
|
+
* (default 10); anything else is a `ValidationError` before a request is made.
|
|
817
|
+
*
|
|
750
818
|
* @category Pool Information
|
|
751
819
|
* @param options Optional filters for pool fetching
|
|
752
820
|
* @returns Promise<PoolsResult> with pagination metadata
|
|
@@ -754,7 +822,7 @@ export declare class LaunchpadSDK {
|
|
|
754
822
|
*
|
|
755
823
|
* @example Basic pool fetching
|
|
756
824
|
* ```typescript
|
|
757
|
-
* const result = await sdk.fetchPools({ type: '
|
|
825
|
+
* const result = await sdk.fetchPools({ type: 'RECENT', pageSize: 20 });
|
|
758
826
|
* console.log(`Fetched ${result.items.length} pools`);
|
|
759
827
|
* console.log(`Total pools: ${result.total}`);
|
|
760
828
|
* ```
|
|
@@ -853,11 +921,7 @@ export declare class LaunchpadSDK {
|
|
|
853
921
|
* console.log('Calculated 10 prices instantly using cached metadata');
|
|
854
922
|
* ```
|
|
855
923
|
*/
|
|
856
|
-
fetchAllPools(options?:
|
|
857
|
-
search?: string;
|
|
858
|
-
tokenName?: string;
|
|
859
|
-
type?: 'recent' | 'popular';
|
|
860
|
-
}): Promise<PoolsResult>;
|
|
924
|
+
fetchAllPools(options?: Omit<FetchPoolsOptions, 'cursor' | 'pageSize'>): Promise<PoolsResult>;
|
|
861
925
|
/**
|
|
862
926
|
* Fetch token ownership distribution with holder percentages
|
|
863
927
|
*
|
|
@@ -1410,6 +1474,14 @@ export declare class LaunchpadSDK {
|
|
|
1410
1474
|
* ```
|
|
1411
1475
|
*/
|
|
1412
1476
|
fetchGalaBalance(address?: string): Promise<TokenBalanceResult | null>;
|
|
1477
|
+
/**
|
|
1478
|
+
* gala-core-sdk's `./bridge` from the `bridge` loader of the config, loaded once (a failed load
|
|
1479
|
+
* is cleared and tried again at the next call).
|
|
1480
|
+
*
|
|
1481
|
+
* @throws ConfigurationError (`field: 'bridge'`) when no loader was configured, or it failed (the
|
|
1482
|
+
* module's optional peers are not installed) or did not give the module
|
|
1483
|
+
*/
|
|
1484
|
+
private loadCoreBridge;
|
|
1413
1485
|
/**
|
|
1414
1486
|
* gala-core-sdk's `./bridge` for a bridge or wrap call (see `loadCoreBridge`). The call was made
|
|
1415
1487
|
* with the SDK's wallet of NOW: if the wallet changes while the module loads, the call is refused
|
|
@@ -1588,6 +1660,10 @@ export declare class LaunchpadSDK {
|
|
|
1588
1660
|
* @since 9.0.0
|
|
1589
1661
|
*/
|
|
1590
1662
|
private getPlatformStatsService;
|
|
1663
|
+
/** Lazily created HealthService (public `GET /health`). @internal */
|
|
1664
|
+
private getHealthService;
|
|
1665
|
+
/** Lazily created EventsQueryService (stored events, Admin API key or Overseer). @internal */
|
|
1666
|
+
private getEventsQueryService;
|
|
1591
1667
|
/**
|
|
1592
1668
|
* Get or create the NotificationService instance.
|
|
1593
1669
|
*
|
|
@@ -1679,7 +1755,6 @@ export declare class LaunchpadSDK {
|
|
|
1679
1755
|
* @internal
|
|
1680
1756
|
*/
|
|
1681
1757
|
private getContentReactionService;
|
|
1682
|
-
private toLegacyPinnedMessage;
|
|
1683
1758
|
private buildMessageFetchOptions;
|
|
1684
1759
|
private resolveReferralAddress;
|
|
1685
1760
|
/**
|
|
@@ -1736,12 +1811,27 @@ export declare class LaunchpadSDK {
|
|
|
1736
1811
|
*/
|
|
1737
1812
|
private getStreamWebSocketService;
|
|
1738
1813
|
/**
|
|
1739
|
-
*
|
|
1814
|
+
* The token the stream socket authenticates with, asked for at every authentication (including the
|
|
1815
|
+
* one after a reconnect), so a refreshed token is the one used: an app `session` is its own authority
|
|
1816
|
+
* (`session.accessToken()`); otherwise the SDK's own session, refreshed or renewed when it is near
|
|
1817
|
+
* expiry (`ensureValidToken()`).
|
|
1818
|
+
*/
|
|
1819
|
+
private streamSocketToken;
|
|
1820
|
+
/**
|
|
1821
|
+
* The realtime socket: one registry of subscribers for every event the backend emits (token rooms,
|
|
1822
|
+
* comment rooms, the global feed, the overseers' firehose, a connection's own user and overseer
|
|
1823
|
+
* rooms). Every `subscribe*` method on it is synchronous, returns that subscriber's own unsubscribe,
|
|
1824
|
+
* serves any number of subscribers per event, and joins a room on its first subscriber and leaves it on
|
|
1825
|
+
* its last. It also has `connect`, `authenticate`, `deauthenticate`, `onConnectionStateChange`,
|
|
1826
|
+
* `onReconnect` and the chat / reaction / typing senders.
|
|
1740
1827
|
*
|
|
1741
|
-
*
|
|
1742
|
-
*
|
|
1828
|
+
* Created on first use.
|
|
1829
|
+
*
|
|
1830
|
+
* @throws ConfigurationError if `streamWebSocketUrl` is not configured
|
|
1831
|
+
* @since 9.0.0
|
|
1832
|
+
* @category WebSocket
|
|
1743
1833
|
*/
|
|
1744
|
-
|
|
1834
|
+
get realtime(): StreamWebSocketService;
|
|
1745
1835
|
/**
|
|
1746
1836
|
* Fetch a single ERC-20 token balance on Ethereum.
|
|
1747
1837
|
*
|
|
@@ -2459,6 +2549,35 @@ export declare class LaunchpadSDK {
|
|
|
2459
2549
|
* ```
|
|
2460
2550
|
*/
|
|
2461
2551
|
login(): Promise<LoginResponse>;
|
|
2552
|
+
/**
|
|
2553
|
+
* Log in with a signature the caller made: a browser wallet signs the login message
|
|
2554
|
+
* (`Sign in to Launchpad t:<ms>`, {@link JWT_CONSTANTS}) itself, so an SDK built with only a
|
|
2555
|
+
* `signer` has nothing to sign it with. `publicKey` registers a `client|` alias's key.
|
|
2556
|
+
*
|
|
2557
|
+
* With an app `session` the login asks for a cookie session (the refresh token becomes an httpOnly
|
|
2558
|
+
* cookie and is absent from the answer) and nothing is stored in the SDK: hand the answer to the
|
|
2559
|
+
* session. Without one the tokens are stored as {@link login} stores them. A failure is an
|
|
2560
|
+
* `AuthError` carrying the backend's `statusCode`.
|
|
2561
|
+
*
|
|
2562
|
+
* @since 9.0.0
|
|
2563
|
+
* @category Authentication
|
|
2564
|
+
*
|
|
2565
|
+
* @example
|
|
2566
|
+
* ```typescript
|
|
2567
|
+
* const message = `Sign in to Launchpad t:${Date.now()}`;
|
|
2568
|
+
* const signature = await provider.signMessage(message);
|
|
2569
|
+
* const { accessToken, refreshExpiresIn } = await sdk.loginWithSignature({ address, message, signature });
|
|
2570
|
+
* ```
|
|
2571
|
+
*/
|
|
2572
|
+
loginWithSignature(request: LoginRequest): Promise<LoginResponse>;
|
|
2573
|
+
/**
|
|
2574
|
+
* Log in as `address` without a signature: the backend's development bypass, accepted by
|
|
2575
|
+
* non-production deployments only. Session handling as in {@link loginWithSignature}.
|
|
2576
|
+
*
|
|
2577
|
+
* @since 9.0.0
|
|
2578
|
+
* @category Authentication
|
|
2579
|
+
*/
|
|
2580
|
+
loginWithDevBypass(address: string): Promise<LoginResponse>;
|
|
2462
2581
|
/**
|
|
2463
2582
|
* Refresh the current JWT token.
|
|
2464
2583
|
*
|
|
@@ -2506,9 +2625,14 @@ export declare class LaunchpadSDK {
|
|
|
2506
2625
|
* await sdk.logout({ allDevices: true });
|
|
2507
2626
|
* console.log('Logged out from all devices');
|
|
2508
2627
|
* ```
|
|
2628
|
+
*
|
|
2629
|
+
* With an app `session` the logout always reaches the server (`POST /auth/logout`, the cookie
|
|
2630
|
+
* naming the session to revoke), carries `options.accessToken` as its bearer when given, and
|
|
2631
|
+
* throws an `AuthError` (with the backend's `statusCode`) when it fails.
|
|
2509
2632
|
*/
|
|
2510
2633
|
logout(options?: {
|
|
2511
2634
|
allDevices?: boolean;
|
|
2635
|
+
accessToken?: string | null;
|
|
2512
2636
|
}): Promise<void>;
|
|
2513
2637
|
/**
|
|
2514
2638
|
* Check if user is authenticated with valid JWT.
|
|
@@ -2819,7 +2943,7 @@ export declare class LaunchpadSDK {
|
|
|
2819
2943
|
* ```typescript
|
|
2820
2944
|
* const { targets } = await sdk.getSimulcastTargets('mytoken');
|
|
2821
2945
|
* targets.forEach(t => {
|
|
2822
|
-
* console.log(`${t.
|
|
2946
|
+
* console.log(`${t.passthrough ?? t.url}: ${t.status}`);
|
|
2823
2947
|
* });
|
|
2824
2948
|
* ```
|
|
2825
2949
|
*/
|
|
@@ -2839,11 +2963,11 @@ export declare class LaunchpadSDK {
|
|
|
2839
2963
|
*
|
|
2840
2964
|
* @example Add YouTube simulcast
|
|
2841
2965
|
* ```typescript
|
|
2842
|
-
* const target = await sdk.addSimulcastTarget({
|
|
2966
|
+
* const { target } = await sdk.addSimulcastTarget({
|
|
2843
2967
|
* tokenName: 'mytoken',
|
|
2844
|
-
* platform: '
|
|
2968
|
+
* platform: 'youtube',
|
|
2845
2969
|
* streamKey: 'xxxx-xxxx-xxxx-xxxx',
|
|
2846
|
-
*
|
|
2970
|
+
* url: 'rtmp://a.rtmp.youtube.com/live2',
|
|
2847
2971
|
* });
|
|
2848
2972
|
* console.log(`Added target: ${target.id}`);
|
|
2849
2973
|
* ```
|
|
@@ -3043,6 +3167,25 @@ export declare class LaunchpadSDK {
|
|
|
3043
3167
|
*
|
|
3044
3168
|
* Deprecated: Chat status is now included in token details (GET /v1/tokens/:tokenName)
|
|
3045
3169
|
*/
|
|
3170
|
+
/**
|
|
3171
|
+
* The chat status of a token (`GET /live/:tokenName/chat`, public): whether chat is on, why it is
|
|
3172
|
+
* off (`reason`: `'global'` or `'token'`) and the slow-mode interval (`slowModeSeconds`, 0 = off).
|
|
3173
|
+
*
|
|
3174
|
+
* @param tokenName - Token name
|
|
3175
|
+
* @returns The token's chat status
|
|
3176
|
+
* @throws ValidationError if the token name is invalid
|
|
3177
|
+
*
|
|
3178
|
+
* @since 9.0.0
|
|
3179
|
+
* @category Chat
|
|
3180
|
+
*
|
|
3181
|
+
* @example
|
|
3182
|
+
* ```typescript
|
|
3183
|
+
* const status = await sdk.getChatStatus('mytoken');
|
|
3184
|
+
* if (!status.enabled) console.log('Chat is off:', status.reason);
|
|
3185
|
+
* console.log('Slow mode:', status.slowModeSeconds ?? 0, 's');
|
|
3186
|
+
* ```
|
|
3187
|
+
*/
|
|
3188
|
+
getChatStatus(tokenName: string): Promise<ChatStatusResponse>;
|
|
3046
3189
|
/**
|
|
3047
3190
|
* Disable chat for a specific token.
|
|
3048
3191
|
*
|
|
@@ -3058,11 +3201,7 @@ export declare class LaunchpadSDK {
|
|
|
3058
3201
|
* @since 5.4.0 - Added dual-auth support (Admin API key OR JWT owner)
|
|
3059
3202
|
* @category Chat
|
|
3060
3203
|
*/
|
|
3061
|
-
disableChat(tokenName: string): Promise<
|
|
3062
|
-
enabled: boolean;
|
|
3063
|
-
tokenName: string;
|
|
3064
|
-
status?: string;
|
|
3065
|
-
}>;
|
|
3204
|
+
disableChat(tokenName: string): Promise<ChatStatusResponse>;
|
|
3066
3205
|
/**
|
|
3067
3206
|
* Enable chat for a specific token.
|
|
3068
3207
|
*
|
|
@@ -3079,11 +3218,7 @@ export declare class LaunchpadSDK {
|
|
|
3079
3218
|
* @since 5.4.0 - Added dual-auth support (Admin API key OR JWT owner)
|
|
3080
3219
|
* @category Chat
|
|
3081
3220
|
*/
|
|
3082
|
-
enableChat(tokenName: string): Promise<
|
|
3083
|
-
enabled: boolean;
|
|
3084
|
-
tokenName: string;
|
|
3085
|
-
status?: string;
|
|
3086
|
-
}>;
|
|
3221
|
+
enableChat(tokenName: string): Promise<ChatStatusResponse>;
|
|
3087
3222
|
/**
|
|
3088
3223
|
* Get the currently pinned chat message for a token (v6.x.0+)
|
|
3089
3224
|
*
|
|
@@ -3105,7 +3240,7 @@ export declare class LaunchpadSDK {
|
|
|
3105
3240
|
* }
|
|
3106
3241
|
* ```
|
|
3107
3242
|
*/
|
|
3108
|
-
getPinnedChatMessage(tokenName: string): Promise<
|
|
3243
|
+
getPinnedChatMessage(tokenName: string): Promise<GetPinnedMessageResult>;
|
|
3109
3244
|
/**
|
|
3110
3245
|
* Pin a chat message for a token (v6.x.0+)
|
|
3111
3246
|
*
|
|
@@ -3114,7 +3249,8 @@ export declare class LaunchpadSDK {
|
|
|
3114
3249
|
*
|
|
3115
3250
|
* @param tokenName Token name (lowercase)
|
|
3116
3251
|
* @param messageId ID of the message to pin
|
|
3117
|
-
* @returns
|
|
3252
|
+
* @returns The token's pinned message as read back after the pin. `pinnedMessage` is null when
|
|
3253
|
+
* another moderator unpinned it between the two requests.
|
|
3118
3254
|
* @throws {ValidationError} If token name or message ID is invalid
|
|
3119
3255
|
* @throws {Error} If user is not authorized to pin messages
|
|
3120
3256
|
*
|
|
@@ -3124,10 +3260,10 @@ export declare class LaunchpadSDK {
|
|
|
3124
3260
|
* @example Pin a message
|
|
3125
3261
|
* ```typescript
|
|
3126
3262
|
* const result = await sdk.pinChatMessage('mytoken', 'msg123');
|
|
3127
|
-
* console.log('Message pinned:', result.pinnedMessage
|
|
3263
|
+
* console.log('Message pinned:', result.pinnedMessage?.messageId);
|
|
3128
3264
|
* ```
|
|
3129
3265
|
*/
|
|
3130
|
-
pinChatMessage(tokenName: string, messageId: string): Promise<
|
|
3266
|
+
pinChatMessage(tokenName: string, messageId: string): Promise<GetPinnedMessageResult>;
|
|
3131
3267
|
/**
|
|
3132
3268
|
* Unpin the currently pinned chat message for a token (v6.x.0+)
|
|
3133
3269
|
*
|
|
@@ -3147,7 +3283,7 @@ export declare class LaunchpadSDK {
|
|
|
3147
3283
|
* console.log('Message unpinned');
|
|
3148
3284
|
* ```
|
|
3149
3285
|
*/
|
|
3150
|
-
unpinChatMessage(tokenName: string): Promise<
|
|
3286
|
+
unpinChatMessage(tokenName: string): Promise<UnpinMessageResult>;
|
|
3151
3287
|
/**
|
|
3152
3288
|
* Set slow mode interval for a token's chat (v8.x.0+)
|
|
3153
3289
|
*
|
|
@@ -3539,7 +3675,7 @@ export declare class LaunchpadSDK {
|
|
|
3539
3675
|
* // Paginate through keys (cursor-based)
|
|
3540
3676
|
* if (result.pageInfo.hasNextPage) {
|
|
3541
3677
|
* const page2 = await sdk.listApiKeys({
|
|
3542
|
-
* cursor: result.pageInfo.
|
|
3678
|
+
* cursor: result.pageInfo.endCursor ?? undefined,
|
|
3543
3679
|
* pageSize: 10
|
|
3544
3680
|
* });
|
|
3545
3681
|
* }
|
|
@@ -4744,7 +4880,7 @@ export declare class LaunchpadSDK {
|
|
|
4744
4880
|
* const result = await sdk.listTokenBans({ cursor, pageSize: 20 });
|
|
4745
4881
|
* console.log('Bans:', result.items.map(b => b.tokenName));
|
|
4746
4882
|
* hasMore = result.pageInfo.hasNextPage;
|
|
4747
|
-
* cursor = result.pageInfo.
|
|
4883
|
+
* cursor = result.pageInfo.endCursor ?? undefined;
|
|
4748
4884
|
* }
|
|
4749
4885
|
* ```
|
|
4750
4886
|
*/
|
|
@@ -5120,8 +5256,7 @@ export declare class LaunchpadSDK {
|
|
|
5120
5256
|
* const { stats } = await sdk.getPlatformStats();
|
|
5121
5257
|
*
|
|
5122
5258
|
* // Display volume in millions
|
|
5123
|
-
*
|
|
5124
|
-
* console.log(`24h Volume: ${(vol24h / 1_000_000).toFixed(2)}M GALA`);
|
|
5259
|
+
* console.log(`24h Volume: ${(stats.galaVolume24h / 1_000_000).toFixed(2)}M GALA`);
|
|
5125
5260
|
*
|
|
5126
5261
|
* // Display token count
|
|
5127
5262
|
* console.log(`${stats.totalTokens} tokens on platform`);
|
|
@@ -5132,6 +5267,55 @@ export declare class LaunchpadSDK {
|
|
|
5132
5267
|
* ```
|
|
5133
5268
|
*/
|
|
5134
5269
|
getPlatformStats(): Promise<GetPlatformStatsResult>;
|
|
5270
|
+
/**
|
|
5271
|
+
* The launchpad backend's dependency health (`GET /health`). Public: no Authorization header.
|
|
5272
|
+
*
|
|
5273
|
+
* A critical dependency being down answers HTTP 503, which throws a `NetworkError`.
|
|
5274
|
+
*
|
|
5275
|
+
* @returns Overall status and the state of each dependency
|
|
5276
|
+
* @since 9.0.0
|
|
5277
|
+
* @category Health
|
|
5278
|
+
*
|
|
5279
|
+
* @example
|
|
5280
|
+
* ```typescript
|
|
5281
|
+
* const health = await sdk.getHealth();
|
|
5282
|
+
* console.log(health.status, health.database?.status, health.redis?.status);
|
|
5283
|
+
* ```
|
|
5284
|
+
*/
|
|
5285
|
+
getHealth(): Promise<HealthCheckResponse>;
|
|
5286
|
+
/**
|
|
5287
|
+
* Aggregate event statistics (`GET /v1/events/stats`). Admin API key or Overseer JWT.
|
|
5288
|
+
*
|
|
5289
|
+
* @returns Event totals, today's count, unique users and tokens, and the count per event type
|
|
5290
|
+
* @throws ConfigurationError if neither an admin API key nor a JWT is configured
|
|
5291
|
+
* @since 9.0.0
|
|
5292
|
+
* @category Events
|
|
5293
|
+
*
|
|
5294
|
+
* @example
|
|
5295
|
+
* ```typescript
|
|
5296
|
+
* const stats = await sdk.getEventStats();
|
|
5297
|
+
* console.log(stats.totalEvents, stats.eventsByType);
|
|
5298
|
+
* ```
|
|
5299
|
+
*/
|
|
5300
|
+
getEventStats(): Promise<EventStats>;
|
|
5301
|
+
/**
|
|
5302
|
+
* One page of stored events (`GET /v1/events`). Admin API key or Overseer JWT. Paging is offset
|
|
5303
|
+
* style (`page`, `limit` 1..100), not a cursor.
|
|
5304
|
+
*
|
|
5305
|
+
* @param options - Filters (user, token, event types, dates, search), paging and sorting
|
|
5306
|
+
* @returns `{ data, pagination: { page, limit, total, totalPages } }`
|
|
5307
|
+
* @throws ValidationError for an out-of-range limit / page or an unknown sort, preset or source
|
|
5308
|
+
* @throws ConfigurationError if neither an admin API key nor a JWT is configured
|
|
5309
|
+
* @since 9.0.0
|
|
5310
|
+
* @category Events
|
|
5311
|
+
*
|
|
5312
|
+
* @example
|
|
5313
|
+
* ```typescript
|
|
5314
|
+
* const page = await sdk.queryEvents({ tokenName: 'anime', eventTypes: ['token_buy'], page: 1, limit: 50 });
|
|
5315
|
+
* console.log(page.pagination.total, page.data[0]?.eventType);
|
|
5316
|
+
* ```
|
|
5317
|
+
*/
|
|
5318
|
+
queryEvents(options?: QueryEventsOptions): Promise<QueryEventsResult>;
|
|
5135
5319
|
/**
|
|
5136
5320
|
* Register a push notification device token.
|
|
5137
5321
|
*
|
|
@@ -5575,7 +5759,7 @@ export declare class LaunchpadSDK {
|
|
|
5575
5759
|
* @example Get chat messages for a token
|
|
5576
5760
|
* ```typescript
|
|
5577
5761
|
* const { messages, pageInfo } = await sdk.fetchMessages({
|
|
5578
|
-
* type: '
|
|
5762
|
+
* type: 'CHAT_MESSAGE',
|
|
5579
5763
|
* tokenName: 'anime'
|
|
5580
5764
|
* });
|
|
5581
5765
|
* console.log(`Found ${pageInfo.totalCount} chat messages`);
|
|
@@ -5615,11 +5799,11 @@ export declare class LaunchpadSDK {
|
|
|
5615
5799
|
* @example Create a chat message
|
|
5616
5800
|
* ```typescript
|
|
5617
5801
|
* const result = await sdk.createMessage({
|
|
5618
|
-
* type: '
|
|
5802
|
+
* type: 'CHAT_MESSAGE',
|
|
5619
5803
|
* tokenName: 'anime',
|
|
5620
5804
|
* content: 'Hello world!'
|
|
5621
5805
|
* });
|
|
5622
|
-
* console.log('Created message ID:', result.message.
|
|
5806
|
+
* console.log('Created message ID:', result.message.messageId);
|
|
5623
5807
|
* ```
|
|
5624
5808
|
*
|
|
5625
5809
|
* @example Create a comment
|
|
@@ -5631,7 +5815,7 @@ export declare class LaunchpadSDK {
|
|
|
5631
5815
|
* });
|
|
5632
5816
|
* ```
|
|
5633
5817
|
*/
|
|
5634
|
-
createMessage(options: CreateMessageOptions): Promise<CreateMessageResult
|
|
5818
|
+
createMessage<T extends MessageType>(options: CreateMessageOptions<T>): Promise<CreateMessageResult<T>>;
|
|
5635
5819
|
/**
|
|
5636
5820
|
* Update a message's content.
|
|
5637
5821
|
*
|
|
@@ -5649,12 +5833,13 @@ export declare class LaunchpadSDK {
|
|
|
5649
5833
|
* @example Update a message
|
|
5650
5834
|
* ```typescript
|
|
5651
5835
|
* const result = await sdk.updateMessage('msg-1234567890123-abc...', {
|
|
5652
|
-
* content: 'Updated message content'
|
|
5836
|
+
* content: 'Updated message content',
|
|
5837
|
+
* type: 'COMMENT'
|
|
5653
5838
|
* });
|
|
5654
5839
|
* console.log('Updated at:', result.message.updatedAt);
|
|
5655
5840
|
* ```
|
|
5656
5841
|
*/
|
|
5657
|
-
updateMessage(id: string, options: UpdateMessageOptions): Promise<UpdateMessageResult
|
|
5842
|
+
updateMessage<T extends MessageType = MessageType>(id: string, options: UpdateMessageOptions<T>): Promise<UpdateMessageResult<T>>;
|
|
5658
5843
|
/**
|
|
5659
5844
|
* Delete a message.
|
|
5660
5845
|
*
|
|
@@ -5697,7 +5882,7 @@ export declare class LaunchpadSDK {
|
|
|
5697
5882
|
* }
|
|
5698
5883
|
* ```
|
|
5699
5884
|
*/
|
|
5700
|
-
getPinnedMessage(tokenName: string): Promise<
|
|
5885
|
+
getPinnedMessage(tokenName: string): Promise<PinnedMessageResult>;
|
|
5701
5886
|
/**
|
|
5702
5887
|
* Pin a message.
|
|
5703
5888
|
*
|
|
@@ -5896,7 +6081,7 @@ export declare class LaunchpadSDK {
|
|
|
5896
6081
|
*
|
|
5897
6082
|
* @example Disable chat for a token
|
|
5898
6083
|
* ```typescript
|
|
5899
|
-
* await sdk.updateTokenConfig('anime', {
|
|
6084
|
+
* await sdk.updateTokenConfig('anime', { chatEnabled: false });
|
|
5900
6085
|
* ```
|
|
5901
6086
|
*
|
|
5902
6087
|
* @example Enable comments for a token
|
|
@@ -5907,7 +6092,7 @@ export declare class LaunchpadSDK {
|
|
|
5907
6092
|
* @example Update messaging and comments
|
|
5908
6093
|
* ```typescript
|
|
5909
6094
|
* await sdk.updateTokenConfig('anime', {
|
|
5910
|
-
*
|
|
6095
|
+
* chatEnabled: true,
|
|
5911
6096
|
* commentsEnabled: false
|
|
5912
6097
|
* });
|
|
5913
6098
|
* ```
|
|
@@ -5965,8 +6150,8 @@ export declare class LaunchpadSDK {
|
|
|
5965
6150
|
*
|
|
5966
6151
|
* @example Get all trades for a token
|
|
5967
6152
|
* ```typescript
|
|
5968
|
-
* const { trades,
|
|
5969
|
-
* console.log(`Found ${
|
|
6153
|
+
* const { trades, pageInfo } = await sdk.getTrades({ tokenName: 'anime' });
|
|
6154
|
+
* console.log(`Found ${trades.length} trades, more: ${pageInfo.hasNextPage}`);
|
|
5970
6155
|
* trades.forEach(trade => {
|
|
5971
6156
|
* console.log(`${trade.txnType}: ${trade.inputAmount} -> ${trade.outputAmount}`);
|
|
5972
6157
|
* });
|
|
@@ -5974,20 +6159,20 @@ export declare class LaunchpadSDK {
|
|
|
5974
6159
|
*
|
|
5975
6160
|
* @example Get all trades by a user
|
|
5976
6161
|
* ```typescript
|
|
5977
|
-
* const { trades,
|
|
6162
|
+
* const { trades, pageInfo } = await sdk.getTrades({
|
|
5978
6163
|
* userAddress: 'eth|1234567890abcdef...'
|
|
5979
6164
|
* });
|
|
5980
|
-
* console.log(
|
|
6165
|
+
* console.log(`${trades.length} trades across all tokens, more: ${pageInfo.hasNextPage}`);
|
|
5981
6166
|
* ```
|
|
5982
6167
|
*
|
|
5983
6168
|
* @example Get a user's trades on a specific token with pagination
|
|
5984
6169
|
* ```typescript
|
|
5985
|
-
* const
|
|
6170
|
+
* const page = await sdk.getTrades({
|
|
5986
6171
|
* tokenName: 'anime',
|
|
5987
6172
|
* userAddress: 'eth|1234567890abcdef...',
|
|
5988
6173
|
* pageSize: 20
|
|
5989
6174
|
* });
|
|
5990
|
-
* console.log(
|
|
6175
|
+
* console.log(`${page.trades.length} trades, next cursor: ${page.pageInfo.endCursor}`);
|
|
5991
6176
|
* ```
|
|
5992
6177
|
*/
|
|
5993
6178
|
getTrades(options: GetTradesOptions): Promise<TradesQueryResult>;
|
|
@@ -6138,10 +6323,12 @@ export declare class LaunchpadSDK {
|
|
|
6138
6323
|
/**
|
|
6139
6324
|
* Connect to the stream WebSocket server.
|
|
6140
6325
|
*
|
|
6141
|
-
* Establishes a WebSocket connection for real-time stream events.
|
|
6142
|
-
*
|
|
6326
|
+
* Establishes a WebSocket connection for real-time stream events. Idempotent and safe to call
|
|
6327
|
+
* concurrently (one socket). Subscribing opens it by itself, so calling this is only needed to wait for
|
|
6328
|
+
* the connection.
|
|
6143
6329
|
*
|
|
6144
|
-
* @param callbacks - Event callback handlers
|
|
6330
|
+
* @param callbacks - Event callback handlers: each becomes its own subscriber of its event on every token
|
|
6331
|
+
* (they join no room, and replace nothing registered before); `disconnectStreamWebSocket()` removes them
|
|
6145
6332
|
* @returns Promise resolving when connected
|
|
6146
6333
|
* @throws Error if streamWebSocketUrl is not configured
|
|
6147
6334
|
*
|
|
@@ -6167,12 +6354,16 @@ export declare class LaunchpadSDK {
|
|
|
6167
6354
|
/**
|
|
6168
6355
|
* Authenticate the stream WebSocket connection.
|
|
6169
6356
|
*
|
|
6170
|
-
* Required before sending chat messages via WebSocket.
|
|
6171
|
-
*
|
|
6357
|
+
* Required before sending chat messages via WebSocket, and for the user and overseer events.
|
|
6358
|
+
* Opens the connection if it is not open. With an app `session` the token is `session.accessToken()`,
|
|
6359
|
+
* otherwise the SDK's own session token (refreshed when near expiry); pass `token` to use a specific
|
|
6360
|
+
* one, e.g. right after the app refreshed its JWT. After a reconnect the socket re-authenticates
|
|
6361
|
+
* itself with the token current at that moment.
|
|
6172
6362
|
*
|
|
6173
|
-
* @
|
|
6174
|
-
* @
|
|
6175
|
-
*
|
|
6363
|
+
* @param token - JWT to authenticate with (default: the session's current token)
|
|
6364
|
+
* @returns Promise resolving `true` once the server confirms; `false` when the server rejects the
|
|
6365
|
+
* token, does not answer within 10 seconds, the connection drops, there is no token, or a newer
|
|
6366
|
+
* `authenticateStreamWebSocket` / `deauthenticateStreamWebSocket` call replaced this one
|
|
6176
6367
|
*
|
|
6177
6368
|
* @since 5.1.0
|
|
6178
6369
|
* @category WebSocket
|
|
@@ -6184,15 +6375,30 @@ export declare class LaunchpadSDK {
|
|
|
6184
6375
|
* // Now can send chat messages via WebSocket
|
|
6185
6376
|
* ```
|
|
6186
6377
|
*/
|
|
6187
|
-
authenticateStreamWebSocket(): Promise<
|
|
6378
|
+
authenticateStreamWebSocket(token?: string): Promise<boolean>;
|
|
6379
|
+
/**
|
|
6380
|
+
* Forget the stream socket's authenticated identity (call it when the wallet disconnects).
|
|
6381
|
+
*
|
|
6382
|
+
* Cancels a pending authentication and stops re-authenticating on reconnect. The server has no message
|
|
6383
|
+
* that drops a connection's identity, so an authenticated socket is closed and opened again: your
|
|
6384
|
+
* subscriptions stay registered and are joined again on the new connection.
|
|
6385
|
+
*
|
|
6386
|
+
* @since 9.0.0
|
|
6387
|
+
* @category WebSocket
|
|
6388
|
+
*/
|
|
6389
|
+
deauthenticateStreamWebSocket(): void;
|
|
6188
6390
|
/**
|
|
6189
6391
|
* Subscribe to real-time events for a stream.
|
|
6190
6392
|
*
|
|
6191
|
-
* Joins the stream room
|
|
6393
|
+
* Joins the stream room and registers each callback in `callbacks` as a subscriber of that token.
|
|
6394
|
+
* Calling it again for a token ADDS callbacks (it replaces nothing). The room is joined once however
|
|
6395
|
+
* many callers share it; use the `sdk.realtime.subscribe*` methods for subscriptions that are released
|
|
6396
|
+
* one by one.
|
|
6192
6397
|
*
|
|
6193
6398
|
* @param tokenName - Token name (lowercase)
|
|
6194
|
-
* @
|
|
6195
|
-
* @
|
|
6399
|
+
* @param callbacks - Event callbacks for this token
|
|
6400
|
+
* @returns Promise resolving when the server confirms the room
|
|
6401
|
+
* @throws Error if the connection fails or the server does not confirm within 10 seconds
|
|
6196
6402
|
*
|
|
6197
6403
|
* @since 5.1.0
|
|
6198
6404
|
* @category WebSocket
|
|
@@ -6209,13 +6415,12 @@ export declare class LaunchpadSDK {
|
|
|
6209
6415
|
*/
|
|
6210
6416
|
subscribeToStream(tokenName: string, callbacks?: StreamEventCallbacks): Promise<StreamSubscribedEvent>;
|
|
6211
6417
|
/**
|
|
6212
|
-
*
|
|
6418
|
+
* Remove what `subscribeToStream` registered for a token.
|
|
6213
6419
|
*
|
|
6214
|
-
*
|
|
6420
|
+
* The token's room is left when no subscriber of any kind remains for it; other subscribers (from
|
|
6421
|
+
* `sdk.realtime.subscribe*`) are untouched.
|
|
6215
6422
|
*
|
|
6216
6423
|
* @param tokenName - Token name (lowercase)
|
|
6217
|
-
* @returns Promise resolving when unsubscribed
|
|
6218
|
-
* @throws Error if not connected
|
|
6219
6424
|
*
|
|
6220
6425
|
* @since 5.1.0
|
|
6221
6426
|
* @category WebSocket
|
|
@@ -6331,7 +6536,8 @@ export declare class LaunchpadSDK {
|
|
|
6331
6536
|
/**
|
|
6332
6537
|
* Disconnect from the stream WebSocket server.
|
|
6333
6538
|
*
|
|
6334
|
-
* Closes the WebSocket connection and
|
|
6539
|
+
* Closes the WebSocket connection and releases everything it holds: every subscriber, listener and
|
|
6540
|
+
* timer. Unsubscribe functions handed out earlier stay harmless; subscribing again opens a new socket.
|
|
6335
6541
|
*
|
|
6336
6542
|
* @since 5.1.0
|
|
6337
6543
|
* @category WebSocket
|
|
@@ -6362,7 +6568,7 @@ export declare class LaunchpadSDK {
|
|
|
6362
6568
|
* });
|
|
6363
6569
|
* ```
|
|
6364
6570
|
*/
|
|
6365
|
-
onStreamStatusChanged(callback:
|
|
6571
|
+
onStreamStatusChanged(callback: RealtimeListener<'STREAM_STATUS'>): Unsubscribe;
|
|
6366
6572
|
/**
|
|
6367
6573
|
* Subscribe to user ban events
|
|
6368
6574
|
*
|
|
@@ -6372,7 +6578,7 @@ export declare class LaunchpadSDK {
|
|
|
6372
6578
|
* @since 5.12.0
|
|
6373
6579
|
* @category WebSocket
|
|
6374
6580
|
*/
|
|
6375
|
-
onUserBanned(callback:
|
|
6581
|
+
onUserBanned(callback: RealtimeListener<'USER_BANNED'>): Unsubscribe;
|
|
6376
6582
|
/**
|
|
6377
6583
|
* Subscribe to user unban events
|
|
6378
6584
|
*
|
|
@@ -6382,7 +6588,7 @@ export declare class LaunchpadSDK {
|
|
|
6382
6588
|
* @since 5.12.0
|
|
6383
6589
|
* @category WebSocket
|
|
6384
6590
|
*/
|
|
6385
|
-
onUserUnbanned(callback:
|
|
6591
|
+
onUserUnbanned(callback: RealtimeListener<'USER_UNBANNED'>): Unsubscribe;
|
|
6386
6592
|
/**
|
|
6387
6593
|
* Subscribe to ban enforcement events (kick, mute, ban)
|
|
6388
6594
|
*
|
|
@@ -6392,7 +6598,7 @@ export declare class LaunchpadSDK {
|
|
|
6392
6598
|
* @since 5.12.0
|
|
6393
6599
|
* @category WebSocket
|
|
6394
6600
|
*/
|
|
6395
|
-
onBanEnforcement(callback:
|
|
6601
|
+
onBanEnforcement(callback: RealtimeListener<'BAN_ENFORCEMENT'>): Unsubscribe;
|
|
6396
6602
|
/**
|
|
6397
6603
|
* Watch all user ban/unban/enforcement events, normalized into a single stream.
|
|
6398
6604
|
*
|
|
@@ -6414,10 +6620,13 @@ export declare class LaunchpadSDK {
|
|
|
6414
6620
|
*/
|
|
6415
6621
|
watchBanEnforcement(callback: (event: {
|
|
6416
6622
|
actionType: 'BANNED' | 'UNBANNED' | 'ENFORCEMENT';
|
|
6417
|
-
|
|
6418
|
-
|
|
6623
|
+
/** Absent on the copy the backend sends to the banned user themselves (only overseers see it). */
|
|
6624
|
+
userAddress: string | null;
|
|
6625
|
+
/** `null`: a global ban. */
|
|
6626
|
+
tokenName: string | null;
|
|
6419
6627
|
reason: string | null;
|
|
6420
|
-
|
|
6628
|
+
/** ISO 8601 expiry of a temporary ban. */
|
|
6629
|
+
expiresAt?: string;
|
|
6421
6630
|
}) => void, filters?: {
|
|
6422
6631
|
userAddress?: string;
|
|
6423
6632
|
actionType?: 'BANNED' | 'UNBANNED' | 'ENFORCEMENT';
|
|
@@ -6427,15 +6636,10 @@ export declare class LaunchpadSDK {
|
|
|
6427
6636
|
/**
|
|
6428
6637
|
* Shared implementation for watching a per-token stream room event.
|
|
6429
6638
|
*
|
|
6430
|
-
* The
|
|
6431
|
-
*
|
|
6432
|
-
*
|
|
6433
|
-
* the
|
|
6434
|
-
* (eventKey, tokenName) so concurrent watchers never clobber each other, calls the real
|
|
6435
|
-
* subscribeXxx() only once per key, and only actually leaves the token's stream room
|
|
6436
|
-
* (unsubscribeFromStream) once every event type's listeners for that token have cleared -
|
|
6437
|
-
* otherwise a short-lived MCP tool call's cleanup could tear down a room another concurrent
|
|
6438
|
-
* watcher on the same token still needs.
|
|
6639
|
+
* The StreamWebSocketService registry serves any number of subscribers per event and token, joins a
|
|
6640
|
+
* token's room on its first subscriber and leaves it on its last, so a watcher is one subscribe call
|
|
6641
|
+
* (the socket opens by itself) and its cleanup is that subscriber's own unsubscribe: another watcher of
|
|
6642
|
+
* the same event and token, or of another event of the same token, is untouched.
|
|
6439
6643
|
*
|
|
6440
6644
|
* Requires `filters.tokenName`: these are all per-token room events, so there is no way to
|
|
6441
6645
|
* "watch every token" the way a genuinely global event (e.g. onLaunchpadTokenCreation) can.
|
|
@@ -6627,7 +6831,7 @@ export declare class LaunchpadSDK {
|
|
|
6627
6831
|
* @since 5.12.0
|
|
6628
6832
|
* @category WebSocket
|
|
6629
6833
|
*/
|
|
6630
|
-
onContentFlagged(callback:
|
|
6834
|
+
onContentFlagged(callback: RealtimeListener<'CONTENT_FLAGGED'>): Unsubscribe;
|
|
6631
6835
|
/**
|
|
6632
6836
|
* Subscribe to flag resolved events
|
|
6633
6837
|
*
|
|
@@ -6637,7 +6841,7 @@ export declare class LaunchpadSDK {
|
|
|
6637
6841
|
* @since 5.12.0
|
|
6638
6842
|
* @category WebSocket
|
|
6639
6843
|
*/
|
|
6640
|
-
onFlagResolved(callback:
|
|
6844
|
+
onFlagResolved(callback: RealtimeListener<'FLAG_RESOLVED'>): Unsubscribe;
|
|
6641
6845
|
/**
|
|
6642
6846
|
* Subscribe to new stream chat messages
|
|
6643
6847
|
*
|
|
@@ -6647,7 +6851,7 @@ export declare class LaunchpadSDK {
|
|
|
6647
6851
|
* @since 5.12.0
|
|
6648
6852
|
* @category WebSocket
|
|
6649
6853
|
*/
|
|
6650
|
-
onStreamChatMessage(callback:
|
|
6854
|
+
onStreamChatMessage(callback: RealtimeListener<'STREAM_CHAT_MESSAGE'>): Unsubscribe;
|
|
6651
6855
|
/**
|
|
6652
6856
|
* Subscribe to stream chat message updates
|
|
6653
6857
|
*
|
|
@@ -6657,7 +6861,7 @@ export declare class LaunchpadSDK {
|
|
|
6657
6861
|
* @since 5.12.0
|
|
6658
6862
|
* @category WebSocket
|
|
6659
6863
|
*/
|
|
6660
|
-
onStreamChatUpdated(callback:
|
|
6864
|
+
onStreamChatUpdated(callback: RealtimeListener<'STREAM_CHAT_UPDATED'>): Unsubscribe;
|
|
6661
6865
|
/**
|
|
6662
6866
|
* Subscribe to stream chat message deletions
|
|
6663
6867
|
*
|
|
@@ -6667,7 +6871,7 @@ export declare class LaunchpadSDK {
|
|
|
6667
6871
|
* @since 5.12.0
|
|
6668
6872
|
* @category WebSocket
|
|
6669
6873
|
*/
|
|
6670
|
-
onStreamChatDeleted(callback:
|
|
6874
|
+
onStreamChatDeleted(callback: RealtimeListener<'STREAM_CHAT_DELETED'>): Unsubscribe;
|
|
6671
6875
|
/**
|
|
6672
6876
|
* Subscribe to stream chat message pins
|
|
6673
6877
|
*
|
|
@@ -6677,7 +6881,7 @@ export declare class LaunchpadSDK {
|
|
|
6677
6881
|
* @since 5.12.0
|
|
6678
6882
|
* @category WebSocket
|
|
6679
6883
|
*/
|
|
6680
|
-
onStreamChatPinned(callback:
|
|
6884
|
+
onStreamChatPinned(callback: RealtimeListener<'STREAM_CHAT_PINNED'>): Unsubscribe;
|
|
6681
6885
|
/**
|
|
6682
6886
|
* Subscribe to stream chat message unpins
|
|
6683
6887
|
*
|
|
@@ -6687,7 +6891,7 @@ export declare class LaunchpadSDK {
|
|
|
6687
6891
|
* @since 5.12.0
|
|
6688
6892
|
* @category WebSocket
|
|
6689
6893
|
*/
|
|
6690
|
-
onStreamChatUnpinned(callback:
|
|
6894
|
+
onStreamChatUnpinned(callback: RealtimeListener<'STREAM_CHAT_UNPINNED'>): Unsubscribe;
|
|
6691
6895
|
/**
|
|
6692
6896
|
* Subscribe to chat status changes (enable/disable)
|
|
6693
6897
|
*
|
|
@@ -6697,7 +6901,7 @@ export declare class LaunchpadSDK {
|
|
|
6697
6901
|
* @since 5.12.0
|
|
6698
6902
|
* @category WebSocket
|
|
6699
6903
|
*/
|
|
6700
|
-
onChatStatusChanged(callback:
|
|
6904
|
+
onChatStatusChanged(callback: RealtimeListener<'CHAT_STATUS_CHANGED'>): Unsubscribe;
|
|
6701
6905
|
/**
|
|
6702
6906
|
* Subscribe to viewer count changes
|
|
6703
6907
|
*
|
|
@@ -6707,7 +6911,7 @@ export declare class LaunchpadSDK {
|
|
|
6707
6911
|
* @since 5.12.0
|
|
6708
6912
|
* @category WebSocket
|
|
6709
6913
|
*/
|
|
6710
|
-
onViewerCountChanged(callback:
|
|
6914
|
+
onViewerCountChanged(callback: RealtimeListener<'VIEWER_COUNT'>): Unsubscribe;
|
|
6711
6915
|
/**
|
|
6712
6916
|
* Subscribe to recording status changes
|
|
6713
6917
|
*
|
|
@@ -6717,7 +6921,7 @@ export declare class LaunchpadSDK {
|
|
|
6717
6921
|
* @since 5.12.0
|
|
6718
6922
|
* @category WebSocket
|
|
6719
6923
|
*/
|
|
6720
|
-
onRecordingStatusChanged(callback:
|
|
6924
|
+
onRecordingStatusChanged(callback: RealtimeListener<'RECORDING_STATUS'>): Unsubscribe;
|
|
6721
6925
|
/**
|
|
6722
6926
|
* Subscribe to simulcast target status changes
|
|
6723
6927
|
*
|
|
@@ -6727,7 +6931,7 @@ export declare class LaunchpadSDK {
|
|
|
6727
6931
|
* @since 5.12.0
|
|
6728
6932
|
* @category WebSocket
|
|
6729
6933
|
*/
|
|
6730
|
-
onSimulcastStatusChanged(callback:
|
|
6934
|
+
onSimulcastStatusChanged(callback: RealtimeListener<'SIMULCAST_STATUS'>): Unsubscribe;
|
|
6731
6935
|
/**
|
|
6732
6936
|
* Subscribe to download ready events
|
|
6733
6937
|
*
|
|
@@ -6737,7 +6941,7 @@ export declare class LaunchpadSDK {
|
|
|
6737
6941
|
* @since 5.12.0
|
|
6738
6942
|
* @category WebSocket
|
|
6739
6943
|
*/
|
|
6740
|
-
onDownloadReady(callback:
|
|
6944
|
+
onDownloadReady(callback: RealtimeListener<'DOWNLOAD_READY'>): Unsubscribe;
|
|
6741
6945
|
/**
|
|
6742
6946
|
* Subscribe to recordings count updates
|
|
6743
6947
|
*
|
|
@@ -6747,7 +6951,7 @@ export declare class LaunchpadSDK {
|
|
|
6747
6951
|
* @since 9.0.0
|
|
6748
6952
|
* @category WebSocket
|
|
6749
6953
|
*/
|
|
6750
|
-
onRecordingsCountUpdated(callback:
|
|
6954
|
+
onRecordingsCountUpdated(callback: RealtimeListener<'RECORDINGS_COUNT_UPDATED'>): Unsubscribe;
|
|
6751
6955
|
/**
|
|
6752
6956
|
* Subscribe to user typing indicators
|
|
6753
6957
|
*
|
|
@@ -6757,7 +6961,7 @@ export declare class LaunchpadSDK {
|
|
|
6757
6961
|
* @since 5.12.0
|
|
6758
6962
|
* @category WebSocket
|
|
6759
6963
|
*/
|
|
6760
|
-
onUserTyping(callback:
|
|
6964
|
+
onUserTyping(callback: RealtimeListener<'USER_TYPING'>): Unsubscribe;
|
|
6761
6965
|
/**
|
|
6762
6966
|
* Subscribe to stream reactions (emoji)
|
|
6763
6967
|
*
|
|
@@ -6767,7 +6971,7 @@ export declare class LaunchpadSDK {
|
|
|
6767
6971
|
* @since 5.12.0
|
|
6768
6972
|
* @category WebSocket
|
|
6769
6973
|
*/
|
|
6770
|
-
onStreamReaction(callback:
|
|
6974
|
+
onStreamReaction(callback: RealtimeListener<'STREAM_REACTION'>): Unsubscribe;
|
|
6771
6975
|
/**
|
|
6772
6976
|
* Subscribe to content reaction additions
|
|
6773
6977
|
*
|
|
@@ -6777,7 +6981,7 @@ export declare class LaunchpadSDK {
|
|
|
6777
6981
|
* @since 5.12.0
|
|
6778
6982
|
* @category WebSocket
|
|
6779
6983
|
*/
|
|
6780
|
-
onContentReactionAdded(callback:
|
|
6984
|
+
onContentReactionAdded(callback: RealtimeListener<'CONTENT_REACTION_ADDED'>): Unsubscribe;
|
|
6781
6985
|
/**
|
|
6782
6986
|
* Subscribe to content reaction removals
|
|
6783
6987
|
*
|
|
@@ -6787,7 +6991,7 @@ export declare class LaunchpadSDK {
|
|
|
6787
6991
|
* @since 5.12.0
|
|
6788
6992
|
* @category WebSocket
|
|
6789
6993
|
*/
|
|
6790
|
-
onContentReactionRemoved(callback:
|
|
6994
|
+
onContentReactionRemoved(callback: RealtimeListener<'CONTENT_REACTION_REMOVED'>): Unsubscribe;
|
|
6791
6995
|
/**
|
|
6792
6996
|
* Subscribe to stream countdown updates
|
|
6793
6997
|
*
|
|
@@ -6797,7 +7001,7 @@ export declare class LaunchpadSDK {
|
|
|
6797
7001
|
* @since 5.12.0
|
|
6798
7002
|
* @category WebSocket
|
|
6799
7003
|
*/
|
|
6800
|
-
onStreamCountdownUpdated(callback:
|
|
7004
|
+
onStreamCountdownUpdated(callback: RealtimeListener<'STREAM_COUNTDOWN_UPDATED'>): Unsubscribe;
|
|
6801
7005
|
/**
|
|
6802
7006
|
* Subscribe to stream language updates
|
|
6803
7007
|
*
|
|
@@ -6807,7 +7011,7 @@ export declare class LaunchpadSDK {
|
|
|
6807
7011
|
* @since 5.12.0
|
|
6808
7012
|
* @category WebSocket
|
|
6809
7013
|
*/
|
|
6810
|
-
onStreamLanguageUpdated(callback:
|
|
7014
|
+
onStreamLanguageUpdated(callback: RealtimeListener<'STREAM_LANGUAGE_UPDATED'>): Unsubscribe;
|
|
6811
7015
|
/**
|
|
6812
7016
|
* Subscribe to stream control status changes
|
|
6813
7017
|
*
|
|
@@ -6817,7 +7021,7 @@ export declare class LaunchpadSDK {
|
|
|
6817
7021
|
* @since 5.12.0
|
|
6818
7022
|
* @category WebSocket
|
|
6819
7023
|
*/
|
|
6820
|
-
onStreamControlStatusChanged(callback:
|
|
7024
|
+
onStreamControlStatusChanged(callback: RealtimeListener<'STREAM_CONTROL_STATUS_CHANGED'>): Unsubscribe;
|
|
6821
7025
|
/**
|
|
6822
7026
|
* Subscribe to WebSocket connection events
|
|
6823
7027
|
*
|
|
@@ -6827,7 +7031,7 @@ export declare class LaunchpadSDK {
|
|
|
6827
7031
|
* @since 5.12.0
|
|
6828
7032
|
* @category WebSocket
|
|
6829
7033
|
*/
|
|
6830
|
-
onConnection(callback:
|
|
7034
|
+
onConnection(callback: RealtimeListener<'connection'>): Unsubscribe;
|
|
6831
7035
|
/**
|
|
6832
7036
|
* Subscribe to WebSocket authentication events
|
|
6833
7037
|
*
|
|
@@ -6837,7 +7041,7 @@ export declare class LaunchpadSDK {
|
|
|
6837
7041
|
* @since 5.12.0
|
|
6838
7042
|
* @category WebSocket
|
|
6839
7043
|
*/
|
|
6840
|
-
onAuthenticated(callback:
|
|
7044
|
+
onAuthenticated(callback: RealtimeListener<'authenticated'>): Unsubscribe;
|
|
6841
7045
|
/**
|
|
6842
7046
|
* Subscribe to token stream room subscription events
|
|
6843
7047
|
*
|
|
@@ -6847,7 +7051,7 @@ export declare class LaunchpadSDK {
|
|
|
6847
7051
|
* @since 5.12.0
|
|
6848
7052
|
* @category WebSocket
|
|
6849
7053
|
*/
|
|
6850
|
-
onTokenSubscribed(callback:
|
|
7054
|
+
onTokenSubscribed(callback: RealtimeListener<'token_subscribed'>): Unsubscribe;
|
|
6851
7055
|
/**
|
|
6852
7056
|
* Subscribe to token stream room unsubscription events
|
|
6853
7057
|
*
|
|
@@ -6857,7 +7061,7 @@ export declare class LaunchpadSDK {
|
|
|
6857
7061
|
* @since 5.12.0
|
|
6858
7062
|
* @category WebSocket
|
|
6859
7063
|
*/
|
|
6860
|
-
onTokenUnsubscribed(callback:
|
|
7064
|
+
onTokenUnsubscribed(callback: RealtimeListener<'token_unsubscribed'>): Unsubscribe;
|
|
6861
7065
|
/**
|
|
6862
7066
|
* Subscribe to comment room subscription events
|
|
6863
7067
|
*
|
|
@@ -6867,7 +7071,7 @@ export declare class LaunchpadSDK {
|
|
|
6867
7071
|
* @since 5.12.0
|
|
6868
7072
|
* @category WebSocket
|
|
6869
7073
|
*/
|
|
6870
|
-
onRoomSubscribed(callback:
|
|
7074
|
+
onRoomSubscribed(callback: RealtimeListener<'room_subscribed'>): Unsubscribe;
|
|
6871
7075
|
/**
|
|
6872
7076
|
* Subscribe to comment room unsubscription events
|
|
6873
7077
|
*
|
|
@@ -6877,7 +7081,7 @@ export declare class LaunchpadSDK {
|
|
|
6877
7081
|
* @since 5.12.0
|
|
6878
7082
|
* @category WebSocket
|
|
6879
7083
|
*/
|
|
6880
|
-
onRoomLeft(callback:
|
|
7084
|
+
onRoomLeft(callback: RealtimeListener<'room_left'>): Unsubscribe;
|
|
6881
7085
|
/**
|
|
6882
7086
|
* Subscribe to engagement stats update events
|
|
6883
7087
|
*
|
|
@@ -6899,7 +7103,7 @@ export declare class LaunchpadSDK {
|
|
|
6899
7103
|
* });
|
|
6900
7104
|
* ```
|
|
6901
7105
|
*/
|
|
6902
|
-
onEngagementStatsUpdated(callback:
|
|
7106
|
+
onEngagementStatsUpdated(callback: RealtimeListener<'ENGAGEMENT_STATS_UPDATED'>): Unsubscribe;
|
|
6903
7107
|
/**
|
|
6904
7108
|
* Estimate bridge fees for a cross-chain transfer.
|
|
6905
7109
|
*
|
|
@@ -7687,7 +7891,7 @@ export declare class LaunchpadSDK {
|
|
|
7687
7891
|
*
|
|
7688
7892
|
* @category Token Creation
|
|
7689
7893
|
* @param data - Token launch configuration
|
|
7690
|
-
* @param data.tokenName - Unique token name (
|
|
7894
|
+
* @param data.tokenName - Unique token name (1-25 letters and digits, required)
|
|
7691
7895
|
* @param data.tokenSymbol - Token symbol (3-6 characters, required)
|
|
7692
7896
|
* @param data.tokenDescription - Token description (optional)
|
|
7693
7897
|
* @param data.tokenImage - Image URL or path (optional)
|
|
@@ -7776,49 +7980,33 @@ export declare class LaunchpadSDK {
|
|
|
7776
7980
|
*/
|
|
7777
7981
|
launchToken(data: LaunchTokenData): Promise<TokenLaunchResult>;
|
|
7778
7982
|
/**
|
|
7779
|
-
* Upload a token image
|
|
7780
|
-
*
|
|
7781
|
-
* Uploads an image file from the local filesystem for a specific token. The image is stored on the
|
|
7782
|
-
* launchpad server and can be displayed in the UI and API responses. Supports common image formats
|
|
7783
|
-
* (PNG, JPG, GIF) and automatically handles image validation and optimization.
|
|
7983
|
+
* Upload a token image (`POST /v1/tokens/:tokenName/image`)
|
|
7784
7984
|
*
|
|
7785
|
-
*
|
|
7786
|
-
*
|
|
7787
|
-
*
|
|
7788
|
-
*
|
|
7789
|
-
* to override the default wallet for this operation.
|
|
7985
|
+
* Takes the image as a browser `File` or a Node.js `Buffer` and answers the URL it is served from.
|
|
7986
|
+
* The route needs only the logged-in session's bearer: it works on an SDK configured with a signer
|
|
7987
|
+
* and a wallet address (and a `session`, or after `login()`), with no `wallet`. The token must be
|
|
7988
|
+
* the caller's to manage; the backend answers 403 otherwise.
|
|
7790
7989
|
*
|
|
7791
7990
|
* @category Main SDK
|
|
7792
|
-
* @param options -
|
|
7793
|
-
* @param options.tokenName - Token name to upload image for (
|
|
7794
|
-
* @param options.
|
|
7795
|
-
* @param options.privateKey - Optional private key override for this operation (format: 0x + 64 hex characters)
|
|
7991
|
+
* @param options - `{ tokenName, options: { file } }`
|
|
7992
|
+
* @param options.tokenName - Token name to upload the image for (letters and digits, the path name the pool lookup resolves)
|
|
7993
|
+
* @param options.options.file - The image: a `File` (browser) or `Buffer` (Node.js), PNG or JPEG
|
|
7994
|
+
* @param options.privateKey - Optional private key override for this operation (format: 0x + 64 hex characters); signs in as that wallet
|
|
7796
7995
|
* @returns Promise<string> URL where the image is hosted and can be accessed
|
|
7797
|
-
* @throws {ValidationError} If tokenName is invalid
|
|
7798
|
-
* @throws {
|
|
7799
|
-
* @throws {NetworkError} If upload request fails
|
|
7996
|
+
* @throws {ValidationError} If tokenName is invalid or the file is not an image
|
|
7997
|
+
* @throws {ConfigurationError} If there is no session or logged-in token
|
|
7998
|
+
* @throws {NetworkError} If upload request fails (the backend's answer is kept: its size limit, 403, 404)
|
|
7800
7999
|
* @since 4.0.4-beta.0
|
|
8000
|
+
* @since 9.0.0 - needs no `wallet` (it threw "Wallet is required" on a signer-plus-address SDK)
|
|
7801
8001
|
*
|
|
7802
|
-
* @example Upload image
|
|
8002
|
+
* @example Upload an image
|
|
7803
8003
|
* ```typescript
|
|
7804
|
-
* import path from 'path';
|
|
7805
|
-
*
|
|
7806
8004
|
* const imageUrl = await sdk.uploadTokenImage({
|
|
7807
8005
|
* tokenName: 'mytoken',
|
|
7808
|
-
*
|
|
8006
|
+
* options: { file: imageBuffer }
|
|
7809
8007
|
* });
|
|
7810
|
-
*
|
|
7811
8008
|
* console.log(`Image uploaded: ${imageUrl}`);
|
|
7812
8009
|
* ```
|
|
7813
|
-
*
|
|
7814
|
-
* @example Upload with private key override
|
|
7815
|
-
* ```typescript
|
|
7816
|
-
* const imageUrl = await sdk.uploadTokenImage({
|
|
7817
|
-
* tokenName: 'mytoken',
|
|
7818
|
-
* imagePath: '/absolute/path/to/image.png',
|
|
7819
|
-
* privateKey: process.env.ALTERNATIVE_PRIVATE_KEY
|
|
7820
|
-
* });
|
|
7821
|
-
* ```
|
|
7822
8010
|
*/
|
|
7823
8011
|
uploadTokenImage(options: UploadImageByTokenNameOptions): Promise<string>;
|
|
7824
8012
|
/**
|
|
@@ -7853,7 +8041,7 @@ export declare class LaunchpadSDK {
|
|
|
7853
8041
|
* attempting to launch a token to prevent registration failures.
|
|
7854
8042
|
*
|
|
7855
8043
|
* @category Token Validation
|
|
7856
|
-
* @param tokenName - Token name to check availability for (
|
|
8044
|
+
* @param tokenName - Token name to check availability for (letters and digits, up to 25 characters)
|
|
7857
8045
|
* @returns Promise resolving to true if name is available, false if already taken
|
|
7858
8046
|
* @throws {ValidationError} If tokenName format is invalid
|
|
7859
8047
|
* @throws {NetworkError} If API request fails
|
|
@@ -7963,9 +8151,9 @@ export declare class LaunchpadSDK {
|
|
|
7963
8151
|
/**
|
|
7964
8152
|
* Fetch user profile information by wallet address
|
|
7965
8153
|
*
|
|
7966
|
-
*
|
|
7967
|
-
*
|
|
7968
|
-
*
|
|
8154
|
+
* `GET /v1/users/:address` (public, no authentication): name, profile image, bio, aggregated stats
|
|
8155
|
+
* and the four badge ladders. An address with no profile row still answers a profile (`fullName`,
|
|
8156
|
+
* `profileImage` and `bio` are null).
|
|
7969
8157
|
*
|
|
7970
8158
|
* **Supports both address formats:**
|
|
7971
8159
|
* - Standard Ethereum format: `0x...` (64 hex characters after 0x prefix)
|
|
@@ -7973,29 +8161,25 @@ export declare class LaunchpadSDK {
|
|
|
7973
8161
|
*
|
|
7974
8162
|
* @category Main SDK
|
|
7975
8163
|
* @param address - Optional wallet address in 0x... or eth|... format. Defaults to current SDK wallet address.
|
|
7976
|
-
* @returns
|
|
8164
|
+
* @returns The public profile (the `data` of the backend's envelope)
|
|
7977
8165
|
* @throws {ValidationError} If wallet is not configured and no address is provided
|
|
7978
|
-
* @throws {NetworkError} If launchpad API request fails
|
|
8166
|
+
* @throws {NetworkError} If launchpad API request fails, or answers a body that is not a profile
|
|
7979
8167
|
* @since 4.0.4-beta.0
|
|
8168
|
+
* @since 9.0.0 - typed `PublicUserProfile` (it returned the whole `{ data }` envelope as `unknown`)
|
|
7980
8169
|
*
|
|
7981
8170
|
* @example Fetch current user's profile
|
|
7982
8171
|
* ```typescript
|
|
7983
8172
|
* const profile = await sdk.fetchProfile();
|
|
7984
|
-
*
|
|
7985
|
-
* console.log(`User: ${profile.fullName}`);
|
|
7986
|
-
* console.log(`Image: ${profile.profileImage}`);
|
|
7987
|
-
* } else {
|
|
7988
|
-
* console.log('No profile created yet');
|
|
7989
|
-
* }
|
|
8173
|
+
* console.log(`User: ${profile.fullName}, tokens created: ${profile.stats.tokensCreated}`);
|
|
7990
8174
|
* ```
|
|
7991
8175
|
*
|
|
7992
8176
|
* @example Fetch profile for specific address
|
|
7993
8177
|
* ```typescript
|
|
7994
8178
|
* const profile = await sdk.fetchProfile('eth|742d35Cc6634C0532925a3b8D0Ea2c76f94C31C0');
|
|
7995
|
-
* console.log(`Profile owner: ${profile
|
|
8179
|
+
* console.log(`Profile owner: ${profile.fullName}`);
|
|
7996
8180
|
* ```
|
|
7997
8181
|
*/
|
|
7998
|
-
fetchProfile(address?: string): Promise<
|
|
8182
|
+
fetchProfile(address?: string): Promise<PublicUserProfile>;
|
|
7999
8183
|
/**
|
|
8000
8184
|
* Fetch the current user's referral URL
|
|
8001
8185
|
*
|
|
@@ -8157,17 +8341,17 @@ export declare class LaunchpadSDK {
|
|
|
8157
8341
|
* Only the wallet owner can update their own profile. Changes take effect immediately after
|
|
8158
8342
|
* successful submission to the launchpad server.
|
|
8159
8343
|
*
|
|
8160
|
-
* **Requires
|
|
8161
|
-
*
|
|
8344
|
+
* **Requires a JWT** (the backend updates the user of the token). Only the fields given are sent:
|
|
8345
|
+
* an omitted field is left as it is, `profileImage: ''` clears the image.
|
|
8162
8346
|
*
|
|
8163
8347
|
* @category Main SDK
|
|
8164
|
-
* @param data - Profile update data
|
|
8165
|
-
* @param data.address -
|
|
8166
|
-
* @param data.fullName - User's full name (optional,
|
|
8167
|
-
* @param data.profileImage - Profile image URL (optional,
|
|
8348
|
+
* @param data - Profile update data (at least one of fullName and profileImage)
|
|
8349
|
+
* @param data.address - Optional (0x... or eth|... format); validated, not sent
|
|
8350
|
+
* @param data.fullName - User's full name (optional, 2 to 20 letters, a second word allowed)
|
|
8351
|
+
* @param data.profileImage - Profile image URL (optional, `''` clears it, null leaves it)
|
|
8168
8352
|
* @param data.privateKey - Optional private key override for this operation (format: 0x + 64 hex characters)
|
|
8169
8353
|
* @returns Promise<void> No return data - throws on failure
|
|
8170
|
-
* @throws {ValidationError} If address
|
|
8354
|
+
* @throws {ValidationError} If the address or name is invalid or nothing is given
|
|
8171
8355
|
* @throws {NetworkError} If launchpad API request fails
|
|
8172
8356
|
* @since 4.0.4-beta.0
|
|
8173
8357
|
*
|
|
@@ -8200,55 +8384,30 @@ export declare class LaunchpadSDK {
|
|
|
8200
8384
|
*/
|
|
8201
8385
|
updateProfile(data: UpdateProfileData): Promise<void>;
|
|
8202
8386
|
/**
|
|
8203
|
-
* Upload a profile image for
|
|
8204
|
-
*
|
|
8205
|
-
* Uploads an image file from the local filesystem as a user's profile picture. The image is stored on the
|
|
8206
|
-
* launchpad server and displayed in user profiles and UI throughout the platform. Supports common image formats
|
|
8207
|
-
* (PNG, JPG, GIF) and automatically handles image validation and optimization.
|
|
8208
|
-
*
|
|
8209
|
-
* **Important:** This method is only available in Node.js environments (not in browsers).
|
|
8210
|
-
* Use for backend applications, build scripts, or CLI tools that manage user profiles.
|
|
8387
|
+
* Upload a profile image for the logged-in user (`POST /v1/users/me/image`)
|
|
8211
8388
|
*
|
|
8212
|
-
*
|
|
8213
|
-
*
|
|
8389
|
+
* Takes the image as a browser `File` or a Node.js `Buffer` and answers the URL it is served from.
|
|
8390
|
+
* The backend uploads for the user of the session JWT, so the route needs no address and no `wallet`:
|
|
8391
|
+
* it works on an SDK configured with a signer and a wallet address (and a `session`, or after
|
|
8392
|
+
* `login()`). An `address` that is given is validated and only names the multipart file.
|
|
8214
8393
|
*
|
|
8215
8394
|
* @category Main SDK
|
|
8216
8395
|
* @param options - Profile image upload options
|
|
8217
|
-
* @param options.
|
|
8218
|
-
* @param options.address - Optional
|
|
8219
|
-
* @param options.privateKey - Optional private key override for this operation (format: 0x + 64 hex characters)
|
|
8396
|
+
* @param options.file - The image: a `File` (browser) or `Buffer` (Node.js), PNG or JPEG
|
|
8397
|
+
* @param options.address - Optional address (0x... or eth|... or client|...); validated, not sent
|
|
8398
|
+
* @param options.privateKey - Optional private key override for this operation (format: 0x + 64 hex characters); signs in as that wallet
|
|
8220
8399
|
* @returns Promise<string> URL where the profile image is hosted and can be accessed
|
|
8221
|
-
* @throws {ValidationError} If
|
|
8222
|
-
* @throws {
|
|
8223
|
-
* @throws {NetworkError} If upload request fails
|
|
8400
|
+
* @throws {ValidationError} If the address is not a valid address
|
|
8401
|
+
* @throws {ConfigurationError} If there is no session or logged-in token
|
|
8402
|
+
* @throws {NetworkError} If upload request fails (the backend's answer is kept: its size limit, 400 for a bad format)
|
|
8224
8403
|
* @since 4.0.4-beta.0
|
|
8404
|
+
* @since 9.0.0 - needs no `wallet` and no address (it threw "Wallet is required" on a signer-plus-address SDK)
|
|
8225
8405
|
*
|
|
8226
|
-
* @example Upload profile image
|
|
8406
|
+
* @example Upload a profile image
|
|
8227
8407
|
* ```typescript
|
|
8228
|
-
*
|
|
8229
|
-
*
|
|
8230
|
-
* const imageUrl = await sdk.uploadProfileImage({
|
|
8231
|
-
* imagePath: path.join(process.cwd(), 'profile-picture.png')
|
|
8232
|
-
* });
|
|
8233
|
-
*
|
|
8408
|
+
* const imageUrl = await sdk.uploadProfileImage({ file: imageBuffer });
|
|
8234
8409
|
* console.log(`Profile image uploaded: ${imageUrl}`);
|
|
8235
8410
|
* ```
|
|
8236
|
-
*
|
|
8237
|
-
* @example Upload image for specific address
|
|
8238
|
-
* ```typescript
|
|
8239
|
-
* const imageUrl = await sdk.uploadProfileImage({
|
|
8240
|
-
* imagePath: '/absolute/path/to/profile.png',
|
|
8241
|
-
* address: 'eth|742d35Cc6634C0532925a3b8D0Ea2c76f94C31C0'
|
|
8242
|
-
* });
|
|
8243
|
-
* ```
|
|
8244
|
-
*
|
|
8245
|
-
* @example Upload with private key override
|
|
8246
|
-
* ```typescript
|
|
8247
|
-
* const imageUrl = await sdk.uploadProfileImage({
|
|
8248
|
-
* imagePath: '/absolute/path/to/profile.png',
|
|
8249
|
-
* privateKey: process.env.ALTERNATIVE_PRIVATE_KEY
|
|
8250
|
-
* });
|
|
8251
|
-
* ```
|
|
8252
8411
|
*/
|
|
8253
8412
|
uploadProfileImage(options: UploadProfileImageOptions): Promise<string>;
|
|
8254
8413
|
/**
|
|
@@ -8356,6 +8515,42 @@ export declare class LaunchpadSDK {
|
|
|
8356
8515
|
* ```
|
|
8357
8516
|
*/
|
|
8358
8517
|
getManagedTokens(options?: GetManagedTokensOptions): Promise<ManagedTokensResult>;
|
|
8518
|
+
/**
|
|
8519
|
+
* A user's GALA balance and its USD value, as the launchpad backend reads them from the chain
|
|
8520
|
+
* (`GET /v1/users/:address/gala-balance`). Public; the backend never caches it. For a chain read
|
|
8521
|
+
* through the gateway instead, use {@link LaunchpadSDK.fetchGalaBalance}.
|
|
8522
|
+
*
|
|
8523
|
+
* @param address - The user's address (`eth|...`, `0x...` or `client|...`)
|
|
8524
|
+
* @returns `{ name: 'GALA', quantity, price, holdingPrice }`
|
|
8525
|
+
* @throws ValidationError if no address is given
|
|
8526
|
+
* @throws NetworkError if the backend cannot read the balance or the GALA price
|
|
8527
|
+
* @since 9.0.0
|
|
8528
|
+
* @category User Management
|
|
8529
|
+
*
|
|
8530
|
+
* @example
|
|
8531
|
+
* ```typescript
|
|
8532
|
+
* const gala = await sdk.getUserGalaBalance('eth|1234567890abcdef1234567890abcdef12345678');
|
|
8533
|
+
* console.log(`${gala.quantity} GALA = $${gala.holdingPrice}`);
|
|
8534
|
+
* ```
|
|
8535
|
+
*/
|
|
8536
|
+
getUserGalaBalance(address: string): Promise<UserGalaBalance>;
|
|
8537
|
+
/**
|
|
8538
|
+
* The authenticated user's referral code (`GET /v1/connect/users/referrals/code`, JWT session;
|
|
8539
|
+
* the backend asks Gala Connect for the wallet of the token). Not {@link LaunchpadSDK.fetchReferralUrl},
|
|
8540
|
+
* which is the DEX API's link for the SDK wallet.
|
|
8541
|
+
*
|
|
8542
|
+
* @returns `{ code, username? }`
|
|
8543
|
+
* @throws ConfigurationError if no JWT session is configured
|
|
8544
|
+
* @since 9.0.0
|
|
8545
|
+
* @category User Management
|
|
8546
|
+
*
|
|
8547
|
+
* @example
|
|
8548
|
+
* ```typescript
|
|
8549
|
+
* const { code } = await sdk.fetchReferralCode();
|
|
8550
|
+
* console.log(`https://pump.gala.com/?ref=${code}`);
|
|
8551
|
+
* ```
|
|
8552
|
+
*/
|
|
8553
|
+
fetchReferralCode(): Promise<ReferralCode>;
|
|
8359
8554
|
/**
|
|
8360
8555
|
* Transfer GALA tokens between wallets
|
|
8361
8556
|
*
|