@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.
- package/.claude/skills/api-tsdoc/SKILL.md +675 -0
- package/.claude/skills/api-tsdoc-final/SKILL.md +266 -0
- package/.claude/skills/api-tsdoc-howto/SKILL.md +143 -0
- package/dist/MiniGames/SAWTemplate.d.ts +4 -0
- package/dist/NodeCache.d.ts +1 -0
- package/dist/OCache.d.ts +7 -0
- package/dist/SmarticoGlobal.d.ts +0 -6
- package/dist/WSAPI/WSAPITypes.d.ts +43 -0
- package/dist/WSAPI/WSAPIUser.d.ts +3 -0
- package/dist/index.js +92 -33
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +60 -10
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/interfaces/TUserProfile.md +136 -0
- package/docs/capabilities/_responses/buyStoreItem.json +4 -0
- package/docs/capabilities/_responses/claimBonus.json +4 -0
- package/docs/capabilities/_responses/gamePickGetActiveRound.json +95 -0
- package/docs/capabilities/_responses/gamePickGetActiveRounds.json +191 -0
- package/docs/capabilities/_responses/gamePickGetBoard.json +47 -0
- package/docs/capabilities/_responses/gamePickGetGameInfo.json +355 -0
- package/docs/capabilities/_responses/gamePickGetHistory.json +191 -0
- package/docs/capabilities/_responses/gamePickGetUserInfo.json +14 -0
- package/docs/capabilities/_responses/getAchCategories.json +12 -0
- package/docs/capabilities/_responses/getActivityLog.json +1 -0
- package/docs/capabilities/_responses/getAvatarPrompts.json +16 -0
- package/docs/capabilities/_responses/getAvatarsCustomized.json +12 -0
- package/docs/capabilities/_responses/getAvatarsList.json +24 -0
- package/docs/capabilities/_responses/getBadges.json +98 -0
- package/docs/capabilities/_responses/getBonuses.json +18 -0
- package/docs/capabilities/_responses/getClanInfo.json +39 -0
- package/docs/capabilities/_responses/getClans.json +35 -0
- package/docs/capabilities/_responses/getCurrentLevel.json +20 -0
- package/docs/capabilities/_responses/getCustomSections.json +25 -0
- package/docs/capabilities/_responses/getInboxMessageBody.json +7 -0
- package/docs/capabilities/_responses/getInboxMessages.json +18 -0
- package/docs/capabilities/_responses/getInboxUnreadCount.json +1 -0
- package/docs/capabilities/_responses/getJackpotEligibleGames.json +20 -0
- package/docs/capabilities/_responses/getJackpotWinners.json +28 -0
- package/docs/capabilities/_responses/getLeaderBoard.json +45 -0
- package/docs/capabilities/_responses/getLevels.json +40 -0
- package/docs/capabilities/_responses/getMiniGames.json +208 -0
- package/docs/capabilities/_responses/getMiniGamesHistory.json +1 -0
- package/docs/capabilities/_responses/getMissions.json +117 -0
- package/docs/capabilities/_responses/getRaffleDrawRun.json +62 -0
- package/docs/capabilities/_responses/getRaffleDrawRunsHistory.json +34 -0
- package/docs/capabilities/_responses/getRaffles.json +140 -0
- package/docs/capabilities/_responses/getStoreCategories.json +12 -0
- package/docs/capabilities/_responses/getStoreItems.json +47 -0
- package/docs/capabilities/_responses/getStorePurchasedItems.json +49 -0
- package/docs/capabilities/_responses/getTournamentInstanceInfo.json +75 -0
- package/docs/capabilities/_responses/getTournamentsList.json +66 -0
- package/docs/capabilities/_responses/getTranslations.json +25 -0
- package/docs/capabilities/_responses/getUserLevelExtraCounters.json +4 -0
- package/docs/capabilities/_responses/getUserProfile.json +34 -0
- package/docs/capabilities/_responses/jackpotGet.json +113 -0
- package/docs/capabilities/_responses/jackpotOptIn.json +9 -0
- package/docs/capabilities/_responses/jackpotOptOut.json +9 -0
- package/docs/capabilities/_responses/markAllInboxMessagesAsRead.json +4 -0
- package/docs/capabilities/_responses/markInboxMessageAsRead.json +4 -0
- package/docs/capabilities/_responses/markUnmarkInboxMessageAsFavorite.json +4 -0
- package/docs/capabilities/_responses/miniGameWinAcknowledgeRequest.json +10 -0
- package/docs/capabilities/_responses/playMiniGame.json +6 -0
- package/docs/capabilities/_responses/playMiniGameBatch.json +9 -0
- package/docs/capabilities/_responses/registerInTournament.json +4 -0
- package/docs/capabilities/_responses/requestMissionOptIn.json +4 -0
- package/docs/capabilities/_responses/setAvatar.json +4 -0
- package/docs/capabilities/avatarsCustomize.md +115 -0
- package/docs/capabilities/buyStoreItem.md +179 -0
- package/docs/capabilities/checkSegmentListMatch.md +69 -0
- package/docs/capabilities/checkSegmentMatch.md +74 -0
- package/docs/capabilities/claimBonus.md +125 -0
- package/docs/capabilities/claimRafflePrize.md +116 -0
- package/docs/capabilities/deleteAllInboxMessages.md +66 -0
- package/docs/capabilities/deleteInboxMessage.md +60 -0
- package/docs/capabilities/gamePickGetActiveRound.md +248 -0
- package/docs/capabilities/gamePickGetActiveRounds.md +259 -0
- package/docs/capabilities/gamePickGetBoard.md +202 -0
- package/docs/capabilities/gamePickGetGameInfo.md +318 -0
- package/docs/capabilities/gamePickGetHistory.md +244 -0
- package/docs/capabilities/gamePickGetRoundInfoForUser.md +189 -0
- package/docs/capabilities/gamePickGetUserInfo.md +91 -0
- package/docs/capabilities/gamePickSubmitSelection.md +222 -0
- package/docs/capabilities/gamePickSubmitSelectionQuiz.md +198 -0
- package/docs/capabilities/getAchCategories.md +119 -0
- package/docs/capabilities/getActivityLog.md +108 -0
- package/docs/capabilities/getAvatarPrompts.md +81 -0
- package/docs/capabilities/getAvatarsCustomized.md +96 -0
- package/docs/capabilities/getAvatarsList.md +101 -0
- package/docs/capabilities/getBadges.md +237 -0
- package/docs/capabilities/getBonuses.md +159 -0
- package/docs/capabilities/getClanInfo.md +164 -0
- package/docs/capabilities/getClanTournamentPlayers.md +112 -0
- package/docs/capabilities/getClans.md +168 -0
- package/docs/capabilities/getCurrentLevel.md +123 -0
- package/docs/capabilities/getCustomSections.md +96 -0
- package/docs/capabilities/getInboxMessageBody.md +87 -0
- package/docs/capabilities/getInboxMessages.md +146 -0
- package/docs/capabilities/getInboxUnreadCount.md +54 -0
- package/docs/capabilities/getJackpotEligibleGames.md +93 -0
- package/docs/capabilities/getJackpotWinners.md +113 -0
- package/docs/capabilities/getLeaderBoard.md +187 -0
- package/docs/capabilities/getLeaderBoards.md +88 -0
- package/docs/capabilities/getLevels.md +118 -0
- package/docs/capabilities/getMiniGames.md +295 -0
- package/docs/capabilities/getMiniGamesHistory.md +183 -0
- package/docs/capabilities/getMissions.md +253 -0
- package/docs/capabilities/getRaffleDrawRun.md +210 -0
- package/docs/capabilities/getRaffleDrawRunsHistory.md +116 -0
- package/docs/capabilities/getRaffleWonPrizes.md +153 -0
- package/docs/capabilities/getRaffles.md +249 -0
- package/docs/capabilities/getRelatedItemsForGame.md +236 -0
- package/docs/capabilities/getStoreCategories.md +128 -0
- package/docs/capabilities/getStoreItems.md +260 -0
- package/docs/capabilities/getStorePurchasedItems.md +280 -0
- package/docs/capabilities/getTournamentInstanceInfo.md +301 -0
- package/docs/capabilities/getTournamentsList.md +234 -0
- package/docs/capabilities/getTranslations.md +95 -0
- package/docs/capabilities/getUserLevelExtraCounters.md +92 -0
- package/docs/capabilities/getUserProfile.md +184 -0
- package/docs/capabilities/jackpotGet.md +173 -0
- package/docs/capabilities/jackpotOptIn.md +94 -0
- package/docs/capabilities/jackpotOptOut.md +92 -0
- package/docs/capabilities/joinClan.md +169 -0
- package/docs/capabilities/markAllInboxMessagesAsRead.md +72 -0
- package/docs/capabilities/markInboxMessageAsRead.md +69 -0
- package/docs/capabilities/markUnmarkInboxMessageAsFavorite.md +75 -0
- package/docs/capabilities/miniGameWinAcknowledgeRequest.md +98 -0
- package/docs/capabilities/playMiniGame.md +217 -0
- package/docs/capabilities/playMiniGameBatch.md +129 -0
- package/docs/capabilities/registerInTournament.md +187 -0
- package/docs/capabilities/reportClickEvent.md +74 -0
- package/docs/capabilities/reportImpressionEvent.md +67 -0
- package/docs/capabilities/requestMissionClaimReward.md +117 -0
- package/docs/capabilities/requestMissionOptIn.md +98 -0
- package/docs/capabilities/requestRaffleOptin.md +108 -0
- package/docs/capabilities/setAvatar.md +132 -0
- package/docs/capabilities/smarticoCallbacks.md +165 -0
- package/docs/capabilities/smarticoGlobal.md +62 -0
- package/package.json +3 -2
- package/readme-smartico-dev.md +208 -0
- package/scripts/capture-responses-browser.mjs +301 -0
- package/scripts/gen-capabilities.js +368 -0
- package/scripts/run-public-api.mjs +105 -0
- package/src/MiniGames/SAWGetTemplatesResponse.ts +2 -0
- package/src/MiniGames/SAWTemplate.ts +5 -0
- package/src/NodeCache.ts +8 -0
- package/src/OCache.ts +17 -0
- package/src/SmarticoGlobal.ts +0 -7
- package/src/WSAPI/WSAPI.ts +3 -3
- package/src/WSAPI/WSAPIJackpots.ts +4 -1
- package/src/WSAPI/WSAPIMiniGames.ts +1 -1
- package/src/WSAPI/WSAPITypes.ts +44 -0
- package/src/WSAPI/WSAPIUser.ts +30 -5
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
# gamePickGetGameInfo — API (GamePickGameInfo)
|
|
2
|
+
|
|
3
|
+
> Returns the game template configuration plus a metadata listing of every round (without events).
|
|
4
|
+
> Import: `import { GamePickGameInfo } from '@smartico/public-api'`
|
|
5
|
+
> Search terms: gamePickGetGameInfo, gamepick, GamePickGameInfo, SAWTemplate, SAWGameType, SAWTemplateUI, SAWBuyInType, SAWPrize, GamePickRoundBase, GPRoundStatus, GamePickScoreType, GameRoundOrderType, GamePickRoundPublicMeta, errCode, data
|
|
6
|
+
|
|
7
|
+
## Signature
|
|
8
|
+
```ts
|
|
9
|
+
_smartico.api.gamePickGetGameInfo(props: GamePickRequestParams): Promise<GamesApiResponse<GamePickGameInfo>>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Parameters
|
|
13
|
+
- `props.saw_template_id` — ID of the MatchX or Quiz game template.
|
|
14
|
+
|
|
15
|
+
## Returns — `Promise<GamesApiResponse<GamePickGameInfo>>`
|
|
16
|
+
Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage?` (string), `data?` — the payload:
|
|
17
|
+
|
|
18
|
+
`GamePickGameInfo`:
|
|
19
|
+
- `sawTemplate` (SAWTemplate) — Game template configuration (SAW template) with UI settings, buy-in type, cost, and spin count
|
|
20
|
+
- `saw_template_id` (number)
|
|
21
|
+
- `saw_game_type_id` (SAWGameType)
|
|
22
|
+
- `saw_template_ui_definition` (SAWTemplateUI)
|
|
23
|
+
- `skin` (string)
|
|
24
|
+
- `name` (string)
|
|
25
|
+
- `description` (string)
|
|
26
|
+
- `over_limit_message` (string)
|
|
27
|
+
- `hide_prize_names` (string)
|
|
28
|
+
- `no_attempts_message` (string)
|
|
29
|
+
- `thumbnail` (string)
|
|
30
|
+
- `sectors_count` (number)
|
|
31
|
+
- `priority` (number)
|
|
32
|
+
- `flow_builder_only` (boolean)
|
|
33
|
+
- `background_image` (string)
|
|
34
|
+
- `background_image_mobile` (string)
|
|
35
|
+
- `background_sound` (string)
|
|
36
|
+
- `spin_animation_duration` (number)
|
|
37
|
+
- `scratch_logo` (string)
|
|
38
|
+
- `scratch_cover` (string)
|
|
39
|
+
- `scratch_bg_desktop` (string)
|
|
40
|
+
- `scratch_bg_mobile` (string)
|
|
41
|
+
- `scratch_cursor` (string)
|
|
42
|
+
- `custom_css` (string)
|
|
43
|
+
- `custom_skin_folder` (string)
|
|
44
|
+
- `jackpot_symbol` (string)
|
|
45
|
+
- `promo_image` (string)
|
|
46
|
+
- `promo_text` (string)
|
|
47
|
+
- `matchx_banner` (string)
|
|
48
|
+
- `matchx_seasonal_ranking` (boolean)
|
|
49
|
+
- `matchx_is_completed` (boolean)
|
|
50
|
+
- `matchx_general_board_users_count` (number)
|
|
51
|
+
- `matchx_hide_ranking` (boolean)
|
|
52
|
+
- `prize_pool_image` (string)
|
|
53
|
+
- `ask_for_username` (SAWAskForUsername)
|
|
54
|
+
- `show_prize_board` (boolean)
|
|
55
|
+
- `max_spins_period_ms` (number)
|
|
56
|
+
- `show_countdown_for_next_availability` (boolean)
|
|
57
|
+
- `disable_background_music` (boolean)
|
|
58
|
+
- `custom_section_id` (number)
|
|
59
|
+
- `only_in_custom_section` (boolean)
|
|
60
|
+
- `custom_data` (any)
|
|
61
|
+
- `placeholder1` (string)
|
|
62
|
+
- `placeholder2` (string)
|
|
63
|
+
- `prize_drop_template` ({
|
|
64
|
+
id: string;
|
|
65
|
+
content: string;
|
|
66
|
+
})
|
|
67
|
+
- `saw_buyin_type_id` (SAWBuyInType)
|
|
68
|
+
- `buyin_cost_points` (number)
|
|
69
|
+
- `visibile_when_can_spin` (boolean)
|
|
70
|
+
- `spin_count` (number)
|
|
71
|
+
- `prizes` (SAWPrize[])
|
|
72
|
+
- `saw_prize_id` (number)
|
|
73
|
+
- `saw_prize_ui_definition` (SAWPrizeUI)
|
|
74
|
+
- `position` (number)
|
|
75
|
+
- `name` (string)
|
|
76
|
+
- `name_original` (string)
|
|
77
|
+
- `hide_prize_popup` (boolean)
|
|
78
|
+
- `aknowledge_message` (string)
|
|
79
|
+
- `sectors` (number[])
|
|
80
|
+
- `acknowledge_type` (SAWAcknowledgeType)
|
|
81
|
+
- `acknowledge_dp` (string)
|
|
82
|
+
- `font_size` (number)
|
|
83
|
+
- `font_size_mobile` (number)
|
|
84
|
+
- `sound_type` (SAWWinSoundType)
|
|
85
|
+
- `icon` (string)
|
|
86
|
+
- `replace_name_with_image` (boolean)
|
|
87
|
+
- `acknowledge_action_title` (string)
|
|
88
|
+
- `custom_win_sound` (string)
|
|
89
|
+
- `prize_value` (number)
|
|
90
|
+
- `prize_type_id` (SAWPrizeType)
|
|
91
|
+
- `place_from` (number)
|
|
92
|
+
- `place_to` (number)
|
|
93
|
+
- `sawUniqueWinId` (string)
|
|
94
|
+
- `is_visible` (boolean)
|
|
95
|
+
- `jackpot_add_on_attempt` (number)
|
|
96
|
+
- `jackpot_current` (number)
|
|
97
|
+
- `jackpot_guaranteed` (number)
|
|
98
|
+
- `maxActiveSpinsAllowed` (number)
|
|
99
|
+
- `maxSpinsCount` (number)
|
|
100
|
+
- `maxSpinsPediodMs` (number)
|
|
101
|
+
- `next_available_spin_ts` (number)
|
|
102
|
+
- `saw_skin_key` (string)
|
|
103
|
+
- `saw_skin_ui_definition` ({
|
|
104
|
+
skin_folder: string;
|
|
105
|
+
skin_css: string;
|
|
106
|
+
})
|
|
107
|
+
- `allRounds` (GamePickRoundBase[]) — List of all rounds (metadata only, no events)
|
|
108
|
+
- `round_id` (number) — Unique round identifier
|
|
109
|
+
- `round_row_id` (number) — Sequential row ID used for ordering rounds
|
|
110
|
+
- `round_name` (string) — Localized display name of the round
|
|
111
|
+
- `round_description` (string) — Localized description of the round
|
|
112
|
+
- `final_screen_cta_button_title` (string) — Label for the CTA button on the final/results screen
|
|
113
|
+
- `final_screen_message` (string) — Message displayed on the final/results screen
|
|
114
|
+
- `final_screen_image_desktop` (string) — URL of the final screen image (desktop)
|
|
115
|
+
- `final_screen_image_mobile` (string) — URL of the final screen image (mobile)
|
|
116
|
+
- `promo_image` (string) — URL of the promotional image for the round
|
|
117
|
+
- `promo_text` (string) — Promotional text displayed with the round
|
|
118
|
+
- `open_date` (number) — Timestamp (ms) when the round opens for participation
|
|
119
|
+
- `last_bet_date` (number) — Timestamp (ms) of the last moment bets are accepted
|
|
120
|
+
- `resolution_date` (number) — Timestamp (ms) when the round is expected to be resolved
|
|
121
|
+
- `score_full_win` (number) — Points awarded for a fully correct prediction
|
|
122
|
+
- `score_part_win` (number) — Points awarded for a partially correct prediction
|
|
123
|
+
- `score_lost` (number) — Points awarded (or deducted) for an incorrect prediction
|
|
124
|
+
- `is_active_now` (boolean) — Whether the round is currently active for participation
|
|
125
|
+
- `is_resolved` (boolean) — Whether the round has been fully resolved and scored
|
|
126
|
+
- `round_status_id` (GPRoundStatus) — Current lifecycle status of the round
|
|
127
|
+
- `events_total` (number) — Total number of events in the round
|
|
128
|
+
- `events_resolved` (number) — Number of events that have been resolved
|
|
129
|
+
- `score_type_id` (GamePickScoreType) — Scoring method used for this round
|
|
130
|
+
- `order_events` (GameRoundOrderType) — How events are ordered for display
|
|
131
|
+
- `board_users_count` (number) — Maximum number of users shown on the leaderboard
|
|
132
|
+
- `hide_users_predictions` (boolean) — Whether other users' predictions are hidden until resolution
|
|
133
|
+
- `public_meta` (GamePickRoundPublicMeta) — Public metadata including translations and display settings from the BackOffice
|
|
134
|
+
- `round_name` (string) — Localized round name
|
|
135
|
+
- `round_description` (string) — Localized round description
|
|
136
|
+
- `promo_image` (string) — URL of the promotional image for the round
|
|
137
|
+
- `promo_text` (string) — Promotional text displayed with the round
|
|
138
|
+
- `hide_resolved_round` (boolean) — Whether to hide the round from the UI after it has been resolved
|
|
139
|
+
- `final_screen_image_desktop` (string) — URL of the final screen image for desktop
|
|
140
|
+
- `final_screen_image_mobile` (string) — URL of the final screen image for mobile
|
|
141
|
+
- `final_screen_message` (string) — Message displayed on the final/results screen
|
|
142
|
+
- `final_screen_cta_button_title` (string) — Label for the CTA button on the final screen
|
|
143
|
+
- `final_screen_cta_dp` (string) — Deep link triggered by the CTA button on the final screen
|
|
144
|
+
- `allow_edit_answers` (boolean) — Whether users can edit their answers after initial submission (within betting window)
|
|
145
|
+
- `_translations` ({
|
|
146
|
+
[key: string]: {
|
|
147
|
+
round_name: string;
|
|
148
|
+
round_description: string;
|
|
149
|
+
promo_image: string;
|
|
150
|
+
promo_text: string;
|
|
151
|
+
final_screen_image_desktop: string;
|
|
152
|
+
final_screen_image_mobile: string;
|
|
153
|
+
final_screen_message: string;
|
|
154
|
+
final_screen_cta_button_title: string;
|
|
155
|
+
};
|
|
156
|
+
}) — Per-language overrides for round display content
|
|
157
|
+
- `next_round_open_date` (number) — Timestamp (ms) when the next round opens, if available
|
|
158
|
+
- `show_users_preference` (boolean) — Whether to show aggregated user preference percentages for each outcome
|
|
159
|
+
- `labelInfo` (any) — Label/brand configuration and settings
|
|
160
|
+
|
|
161
|
+
## Behavioral contract
|
|
162
|
+
**Preconditions**
|
|
163
|
+
- User must be authenticated. Visitor mode not supported.
|
|
164
|
+
|
|
165
|
+
**Buy-in semantics**
|
|
166
|
+
The `sawTemplate.saw_buyin_type_id` value determines which currency is
|
|
167
|
+
deducted on the user's first prediction in any round:
|
|
168
|
+
- Free — no deduction.
|
|
169
|
+
- Points — `buyin_cost_points` deducted from the user's points balance.
|
|
170
|
+
- Gems — deducted from the user's gems balance.
|
|
171
|
+
- Diamonds — deducted from the user's diamonds balance.
|
|
172
|
+
- Spins — one spin counted from `spin_count`.
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
**Refresh**
|
|
177
|
+
- No cache.
|
|
178
|
+
- No push subscription. Re-call after a successful
|
|
179
|
+
`gamePickSubmitSelection` to refresh `spin_count`.
|
|
180
|
+
|
|
181
|
+
**Visitor mode**: not supported.
|
|
182
|
+
|
|
183
|
+
**UI guidance**: see [UI Guide — `gamePickGetGameInfo`](../../docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md).
|
|
184
|
+
|
|
185
|
+
## Example
|
|
186
|
+
```ts
|
|
187
|
+
const r = await window._smartico.api.gamePickGetGameInfo({ saw_template_id: 1189 });
|
|
188
|
+
|
|
189
|
+
if (r.errCode === 0 && r.data) {
|
|
190
|
+
console.log('[smartico] render Game Pick lobby — title:', r.data.sawTemplate.saw_template_ui_definition.name);
|
|
191
|
+
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);
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Example response (REAL shape)
|
|
196
|
+
> Where this real payload differs from the typed Returns above (TS interface vs raw wire), the REAL shape is the runtime truth.
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"errCode": 0,
|
|
200
|
+
"data": {
|
|
201
|
+
"sawTemplate": {
|
|
202
|
+
"saw_template_id": 11487,
|
|
203
|
+
"saw_game_type_id": 6,
|
|
204
|
+
"saw_template_ui_definition": {
|
|
205
|
+
"show_prize_board": true,
|
|
206
|
+
"matchx_is_completed": false,
|
|
207
|
+
"description": "<style>\n .custom-rules {\n font-family: inherit;\n background-color: #27244F !important;\n margin: 0;\n padding: 4px; \n co…",
|
|
208
|
+
"priority": 1,
|
|
209
|
+
"ask_for_username": "no-ask",
|
|
210
|
+
"show_countdown_for_next_availability": false,
|
|
211
|
+
"promo_image": "https://cdn.example/b1cddefabccba88a16fad7-Artboard4.png",
|
|
212
|
+
"matchx_hide_ranking": false,
|
|
213
|
+
"matchx_remove_ties_in_leaders": false,
|
|
214
|
+
"name": "FIFA World Cup",
|
|
215
|
+
"matchx_seasonal_ranking": true,
|
|
216
|
+
"flow_builder_only": false,
|
|
217
|
+
"custom_section_id": null
|
|
218
|
+
},
|
|
219
|
+
"saw_buyin_type_id": 1,
|
|
220
|
+
"buyin_cost_points": 0,
|
|
221
|
+
"visibile_when_can_spin": false,
|
|
222
|
+
"spin_count": 0,
|
|
223
|
+
"prizesMap": "…(keyed duplicate of `prizes[]`)",
|
|
224
|
+
"prizes": [
|
|
225
|
+
{
|
|
226
|
+
"saw_prize_id": 65863,
|
|
227
|
+
"saw_template_id": 11487,
|
|
228
|
+
"saw_prize_ui_definition": {
|
|
229
|
+
"name": "25 Free Spins on Book of Cleopatra"
|
|
230
|
+
},
|
|
231
|
+
"prize_value": 1,
|
|
232
|
+
"prize_type_id": 3,
|
|
233
|
+
"pool": 1000000,
|
|
234
|
+
"wins_count": null,
|
|
235
|
+
"pool_initial": null,
|
|
236
|
+
"prize_ref_id": 0,
|
|
237
|
+
"is_surcharge": false,
|
|
238
|
+
"prize_details_json": {
|
|
239
|
+
"ui_amount": "",
|
|
240
|
+
"bonus_coupon_code": "",
|
|
241
|
+
"label_bonus_template_id": 2156
|
|
242
|
+
},
|
|
243
|
+
"affects_points_progress": true,
|
|
244
|
+
"affects_leaderboard_progress": true,
|
|
245
|
+
"affects_level_progress": true,
|
|
246
|
+
"affects_current_balance_progress": true,
|
|
247
|
+
"place_from": 2,
|
|
248
|
+
"place_to": 2,
|
|
249
|
+
"weekdays": null,
|
|
250
|
+
"active_from": null,
|
|
251
|
+
"active_till": null,
|
|
252
|
+
"active_from_ts": null,
|
|
253
|
+
"active_till_ts": null,
|
|
254
|
+
"is_deleted": false,
|
|
255
|
+
"relative_period_timezone": 0,
|
|
256
|
+
"show_prize_history": true,
|
|
257
|
+
"needed_tag_replacement": false,
|
|
258
|
+
"win_segment_id": null,
|
|
259
|
+
"win_conditions": null,
|
|
260
|
+
"max_give_period_type_id": 2
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
"segment_id": 6557,
|
|
264
|
+
"label_id": 16018,
|
|
265
|
+
"maxActiveSpinsAllowed": null,
|
|
266
|
+
"maxSpinsCount": 0,
|
|
267
|
+
"maxSpinsPeriodMs": 0,
|
|
268
|
+
"sawStatusId": 2,
|
|
269
|
+
"needsTagReplacement": false,
|
|
270
|
+
"containsConditionalPrize": false,
|
|
271
|
+
"jackpot_guaranteed": null,
|
|
272
|
+
"jackpot_add_on_attempt": null,
|
|
273
|
+
"jackpot_current": null,
|
|
274
|
+
"saw_skin_key": null,
|
|
275
|
+
"saw_skin_ui_definition": null,
|
|
276
|
+
"maxSpinPeriodTypeId": 1,
|
|
277
|
+
"expireSpinsMs": 0,
|
|
278
|
+
"next_available_spin_ts": null,
|
|
279
|
+
"saw_expire_spin_type": null,
|
|
280
|
+
"saw_expire_spin_config": null,
|
|
281
|
+
"isVisitorMode": false,
|
|
282
|
+
"activeFromDate": -9223372036854776000,
|
|
283
|
+
"activeTillDate": 9223372036854776000,
|
|
284
|
+
"requires_prize_claim": false,
|
|
285
|
+
"expose_game_stat_on_api": false,
|
|
286
|
+
"relative_period_timezone": 0,
|
|
287
|
+
"templateName": "FIFA World Cup",
|
|
288
|
+
"show_prize_history": true,
|
|
289
|
+
"visibility_conditions": "[]",
|
|
290
|
+
"active_start_time": null,
|
|
291
|
+
"active_end_time": null
|
|
292
|
+
},
|
|
293
|
+
"allRounds": [
|
|
294
|
+
{
|
|
295
|
+
"round_name": "",
|
|
296
|
+
"round_id": -1,
|
|
297
|
+
"hide_users_predictions": true
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"labelInfo": "…(label config — typed `any`, omitted)"
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## Errors
|
|
306
|
+
**Error codes** (in `errCode`)
|
|
307
|
+
- `0` — success.
|
|
308
|
+
- `100002` — template not found.
|
|
309
|
+
- `100000` — auth hash invalid.
|
|
310
|
+
- `100004` — generic server error.
|
|
311
|
+
|
|
312
|
+
## Related
|
|
313
|
+
- `gamePickGetActiveRound`
|
|
314
|
+
- `gamePickGetActiveRounds`
|
|
315
|
+
- `gamePickGetBoard`
|
|
316
|
+
- `gamePickSubmitSelection`
|
|
317
|
+
- `GamesApiResponse`
|
|
318
|
+
- `GamePickGameInfo`
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# gamePickGetHistory — API (GamePickRound)
|
|
2
|
+
|
|
3
|
+
> Returns the full round history (active + resolved) for a MatchX or Quiz game template, newest-first.
|
|
4
|
+
> Import: `import { GamePickRound } from '@smartico/public-api'`
|
|
5
|
+
> Search terms: gamePickGetHistory, gamepick, GamePickRound, GPRoundStatus, GamePickScoreType, GameRoundOrderType, GamePickRoundPublicMeta, GamePickEvent, SAWGPMarketType, GamePickEventMeta, QuizAnswersValueType, GamePickResolutionType, errCode, data
|
|
6
|
+
|
|
7
|
+
## Signature
|
|
8
|
+
```ts
|
|
9
|
+
_smartico.api.gamePickGetHistory(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. Visitor mode not supported.
|
|
130
|
+
|
|
131
|
+
**Sort order**
|
|
132
|
+
Server returns rounds newest-first. No client-side sort needed.
|
|
133
|
+
|
|
134
|
+
**Per-event resolution**
|
|
135
|
+
Each event in the rounds carries `resolution_type_id` — values are from
|
|
136
|
+
`GamePickResolutionType`: `None` (0, not yet resolved), `Lost` (2),
|
|
137
|
+
`PartialWin` (3), `FullWin` (4). Use these to render result badges on
|
|
138
|
+
each event row.
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
**Refresh**
|
|
143
|
+
- No cache.
|
|
144
|
+
- No push subscription. Re-call when the user opens the history tab.
|
|
145
|
+
|
|
146
|
+
**Visitor mode**: not supported.
|
|
147
|
+
|
|
148
|
+
**UI guidance**: see [UI Guide — `gamePickGetHistory`](../../docs/ui/gamepick/UIGuide_gamePickGetHistory.md).
|
|
149
|
+
|
|
150
|
+
## Example
|
|
151
|
+
```ts
|
|
152
|
+
const r = await window._smartico.api.gamePickGetHistory({ saw_template_id: 1083 });
|
|
153
|
+
|
|
154
|
+
for (const round of r.data ?? []) {
|
|
155
|
+
console.log('[smartico] history row —', round.round_name, 'score:', round.user_score, 'resolved:', round.is_resolved);
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Example response (REAL shape)
|
|
160
|
+
> Where this real payload differs from the typed Returns above (TS interface vs raw wire), the REAL shape is the runtime truth.
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"errCode": 0,
|
|
164
|
+
"data": [
|
|
165
|
+
{
|
|
166
|
+
"round_id": 42115,
|
|
167
|
+
"round_row_id": 2,
|
|
168
|
+
"public_meta": {
|
|
169
|
+
"round_name": "Group stage 15-28 June",
|
|
170
|
+
"_translations": {
|
|
171
|
+
"BR": {},
|
|
172
|
+
"TH": {}
|
|
173
|
+
},
|
|
174
|
+
"allow_edit_answers": true,
|
|
175
|
+
"final_screen_cta_dp": "dp:ok",
|
|
176
|
+
"hide_resolved_round": false
|
|
177
|
+
},
|
|
178
|
+
"score_type_id": 1,
|
|
179
|
+
"open_date": 1782200297406,
|
|
180
|
+
"last_bet_date": 1782691140000,
|
|
181
|
+
"is_active_now": true,
|
|
182
|
+
"is_resolved": false,
|
|
183
|
+
"round_status_id": -1,
|
|
184
|
+
"score_full_win": 0,
|
|
185
|
+
"score_part_win": 0,
|
|
186
|
+
"score_lost": 0,
|
|
187
|
+
"events_total": "28",
|
|
188
|
+
"events_resolved": "1",
|
|
189
|
+
"show_users_preference": true,
|
|
190
|
+
"order_events": 1,
|
|
191
|
+
"board_users_count": 20,
|
|
192
|
+
"hide_users_predictions": false,
|
|
193
|
+
"round_name": "Group stage 15-28 June",
|
|
194
|
+
"user_score": 0,
|
|
195
|
+
"user_placed_bet": false,
|
|
196
|
+
"events": [
|
|
197
|
+
{
|
|
198
|
+
"gp_event_id": 147400,
|
|
199
|
+
"market_type_id": 4,
|
|
200
|
+
"event_meta": {
|
|
201
|
+
"event_name": "World Cup",
|
|
202
|
+
"team1_name": "Czech Republic",
|
|
203
|
+
"team2_name": "Mexico",
|
|
204
|
+
"is_canceled": false,
|
|
205
|
+
"team1_image": "https://cdn.example/games/teams-images/1299262.png",
|
|
206
|
+
"team2_image": "https://cdn.example/games/teams-images/4781.png",
|
|
207
|
+
"sport_type_id": 1,
|
|
208
|
+
"question_image": "https://cdn.example/5ff1fc35b419e43886d227-Artboard3.png",
|
|
209
|
+
"scores_manually_adjusted": false
|
|
210
|
+
},
|
|
211
|
+
"event_resolution_date": null,
|
|
212
|
+
"match_date": "2026-06-25T01:00:00.000Z",
|
|
213
|
+
"odds_details": {
|
|
214
|
+
"odd_value": {
|
|
215
|
+
"1": 22,
|
|
216
|
+
"2": 35,
|
|
217
|
+
"x": 43
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"user_placed_bet": false,
|
|
221
|
+
"resolution_score": 0,
|
|
222
|
+
"is_open_for_bets": true,
|
|
223
|
+
"resolution_type_id": 0
|
|
224
|
+
}
|
|
225
|
+
],
|
|
226
|
+
"has_open_for_bet_events": true,
|
|
227
|
+
"has_not_submitted_changes": false
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Errors
|
|
234
|
+
**Error codes** (in `errCode`)
|
|
235
|
+
- `0` — success.
|
|
236
|
+
- `100002` — template not found.
|
|
237
|
+
- `100000` — auth hash invalid.
|
|
238
|
+
- `100004` — generic server error.
|
|
239
|
+
|
|
240
|
+
## Related
|
|
241
|
+
- `gamePickGetActiveRounds`
|
|
242
|
+
- `GamePickResolutionType`
|
|
243
|
+
- `GamesApiResponse`
|
|
244
|
+
- `GamePickRound`
|