@smartico/public-api 0.0.379 → 0.0.381

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 (219) hide show
  1. package/.nvmrc +1 -1
  2. package/CLAUDE.md +103 -0
  3. package/README.md +53 -2
  4. package/dist/Base/ClassId.d.ts +2 -0
  5. package/dist/Jackpots/JackpotDetails.d.ts +14 -15
  6. package/dist/Jackpots/JackpotPot.d.ts +10 -6
  7. package/dist/Raffle/GetRaffleWonPrizesRequest.d.ts +9 -0
  8. package/dist/Raffle/GetRaffleWonPrizesResponse.d.ts +52 -0
  9. package/dist/Raffle/index.d.ts +2 -0
  10. package/dist/SmarticoAPI.d.ts +6 -1
  11. package/dist/SmarticoLib/index.d.ts +5 -1
  12. package/dist/Store/BuyStoreItemErrorCode.d.ts +9 -1
  13. package/dist/Tournaments/TournamentRegistrationError.d.ts +3 -1
  14. package/dist/WSAPI/WSAPI.d.ts +13 -1235
  15. package/dist/WSAPI/WSAPIAvatars.d.ts +296 -0
  16. package/dist/WSAPI/WSAPIBase.d.ts +71 -0
  17. package/dist/WSAPI/WSAPIBonuses.d.ts +240 -0
  18. package/dist/WSAPI/WSAPIClans.d.ts +388 -0
  19. package/dist/WSAPI/WSAPIGamePick.d.ts +593 -0
  20. package/dist/WSAPI/WSAPIGeneral.d.ts +172 -0
  21. package/dist/WSAPI/WSAPIInbox.d.ts +615 -0
  22. package/dist/WSAPI/WSAPIJackpots.d.ts +344 -0
  23. package/dist/WSAPI/WSAPILeaderBoard.d.ts +139 -0
  24. package/dist/WSAPI/WSAPIMiniGames.d.ts +510 -0
  25. package/dist/WSAPI/WSAPIMissions.d.ts +517 -0
  26. package/dist/WSAPI/WSAPIRaffles.d.ts +643 -0
  27. package/dist/WSAPI/WSAPIStore.d.ts +656 -0
  28. package/dist/WSAPI/WSAPITournaments.d.ts +501 -0
  29. package/dist/WSAPI/WSAPITypes.d.ts +376 -205
  30. package/dist/WSAPI/WSAPIUser.d.ts +533 -0
  31. package/dist/index.js +6745 -1661
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.modern.mjs +6324 -1342
  34. package/dist/index.modern.mjs.map +1 -1
  35. package/docs/Callbacks.md +162 -0
  36. package/docs/SmarticoObject.md +445 -0
  37. package/docs/Transforms.md +99 -0
  38. package/docs/api/README.md +82 -2
  39. package/docs/api/classes/WSAPIAvatars.md +344 -0
  40. package/docs/api/classes/WSAPIBonuses.md +271 -0
  41. package/docs/api/classes/WSAPIClans.md +436 -0
  42. package/docs/api/classes/WSAPIGamePick.md +710 -0
  43. package/docs/api/classes/WSAPIGeneral.md +212 -0
  44. package/docs/api/classes/WSAPIInbox.md +801 -0
  45. package/docs/api/classes/WSAPIJackpots.md +439 -0
  46. package/docs/api/classes/WSAPILeaderBoard.md +157 -0
  47. package/docs/api/classes/WSAPIMiniGames.md +612 -0
  48. package/docs/api/classes/WSAPIMissions.md +590 -0
  49. package/docs/api/classes/WSAPIRaffles.md +773 -0
  50. package/docs/api/classes/WSAPIStore.md +719 -0
  51. package/docs/api/classes/WSAPITournaments.md +571 -0
  52. package/docs/api/classes/WSAPIUser.md +637 -0
  53. package/docs/api/documents/Callbacks.md +162 -0
  54. package/docs/api/documents/SmarticoObject.md +445 -0
  55. package/docs/api/documents/Transforms.md +99 -0
  56. package/docs/api/enumerations/AchievementClaimPeriodTypeId.md +13 -0
  57. package/docs/api/enumerations/BonusStatus-1.md +11 -6
  58. package/docs/api/enumerations/BuyStoreItemErrorCode.md +32 -0
  59. package/docs/api/enumerations/JoinClanErrorCode.md +81 -0
  60. package/docs/api/enumerations/TournamentRegistrationError.md +12 -0
  61. package/docs/api/functions/clanTournamentPlayersTransform.md +13 -0
  62. package/docs/api/interfaces/AvatarCustomized.md +25 -0
  63. package/docs/api/interfaces/AvatarDefinition.md +94 -0
  64. package/docs/api/interfaces/AvatarPrompt.md +45 -0
  65. package/docs/api/interfaces/BonusMetaMap-1.md +4 -1
  66. package/docs/api/interfaces/BonusTemplateMetaMap-1.md +9 -4
  67. package/docs/api/interfaces/Clan.md +4 -0
  68. package/docs/api/interfaces/ClanInfo.md +109 -0
  69. package/docs/api/interfaces/ClanMember.md +53 -0
  70. package/docs/api/interfaces/ClanPrizePublicMeta.md +41 -0
  71. package/docs/api/interfaces/ClanPrizeStructureEntry.md +7 -1
  72. package/docs/api/interfaces/ClanPublicMeta.md +4 -0
  73. package/docs/api/interfaces/ClanTournamentPlayerRaw.md +67 -0
  74. package/docs/api/interfaces/GemsDiamondsLog.md +43 -0
  75. package/docs/api/interfaces/GetClanInfoResponse.md +61 -0
  76. package/docs/api/interfaces/GetClanTournamentPlayersResponse.md +81 -0
  77. package/docs/api/interfaces/GetRaffleWonPrizesRequest.md +59 -0
  78. package/docs/api/interfaces/GetRaffleWonPrizesResponse.md +95 -0
  79. package/docs/api/interfaces/InboxMarkMessageAction.md +10 -2
  80. package/docs/api/interfaces/JackpotDetails.md +14 -15
  81. package/docs/api/interfaces/JackpotPot.md +9 -6
  82. package/docs/api/interfaces/LeaderBoardDetailsT.md +14 -8
  83. package/docs/api/interfaces/LeaderBoardUserT.md +8 -5
  84. package/docs/api/interfaces/LeaderBoardsRewardsT.md +7 -0
  85. package/docs/api/interfaces/PointsLog.md +43 -0
  86. package/docs/api/interfaces/RaffleWonPrize.md +59 -0
  87. package/docs/api/interfaces/RaffleWonPrizePublicMeta.md +27 -0
  88. package/docs/api/interfaces/RaffleWonPrizeUser.md +43 -0
  89. package/docs/api/interfaces/SAWTemplateUI.md +10 -0
  90. package/docs/api/interfaces/TAchCategory.md +14 -4
  91. package/docs/api/interfaces/TAvatarCustomized.md +4 -4
  92. package/docs/api/interfaces/TAvatarDefinition.md +13 -14
  93. package/docs/api/interfaces/TAvatarPrompt.md +6 -6
  94. package/docs/api/interfaces/TBonus.md +16 -8
  95. package/docs/api/interfaces/TBuyStoreItemResult.md +4 -11
  96. package/docs/api/interfaces/TClaimBonusResult.md +5 -5
  97. package/docs/api/interfaces/TClan.md +8 -4
  98. package/docs/api/interfaces/TClanInfo.md +47 -0
  99. package/docs/api/interfaces/TClanJoinResult.md +11 -1
  100. package/docs/api/interfaces/TClanTournamentPlayer.md +55 -0
  101. package/docs/api/interfaces/TClanTournamentPlayersResult.md +27 -0
  102. package/docs/api/interfaces/TClans.md +3 -1
  103. package/docs/api/interfaces/TGetTranslations.md +4 -0
  104. package/docs/api/interfaces/TInboxMessage.md +14 -6
  105. package/docs/api/interfaces/TInboxMessageBody.md +18 -12
  106. package/docs/api/interfaces/TLevel.md +17 -20
  107. package/docs/api/interfaces/TLevelCurrent.md +19 -18
  108. package/docs/api/interfaces/TMiniGamePlayBatchResult.md +14 -6
  109. package/docs/api/interfaces/TMiniGamePlayResult.md +9 -4
  110. package/docs/api/interfaces/TMissionClaimRewardResult.md +6 -3
  111. package/docs/api/interfaces/TMissionOptInResult.md +6 -3
  112. package/docs/api/interfaces/TMissionOrBadge.md +5 -4
  113. package/docs/api/interfaces/TRaffleOptinResponse.md +4 -2
  114. package/docs/api/interfaces/TSegmentCheckResult.md +10 -0
  115. package/docs/api/interfaces/TSetAvatarResult.md +3 -3
  116. package/docs/api/interfaces/TStoreItem.md +11 -1
  117. package/docs/api/interfaces/TTournament.md +1 -1
  118. package/docs/api/interfaces/TTournamentDetailed.md +9 -1
  119. package/docs/api/interfaces/TTournamentRegistrationResult.md +4 -2
  120. package/docs/api/interfaces/TUICustomSection.md +23 -19
  121. package/docs/api/interfaces/TUserProfile.md +18 -16
  122. package/docs/api/interfaces/TransformedRaffleClaimPrizeResponse.md +6 -2
  123. package/docs/api/interfaces/UserAchievement.md +1 -1
  124. package/docs/api/interfaces/UserLevelExtraCountersT.md +9 -2
  125. package/docs/api/type-aliases/ActivityLogEntry.md +3 -0
  126. package/docs/native/ADDING_METHODS.md +7 -2
  127. package/docs/native/PROTOCOL.md +337 -0
  128. package/docs/ui/avatars/UIGuide_getAvatarPrompts.md +100 -0
  129. package/docs/ui/avatars/UIGuide_getAvatarsCustomized.md +90 -0
  130. package/docs/ui/avatars/UIGuide_getAvatarsList.md +105 -0
  131. package/docs/ui/avatars/UIGuide_setAvatar.md +118 -0
  132. package/docs/ui/bonuses/UIGuide_claimBonus.md +144 -0
  133. package/docs/ui/bonuses/UIGuide_getBonuses.md +176 -0
  134. package/docs/ui/clans/UIGuide_getClanInfo.md +153 -0
  135. package/docs/ui/clans/UIGuide_getClans.md +172 -0
  136. package/docs/ui/clans/UIGuide_joinClan.md +196 -0
  137. package/docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md +99 -0
  138. package/docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md +76 -0
  139. package/docs/ui/gamepick/UIGuide_gamePickGetBoard.md +81 -0
  140. package/docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md +78 -0
  141. package/docs/ui/gamepick/UIGuide_gamePickGetHistory.md +55 -0
  142. package/docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md +71 -0
  143. package/docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md +64 -0
  144. package/docs/ui/gamepick/UIGuide_gamePickSubmitSelection.md +103 -0
  145. package/docs/ui/gamepick/UIGuide_gamePickSubmitSelectionQuiz.md +67 -0
  146. package/docs/ui/general/UIGuide_getCustomSections.md +137 -0
  147. package/docs/ui/general/UIGuide_getRelatedItemsForGame.md +140 -0
  148. package/docs/ui/inbox/UIGuide_deleteInboxMessage.md +135 -0
  149. package/docs/ui/inbox/UIGuide_getInboxMessageBody.md +133 -0
  150. package/docs/ui/inbox/UIGuide_getInboxMessages.md +186 -0
  151. package/docs/ui/inbox/UIGuide_markInboxMessageAsRead.md +122 -0
  152. package/docs/ui/inbox/UIGuide_markUnmarkInboxMessageAsFavorite.md +84 -0
  153. package/docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md +73 -0
  154. package/docs/ui/jackpots/UIGuide_getJackpotWinners.md +83 -0
  155. package/docs/ui/jackpots/UIGuide_jackpotGet.md +138 -0
  156. package/docs/ui/jackpots/UIGuide_jackpotOptIn.md +85 -0
  157. package/docs/ui/jackpots/UIGuide_jackpotOptOut.md +65 -0
  158. package/docs/ui/leaderboard/UIGuide_getLeaderBoard.md +166 -0
  159. package/docs/ui/minigames/UIGuide_getMiniGames.md +153 -0
  160. package/docs/ui/minigames/UIGuide_getMiniGamesHistory.md +90 -0
  161. package/docs/ui/minigames/UIGuide_playMiniGame.md +150 -0
  162. package/docs/ui/minigames/UIGuide_playMiniGameBatch.md +128 -0
  163. package/docs/ui/missions/UIGuide_getAchCategories.md +17 -0
  164. package/docs/ui/missions/UIGuide_getBadges.md +237 -0
  165. package/docs/ui/missions/UIGuide_getMissions.md +268 -0
  166. package/docs/ui/missions/UIGuide_requestMissionClaimReward.md +21 -0
  167. package/docs/ui/missions/UIGuide_requestMissionOptIn.md +16 -0
  168. package/docs/ui/raffles/UIGuide_claimRafflePrize.md +99 -0
  169. package/docs/ui/raffles/UIGuide_getRaffleDrawRun.md +117 -0
  170. package/docs/ui/raffles/UIGuide_getRaffleDrawRunsHistory.md +92 -0
  171. package/docs/ui/raffles/UIGuide_getRaffleWonPrizes.md +120 -0
  172. package/docs/ui/raffles/UIGuide_getRaffles.md +175 -0
  173. package/docs/ui/raffles/UIGuide_requestRaffleOptin.md +114 -0
  174. package/docs/ui/store/UIGuide_buyStoreItem.md +133 -0
  175. package/docs/ui/store/UIGuide_getStoreCategories.md +19 -0
  176. package/docs/ui/store/UIGuide_getStoreItems.md +264 -0
  177. package/docs/ui/store/UIGuide_getStorePurchasedItems.md +122 -0
  178. package/docs/ui/tournaments/UIGuide_getClanTournamentPlayers.md +140 -0
  179. package/docs/ui/tournaments/UIGuide_getTournamentInstanceInfo.md +265 -0
  180. package/docs/ui/tournaments/UIGuide_getTournamentsList.md +236 -0
  181. package/docs/ui/tournaments/UIGuide_registerInTournament.md +156 -0
  182. package/docs/ui/user/UIGuide_getActivityLog.md +130 -0
  183. package/docs/ui/user/UIGuide_getLevels.md +167 -0
  184. package/docs/ui/user/UIGuide_getUserProfile.md +213 -0
  185. package/package.json +3 -3
  186. package/scripts/postdoc-cleanup.js +195 -0
  187. package/src/Base/ClassId.ts +2 -0
  188. package/src/Jackpots/JackpotDetails.ts +14 -15
  189. package/src/Jackpots/JackpotPot.ts +10 -6
  190. package/src/Missions/MissionsUtils.ts +5 -2
  191. package/src/Raffle/GetRaffleWonPrizesRequest.ts +12 -0
  192. package/src/Raffle/GetRaffleWonPrizesResponse.ts +56 -0
  193. package/src/Raffle/index.ts +3 -1
  194. package/src/SmarticoAPI.ts +14 -1
  195. package/src/SmarticoLib/index.ts +4 -0
  196. package/src/Store/BuyStoreItemErrorCode.ts +8 -0
  197. package/src/Store/StoreItem.ts +1 -0
  198. package/src/Store/StoreItemPurchased.ts +1 -0
  199. package/src/Store/StoreItemType.ts +1 -1
  200. package/src/Tournaments/TournamentRegistrationError.ts +4 -0
  201. package/src/WSAPI/WSAPI.ts +27 -2007
  202. package/src/WSAPI/WSAPIAvatars.ts +345 -0
  203. package/src/WSAPI/WSAPIBase.ts +93 -0
  204. package/src/WSAPI/WSAPIBonuses.ts +268 -0
  205. package/src/WSAPI/WSAPIClans.ts +417 -0
  206. package/src/WSAPI/WSAPIGamePick.ts +667 -0
  207. package/src/WSAPI/WSAPIGeneral.ts +199 -0
  208. package/src/WSAPI/WSAPIInbox.ts +711 -0
  209. package/src/WSAPI/WSAPIJackpots.ts +448 -0
  210. package/src/WSAPI/WSAPILeaderBoard.ts +154 -0
  211. package/src/WSAPI/WSAPIMiniGames.ts +597 -0
  212. package/src/WSAPI/WSAPIMissions.ts +572 -0
  213. package/src/WSAPI/WSAPIRaffles.ts +703 -0
  214. package/src/WSAPI/WSAPIStore.ts +732 -0
  215. package/src/WSAPI/WSAPITournaments.ts +541 -0
  216. package/src/WSAPI/WSAPITypes.ts +376 -207
  217. package/src/WSAPI/WSAPIUser.ts +606 -0
  218. package/tsconfig.json +26 -2
  219. package/docs/api/classes/WSAPI.md +0 -1927
