@smartico/public-api 0.0.409 → 0.0.411
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/README.md +1 -1
- package/dist/MiniGames/SAWDoAknowledgeRequest.d.ts +2 -0
- package/dist/MiniGames/SAWPrize.d.ts +18 -0
- package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
- package/dist/MiniGames/SAWTemplate.d.ts +24 -0
- package/dist/SmarticoAPI.d.ts +1 -1
- package/dist/SmarticoLib/index.d.ts +1 -1
- package/dist/WSAPI/WSAPIJackpots.d.ts +11 -2
- package/dist/WSAPI/WSAPIMiniGames.d.ts +92 -23
- package/dist/WSAPI/WSAPITypes.d.ts +45 -44
- package/dist/index.js +112 -31
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +109 -28
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/classes/WSAPIJackpots.md +11 -2
- package/docs/api/classes/WSAPIMiniGames.md +92 -23
- package/docs/api/interfaces/SAWDoAknowledgeRequest.md +8 -0
- package/docs/api/interfaces/SAWPrize.md +36 -0
- package/docs/api/interfaces/SAWPrizeUI.md +2 -0
- package/docs/api/interfaces/SAWTemplate.md +48 -0
- package/docs/api/interfaces/TMiniGamePrize.md +51 -27
- package/docs/api/interfaces/TMiniGameTemplate.md +15 -16
- package/docs/capabilities/getJackpotEligibleGames.md +11 -2
- package/docs/capabilities/getMiniGames.md +63 -39
- package/docs/capabilities/miniGameWinAcknowledgeRequest.md +36 -7
- package/docs/capabilities/playMiniGame.md +27 -14
- package/docs/native/PROTOCOL.md +7 -0
- package/docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md +8 -0
- package/docs/ui/minigames/UIGuide_getMiniGames.md +46 -0
- package/docs/ui/minigames/UIGuide_getMiniGamesHistory.md +1 -1
- package/docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md +90 -0
- package/docs/ui/minigames/UIGuide_playMiniGame.md +38 -2
- package/package.json +1 -1
- package/src/MiniGames/SAWDoAknowledgeRequest.ts +2 -0
- package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -0
- package/src/MiniGames/SAWPrize.ts +18 -0
- package/src/MiniGames/SAWPrizeUI.ts +2 -1
- package/src/MiniGames/SAWTemplate.ts +27 -4
- package/src/SmarticoAPI.ts +7 -1
- package/src/SmarticoLib/index.ts +1 -1
- package/src/WSAPI/WSAPIJackpots.ts +11 -2
- package/src/WSAPI/WSAPIMiniGames.ts +91 -24
- package/src/WSAPI/WSAPITypes.ts +47 -46
|
@@ -16,7 +16,7 @@ ID of the prize
|
|
|
16
16
|
|
|
17
17
|
> **name**: `string`
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Display name of the prize, pre-translated; any jackpot placeholder in it arrives resolved to the live jackpot value
|
|
20
20
|
|
|
21
21
|
***
|
|
22
22
|
|
|
@@ -24,7 +24,7 @@ The visual name of the prize
|
|
|
24
24
|
|
|
25
25
|
> **prize\_type**: [`MiniGamePrizeTypeName`](../enumerations/MiniGamePrizeTypeName.md)
|
|
26
26
|
|
|
27
|
-
The type of the prize
|
|
27
|
+
The type of the prize — see [MiniGamePrizeTypeName](../enumerations/MiniGamePrizeTypeName.md) ('no-prize', 'points', 'gems-and-diamonds', 'spin', 'bonus', 'jackpot', 'raffle-ticket', 'mission', 'change-level', 'manual')
|
|
28
28
|
|
|
29
29
|
***
|
|
30
30
|
|
|
@@ -32,7 +32,7 @@ The type of the prize, no-prize, points, bonus, manual, spin, jackpot
|
|
|
32
32
|
|
|
33
33
|
> `optional` **prize\_value?**: `number`
|
|
34
34
|
|
|
35
|
-
Numeric value of the prize in case it's 'points' or 'spin' type. For other types of prizes this value is not relevant.
|
|
35
|
+
Numeric value of the prize in case it's 'points' or 'spin' type. For other types of prizes this value is not relevant.
|
|
36
36
|
For example for prize '100 points' the prize_value will be 100. For '100 free spins' the prize_value will be 100.
|
|
37
37
|
|
|
38
38
|
***
|
|
@@ -41,7 +41,7 @@ For example for prize '100 points' the prize_value will be 100. For '100 free s
|
|
|
41
41
|
|
|
42
42
|
> `optional` **font\_size?**: `number`
|
|
43
43
|
|
|
44
|
-
Custom font size for the prize (desktop
|
|
44
|
+
Custom font size in px for rendering the prize name on the game surface (e.g. a wheel sector), desktop
|
|
45
45
|
|
|
46
46
|
***
|
|
47
47
|
|
|
@@ -49,7 +49,7 @@ Custom font size for the prize (desktop)
|
|
|
49
49
|
|
|
50
50
|
> `optional` **font\_size\_mobile?**: `number`
|
|
51
51
|
|
|
52
|
-
Custom font size for the prize
|
|
52
|
+
Custom font size in px for the prize name, mobile; falls back to `font_size` when absent
|
|
53
53
|
|
|
54
54
|
***
|
|
55
55
|
|
|
@@ -65,7 +65,7 @@ The URL of the icon of the prize, aspect ratio 1:1
|
|
|
65
65
|
|
|
66
66
|
> **position**: `number`
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
For Scratch Card games — relative order of the prize in the scratch grid (lower first). May be absent for other game types
|
|
69
69
|
|
|
70
70
|
***
|
|
71
71
|
|
|
@@ -73,7 +73,7 @@ for scratch card defines position of prize in the list
|
|
|
73
73
|
|
|
74
74
|
> **sectors**: `number`[]
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
For Spin-a-Wheel games — wheel sector indices this prize occupies. Absent for non-wheel games
|
|
77
77
|
|
|
78
78
|
***
|
|
79
79
|
|
|
@@ -81,7 +81,7 @@ List of sectors for the prize
|
|
|
81
81
|
|
|
82
82
|
> **acknowledge\_type**: [`SAWAcknowledgeTypeName`](../enumerations/SAWAcknowledgeTypeName.md)
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
Which win modal the prize uses — see [SAWAcknowledgeTypeName](../enumerations/SAWAcknowledgeTypeName.md) (Silent / QuickMessage / FullMessage / ExplicitAcknowledge)
|
|
85
85
|
|
|
86
86
|
***
|
|
87
87
|
|
|
@@ -93,11 +93,19 @@ Message that will be shown to user in modal pop-up
|
|
|
93
93
|
|
|
94
94
|
***
|
|
95
95
|
|
|
96
|
+
### aknowledge\_message\_lose?
|
|
97
|
+
|
|
98
|
+
> `optional` **aknowledge\_message\_lose?**: `string`
|
|
99
|
+
|
|
100
|
+
Message shown instead of `aknowledge_message` when the spin is finalised as lost (`lose: true` acknowledge flows — games with a client-decided outcome, e.g. Voyager). Absent unless configured
|
|
101
|
+
|
|
102
|
+
***
|
|
103
|
+
|
|
96
104
|
### acknowledge\_dp
|
|
97
105
|
|
|
98
106
|
> **acknowledge\_dp**: `string`
|
|
99
107
|
|
|
100
|
-
Deep link
|
|
108
|
+
Deep link executed when the user taps the main action button in the win modal (run it via `_smartico.dp()`)
|
|
101
109
|
|
|
102
110
|
***
|
|
103
111
|
|
|
@@ -105,7 +113,7 @@ Deep link that will trigger some action in modal pop-up
|
|
|
105
113
|
|
|
106
114
|
> **acknowledge\_action\_title**: `string`
|
|
107
115
|
|
|
108
|
-
|
|
116
|
+
Label of the main action button in the win modal
|
|
109
117
|
|
|
110
118
|
***
|
|
111
119
|
|
|
@@ -113,7 +121,7 @@ The name of the action button in modal pop-up
|
|
|
113
121
|
|
|
114
122
|
> `optional` **acknowledge\_dp\_additional?**: `string`
|
|
115
123
|
|
|
116
|
-
Deep link
|
|
124
|
+
Deep link of the additional action button in the win modal
|
|
117
125
|
|
|
118
126
|
***
|
|
119
127
|
|
|
@@ -121,7 +129,23 @@ Deep link that will trigger some action in modal pop-up (additional)
|
|
|
121
129
|
|
|
122
130
|
> `optional` **acknowledge\_action\_title\_additional?**: `string`
|
|
123
131
|
|
|
124
|
-
|
|
132
|
+
Label of the additional action button in the win modal
|
|
133
|
+
|
|
134
|
+
***
|
|
135
|
+
|
|
136
|
+
### second\_btn?
|
|
137
|
+
|
|
138
|
+
> `optional` **second\_btn?**: `string`
|
|
139
|
+
|
|
140
|
+
Deep link of the secondary button in the win modal
|
|
141
|
+
|
|
142
|
+
***
|
|
143
|
+
|
|
144
|
+
### second\_btn\_action\_title?
|
|
145
|
+
|
|
146
|
+
> `optional` **second\_btn\_action\_title?**: `string`
|
|
147
|
+
|
|
148
|
+
Label of the secondary button in the win modal
|
|
125
149
|
|
|
126
150
|
***
|
|
127
151
|
|
|
@@ -137,7 +161,7 @@ Message when the prize pool is empty for that specific prize
|
|
|
137
161
|
|
|
138
162
|
> `optional` **pool?**: `number`
|
|
139
163
|
|
|
140
|
-
|
|
164
|
+
Remaining stock of the prize — decrements on each win, refunded if the spin is finalised as lost. Populated only when the template's `expose_game_stat_on_api` is enabled; always populated for MatchX / Quiz games
|
|
141
165
|
|
|
142
166
|
***
|
|
143
167
|
|
|
@@ -145,7 +169,7 @@ Number of items in stock
|
|
|
145
169
|
|
|
146
170
|
> `optional` **pool\_initial?**: `number`
|
|
147
171
|
|
|
148
|
-
Initial
|
|
172
|
+
Initial (configured) stock of the prize. Populated regardless of `expose_game_stat_on_api`
|
|
149
173
|
|
|
150
174
|
***
|
|
151
175
|
|
|
@@ -153,7 +177,7 @@ Initial number of items in stock
|
|
|
153
177
|
|
|
154
178
|
> `optional` **wins\_count?**: `number`
|
|
155
179
|
|
|
156
|
-
Number of
|
|
180
|
+
Number of times the prize has been won, across all players. Populated only when the template's `expose_game_stat_on_api` is enabled
|
|
157
181
|
|
|
158
182
|
***
|
|
159
183
|
|
|
@@ -161,7 +185,7 @@ Number of wins in game
|
|
|
161
185
|
|
|
162
186
|
> `optional` **weekdays?**: `number`[]
|
|
163
187
|
|
|
164
|
-
|
|
188
|
+
ISO weekday numbers (1 = Monday … 7 = Sunday) on which the prize can be won; absent = any day. Populated only when the template's `expose_game_stat_on_api` is enabled
|
|
165
189
|
|
|
166
190
|
***
|
|
167
191
|
|
|
@@ -169,7 +193,7 @@ Number of days of week, when the prize can be available
|
|
|
169
193
|
|
|
170
194
|
> `optional` **active\_from\_ts?**: `number`
|
|
171
195
|
|
|
172
|
-
|
|
196
|
+
Time from which the prize can be won (epoch ms), evaluated against `relative_period_timezone`. Populated only when the template's `expose_game_stat_on_api` is enabled
|
|
173
197
|
|
|
174
198
|
***
|
|
175
199
|
|
|
@@ -177,7 +201,7 @@ Holds time from which prize will become available, for the prizes that are targe
|
|
|
177
201
|
|
|
178
202
|
> `optional` **active\_till\_ts?**: `number`
|
|
179
203
|
|
|
180
|
-
|
|
204
|
+
Time until which the prize can be won (epoch ms), evaluated against `relative_period_timezone`. Populated only when the template's `expose_game_stat_on_api` is enabled
|
|
181
205
|
|
|
182
206
|
***
|
|
183
207
|
|
|
@@ -185,7 +209,7 @@ Holds time till which prize will become available, for the prizes that are targe
|
|
|
185
209
|
|
|
186
210
|
> `optional` **relative\_period\_timezone?**: `number`
|
|
187
211
|
|
|
188
|
-
|
|
212
|
+
Timezone offset in minutes used to evaluate `weekdays` and the active window (UTC minus local, as in JS `Date.getTimezoneOffset()` — e.g. `-180` for UTC+3)
|
|
189
213
|
|
|
190
214
|
***
|
|
191
215
|
|
|
@@ -193,7 +217,7 @@ Time zone to ensure each day aligns with your local midnight.
|
|
|
193
217
|
|
|
194
218
|
> `optional` **is\_surcharge?**: `boolean`
|
|
195
219
|
|
|
196
|
-
|
|
220
|
+
When true, the prize stays winnable even when its `pool` reaches 0 (effectively unlimited stock)
|
|
197
221
|
|
|
198
222
|
***
|
|
199
223
|
|
|
@@ -201,7 +225,7 @@ Flag indicating that the prize is surcharged (available all the time, despite po
|
|
|
201
225
|
|
|
202
226
|
> `optional` **is\_deleted?**: `boolean`
|
|
203
227
|
|
|
204
|
-
|
|
228
|
+
Always `false` in API responses — deleted prizes are excluded server-side
|
|
205
229
|
|
|
206
230
|
***
|
|
207
231
|
|
|
@@ -209,7 +233,7 @@ Flag indicating the state of the prize
|
|
|
209
233
|
|
|
210
234
|
> `optional` **custom\_data?**: `any`
|
|
211
235
|
|
|
212
|
-
The custom data of the
|
|
236
|
+
The custom data of the prize defined by the operator. Can be a JSON object, string or number
|
|
213
237
|
|
|
214
238
|
***
|
|
215
239
|
|
|
@@ -217,7 +241,7 @@ The custom data of the mini-game defined by operator in the BackOffice. Can be a
|
|
|
217
241
|
|
|
218
242
|
> `optional` **prize\_modifiers?**: [`PrizeModifiers`](../enumerations/PrizeModifiers.md)[]
|
|
219
243
|
|
|
220
|
-
|
|
244
|
+
Step-modifier tiles for step games (Treasure Hunt / Voyager) — see [PrizeModifiers](../enumerations/PrizeModifiers.md) (2x / 5x / 10x, /2 / /5 / /10, 0, reset) applied to the running total revealed during the game. Presentation only — the awarded amount is still `prize_value`
|
|
221
245
|
|
|
222
246
|
***
|
|
223
247
|
|
|
@@ -225,7 +249,7 @@ Prize modifiers that will multiply by 2x, 5x or 10x the current total. This will
|
|
|
225
249
|
|
|
226
250
|
> `optional` **allow\_split\_decimal?**: `boolean`
|
|
227
251
|
|
|
228
|
-
|
|
252
|
+
Step games (Treasure Hunt / Voyager): when true, the per-step revealed amounts of the prize value may be fractional; when false the split uses whole numbers
|
|
229
253
|
|
|
230
254
|
***
|
|
231
255
|
|
|
@@ -233,7 +257,7 @@ When enabled, you can split prize value by decimal values
|
|
|
233
257
|
|
|
234
258
|
> `optional` **hide\_prize\_from\_history?**: `boolean`
|
|
235
259
|
|
|
236
|
-
|
|
260
|
+
Operator hint to hide this prize when rendering prize-history UIs. Informational only — API responses are not filtered by it
|
|
237
261
|
|
|
238
262
|
***
|
|
239
263
|
|
|
@@ -241,7 +265,7 @@ When enabled, you can hide prize from prize history
|
|
|
241
265
|
|
|
242
266
|
> `optional` **requirements\_to\_get\_prize?**: `string`
|
|
243
267
|
|
|
244
|
-
|
|
268
|
+
Operator text describing what the user must do to be eligible for this prize (lootbox games); shown when the prize is not yet available to the user
|
|
245
269
|
|
|
246
270
|
***
|
|
247
271
|
|
|
@@ -249,4 +273,4 @@ Requirements to claim the prize (lootbox specific)
|
|
|
249
273
|
|
|
250
274
|
> `optional` **max\_give\_period\_type\_id?**: [`AttemptPeriodType`](../enumerations/AttemptPeriodType.md)
|
|
251
275
|
|
|
252
|
-
|
|
276
|
+
Period basis for the prize availability restriction — see [AttemptPeriodType](../enumerations/AttemptPeriodType.md). `CalendarDaysUserTimeZone` evaluates `weekdays` / the active window in the user's timezone; the other types use `relative_period_timezone`
|
|
@@ -96,10 +96,9 @@ in case of charging type 'Spin attempts', shows the current number of spin attem
|
|
|
96
96
|
|
|
97
97
|
> **next\_available\_spin\_ts**: `number`
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
Important: this field will not be populated if “Max number of attempts a user can do” is set to value different from 1
|
|
99
|
+
If the game limits the number of attempts per period of time, the epoch-ms time (UTC) when the next attempt becomes available.
|
|
100
|
+
Populated only when the operator enabled the "show time to the next available spin" template setting, and only when the
|
|
101
|
+
template's maximum attempts per period is 1.
|
|
103
102
|
|
|
104
103
|
***
|
|
105
104
|
|
|
@@ -144,7 +143,7 @@ The message that should be shown to the user when he cannot play the game becaus
|
|
|
144
143
|
|
|
145
144
|
> **jackpot\_current**: `number`
|
|
146
145
|
|
|
147
|
-
Current
|
|
146
|
+
Current jackpot amount, if jackpot is enabled.
|
|
148
147
|
|
|
149
148
|
***
|
|
150
149
|
|
|
@@ -192,7 +191,7 @@ The custom data of the mini-game defined by operator in the BackOffice. Can be a
|
|
|
192
191
|
|
|
193
192
|
> **prizes**: [`TMiniGamePrize`](TMiniGamePrize.md)[]
|
|
194
193
|
|
|
195
|
-
|
|
194
|
+
Prizes configured for this game — see [TMiniGamePrize](TMiniGamePrize.md)
|
|
196
195
|
|
|
197
196
|
***
|
|
198
197
|
|
|
@@ -200,7 +199,7 @@ List of prizes for mini-games
|
|
|
200
199
|
|
|
201
200
|
> `optional` **expose\_game\_stat\_on\_api?**: `boolean`
|
|
202
201
|
|
|
203
|
-
When enabled, the
|
|
202
|
+
Operator template setting. When enabled, the per-prize stock statistics (`pool`, `wins_count`, `weekdays`, `active_from_ts` / `active_till_ts`) are populated on `prizes` and kept current after every play; when disabled (default) those fields are omitted. See `getMiniGames` "Per-prize statistics"
|
|
204
203
|
|
|
205
204
|
***
|
|
206
205
|
|
|
@@ -208,7 +207,7 @@ When enabled, the number of items in the pool and number of won items will be ex
|
|
|
208
207
|
|
|
209
208
|
> `optional` **relative\_period\_timezone?**: `number`
|
|
210
209
|
|
|
211
|
-
|
|
210
|
+
Timezone offset in minutes used to evaluate the template's period-based rules (UTC minus local, as in JS `Date.getTimezoneOffset()` — e.g. `-180` for UTC+3)
|
|
212
211
|
|
|
213
212
|
***
|
|
214
213
|
|
|
@@ -216,7 +215,7 @@ Time zone to ensure each day aligns with your local midnight.
|
|
|
216
215
|
|
|
217
216
|
> `optional` **activeFromDate?**: `number`
|
|
218
217
|
|
|
219
|
-
|
|
218
|
+
Time from which the template becomes available (epoch ms); absent when not restricted
|
|
220
219
|
|
|
221
220
|
***
|
|
222
221
|
|
|
@@ -224,7 +223,7 @@ Holds time from which template will become available, for the template that are
|
|
|
224
223
|
|
|
225
224
|
> `optional` **activeTillDate?**: `number`
|
|
226
225
|
|
|
227
|
-
|
|
226
|
+
Time until which the template stays available (epoch ms); absent when not restricted
|
|
228
227
|
|
|
229
228
|
***
|
|
230
229
|
|
|
@@ -232,7 +231,7 @@ Holds time till which template will become available, for the templates that are
|
|
|
232
231
|
|
|
233
232
|
> `optional` **steps\_to\_finish\_game?**: `number`
|
|
234
233
|
|
|
235
|
-
|
|
234
|
+
Number of steps to complete the game and collect the prize (step games — Voyager / Treasure Hunt)
|
|
236
235
|
|
|
237
236
|
***
|
|
238
237
|
|
|
@@ -240,7 +239,7 @@ The amount of steps to complete the game and gather the prize
|
|
|
240
239
|
|
|
241
240
|
> `optional` **custom\_section\_id?**: `number`
|
|
242
241
|
|
|
243
|
-
|
|
242
|
+
ID of the operator-defined custom section (widget menu grouping) the mini-game is assigned to
|
|
244
243
|
|
|
245
244
|
***
|
|
246
245
|
|
|
@@ -248,7 +247,7 @@ Hold the id of the custom section
|
|
|
248
247
|
|
|
249
248
|
> **saw\_template\_ui\_definition**: [`SAWTemplateUI`](SAWTemplateUI.md)
|
|
250
249
|
|
|
251
|
-
|
|
250
|
+
Full raw UI definition of the mini-game (skin, colors, per-game visual settings) — see [SAWTemplateUI](SAWTemplateUI.md). The commonly needed values are already lifted onto this template object
|
|
252
251
|
|
|
253
252
|
***
|
|
254
253
|
|
|
@@ -256,7 +255,7 @@ The UI definition of the mini-game
|
|
|
256
255
|
|
|
257
256
|
> `optional` **game\_layout?**: [`SAWGameLayoutName`](../enumerations/SAWGameLayoutName.md)
|
|
258
257
|
|
|
259
|
-
|
|
258
|
+
Grid layout of the game. Populated only for Lootbox game types (LootboxWeekdays / LootboxCalendarDays)
|
|
260
259
|
|
|
261
260
|
***
|
|
262
261
|
|
|
@@ -264,7 +263,7 @@ The layout of the game
|
|
|
264
263
|
|
|
265
264
|
> `optional` **show\_prize\_history?**: `boolean`
|
|
266
265
|
|
|
267
|
-
|
|
266
|
+
Operator setting: show a prize-history entry point (icon / button) on this game's view
|
|
268
267
|
|
|
269
268
|
***
|
|
270
269
|
|
|
@@ -288,4 +287,4 @@ The period of time in milliseconds during which the user can do the maximum numb
|
|
|
288
287
|
|
|
289
288
|
> `optional` **expose\_user\_spin\_id?**: [`SAWExposeUserSpinIdName`](../enumerations/SAWExposeUserSpinIdName.md)
|
|
290
289
|
|
|
291
|
-
|
|
290
|
+
Which identifier to show next to a win result for transparency/audit — 'userId' (the player's external user id) or 'spinId' (the spin's transaction id). Absent when the operator disabled it
|
|
@@ -33,7 +33,7 @@ _None._
|
|
|
33
33
|
|
|
34
34
|
## Behavioral contract
|
|
35
35
|
**Preconditions**
|
|
36
|
-
-
|
|
36
|
+
- No authentication required — works in both identified and visitor mode.
|
|
37
37
|
- `jp_template_id` is mandatory.
|
|
38
38
|
|
|
39
39
|
**`onUpdate` caveat**
|
|
@@ -51,7 +51,12 @@ Treat it as a no-op for now.
|
|
|
51
51
|
Non-zero `errCode` on control-group users or generic server errors.
|
|
52
52
|
Branch on `errCode === 0` and surface `errMsg` on failure.
|
|
53
53
|
|
|
54
|
-
**Visitor mode**:
|
|
54
|
+
**Visitor mode**: supported via
|
|
55
|
+
`_smartico.vapi(lang).getJackpotEligibleGames(...)`. The eligible-games
|
|
56
|
+
list is template-level (which games contribute to the pot) and carries no
|
|
57
|
+
per-user fields, so a visitor session receives the same list an identified
|
|
58
|
+
user would. The `lang` passed to `_smartico.vapi(lang)` drives the
|
|
59
|
+
translation of game names.
|
|
55
60
|
|
|
56
61
|
**UI guidance**: see [UI Guide — `getJackpotEligibleGames`](../../docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md).
|
|
57
62
|
|
|
@@ -66,6 +71,10 @@ if (jp?.ach_related_game_allow_all) {
|
|
|
66
71
|
|
|
67
72
|
const r = await window._smartico.api.getJackpotEligibleGames({ jp_template_id: 42 });
|
|
68
73
|
console.log('[smartico] render', r.eligible_games.length, 'eligible game tiles');
|
|
74
|
+
|
|
75
|
+
// Visitor mode — same shape, language driven by the vapi(lang) argument
|
|
76
|
+
const visitor = await window._smartico.vapi('EN').getJackpotEligibleGames({ jp_template_id: 42 });
|
|
77
|
+
console.log('[smartico] visitor eligible games:', visitor.eligible_games.length);
|
|
69
78
|
```
|
|
70
79
|
|
|
71
80
|
### Example response (REAL shape)
|
|
@@ -30,56 +30,59 @@ Array of `TMiniGameTemplate`. Each item:
|
|
|
30
30
|
- `buyin_cost_gems` (number) — in case of charging type 'Gems', what is the gems amount will be deducted from user balance
|
|
31
31
|
- `buyin_cost_diamonds` (number) — in case of charging type 'Diamonds', what is the diamonds amount will be deducted from user balance
|
|
32
32
|
- `spin_count` (number) — in case of charging type 'Spin attempts', shows the current number of spin attempts that user has
|
|
33
|
-
- `next_available_spin_ts` (number) —
|
|
33
|
+
- `next_available_spin_ts` (number) — If the game limits the number of attempts per period of time, the epoch-ms time (UTC) when the next attempt becomes available. Populated only when the operator enabled the "show time to the next available spin" template setting, and only when the template's maximum attempts per period is 1.
|
|
34
34
|
- `earliest_expiration_dt` (number | null) — Soonest-expiring spin's expiration time for the current user, as an epoch-ms timestamp. `null` when the user has no expirable spins for this template — spins only expire when the template defines a spin-expiration rule (Wheel of Fortune, Loot Boxes, etc.). Pair with `latest_expiration_dt` to render a "spins expire between X and Y" window.
|
|
35
35
|
- `latest_expiration_dt` (number | null) — Latest-expiring spin's expiration time for the current user, as an epoch-ms timestamp. `null` when the user has no expirable spins; equals `earliest_expiration_dt` when a single expiration applies.
|
|
36
36
|
- `over_limit_message` (string) — The message that should be shown to the user when he cannot play the game, server rejected attempt with error code SAWSpinErrorCode.SAW_FAILED_MAX_SPINS_REACHED
|
|
37
37
|
- `no_attempts_message` (string) — The message that should be shown to the user when he cannot play the game because he doesn't have spin attempts or points.
|
|
38
|
-
- `jackpot_current` (number) — Current
|
|
38
|
+
- `jackpot_current` (number) — Current jackpot amount, if jackpot is enabled.
|
|
39
39
|
- `jackpot_add_on_attempt` (number) — The amount that will be added to the jackpot every time when somebody plays the game. Note that the contribution amount is abstract, means that no money or points are deducted from the user balance.
|
|
40
40
|
- `jackpot_symbol` (string) — The symbol of jackpot that is giving the sense to the 'amount' E.g. the symbol could be EUR and connected to the amount it can indicate that amount is monetary, e.g. '100 EUR'. Or the symbol can be 'Free spins' and connected to the amount it can indicate that amount is number of free spins, e.g. '100 Free spins'.
|
|
41
41
|
- `promo_image` (string) — The promo image, 500x240px
|
|
42
42
|
- `promo_text` (string) — The promo text
|
|
43
43
|
- `custom_data` (any) — The custom data of the mini-game defined by operator in the BackOffice. Can be a JSON object, string or number
|
|
44
|
-
- `prizes` (TMiniGamePrize[]) —
|
|
44
|
+
- `prizes` (TMiniGamePrize[]) — Prizes configured for this game — see `TMiniGamePrize`
|
|
45
45
|
- `id` (number) — ID of the prize
|
|
46
|
-
- `name` (string) —
|
|
47
|
-
- `prize_type` (MiniGamePrizeTypeName) — The type of the prize
|
|
46
|
+
- `name` (string) — Display name of the prize, pre-translated; any jackpot placeholder in it arrives resolved to the live jackpot value
|
|
47
|
+
- `prize_type` (MiniGamePrizeTypeName) — The type of the prize — see `MiniGamePrizeTypeName` ('no-prize', 'points', 'gems-and-diamonds', 'spin', 'bonus', 'jackpot', 'raffle-ticket', 'mission', 'change-level', 'manual')
|
|
48
48
|
- `prize_value` (number) — Numeric value of the prize in case it's 'points' or 'spin' type. For other types of prizes this value is not relevant. For example for prize '100 points' the prize_value will be 100. For '100 free spins' the prize_value will be 100.
|
|
49
|
-
- `font_size` (number) — Custom font size for the prize (desktop
|
|
50
|
-
- `font_size_mobile` (number) — Custom font size for the prize
|
|
49
|
+
- `font_size` (number) — Custom font size in px for rendering the prize name on the game surface (e.g. a wheel sector), desktop
|
|
50
|
+
- `font_size_mobile` (number) — Custom font size in px for the prize name, mobile; falls back to `font_size` when absent
|
|
51
51
|
- `icon` (string) — The URL of the icon of the prize, aspect ratio 1:1
|
|
52
|
-
- `position` (number) —
|
|
53
|
-
- `sectors` (number[]) —
|
|
54
|
-
- `acknowledge_type` (SAWAcknowledgeTypeName) —
|
|
52
|
+
- `position` (number) — For Scratch Card games — relative order of the prize in the scratch grid (lower first). May be absent for other game types
|
|
53
|
+
- `sectors` (number[]) — For Spin-a-Wheel games — wheel sector indices this prize occupies. Absent for non-wheel games
|
|
54
|
+
- `acknowledge_type` (SAWAcknowledgeTypeName) — Which win modal the prize uses — see `SAWAcknowledgeTypeName` (Silent / QuickMessage / FullMessage / ExplicitAcknowledge)
|
|
55
55
|
- `aknowledge_message` (string) — Message that will be shown to user in modal pop-up
|
|
56
|
-
- `
|
|
57
|
-
- `
|
|
58
|
-
- `
|
|
59
|
-
- `
|
|
56
|
+
- `aknowledge_message_lose` (string) — Message shown instead of `aknowledge_message` when the spin is finalised as lost (`lose: true` acknowledge flows — games with a client-decided outcome, e.g. Voyager). Absent unless configured
|
|
57
|
+
- `acknowledge_dp` (string) — Deep link executed when the user taps the main action button in the win modal (run it via `_smartico.dp()`)
|
|
58
|
+
- `acknowledge_action_title` (string) — Label of the main action button in the win modal
|
|
59
|
+
- `acknowledge_dp_additional` (string) — Deep link of the additional action button in the win modal
|
|
60
|
+
- `acknowledge_action_title_additional` (string) — Label of the additional action button in the win modal
|
|
61
|
+
- `second_btn` (string) — Deep link of the secondary button in the win modal
|
|
62
|
+
- `second_btn_action_title` (string) — Label of the secondary button in the win modal
|
|
60
63
|
- `out_of_stock_message` (string) — Message when the prize pool is empty for that specific prize
|
|
61
|
-
- `pool` (number) —
|
|
62
|
-
- `pool_initial` (number) — Initial
|
|
63
|
-
- `wins_count` (number) — Number of
|
|
64
|
-
- `weekdays` (number[]) —
|
|
65
|
-
- `active_from_ts` (number) —
|
|
66
|
-
- `active_till_ts` (number) —
|
|
67
|
-
- `relative_period_timezone` (number) —
|
|
68
|
-
- `is_surcharge` (boolean) —
|
|
69
|
-
- `is_deleted` (boolean) —
|
|
70
|
-
- `custom_data` (any) — The custom data of the
|
|
71
|
-
- `prize_modifiers` (PrizeModifiers[]) —
|
|
72
|
-
- `allow_split_decimal` (boolean) —
|
|
73
|
-
- `hide_prize_from_history` (boolean) —
|
|
74
|
-
- `requirements_to_get_prize` (string) —
|
|
75
|
-
- `max_give_period_type_id` (AttemptPeriodType) —
|
|
76
|
-
- `expose_game_stat_on_api` (boolean) — When enabled, the
|
|
77
|
-
- `relative_period_timezone` (number) —
|
|
78
|
-
- `activeFromDate` (number) —
|
|
79
|
-
- `activeTillDate` (number) —
|
|
80
|
-
- `steps_to_finish_game` (number) —
|
|
81
|
-
- `custom_section_id` (number) —
|
|
82
|
-
- `saw_template_ui_definition` (SAWTemplateUI) —
|
|
64
|
+
- `pool` (number) — Remaining stock of the prize — decrements on each win, refunded if the spin is finalised as lost. Populated only when the template's `expose_game_stat_on_api` is enabled; always populated for MatchX / Quiz games
|
|
65
|
+
- `pool_initial` (number) — Initial (configured) stock of the prize. Populated regardless of `expose_game_stat_on_api`
|
|
66
|
+
- `wins_count` (number) — Number of times the prize has been won, across all players. Populated only when the template's `expose_game_stat_on_api` is enabled
|
|
67
|
+
- `weekdays` (number[]) — ISO weekday numbers (1 = Monday … 7 = Sunday) on which the prize can be won; absent = any day. Populated only when the template's `expose_game_stat_on_api` is enabled
|
|
68
|
+
- `active_from_ts` (number) — Time from which the prize can be won (epoch ms), evaluated against `relative_period_timezone`. Populated only when the template's `expose_game_stat_on_api` is enabled
|
|
69
|
+
- `active_till_ts` (number) — Time until which the prize can be won (epoch ms), evaluated against `relative_period_timezone`. Populated only when the template's `expose_game_stat_on_api` is enabled
|
|
70
|
+
- `relative_period_timezone` (number) — Timezone offset in minutes used to evaluate `weekdays` and the active window (UTC minus local, as in JS `Date.getTimezoneOffset()` — e.g. `-180` for UTC+3)
|
|
71
|
+
- `is_surcharge` (boolean) — When true, the prize stays winnable even when its `pool` reaches 0 (effectively unlimited stock)
|
|
72
|
+
- `is_deleted` (boolean) — Always `false` in API responses — deleted prizes are excluded server-side
|
|
73
|
+
- `custom_data` (any) — The custom data of the prize defined by the operator. Can be a JSON object, string or number
|
|
74
|
+
- `prize_modifiers` (PrizeModifiers[]) — Step-modifier tiles for step games (Treasure Hunt / Voyager) — see `PrizeModifiers` (2x / 5x / 10x, /2 / /5 / /10, 0, reset) applied to the running total revealed during the game. Presentation only — the awarded amount is still `prize_value`
|
|
75
|
+
- `allow_split_decimal` (boolean) — Step games (Treasure Hunt / Voyager): when true, the per-step revealed amounts of the prize value may be fractional; when false the split uses whole numbers
|
|
76
|
+
- `hide_prize_from_history` (boolean) — Operator hint to hide this prize when rendering prize-history UIs. Informational only — API responses are not filtered by it
|
|
77
|
+
- `requirements_to_get_prize` (string) — Operator text describing what the user must do to be eligible for this prize (lootbox games); shown when the prize is not yet available to the user
|
|
78
|
+
- `max_give_period_type_id` (AttemptPeriodType) — Period basis for the prize availability restriction — see `AttemptPeriodType`. `CalendarDaysUserTimeZone` evaluates `weekdays` / the active window in the user's timezone; the other types use `relative_period_timezone`
|
|
79
|
+
- `expose_game_stat_on_api` (boolean) — Operator template setting. When enabled, the per-prize stock statistics (`pool`, `wins_count`, `weekdays`, `active_from_ts` / `active_till_ts`) are populated on `prizes` and kept current after every play; when disabled (default) those fields are omitted. See `getMiniGames` "Per-prize statistics"
|
|
80
|
+
- `relative_period_timezone` (number) — Timezone offset in minutes used to evaluate the template's period-based rules (UTC minus local, as in JS `Date.getTimezoneOffset()` — e.g. `-180` for UTC+3)
|
|
81
|
+
- `activeFromDate` (number) — Time from which the template becomes available (epoch ms); absent when not restricted
|
|
82
|
+
- `activeTillDate` (number) — Time until which the template stays available (epoch ms); absent when not restricted
|
|
83
|
+
- `steps_to_finish_game` (number) — Number of steps to complete the game and collect the prize (step games — Voyager / Treasure Hunt)
|
|
84
|
+
- `custom_section_id` (number) — ID of the operator-defined custom section (widget menu grouping) the mini-game is assigned to
|
|
85
|
+
- `saw_template_ui_definition` (SAWTemplateUI) — Full raw UI definition of the mini-game (skin, colors, per-game visual settings) — see `SAWTemplateUI`. The commonly needed values are already lifted onto this template object
|
|
83
86
|
- `skin` (string)
|
|
84
87
|
- `name` (string)
|
|
85
88
|
- `description` (string)
|
|
@@ -124,11 +127,11 @@ Array of `TMiniGameTemplate`. Each item:
|
|
|
124
127
|
id: string;
|
|
125
128
|
content: string;
|
|
126
129
|
})
|
|
127
|
-
- `game_layout` (SAWGameLayoutName) —
|
|
128
|
-
- `show_prize_history` (boolean) —
|
|
130
|
+
- `game_layout` (SAWGameLayoutName) — Grid layout of the game. Populated only for Lootbox game types (LootboxWeekdays / LootboxCalendarDays)
|
|
131
|
+
- `show_prize_history` (boolean) — Operator setting: show a prize-history entry point (icon / button) on this game's view
|
|
129
132
|
- `max_number_of_attempts` (number) — The maximum number of attempts that user can do during period of time
|
|
130
133
|
- `max_spins_period_ms` (number) — The period of time in milliseconds during which the user can do the maximum number of attempts
|
|
131
|
-
- `expose_user_spin_id` (SAWExposeUserSpinIdName) —
|
|
134
|
+
- `expose_user_spin_id` (SAWExposeUserSpinIdName) — Which identifier to show next to a win result for transparency/audit — 'userId' (the player's external user id) or 'spinId' (the spin's transaction id). Absent when the operator disabled it
|
|
132
135
|
|
|
133
136
|
## Behavioral contract
|
|
134
137
|
**Subscription model (`onUpdate`)**
|
|
@@ -166,6 +169,27 @@ played via `playMiniGame`; the exceptions are:
|
|
|
166
169
|
games server (not this SDK); the SAW spin is fired
|
|
167
170
|
server-internally to deduct the buy-in.
|
|
168
171
|
|
|
172
|
+
**Per-prize statistics (`expose_game_stat_on_api`)**
|
|
173
|
+
Each template's `prizes` array always carries the definition
|
|
174
|
+
fields — name, icon, `prize_type`, `prize_value`, acknowledge
|
|
175
|
+
configuration. The stock-statistics fields are gated by an
|
|
176
|
+
operator template setting, surfaced as
|
|
177
|
+
`expose_game_stat_on_api`:
|
|
178
|
+
- Populated when enabled: `pool` (remaining stock),
|
|
179
|
+
`wins_count` (total wins across all players), `weekdays`
|
|
180
|
+
(ISO 1–7 days the prize can be won), `active_from_ts` /
|
|
181
|
+
`active_till_ts` (prize availability window).
|
|
182
|
+
- Omitted when disabled (the default) — this keeps the live
|
|
183
|
+
prize economy (stock levels, win rates, schedules) hidden
|
|
184
|
+
from players.
|
|
185
|
+
- Exception: `pool` is always populated for `MatchX` / `Quiz`
|
|
186
|
+
templates, whose game flow needs the remaining stock.
|
|
187
|
+
- `pool_initial` is populated regardless of the setting.
|
|
188
|
+
When enabled, the values are also kept current — the server
|
|
189
|
+
refreshes the prize rows on each fetch and drops its template
|
|
190
|
+
caches after every play, so `pool` / `wins_count` are safe to
|
|
191
|
+
drive an "X prizes left" scarcity UI.
|
|
192
|
+
|
|
169
193
|
**Cache TTL**: the SDK caches the response for 30 seconds. Cache
|
|
170
194
|
is fully cleared on login / logout.
|
|
171
195
|
|