@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
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The realtime event catalog: the one table the StreamWebSocketService routes by.
|
|
3
|
+
*
|
|
4
|
+
* - {@link STREAM_EVENTS}: the wire names (what the client emits, what the server emits).
|
|
5
|
+
* - {@link EVENT_ROUTES}: every event the server emits, with how a duplicate is recognised.
|
|
6
|
+
* It is typed against {@link RealtimeEventPayloads}, so an event added to the payload map without a route
|
|
7
|
+
* (or the reverse) does not compile.
|
|
8
|
+
* - the room-scoped event lists: which events a token room, a comment room and the global feed deliver.
|
|
9
|
+
* - the callback-object tables ({@link StreamEventCallbacks}, {@link GlobalFeedEventCallbacks}): one
|
|
10
|
+
* `onX` key per event, so the object form of subscribing is the same registry as the method form.
|
|
11
|
+
*
|
|
12
|
+
* @category WebSocket
|
|
13
|
+
* @since 9.0.0
|
|
14
|
+
*/
|
|
15
|
+
import type { SiteConfigState } from '../../types/global-feed.dto';
|
|
16
|
+
import type { RealtimeEventName, RealtimeEventPayloads } from '../../types/realtime-events.dto';
|
|
17
|
+
/**
|
|
18
|
+
* Stream event names used by the backend.
|
|
19
|
+
*
|
|
20
|
+
* Client to server names are snake_case (`@SubscribeMessage` handlers); server to client names are
|
|
21
|
+
* SCREAMING_CASE, except the acknowledgements and the connection events, which are lowercase.
|
|
22
|
+
*/
|
|
23
|
+
export declare const STREAM_EVENTS: {
|
|
24
|
+
readonly SUBSCRIBE: "subscribe_token";
|
|
25
|
+
readonly UNSUBSCRIBE: "unsubscribe_token";
|
|
26
|
+
readonly SUBSCRIBE_COMMENT: "subscribe_comment";
|
|
27
|
+
readonly UNSUBSCRIBE_COMMENT: "unsubscribe_comment";
|
|
28
|
+
readonly SUBSCRIBE_GLOBAL_FEED: "subscribe_global_feed";
|
|
29
|
+
readonly UNSUBSCRIBE_GLOBAL_FEED: "unsubscribe_global_feed";
|
|
30
|
+
readonly SUBSCRIBE_EVENTS_FIREHOSE: "subscribe_events_firehose";
|
|
31
|
+
readonly UNSUBSCRIBE_EVENTS_FIREHOSE: "unsubscribe_events_firehose";
|
|
32
|
+
readonly AUTHENTICATE: "authenticate";
|
|
33
|
+
readonly SEND_CHAT: "send_stream_chat";
|
|
34
|
+
readonly SEND_REACTION: "SEND_STREAM_REACTION";
|
|
35
|
+
readonly TYPING_START: "typing_start";
|
|
36
|
+
readonly TYPING_STOP: "typing_stop";
|
|
37
|
+
readonly STREAM_STATUS: "STREAM_STATUS";
|
|
38
|
+
readonly RECORDING_STATUS: "RECORDING_STATUS";
|
|
39
|
+
readonly RECORDINGS_COUNT_UPDATED: "RECORDINGS_COUNT_UPDATED";
|
|
40
|
+
readonly SIMULCAST_STATUS: "SIMULCAST_STATUS";
|
|
41
|
+
readonly DOWNLOAD_READY: "DOWNLOAD_READY";
|
|
42
|
+
readonly STREAM_COUNTDOWN_UPDATED: "STREAM_COUNTDOWN_UPDATED";
|
|
43
|
+
readonly STREAM_LANGUAGE_UPDATED: "STREAM_LANGUAGE_UPDATED";
|
|
44
|
+
readonly VIEWER_COUNT: "VIEWER_COUNT";
|
|
45
|
+
readonly STREAM_CONTROL_STATUS_CHANGED: "STREAM_CONTROL_STATUS_CHANGED";
|
|
46
|
+
readonly STREAM_GLOBAL_STATUS: "STREAM_GLOBAL_STATUS";
|
|
47
|
+
readonly ENGAGEMENT_STATS_UPDATED: "ENGAGEMENT_STATS_UPDATED";
|
|
48
|
+
readonly CHAT_MESSAGE: "STREAM_CHAT_MESSAGE";
|
|
49
|
+
readonly CHAT_SENT: "STREAM_CHAT_SENT";
|
|
50
|
+
readonly CHAT_UPDATED: "STREAM_CHAT_UPDATED";
|
|
51
|
+
readonly CHAT_DELETED: "STREAM_CHAT_DELETED";
|
|
52
|
+
readonly CHAT_PINNED: "STREAM_CHAT_PINNED";
|
|
53
|
+
readonly CHAT_UNPINNED: "STREAM_CHAT_UNPINNED";
|
|
54
|
+
readonly CHAT_STATUS: "CHAT_STATUS_CHANGED";
|
|
55
|
+
readonly SLOW_MODE_CHANGED: "SLOW_MODE_CHANGED";
|
|
56
|
+
readonly CHAT_GLOBAL_STATUS: "STREAM_CHAT_GLOBAL_STATUS";
|
|
57
|
+
readonly USER_TYPING: "USER_TYPING";
|
|
58
|
+
readonly CHAT_ERROR: "stream_chat_error";
|
|
59
|
+
readonly REACTION: "STREAM_REACTION";
|
|
60
|
+
readonly REACTION_ERROR: "stream_reaction_error";
|
|
61
|
+
readonly CONTENT_REACTION_ADDED: "CONTENT_REACTION_ADDED";
|
|
62
|
+
readonly CONTENT_REACTION_REMOVED: "CONTENT_REACTION_REMOVED";
|
|
63
|
+
readonly COMMENT_CREATED: "COMMENT_CREATED";
|
|
64
|
+
readonly COMMENT_UPDATED: "COMMENT_UPDATED";
|
|
65
|
+
readonly COMMENT_DELETED: "COMMENT_DELETED";
|
|
66
|
+
readonly TRADE_EXECUTED: "TRADE_EXECUTED";
|
|
67
|
+
readonly TRADE_UPDATE_NOTIFY: "TRADE_UPDATE_NOTIFY";
|
|
68
|
+
readonly BALANCE_UPDATED: "BALANCE_UPDATED";
|
|
69
|
+
readonly STATS_UPDATED: "STATS_UPDATED";
|
|
70
|
+
readonly USER_BANNED: "USER_BANNED";
|
|
71
|
+
readonly USER_UNBANNED: "USER_UNBANNED";
|
|
72
|
+
readonly BAN_ENFORCEMENT: "BAN_ENFORCEMENT";
|
|
73
|
+
readonly TOKEN_BANNED: "TOKEN_BANNED";
|
|
74
|
+
readonly TOKEN_UNBANNED: "TOKEN_UNBANNED";
|
|
75
|
+
readonly CONTENT_FLAGGED: "CONTENT_FLAGGED";
|
|
76
|
+
readonly FLAG_RESOLVED: "FLAG_RESOLVED";
|
|
77
|
+
readonly AI_MODERATION_COMPLETE: "AI_MODERATION_COMPLETE";
|
|
78
|
+
readonly AI_MODERATION_FAILED: "AI_MODERATION_FAILED";
|
|
79
|
+
readonly MODERATOR_INVITE_CREATED: "MODERATOR_INVITE_CREATED";
|
|
80
|
+
readonly MODERATOR_ADDED: "MODERATOR_ADDED";
|
|
81
|
+
readonly MODERATOR_REMOVED: "MODERATOR_REMOVED";
|
|
82
|
+
readonly MODERATOR_ROLE_UPDATED: "MODERATOR_ROLE_UPDATED";
|
|
83
|
+
readonly OVERSEER_ADDED: "OVERSEER_ADDED";
|
|
84
|
+
readonly OVERSEER_REMOVED: "OVERSEER_REMOVED";
|
|
85
|
+
readonly POOL_CREATED: "POOL_CREATED";
|
|
86
|
+
readonly POOL_METADATA_UPDATED: "POOL_METADATA_UPDATED";
|
|
87
|
+
readonly POOL_SOCIAL_LINKS_UPDATED: "POOL_SOCIAL_LINKS_UPDATED";
|
|
88
|
+
readonly POOL_BADGE_ASSIGNED: "POOL_BADGE_ASSIGNED";
|
|
89
|
+
readonly TOKEN_CONFIG_UPDATED: "TOKEN_CONFIG_UPDATED";
|
|
90
|
+
readonly HOLDER_COUNT_UPDATED: "HOLDER_COUNT_UPDATED";
|
|
91
|
+
readonly USER_PROFILE_UPDATED: "USER_PROFILE_UPDATED";
|
|
92
|
+
readonly API_KEY_CREATED: "API_KEY_CREATED";
|
|
93
|
+
readonly API_KEY_UPDATED: "API_KEY_UPDATED";
|
|
94
|
+
readonly API_KEY_REVOKED: "API_KEY_REVOKED";
|
|
95
|
+
readonly SITE_CONFIG_CHANGED: "SITE_CONFIG_CHANGED";
|
|
96
|
+
readonly COMMENTS_GLOBAL_STATUS: "COMMENTS_GLOBAL_STATUS";
|
|
97
|
+
readonly WEBHOOKS_GLOBAL_STATUS: "WEBHOOKS_GLOBAL_STATUS";
|
|
98
|
+
readonly AI_MODERATION_GLOBAL_STATUS: "AI_MODERATION_GLOBAL_STATUS";
|
|
99
|
+
readonly EVENT: "EVENT";
|
|
100
|
+
readonly CONNECTION: "connection";
|
|
101
|
+
readonly CHAT_AUTHENTICATED: "authenticated";
|
|
102
|
+
readonly CHAT_AUTH_ERROR: "stream_chat_auth_error";
|
|
103
|
+
readonly EXCEPTION: "exception";
|
|
104
|
+
readonly STREAM_SUBSCRIBED: "token_subscribed";
|
|
105
|
+
readonly STREAM_UNSUBSCRIBED: "token_unsubscribed";
|
|
106
|
+
readonly ROOM_SUBSCRIBED: "room_subscribed";
|
|
107
|
+
readonly ROOM_LEFT: "room_left";
|
|
108
|
+
readonly GLOBAL_FEED_SUBSCRIBED: "global_feed_subscribed";
|
|
109
|
+
readonly GLOBAL_FEED_UNSUBSCRIBED: "global_feed_unsubscribed";
|
|
110
|
+
readonly EVENTS_FIREHOSE_SUBSCRIBED: "events_firehose_subscribed";
|
|
111
|
+
readonly EVENTS_FIREHOSE_UNSUBSCRIBED: "events_firehose_unsubscribed";
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* How one incoming event is routed.
|
|
115
|
+
*/
|
|
116
|
+
export interface EventRoute {
|
|
117
|
+
/**
|
|
118
|
+
* Where the event's token comes from. `'payload'` (default): `payload.tokenName`; `'room'`: the
|
|
119
|
+
* `token:{name}` in `payload.room`; `'none'`: the event is not about one token.
|
|
120
|
+
*/
|
|
121
|
+
readonly token?: 'payload' | 'room' | 'none';
|
|
122
|
+
/**
|
|
123
|
+
* The backend sends this event through two rooms a client can be in at once (and the room-exclusion it
|
|
124
|
+
* uses does not cover that pair): the key names one occurrence, and a second occurrence with the same
|
|
125
|
+
* key within {@link DUPLICATE_WINDOW_MS} is dropped.
|
|
126
|
+
*/
|
|
127
|
+
readonly duplicateKey?: (payload: Record<string, unknown>) => string | undefined;
|
|
128
|
+
}
|
|
129
|
+
/** How long a second copy of the same occurrence is recognised as a duplicate. */
|
|
130
|
+
export declare const DUPLICATE_WINDOW_MS = 5000;
|
|
131
|
+
/**
|
|
132
|
+
* Every event the server emits and how it is routed. Absent fields mean the default: the token is
|
|
133
|
+
* `payload.tokenName`, and an occurrence arrives once.
|
|
134
|
+
*/
|
|
135
|
+
export declare const EVENT_ROUTES: {
|
|
136
|
+
readonly STREAM_STATUS: {};
|
|
137
|
+
readonly RECORDING_STATUS: {};
|
|
138
|
+
readonly RECORDINGS_COUNT_UPDATED: {};
|
|
139
|
+
readonly SIMULCAST_STATUS: {};
|
|
140
|
+
readonly DOWNLOAD_READY: {};
|
|
141
|
+
readonly STREAM_COUNTDOWN_UPDATED: {};
|
|
142
|
+
readonly STREAM_LANGUAGE_UPDATED: {};
|
|
143
|
+
readonly VIEWER_COUNT: {};
|
|
144
|
+
readonly STREAM_CONTROL_STATUS_CHANGED: {};
|
|
145
|
+
readonly STREAM_GLOBAL_STATUS: {
|
|
146
|
+
readonly token: "none";
|
|
147
|
+
};
|
|
148
|
+
readonly ENGAGEMENT_STATS_UPDATED: {};
|
|
149
|
+
readonly STREAM_CHAT_MESSAGE: {};
|
|
150
|
+
readonly STREAM_CHAT_SENT: {};
|
|
151
|
+
readonly STREAM_CHAT_UPDATED: {};
|
|
152
|
+
readonly STREAM_CHAT_DELETED: {};
|
|
153
|
+
readonly STREAM_CHAT_PINNED: {};
|
|
154
|
+
readonly STREAM_CHAT_UNPINNED: {};
|
|
155
|
+
readonly CHAT_STATUS_CHANGED: {};
|
|
156
|
+
readonly SLOW_MODE_CHANGED: {};
|
|
157
|
+
readonly STREAM_CHAT_GLOBAL_STATUS: {
|
|
158
|
+
readonly token: "none";
|
|
159
|
+
};
|
|
160
|
+
readonly USER_TYPING: {};
|
|
161
|
+
readonly stream_chat_error: {};
|
|
162
|
+
readonly STREAM_REACTION: {};
|
|
163
|
+
readonly stream_reaction_error: {};
|
|
164
|
+
readonly CONTENT_REACTION_ADDED: {};
|
|
165
|
+
readonly CONTENT_REACTION_REMOVED: {};
|
|
166
|
+
readonly COMMENT_CREATED: {};
|
|
167
|
+
readonly COMMENT_UPDATED: {};
|
|
168
|
+
readonly COMMENT_DELETED: {};
|
|
169
|
+
readonly TRADE_EXECUTED: {};
|
|
170
|
+
readonly TRADE_UPDATE_NOTIFY: {
|
|
171
|
+
readonly token: "none";
|
|
172
|
+
};
|
|
173
|
+
readonly BALANCE_UPDATED: {};
|
|
174
|
+
readonly STATS_UPDATED: {};
|
|
175
|
+
readonly USER_BANNED: {};
|
|
176
|
+
readonly USER_UNBANNED: {};
|
|
177
|
+
readonly BAN_ENFORCEMENT: {};
|
|
178
|
+
readonly TOKEN_BANNED: {};
|
|
179
|
+
readonly TOKEN_UNBANNED: {};
|
|
180
|
+
readonly CONTENT_FLAGGED: {
|
|
181
|
+
readonly duplicateKey: (payload: Record<string, unknown>) => string | undefined;
|
|
182
|
+
};
|
|
183
|
+
readonly FLAG_RESOLVED: {
|
|
184
|
+
readonly duplicateKey: (payload: Record<string, unknown>) => string | undefined;
|
|
185
|
+
};
|
|
186
|
+
readonly AI_MODERATION_COMPLETE: {
|
|
187
|
+
readonly duplicateKey: (payload: Record<string, unknown>) => string | undefined;
|
|
188
|
+
};
|
|
189
|
+
readonly AI_MODERATION_FAILED: {
|
|
190
|
+
readonly duplicateKey: (payload: Record<string, unknown>) => string | undefined;
|
|
191
|
+
};
|
|
192
|
+
readonly MODERATOR_INVITE_CREATED: {};
|
|
193
|
+
readonly MODERATOR_ADDED: {};
|
|
194
|
+
readonly MODERATOR_REMOVED: {};
|
|
195
|
+
readonly MODERATOR_ROLE_UPDATED: {};
|
|
196
|
+
readonly OVERSEER_ADDED: {
|
|
197
|
+
readonly token: "none";
|
|
198
|
+
readonly duplicateKey: (payload: Record<string, unknown>) => string | undefined;
|
|
199
|
+
};
|
|
200
|
+
readonly OVERSEER_REMOVED: {
|
|
201
|
+
readonly token: "none";
|
|
202
|
+
readonly duplicateKey: (payload: Record<string, unknown>) => string | undefined;
|
|
203
|
+
};
|
|
204
|
+
readonly POOL_CREATED: {
|
|
205
|
+
readonly duplicateKey: (payload: Record<string, unknown>) => string | undefined;
|
|
206
|
+
};
|
|
207
|
+
readonly POOL_METADATA_UPDATED: {};
|
|
208
|
+
readonly POOL_SOCIAL_LINKS_UPDATED: {};
|
|
209
|
+
readonly POOL_BADGE_ASSIGNED: {};
|
|
210
|
+
readonly TOKEN_CONFIG_UPDATED: {};
|
|
211
|
+
readonly HOLDER_COUNT_UPDATED: {};
|
|
212
|
+
readonly USER_PROFILE_UPDATED: {
|
|
213
|
+
readonly token: "none";
|
|
214
|
+
};
|
|
215
|
+
readonly API_KEY_CREATED: {
|
|
216
|
+
readonly token: "none";
|
|
217
|
+
};
|
|
218
|
+
readonly API_KEY_UPDATED: {
|
|
219
|
+
readonly token: "none";
|
|
220
|
+
};
|
|
221
|
+
readonly API_KEY_REVOKED: {
|
|
222
|
+
readonly token: "none";
|
|
223
|
+
};
|
|
224
|
+
readonly SITE_CONFIG_CHANGED: {
|
|
225
|
+
readonly token: "none";
|
|
226
|
+
};
|
|
227
|
+
readonly COMMENTS_GLOBAL_STATUS: {
|
|
228
|
+
readonly token: "none";
|
|
229
|
+
};
|
|
230
|
+
readonly WEBHOOKS_GLOBAL_STATUS: {
|
|
231
|
+
readonly token: "none";
|
|
232
|
+
};
|
|
233
|
+
readonly AI_MODERATION_GLOBAL_STATUS: {
|
|
234
|
+
readonly token: "none";
|
|
235
|
+
};
|
|
236
|
+
readonly EVENT: {
|
|
237
|
+
readonly token: "none";
|
|
238
|
+
};
|
|
239
|
+
readonly connection: {
|
|
240
|
+
readonly token: "none";
|
|
241
|
+
};
|
|
242
|
+
readonly authenticated: {
|
|
243
|
+
readonly token: "none";
|
|
244
|
+
};
|
|
245
|
+
readonly stream_chat_auth_error: {
|
|
246
|
+
readonly token: "none";
|
|
247
|
+
};
|
|
248
|
+
readonly exception: {
|
|
249
|
+
readonly token: "none";
|
|
250
|
+
};
|
|
251
|
+
readonly token_subscribed: {};
|
|
252
|
+
readonly token_unsubscribed: {
|
|
253
|
+
readonly token: "room";
|
|
254
|
+
};
|
|
255
|
+
readonly room_subscribed: {
|
|
256
|
+
readonly token: "none";
|
|
257
|
+
};
|
|
258
|
+
readonly room_left: {
|
|
259
|
+
readonly token: "none";
|
|
260
|
+
};
|
|
261
|
+
readonly global_feed_subscribed: {
|
|
262
|
+
readonly token: "none";
|
|
263
|
+
};
|
|
264
|
+
readonly global_feed_unsubscribed: {
|
|
265
|
+
readonly token: "none";
|
|
266
|
+
};
|
|
267
|
+
readonly events_firehose_subscribed: {
|
|
268
|
+
readonly token: "none";
|
|
269
|
+
};
|
|
270
|
+
readonly events_firehose_unsubscribed: {
|
|
271
|
+
readonly token: "none";
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
/** The routes as a plain map (an event name to its route). */
|
|
275
|
+
export declare function routeOf(name: RealtimeEventName): EventRoute;
|
|
276
|
+
/** Every event name the service listens for, once each. */
|
|
277
|
+
export declare const REALTIME_EVENT_NAMES: RealtimeEventName[];
|
|
278
|
+
/** The token a payload is about, or `undefined` when the event is not about one token. */
|
|
279
|
+
export declare function tokenOfPayload(name: RealtimeEventName, payload: Record<string, unknown>): string | undefined;
|
|
280
|
+
/**
|
|
281
|
+
* An event the SDK derives from another. The backend folds a token's countdown and language into
|
|
282
|
+
* `TOKEN_CONFIG_UPDATED` (it no longer emits `STREAM_COUNTDOWN_UPDATED` / `STREAM_LANGUAGE_UPDATED`), so the
|
|
283
|
+
* subscribers of those two are fed from the config delta.
|
|
284
|
+
*/
|
|
285
|
+
export type DerivedEvent = {
|
|
286
|
+
readonly name: 'STREAM_COUNTDOWN_UPDATED';
|
|
287
|
+
readonly payload: RealtimeEventPayloads['STREAM_COUNTDOWN_UPDATED'];
|
|
288
|
+
} | {
|
|
289
|
+
readonly name: 'STREAM_LANGUAGE_UPDATED';
|
|
290
|
+
readonly payload: RealtimeEventPayloads['STREAM_LANGUAGE_UPDATED'];
|
|
291
|
+
};
|
|
292
|
+
/** The events derived from one incoming occurrence. */
|
|
293
|
+
export declare function deriveEvents(name: RealtimeEventName, payload: Record<string, unknown>): DerivedEvent[];
|
|
294
|
+
/** The `token:` prefix of a token room. */
|
|
295
|
+
export declare const TOKEN_ROOM_PREFIX = "token:";
|
|
296
|
+
/** The `comment:` prefix of a comment room. */
|
|
297
|
+
export declare const COMMENT_ROOM_PREFIX = "comment:";
|
|
298
|
+
/** The global feed room. */
|
|
299
|
+
export declare const GLOBAL_FEED_ROOM = "global:feed";
|
|
300
|
+
/** The overseers' events firehose room. */
|
|
301
|
+
export declare const EVENTS_FIREHOSE_ROOM = "global:events_firehose";
|
|
302
|
+
/** The emit that joins or leaves a room. */
|
|
303
|
+
export interface RoomRequest {
|
|
304
|
+
readonly event: string;
|
|
305
|
+
readonly payload?: {
|
|
306
|
+
readonly tokenName: string;
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
/** The join and leave emits of a room, from its name. */
|
|
310
|
+
export declare function roomRequests(room: string): {
|
|
311
|
+
readonly join: RoomRequest;
|
|
312
|
+
readonly leave: RoomRequest;
|
|
313
|
+
};
|
|
314
|
+
/**
|
|
315
|
+
* Rooms only an authenticated overseer socket can join: the server rejects the join of any other socket
|
|
316
|
+
* with an `exception`, so the service joins them once the socket is authenticated.
|
|
317
|
+
*/
|
|
318
|
+
export declare function roomNeedsAuthentication(room: string): boolean;
|
|
319
|
+
/** Whether an incoming event is the server's answer to a room join. */
|
|
320
|
+
export declare function isRoomAcknowledgement(name: RealtimeEventName): boolean;
|
|
321
|
+
/** The site-wide switches, and the `SiteConfigState` field each event sets. */
|
|
322
|
+
export declare const SITE_SWITCH_EVENTS: Readonly<Partial<Record<RealtimeEventName, keyof SiteConfigState>>>;
|
|
323
|
+
/** The events a token room delivers (and that the server tags with the token). */
|
|
324
|
+
export declare const TOKEN_ROOM_EVENTS: readonly ["STREAM_STATUS", "RECORDING_STATUS", "RECORDINGS_COUNT_UPDATED", "SIMULCAST_STATUS", "DOWNLOAD_READY", "STREAM_COUNTDOWN_UPDATED", "STREAM_LANGUAGE_UPDATED", "VIEWER_COUNT", "STREAM_CONTROL_STATUS_CHANGED", "ENGAGEMENT_STATS_UPDATED", "STREAM_CHAT_MESSAGE", "STREAM_CHAT_SENT", "STREAM_CHAT_UPDATED", "STREAM_CHAT_DELETED", "STREAM_CHAT_PINNED", "STREAM_CHAT_UNPINNED", "CHAT_STATUS_CHANGED", "SLOW_MODE_CHANGED", "USER_TYPING", "stream_chat_error", "STREAM_REACTION", "stream_reaction_error", "CONTENT_REACTION_ADDED", "CONTENT_REACTION_REMOVED", "TRADE_EXECUTED", "BALANCE_UPDATED", "STATS_UPDATED", "TOKEN_BANNED", "TOKEN_UNBANNED", "CONTENT_FLAGGED", "FLAG_RESOLVED", "MODERATOR_INVITE_CREATED", "MODERATOR_ADDED", "MODERATOR_REMOVED", "MODERATOR_ROLE_UPDATED", "POOL_METADATA_UPDATED", "POOL_SOCIAL_LINKS_UPDATED", "POOL_BADGE_ASSIGNED", "TOKEN_CONFIG_UPDATED", "HOLDER_COUNT_UPDATED", "token_subscribed", "token_unsubscribed"];
|
|
325
|
+
/** The events the comment room delivers. */
|
|
326
|
+
export declare const COMMENT_ROOM_EVENTS: readonly ["COMMENT_CREATED", "COMMENT_UPDATED", "COMMENT_DELETED"];
|
|
327
|
+
/** The token events the global feed delivers (the same payloads as the token room). */
|
|
328
|
+
export declare const FEED_TOKEN_EVENTS: readonly ["STREAM_STATUS", "TRADE_EXECUTED", "HOLDER_COUNT_UPDATED", "POOL_BADGE_ASSIGNED", "VIEWER_COUNT", "TOKEN_CONFIG_UPDATED", "STATS_UPDATED", "POOL_CREATED"];
|
|
329
|
+
/** The site configuration events the global feed delivers. */
|
|
330
|
+
export declare const FEED_SITE_CONFIG_EVENTS: readonly ["SITE_CONFIG_CHANGED", "STREAM_GLOBAL_STATUS", "STREAM_CHAT_GLOBAL_STATUS", "COMMENTS_GLOBAL_STATUS", "WEBHOOKS_GLOBAL_STATUS", "AI_MODERATION_GLOBAL_STATUS"];
|
|
331
|
+
/** A token room event. */
|
|
332
|
+
export type TokenRoomEventName = (typeof TOKEN_ROOM_EVENTS)[number];
|
|
333
|
+
/** A comment room event. */
|
|
334
|
+
export type CommentRoomEventName = (typeof COMMENT_ROOM_EVENTS)[number];
|
|
335
|
+
/** A token event of the global feed. */
|
|
336
|
+
export type FeedTokenEventName = (typeof FEED_TOKEN_EVENTS)[number];
|
|
337
|
+
/** Any event of the global feed. */
|
|
338
|
+
export type FeedEventName = FeedTokenEventName | (typeof FEED_SITE_CONFIG_EVENTS)[number];
|
|
339
|
+
/**
|
|
340
|
+
* One occurrence of a global feed token event, named: `subscribeFeedTokenEvents` hands these to one
|
|
341
|
+
* callback, which tells them apart by `event` instead of by the shape of the payload.
|
|
342
|
+
*/
|
|
343
|
+
export type FeedTokenEvent = {
|
|
344
|
+
[K in FeedTokenEventName]: {
|
|
345
|
+
readonly event: K;
|
|
346
|
+
readonly data: RealtimeEventPayloads[K];
|
|
347
|
+
};
|
|
348
|
+
}[FeedTokenEventName];
|
|
349
|
+
/** Whether joining a token room delivers this event. */
|
|
350
|
+
export declare function isTokenRoomEvent(name: RealtimeEventName): name is TokenRoomEventName;
|
|
351
|
+
/** Whether joining a token's comment room delivers this event. */
|
|
352
|
+
export declare function isCommentRoomEvent(name: RealtimeEventName): name is CommentRoomEventName;
|
|
353
|
+
/**
|
|
354
|
+
* The `onX` keys of a callback object, each naming the event it receives.
|
|
355
|
+
*/
|
|
356
|
+
export declare const STREAM_CALLBACK_EVENTS: {
|
|
357
|
+
readonly onStreamStatus: "STREAM_STATUS";
|
|
358
|
+
readonly onStreamSubscribed: "token_subscribed";
|
|
359
|
+
readonly onStreamUnsubscribed: "token_unsubscribed";
|
|
360
|
+
readonly onViewerCount: "VIEWER_COUNT";
|
|
361
|
+
readonly onStreamGlobalStatus: "STREAM_GLOBAL_STATUS";
|
|
362
|
+
readonly onCountdownUpdated: "STREAM_COUNTDOWN_UPDATED";
|
|
363
|
+
readonly onLanguageUpdated: "STREAM_LANGUAGE_UPDATED";
|
|
364
|
+
readonly onRecordingStatus: "RECORDING_STATUS";
|
|
365
|
+
readonly onRecordingsCountUpdated: "RECORDINGS_COUNT_UPDATED";
|
|
366
|
+
readonly onSimulcastStatus: "SIMULCAST_STATUS";
|
|
367
|
+
readonly onDownloadReady: "DOWNLOAD_READY";
|
|
368
|
+
readonly onStreamControlStatusChanged: "STREAM_CONTROL_STATUS_CHANGED";
|
|
369
|
+
readonly onChatMessage: "STREAM_CHAT_MESSAGE";
|
|
370
|
+
readonly onChatSent: "STREAM_CHAT_SENT";
|
|
371
|
+
readonly onChatUpdated: "STREAM_CHAT_UPDATED";
|
|
372
|
+
readonly onChatDeleted: "STREAM_CHAT_DELETED";
|
|
373
|
+
readonly onChatError: "stream_chat_error";
|
|
374
|
+
readonly onChatStatus: "CHAT_STATUS_CHANGED";
|
|
375
|
+
readonly onChatSlowMode: "SLOW_MODE_CHANGED";
|
|
376
|
+
readonly onChatGlobalStatus: "STREAM_CHAT_GLOBAL_STATUS";
|
|
377
|
+
readonly onChatAuthenticated: "authenticated";
|
|
378
|
+
readonly onChatAuthError: "stream_chat_auth_error";
|
|
379
|
+
readonly onChatPinned: "STREAM_CHAT_PINNED";
|
|
380
|
+
readonly onChatUnpinned: "STREAM_CHAT_UNPINNED";
|
|
381
|
+
readonly onTypingIndicator: "USER_TYPING";
|
|
382
|
+
readonly onReaction: "STREAM_REACTION";
|
|
383
|
+
readonly onReactionError: "stream_reaction_error";
|
|
384
|
+
readonly onContentReactionAdded: "CONTENT_REACTION_ADDED";
|
|
385
|
+
readonly onContentReactionRemoved: "CONTENT_REACTION_REMOVED";
|
|
386
|
+
readonly onCommentCreated: "COMMENT_CREATED";
|
|
387
|
+
readonly onCommentUpdated: "COMMENT_UPDATED";
|
|
388
|
+
readonly onCommentDeleted: "COMMENT_DELETED";
|
|
389
|
+
readonly onUserBanned: "USER_BANNED";
|
|
390
|
+
readonly onUserUnbanned: "USER_UNBANNED";
|
|
391
|
+
readonly onBanEnforcement: "BAN_ENFORCEMENT";
|
|
392
|
+
readonly onTokenBanned: "TOKEN_BANNED";
|
|
393
|
+
readonly onTokenUnbanned: "TOKEN_UNBANNED";
|
|
394
|
+
readonly onContentFlagged: "CONTENT_FLAGGED";
|
|
395
|
+
readonly onFlagResolved: "FLAG_RESOLVED";
|
|
396
|
+
readonly onAIModerationComplete: "AI_MODERATION_COMPLETE";
|
|
397
|
+
readonly onAIModerationFailed: "AI_MODERATION_FAILED";
|
|
398
|
+
readonly onModeratorInviteCreated: "MODERATOR_INVITE_CREATED";
|
|
399
|
+
readonly onModeratorAdded: "MODERATOR_ADDED";
|
|
400
|
+
readonly onModeratorRemoved: "MODERATOR_REMOVED";
|
|
401
|
+
readonly onModeratorRoleUpdated: "MODERATOR_ROLE_UPDATED";
|
|
402
|
+
readonly onOverseerAdded: "OVERSEER_ADDED";
|
|
403
|
+
readonly onOverseerRemoved: "OVERSEER_REMOVED";
|
|
404
|
+
readonly onTradeExecuted: "TRADE_EXECUTED";
|
|
405
|
+
readonly onTradeUpdateNotify: "TRADE_UPDATE_NOTIFY";
|
|
406
|
+
readonly onBalanceUpdated: "BALANCE_UPDATED";
|
|
407
|
+
readonly onStatsUpdated: "STATS_UPDATED";
|
|
408
|
+
readonly onEngagementStatsUpdated: "ENGAGEMENT_STATS_UPDATED";
|
|
409
|
+
readonly onPoolCreated: "POOL_CREATED";
|
|
410
|
+
readonly onPoolMetadataUpdated: "POOL_METADATA_UPDATED";
|
|
411
|
+
readonly onPoolSocialLinksUpdated: "POOL_SOCIAL_LINKS_UPDATED";
|
|
412
|
+
readonly onPoolBadgeAssigned: "POOL_BADGE_ASSIGNED";
|
|
413
|
+
readonly onHolderCountUpdated: "HOLDER_COUNT_UPDATED";
|
|
414
|
+
readonly onTokenConfigUpdated: "TOKEN_CONFIG_UPDATED";
|
|
415
|
+
readonly onUserProfileUpdated: "USER_PROFILE_UPDATED";
|
|
416
|
+
readonly onApiKeyCreated: "API_KEY_CREATED";
|
|
417
|
+
readonly onApiKeyUpdated: "API_KEY_UPDATED";
|
|
418
|
+
readonly onApiKeyRevoked: "API_KEY_REVOKED";
|
|
419
|
+
readonly onException: "exception";
|
|
420
|
+
};
|
|
421
|
+
/**
|
|
422
|
+
* Callbacks for stream events, one optional `onX` per event. Passed to `subscribeToStream(token, callbacks)`
|
|
423
|
+
* they become subscribers of that token (and the room is joined for as long as one of them is registered);
|
|
424
|
+
* passed to `connectStreamWebSocket(callbacks)` they become subscribers of the event on every token.
|
|
425
|
+
* Each registered callback is its own subscriber: no callback replaces another.
|
|
426
|
+
*/
|
|
427
|
+
export type StreamEventCallbacks = {
|
|
428
|
+
[K in keyof typeof STREAM_CALLBACK_EVENTS]?: (event: RealtimeEventPayloads[(typeof STREAM_CALLBACK_EVENTS)[K]]) => void | Promise<void>;
|
|
429
|
+
};
|
|
430
|
+
/** The `onX` keys of a global feed callback object. */
|
|
431
|
+
export declare const FEED_CALLBACK_EVENTS: {
|
|
432
|
+
readonly onGlobalFeedSubscribed: "global_feed_subscribed";
|
|
433
|
+
readonly onGlobalFeedUnsubscribed: "global_feed_unsubscribed";
|
|
434
|
+
readonly onStreamStatus: "STREAM_STATUS";
|
|
435
|
+
readonly onTradeExecuted: "TRADE_EXECUTED";
|
|
436
|
+
readonly onHolderCountUpdated: "HOLDER_COUNT_UPDATED";
|
|
437
|
+
readonly onPoolBadgeAssigned: "POOL_BADGE_ASSIGNED";
|
|
438
|
+
readonly onViewerCount: "VIEWER_COUNT";
|
|
439
|
+
readonly onTokenConfigUpdated: "TOKEN_CONFIG_UPDATED";
|
|
440
|
+
readonly onStatsUpdated: "STATS_UPDATED";
|
|
441
|
+
readonly onPoolCreated: "POOL_CREATED";
|
|
442
|
+
readonly onSiteConfigChanged: "SITE_CONFIG_CHANGED";
|
|
443
|
+
readonly onStreamGlobalStatus: "STREAM_GLOBAL_STATUS";
|
|
444
|
+
readonly onStreamChatGlobalStatus: "STREAM_CHAT_GLOBAL_STATUS";
|
|
445
|
+
readonly onCommentsGlobalStatus: "COMMENTS_GLOBAL_STATUS";
|
|
446
|
+
readonly onWebhooksGlobalStatus: "WEBHOOKS_GLOBAL_STATUS";
|
|
447
|
+
readonly onAIModerationGlobalStatus: "AI_MODERATION_GLOBAL_STATUS";
|
|
448
|
+
};
|
|
449
|
+
/**
|
|
450
|
+
* Callbacks for the global feed, one optional `onX` per feed event. Each registered callback is its own
|
|
451
|
+
* subscriber; the feed room is joined while any is registered.
|
|
452
|
+
*/
|
|
453
|
+
export type GlobalFeedEventCallbacks = {
|
|
454
|
+
[K in keyof typeof FEED_CALLBACK_EVENTS]?: (event: RealtimeEventPayloads[(typeof FEED_CALLBACK_EVENTS)[K]]) => void | Promise<void>;
|
|
455
|
+
};
|
|
456
|
+
//# sourceMappingURL=event-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-catalog.d.ts","sourceRoot":"","sources":["../../../src/services/realtime/event-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAMhG;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkHhB,CAAC;AAMX;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IA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;CAiBqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;KACpC,CAAC,IAAI,MAAM,OAAO,oBAAoB,CAAC,CAAC,EAAE,CACzC,KAAK,EAAE,qBAAqB,CAAC,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,KAC3D,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAC1B,CAAC"}
|
|
@@ -95,11 +95,28 @@ export declare function buildPaginationMeta(total: number, page?: number, limit?
|
|
|
95
95
|
* ```
|
|
96
96
|
*/
|
|
97
97
|
export declare function buildFlattenedPaginationMeta<T>(items: T[], total?: number): PaginationMeta;
|
|
98
|
+
/**
|
|
99
|
+
* How each launchpad-backend path parameter is spelled in a URL (launchpad-backend-service-v3
|
|
100
|
+
* origin/main). Lowercased only where the backend normalizes the value itself, so the SDK's
|
|
101
|
+
* spelling can never select something the backend's would not; every other value is sent exactly
|
|
102
|
+
* as given:
|
|
103
|
+
* - `tokenName`: lowercase (the pool lookup's `normalizeTokenName`; token names are lowercase);
|
|
104
|
+
* - `address`, `userAddress`: lowercase (`normalizeAddress` / `GalaChainAddressField` on every
|
|
105
|
+
* route that takes one: bans, overseers, user summary, cache flushes);
|
|
106
|
+
* - `assetId`, `targetId`: as given (Mux asset and simulcast target ids, mixed-case and compared
|
|
107
|
+
* exactly);
|
|
108
|
+
* - `id`: as given (numeric invite ids);
|
|
109
|
+
* - `code`: as given (invite codes are matched exactly; the backend generates lowercase hex).
|
|
110
|
+
*
|
|
111
|
+
* @since 9.0.0
|
|
112
|
+
*/
|
|
113
|
+
export declare const PATH_PARAM_CASING: Readonly<Record<string, 'lowercase' | 'as given'>>;
|
|
98
114
|
/**
|
|
99
115
|
* Build endpoint URL with path parameters
|
|
100
116
|
*
|
|
101
|
-
* Replaces :param placeholders in URL templates with provided values
|
|
102
|
-
*
|
|
117
|
+
* Replaces :param placeholders in URL templates with provided values, URI-encoded, each spelled
|
|
118
|
+
* as {@link PATH_PARAM_CASING} says. A parameter that table does not name is refused (a
|
|
119
|
+
* programming error: decide its casing there first).
|
|
103
120
|
*
|
|
104
121
|
* @param template - URL template with :param placeholders
|
|
105
122
|
* @param params - Parameters to substitute
|
|
@@ -110,11 +127,11 @@ export declare function buildFlattenedPaginationMeta<T>(items: T[], total?: numb
|
|
|
110
127
|
* const url = buildEndpoint('/api/:tokenName/status', { tokenName: 'MyToken' });
|
|
111
128
|
* // Returns: '/api/mytoken/status'
|
|
112
129
|
*
|
|
113
|
-
* const url = buildEndpoint('/
|
|
130
|
+
* const url = buildEndpoint('/v1/tokens/:tokenName/recordings/:assetId', {
|
|
114
131
|
* tokenName: 'MyToken',
|
|
115
|
-
* assetId: '
|
|
132
|
+
* assetId: 'Ab3xYz00',
|
|
116
133
|
* });
|
|
117
|
-
* // Returns: '/
|
|
134
|
+
* // Returns: '/v1/tokens/mytoken/recordings/Ab3xYz00'
|
|
118
135
|
* ```
|
|
119
136
|
*/
|
|
120
137
|
export declare function buildEndpoint(template: string, params: Record<string, string>): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination-helpers.d.ts","sourceRoot":"","sources":["../../../src/services/shared/pagination-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,iBAAiB,EAC1B,WAAW,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAaxB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,MAAU,EAAE,KAAK,GAAE,MAAW,GAAG,cAAc,CAOvG;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,GAAE,MAAqB,GAAG,cAAc,CAOxG;AAED
|
|
1
|
+
{"version":3,"file":"pagination-helpers.d.ts","sourceRoot":"","sources":["../../../src/services/shared/pagination-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,iBAAiB,EAC1B,WAAW,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAaxB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,MAAU,EAAE,KAAK,GAAE,MAAW,GAAG,cAAc,CAOvG;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,GAAE,MAAqB,GAAG,cAAc,CAOxG;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,CAAC,CAQhF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAUtF;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,OAAO,EAAE,CAAC,EACV,MAAM,EAAE,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE,GAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-validators.d.ts","sourceRoot":"","sources":["../../../src/services/shared/service-validators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAc9D,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,IAAI,wBAAwB,EAChD,sBAAsB,IAAI,0BAA0B,EACpD,sBAAsB,EACtB,sBAAsB,IAAI,0BAA0B,EACpD,uBAAuB,IAAI,2BAA2B,EACtD,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,IAAI,0BAA0B,EACpD,oBAAoB,IAAI,wBAAwB,EAChD,oBAAoB,EACpB,gCAAgC,IAAI,oCAAoC,GACzE,MAAM,gCAAgC,CAAC;AAExC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAOnG;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gCAAgC,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"service-validators.d.ts","sourceRoot":"","sources":["../../../src/services/shared/service-validators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAc9D,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,IAAI,wBAAwB,EAChD,sBAAsB,IAAI,0BAA0B,EACpD,sBAAsB,EACtB,sBAAsB,IAAI,0BAA0B,EACpD,uBAAuB,IAAI,2BAA2B,EACtD,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,IAAI,0BAA0B,EACpD,oBAAoB,IAAI,wBAAwB,EAChD,oBAAoB,EACpB,gCAAgC,IAAI,oCAAoC,GACzE,MAAM,gCAAgC,CAAC;AAExC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAOnG;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gCAAgC,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,GAAG,IAAI,CAS1G;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAI9G;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAChC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,IAAI,CASN;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAChC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,IAAI,CAWN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAChC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAClB,IAAI,CAUN;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnE,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,eAAe,EAAE,CAAC,EAClB,SAAS,GAAE,MAAiB,GAC3B,IAAI,CAIN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Eip1193Provider } from 'ethers';
|
|
1
2
|
import { BrowserWalletSigner as CoreBrowserWalletSigner, GalaWalletSigner as CoreGalaWalletSigner, PrivateKeySigner as CorePrivateKeySigner, type EIP712Types } from '@gala-chain/gala-core-sdk';
|
|
2
3
|
import type { EIP712Domain, LaunchpadSigner, SignedTypedDataBody } from './types';
|
|
3
4
|
interface GalaWalletProvider {
|
|
@@ -50,8 +51,40 @@ export declare class PrivateKeySigner extends CorePrivateKeySigner implements La
|
|
|
50
51
|
* console.log(body.signature);
|
|
51
52
|
*/
|
|
52
53
|
export declare class GalaWalletSigner extends CoreGalaWalletSigner implements LaunchpadSigner {
|
|
54
|
+
/** The `wallet` option: the Gala Wallet object typed data is signed through (`window.gala` when absent). */
|
|
55
|
+
private readonly typedDataWallet;
|
|
56
|
+
/**
|
|
57
|
+
* The Ethereum account of the KEY the wallet must have active when `verifyActiveAccount` is on
|
|
58
|
+
* (`undefined` when the check is off).
|
|
59
|
+
*/
|
|
60
|
+
private readonly verifiedKey;
|
|
61
|
+
/**
|
|
62
|
+
* Same arguments as gala-core-sdk's `GalaWalletSigner` (`scheme`, `selectAddress`, `wallet`), and:
|
|
63
|
+
*
|
|
64
|
+
* - `verifyActiveAccount` (default `false`): before every typed-data signature, refuse unless the
|
|
65
|
+
* wallet's active account is this signer's key. See {@link GalaWalletSigner.signTypedData}.
|
|
66
|
+
* The key is `walletAddress` when that is an Ethereum account (`0x...` / `eth|...`), else
|
|
67
|
+
* `selectAddress` when that is one; a signer that names no key cannot be verified and is refused
|
|
68
|
+
* at construction (`INVALID_SIGNER_OPTIONS`).
|
|
69
|
+
*
|
|
70
|
+
* @since 9.0.0
|
|
71
|
+
*/
|
|
72
|
+
constructor(walletAddress: string, options?: ConstructorParameters<typeof CoreGalaWalletSigner>[1] & {
|
|
73
|
+
verifyActiveAccount?: boolean | undefined;
|
|
74
|
+
});
|
|
53
75
|
/**
|
|
54
|
-
*
|
|
76
|
+
* With `verifyActiveAccount`, the first step is the active-account check (below); the RPC order is
|
|
77
|
+
* then the check (`window.gala.address`, else `eth_accounts` when the wallet has not reported an
|
|
78
|
+
* account yet), `setAddress`, `eth_signTypedData`. A mismatch, or a wallet reporting no account,
|
|
79
|
+
* is `WALLET_ACCOUNT_CHANGED` and nothing is signed. The check runs before this signer's own
|
|
80
|
+
* `setAddress`, so it sees the account the person has active, not one this signer just selected;
|
|
81
|
+
* another signer's select on the same wallet object in flight at that moment is not observable.
|
|
82
|
+
*
|
|
83
|
+
* Sign a launchpad DTO through Gala Wallet. Gala Wallet holds one current account, so the
|
|
84
|
+
* account is selected first (`setAddress`, where the wallet offers it, with `selectAddress` or
|
|
85
|
+
* else the Ethereum account the request names) and the select-then-sign pair is serialized per
|
|
86
|
+
* wallet object with every other signer and provider that signs through it (gala-core-sdk's
|
|
87
|
+
* `withGalaWalletIdentity`). The wallet is the `wallet` option, else `window.gala`.
|
|
55
88
|
*
|
|
56
89
|
* @example
|
|
57
90
|
* const body = await signer.signTypedData('BuyWithNative', { amount: '1' });
|
|
@@ -90,6 +123,29 @@ export declare class BrowserWalletSigner extends CoreBrowserWalletSigner impleme
|
|
|
90
123
|
* console.log(body.domain.chainId);
|
|
91
124
|
*/
|
|
92
125
|
signTypedData(method: string, rawDto: Record<string, unknown>): Promise<SignedTypedDataBody>;
|
|
126
|
+
/**
|
|
127
|
+
* A signer for a browser app that holds the wallet's raw EIP-1193 provider (`window.ethereum`,
|
|
128
|
+
* an EIP-6963 announcement's `provider`) rather than an ethers provider. It builds the ethers
|
|
129
|
+
* `BrowserProvider` the typed-data path reads the network and the account from, and keeps the raw
|
|
130
|
+
* `request` for the DEX signatures (`signObject`). The bytes signed are exactly those of
|
|
131
|
+
* `new BrowserWalletSigner({ request, getNetwork, getSigner }, key)` over that `BrowserProvider`:
|
|
132
|
+
* domain `{ name: network.name, chainId: Number(network.chainId) }`, signed by the account the
|
|
133
|
+
* wallet has selected (`getSigner()`), refused with `WALLET_ACCOUNT_CHANGED` when that is not
|
|
134
|
+
* `keyAddress`.
|
|
135
|
+
*
|
|
136
|
+
* @param provider - The wallet's EIP-1193 provider.
|
|
137
|
+
* @param keyAddress - The account of the KEY that signs: `0x` plus 40 hex digits, or `eth|` plus
|
|
138
|
+
* 40 hex digits (with or without `0x`). Not a `client|` alias: an alias names no key (it is the
|
|
139
|
+
* `walletAddress` the SDK declares beside this signer).
|
|
140
|
+
* @param options - As the constructor's (`{ scheme: 'eip712' }` for the DEX methods).
|
|
141
|
+
* @throws GalaSDKError `INVALID_WALLET_ADDRESS` when `keyAddress` names no Ethereum account.
|
|
142
|
+
* @since 9.0.0
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* const signer = BrowserWalletSigner.fromEip1193(window.ethereum, '0x70997970C51812dc3A010C7d01b50e0d17dc79C8');
|
|
146
|
+
* const sdk = new LaunchpadSDK({ signer, walletAddress: 'client|618ae395c1c653111d3315be' });
|
|
147
|
+
*/
|
|
148
|
+
static fromEip1193(provider: Eip1193Provider, keyAddress: string, options?: ConstructorParameters<typeof CoreBrowserWalletSigner>[2]): BrowserWalletSigner;
|
|
93
149
|
}
|
|
94
150
|
export type { BrowserWalletProvider };
|
|
95
151
|
//# sourceMappingURL=signers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signers.d.ts","sourceRoot":"","sources":["../../src/signing/signers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"signers.d.ts","sourceRoot":"","sources":["../../src/signing/signers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC9F,OAAO,EACL,mBAAmB,IAAI,uBAAuB,EAC9C,gBAAgB,IAAI,oBAAoB,EACxC,gBAAgB,IAAI,oBAAoB,EAIxC,KAAK,WAAW,EAEjB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,UAAU,kBAAkB;IAC1B,OAAO,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACzE;AAMD,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED,UAAU,yBAAyB;IACjC,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;I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AAQ,uBACR,YAAW,eAAe;IAE1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwB;IAE1D;;;;OAIG;gBAED,QAAQ,EAAE,qBAAqB,EAC/B,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,qBAAqB,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAMpE;;;;;;OAMG;IACU,aAAa,CACxB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,mBAAmB,CAAC;IAwB/B;;;;;;;;;;;;;;;;;;;;;OAqBG;WACW,WAAW,CACvB,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,qBAAqB,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC,GACjE,mBAAmB;CAYvB;AAED,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -217,7 +217,7 @@ export interface UpdateApiKeyOptions {
|
|
|
217
217
|
export interface ListApiKeysOptions {
|
|
218
218
|
/**
|
|
219
219
|
* Cursor token for fetching the next page (omit for first page).
|
|
220
|
-
* Use the `
|
|
220
|
+
* Use the `endCursor` from the previous response's `pageInfo`.
|
|
221
221
|
*/
|
|
222
222
|
cursor?: string;
|
|
223
223
|
/**
|