@@ -0,0 +1,593 @@
1
+ import { GamesApiResponse, GamePickRound, GamePickRoundBoard, GamePickUserInfo, GamePickGameInfo, GamePickRequestParams, GamePickRoundRequestParams } from './WSAPITypes';
2
+ import { WSAPIAvatars } from './WSAPIAvatars';
3
+ /** @group GamePick */
4
+ export declare class WSAPIGamePick extends WSAPIAvatars {
5
+ /**
6
+ * Returns every open round for a MatchX or Quiz game template, with the full
7
+ * event list (matches / questions) and the current user's selections per event.
8
+ *
9
+ * Use to power the rounds-lobby screen — typically a list of round cards a user
10
+ * can tap into to make predictions. For a single round, use
11
+ * {@link gamePickGetActiveRound} (lighter payload when only one round is shown).
12
+ *
13
+ * @remarks
14
+ * **Preconditions**
15
+ * - User must be authenticated.
16
+ * - `saw_template_id` must reference a MatchX or Quiz game template. The SDK
17
+ * throws synchronously if it's missing.
18
+ *
19
+ * **Transport**
20
+ * Game Pick methods are HTTP REST calls to a separate Game Pick games server
21
+ * (not the main WebSocket). One consequence: there is no SDK cache and no push
22
+ * subscription — every call is a fresh server roundtrip.
23
+ *
24
+ * **Round status**
25
+ * Each round's `round_status_id` is a {@link GPRoundStatus} value. Rounds with
26
+ * status `NoEventsDefined` (1) are filtered out server-side and never appear
27
+ * here. Other values: `Other` (-1, normally open), `NoMoreBetsAllowed` (2),
28
+ * `AllEventsResolved_ButNotRound` (3), `RoundResolved` (4 — appears here only
29
+ * briefly during transition; use {@link gamePickGetHistory} for resolved rounds).
30
+ *
31
+ * **Error codes** (in `errCode`)
32
+ * - `0` — success.
33
+ * - `100002` — template not found (the `saw_template_id` doesn't reference a
34
+ * MatchX/Quiz game).
35
+ * - `100003` — no open rounds available for this template right now.
36
+ * - `100000` — auth hash invalid; SDK session needs re-initialization.
37
+ * - `100004` — generic server error.
38
+ *
39
+ * **Refresh**
40
+ * - No cache; every call is live.
41
+ * - No push subscription. Poll while the user is on the screen if you need
42
+ * live round-status changes (typically every 30–60 s is enough).
43
+ *
44
+ * **Visitor mode**: not supported. The SDK throws synchronously on visitor
45
+ * sessions.
46
+ *
47
+ * **UI guidance**: see [UI Guide — `gamePickGetActiveRounds`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md).
48
+ *
49
+ * @param props.saw_template_id ID of the MatchX or Quiz game template.
50
+ * @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const r = await window._smartico.api.gamePickGetActiveRounds({ saw_template_id: 1083 });
55
+ *
56
+ * if (r.errCode !== 0) {
57
+ * console.error('[smartico] active rounds fetch failed — show empty rounds lobby:', r.errMessage);
58
+ * return;
59
+ * }
60
+ *
61
+ * for (const round of r.data ?? []) {
62
+ * console.log('[smartico] render a round card:', round.round_name, '— events:', round.events.length, 'user has placed bet:', round.user_placed_bet);
63
+ * }
64
+ * ```
65
+ */
66
+ gamePickGetActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>;
67
+ /**
68
+ * Returns a single round (events, user selections, scoring rules) for a
69
+ * MatchX or Quiz game. Use to power the round-detail / prediction-input
70
+ * screen the user lands on after picking a round from the lobby.
71
+ *
72
+ * Same shape as one entry of {@link gamePickGetActiveRounds}; cheaper when the
73
+ * UI only shows one round at a time.
74
+ *
75
+ * @remarks
76
+ * **Preconditions**
77
+ * - User must be authenticated. Visitor mode not supported.
78
+ * - `saw_template_id` and `round_id` are mandatory — the SDK throws if either
79
+ * is missing.
80
+ *
81
+ * **Error codes** (in `errCode`)
82
+ * - `0` — success.
83
+ * - `4` — round / event not found (e.g. round resolved after the last
84
+ * `gamePickGetActiveRounds` poll); non-fatal — retry after a fresh active-
85
+ * rounds fetch.
86
+ * - `100002` — template not found.
87
+ * - `100000` — auth hash invalid.
88
+ * - `100004` — generic server error.
89
+ *
90
+ * **Refresh**
91
+ * - No cache; every call is live.
92
+ * - Re-call after {@link gamePickSubmitSelection} or
93
+ * {@link gamePickSubmitSelectionQuiz} to surface the persisted predictions.
94
+ * - Poll while the user is on the prediction screen if event resolution
95
+ * updates are needed (typically every 30–60 s).
96
+ *
97
+ * **Visitor mode**: not supported.
98
+ *
99
+ * **UI guidance**: see [UI Guide — `gamePickGetActiveRound`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md).
100
+ *
101
+ * @param props.saw_template_id ID of the MatchX or Quiz game template.
102
+ * @param props.round_id ID of the round to fetch.
103
+ * @returns Wrapped {@link GamesApiResponse} of a single {@link GamePickRound}.
104
+ *
105
+ * @example
106
+ * ```ts
107
+ * const r = await window._smartico.api.gamePickGetActiveRound({
108
+ * saw_template_id: 1083,
109
+ * round_id: 31652,
110
+ * });
111
+ *
112
+ * if (r.errCode === 0 && r.data) {
113
+ * console.log('[smartico] render round detail page —', r.data.round_name, '— user has placed bet:', r.data.user_placed_bet, 'score so far:', r.data.user_score);
114
+ * } else {
115
+ * console.error('[smartico] round fetch failed — bounce back to the lobby and refresh:', r.errMessage);
116
+ * }
117
+ * ```
118
+ */
119
+ gamePickGetActiveRound(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRound>>;
120
+ /**
121
+ * Returns the full round history (active + resolved) for a MatchX or Quiz game
122
+ * template, newest-first. Each round carries the user's predictions plus the
123
+ * server-resolved outcome on each event.
124
+ *
125
+ * Use to power a "Past predictions" / history tab. For just the open rounds,
126
+ * use {@link gamePickGetActiveRounds} (faster — skips resolved data).
127
+ *
128
+ * @remarks
129
+ * **Preconditions**
130
+ * - User must be authenticated. Visitor mode not supported.
131
+ *
132
+ * **Sort order**
133
+ * Server returns rounds newest-first. No client-side sort needed.
134
+ *
135
+ * **Per-event resolution**
136
+ * Each event in the rounds carries `resolution_type_id` — values are from
137
+ * {@link GamePickResolutionType}: `None` (0, not yet resolved), `Lost` (2),
138
+ * `PartialWin` (3), `FullWin` (4). Use these to render result badges on
139
+ * each event row.
140
+ *
141
+ * **Error codes** (in `errCode`)
142
+ * - `0` — success.
143
+ * - `100002` — template not found.
144
+ * - `100000` — auth hash invalid.
145
+ * - `100004` — generic server error.
146
+ *
147
+ * **Refresh**
148
+ * - No cache.
149
+ * - No push subscription. Re-call when the user opens the history tab.
150
+ *
151
+ * **Visitor mode**: not supported.
152
+ *
153
+ * **UI guidance**: see [UI Guide — `gamePickGetHistory`](../../docs/ui/gamepick/UIGuide_gamePickGetHistory.md).
154
+ *
155
+ * @param props.saw_template_id ID of the MatchX or Quiz game template.
156
+ * @returns Wrapped {@link GamesApiResponse} of {@link GamePickRound} array,
157
+ * newest-first.
158
+ *
159
+ * @example
160
+ * ```ts
161
+ * const r = await window._smartico.api.gamePickGetHistory({ saw_template_id: 1083 });
162
+ *
163
+ * for (const round of r.data ?? []) {
164
+ * console.log('[smartico] history row —', round.round_name, 'score:', round.user_score, 'resolved:', round.is_resolved);
165
+ * }
166
+ * ```
167
+ */
168
+ gamePickGetHistory(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>;
169
+ /**
170
+ * Returns the leaderboard for a MatchX or Quiz game round — ranked list of
171
+ * players plus the current user's entry (`my_user`). Pass `round_id: -1` for
172
+ * the season / overall leaderboard across every round in the template.
173
+ *
174
+ * @remarks
175
+ * **Preconditions**
176
+ * - User must be authenticated. Visitor mode not supported.
177
+ *
178
+ * **`round_id` semantics**
179
+ * - Positive `round_id` — per-round leaderboard scoped to that round's events.
180
+ * - `-1` — season / overall leaderboard aggregating scores across every round
181
+ * of the template.
182
+ *
183
+ * **`my_user`**
184
+ * The current user's entry is returned separately from the `users[]` array
185
+ * — `my_user` may be `null` if the user has never made a prediction on this
186
+ * round / template. Use it to render the user's rank in a sticky footer or
187
+ * "you are here" highlight regardless of pagination.
188
+ *
189
+ * **Username masking**
190
+ * `public_username` on other players may be masked / anonymized by operator
191
+ * label settings. Always pair with `avatar_url` so the user can recognize
192
+ * themselves in the ranking by avatar even when usernames are hidden.
193
+ *
194
+ * **Error codes** (in `errCode`)
195
+ * - `0` — success.
196
+ * - `100002` — template not found.
197
+ * - `100000` — auth hash invalid.
198
+ * - `100004` — generic server error.
199
+ *
200
+ * **Refresh**
201
+ * - No cache.
202
+ * - No push subscription. Poll while the leaderboard is visible
203
+ * (every 30–60 s) if you want live rank updates after match
204
+ * resolution.
205
+ *
206
+ * **Visitor mode**: not supported.
207
+ *
208
+ * **UI guidance**: see [UI Guide — `gamePickGetBoard`](../../docs/ui/gamepick/UIGuide_gamePickGetBoard.md).
209
+ *
210
+ * @param props.saw_template_id ID of the MatchX or Quiz game template.
211
+ * @param props.round_id Round ID, or `-1` for the season leaderboard.
212
+ * @returns Wrapped {@link GamesApiResponse} of {@link GamePickRoundBoard}.
213
+ *
214
+ * @example
215
+ * ```ts
216
+ * const r = await window._smartico.api.gamePickGetBoard({
217
+ * saw_template_id: 1083,
218
+ * round_id: -1, // season leaderboard
219
+ * });
220
+ *
221
+ * if (r.errCode === 0 && r.data) {
222
+ * console.log('[smartico] render leaderboard rows for top', r.data.users.length, 'players');
223
+ * if (r.data.my_user) {
224
+ * console.log('[smartico] pin "you are rank #' + r.data.my_user.gp_position + '" footer to bottom');
225
+ * } else {
226
+ * console.log('[smartico] user not ranked — render "Play a round to join the leaderboard" CTA');
227
+ * }
228
+ * }
229
+ * ```
230
+ */
231
+ gamePickGetBoard(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRoundBoard>>;
232
+ /**
233
+ * Submits all score predictions for a round in a MatchX game in one shot.
234
+ * Each event in the round must carry `team1_user_selection` and
235
+ * `team2_user_selection` (the predicted scores).
236
+ *
237
+ * On the user's FIRST submit for a round, the server charges one buy-in (one
238
+ * "spin" / one currency deduction based on the template's `saw_buyin_type_id`).
239
+ * Subsequent edits within the same round are free and only persist changed
240
+ * selections.
241
+ *
242
+ * @remarks
243
+ * **Preconditions**
244
+ * - User must be authenticated. Visitor mode not supported.
245
+ * - `saw_template_id` and `props.round.round_id` are mandatory — SDK throws if
246
+ * either is missing.
247
+ * - Each event passed must include `gp_event_id` and the two
248
+ * `team{1,2}_user_selection` fields. Missing events default to "no change".
249
+ *
250
+ * **Error codes** (in `errCode`)
251
+ * - `0` — success; the response `data` is the updated round with
252
+ * `user_placed_bet === true` and `has_not_submitted_changes === false`.
253
+ * - `3` (`NoBetsUpdatedOnSubmit`) — submit produced no changes, OR every event
254
+ * is past its `last_bet_date` deadline. The buy-in is NOT consumed; the
255
+ * current round is still returned in `data`.
256
+ * - `4` — round / event not found; refresh state and retry.
257
+ * - `100002` — template not found.
258
+ * - `100000` — auth hash invalid.
259
+ * - `100004` — generic server error.
260
+ *
261
+ * Buy-in failures pass through the {@link SAWSpinErrorCode} values on first
262
+ * submit:
263
+ * - `40001` — no spins left (when `saw_buyin_type_id` is Spins).
264
+ * - `40003` — insufficient points.
265
+ * - `40004` — global max-spins cap hit.
266
+ * - `40007` — template outside its active date window.
267
+ * - `40009` — user excluded by segment rule.
268
+ * - `40011` — insufficient gems.
269
+ * - `40012` — insufficient diamonds.
270
+ *
271
+ * **Idempotency**
272
+ * Re-submitting identical selections returns `errCode: 3` (no changes); the
273
+ * buy-in is consumed exactly once per round-per-user. Re-submitting after
274
+ * `last_bet_date` also returns `errCode: 3` without consuming the buy-in.
275
+ *
276
+ * **Side effects**
277
+ * - First successful submit deducts the buy-in (Points / Gems / Diamonds /
278
+ * one Spin) per `saw_buyin_type_id`.
279
+ * - Reports a `minigame_matchx_prediction` event to the operator's event log.
280
+ * - Updates the round's participant counter (`users_cnt`) and per-event
281
+ * counters (`num_users`).
282
+ * - Score is awarded after the operator resolves the round
283
+ * ({@link GPRoundStatus} = `RoundResolved`).
284
+ *
285
+ * **Visitor mode**: not supported.
286
+ *
287
+ * **UI guidance**: see [UI Guide — `gamePickSubmitSelection`](../../docs/ui/gamepick/UIGuide_gamePickSubmitSelection.md).
288
+ *
289
+ * @param props.saw_template_id ID of the MatchX game template.
290
+ * @param props.round Round object with `round_id` + `events[]`
291
+ * carrying the user's score predictions.
292
+ * @returns Wrapped {@link GamesApiResponse} with the updated round.
293
+ *
294
+ * @example
295
+ * ```ts
296
+ * const ar = await window._smartico.api.gamePickGetActiveRound({
297
+ * saw_template_id: 1190,
298
+ * round_id: 38665,
299
+ * });
300
+ * if (ar.errCode !== 0 || !ar.data) {
301
+ * console.error('[smartico] could not fetch round to submit — show error and bounce back');
302
+ * return;
303
+ * }
304
+ *
305
+ * const round = ar.data;
306
+ * round.events = round.events.map(e => ({
307
+ * gp_event_id: e.gp_event_id,
308
+ * team1_user_selection: 1,
309
+ * team2_user_selection: 0,
310
+ * }));
311
+ *
312
+ * const r = await window._smartico.api.gamePickSubmitSelection({
313
+ * saw_template_id: 1190,
314
+ * round,
315
+ * });
316
+ *
317
+ * switch (r.errCode) {
318
+ * case 0:
319
+ * console.log('[smartico] predictions saved — show confirmation, refresh leaderboard');
320
+ * break;
321
+ * case 3:
322
+ * console.log('[smartico] nothing changed (or all events closed) — silent no-op');
323
+ * break;
324
+ * case 40001:
325
+ * case 40003:
326
+ * case 40011:
327
+ * case 40012:
328
+ * console.error('[smartico] insufficient balance / spins — show top-up CTA:', r.errMessage);
329
+ * break;
330
+ * default:
331
+ * console.error('[smartico] submit failed — show generic error toast:', r.errMessage);
332
+ * }
333
+ * ```
334
+ */
335
+ gamePickSubmitSelection(props: GamePickRequestParams & {
336
+ round: Partial<GamePickRound>;
337
+ }): Promise<GamesApiResponse<GamePickRound>>;
338
+ /**
339
+ * Submits all quiz answers for a round in one shot. Each event in the round
340
+ * must carry `user_selection` (the answer value — typically `"1"` / `"2"` /
341
+ * `"x"` for 1×2 markets, `"yes"` / `"no"` for binary markets, or any
342
+ * operator-defined string for custom markets).
343
+ *
344
+ * Same first-submit buy-in behavior as {@link gamePickSubmitSelection} — one
345
+ * buy-in is charged on the first successful submit; subsequent edits within
346
+ * the same round are free.
347
+ *
348
+ * @remarks
349
+ * **Preconditions**
350
+ * - User must be authenticated. Visitor mode not supported.
351
+ * - `saw_template_id` and `props.round.round_id` are mandatory — SDK throws if
352
+ * either is missing.
353
+ * - Each event must include `gp_event_id` and `user_selection`. Missing
354
+ * events default to "no change".
355
+ *
356
+ * **Error codes** (in `errCode`)
357
+ * - `0` — success.
358
+ * - `3` (`NoBetsUpdatedOnSubmit`) — no changes, OR every event past
359
+ * `last_bet_date`. Buy-in NOT consumed; current round returned in `data`.
360
+ * - `4` — round / event not found.
361
+ * - `100002` — template not found.
362
+ * - `100000` — auth hash invalid.
363
+ * - `100004` — generic server error.
364
+ *
365
+ * Buy-in failures use the same {@link SAWSpinErrorCode} pass-through values
366
+ * as {@link gamePickSubmitSelection} — see that method's TSDoc for the
367
+ * `40001` / `40003` / `40004` / `40007` / `40009` / `40011` / `40012`
368
+ * semantics.
369
+ *
370
+ * **Idempotency**: identical to {@link gamePickSubmitSelection} — re-submit
371
+ * returns `errCode: 3` and never double-charges the buy-in.
372
+ *
373
+ * **Side effects**: identical to {@link gamePickSubmitSelection}, with the
374
+ * reported event being `minigame_quiz_prediction` instead of
375
+ * `minigame_matchx_prediction`.
376
+ *
377
+ * **Visitor mode**: not supported.
378
+ *
379
+ * **UI guidance**: see [UI Guide — `gamePickSubmitSelectionQuiz`](../../docs/ui/gamepick/UIGuide_gamePickSubmitSelectionQuiz.md).
380
+ *
381
+ * @param props.saw_template_id ID of the Quiz game template.
382
+ * @param props.round Round object with `round_id` + `events[]`
383
+ * carrying the user's answer selections.
384
+ * @returns Wrapped {@link GamesApiResponse} with the updated round.
385
+ *
386
+ * @example
387
+ * ```ts
388
+ * const ar = await window._smartico.api.gamePickGetActiveRound({
389
+ * saw_template_id: 1183,
390
+ * round_id: 37974,
391
+ * });
392
+ * if (ar.errCode !== 0 || !ar.data) {
393
+ * console.error('[smartico] could not fetch round to submit answers — show error');
394
+ * return;
395
+ * }
396
+ *
397
+ * const round = ar.data;
398
+ * round.events = round.events.map(e => ({
399
+ * gp_event_id: e.gp_event_id,
400
+ * user_selection: 'x',
401
+ * }));
402
+ *
403
+ * const r = await window._smartico.api.gamePickSubmitSelectionQuiz({
404
+ * saw_template_id: 1183,
405
+ * round,
406
+ * });
407
+ *
408
+ * if (r.errCode === 0) {
409
+ * console.log('[smartico] quiz answers saved — show confirmation');
410
+ * } else if (r.errCode === 3) {
411
+ * console.log('[smartico] nothing changed — silent no-op');
412
+ * } else {
413
+ * console.error('[smartico] quiz submit failed:', r.errMessage);
414
+ * }
415
+ * ```
416
+ */
417
+ gamePickSubmitSelectionQuiz(props: GamePickRequestParams & {
418
+ round: Partial<GamePickRound>;
419
+ }): Promise<GamesApiResponse<GamePickRound>>;
420
+ /**
421
+ * Returns the current user's profile within the Game Pick system — display
422
+ * name, avatar, balances, and last wallet-sync timestamp. The Game Pick server
423
+ * maintains its own user record that mirrors the user's Smartico balances; the
424
+ * mirror is updated at most once per minute, so `last_wallet_sync_time` tells
425
+ * the consumer how stale the balances on the response are.
426
+ *
427
+ * On the user's first call for a given game, the Game Pick server lazily
428
+ * provisions a user record — so this method doubles as a "register the user
429
+ * with this game" call.
430
+ *
431
+ * @remarks
432
+ * **Preconditions**
433
+ * - User must be authenticated. Visitor mode not supported.
434
+ *
435
+ * **Balance freshness**
436
+ * The balances returned here are the cached mirror — at most ~1 minute stale.
437
+ * For an up-to-the-second view of Points / Gems / Diamonds, read from
438
+ * {@link getUserProfile} instead. Use this method's balances only for
439
+ * in-Game-Pick display.
440
+ *
441
+ * **Error codes** (in `errCode`)
442
+ * - `0` — success.
443
+ * - `100002` — template not found.
444
+ * - `100000` — auth hash invalid.
445
+ * - `100004` — generic server error.
446
+ *
447
+ * **Refresh**
448
+ * - No cache. Server-side mirror refreshes at most every 60 s.
449
+ * - No push subscription.
450
+ *
451
+ * **Visitor mode**: not supported.
452
+ *
453
+ * **UI guidance**: see [UI Guide — `gamePickGetUserInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md).
454
+ *
455
+ * @param props.saw_template_id ID of the MatchX or Quiz game template.
456
+ * @returns Wrapped {@link GamesApiResponse} of {@link GamePickUserInfo}.
457
+ *
458
+ * @example
459
+ * ```ts
460
+ * const r = await window._smartico.api.gamePickGetUserInfo({ saw_template_id: 1083 });
461
+ *
462
+ * if (r.errCode === 0 && r.data) {
463
+ * console.log('[smartico] render Game Pick header — name:', r.data.public_username, '— points:', r.data.ach_points_balance, '— synced:', r.data.last_wallet_sync_time);
464
+ * }
465
+ * ```
466
+ */
467
+ gamePickGetUserInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickUserInfo>>;
468
+ /**
469
+ * Returns the game template configuration plus a metadata listing of every
470
+ * round (without events). Use to power the game's welcome / lobby screen —
471
+ * shows the template name, buy-in cost, the user's remaining attempts, and
472
+ * the full round list.
473
+ *
474
+ * The `allRounds[]` here is a lightweight metadata-only view — to render
475
+ * predictions or leaderboards, call {@link gamePickGetActiveRound} /
476
+ * {@link gamePickGetActiveRounds} / {@link gamePickGetBoard} for the rounds
477
+ * the user actually opens.
478
+ *
479
+ * @remarks
480
+ * **Preconditions**
481
+ * - User must be authenticated. Visitor mode not supported.
482
+ *
483
+ * **Buy-in semantics**
484
+ * The `sawTemplate.saw_buyin_type_id` value determines which currency is
485
+ * deducted on the user's first prediction in any round:
486
+ * - Free — no deduction.
487
+ * - Points — `buyin_cost_points` deducted from the user's points balance.
488
+ * - Gems — deducted from the user's gems balance.
489
+ * - Diamonds — deducted from the user's diamonds balance.
490
+ * - Spins — one spin counted from `spin_count`.
491
+ *
492
+ * **Error codes** (in `errCode`)
493
+ * - `0` — success.
494
+ * - `100002` — template not found.
495
+ * - `100000` — auth hash invalid.
496
+ * - `100004` — generic server error.
497
+ *
498
+ * **Refresh**
499
+ * - No cache.
500
+ * - No push subscription. Re-call after a successful
501
+ * {@link gamePickSubmitSelection} to refresh `spin_count`.
502
+ *
503
+ * **Visitor mode**: not supported.
504
+ *
505
+ * **UI guidance**: see [UI Guide — `gamePickGetGameInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md).
506
+ *
507
+ * @param props.saw_template_id ID of the MatchX or Quiz game template.
508
+ * @returns Wrapped {@link GamesApiResponse} of {@link GamePickGameInfo}.
509
+ *
510
+ * @example
511
+ * ```ts
512
+ * const r = await window._smartico.api.gamePickGetGameInfo({ saw_template_id: 1189 });
513
+ *
514
+ * if (r.errCode === 0 && r.data) {
515
+ * console.log('[smartico] render Game Pick lobby — title:', r.data.sawTemplate.saw_template_ui_definition.name);
516
+ * console.log('[smartico] rounds available:', r.data.allRounds.length, '— buy-in type:', r.data.sawTemplate.saw_buyin_type_id, 'cost:', r.data.sawTemplate.buyin_cost_points);
517
+ * }
518
+ * ```
519
+ */
520
+ gamePickGetGameInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickGameInfo>>;
521
+ /**
522
+ * Returns a round with another player's predictions instead of the current
523
+ * user's. The target player is identified by `int_user_id` (the Game Pick
524
+ * system's internal user ID, obtained from {@link gamePickGetBoard}'s
525
+ * `users[].int_user_id`).
526
+ *
527
+ * Use to power "view this player's picks" affordances opened from leaderboard
528
+ * rows — community / social inspection of how a top-ranked user predicted.
529
+ *
530
+ * @remarks
531
+ * **Preconditions**
532
+ * - User must be authenticated. Visitor mode not supported.
533
+ * - `saw_template_id`, `round_id`, and `int_user_id` are all mandatory — SDK
534
+ * throws synchronously if any is missing.
535
+ * - `int_user_id` must come from a leaderboard fetch in the same game
536
+ * template; it is stable within a template but not portable across
537
+ * templates.
538
+ *
539
+ * **Shape vs `gamePickGetActiveRound`**
540
+ * Same {@link GamePickRound} structure, but `user_selection` /
541
+ * `team1_user_selection` / `team2_user_selection` reflect the TARGET user's
542
+ * predictions instead of the caller's. Each event still carries its own
543
+ * `resolution_type_id` (see {@link GamePickResolutionType}) so the UI can
544
+ * render result badges per pick.
545
+ *
546
+ * **Error codes** (in `errCode`)
547
+ * - `0` — success.
548
+ * - `4` — round / event / user not found.
549
+ * - `100002` — template not found.
550
+ * - `100000` — auth hash invalid.
551
+ * - `100004` — generic server error.
552
+ *
553
+ * **Refresh**
554
+ * - No cache. Re-call when opening a different leaderboard row's
555
+ * "view picks" modal.
556
+ * - No push subscription.
557
+ *
558
+ * **Visitor mode**: not supported.
559
+ *
560
+ * **UI guidance**: see [UI Guide — `gamePickGetRoundInfoForUser`](../../docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md).
561
+ *
562
+ * @param props.saw_template_id ID of the MatchX or Quiz game template.
563
+ * @param props.round_id ID of the round to inspect.
564
+ * @param props.int_user_id Internal user ID from
565
+ * `gamePickGetBoard.users[].int_user_id`.
566
+ * @returns Wrapped {@link GamesApiResponse} with the target user's
567
+ * {@link GamePickRound}.
568
+ *
569
+ * @example
570
+ * ```ts
571
+ * const board = await window._smartico.api.gamePickGetBoard({
572
+ * saw_template_id: 1083, round_id: 31652,
573
+ * });
574
+ * const topPlayer = board.data?.users?.[0];
575
+ * if (!topPlayer) return;
576
+ *
577
+ * const r = await window._smartico.api.gamePickGetRoundInfoForUser({
578
+ * saw_template_id: 1083,
579
+ * round_id: 31652,
580
+ * int_user_id: topPlayer.int_user_id,
581
+ * });
582
+ *
583
+ * if (r.errCode === 0 && r.data) {
584
+ * for (const ev of r.data.events) {
585
+ * console.log('[smartico] render row —', ev.event_meta.team1_name, 'vs', ev.event_meta.team2_name, '— picked:', ev.user_selection, '— resolution:', ev.resolution_type_id);
586
+ * }
587
+ * }
588
+ * ```
589
+ */
590
+ gamePickGetRoundInfoForUser(props: GamePickRoundRequestParams & {
591
+ int_user_id: number;
592
+ }): Promise<GamesApiResponse<GamePickRound>>;
593
+ }