@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
@@ -3,304 +3,589 @@ import { WSAPIAvatars } from './WSAPIAvatars';
3
3
  /** @group GamePick */
4
4
  export declare class WSAPIGamePick extends WSAPIAvatars {
5
5
  /**
6
- * Returns the active rounds for the specified MatchX or Quiz game.
7
- * Each round includes its events (matches/questions) along with the current user's selections and scores.
8
- *
9
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
10
- *
11
- * **Response** `GamesApiResponse<GamePickRound[]>`:
12
- * - `errCode` - 0 on success
13
- * - `data` - Array of rounds, each containing:
14
- * - `round_id`, `round_name` - Round identifier and display name
15
- * - `open_date`, `last_bet_date` - Timestamps (ms) for round open and betting deadline
16
- * - `is_active_now`, `is_resolved` - Round state flags
17
- * - `round_status_id` - Round status: -1 (active), 2 (no more bets), 3 (all events resolved), 4 (round resolved)
18
- * - `score_full_win`, `score_part_win`, `score_lost` - Scoring rules per prediction outcome
19
- * - `user_score` - Current user's total score in this round
20
- * - `user_placed_bet` - Whether the user has submitted predictions
21
- * - `has_open_for_bet_events` - Whether there are events still open for betting
22
- * - `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
23
- *
24
- * **Example**:
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
+ * }
25
64
  * ```
26
- * _smartico.api.gamePickGetActiveRounds({
27
- * saw_template_id: 1083,
28
- * }).then((result) => {
29
- * console.log(result.data); // GamePickRound[]
30
- * result.data.forEach(round => {
31
- * console.log(round.round_name, round.events.length);
32
- * });
33
- * });
34
- * ```
35
- *
36
- * **Visitor mode: not supported**
37
65
  */
38
66
  gamePickGetActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>;
39
67
  /**
40
- * Returns a single active round for the specified MatchX or Quiz game.
41
- * The round includes full event details with the current user's selections.
42
- *
43
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
44
- * @param props.round_id - The specific round to retrieve
45
- *
46
- * **Response** `GamesApiResponse<GamePickRound>`:
47
- * - `errCode` - 0 on success
48
- * - `data` - Single round object with the same structure as in `gamePickGetActiveRounds`,
49
- * including `events[]` with full event details, user selections, and resolution info
50
- *
51
- * **Example**:
52
- * ```
53
- * _smartico.api.gamePickGetActiveRound({
54
- * saw_template_id: 1083,
55
- * round_id: 31652,
56
- * }).then((result) => {
57
- * console.log(result.data.round_name, result.data.events.length);
58
- * console.log(result.data.user_score, result.data.user_placed_bet);
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,
59
110
  * });
60
- * ```
61
111
  *
62
- * **Visitor mode: not supported**
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
+ * ```
63
118
  */
64
119
  gamePickGetActiveRound(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRound>>;
65
120
  /**
66
- * Returns the history of all rounds (including resolved ones) for the specified MatchX or Quiz game.
67
- * Each round contains full event details with results and the current user's predictions.
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.
68
124
  *
69
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
125
+ * Use to power a "Past predictions" / history tab. For just the open rounds,
126
+ * use {@link gamePickGetActiveRounds} (faster — skips resolved data).
70
127
  *
71
- * **Response** `GamesApiResponse<GamePickRound[]>`:
72
- * - `errCode` - 0 on success
73
- * - `data` - Array of rounds ordered by `round_row_id` descending (newest first).
74
- * Each round has the same structure as in `gamePickGetActiveRounds`, including resolved events
75
- * with `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) and `resolution_score`
128
+ * @remarks
129
+ * **Preconditions**
130
+ * - User must be authenticated. Visitor mode not supported.
76
131
  *
77
- * **Example**:
78
- * ```
79
- * _smartico.api.gamePickGetHistory({
80
- * saw_template_id: 1083,
81
- * }).then((result) => {
82
- * result.data.forEach(round => {
83
- * console.log(round.round_name, 'Score:', round.user_score, 'Resolved:', round.is_resolved);
84
- * });
85
- * });
86
- * ```
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.
87
152
  *
88
- * **Visitor mode: not supported**
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
+ * ```
89
167
  */
90
168
  gamePickGetHistory(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>;
91
169
  /**
92
- * Returns the leaderboard for a specific round within a MatchX or Quiz game.
93
- * Use `round_id = -1` (AllRoundsGameBoardID) to get the season/overall leaderboard across all rounds.
94
- *
95
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
96
- * @param props.round_id - The round to get the leaderboard for. Use -1 for overall/seasonal leaderboard
97
- *
98
- * **Response** `GamesApiResponse<GamePickRoundBoard>`:
99
- * - `errCode` - 0 on success
100
- * - `data` - Leaderboard object containing:
101
- * - Round base fields (`round_id`, `round_name`, `open_date`, `last_bet_date`, etc.)
102
- * - `users[]` - Ranked list of players, each with:
103
- * - `ext_user_id`, `int_user_id` - User identifiers
104
- * - `public_username`, `avatar_url` - Display info (usernames may be masked based on label settings)
105
- * - `gp_position` - Leaderboard rank (null if not yet ranked)
106
- * - `resolution_score` - Total score in this round
107
- * - `full_wins_count`, `part_wins_count`, `lost_count` - Prediction outcome counts
108
- * - `my_user` - Current user's entry (same fields as above), or null if user hasn't participated
109
- *
110
- * **Example**:
111
- * ```
112
- * _smartico.api.gamePickGetBoard({
113
- * saw_template_id: 1083,
114
- * round_id: 31652,
115
- * }).then((result) => {
116
- * console.log('Top players:', result.data.users);
117
- * console.log('My position:', result.data.my_user?.gp_position);
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
118
219
  * });
119
- * ```
120
220
  *
121
- * **Visitor mode: not supported**
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
+ * ```
122
230
  */
123
231
  gamePickGetBoard(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRoundBoard>>;
124
232
  /**
125
- * Submits score predictions for a round in a MatchX game.
126
- * Sends the round object with user selections for all events at once.
127
- * Each event must include `team1_user_selection` and `team2_user_selection` representing predicted scores.
128
- * If the user hasn't placed bets before, one game attempt (spin) will be consumed.
129
- * Predictions can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
130
- *
131
- * @param props.saw_template_id - The ID of the MatchX game template
132
- * @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
133
- * and modified with user predictions. Each event needs: `gp_event_id`, `team1_user_selection`, `team2_user_selection`
134
- *
135
- * **Response** `GamesApiResponse<GamePickRound>`:
136
- * - `errCode` - 0 on success. Non-zero codes indicate errors (e.g. not enough points/attempts)
137
- * - `data` - Updated round with all events reflecting the submitted selections.
138
- * `user_placed_bet` will be `true`, `has_not_submitted_changes` will be `false`
139
- *
140
- * **Example**:
141
- * ```
142
- * _smartico.api.gamePickGetActiveRound({
143
- * saw_template_id: 1190,
144
- * round_id: 38665,
145
- * }).then((roundData) => {
146
- * const round = roundData.data;
147
- * round.events = round.events.map(e => ({
148
- * gp_event_id: e.gp_event_id,
149
- * team1_user_selection: 1,
150
- * team2_user_selection: 0,
151
- * }));
152
- * _smartico.api.gamePickSubmitSelection({
153
- * saw_template_id: 1190,
154
- * round: round,
155
- * }).then((result) => {
156
- * console.log(result.data.user_placed_bet); // true
157
- * });
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,
158
315
  * });
159
- * ```
160
316
  *
161
- * **Visitor mode: not supported**
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
+ * ```
162
334
  */
163
335
  gamePickSubmitSelection(props: GamePickRequestParams & {
164
336
  round: Partial<GamePickRound>;
165
337
  }): Promise<GamesApiResponse<GamePickRound>>;
166
338
  /**
167
- * Submits answers for a round in a Quiz game.
168
- * Sends the round object with user answers for all events at once.
169
- * Each event must include `user_selection` with the answer value (e.g. '1', '2', 'x', 'yes', 'no' — depending on the market type).
170
- * If the user hasn't placed bets before, one game attempt (spin) will be consumed.
171
- * Answers can be edited until each match starts (if `allow_edit_answers` is enabled on the round).
172
- *
173
- * @param props.saw_template_id - The ID of the Quiz game template
174
- * @param props.round - Round object containing `round_id` and `events[]`. Typically obtained from `gamePickGetActiveRound`
175
- * and modified with user answers. Each event needs: `gp_event_id`, `user_selection`
176
- *
177
- * **Response** `GamesApiResponse<GamePickRound>`:
178
- * - `errCode` - 0 on success. Non-zero codes indicate errors (e.g. not enough points/attempts)
179
- * - `data` - Updated round with all events reflecting the submitted answers.
180
- * `user_placed_bet` will be `true`, `has_not_submitted_changes` will be `false`
181
- *
182
- * **Example**:
183
- * ```
184
- * _smartico.api.gamePickGetActiveRound({
185
- * saw_template_id: 1183,
186
- * round_id: 37974,
187
- * }).then((roundData) => {
188
- * const round = roundData.data;
189
- * round.events = round.events.map(e => ({
190
- * gp_event_id: e.gp_event_id,
191
- * user_selection: 'x',
192
- * }));
193
- * _smartico.api.gamePickSubmitSelectionQuiz({
194
- * saw_template_id: 1183,
195
- * round: round,
196
- * }).then((result) => {
197
- * console.log(result.data.user_placed_bet); // true
198
- * });
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,
199
406
  * });
200
- * ```
201
407
  *
202
- * **Visitor mode: not supported**
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
+ * ```
203
416
  */
204
417
  gamePickSubmitSelectionQuiz(props: GamePickRequestParams & {
205
418
  round: Partial<GamePickRound>;
206
419
  }): Promise<GamesApiResponse<GamePickRound>>;
207
420
  /**
208
- * Returns the current user's profile information within the specified MatchX or Quiz game.
209
- * The user record is synced from the Smartico platform into the games DB (synced every 1 minute).
210
- * If the user doesn't exist in the games DB yet, it will be created automatically on first call.
211
- *
212
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
213
- *
214
- * **Response** `GamesApiResponse<GamePickUserInfo>`:
215
- * - `errCode` - 0 on success
216
- * - `data`:
217
- * - `ext_user_id` - External user ID (Smartico internal numeric ID)
218
- * - `int_user_id` - Internal user ID within the games system
219
- * - `public_username` - Display name
220
- * - `avatar_url` - User's avatar image URL
221
- * - `last_wallet_sync_time` - Last time the user's balance was synced from Smartico
222
- * - `ach_points_balance` - User's current points balance
223
- * - `ach_gems_balance` - User's current gems balance
224
- * - `ach_diamonds_balance` - User's current diamonds balance
225
- * - `pubic_username_set` - Whether the user has set a custom username
226
- *
227
- * **Example**:
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
+ * }
228
465
  * ```
229
- * _smartico.api.gamePickGetUserInfo({
230
- * saw_template_id: 1083,
231
- * }).then((result) => {
232
- * console.log(result.data.public_username, result.data.ach_points_balance);
233
- * });
234
- * ```
235
- *
236
- * **Visitor mode: not supported**
237
466
  */
238
467
  gamePickGetUserInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickUserInfo>>;
239
468
  /**
240
- * Returns the game configuration and the list of all rounds for the specified MatchX or Quiz game.
241
- * Includes the SAW template definition, label settings, and round metadata (without events).
242
- *
243
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
244
- *
245
- * **Response** `GamesApiResponse<GamePickGameInfo>`:
246
- * - `errCode` - 0 on success
247
- * - `data`:
248
- * - `sawTemplate` - Game template configuration including:
249
- * - `saw_template_id`, `saw_game_type_id` (6 = MatchX/Quiz)
250
- * - `saw_template_ui_definition` - UI settings (name, ranking options, ask_for_username, etc.)
251
- * - `saw_buyin_type_id` - Cost type (1=Free, 2=Points, 3=Gems, 4=Diamonds, 5=Spins)
252
- * - `buyin_cost_points` - Cost per attempt
253
- * - `spin_count` - Available attempts for the current user
254
- * - `allRounds[]` - List of all rounds (metadata only, no events), each with:
255
- * - `round_id`, `round_name`, `round_description`
256
- * - `open_date`, `last_bet_date` - Timestamps (ms)
257
- * - `is_active_now`, `is_resolved`, `round_status_id`
258
- * - `labelInfo` - Label/brand configuration and settings
259
- *
260
- * **Example**:
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
+ * }
261
518
  * ```
262
- * _smartico.api.gamePickGetGameInfo({
263
- * saw_template_id: 1189,
264
- * }).then((result) => {
265
- * console.log(result.data.sawTemplate.saw_template_ui_definition.name);
266
- * console.log('Rounds:', result.data.allRounds.length);
267
- * console.log('Buy-in type:', result.data.sawTemplate.saw_buyin_type_id);
268
- * });
269
- * ```
270
- *
271
- * **Visitor mode: not supported**
272
519
  */
273
520
  gamePickGetGameInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickGameInfo>>;
274
521
  /**
275
- * Returns round data with events and picks for a specific user (identified by their internal user ID).
276
- * Useful for viewing another user's predictions from the leaderboard.
277
- * The `int_user_id` can be obtained from the `gamePickGetBoard` response (`users[].int_user_id`).
278
- *
279
- * @param props.saw_template_id - The ID of the MatchX or Quiz game template
280
- * @param props.round_id - The round to get info for
281
- * @param props.int_user_id - Internal user ID of the player whose predictions to view (from leaderboard data)
282
- *
283
- * **Response** `GamesApiResponse<GamePickRound>`:
284
- * - `errCode` - 0 on success
285
- * - `data` - Round object with the target user's selections.
286
- * Same structure as `gamePickGetActiveRound`, but `user_selection`/`team1_user_selection`/`team2_user_selection`
287
- * fields on events reflect the specified user's picks instead of the current user's.
288
- * Events also include `resolution_type_id` (0=None, 2=Lost, 3=PartialWin, 4=FullWin) showing how each prediction was scored
289
- *
290
- * **Example**:
291
- * ```
292
- * _smartico.api.gamePickGetRoundInfoForUser({
293
- * saw_template_id: 1083,
294
- * round_id: 31652,
295
- * int_user_id: 65653810,
296
- * }).then((result) => {
297
- * result.data.events.forEach(e => {
298
- * console.log(e.event_meta.team1_name, 'vs', e.event_meta.team2_name, '→', e.user_selection);
299
- * });
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,
300
573
  * });
301
- * ```
574
+ * const topPlayer = board.data?.users?.[0];
575
+ * if (!topPlayer) return;
302
576
  *
303
- * **Visitor mode: not supported**
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
+ * ```
304
589
  */
305
590
  gamePickGetRoundInfoForUser(props: GamePickRoundRequestParams & {
306
591
  int_user_id: number;