@smartico/public-api 0.0.402 → 0.0.404

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 (153) hide show
  1. package/.claude/skills/api-tsdoc/SKILL.md +675 -0
  2. package/.claude/skills/api-tsdoc-final/SKILL.md +266 -0
  3. package/.claude/skills/api-tsdoc-howto/SKILL.md +143 -0
  4. package/dist/MiniGames/SAWTemplate.d.ts +4 -0
  5. package/dist/NodeCache.d.ts +1 -0
  6. package/dist/OCache.d.ts +7 -0
  7. package/dist/SmarticoGlobal.d.ts +0 -6
  8. package/dist/WSAPI/WSAPITypes.d.ts +43 -0
  9. package/dist/WSAPI/WSAPIUser.d.ts +3 -0
  10. package/dist/index.js +92 -33
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.modern.mjs +60 -10
  13. package/dist/index.modern.mjs.map +1 -1
  14. package/docs/api/interfaces/TUserProfile.md +136 -0
  15. package/docs/capabilities/_responses/buyStoreItem.json +4 -0
  16. package/docs/capabilities/_responses/claimBonus.json +4 -0
  17. package/docs/capabilities/_responses/gamePickGetActiveRound.json +95 -0
  18. package/docs/capabilities/_responses/gamePickGetActiveRounds.json +191 -0
  19. package/docs/capabilities/_responses/gamePickGetBoard.json +47 -0
  20. package/docs/capabilities/_responses/gamePickGetGameInfo.json +355 -0
  21. package/docs/capabilities/_responses/gamePickGetHistory.json +191 -0
  22. package/docs/capabilities/_responses/gamePickGetUserInfo.json +14 -0
  23. package/docs/capabilities/_responses/getAchCategories.json +12 -0
  24. package/docs/capabilities/_responses/getActivityLog.json +1 -0
  25. package/docs/capabilities/_responses/getAvatarPrompts.json +16 -0
  26. package/docs/capabilities/_responses/getAvatarsCustomized.json +12 -0
  27. package/docs/capabilities/_responses/getAvatarsList.json +24 -0
  28. package/docs/capabilities/_responses/getBadges.json +98 -0
  29. package/docs/capabilities/_responses/getBonuses.json +18 -0
  30. package/docs/capabilities/_responses/getClanInfo.json +39 -0
  31. package/docs/capabilities/_responses/getClans.json +35 -0
  32. package/docs/capabilities/_responses/getCurrentLevel.json +20 -0
  33. package/docs/capabilities/_responses/getCustomSections.json +25 -0
  34. package/docs/capabilities/_responses/getInboxMessageBody.json +7 -0
  35. package/docs/capabilities/_responses/getInboxMessages.json +18 -0
  36. package/docs/capabilities/_responses/getInboxUnreadCount.json +1 -0
  37. package/docs/capabilities/_responses/getJackpotEligibleGames.json +20 -0
  38. package/docs/capabilities/_responses/getJackpotWinners.json +28 -0
  39. package/docs/capabilities/_responses/getLeaderBoard.json +45 -0
  40. package/docs/capabilities/_responses/getLevels.json +40 -0
  41. package/docs/capabilities/_responses/getMiniGames.json +208 -0
  42. package/docs/capabilities/_responses/getMiniGamesHistory.json +1 -0
  43. package/docs/capabilities/_responses/getMissions.json +117 -0
  44. package/docs/capabilities/_responses/getRaffleDrawRun.json +62 -0
  45. package/docs/capabilities/_responses/getRaffleDrawRunsHistory.json +34 -0
  46. package/docs/capabilities/_responses/getRaffles.json +140 -0
  47. package/docs/capabilities/_responses/getStoreCategories.json +12 -0
  48. package/docs/capabilities/_responses/getStoreItems.json +47 -0
  49. package/docs/capabilities/_responses/getStorePurchasedItems.json +49 -0
  50. package/docs/capabilities/_responses/getTournamentInstanceInfo.json +75 -0
  51. package/docs/capabilities/_responses/getTournamentsList.json +66 -0
  52. package/docs/capabilities/_responses/getTranslations.json +25 -0
  53. package/docs/capabilities/_responses/getUserLevelExtraCounters.json +4 -0
  54. package/docs/capabilities/_responses/getUserProfile.json +34 -0
  55. package/docs/capabilities/_responses/jackpotGet.json +113 -0
  56. package/docs/capabilities/_responses/jackpotOptIn.json +9 -0
  57. package/docs/capabilities/_responses/jackpotOptOut.json +9 -0
  58. package/docs/capabilities/_responses/markAllInboxMessagesAsRead.json +4 -0
  59. package/docs/capabilities/_responses/markInboxMessageAsRead.json +4 -0
  60. package/docs/capabilities/_responses/markUnmarkInboxMessageAsFavorite.json +4 -0
  61. package/docs/capabilities/_responses/miniGameWinAcknowledgeRequest.json +10 -0
  62. package/docs/capabilities/_responses/playMiniGame.json +6 -0
  63. package/docs/capabilities/_responses/playMiniGameBatch.json +9 -0
  64. package/docs/capabilities/_responses/registerInTournament.json +4 -0
  65. package/docs/capabilities/_responses/requestMissionOptIn.json +4 -0
  66. package/docs/capabilities/_responses/setAvatar.json +4 -0
  67. package/docs/capabilities/avatarsCustomize.md +115 -0
  68. package/docs/capabilities/buyStoreItem.md +179 -0
  69. package/docs/capabilities/checkSegmentListMatch.md +69 -0
  70. package/docs/capabilities/checkSegmentMatch.md +74 -0
  71. package/docs/capabilities/claimBonus.md +125 -0
  72. package/docs/capabilities/claimRafflePrize.md +116 -0
  73. package/docs/capabilities/deleteAllInboxMessages.md +66 -0
  74. package/docs/capabilities/deleteInboxMessage.md +60 -0
  75. package/docs/capabilities/gamePickGetActiveRound.md +248 -0
  76. package/docs/capabilities/gamePickGetActiveRounds.md +259 -0
  77. package/docs/capabilities/gamePickGetBoard.md +202 -0
  78. package/docs/capabilities/gamePickGetGameInfo.md +318 -0
  79. package/docs/capabilities/gamePickGetHistory.md +244 -0
  80. package/docs/capabilities/gamePickGetRoundInfoForUser.md +189 -0
  81. package/docs/capabilities/gamePickGetUserInfo.md +91 -0
  82. package/docs/capabilities/gamePickSubmitSelection.md +222 -0
  83. package/docs/capabilities/gamePickSubmitSelectionQuiz.md +198 -0
  84. package/docs/capabilities/getAchCategories.md +119 -0
  85. package/docs/capabilities/getActivityLog.md +108 -0
  86. package/docs/capabilities/getAvatarPrompts.md +81 -0
  87. package/docs/capabilities/getAvatarsCustomized.md +96 -0
  88. package/docs/capabilities/getAvatarsList.md +101 -0
  89. package/docs/capabilities/getBadges.md +237 -0
  90. package/docs/capabilities/getBonuses.md +159 -0
  91. package/docs/capabilities/getClanInfo.md +164 -0
  92. package/docs/capabilities/getClanTournamentPlayers.md +112 -0
  93. package/docs/capabilities/getClans.md +168 -0
  94. package/docs/capabilities/getCurrentLevel.md +123 -0
  95. package/docs/capabilities/getCustomSections.md +96 -0
  96. package/docs/capabilities/getInboxMessageBody.md +87 -0
  97. package/docs/capabilities/getInboxMessages.md +146 -0
  98. package/docs/capabilities/getInboxUnreadCount.md +54 -0
  99. package/docs/capabilities/getJackpotEligibleGames.md +93 -0
  100. package/docs/capabilities/getJackpotWinners.md +113 -0
  101. package/docs/capabilities/getLeaderBoard.md +187 -0
  102. package/docs/capabilities/getLeaderBoards.md +88 -0
  103. package/docs/capabilities/getLevels.md +118 -0
  104. package/docs/capabilities/getMiniGames.md +295 -0
  105. package/docs/capabilities/getMiniGamesHistory.md +183 -0
  106. package/docs/capabilities/getMissions.md +253 -0
  107. package/docs/capabilities/getRaffleDrawRun.md +210 -0
  108. package/docs/capabilities/getRaffleDrawRunsHistory.md +116 -0
  109. package/docs/capabilities/getRaffleWonPrizes.md +153 -0
  110. package/docs/capabilities/getRaffles.md +249 -0
  111. package/docs/capabilities/getRelatedItemsForGame.md +236 -0
  112. package/docs/capabilities/getStoreCategories.md +128 -0
  113. package/docs/capabilities/getStoreItems.md +260 -0
  114. package/docs/capabilities/getStorePurchasedItems.md +280 -0
  115. package/docs/capabilities/getTournamentInstanceInfo.md +301 -0
  116. package/docs/capabilities/getTournamentsList.md +234 -0
  117. package/docs/capabilities/getTranslations.md +95 -0
  118. package/docs/capabilities/getUserLevelExtraCounters.md +92 -0
  119. package/docs/capabilities/getUserProfile.md +184 -0
  120. package/docs/capabilities/jackpotGet.md +173 -0
  121. package/docs/capabilities/jackpotOptIn.md +94 -0
  122. package/docs/capabilities/jackpotOptOut.md +92 -0
  123. package/docs/capabilities/joinClan.md +169 -0
  124. package/docs/capabilities/markAllInboxMessagesAsRead.md +72 -0
  125. package/docs/capabilities/markInboxMessageAsRead.md +69 -0
  126. package/docs/capabilities/markUnmarkInboxMessageAsFavorite.md +75 -0
  127. package/docs/capabilities/miniGameWinAcknowledgeRequest.md +98 -0
  128. package/docs/capabilities/playMiniGame.md +217 -0
  129. package/docs/capabilities/playMiniGameBatch.md +129 -0
  130. package/docs/capabilities/registerInTournament.md +187 -0
  131. package/docs/capabilities/reportClickEvent.md +74 -0
  132. package/docs/capabilities/reportImpressionEvent.md +67 -0
  133. package/docs/capabilities/requestMissionClaimReward.md +117 -0
  134. package/docs/capabilities/requestMissionOptIn.md +98 -0
  135. package/docs/capabilities/requestRaffleOptin.md +108 -0
  136. package/docs/capabilities/setAvatar.md +132 -0
  137. package/docs/capabilities/smarticoCallbacks.md +165 -0
  138. package/docs/capabilities/smarticoGlobal.md +62 -0
  139. package/package.json +3 -2
  140. package/readme-smartico-dev.md +208 -0
  141. package/scripts/capture-responses-browser.mjs +301 -0
  142. package/scripts/gen-capabilities.js +368 -0
  143. package/scripts/run-public-api.mjs +105 -0
  144. package/src/MiniGames/SAWGetTemplatesResponse.ts +2 -0
  145. package/src/MiniGames/SAWTemplate.ts +5 -0
  146. package/src/NodeCache.ts +8 -0
  147. package/src/OCache.ts +17 -0
  148. package/src/SmarticoGlobal.ts +0 -7
  149. package/src/WSAPI/WSAPI.ts +3 -3
  150. package/src/WSAPI/WSAPIJackpots.ts +4 -1
  151. package/src/WSAPI/WSAPIMiniGames.ts +1 -1
  152. package/src/WSAPI/WSAPITypes.ts +44 -0
  153. package/src/WSAPI/WSAPIUser.ts +30 -5
