@smartico/public-api 0.0.379 → 0.0.380

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.
Files changed (99) hide show
  1. package/.nvmrc +1 -1
  2. package/README.md +31 -2
  3. package/dist/Store/BuyStoreItemErrorCode.d.ts +9 -1
  4. package/dist/Tournaments/TournamentRegistrationError.d.ts +3 -1
  5. package/dist/WSAPI/WSAPI.d.ts +13 -1235
  6. package/dist/WSAPI/WSAPIAvatars.d.ts +78 -0
  7. package/dist/WSAPI/WSAPIBase.d.ts +71 -0
  8. package/dist/WSAPI/WSAPIBonuses.d.ts +26 -0
  9. package/dist/WSAPI/WSAPIClans.d.ts +388 -0
  10. package/dist/WSAPI/WSAPIGamePick.d.ts +308 -0
  11. package/dist/WSAPI/WSAPIGeneral.d.ts +30 -0
  12. package/dist/WSAPI/WSAPIInbox.d.ts +126 -0
  13. package/dist/WSAPI/WSAPIJackpots.d.ts +109 -0
  14. package/dist/WSAPI/WSAPILeaderBoard.d.ts +25 -0
  15. package/dist/WSAPI/WSAPIMiniGames.d.ts +94 -0
  16. package/dist/WSAPI/WSAPIMissions.d.ts +517 -0
  17. package/dist/WSAPI/WSAPIRaffles.d.ts +119 -0
  18. package/dist/WSAPI/WSAPIStore.d.ts +656 -0
  19. package/dist/WSAPI/WSAPITournaments.d.ts +501 -0
  20. package/dist/WSAPI/WSAPITypes.d.ts +145 -85
  21. package/dist/WSAPI/WSAPIUser.d.ts +383 -0
  22. package/dist/index.js +3818 -1528
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.modern.mjs +3180 -981
  25. package/dist/index.modern.mjs.map +1 -1
  26. package/docs/api/README.md +56 -2
  27. package/docs/api/classes/WSAPIAvatars.md +116 -0
  28. package/docs/api/classes/WSAPIBonuses.md +50 -0
  29. package/docs/api/classes/WSAPIClans.md +66 -0
  30. package/docs/api/classes/WSAPIGamePick.md +181 -0
  31. package/docs/api/classes/WSAPIGeneral.md +63 -0
  32. package/docs/api/classes/WSAPIInbox.md +277 -0
  33. package/docs/api/classes/WSAPIJackpots.md +185 -0
  34. package/docs/api/classes/WSAPILeaderBoard.md +39 -0
  35. package/docs/api/classes/WSAPIMiniGames.md +175 -0
  36. package/docs/api/classes/WSAPIMissions.md +611 -0
  37. package/docs/api/classes/WSAPIRaffles.md +195 -0
  38. package/docs/api/classes/WSAPIStore.md +744 -0
  39. package/docs/api/classes/WSAPITournaments.md +104 -0
  40. package/docs/api/classes/WSAPIUser.md +200 -0
  41. package/docs/api/enumerations/AchievementClaimPeriodTypeId.md +13 -0
  42. package/docs/api/enumerations/BuyStoreItemErrorCode.md +32 -0
  43. package/docs/api/interfaces/ClanPrizePublicMeta.md +41 -0
  44. package/docs/api/interfaces/ClanPrizeStructureEntry.md +7 -1
  45. package/docs/api/interfaces/ClanPublicMeta.md +4 -0
  46. package/docs/api/interfaces/SAWTemplateUI.md +10 -0
  47. package/docs/api/interfaces/TAchCategory.md +19 -4
  48. package/docs/api/interfaces/TBuyStoreItemResult.md +26 -8
  49. package/docs/api/interfaces/TMissionClaimRewardResult.md +14 -3
  50. package/docs/api/interfaces/TMissionOptInResult.md +10 -3
  51. package/docs/api/interfaces/TMissionOrBadge.md +6 -2
  52. package/docs/api/interfaces/TStoreItem.md +21 -1
  53. package/docs/api/interfaces/TTournamentDetailed.md +8 -0
  54. package/docs/api/interfaces/UserAchievement.md +1 -1
  55. package/docs/ui/clans/UIGuide_getClanInfo.md +153 -0
  56. package/docs/ui/clans/UIGuide_getClans.md +172 -0
  57. package/docs/ui/clans/UIGuide_joinClan.md +196 -0
  58. package/docs/ui/missions/UIGuide_getAchCategories.md +17 -0
  59. package/docs/ui/missions/UIGuide_getBadges.md +237 -0
  60. package/docs/ui/missions/UIGuide_getMissions.md +268 -0
  61. package/docs/ui/missions/UIGuide_requestMissionClaimReward.md +21 -0
  62. package/docs/ui/missions/UIGuide_requestMissionOptIn.md +16 -0
  63. package/docs/ui/store/UIGuide_buyStoreItem.md +133 -0
  64. package/docs/ui/store/UIGuide_getStoreCategories.md +19 -0
  65. package/docs/ui/store/UIGuide_getStoreItems.md +264 -0
  66. package/docs/ui/store/UIGuide_getStorePurchasedItems.md +122 -0
  67. package/docs/ui/tournaments/UIGuide_getClanTournamentPlayers.md +140 -0
  68. package/docs/ui/tournaments/UIGuide_getTournamentInstanceInfo.md +265 -0
  69. package/docs/ui/tournaments/UIGuide_getTournamentsList.md +236 -0
  70. package/docs/ui/tournaments/UIGuide_registerInTournament.md +156 -0
  71. package/docs/ui/user/UIGuide_getLevels.md +162 -0
  72. package/docs/ui/user/UIGuide_getUserProfile.md +213 -0
  73. package/package.json +3 -3
  74. package/scripts/postdoc-cleanup.js +195 -0
  75. package/src/Missions/MissionsUtils.ts +5 -2
  76. package/src/Store/BuyStoreItemErrorCode.ts +8 -0
  77. package/src/Store/StoreItem.ts +1 -0
  78. package/src/Store/StoreItemPurchased.ts +1 -0
  79. package/src/Store/StoreItemType.ts +1 -1
  80. package/src/Tournaments/TournamentRegistrationError.ts +4 -0
  81. package/src/WSAPI/WSAPI.ts +27 -2007
  82. package/src/WSAPI/WSAPIAvatars.ts +127 -0
  83. package/src/WSAPI/WSAPIBase.ts +93 -0
  84. package/src/WSAPI/WSAPIBonuses.ts +54 -0
  85. package/src/WSAPI/WSAPIClans.ts +417 -0
  86. package/src/WSAPI/WSAPIGamePick.ts +382 -0
  87. package/src/WSAPI/WSAPIGeneral.ts +57 -0
  88. package/src/WSAPI/WSAPIInbox.ts +222 -0
  89. package/src/WSAPI/WSAPIJackpots.ts +212 -0
  90. package/src/WSAPI/WSAPILeaderBoard.ts +40 -0
  91. package/src/WSAPI/WSAPIMiniGames.ts +181 -0
  92. package/src/WSAPI/WSAPIMissions.ts +572 -0
  93. package/src/WSAPI/WSAPIRaffles.ts +175 -0
  94. package/src/WSAPI/WSAPIStore.ts +732 -0
  95. package/src/WSAPI/WSAPITournaments.ts +541 -0
  96. package/src/WSAPI/WSAPITypes.ts +145 -87
  97. package/src/WSAPI/WSAPIUser.ts +456 -0
  98. package/tsconfig.json +17 -1
  99. package/docs/api/classes/WSAPI.md +0 -1927
