@smartico/public-api 0.0.380 → 0.0.382

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