@@ -0,0 +1,259 @@
1
+ # gamePickGetActiveRounds — API (GamePickRound)
2
+
3
+ > Returns every open round for a MatchX or Quiz game template, with the full event list (matches / questions) and the current user's selections per event.
4
+ > Import: `import { GamePickRound } from '@smartico/public-api'`
5
+ > Search terms: gamePickGetActiveRounds, gamepick, GamePickRound, GPRoundStatus, GamePickScoreType, GameRoundOrderType, GamePickRoundPublicMeta, GamePickEvent, SAWGPMarketType, GamePickEventMeta, QuizAnswersValueType, GamePickResolutionType, errCode, data
6
+
7
+ ## Signature
8
+ ```ts
9
+ _smartico.api.gamePickGetActiveRounds(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickRound[]>>
10
+ ```
11
+
12
+ ## Parameters
13
+ - `props.saw_template_id` — ID of the MatchX or Quiz game template.
14
+
15
+ ## Returns — `Promise<GamesApiResponse<GamePickRound[]>>`
16
+ Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage?` (string), `data?` — the payload:
17
+
18
+ Array of `GamePickRound`. Each item:
19
+ - `round_id` (number) — Unique round identifier
20
+ - `round_row_id` (number) — Sequential row ID used for ordering rounds
21
+ - `round_name` (string) — Localized display name of the round
22
+ - `round_description` (string) — Localized description of the round
23
+ - `final_screen_cta_button_title` (string) — Label for the CTA button on the final/results screen
24
+ - `final_screen_message` (string) — Message displayed on the final/results screen
25
+ - `final_screen_image_desktop` (string) — URL of the final screen image (desktop)
26
+ - `final_screen_image_mobile` (string) — URL of the final screen image (mobile)
27
+ - `promo_image` (string) — URL of the promotional image for the round
28
+ - `promo_text` (string) — Promotional text displayed with the round
29
+ - `open_date` (number) — Timestamp (ms) when the round opens for participation
30
+ - `last_bet_date` (number) — Timestamp (ms) of the last moment bets are accepted
31
+ - `resolution_date` (number) — Timestamp (ms) when the round is expected to be resolved
32
+ - `score_full_win` (number) — Points awarded for a fully correct prediction
33
+ - `score_part_win` (number) — Points awarded for a partially correct prediction
34
+ - `score_lost` (number) — Points awarded (or deducted) for an incorrect prediction
35
+ - `is_active_now` (boolean) — Whether the round is currently active for participation
36
+ - `is_resolved` (boolean) — Whether the round has been fully resolved and scored
37
+ - `round_status_id` (GPRoundStatus) — Current lifecycle status of the round
38
+ - `events_total` (number) — Total number of events in the round
39
+ - `events_resolved` (number) — Number of events that have been resolved
40
+ - `score_type_id` (GamePickScoreType) — Scoring method used for this round
41
+ - `order_events` (GameRoundOrderType) — How events are ordered for display
42
+ - `board_users_count` (number) — Maximum number of users shown on the leaderboard
43
+ - `hide_users_predictions` (boolean) — Whether other users' predictions are hidden until resolution
44
+ - `public_meta` (GamePickRoundPublicMeta) — Public metadata including translations and display settings from the BackOffice
45
+ - `round_name` (string) — Localized round name
46
+ - `round_description` (string) — Localized round description
47
+ - `promo_image` (string) — URL of the promotional image for the round
48
+ - `promo_text` (string) — Promotional text displayed with the round
49
+ - `hide_resolved_round` (boolean) — Whether to hide the round from the UI after it has been resolved
50
+ - `final_screen_image_desktop` (string) — URL of the final screen image for desktop
51
+ - `final_screen_image_mobile` (string) — URL of the final screen image for mobile
52
+ - `final_screen_message` (string) — Message displayed on the final/results screen
53
+ - `final_screen_cta_button_title` (string) — Label for the CTA button on the final screen
54
+ - `final_screen_cta_dp` (string) — Deep link triggered by the CTA button on the final screen
55
+ - `allow_edit_answers` (boolean) — Whether users can edit their answers after initial submission (within betting window)
56
+ - `_translations` ({
57
+ [key: string]: {
58
+ round_name: string;
59
+ round_description: string;
60
+ promo_image: string;
61
+ promo_text: string;
62
+ final_screen_image_desktop: string;
63
+ final_screen_image_mobile: string;
64
+ final_screen_message: string;
65
+ final_screen_cta_button_title: string;
66
+ };
67
+ }) — Per-language overrides for round display content
68
+ - `next_round_open_date` (number) — Timestamp (ms) when the next round opens, if available
69
+ - `show_users_preference` (boolean) — Whether to show aggregated user preference percentages for each outcome
70
+ - `events` (GamePickEvent[]) — List of events (matches/questions) in this round
71
+ - `gp_event_id` (number) — Unique identifier of the event
72
+ - `event_resolution_date` (string) — ISO 8601 date-time string when the event was resolved; null until resolved.
73
+ - `match_date` (string) — ISO 8601 date-time string of the match/event start time.
74
+ - `market_type_id` (SAWGPMarketType) — Market type defining the prediction format (e.g. two-team score, quiz question, custom)
75
+ - `event_meta` (GamePickEventMeta) — Event metadata containing team names, images, sport type, and question details
76
+ - `answers` ({
77
+ /** Answer identifier value sent on submission */
78
+ value: string;
79
+ /** Localized display text of the answer */
80
+ text: string;
81
+ /** Per-language overrides for the answer text */
82
+ _translations: {
83
+ [key: string]: {
84
+ text: string;
85
+ };
86
+ };
87
+ }[]) — List of possible answer options for the quiz question
88
+ - `question_image` (string) — URL of an image associated with the question
89
+ - `result` (QuizAnswersValueType) — Correct answer value after resolution
90
+ - `custom_question` (string) — Custom question text displayed to the user
91
+ - `event_name` (string) — Display name of the event/match
92
+ - `team1_name` (string) — Name of the first team (home)
93
+ - `team1_image` (string) — URL of the first team's logo image
94
+ - `team2_name` (string) — Name of the second team (away)
95
+ - `team2_image` (string) — URL of the second team's logo image
96
+ - `team1_result` (number) — Actual result score for team 1 after resolution
97
+ - `team2_result` (number) — Actual result score for team 2 after resolution
98
+ - `sport_type_id` (number) — Betradar sport type ID for the event
99
+ - `is_canceled` (boolean) — Whether the event has been canceled
100
+ - `auto_resolve_enabled` (boolean) — Whether auto-resolution from live data feed is enabled
101
+ - `auto_resolve_date` (string) — ISO date string for when auto-resolution is expected
102
+ - `team1_auto_result` (number) — Auto-resolved score for team 1 from live data feed
103
+ - `team2_auto_result` (number) — Auto-resolved score for team 2 from live data feed
104
+ - `auto_result` (string) — Auto-resolved answer value from live data feed (for quiz events)
105
+ - `_translations` ({
106
+ [key: string]: {
107
+ team1_name: string;
108
+ team2_name: string;
109
+ event_name: string;
110
+ custom_question: string;
111
+ };
112
+ }) — Per-language overrides for team names, event name, and custom question
113
+ - `user_placed_bet` (boolean) — Whether the current user has submitted a prediction for this event
114
+ - `team1_user_selection` (number | { from: number; to: number }) — User's predicted score for team 1 (MatchX only). Can be a number or a range object
115
+ - `team2_user_selection` (number | { from: number; to: number }) — User's predicted score for team 2 (MatchX only). Can be a number or a range object
116
+ - `user_selection` (QuizAnswersValueType) — User's selected answer (Quiz only). Value depends on market type (e.g. '1', '2', 'x', 'yes', 'no')
117
+ - `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
118
+ - `resolution_score` (number) — Points awarded for this event based on prediction accuracy
119
+ - `is_open_for_bets` (boolean) — Whether this event is still accepting predictions
120
+ - `odds_details` ({ odd_value: { [key: string]: number } }) — Betting odds details for the event outcomes
121
+ - `question_image` (string) — URL of a question-specific image (quiz events)
122
+ - `user_score` (number) — Current user's total score in this round
123
+ - `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
124
+ - `has_open_for_bet_events` (boolean) — Whether there are events still open for betting
125
+ - `has_not_submitted_changes` (boolean) — Whether the user has unsaved changes to their predictions
126
+
127
+ ## Behavioral contract
128
+ **Preconditions**
129
+ - User must be authenticated.
130
+ - `saw_template_id` must reference a MatchX or Quiz game template. The SDK
131
+ throws synchronously if it's missing.
132
+
133
+ **Transport**
134
+ Game Pick methods are HTTP REST calls to a separate Game Pick games server
135
+ (not the main WebSocket). One consequence: there is no SDK cache and no push
136
+ subscription — every call is a fresh server roundtrip.
137
+
138
+ **Round status**
139
+ Each round's `round_status_id` is a `GPRoundStatus` value. Rounds with
140
+ status `NoEventsDefined` (1) are filtered out server-side and never appear
141
+ here. Other values: `Other` (-1, normally open), `NoMoreBetsAllowed` (2),
142
+ `AllEventsResolved_ButNotRound` (3), `RoundResolved` (4 — appears here only
143
+ briefly during transition; use `gamePickGetHistory` for resolved rounds).
144
+
145
+
146
+
147
+ **Refresh**
148
+ - No cache; every call is live.
149
+ - No push subscription. Poll while the user is on the screen if you need
150
+ live round-status changes (typically every 30–60 s is enough).
151
+
152
+ **Visitor mode**: not supported. The SDK throws synchronously on visitor
153
+ sessions.
154
+
155
+ **UI guidance**: see [UI Guide — `gamePickGetActiveRounds`](../../docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md).
156
+
157
+ ## Example
158
+ ```ts
159
+ const r = await window._smartico.api.gamePickGetActiveRounds({ saw_template_id: 1083 });
160
+
161
+ if (r.errCode !== 0) {
162
+ console.error('[smartico] active rounds fetch failed — show empty rounds lobby:', r.errMessage);
163
+ return;
164
+ }
165
+
166
+ for (const round of r.data ?? []) {
167
+ console.log('[smartico] render a round card:', round.round_name, '— events:', round.events.length, 'user has placed bet:', round.user_placed_bet);
168
+ }
169
+ ```
170
+
171
+ ### Example response (REAL shape)
172
+ > Where this real payload differs from the typed Returns above (TS interface vs raw wire), the REAL shape is the runtime truth.
173
+ ```json
174
+ {
175
+ "errCode": 0,
176
+ "data": [
177
+ {
178
+ "round_id": 42115,
179
+ "round_row_id": 2,
180
+ "public_meta": {
181
+ "round_name": "Group stage 15-28 June",
182
+ "_translations": {
183
+ "BR": {},
184
+ "TH": {}
185
+ },
186
+ "allow_edit_answers": true,
187
+ "final_screen_cta_dp": "dp:ok",
188
+ "hide_resolved_round": false
189
+ },
190
+ "score_type_id": 1,
191
+ "open_date": 1782200297406,
192
+ "last_bet_date": 1782691140000,
193
+ "is_active_now": true,
194
+ "is_resolved": false,
195
+ "round_status_id": -1,
196
+ "score_full_win": 0,
197
+ "score_part_win": 0,
198
+ "score_lost": 0,
199
+ "events_total": "28",
200
+ "events_resolved": "1",
201
+ "show_users_preference": true,
202
+ "order_events": 1,
203
+ "board_users_count": 20,
204
+ "hide_users_predictions": false,
205
+ "round_name": "Group stage 15-28 June",
206
+ "user_score": 0,
207
+ "user_placed_bet": false,
208
+ "events": [
209
+ {
210
+ "gp_event_id": 147400,
211
+ "market_type_id": 4,
212
+ "event_meta": {
213
+ "event_name": "World Cup",
214
+ "team1_name": "Czech Republic",
215
+ "team2_name": "Mexico",
216
+ "is_canceled": false,
217
+ "team1_image": "https://cdn.example/games/teams-images/1299262.png",
218
+ "team2_image": "https://cdn.example/games/teams-images/4781.png",
219
+ "sport_type_id": 1,
220
+ "question_image": "https://cdn.example/5ff1fc35b419e43886d227-Artboard3.png",
221
+ "scores_manually_adjusted": false
222
+ },
223
+ "event_resolution_date": null,
224
+ "match_date": "2026-06-25T01:00:00.000Z",
225
+ "odds_details": {
226
+ "odd_value": {
227
+ "1": 22,
228
+ "2": 35,
229
+ "x": 43
230
+ }
231
+ },
232
+ "user_placed_bet": false,
233
+ "resolution_score": 0,
234
+ "is_open_for_bets": true,
235
+ "resolution_type_id": 0
236
+ }
237
+ ],
238
+ "has_open_for_bet_events": true,
239
+ "has_not_submitted_changes": false
240
+ }
241
+ ]
242
+ }
243
+ ```
244
+
245
+ ## Errors
246
+ **Error codes** (in `errCode`)
247
+ - `0` — success.
248
+ - `100002` — template not found (the `saw_template_id` doesn't reference a
249
+ MatchX/Quiz game).
250
+ - `100003` — no open rounds available for this template right now.
251
+ - `100000` — auth hash invalid; SDK session needs re-initialization.
252
+ - `100004` — generic server error.
253
+
254
+ ## Related
255
+ - `gamePickGetActiveRound`
256
+ - `GPRoundStatus`
257
+ - `gamePickGetHistory`
258
+ - `GamesApiResponse`
259
+ - `GamePickRound`
@@ -0,0 +1,202 @@
1
+ # gamePickGetBoard — API (GamePickRoundBoard)
2
+
3
+ > Returns the leaderboard for a MatchX or Quiz game round — ranked list of players plus the current user's entry (`my_user`).
4
+ > Import: `import { GamePickRoundBoard } from '@smartico/public-api'`
5
+ > Search terms: gamePickGetBoard, gamepick, GamePickRoundBoard, GPRoundStatus, GamePickScoreType, GameRoundOrderType, GamePickRoundPublicMeta, GamePickBoardUser, errCode, data
6
+
7
+ ## Signature
8
+ ```ts
9
+ _smartico.api.gamePickGetBoard(props: GamePickRoundRequestParams): Promise<GamesApiResponse<GamePickRoundBoard>>
10
+ ```
11
+
12
+ ## Parameters
13
+ - `props.saw_template_id` — ID of the MatchX or Quiz game template.
14
+ - `props.round_id` — Round ID, or `-1` for the season leaderboard.
15
+
16
+ ## Returns — `Promise<GamesApiResponse<GamePickRoundBoard>>`
17
+ Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage?` (string), `data?` — the payload:
18
+
19
+ `GamePickRoundBoard`:
20
+ - `round_id` (number) — Unique round identifier
21
+ - `round_row_id` (number) — Sequential row ID used for ordering rounds
22
+ - `round_name` (string) — Localized display name of the round
23
+ - `round_description` (string) — Localized description of the round
24
+ - `final_screen_cta_button_title` (string) — Label for the CTA button on the final/results screen
25
+ - `final_screen_message` (string) — Message displayed on the final/results screen
26
+ - `final_screen_image_desktop` (string) — URL of the final screen image (desktop)
27
+ - `final_screen_image_mobile` (string) — URL of the final screen image (mobile)
28
+ - `promo_image` (string) — URL of the promotional image for the round
29
+ - `promo_text` (string) — Promotional text displayed with the round
30
+ - `open_date` (number) — Timestamp (ms) when the round opens for participation
31
+ - `last_bet_date` (number) — Timestamp (ms) of the last moment bets are accepted
32
+ - `resolution_date` (number) — Timestamp (ms) when the round is expected to be resolved
33
+ - `score_full_win` (number) — Points awarded for a fully correct prediction
34
+ - `score_part_win` (number) — Points awarded for a partially correct prediction
35
+ - `score_lost` (number) — Points awarded (or deducted) for an incorrect prediction
36
+ - `is_active_now` (boolean) — Whether the round is currently active for participation
37
+ - `is_resolved` (boolean) — Whether the round has been fully resolved and scored
38
+ - `round_status_id` (GPRoundStatus) — Current lifecycle status of the round
39
+ - `events_total` (number) — Total number of events in the round
40
+ - `events_resolved` (number) — Number of events that have been resolved
41
+ - `score_type_id` (GamePickScoreType) — Scoring method used for this round
42
+ - `order_events` (GameRoundOrderType) — How events are ordered for display
43
+ - `board_users_count` (number) — Maximum number of users shown on the leaderboard
44
+ - `hide_users_predictions` (boolean) — Whether other users' predictions are hidden until resolution
45
+ - `public_meta` (GamePickRoundPublicMeta) — Public metadata including translations and display settings from the BackOffice
46
+ - `round_name` (string) — Localized round name
47
+ - `round_description` (string) — Localized round description
48
+ - `promo_image` (string) — URL of the promotional image for the round
49
+ - `promo_text` (string) — Promotional text displayed with the round
50
+ - `hide_resolved_round` (boolean) — Whether to hide the round from the UI after it has been resolved
51
+ - `final_screen_image_desktop` (string) — URL of the final screen image for desktop
52
+ - `final_screen_image_mobile` (string) — URL of the final screen image for mobile
53
+ - `final_screen_message` (string) — Message displayed on the final/results screen
54
+ - `final_screen_cta_button_title` (string) — Label for the CTA button on the final screen
55
+ - `final_screen_cta_dp` (string) — Deep link triggered by the CTA button on the final screen
56
+ - `allow_edit_answers` (boolean) — Whether users can edit their answers after initial submission (within betting window)
57
+ - `_translations` ({
58
+ [key: string]: {
59
+ round_name: string;
60
+ round_description: string;
61
+ promo_image: string;
62
+ promo_text: string;
63
+ final_screen_image_desktop: string;
64
+ final_screen_image_mobile: string;
65
+ final_screen_message: string;
66
+ final_screen_cta_button_title: string;
67
+ };
68
+ }) — Per-language overrides for round display content
69
+ - `next_round_open_date` (number) — Timestamp (ms) when the next round opens, if available
70
+ - `show_users_preference` (boolean) — Whether to show aggregated user preference percentages for each outcome
71
+ - `my_user` (GamePickBoardUser) — Current user's leaderboard entry, or null if user hasn't participated
72
+ - `ext_user_id` (string) — External user ID (Smartico numeric user ID)
73
+ - `int_user_id` (number) — Internal user ID within the games system
74
+ - `public_username` (string) — Display name shown on the leaderboard
75
+ - `avatar_url` (string) — URL of the user's avatar image
76
+ - `gp_position` (number) — User's rank position on the leaderboard, null if not yet ranked
77
+ - `resolution_score` (number) — User's total score in this round/season
78
+ - `full_wins_count` (number) — Number of fully correct predictions
79
+ - `part_wins_count` (number) — Number of partially correct predictions
80
+ - `lost_count` (number) — Number of incorrect predictions
81
+ - `users` (GamePickBoardUser[]) — Ranked list of users on the leaderboard
82
+ - `ext_user_id` (string) — External user ID (Smartico numeric user ID)
83
+ - `int_user_id` (number) — Internal user ID within the games system
84
+ - `public_username` (string) — Display name shown on the leaderboard
85
+ - `avatar_url` (string) — URL of the user's avatar image
86
+ - `gp_position` (number) — User's rank position on the leaderboard, null if not yet ranked
87
+ - `resolution_score` (number) — User's total score in this round/season
88
+ - `full_wins_count` (number) — Number of fully correct predictions
89
+ - `part_wins_count` (number) — Number of partially correct predictions
90
+ - `lost_count` (number) — Number of incorrect predictions
91
+
92
+ ## Behavioral contract
93
+ **Preconditions**
94
+ - User must be authenticated. Visitor mode not supported.
95
+
96
+ **`round_id` semantics**
97
+ - Positive `round_id` — per-round leaderboard scoped to that round's events.
98
+ - `-1` — season / overall leaderboard aggregating scores across every round
99
+ of the template.
100
+
101
+ **`my_user`**
102
+ The current user's entry is returned separately from the `users[]` array
103
+ — `my_user` may be `null` if the user has never made a prediction on this
104
+ round / template. Use it to render the user's rank in a sticky footer or
105
+ "you are here" highlight regardless of pagination.
106
+
107
+ **Username masking**
108
+ `public_username` on other players may be masked / anonymized by operator
109
+ label settings. Always pair with `avatar_url` so the user can recognize
110
+ themselves in the ranking by avatar even when usernames are hidden.
111
+
112
+
113
+
114
+ **Refresh**
115
+ - No cache.
116
+ - No push subscription. Poll while the leaderboard is visible
117
+ (every 30–60 s) if you want live rank updates after match
118
+ resolution.
119
+
120
+ **Visitor mode**: not supported.
121
+
122
+ **UI guidance**: see [UI Guide — `gamePickGetBoard`](../../docs/ui/gamepick/UIGuide_gamePickGetBoard.md).
123
+
124
+ ## Example
125
+ ```ts
126
+ const r = await window._smartico.api.gamePickGetBoard({
127
+ saw_template_id: 1083,
128
+ round_id: -1, // season leaderboard
129
+ });
130
+
131
+ if (r.errCode === 0 && r.data) {
132
+ console.log('[smartico] render leaderboard rows for top', r.data.users.length, 'players');
133
+ if (r.data.my_user) {
134
+ console.log('[smartico] pin "you are rank #' + r.data.my_user.gp_position + '" footer to bottom');
135
+ } else {
136
+ console.log('[smartico] user not ranked — render "Play a round to join the leaderboard" CTA');
137
+ }
138
+ }
139
+ ```
140
+
141
+ ### Example response (REAL shape)
142
+ > Where this real payload differs from the typed Returns above (TS interface vs raw wire), the REAL shape is the runtime truth.
143
+ ```json
144
+ {
145
+ "errCode": 0,
146
+ "data": {
147
+ "round_id": 42115,
148
+ "round_row_id": 2,
149
+ "public_meta": {
150
+ "round_name": "Group stage 15-28 June",
151
+ "_translations": {
152
+ "BR": {},
153
+ "TH": {}
154
+ },
155
+ "allow_edit_answers": true,
156
+ "final_screen_cta_dp": "dp:ok",
157
+ "hide_resolved_round": false
158
+ },
159
+ "score_type_id": 1,
160
+ "open_date": 1782200297406,
161
+ "last_bet_date": 1782691140000,
162
+ "is_active_now": true,
163
+ "is_resolved": false,
164
+ "round_status_id": -1,
165
+ "score_full_win": 0,
166
+ "score_part_win": 0,
167
+ "score_lost": 0,
168
+ "events_total": "28",
169
+ "events_resolved": "1",
170
+ "show_users_preference": true,
171
+ "order_events": 1,
172
+ "board_users_count": 20,
173
+ "hide_users_predictions": false,
174
+ "round_name": "Group stage 15-28 June",
175
+ "users": [
176
+ {
177
+ "ext_user_id": "222849599",
178
+ "int_user_id": "228975556",
179
+ "public_username": "Alex*****",
180
+ "avatar_url": "https://cdn.example/d58c99035fadf00dcfe638-Dragongenderless.webp",
181
+ "gp_position": null,
182
+ "resolution_score": 0,
183
+ "full_wins_count": 0,
184
+ "part_wins_count": 0,
185
+ "lost_count": 0
186
+ }
187
+ ],
188
+ "my_user": null
189
+ }
190
+ }
191
+ ```
192
+
193
+ ## Errors
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
+ ## Related
201
+ - `GamesApiResponse`
202
+ - `GamePickRoundBoard`