@@ -1,1239 +1,17 @@
1
- import { ActivityTypeLimited } from '../Core';
2
1
  import { SmarticoAPI } from '../SmarticoAPI';
3
- import { InboxMarkMessageAction, LeaderBoardDetailsT, TAchCategory, TBuyStoreItemResult, TGetTranslations, TInboxMessage, TInboxMessageBody, TLevel, TMiniGamePlayResult, TMiniGameTemplate, TMissionClaimRewardResult, TMissionOptInResult, TMissionOrBadge, TSegmentCheckResult, TStoreCategory, TStoreItem, TTournament, TTournamentDetailed, TTournamentRegistrationResult, TUICustomSection, TUserProfile, UserLevelExtraCountersT, TBonus, TClaimBonusResult, TMiniGamePlayBatchResult, TSawHistory, TRaffle, TRaffleDraw, TRaffleDrawRun, TransformedRaffleClaimPrizeResponse, TLevelCurrent, TActivityLog, TRaffleOptinResponse, TClans, TClanInfo, TClanJoinResult, TClanTournamentPlayers, GamesApiResponse, GamePickRound, GamePickRoundBoard, GamePickUserInfo, GamePickGameInfo, GamePickRequestParams, GamePickRoundRequestParams, TAvatarDefinition, TAvatarCustomized, TAvatarPrompt, TSetAvatarResult } from './WSAPITypes';
4
- import { LeaderBoardPeriodType } from '../Leaderboard';
5
- import { JackpotDetails, JackpotWinnerHistory, JackpotsOptinResponse, JackpotsOptoutResponse } from '../Jackpots';
6
- import { GetRelatedAchTourResponse } from '../Missions/GetRelatedAchTourResponse';
7
- import { InboxCategories } from '../Inbox/InboxCategories';
8
- import { TGetJackpotEligibleGamesResponse } from '../Jackpots/GetJackpotEligibleGamesResponse';
9
- import { InboxReadStatus } from '../Inbox/InboxReadStatus';
10
- /** @group General API */
11
- export declare class WSAPI {
12
- private api;
13
- private onUpdateCallback;
14
- private jackpotGetSignature;
15
- private userExtId;
2
+ import { WSAPIInbox } from './WSAPIInbox';
3
+ /**
4
+ * Public surface of the Smartico WebSocket API. The consumer reaches every
5
+ * method on this class via `_smartico.api.X(...)`. The class is the
6
+ * terminator of an inheritance chain that splits the surface into focused
7
+ * domain classes (see `WSAPIBase` → `WSAPIUser` → ... → `WSAPIInbox` →
8
+ * `WSAPI`); each domain class hosts its own subset of methods. Consumers
9
+ * don't need to know about the chain — every method is reachable directly
10
+ * on the `WSAPI` instance via prototype-chain lookup.
11
+ *
12
+ * @group General API
13
+ */
14
+ export declare class WSAPI extends WSAPIInbox {
16
15
  /** @private */
17
16
  constructor(api: SmarticoAPI, userExtId?: string);
18
- /** @private */
19
- clearCaches(): void;
20
- /** Returns information about current user
21
- * Pay attention that this method is synchronous and returns the user profile object immediately, not a promise.
22
- * **Example**:
23
- * ```
24
- * var p = _smartico.api.getUserProfile();
25
- * console.log(p);
26
- * ```
27
- * **Visitor mode: not supported**
28
- * */
29
- getUserProfile(): TUserProfile;
30
- /** Check if user belongs to specific segments
31
- * **Example**:
32
- * ```
33
- * _smartico.api.checkSegmentMatch(1).then((result) => {
34
- * console.log(result);
35
- * });
36
- * ```
37
- *
38
- * **Visitor mode: not supported**
39
- */
40
- checkSegmentMatch(segment_id: number): Promise<boolean>;
41
- /** Check if user belongs to specific list of segments
42
- * **Example**:
43
- * ```
44
- * _smartico.api.checkSegmentListMatch([1, 2, 3]).then((result) => {
45
- * console.log(result);
46
- * });
47
- * ```
48
- * **Visitor mode: not supported**
49
- */
50
- checkSegmentListMatch(segment_ids: number[]): Promise<TSegmentCheckResult[]>;
51
- /** Returns all the levels available to the current user
52
- * **Example**:
53
- * ```
54
- * _smartico.api.getLevels().then((result) => {
55
- * console.log(result);
56
- * });
57
- * ```
58
- *
59
- * **Example in the Visitor mode**:
60
- * ```
61
- * _smartico.vapi('EN').getLevels().then((result) => {
62
- * console.log(result);
63
- * });
64
- * ```
65
- */
66
- getLevels(): Promise<TLevel[]>;
67
- /**
68
- * Returns the current level of the user with extended information including ordinal position and progress.
69
- *
70
- * **Example**:
71
- * ```
72
- * _smartico.api.getCurrentLevel().then((result) => {
73
- * console.log(result);
74
- * });
75
- * ```
76
- *
77
- * **Visitor mode: not supported**
78
- */
79
- getCurrentLevel(): Promise<TLevelCurrent>;
80
- /** Returns all the missions configured for the current user (server-side scoped, not filtered by Widget visibility).
81
- * The returned missions are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
82
- * Note that each time you call getMissions with a new onUpdate callback, the old one will be overwritten by the new one.
83
- * The onUpdate callback will be called on mission OptIn and the updated missions will be passed to it.
84
- *
85
- * **Example**:
86
- * ```
87
- * _smartico.api.getMissions().then((result) => {
88
- * console.log(result);
89
- * });
90
- * ```
91
- *
92
- * **Example in the Visitor mode**:
93
- * ```
94
- * _smartico.vapi('EN').getMissions().then((result) => {
95
- * console.log(result);
96
- * });
97
- * ```
98
- */
99
- getMissions({ onUpdate }?: {
100
- onUpdate?: (data: TMissionOrBadge[]) => void;
101
- }): Promise<TMissionOrBadge[]>;
102
- /**
103
- * Returns all the badges available to the current user
104
- *
105
- * **Visitor mode: not supported**
106
- */
107
- getBadges(): Promise<TMissionOrBadge[]>;
108
- /**
109
- * Returns all the bonuses for the current user
110
- * The returned bonuses are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
111
- * Note that each time you call getBonuses with a new onUpdate callback, the old one will be overwritten by the new one.
112
- * The onUpdate callback will be called on bonus claimed and the updated bonuses will be passed to it.
113
- *
114
- * **Visitor mode: not supported**
115
- */
116
- getBonuses({ onUpdate }?: {
117
- onUpdate?: (data: TBonus[]) => void;
118
- }): Promise<TBonus[]>;
119
- /**
120
- * Claim the bonus by bonus_id. Returns the err_code in case of success or error.
121
- * Note that this method can be used only on integrations where originally failed bonus can be claimed again.
122
- * For example, user won a bonus in the mini-game, but Operator rejected this bonus.
123
- * This bonus will be available for the user to claim again.
124
- *
125
- * **Visitor mode: not supported**
126
- */
127
- claimBonus(bonus_id: number): Promise<TClaimBonusResult>;
128
- /**
129
- * Returns the extra counters for the current user level.
130
- * These are counters that are configured for each Smartico client separately by request.
131
- * For example 1st counter could be total wagering amount, 2nd counter could be total deposit amount, etc.
132
- *
133
- * **Example**:
134
- * ```
135
- * _smartico.api.getUserLevelExtraCounters().then((result) => {
136
- * console.log(result);
137
- * });
138
- * ```
139
- *
140
- * **Visitor mode: not supported**
141
- */
142
- getUserLevelExtraCounters(): Promise<UserLevelExtraCountersT>;
143
- /**
144
- *
145
- * Returns all the store items available to the current user
146
- * The returned store items are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
147
- * Note that each time you call getStoreItems with a new onUpdate callback, the old one will be overwritten by the new one.
148
- * The onUpdate callback will be called on purchase of the store item.
149
- *
150
- * **Example**:
151
- * ```
152
- * _smartico.api.getStoreItems().then((result) => {
153
- * console.log(result);
154
- * });
155
- * ```
156
- *
157
- * **Example in the Visitor mode**:
158
- * ```
159
- * _smartico.vapi('EN').getStoreItems().then((result) => {
160
- * console.log(result);
161
- * });
162
- * ```
163
- * @param params
164
- * @param params.onUpdate - callback function that will be called when the store items are updated
165
- */
166
- getStoreItems({ onUpdate }?: {
167
- onUpdate?: (data: TStoreItem[]) => void;
168
- }): Promise<TStoreItem[]>;
169
- /** Buy the specific shop item by item_id. Returns the err_code in case of success or error.
170
- * **Example**:
171
- * ```
172
- * _smartico.api.buyStoreItem(1).then((result) => {
173
- * console.log(result);
174
- * });
175
- * ```
176
- *
177
- * **Visitor mode: not supported**
178
- */
179
- buyStoreItem(item_id: number): Promise<TBuyStoreItemResult>;
180
- /**
181
- *
182
- * Returns store categories
183
- *
184
- * **Example**:
185
- * ```
186
- * _smartico.api.getStoreCategories().then((result) => {
187
- * console.log(result);
188
- * });
189
- * ```
190
- *
191
- * **Example in the Visitor mode**:
192
- * ```
193
- * _smartico.vapi('EN').getStoreCategories().then((result) => {
194
- * console.log(result);
195
- * });
196
- * ```
197
- */
198
- getStoreCategories(): Promise<TStoreCategory[]>;
199
- /**
200
- * Returns purchased items based on the provided parameters. "Limit" and "offset" indicate the range of items to be fetched.
201
- * The maximum number of items per request is limited to 20.
202
- * You can leave this params empty and by default it will return list of purchased items ranging from 0 to 20.
203
- * The returned store items are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
204
- * Note that each time you call getStorePurchasedItems with a new onUpdate callback, the old one will be overwritten by the new one.
205
- * The onUpdate callback will be called on purchase of the store item and the last 20 items will be passed to it.
206
- *
207
- * **Example**:
208
- * ```
209
- * _smartico.api.getStorePurchasedItems().then((result) => {
210
- * console.log(result);
211
- * });
212
- * ```
213
- *
214
- * **Visitor mode: not supported**
215
- */
216
- getStorePurchasedItems({ limit, offset, onUpdate, }?: {
217
- limit?: number;
218
- offset?: number;
219
- onUpdate?: (data: TStoreItem[]) => void;
220
- }): Promise<TStoreItem[]>;
221
- /**
222
- * Returns missions & badges categories
223
- *
224
- * **Example**:
225
- * ```
226
- * _smartico.api.getAchCategories().then((result) => {
227
- * console.log(result);
228
- * });
229
- * ```
230
- *
231
- * **Example in the Visitor mode**:
232
- * ```
233
- * _smartico.vapi('EN').getAchCategories().then((result) => {
234
- * console.log(result);
235
- * });
236
- * ```
237
- *
238
- * */
239
- getAchCategories(): Promise<TAchCategory[]>;
240
- /**
241
- * Returns list of custom sections
242
- *
243
- * **Example**:
244
- * ```
245
- * _smartico.api.getCustomSections().then((result) => {
246
- * console.log(result);
247
- * });
248
- * ```
249
- *
250
- * **Example in the Visitor mode**:
251
- * ```
252
- * _smartico.vapi('EN').getCustomSections().then((result) => {
253
- * console.log(result);
254
- * });
255
- * ```
256
- *
257
- * */
258
- getCustomSections(): Promise<TUICustomSection[]>;
259
- /**
260
- * Returns the list of mini-games configured for the current user (not filtered by spin availability or Widget visibility).
261
- * The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getMiniGames with a new onUpdate callback, the old one will be overwritten by the new one.
262
- * The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or won prize is spin/jackpot and if max count of the available user spins equals one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
263
- *
264
- * **Example**:
265
- * ```
266
- * _smartico.api.getMiniGames().then((result) => {
267
- * console.log(result);
268
- * });
269
- * ```
270
- *
271
- * **Example in the Visitor mode**:
272
- * ```
273
- * _smartico.vapi('EN').getMiniGames().then((result) => {
274
- * console.log(result);
275
- * });
276
- * ```
277
- *
278
- */
279
- getMiniGames({ onUpdate }?: {
280
- onUpdate?: (data: TMiniGameTemplate[]) => void;
281
- }): Promise<TMiniGameTemplate[]>;
282
- /**
283
- * Returns the list of mini-games based on the provided parameters. "Limit" and "offset" indicate the range of items to be fetched.
284
- * The maximum number of items per request is limited to 20.
285
- * You can leave this params empty and by default it will return list of mini-games ranging from 0 to 20.
286
- * The returned list of mini-games history is cached for 30 seconds.
287
- *
288
- * **Example**:
289
- * ```
290
- * _smartico.api.getMiniGamesHistory().then((result) => {
291
- * console.log(result);
292
- * });
293
- * ```
294
- *
295
- * **Visitor mode: not supported**
296
- */
297
- getMiniGamesHistory({ limit, offset, saw_template_id, }: {
298
- limit?: number;
299
- offset?: number;
300
- saw_template_id?: number;
301
- }): Promise<TSawHistory[]>;
302
- /**
303
- * Plays the specified by template_id mini-game on behalf of user and returns prize_id or err_code
304
- * After playMiniGame is called, you can call getMiniGames to get the list of mini-games.The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call playMiniGame with a new onUpdate callback, the old one will be overwritten by the new one.
305
- * The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or won prize is spin/jackpot and if max count of the available user spins equals one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
306
- *
307
- * **Example**:
308
- * ```
309
- * _smartico.api.playMiniGame(55).then((result) => {
310
- * console.log(result);
311
- * });
312
- * ```
313
- *
314
- * **Visitor mode: not supported**
315
- */
316
- playMiniGame(template_id: number, { onUpdate }?: {
317
- onUpdate?: (data: TMiniGameTemplate[]) => void;
318
- }): Promise<TMiniGamePlayResult>;
319
- /**
320
- * Sends the acknowledge request with specific client_request_id from minigame history in order to claim prize
321
- * **Example**:
322
- * ```
323
- * _smartico.api.miniGameWinAcknowledgeRequest('2a189322-31bb-4119-b943-bx7868ff8dc3').then((result) => {
324
- * console.log(result);
325
- * });
326
- * ```
327
- */
328
- miniGameWinAcknowledgeRequest(request_id: string): Promise<import("../MiniGames").SAWDoAknowledgeResponse>;
329
- /**
330
- * Plays the specified by template_id mini-game on behalf of user spin_count times and returns array of the prizes
331
- * After playMiniGameBatch is called, you can call getMiniGames to get the list of mini-games. The returned list of mini-games is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call playMiniGameBatch with a new onUpdate callback, the old one will be overwritten by the new one.
332
- * The onUpdate callback will be called on available spin count change, if mini-game has increasing jackpot per spin or won prize is spin/jackpot and if max count of the available user spins equals one, also if the spins were issued to the user manually in the BO. Updated templates will be passed to onUpdate callback.
333
- *
334
- * **Example**:
335
- * ```
336
- * _smartico.api.playMiniGameBatch(55, 10).then((result) => {
337
- * console.log(result);
338
- * });
339
- * ```
340
- * **Visitor mode: not supported**
341
- */
342
- playMiniGameBatch(template_id: number, spin_count: number, { onUpdate }?: {
343
- onUpdate?: (data: TMiniGameTemplate[]) => void;
344
- }): Promise<TMiniGamePlayBatchResult[]>;
345
- /**
346
- * Requests an opt-in for the specified mission_id. Returns the err_code.
347
- *
348
- * **Visitor mode: not supported**
349
- */
350
- requestMissionOptIn(mission_id: number): Promise<TMissionOptInResult>;
351
- /**
352
- * Request for claim reward for the specified mission id. Returns the err_code.
353
- *
354
- * **Visitor mode: not supported**
355
- */
356
- requestMissionClaimReward(mission_id: number, ach_completed_id: number): Promise<TMissionClaimRewardResult>;
357
- /** Returns all the active instances of tournaments
358
- * The returned list is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getTournamentsList with a new onUpdate callback, the old one will be overwritten by the new one.
359
- * The onUpdate callback will be called when the user has registered in a tournament. Updated list will be passed to onUpdate callback.
360
- *
361
- * **Example**:
362
- * ```
363
- * _smartico.api.getTournamentsList().then((result) => {
364
- * console.log(result);
365
- * });
366
- * ```
367
- *
368
- * **Example in the Visitor mode**:
369
- * ```
370
- * _smartico.vapi('EN').getTournamentsList().then((result) => {
371
- * console.log(result);
372
- * });
373
- * ```
374
- * */
375
- getTournamentsList({ onUpdate }?: {
376
- onUpdate?: (data: TTournament[]) => void;
377
- }): Promise<TTournament[]>;
378
- /**
379
- * Returns clans list payload for the current user.
380
- * The returned payload is cached for 30 seconds.
381
- * If onUpdate is passed, it will be called when clans response is received.
382
- *
383
- * **Visitor mode: not supported**
384
- */
385
- getClans({ onUpdate }?: {
386
- onUpdate?: (data: TClans) => void;
387
- }): Promise<TClans>;
388
- /**
389
- * Returns detailed information for a specific clan including its members.
390
- *
391
- * **Visitor mode: not supported**
392
- */
393
- getClanInfo(clanId: number): Promise<TClanInfo>;
394
- /**
395
- * Joins a clan on behalf of the current user.
396
- *
397
- * **Visitor mode: not supported**
398
- */
399
- joinClan(clanId: number): Promise<TClanJoinResult>;
400
- /**
401
- * Returns detailed information for a specific tournament instance; the response includes tournament info and the leaderboard of players
402
- *
403
- * **Example**:
404
- * ```
405
- * _smartico.api.getTournamentsList().then((result) => {
406
- * if (result.length > 0) {
407
- * _smartico.api.getTournamentInstanceInfo(result[0].instance_id).then((result) => {
408
- * console.log(result);
409
- * });
410
- * }
411
- * });
412
- * ```
413
- *
414
- * **Example in the Visitor mode**:
415
- * ```
416
- * _smartico.vapi('EN').getTournamentsList().then((result) => {
417
- * if (result.length > 0) {
418
- * _smartico.vapi('EN').getTournamentInstanceInfo(result[0].instance_id).then((result) => {
419
- * console.log(result);
420
- * });
421
- * }
422
- * });
423
- * ```
424
- */
425
- getTournamentInstanceInfo(tournamentInstanceId: number): Promise<TTournamentDetailed>;
426
- /**
427
- * Returns the players of a specific clan in a clan-based tournament.
428
- *
429
- * **Visitor mode: not supported**
430
- */
431
- getClanTournamentPlayers(tournamentInstanceId: number, clanId: number): Promise<TClanTournamentPlayers>;
432
- /**
433
- * Requests registration for the specified tournament instance. Returns the err_code.
434
- *
435
- * **Visitor mode: not supported**
436
- */
437
- registerInTournament(tournamentInstanceId: number): Promise<TTournamentRegistrationResult>;
438
- /**
439
- * Returns the leaderboard for the current type (default is Daily). If getPreviousPeriod is passed as true, a leaderboard for the previous period for the current type will be returned.
440
- * For example, if the type is Weekly and getPreviousPeriod is true, a leaderboard for the previous week will be returned.
441
- *
442
- * **Example**:
443
- * ```
444
- * _smartico.api.getLeaderBoard(1).then((result) => {
445
- * console.log(result);
446
- * });
447
- * ```
448
- *
449
- * **Example in the Visitor mode**:
450
- * ```
451
- * _smartico.vapi('EN').getLeaderBoard(1).then((result) => {
452
- * console.log(result);
453
- * });
454
- * ```
455
- */
456
- getLeaderBoard(periodType: LeaderBoardPeriodType, getPreviousPeriod?: boolean): Promise<LeaderBoardDetailsT>;
457
- /** Returns inbox messages based on the provided parameters. "From" and "to" indicate the range of messages to be fetched.
458
- * The maximum number of messages per request is limited to 20.
459
- * An indicator "onlyFavorite" can be passed to get only messages marked as favorites.
460
- * An indicator "read_status" can be passed to get only messages marked as read or unread.
461
- * You can leave this params empty and by default it will return list of messages ranging from 0 to 20.
462
- * This function returns a list of messages without the body of each message.
463
- * To get the body of the message you need to call getInboxMessageBody function and pass the message guid contained in each message of this request.
464
- * All other action like mark as read, favorite, delete, etc. can be done using this message GUID.
465
- * The "onUpdate" callback will be triggered when the user receives a new message. It will provide an updated list of messages, ranging from 0 to 20, to the onUpdate callback function.
466
- *
467
- * **Visitor mode: not supported**
468
- *
469
- * @param params
470
- */
471
- getInboxMessages({ from, to, onlyFavorite, categoryId, read_status, onUpdate, }?: {
472
- from?: number;
473
- to?: number;
474
- onlyFavorite?: boolean;
475
- categoryId?: InboxCategories;
476
- read_status?: InboxReadStatus;
477
- onUpdate?: (data: TInboxMessage[]) => void;
478
- }): Promise<TInboxMessage[]>;
479
- /**
480
- * Returns inbox unread count.
481
- *
482
- * **Visitor mode: not supported**
483
- * @param params
484
- */
485
- getInboxUnreadCount({ onUpdate }?: {
486
- onUpdate?: (unread_count: number) => void;
487
- }): Promise<number>;
488
- /**
489
- * Returns the message body of the specified message guid.
490
- *
491
- * **Visitor mode: not supported**
492
- */
493
- getInboxMessageBody(messageGuid: string): Promise<TInboxMessageBody>;
494
- /**
495
- * Requests to mark inbox message with specified guid as read
496
- *
497
- * **Visitor mode: not supported**
498
- */
499
- markInboxMessageAsRead(messageGuid: string): Promise<InboxMarkMessageAction>;
500
- /**
501
- * Requests to mark all inbox messages as read
502
- *
503
- * **Visitor mode: not supported**
504
- */
505
- markAllInboxMessagesAsRead(): Promise<InboxMarkMessageAction>;
506
- /**
507
- * Requests to mark inbox message with specified guid as favorite. Pass mark true to add message to favorite and false to remove.
508
- *
509
- * **Visitor mode: not supported**
510
- */
511
- markUnmarkInboxMessageAsFavorite(messageGuid: string, mark: boolean): Promise<InboxMarkMessageAction>;
512
- /**
513
- * Requests to delete inbox message
514
- *
515
- * **Visitor mode: not supported**
516
- */
517
- deleteInboxMessage(messageGuid: string): Promise<InboxMarkMessageAction>;
518
- /**
519
- * Requests to delete all inbox messages
520
- *
521
- * **Visitor mode: not supported**
522
- */
523
- deleteAllInboxMessages(): Promise<InboxMarkMessageAction>;
524
- /**
525
- * Requests translations for the given language. Returns the object including translation key/translation value pairs. All possible translation keys defined in the back office.
526
- */
527
- getTranslations(lang_code: string): Promise<TGetTranslations>;
528
- /**
529
- * Reports an impression event for an engagement (when engagement content is displayed to the user).
530
- * Use this method to track when users view engagement content such as inbox messages, popups.
531
- * When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType.
532
- *
533
- * **Example**:
534
- * ```
535
- * _smartico.api.reportImpressionEvent({
536
- * engagement_uid: 'abc123-def456',
537
- * activityType: 31 // Inbox
538
- * });
539
- * ```
540
- *
541
- * **Visitor mode: not supported**
542
- *
543
- * @param params - Event parameters
544
- * @param params.engagement_uid - Unique identifier for the engagement
545
- * @param params.activityType - Type of engagement activity (Popup=30, Inbox=31)
546
- */
547
- reportImpressionEvent({ engagement_uid, activityType, }: {
548
- engagement_uid: string;
549
- activityType: ActivityTypeLimited | number;
550
- }): void;
551
- /**
552
- * Reports a click/action event for an engagement (when user interacts with engagement content).
553
- * Use this method to track when users click on or interact with engagement content such as inbox messages, popups.
554
- * When using for Inbox cases, you need to use message guid as engagement_uid, and pass 31 as activityType, and pass the action/deeplink that was triggered by the user interaction as action.
555
- *
556
- *
557
- * **Example**:
558
- * ```
559
- * _smartico.api.reportClickEvent({
560
- * engagement_uid: 'abc123-def456',
561
- * activityType: 31 // Inbox
562
- * action: 'dp:gf_missions'
563
- * });
564
- * ```
565
- *
566
- * **Visitor mode: not supported**
567
- *
568
- * @param params - Event parameters
569
- * @param params.engagement_uid - Unique identifier for the engagement
570
- * @param params.activityType - Type of engagement activity (Popup=30, Inbox=31)
571
- * @param params.action - Optional action/deeplink that was triggered by the user interaction
572
- */
573
- reportClickEvent({ engagement_uid, activityType, action, }: {
574
- engagement_uid: string;
575
- activityType: ActivityTypeLimited | number;
576
- action?: string;
577
- }): void;
578
- /**
579
- * Returns the activity log for a user within a specified time range.
580
- * The response includes both points changes and gems/diamonds changes.
581
- * Each log entry contains information about the change amount, balance, and source.
582
- * The returned list is cached for 30 seconds.
583
- * You can pass the onUpdate callback as a parameter, it will be called every time the activity log is updated and will provide the updated list of activity logs for the last 10 minutes.
584
- *
585
- * **Example**:
586
- * ```
587
- * const startTime = Math.floor(Date.now() / 1000) - 86400 * 30; // 30 days ago
588
- * const endTime = Math.floor(Date.now() / 1000); // now
589
- *
590
- * _smartico.api.getActivityLog({
591
- * startTimeSeconds: startTime,
592
- * endTimeSeconds: endTime,
593
- * from: 0,
594
- * to: 50,
595
- * onUpdate: (data) => console.log('Updated:', data)
596
- * }).then((result) => {
597
- * console.log(result);
598
- * });
599
- * ```
600
- *
601
- * **Visitor mode: not supported**
602
- *
603
- * @param params - Activity log parameters
604
- * @param params.startTimeSeconds - Start time in seconds (epoch timestamp)
605
- * @param params.endTimeSeconds - End time in seconds (epoch timestamp)
606
- * @param params.from - Start index of records to return
607
- * @param params.to - End index of records to return
608
- * @param params.onUpdate - Optional callback function that will be called when the activity log is updated
609
- */
610
- getActivityLog({ startTimeSeconds, endTimeSeconds, from, to, onUpdate, }: {
611
- startTimeSeconds: number;
612
- endTimeSeconds: number;
613
- from: number;
614
- to: number;
615
- onUpdate?: (data: TActivityLog[]) => void;
616
- }): Promise<TActivityLog[]>;
617
- /**
618
- * Returns the active rounds for the specified MatchX or Quiz game.
619
- * Each round includes its events (matches/questions) along with the current user's selections and scores.
620
- *
621
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
622
- *
623
- * **Response** `GamesApiResponse<GamePickRound[]>`:
624
- * - `errCode` - 0 on success
625
- * - `data` - Array of rounds, each containing:
626
- * - `round_id`, `round_name` - Round identifier and display name
627
- * - `open_date`, `last_bet_date` - Timestamps (ms) for round open and betting deadline
628
- * - `is_active_now`, `is_resolved` - Round state flags
629
- * - `round_status_id` - Round status: -1 (active), 2 (no more bets), 3 (all events resolved), 4 (round resolved)
630
- * - `score_full_win`, `score_part_win`, `score_lost` - Scoring rules per prediction outcome
631
- * - `user_score` - Current user's total score in this round
632
- * - `user_placed_bet` - Whether the user has submitted predictions
633
- * - `has_open_for_bet_events` - Whether there are events still open for betting
634
- * - `events[]` - Array of events with `gp_event_id`, `market_type_id`, `event_meta` (team names, images, sport), `match_date`, `is_open_for_bets`, `odds_details`, and user selection fields
635
- *
636
- * **Example**:
637
- * ```
638
- * _smartico.api.gamePickGetActiveRounds({
639
- * saw_template_id: 1083,
640
- * }).then((result) => {
641
- * console.log(result.data); // GamePickRound[]
642
- * result.data.forEach(round => {
643
- * console.log(round.round_name, round.events.length);
644
- * });
645
- * });
646
- * ```
647
- *
648
- * **Visitor mode: not supported**
649
- */
650
- gamePickGetActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>;
651
- /**
652
- * Returns a single active round for the specified MatchX or Quiz game.
653
- * The round includes full event details with the current user's selections.
654
- *
655
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
656
- * @param props.round_id - The specific round to retrieve
657
- *
658
- * **Response** `GamesApiResponse<GamePickRound>`:
659
- * - `errCode` - 0 on success
660
- * - `data` - Single round object with the same structure as in `gamePickGetActiveRounds`,
661
- * including `events[]` with full event details, user selections, and resolution info
662
- *
663
- * **Example**:
664
- * ```
665
- * _smartico.api.gamePickGetActiveRound({
666
- * saw_template_id: 1083,
667
- * round_id: 31652,
668
- * }).then((result) => {
669
- * console.log(result.data.round_name, result.data.events.length);
670
- * console.log(result.data.user_score, result.data.user_placed_bet);
671
- * });
672
- * ```
673
- *
674
- * **Visitor mode: not supported**
675
- */
676
- gamePickGetActiveRound(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRound>>;
677
- /**
678
- * Returns the history of all rounds (including resolved ones) for the specified MatchX or Quiz game.
679
- * Each round contains full event details with results and the current user's predictions.
680
- *
681
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
682
- *
683
- * **Response** `GamesApiResponse<GamePickRound[]>`:
684
- * - `errCode` - 0 on success
685
- * - `data` - Array of rounds ordered by `round_row_id` descending (newest first).
686
- * Each round has the same structure as in `gamePickGetActiveRounds`, including resolved events
687
- * with `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) and `resolution_score`
688
- *
689
- * **Example**:
690
- * ```
691
- * _smartico.api.gamePickGetHistory({
692
- * saw_template_id: 1083,
693
- * }).then((result) => {
694
- * result.data.forEach(round => {
695
- * console.log(round.round_name, 'Score:', round.user_score, 'Resolved:', round.is_resolved);
696
- * });
697
- * });
698
- * ```
699
- *
700
- * **Visitor mode: not supported**
701
- */
702
- gamePickGetHistory(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>;
703
- /**
704
- * Returns the leaderboard for a specific round within a MatchX or Quiz game.
705
- * Use `round_id = -1` (AllRoundsGameBoardID) to get the season/overall leaderboard across all rounds.
706
- *
707
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
708
- * @param props.round_id - The round to get the leaderboard for. Use -1 for overall/seasonal leaderboard
709
- *
710
- * **Response** `GamesApiResponse<GamePickRoundBoard>`:
711
- * - `errCode` - 0 on success
712
- * - `data` - Leaderboard object containing:
713
- * - Round base fields (`round_id`, `round_name`, `open_date`, `last_bet_date`, etc.)
714
- * - `users[]` - Ranked list of players, each with:
715
- * - `ext_user_id`, `int_user_id` - User identifiers
716
- * - `public_username`, `avatar_url` - Display info (usernames may be masked based on label settings)
717
- * - `gp_position` - Leaderboard rank (null if not yet ranked)
718
- * - `resolution_score` - Total score in this round
719
- * - `full_wins_count`, `part_wins_count`, `lost_count` - Prediction outcome counts
720
- * - `my_user` - Current user's entry (same fields as above), or null if user hasn't participated
721
- *
722
- * **Example**:
723
- * ```
724
- * _smartico.api.gamePickGetBoard({
725
- * saw_template_id: 1083,
726
- * round_id: 31652,
727
- * }).then((result) => {
728
- * console.log('Top players:', result.data.users);
729
- * console.log('My position:', result.data.my_user?.gp_position);
730
- * });
731
- * ```
732
- *
733
- * **Visitor mode: not supported**
734
- */
735
- gamePickGetBoard(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRoundBoard>>;
736
- /**
737
- * Submits score predictions for a round in a MatchX game.
738
- * Sends the round object with user selections for all events at once.
739
- * Each event must include `team1_user_selection` and `team2_user_selection` representing predicted scores.
740
- * If the user hasn't placed bets before, one game attempt (spin) will be consumed.
741
- * Predictions can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
742
- *
743
- * @param props.saw_template_id - The ID of the MatchX game template
744
- * @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
745
- * and modified with user predictions. Each event needs: `gp_event_id`, `team1_user_selection`, `team2_user_selection`
746
- *
747
- * **Response** `GamesApiResponse<GamePickRound>`:
748
- * - `errCode` - 0 on success. Non-zero codes indicate errors (e.g. not enough points/attempts)
749
- * - `data` - Updated round with all events reflecting the submitted selections.
750
- * `user_placed_bet` will be `true`, `has_not_submitted_changes` will be `false`
751
- *
752
- * **Example**:
753
- * ```
754
- * _smartico.api.gamePickGetActiveRound({
755
- * saw_template_id: 1190,
756
- * round_id: 38665,
757
- * }).then((roundData) => {
758
- * const round = roundData.data;
759
- * round.events = round.events.map(e => ({
760
- * gp_event_id: e.gp_event_id,
761
- * team1_user_selection: 1,
762
- * team2_user_selection: 0,
763
- * }));
764
- * _smartico.api.gamePickSubmitSelection({
765
- * saw_template_id: 1190,
766
- * round: round,
767
- * }).then((result) => {
768
- * console.log(result.data.user_placed_bet); // true
769
- * });
770
- * });
771
- * ```
772
- *
773
- * **Visitor mode: not supported**
774
- */
775
- gamePickSubmitSelection(props: GamePickRequestParams & {
776
- round: Partial<GamePickRound>;
777
- }): Promise<GamesApiResponse<GamePickRound>>;
778
- /**
779
- * Submits answers for a round in a Quiz game.
780
- * Sends the round object with user answers for all events at once.
781
- * Each event must include `user_selection` with the answer value (e.g. '1', '2', 'x', 'yes', 'no' — depending on the market type).
782
- * If the user hasn't placed bets before, one game attempt (spin) will be consumed.
783
- * Answers can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
784
- *
785
- * @param props.saw_template_id - The ID of the Quiz game template
786
- * @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
787
- * and modified with user answers. Each event needs: `gp_event_id`, `user_selection`
788
- *
789
- * **Response** `GamesApiResponse<GamePickRound>`:
790
- * - `errCode` - 0 on success. Non-zero codes indicate errors (e.g. not enough points/attempts)
791
- * - `data` - Updated round with all events reflecting the submitted answers.
792
- * `user_placed_bet` will be `true`, `has_not_submitted_changes` will be `false`
793
- *
794
- * **Example**:
795
- * ```
796
- * _smartico.api.gamePickGetActiveRound({
797
- * saw_template_id: 1183,
798
- * round_id: 37974,
799
- * }).then((roundData) => {
800
- * const round = roundData.data;
801
- * round.events = round.events.map(e => ({
802
- * gp_event_id: e.gp_event_id,
803
- * user_selection: 'x',
804
- * }));
805
- * _smartico.api.gamePickSubmitSelectionQuiz({
806
- * saw_template_id: 1183,
807
- * round: round,
808
- * }).then((result) => {
809
- * console.log(result.data.user_placed_bet); // true
810
- * });
811
- * });
812
- * ```
813
- *
814
- * **Visitor mode: not supported**
815
- */
816
- gamePickSubmitSelectionQuiz(props: GamePickRequestParams & {
817
- round: Partial<GamePickRound>;
818
- }): Promise<GamesApiResponse<GamePickRound>>;
819
- /**
820
- * Returns the current user's profile information within the specified MatchX or Quiz game.
821
- * The user record is synced from the Smartico platform into the games DB (synced every 1 minute).
822
- * If the user doesn't exist in the games DB yet, it will be created automatically on first call.
823
- *
824
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
825
- *
826
- * **Response** `GamesApiResponse<GamePickUserInfo>`:
827
- * - `errCode` - 0 on success
828
- * - `data`:
829
- * - `ext_user_id` - External user ID (Smartico internal numeric ID)
830
- * - `int_user_id` - Internal user ID within the games system
831
- * - `public_username` - Display name
832
- * - `avatar_url` - User's avatar image URL
833
- * - `last_wallet_sync_time` - Last time the user's balance was synced from Smartico
834
- * - `ach_points_balance` - User's current points balance
835
- * - `ach_gems_balance` - User's current gems balance
836
- * - `ach_diamonds_balance` - User's current diamonds balance
837
- * - `pubic_username_set` - Whether the user has set a custom username
838
- *
839
- * **Example**:
840
- * ```
841
- * _smartico.api.gamePickGetUserInfo({
842
- * saw_template_id: 1083,
843
- * }).then((result) => {
844
- * console.log(result.data.public_username, result.data.ach_points_balance);
845
- * });
846
- * ```
847
- *
848
- * **Visitor mode: not supported**
849
- */
850
- gamePickGetUserInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickUserInfo>>;
851
- /**
852
- * Returns the game configuration and the list of all rounds for the specified MatchX or Quiz game.
853
- * Includes the SAW template definition, label settings, and round metadata (without events).
854
- *
855
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
856
- *
857
- * **Response** `GamesApiResponse<GamePickGameInfo>`:
858
- * - `errCode` - 0 on success
859
- * - `data`:
860
- * - `sawTemplate` - Game template configuration including:
861
- * - `saw_template_id`, `saw_game_type_id` (6 = MatchX/Quiz)
862
- * - `saw_template_ui_definition` - UI settings (name, ranking options, ask_for_username, etc.)
863
- * - `saw_buyin_type_id` - Cost type (1=Free, 2=Points, 3=Gems, 4=Diamonds, 5=Spins)
864
- * - `buyin_cost_points` - Cost per attempt
865
- * - `spin_count` - Available attempts for the current user
866
- * - `allRounds[]` - List of all rounds (metadata only, no events), each with:
867
- * - `round_id`, `round_name`, `round_description`
868
- * - `open_date`, `last_bet_date` - Timestamps (ms)
869
- * - `is_active_now`, `is_resolved`, `round_status_id`
870
- * - `labelInfo` - Label/brand configuration and settings
871
- *
872
- * **Example**:
873
- * ```
874
- * _smartico.api.gamePickGetGameInfo({
875
- * saw_template_id: 1189,
876
- * }).then((result) => {
877
- * console.log(result.data.sawTemplate.saw_template_ui_definition.name);
878
- * console.log('Rounds:', result.data.allRounds.length);
879
- * console.log('Buy-in type:', result.data.sawTemplate.saw_buyin_type_id);
880
- * });
881
- * ```
882
- *
883
- * **Visitor mode: not supported**
884
- */
885
- gamePickGetGameInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickGameInfo>>;
886
- /**
887
- * Returns round data with events and picks for a specific user (identified by their internal user ID).
888
- * Useful for viewing another user's predictions from the leaderboard.
889
- * The `int_user_id` can be obtained from the `gamePickGetBoard` response (`users[].int_user_id`).
890
- *
891
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
892
- * @param props.round_id - The round to get info for
893
- * @param props.int_user_id - Internal user ID of the player whose predictions to view (from leaderboard data)
894
- *
895
- * **Response** `GamesApiResponse<GamePickRound>`:
896
- * - `errCode` - 0 on success
897
- * - `data` - Round object with the target user's selections.
898
- * Same structure as `gamePickGetActiveRound`, but `user_selection`/`team1_user_selection`/`team2_user_selection`
899
- * fields on events reflect the specified user's picks instead of the current user's.
900
- * Events also include `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) showing how each prediction was scored
901
- *
902
- * **Example**:
903
- * ```
904
- * _smartico.api.gamePickGetRoundInfoForUser({
905
- * saw_template_id: 1083,
906
- * round_id: 31652,
907
- * int_user_id: 65653810,
908
- * }).then((result) => {
909
- * result.data.events.forEach(e => {
910
- * console.log(e.event_meta.team1_name, 'vs', e.event_meta.team2_name, '→', e.user_selection);
911
- * });
912
- * });
913
- * ```
914
- *
915
- * **Visitor mode: not supported**
916
- */
917
- gamePickGetRoundInfoForUser(props: GamePickRoundRequestParams & {
918
- int_user_id: number;
919
- }): Promise<GamesApiResponse<GamePickRound>>;
920
- /**
921
- * Returns the list of avatars available in the catalog for the current user.
922
- * The response includes both free avatars and earned/purchased ones.
923
- * Avatars with `hide_until_achieved = true` and `is_given = false` should be hidden from the user.
924
- * The result is cached for 30 seconds.
925
- *
926
- * **Example**:
927
- * ```
928
- * _smartico.api.getAvatarsList().then((result) => {
929
- * console.log(result);
930
- * });
931
- * ```
932
- *
933
- * **Visitor mode: not supported**
934
- */
935
- getAvatarsList(): Promise<TAvatarDefinition[]>;
936
- /**
937
- * Returns the list of AI-customized avatars for the current user.
938
- * Each entry represents a previously generated AI customization for a specific base avatar.
939
- * The result is cached for 30 seconds.
940
- *
941
- * **Example**:
942
- * ```
943
- * _smartico.api.getAvatarsCustomized().then((result) => {
944
- * console.log(result);
945
- * });
946
- * ```
947
- *
948
- * **Visitor mode: not supported**
949
- */
950
- getAvatarsCustomized(): Promise<TAvatarCustomized[]>;
951
- /**
952
- * Returns the list of AI customization prompts (styles) available for avatar customization.
953
- * Each prompt represents a visual style that can be applied to a base avatar.
954
- * The result is cached for 30 seconds.
955
- *
956
- * **Example**:
957
- * ```
958
- * _smartico.api.getAvatarPrompts().then((result) => {
959
- * console.log(result);
960
- * });
961
- * ```
962
- *
963
- * **Visitor mode: not supported**
964
- */
965
- getAvatarPrompts(): Promise<TAvatarPrompt[]>;
966
- /**
967
- * Sets the specified avatar as the active avatar for the current user.
968
- * Pass `avatar_url` (the `TAvatarDefinition.url` path or a CDN URL for AI-customized avatars)
969
- * and `avatar_real_id` from the avatar catalog.
970
- * After a successful call, the avatar list cache is cleared so the next `getAvatarsList()` call reflects `is_in_use`.
971
- *
972
- * **Example**:
973
- * ```
974
- * _smartico.api.getAvatarsList().then((avatars) => {
975
- * const avatar = avatars.find((a) => !a.hide_until_achieved || a.is_given);
976
- * if (avatar) {
977
- * _smartico.api.setAvatar({
978
- * avatar_url: avatar.url,
979
- * avatar_real_id: avatar.avatar_real_id,
980
- * }).then((result) => {
981
- * console.log(result);
982
- * });
983
- * }
984
- * });
985
- * ```
986
- *
987
- * **Visitor mode: not supported**
988
- */
989
- setAvatar(props: {
990
- avatar_url: string;
991
- avatar_real_id: number;
992
- }): Promise<TSetAvatarResult>;
993
- private updateOnSpin;
994
- private reloadMiniGameTemplate;
995
- private updateMissions;
996
- private updateBonuses;
997
- private updateTournaments;
998
- private updateClans;
999
- private updateStorePurchasedItems;
1000
- private updateStoreItems;
1001
- private updateInboxUnreadCount;
1002
- private updateInboxMessages;
1003
- private updateRaffles;
1004
- private notifyActivityLogUpdate;
1005
- private updateEntity;
1006
- private jackpotClearCache;
1007
- /** Returns list of Jackpots that are active in the system and matching to the filter definition.
1008
- * If filter is not provided, all active jackpots will be returned.
1009
- * Filter can be used to get jackpots related to specific game or specific jackpot template.
1010
- * You can call this method every second in order to get up to date information about current value of the jackpot(s) and present them to the end-users
1011
- *
1012
- * **Example**:
1013
- * ```
1014
- * _smartico.api.jackpotGet({ related_game_id: 'wooko-slot' }).then((result) => {
1015
- * console.log(result);
1016
- * });
1017
- * ```
1018
- *
1019
- * **Example in the Visitor mode**:
1020
- * ```
1021
- * _smartico.vapi('EN').jackpotGet({ related_game_id: 'wooko-slot' }).then((result) => {
1022
- * console.log(result);
1023
- * });
1024
- * ```
1025
- */
1026
- jackpotGet(filter?: {
1027
- related_game_id?: string;
1028
- jp_template_id?: number;
1029
- }): Promise<JackpotDetails[]>;
1030
- /**
1031
- * Opt-in currently logged in user to the jackpot with the specified jp_template_id.
1032
- * You may call jackpotGet method after doing optin to see that user is opted in to the jackpot.
1033
- *
1034
- * **Example**:
1035
- * ```
1036
- * _smartico.api.jackpotOptIn({ jp_template_id: 123 }).then((result) => {
1037
- * console.log('Opted in to the jackpot');
1038
- * });
1039
- * ```
1040
- *
1041
- * **Visitor mode: not supported**
1042
- *
1043
- */
1044
- jackpotOptIn(filter: {
1045
- jp_template_id: number;
1046
- }): Promise<JackpotsOptinResponse>;
1047
- /**
1048
- * Opt-out currently logged in user from the jackpot with the specified jp_template_id.
1049
- * You may call jackpotGet method after doing optout to see that user is not opted in to the jackpot.
1050
- *
1051
- * **Example**:
1052
- * ```
1053
- * _smartico.api.jackpotOptOut({ jp_template_id: 123 }).then((result) => {
1054
- * console.log('Opted out from the jackpot');
1055
- * });
1056
- * ```
1057
- *
1058
- * **Visitor mode: not supported**
1059
- *
1060
- */
1061
- jackpotOptOut(filter: {
1062
- jp_template_id: number;
1063
- }): Promise<JackpotsOptoutResponse>;
1064
- /**
1065
- * Returns jackpot winners for the given `jp_template_id` (paginated on the server).
1066
- * Default page size on the wire is 20; use `limit`, `offset`, and repeated calls to load more.
1067
- * The full protocol response also includes `has_more`; this method returns only the `winners` array.
1068
- *
1069
- * **Example**:
1070
- * ```
1071
- * _smartico.api.getJackpotWinners({
1072
- * jp_template_id: 123,
1073
- * }).then((result) => {
1074
- * console.log(result);
1075
- * });
1076
- * ```
1077
- *
1078
- * **Visitor mode: not supported**
1079
- *
1080
- * @param params - Jackpot winners parameters
1081
- * @param params.jp_template_id - Jackpot template id (required; throws if missing)
1082
- * @param params.limit - Page size (server default 20 when omitted)
1083
- * @param params.offset - Offset into the winner list
1084
- */
1085
- getJackpotWinners({ limit, offset, jp_template_id, }: {
1086
- limit?: number;
1087
- offset?: number;
1088
- jp_template_id?: number;
1089
- }): Promise<JackpotWinnerHistory[]>;
1090
- /**
1091
- * Returns the eligible games for the jackpot with the specified jp_template_id.
1092
- *
1093
- * **Example**:
1094
- * ```
1095
- * _smartico.api.getJackpotEligibleGames({ jp_template_id: 123 }).then((result) => {
1096
- * console.log(result);
1097
- * });
1098
- * ```
1099
- *
1100
- * **Visitor mode: not supported**
1101
- *
1102
- */
1103
- getJackpotEligibleGames({ jp_template_id, onUpdate }: {
1104
- jp_template_id: number;
1105
- onUpdate?: () => void;
1106
- }): Promise<TGetJackpotEligibleGamesResponse>;
1107
- /**
1108
- * Returns all the related tournaments and missions for the provided game id for the current user
1109
- * The provided Game ID should correspond to the ID from the Games Catalog - https://help.smartico.ai/welcome/technical-guides/games-catalog-api
1110
- *
1111
- * **Example**:
1112
- * ```
1113
- * _smartico.api.getRelatedItemsForGame('gold-slot2').then((result) => {
1114
- * console.log(result);
1115
- * });
1116
- * ```
1117
- *
1118
- * **Example in the Visitor mode**:
1119
- * ```
1120
- * _smartico.vapi('EN').getRelatedItemsForGame('gold-slot2').then((result) => {
1121
- * console.log(result);
1122
- * });
1123
- * ```
1124
- */
1125
- getRelatedItemsForGame(related_game_id: string): Promise<GetRelatedAchTourResponse>;
1126
- /**
1127
- * Returns the list of Raffles available for user
1128
- * The returned list of Raffles is cached for 30 seconds. But you can pass the onUpdate callback as a parameter. Note that each time you call getRaffles with a new onUpdate callback, the old one will be overwritten by the new one.
1129
- * The onUpdate callback will be called on claiming prize. Updated Raffles will be passed to onUpdate callback.
1130
- *
1131
- * **Example**:
1132
- *
1133
- * ```
1134
- * _smartico.api.getRaffles().then((result) => {
1135
- * console.log(result);
1136
- * });
1137
- * ```
1138
- *
1139
- * **Example in the Visitor mode**:
1140
- *
1141
- * ```
1142
- * _smartico.vapi('EN').getRaffles().then((result) => {
1143
- * console.log(result);
1144
- * });
1145
- * ```
1146
- *
1147
- */
1148
- getRaffles({ onUpdate }?: {
1149
- onUpdate?: (data: TRaffle[]) => void;
1150
- }): Promise<TRaffle[]>;
1151
- /**
1152
- * Returns draw run for provided raffle_id and run_id.
1153
- * You can pass winners_from and winners_to parameters to get a specific range of winners. Default is 0-20.
1154
- *
1155
- *
1156
- * **Example**:
1157
- *
1158
- * ```javascript
1159
- * _smartico.api.getRaffleDrawRun({raffle_id: 156, run_id: 145}).then((result) => {
1160
- * console.log(result);
1161
- * });
1162
- * ```
1163
- *
1164
- * **Example in the Visitor mode**:
1165
- *
1166
- *
1167
- * ```javascript
1168
- * _smartico.vapi('EN').getRaffleDrawRun({ raffle_id: 156, run_id: 145 }).then((result) => {
1169
- * console.log(result);
1170
- * });
1171
- * ```
1172
- *
1173
- */
1174
- getRaffleDrawRun(props: {
1175
- raffle_id: number;
1176
- run_id: number;
1177
- winners_from?: number;
1178
- winners_to?: number;
1179
- }): Promise<TRaffleDraw>;
1180
- /**
1181
- * Returns history of draw runs for the provided raffle_id and draw_id, if the draw_id is not provided will return history of all the draws for the provided raffle_id
1182
- *
1183
- *
1184
- * **Example**:
1185
- *
1186
- * ```javascript
1187
- * _smartico.api.getRaffleDrawRunsHistory({ raffle_id: 156, draw_id: 432 }).then((result) => {
1188
- * console.log(result);
1189
- * });
1190
- * ```
1191
- *
1192
- * **Example in the Visitor mode**:
1193
- *
1194
- * ```javascript
1195
- * _smartico.vapi('EN').getRaffleDrawRunsHistory({ raffle_id: 156, draw_id: 432 }).then((result) => {
1196
- * console.log(result);
1197
- * });
1198
- * ```
1199
- *
1200
- */
1201
- getRaffleDrawRunsHistory(props: {
1202
- raffle_id: number;
1203
- draw_id?: number;
1204
- }): Promise<TRaffleDrawRun[]>;
1205
- /**
1206
- * Returns `err_code` and `err_message` after the call; `err_code` 0 means the request succeeded.
1207
- *
1208
- *
1209
- * **Example**:
1210
- *
1211
- * ```javascript
1212
- * _smartico.api.claimRafflePrize({won_id:251}).then((result) => {
1213
- * console.log(result);
1214
- * });
1215
- * ```
1216
- *
1217
- * **Example in the Visitor mode**:
1218
- *
1219
- * ```javascript
1220
- * _smartico.vapi('EN').claimRafflePrize({ won_id: 251 }).then((result) => {
1221
- * console.log(result);
1222
- * });
1223
- * ```
1224
- *
1225
- */
1226
- claimRafflePrize(props: {
1227
- won_id: number;
1228
- }): Promise<TransformedRaffleClaimPrizeResponse>;
1229
- /**
1230
- * Requests an opt-in for the specified raffle. Returns the err_code.
1231
- *
1232
- * **Visitor mode: not supported**
1233
- */
1234
- requestRaffleOptin(props: {
1235
- raffle_id: number;
1236
- draw_id: number;
1237
- raffle_run_id: number;
1238
- }): Promise<TRaffleOptinResponse>;
1239
17
  }