@smartico/public-api 0.0.403 → 0.0.405

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 (148) 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/MiniGames/SAWTemplateUI.d.ts +6 -2
  6. package/dist/SmarticoGlobal.d.ts +0 -6
  7. package/dist/WSAPI/WSAPITypes.d.ts +43 -0
  8. package/dist/index.js +2 -0
  9. package/dist/index.js.map +1 -1
  10. package/dist/index.modern.mjs +2 -0
  11. package/dist/index.modern.mjs.map +1 -1
  12. package/docs/api/interfaces/SAWTemplate.md +16 -0
  13. package/docs/api/interfaces/TMiniGameTemplate.md +21 -0
  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/MiniGames/SAWTemplateUI.ts +6 -2
  147. package/src/SmarticoGlobal.ts +0 -7
  148. package/src/WSAPI/WSAPITypes.ts +44 -0
@@ -0,0 +1,189 @@
1
+ # gamePickGetRoundInfoForUser — API (GamePickRound)
2
+
3
+ > Returns a round with another player's predictions instead of the current user's.
4
+ > Import: `import { GamePickRound } from '@smartico/public-api'`
5
+ > Search terms: gamePickGetRoundInfoForUser, gamepick, GamePickRound, GPRoundStatus, GamePickScoreType, GameRoundOrderType, GamePickRoundPublicMeta, GamePickEvent, SAWGPMarketType, GamePickEventMeta, QuizAnswersValueType, GamePickResolutionType
6
+
7
+ ## Signature
8
+ ```ts
9
+ _smartico.api.gamePickGetRoundInfoForUser(props: GamePickRoundRequestParams & { int_user_id: number }): Promise<GamesApiResponse<GamePickRound>>
10
+ ```
11
+
12
+ ## Parameters
13
+ - `props.saw_template_id` — ID of the MatchX or Quiz game template.
14
+ - `props.round_id` — ID of the round to inspect.
15
+ - `props.int_user_id` — Internal user ID from `gamePickGetBoard.users[].int_user_id`.
16
+
17
+ ## Returns — `Promise<GamesApiResponse<GamePickRound>>`
18
+ Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage?` (string), `data?` — the payload:
19
+
20
+ `GamePickRound`:
21
+ - `round_id` (number) — Unique round identifier
22
+ - `round_row_id` (number) — Sequential row ID used for ordering rounds
23
+ - `round_name` (string) — Localized display name of the round
24
+ - `round_description` (string) — Localized description of the round
25
+ - `final_screen_cta_button_title` (string) — Label for the CTA button on the final/results screen
26
+ - `final_screen_message` (string) — Message displayed on the final/results screen
27
+ - `final_screen_image_desktop` (string) — URL of the final screen image (desktop)
28
+ - `final_screen_image_mobile` (string) — URL of the final screen image (mobile)
29
+ - `promo_image` (string) — URL of the promotional image for the round
30
+ - `promo_text` (string) — Promotional text displayed with the round
31
+ - `open_date` (number) — Timestamp (ms) when the round opens for participation
32
+ - `last_bet_date` (number) — Timestamp (ms) of the last moment bets are accepted
33
+ - `resolution_date` (number) — Timestamp (ms) when the round is expected to be resolved
34
+ - `score_full_win` (number) — Points awarded for a fully correct prediction
35
+ - `score_part_win` (number) — Points awarded for a partially correct prediction
36
+ - `score_lost` (number) — Points awarded (or deducted) for an incorrect prediction
37
+ - `is_active_now` (boolean) — Whether the round is currently active for participation
38
+ - `is_resolved` (boolean) — Whether the round has been fully resolved and scored
39
+ - `round_status_id` (GPRoundStatus) — Current lifecycle status of the round
40
+ - `events_total` (number) — Total number of events in the round
41
+ - `events_resolved` (number) — Number of events that have been resolved
42
+ - `score_type_id` (GamePickScoreType) — Scoring method used for this round
43
+ - `order_events` (GameRoundOrderType) — How events are ordered for display
44
+ - `board_users_count` (number) — Maximum number of users shown on the leaderboard
45
+ - `hide_users_predictions` (boolean) — Whether other users' predictions are hidden until resolution
46
+ - `public_meta` (GamePickRoundPublicMeta) — Public metadata including translations and display settings from the BackOffice
47
+ - `round_name` (string) — Localized round name
48
+ - `round_description` (string) — Localized round description
49
+ - `promo_image` (string) — URL of the promotional image for the round
50
+ - `promo_text` (string) — Promotional text displayed with the round
51
+ - `hide_resolved_round` (boolean) — Whether to hide the round from the UI after it has been resolved
52
+ - `final_screen_image_desktop` (string) — URL of the final screen image for desktop
53
+ - `final_screen_image_mobile` (string) — URL of the final screen image for mobile
54
+ - `final_screen_message` (string) — Message displayed on the final/results screen
55
+ - `final_screen_cta_button_title` (string) — Label for the CTA button on the final screen
56
+ - `final_screen_cta_dp` (string) — Deep link triggered by the CTA button on the final screen
57
+ - `allow_edit_answers` (boolean) — Whether users can edit their answers after initial submission (within betting window)
58
+ - `_translations` ({
59
+ [key: string]: {
60
+ round_name: string;
61
+ round_description: string;
62
+ promo_image: string;
63
+ promo_text: string;
64
+ final_screen_image_desktop: string;
65
+ final_screen_image_mobile: string;
66
+ final_screen_message: string;
67
+ final_screen_cta_button_title: string;
68
+ };
69
+ }) — Per-language overrides for round display content
70
+ - `next_round_open_date` (number) — Timestamp (ms) when the next round opens, if available
71
+ - `show_users_preference` (boolean) — Whether to show aggregated user preference percentages for each outcome
72
+ - `events` (GamePickEvent[]) — List of events (matches/questions) in this round
73
+ - `gp_event_id` (number) — Unique identifier of the event
74
+ - `event_resolution_date` (string) — ISO 8601 date-time string when the event was resolved; null until resolved.
75
+ - `match_date` (string) — ISO 8601 date-time string of the match/event start time.
76
+ - `market_type_id` (SAWGPMarketType) — Market type defining the prediction format (e.g. two-team score, quiz question, custom)
77
+ - `event_meta` (GamePickEventMeta) — Event metadata containing team names, images, sport type, and question details
78
+ - `answers` ({
79
+ /** Answer identifier value sent on submission */
80
+ value: string;
81
+ /** Localized display text of the answer */
82
+ text: string;
83
+ /** Per-language overrides for the answer text */
84
+ _translations: {
85
+ [key: string]: {
86
+ text: string;
87
+ };
88
+ };
89
+ }[]) — List of possible answer options for the quiz question
90
+ - `question_image` (string) — URL of an image associated with the question
91
+ - `result` (QuizAnswersValueType) — Correct answer value after resolution
92
+ - `custom_question` (string) — Custom question text displayed to the user
93
+ - `event_name` (string) — Display name of the event/match
94
+ - `team1_name` (string) — Name of the first team (home)
95
+ - `team1_image` (string) — URL of the first team's logo image
96
+ - `team2_name` (string) — Name of the second team (away)
97
+ - `team2_image` (string) — URL of the second team's logo image
98
+ - `team1_result` (number) — Actual result score for team 1 after resolution
99
+ - `team2_result` (number) — Actual result score for team 2 after resolution
100
+ - `sport_type_id` (number) — Betradar sport type ID for the event
101
+ - `is_canceled` (boolean) — Whether the event has been canceled
102
+ - `auto_resolve_enabled` (boolean) — Whether auto-resolution from live data feed is enabled
103
+ - `auto_resolve_date` (string) — ISO date string for when auto-resolution is expected
104
+ - `team1_auto_result` (number) — Auto-resolved score for team 1 from live data feed
105
+ - `team2_auto_result` (number) — Auto-resolved score for team 2 from live data feed
106
+ - `auto_result` (string) — Auto-resolved answer value from live data feed (for quiz events)
107
+ - `_translations` ({
108
+ [key: string]: {
109
+ team1_name: string;
110
+ team2_name: string;
111
+ event_name: string;
112
+ custom_question: string;
113
+ };
114
+ }) — Per-language overrides for team names, event name, and custom question
115
+ - `user_placed_bet` (boolean) — Whether the current user has submitted a prediction for this event
116
+ - `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
117
+ - `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
118
+ - `user_selection` (QuizAnswersValueType) — User's selected answer (Quiz only). Value depends on market type (e.g. '1', '2', 'x', 'yes', 'no')
119
+ - `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
120
+ - `resolution_score` (number) — Points awarded for this event based on prediction accuracy
121
+ - `is_open_for_bets` (boolean) — Whether this event is still accepting predictions
122
+ - `odds_details` ({ odd_value: { [key: string]: number } }) — Betting odds details for the event outcomes
123
+ - `question_image` (string) — URL of a question-specific image (quiz events)
124
+ - `user_score` (number) — Current user's total score in this round
125
+ - `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
126
+ - `has_open_for_bet_events` (boolean) — Whether there are events still open for betting
127
+ - `has_not_submitted_changes` (boolean) — Whether the user has unsaved changes to their predictions
128
+
129
+ ## Behavioral contract
130
+ **Preconditions**
131
+ - User must be authenticated. Visitor mode not supported.
132
+ - `saw_template_id`, `round_id`, and `int_user_id` are all mandatory — SDK
133
+ throws synchronously if any is missing.
134
+ - `int_user_id` must come from a leaderboard fetch in the same game
135
+ template; it is stable within a template but not portable across
136
+ templates.
137
+
138
+ **Shape vs `gamePickGetActiveRound`**
139
+ Same `GamePickRound` structure, but `user_selection` /
140
+ `team1_user_selection` / `team2_user_selection` reflect the TARGET user's
141
+ predictions instead of the caller's. Each event still carries its own
142
+ `resolution_type_id` (see `GamePickResolutionType`) so the UI can
143
+ render result badges per pick.
144
+
145
+
146
+
147
+ **Refresh**
148
+ - No cache. Re-call when opening a different leaderboard row's
149
+ "view picks" modal.
150
+ - No push subscription.
151
+
152
+ **Visitor mode**: not supported.
153
+
154
+ **UI guidance**: see [UI Guide — `gamePickGetRoundInfoForUser`](../../docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md).
155
+
156
+ ## Example
157
+ ```ts
158
+ const board = await window._smartico.api.gamePickGetBoard({
159
+ saw_template_id: 1083, round_id: 31652,
160
+ });
161
+ const topPlayer = board.data?.users?.[0];
162
+ if (!topPlayer) return;
163
+
164
+ const r = await window._smartico.api.gamePickGetRoundInfoForUser({
165
+ saw_template_id: 1083,
166
+ round_id: 31652,
167
+ int_user_id: topPlayer.int_user_id,
168
+ });
169
+
170
+ if (r.errCode === 0 && r.data) {
171
+ for (const ev of r.data.events) {
172
+ 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);
173
+ }
174
+ }
175
+ ```
176
+
177
+ ## Errors
178
+ **Error codes** (in `errCode`)
179
+ - `0` — success.
180
+ - `4` — round / event / user not found.
181
+ - `100002` — template not found.
182
+ - `100000` — auth hash invalid.
183
+ - `100004` — generic server error.
184
+
185
+ ## Related
186
+ - `gamePickGetBoard`
187
+ - `GamePickRound`
188
+ - `GamePickResolutionType`
189
+ - `GamesApiResponse`
@@ -0,0 +1,91 @@
1
+ # gamePickGetUserInfo — API (GamePickUserInfo)
2
+
3
+ > Returns the current user's profile within the Game Pick system — display name, avatar, balances, and last wallet-sync timestamp.
4
+ > Import: `import { GamePickUserInfo } from '@smartico/public-api'`
5
+ > Search terms: gamePickGetUserInfo, gamepick, GamePickUserInfo, errCode, data
6
+
7
+ ## Signature
8
+ ```ts
9
+ _smartico.api.gamePickGetUserInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickUserInfo>>
10
+ ```
11
+
12
+ ## Parameters
13
+ - `props.saw_template_id` — ID of the MatchX or Quiz game template.
14
+
15
+ ## Returns — `Promise<GamesApiResponse<GamePickUserInfo>>`
16
+ Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage?` (string), `data?` — the payload:
17
+
18
+ `GamePickUserInfo`:
19
+ - `ext_user_id` (string) — External user ID (Smartico numeric user ID)
20
+ - `int_user_id` (number) — Internal user ID within the games system
21
+ - `public_username` (string) — Display name
22
+ - `avatar_url` (string) — URL of the user's avatar image
23
+ - `gp_position` (number) — User's leaderboard rank position
24
+ - `full_wins_count` (number) — Number of fully correct predictions
25
+ - `part_wins_count` (number) — Number of partially correct predictions
26
+ - `resolution_score` (number) — User's total score
27
+ - `last_wallet_sync_time` (string) — ISO 8601 date-time string of the last time the user's balance was synced from the Smartico platform.
28
+ - `ach_points_balance` (number) — User's current points balance
29
+ - `ach_gems_balance` (number) — User's current gems balance
30
+ - `ach_diamonds_balance` (number) — User's current diamonds balance
31
+ - `pubic_username_set` (boolean) — Whether the user has set a custom public username
32
+
33
+ ## Behavioral contract
34
+ **Preconditions**
35
+ - User must be authenticated. Visitor mode not supported.
36
+
37
+ **Balance freshness**
38
+ The balances returned here are the cached mirror — at most ~1 minute stale.
39
+ For an up-to-the-second view of Points / Gems / Diamonds, read from
40
+ `getUserProfile` instead. Use this method's balances only for
41
+ in-Game-Pick display.
42
+
43
+
44
+
45
+ **Refresh**
46
+ - No cache. Server-side mirror refreshes at most every 60 s.
47
+ - No push subscription.
48
+
49
+ **Visitor mode**: not supported.
50
+
51
+ **UI guidance**: see [UI Guide — `gamePickGetUserInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md).
52
+
53
+ ## Example
54
+ ```ts
55
+ const r = await window._smartico.api.gamePickGetUserInfo({ saw_template_id: 1083 });
56
+
57
+ if (r.errCode === 0 && r.data) {
58
+ 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);
59
+ }
60
+ ```
61
+
62
+ ### Example response (REAL shape)
63
+ > Where this real payload differs from the typed Returns above (TS interface vs raw wire), the REAL shape is the runtime truth.
64
+ ```json
65
+ {
66
+ "errCode": 0,
67
+ "data": {
68
+ "ext_user_id": "361368543",
69
+ "int_user_id": "216289785",
70
+ "public_username": "Antonio",
71
+ "avatar_url": "https://cdn.example/avatars/12/00000000-0000-0000-0000-000000000000.png",
72
+ "last_wallet_sync_time": "2026-06-24T11:56:54.592Z",
73
+ "ach_points_balance": 326,
74
+ "ach_gems_balance": 10,
75
+ "ach_diamonds_balance": 1,
76
+ "pubic_username_set": true
77
+ }
78
+ }
79
+ ```
80
+
81
+ ## Errors
82
+ **Error codes** (in `errCode`)
83
+ - `0` — success.
84
+ - `100002` — template not found.
85
+ - `100000` — auth hash invalid.
86
+ - `100004` — generic server error.
87
+
88
+ ## Related
89
+ - `getUserProfile`
90
+ - `GamesApiResponse`
91
+ - `GamePickUserInfo`
@@ -0,0 +1,222 @@
1
+ # gamePickSubmitSelection — API (GamePickRound)
2
+
3
+ > Submits all score predictions for a round in a MatchX game in one shot.
4
+ > Import: `import { GamePickRound } from '@smartico/public-api'`
5
+ > Search terms: gamePickSubmitSelection, gamepick, GamePickRound, GPRoundStatus, GamePickScoreType, GameRoundOrderType, GamePickRoundPublicMeta, GamePickEvent, SAWGPMarketType, GamePickEventMeta, QuizAnswersValueType, GamePickResolutionType
6
+
7
+ ## Signature
8
+ ```ts
9
+ _smartico.api.gamePickSubmitSelection(props: GamePickRequestParams & { round: Partial<GamePickRound> }): Promise<GamesApiResponse<GamePickRound>>
10
+ ```
11
+
12
+ ## Parameters
13
+ - `props.saw_template_id` — ID of the MatchX game template.
14
+ - `props.round` — Round object with `round_id` + `events[]` carrying the user's score predictions.
15
+
16
+ ## Returns — `Promise<GamesApiResponse<GamePickRound>>`
17
+ Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage?` (string), `data?` — the payload:
18
+
19
+ `GamePickRound`:
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
+ - `events` (GamePickEvent[]) — List of events (matches/questions) in this round
72
+ - `gp_event_id` (number) — Unique identifier of the event
73
+ - `event_resolution_date` (string) — ISO 8601 date-time string when the event was resolved; null until resolved.
74
+ - `match_date` (string) — ISO 8601 date-time string of the match/event start time.
75
+ - `market_type_id` (SAWGPMarketType) — Market type defining the prediction format (e.g. two-team score, quiz question, custom)
76
+ - `event_meta` (GamePickEventMeta) — Event metadata containing team names, images, sport type, and question details
77
+ - `answers` ({
78
+ /** Answer identifier value sent on submission */
79
+ value: string;
80
+ /** Localized display text of the answer */
81
+ text: string;
82
+ /** Per-language overrides for the answer text */
83
+ _translations: {
84
+ [key: string]: {
85
+ text: string;
86
+ };
87
+ };
88
+ }[]) — List of possible answer options for the quiz question
89
+ - `question_image` (string) — URL of an image associated with the question
90
+ - `result` (QuizAnswersValueType) — Correct answer value after resolution
91
+ - `custom_question` (string) — Custom question text displayed to the user
92
+ - `event_name` (string) — Display name of the event/match
93
+ - `team1_name` (string) — Name of the first team (home)
94
+ - `team1_image` (string) — URL of the first team's logo image
95
+ - `team2_name` (string) — Name of the second team (away)
96
+ - `team2_image` (string) — URL of the second team's logo image
97
+ - `team1_result` (number) — Actual result score for team 1 after resolution
98
+ - `team2_result` (number) — Actual result score for team 2 after resolution
99
+ - `sport_type_id` (number) — Betradar sport type ID for the event
100
+ - `is_canceled` (boolean) — Whether the event has been canceled
101
+ - `auto_resolve_enabled` (boolean) — Whether auto-resolution from live data feed is enabled
102
+ - `auto_resolve_date` (string) — ISO date string for when auto-resolution is expected
103
+ - `team1_auto_result` (number) — Auto-resolved score for team 1 from live data feed
104
+ - `team2_auto_result` (number) — Auto-resolved score for team 2 from live data feed
105
+ - `auto_result` (string) — Auto-resolved answer value from live data feed (for quiz events)
106
+ - `_translations` ({
107
+ [key: string]: {
108
+ team1_name: string;
109
+ team2_name: string;
110
+ event_name: string;
111
+ custom_question: string;
112
+ };
113
+ }) — Per-language overrides for team names, event name, and custom question
114
+ - `user_placed_bet` (boolean) — Whether the current user has submitted a prediction for this event
115
+ - `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
116
+ - `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
117
+ - `user_selection` (QuizAnswersValueType) — User's selected answer (Quiz only). Value depends on market type (e.g. '1', '2', 'x', 'yes', 'no')
118
+ - `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
119
+ - `resolution_score` (number) — Points awarded for this event based on prediction accuracy
120
+ - `is_open_for_bets` (boolean) — Whether this event is still accepting predictions
121
+ - `odds_details` ({ odd_value: { [key: string]: number } }) — Betting odds details for the event outcomes
122
+ - `question_image` (string) — URL of a question-specific image (quiz events)
123
+ - `user_score` (number) — Current user's total score in this round
124
+ - `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
125
+ - `has_open_for_bet_events` (boolean) — Whether there are events still open for betting
126
+ - `has_not_submitted_changes` (boolean) — Whether the user has unsaved changes to their predictions
127
+
128
+ ## Behavioral contract
129
+ **Preconditions**
130
+ - User must be authenticated. Visitor mode not supported.
131
+ - `saw_template_id` and `props.round.round_id` are mandatory — SDK throws if
132
+ either is missing.
133
+ - Each event passed must include `gp_event_id` and the two
134
+ `team{1,2}_user_selection` fields. Missing events default to "no change".
135
+
136
+
137
+
138
+ **Idempotency**
139
+ Re-submitting identical selections returns `errCode: 3` (no changes); the
140
+ buy-in is consumed exactly once per round-per-user. Re-submitting after
141
+ `last_bet_date` also returns `errCode: 3` without consuming the buy-in.
142
+
143
+ **Side effects**
144
+ - First successful submit deducts the buy-in (Points / Gems / Diamonds /
145
+ one Spin) per `saw_buyin_type_id`.
146
+ - Records the user's participation against the round and its events
147
+ server-side and reports a prediction event to the operator's activity
148
+ stream.
149
+ - Score is awarded after the operator resolves the round
150
+ (`GPRoundStatus` = `RoundResolved`).
151
+
152
+ **Visitor mode**: not supported.
153
+
154
+ **UI guidance**: see [UI Guide — `gamePickSubmitSelection`](../../docs/ui/gamepick/UIGuide_gamePickSubmitSelection.md).
155
+
156
+ ## Example
157
+ ```ts
158
+ const ar = await window._smartico.api.gamePickGetActiveRound({
159
+ saw_template_id: 1190,
160
+ round_id: 38665,
161
+ });
162
+ if (ar.errCode !== 0 || !ar.data) {
163
+ console.error('[smartico] could not fetch round to submit — show error and bounce back');
164
+ return;
165
+ }
166
+
167
+ const round = ar.data;
168
+ round.events = round.events.map(e => ({
169
+ gp_event_id: e.gp_event_id,
170
+ team1_user_selection: 1,
171
+ team2_user_selection: 0,
172
+ }));
173
+
174
+ const r = await window._smartico.api.gamePickSubmitSelection({
175
+ saw_template_id: 1190,
176
+ round,
177
+ });
178
+
179
+ switch (r.errCode) {
180
+ case 0:
181
+ console.log('[smartico] predictions saved — show confirmation, refresh leaderboard');
182
+ break;
183
+ case 3:
184
+ console.log('[smartico] nothing changed (or all events closed) — silent no-op');
185
+ break;
186
+ case 40001:
187
+ case 40003:
188
+ case 40011:
189
+ case 40012:
190
+ console.error('[smartico] insufficient balance / spins — show top-up CTA:', r.errMessage);
191
+ break;
192
+ default:
193
+ console.error('[smartico] submit failed — show generic error toast:', r.errMessage);
194
+ }
195
+ ```
196
+
197
+ ## Errors
198
+ **Error codes** (in `errCode`)
199
+ - `0` — success; the response `data` is the updated round with
200
+ `user_placed_bet === true` and `has_not_submitted_changes === false`.
201
+ - `3` (`NoBetsUpdatedOnSubmit`) — submit produced no changes, OR every event
202
+ is past its `last_bet_date` deadline. The buy-in is NOT consumed; the
203
+ current round is still returned in `data`.
204
+ - `4` — round / event not found; refresh state and retry.
205
+ - `100002` — template not found.
206
+ - `100000` — auth hash invalid.
207
+ - `100004` — generic server error.
208
+
209
+ Buy-in failures pass through the `SAWSpinErrorCode` values on first
210
+ submit:
211
+ - `40001` — no spins left (when `saw_buyin_type_id` is Spins).
212
+ - `40003` — insufficient points.
213
+ - `40004` — global max-spins cap hit.
214
+ - `40007` — template outside its active date window.
215
+ - `40009` — user excluded by segment rule.
216
+ - `40011` — insufficient gems.
217
+ - `40012` — insufficient diamonds.
218
+
219
+ ## Related
220
+ - `SAWSpinErrorCode`
221
+ - `GPRoundStatus`
222
+ - `GamesApiResponse`