@smartico/public-api 0.0.408 → 0.0.410

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 (53) hide show
  1. package/dist/GamePick/GamePickTypes.d.ts +6 -1
  2. package/dist/MiniGames/SAWDoAknowledgeRequest.d.ts +2 -0
  3. package/dist/MiniGames/SAWPrize.d.ts +9 -0
  4. package/dist/MiniGames/SAWTemplate.d.ts +1 -0
  5. package/dist/SmarticoAPI.d.ts +1 -1
  6. package/dist/SmarticoLib/index.d.ts +1 -1
  7. package/dist/Tournaments/GetClanTournamentPlayersResponse.d.ts +2 -16
  8. package/dist/WSAPI/WSAPIJackpots.d.ts +11 -2
  9. package/dist/WSAPI/WSAPIMiniGames.d.ts +86 -23
  10. package/dist/WSAPI/WSAPITypes.d.ts +16 -12
  11. package/dist/index.js +109 -31
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.modern.mjs +106 -28
  14. package/dist/index.modern.mjs.map +1 -1
  15. package/docs/api/README.md +0 -2
  16. package/docs/api/classes/WSAPIJackpots.md +11 -2
  17. package/docs/api/classes/WSAPIMiniGames.md +86 -23
  18. package/docs/api/functions/clanTournamentPlayersTransform.md +2 -2
  19. package/docs/api/interfaces/GamePickEvent.md +6 -1
  20. package/docs/api/interfaces/SAWDoAknowledgeRequest.md +8 -0
  21. package/docs/api/interfaces/SAWPrize.md +18 -0
  22. package/docs/api/interfaces/SAWTemplate.md +2 -0
  23. package/docs/api/interfaces/TMiniGamePrize.md +25 -9
  24. package/docs/api/interfaces/TMiniGameTemplate.md +3 -3
  25. package/docs/capabilities/gamePickGetActiveRound.md +1 -1
  26. package/docs/capabilities/gamePickGetActiveRounds.md +1 -1
  27. package/docs/capabilities/gamePickGetHistory.md +1 -1
  28. package/docs/capabilities/gamePickGetRoundInfoForUser.md +1 -1
  29. package/docs/capabilities/gamePickSubmitSelection.md +1 -1
  30. package/docs/capabilities/gamePickSubmitSelectionQuiz.md +1 -1
  31. package/docs/capabilities/getJackpotEligibleGames.md +11 -2
  32. package/docs/capabilities/getMiniGames.md +35 -12
  33. package/docs/capabilities/miniGameWinAcknowledgeRequest.md +30 -7
  34. package/docs/capabilities/playMiniGame.md +27 -14
  35. package/docs/native/PROTOCOL.md +3 -0
  36. package/docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md +8 -0
  37. package/docs/ui/minigames/UIGuide_getMiniGames.md +24 -0
  38. package/docs/ui/minigames/UIGuide_getMiniGamesHistory.md +1 -1
  39. package/docs/ui/minigames/UIGuide_playMiniGame.md +28 -1
  40. package/package.json +2 -2
  41. package/src/GamePick/GamePickTypes.ts +6 -1
  42. package/src/MiniGames/SAWDoAknowledgeRequest.ts +2 -0
  43. package/src/MiniGames/SAWGetTemplatesResponse.ts +2 -0
  44. package/src/MiniGames/SAWPrize.ts +9 -0
  45. package/src/MiniGames/SAWTemplate.ts +1 -0
  46. package/src/SmarticoAPI.ts +2 -1
  47. package/src/SmarticoLib/index.ts +1 -1
  48. package/src/Tournaments/GetClanTournamentPlayersResponse.ts +5 -18
  49. package/src/WSAPI/WSAPIJackpots.ts +11 -2
  50. package/src/WSAPI/WSAPIMiniGames.ts +85 -24
  51. package/src/WSAPI/WSAPITypes.ts +16 -12
  52. package/docs/api/interfaces/TClanTournamentPlayer.md +0 -55
  53. package/docs/api/interfaces/TClanTournamentPlayersResult.md +0 -13
@@ -195,8 +195,6 @@
195
195
  - [StoreItemPublicMeta](interfaces/StoreItemPublicMeta.md)
196
196
  - [ClanTournamentPlayerRaw](interfaces/ClanTournamentPlayerRaw.md)
197
197
  - [GetClanTournamentPlayersResponse](interfaces/GetClanTournamentPlayersResponse.md)
198
- - [TClanTournamentPlayer](interfaces/TClanTournamentPlayer.md)
199
- - [TClanTournamentPlayersResult](interfaces/TClanTournamentPlayersResult.md)
200
198
  - [GetTournamentInfoResponse](interfaces/GetTournamentInfoResponse.md)
201
199
  - [Tournament](interfaces/Tournament.md)
202
200
  - [ClanLeaderboardEntry](interfaces/ClanLeaderboardEntry.md)
@@ -400,7 +400,7 @@ Optional callback; not auto-invoked today.
400
400
  #### Remarks
401
401
 
402
402
  **Preconditions**
403
- - User must be authenticated. Visitor mode not supported.
403
+ - No authentication required — works in both identified and visitor mode.
404
404
  - `jp_template_id` is mandatory.
405
405
 
406
406
  **`onUpdate` caveat**
@@ -418,7 +418,12 @@ Treat it as a no-op for now.
418
418
  Non-zero `errCode` on control-group users or generic server errors.
419
419
  Branch on `errCode === 0` and surface `errMsg` on failure.
420
420
 
421
- **Visitor mode**: not supported.
421
+ **Visitor mode**: supported via
422
+ `_smartico.vapi(lang).getJackpotEligibleGames(...)`. The eligible-games
423
+ list is template-level (which games contribute to the pot) and carries no
424
+ per-user fields, so a visitor session receives the same list an identified
425
+ user would. The `lang` passed to `_smartico.vapi(lang)` drives the
426
+ translation of game names.
422
427
 
423
428
  **UI guidance**: see [UI Guide — `getJackpotEligibleGames`](../_media/UIGuide_getJackpotEligibleGames.md).
424
429
 
@@ -434,6 +439,10 @@ if (jp?.ach_related_game_allow_all) {
434
439
 
435
440
  const r = await window._smartico.api.getJackpotEligibleGames({ jp_template_id: 42 });
436
441
  console.log('[smartico] render', r.eligible_games.length, 'eligible game tiles');
442
+
443
+ // Visitor mode — same shape, language driven by the vapi(lang) argument
444
+ const visitor = await window._smartico.vapi('EN').getJackpotEligibleGames({ jp_template_id: 42 });
445
+ console.log('[smartico] visitor eligible games:', visitor.eligible_games.length);
437
446
  ```
438
447
 
439
448
  ***
@@ -78,6 +78,27 @@ played via [playMiniGame](#playminigame); the exceptions are:
78
78
  games server (not this SDK); the SAW spin is fired
79
79
  server-internally to deduct the buy-in.
80
80
 
81
+ **Per-prize statistics (`expose_game_stat_on_api`)**
82
+ Each template's `prizes` array always carries the definition
83
+ fields — name, icon, `prize_type`, `prize_value`, acknowledge
84
+ configuration. The stock-statistics fields are gated by an
85
+ operator template setting, surfaced as
86
+ `expose_game_stat_on_api`:
87
+ - Populated when enabled: `pool` (remaining stock),
88
+ `wins_count` (total wins across all players), `weekdays`
89
+ (ISO 1–7 days the prize can be won), `active_from_ts` /
90
+ `active_till_ts` (prize availability window).
91
+ - Omitted when disabled (the default) — this keeps the live
92
+ prize economy (stock levels, win rates, schedules) hidden
93
+ from players.
94
+ - Exception: `pool` is always populated for `MatchX` / `Quiz`
95
+ templates, whose game flow needs the remaining stock.
96
+ - `pool_initial` is populated regardless of the setting.
97
+ When enabled, the values are also kept current — the server
98
+ refreshes the prize rows on each fetch and drops its template
99
+ caches after every play, so `pool` / `wins_count` are safe to
100
+ drive an "X prizes left" scarcity UI.
101
+
81
102
  **Cache TTL**: the SDK caches the response for 30 seconds. Cache
82
103
  is fully cleared on login / logout.
83
104
 
@@ -345,14 +366,19 @@ without waiting for the win to be marked delivered. You finalise
345
366
  it later by calling [miniGameWinAcknowledgeRequest](#minigamewinacknowledgerequest) with the
346
367
  `request_id` returned on this result.
347
368
 
348
- What `acknowledge: false` does and does NOT defer:
349
- - For STANDARD prizes the value is credited at spin time
350
- regardless, so opting out does NOT delay the balance change —
351
- it only defers the "delivered" bookkeeping and the `is_claimed`
352
- flag flipping in [getMiniGamesHistory](#getminigameshistory).
353
- - For operator-configured "explicit claim" prizes the credit IS
354
- deferred until the spin is acknowledged, so those require an
355
- explicit acknowledge to finalise.
369
+ What `acknowledge: false` defers:
370
+ - For STANDARD prizes the value is credited when the spin is
371
+ finalised — by your later acknowledge or, failing that, by the
372
+ server-side fallback below — so opting out delays the balance
373
+ change by at most that fallback window. The `is_claimed` flag in
374
+ [getMiniGamesHistory](#getminigameshistory) flips on the same finalisation.
375
+ - For operator-configured "explicit claim" prizes the credit is
376
+ deferred until your explicit acknowledge — the fallback does not
377
+ cover them.
378
+
379
+ While the spin is un-finalised it can also be finalised as LOST —
380
+ prize discarded back to the pool — via
381
+ [miniGameWinAcknowledgeRequest](#minigamewinacknowledgerequest) with `{ lose: true }`.
356
382
 
357
383
  A server-side fallback auto-acknowledges ordinary un-acknowledged
358
384
  spins after a short delay (about 1–3 minutes), so an ordinary
@@ -383,8 +409,10 @@ refreshed array.
383
409
  time the call resolves. Balance updates flow via the
384
410
  user-properties channel (observe via [getUserProfile](WSAPIUser.md#getuserprofile)).
385
411
  - Prize value credited per the prize's type (see "Prize handling"
386
- above). Standard prizes are credited at spin time; "explicit
387
- claim" prizes are credited when the spin is acknowledged.
412
+ above) when the spin is finalised — with the default
413
+ auto-acknowledge that happens before the call resolves;
414
+ "explicit claim" prizes are credited only by an explicit
415
+ acknowledge.
388
416
  - The play is recorded server-side for analytics / reporting.
389
417
 
390
418
  **UI guidance**: see [UI Guide — `playMiniGame`](../_media/UIGuide_playMiniGame.md).
@@ -432,18 +460,24 @@ if (r.err_code === 0) {
432
460
  ```
433
461
 
434
462
  Manual finalisation (`acknowledge: false`) — e.g. an explicit
435
- "Claim" CTA, or finalising on your own schedule:
463
+ "Claim" CTA, a decline/forfeit flow, or finalising on your own
464
+ schedule:
436
465
  ```ts
437
466
  const r = await window._smartico.api.playMiniGame(game.id, { acknowledge: false });
438
467
  if (r.err_code === 0) {
439
- // Spin resolved but not yet acknowledged. For standard prizes the
440
- // balance already changed server-side; "explicit claim" prizes
441
- // are credited only by the acknowledge below.
468
+ // Spin resolved but not yet finalised — the prize is not credited
469
+ // yet. Your acknowledge below credits it (for standard prizes the
470
+ // server-side fallback would eventually do the same).
442
471
  console.log('[smartico] prize won — show the result / Claim CTA, then finalise');
443
472
 
444
473
  // On the user's Claim click, finalise with the request_id from the result.
445
474
  await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id);
446
475
  console.log('[smartico] win finalised — refresh getUserProfile / getMiniGames to reflect it');
476
+
477
+ // Or, if the game flow ends in the player declining / losing the
478
+ // drawn prize, finalise the spin as lost instead — the prize is
479
+ // not credited and returns to the prize pool:
480
+ // await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id, { lose: true });
447
481
  }
448
482
  ```
449
483
 
@@ -451,12 +485,13 @@ if (r.err_code === 0) {
451
485
 
452
486
  ### miniGameWinAcknowledgeRequest()
453
487
 
454
- > **miniGameWinAcknowledgeRequest**(`request_id`): `Promise`\<[`SAWDoAknowledgeResponse`](../interfaces/SAWDoAknowledgeResponse.md)\>
488
+ > **miniGameWinAcknowledgeRequest**(`request_id`, `__namedParameters?`): `Promise`\<[`SAWDoAknowledgeResponse`](../interfaces/SAWDoAknowledgeResponse.md)\>
455
489
 
456
490
  Manually acknowledges a mini-game spin — marks the win delivered
457
- server-side. Most consumers do NOT need this: [playMiniGame](#playminigame)
458
- acknowledges by default (`acknowledge: true`) and
459
- [playMiniGameBatch](#playminigamebatch) acknowledges automatically. Call this
491
+ server-side, or (with `lose: true`) finalises it as lost and
492
+ returns the prize to the pool. Most consumers do NOT need this:
493
+ [playMiniGame](#playminigame) acknowledges by default (`acknowledge: true`)
494
+ and [playMiniGameBatch](#playminigamebatch) acknowledges automatically. Call this
460
495
  directly only when you took ownership of the acknowledge step or
461
496
  need to recover a lost one.
462
497
 
@@ -472,6 +507,12 @@ Correlation id of the spin to finalise: the
472
507
  `client_request_id` of a
473
508
  [getMiniGamesHistory](#getminigameshistory) row.
474
509
 
510
+ ##### \_\_namedParameters?
511
+
512
+ ###### lose?
513
+
514
+ `boolean`
515
+
475
516
  #### Returns
476
517
 
477
518
  `Promise`\<[`SAWDoAknowledgeResponse`](../interfaces/SAWDoAknowledgeResponse.md)\>
@@ -496,6 +537,23 @@ The `request_id` on a [playMiniGame](#playminigame) result and the
496
537
  `client_request_id` on a [getMiniGamesHistory](#getminigameshistory) row are the
497
538
  same correlation id — this method accepts either.
498
539
 
540
+ **Finalising as lost (`lose: true`)**
541
+ Pass `{ lose: true }` to finalise the spin as LOST instead of won:
542
+ the prize is NOT credited and is returned to the game's prize pool
543
+ (available again for other players), and the spin fires the
544
+ mini-game "lose" engagement event instead of the win one. On the
545
+ next [getMiniGamesHistory](#getminigameshistory) fetch the row shows `is_claimed:
546
+ true` with no prize attached. Use this for game mechanics where the
547
+ player can decline or forfeit the drawn prize — e.g. a
548
+ gamble/discard step, or a client-driven game where the user's final
549
+ action decides whether the pre-drawn prize is actually won. It only
550
+ works on a spin that is not yet finalised, so it requires playing
551
+ with `acknowledge: false` and calling promptly — once the automatic
552
+ acknowledge or the server-side fallback (below) has finalised the
553
+ spin, `lose: true` is a no-op and the prize stays credited.
554
+ ("Explicit claim" prizes are exempt from the fallback, so for them
555
+ there is no time pressure.)
556
+
499
557
  **Idempotency**: safe. Acknowledging a spin that is already
500
558
  finalised — by you, by the automatic acknowledge, or by the
501
559
  fallback — is a no-op with no double credit. Acknowledging a
@@ -510,11 +568,12 @@ exception — excluded from the fallback, they require an explicit
510
568
  call here.
511
569
 
512
570
  **Side effects** (first successful call for an un-acknowledged spin)
513
- - For "explicit claim" prizes, the prize value is credited on this
514
- call. For standard prizes the value was already credited at spin
515
- time (see [playMiniGame](#playminigame) "Prize handling"); this call only
516
- marks the win delivered.
517
- - The spin's `is_claimed` flips to `true` on the next
571
+ - Default (win): the prize value is credited on this call — this is
572
+ the finalisation step that credits standard and "explicit claim"
573
+ prizes alike (see [playMiniGame](#playminigame) "Prize handling").
574
+ - With `lose: true`: no credit; the prize returns to the prize pool
575
+ and the "lose" engagement event fires.
576
+ - Either way the spin's `is_claimed` flips to `true` on the next
518
577
  [getMiniGamesHistory](#getminigameshistory) fetch.
519
578
 
520
579
  **Visitor mode**: not supported.
@@ -529,6 +588,10 @@ if (r.err_code === 0) {
529
588
  await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id);
530
589
  }
531
590
 
591
+ // Decline / forfeit — finalise the same spin as lost instead:
592
+ // the prize is not credited and goes back to the prize pool.
593
+ await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id, { lose: true });
594
+
532
595
  // Recovery — re-acknowledge any spins a batch acknowledge missed.
533
596
  const history = await window._smartico.api.getMiniGamesHistory({ limit: 20 });
534
597
  for (const row of history.filter(h => !h.is_claimed)) {
@@ -1,6 +1,6 @@
1
1
  # Function: clanTournamentPlayersTransform()
2
2
 
3
- > **clanTournamentPlayersTransform**(`response`): [`TClanTournamentPlayersResult`](../interfaces/TClanTournamentPlayersResult.md)
3
+ > **clanTournamentPlayersTransform**(`response`): [`TClanTournamentPlayers`](../interfaces/TClanTournamentPlayers.md)
4
4
 
5
5
  ## Parameters
6
6
 
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Returns
12
12
 
13
- [`TClanTournamentPlayersResult`](../interfaces/TClanTournamentPlayersResult.md)
13
+ [`TClanTournamentPlayers`](../interfaces/TClanTournamentPlayers.md)
@@ -104,7 +104,12 @@ Whether this event is still accepting predictions
104
104
 
105
105
  > `optional` **odds\_details?**: `object`
106
106
 
107
- Betting odds details for the event outcomes
107
+ Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …).
108
+ Dual-purpose by event type:
109
+ - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`).
110
+ - Quiz: when the round's `show_users_preference` is `true`, these are aggregated
111
+ **user-preference percentages** — what other users predicted, summing to ~100
112
+ (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
108
113
 
109
114
  #### odd\_value
110
115
 
@@ -39,3 +39,11 @@
39
39
  ### request\_id
40
40
 
41
41
  > **request\_id**: `string`
42
+
43
+ ***
44
+
45
+ ### lose?
46
+
47
+ > `optional` **lose?**: `boolean`
48
+
49
+ When true, finalises the spin as lost: the prize is not credited and is returned to the prize pool.
@@ -48,54 +48,72 @@
48
48
 
49
49
  > `optional` **pool?**: `number`
50
50
 
51
+ Remaining stock. Present only when the template's `expose_game_stat_on_api` is enabled; always present for MatchX / Quiz games
52
+
51
53
  ***
52
54
 
53
55
  ### pool\_initial?
54
56
 
55
57
  > `optional` **pool\_initial?**: `number`
56
58
 
59
+ Initial (configured) stock. Present regardless of `expose_game_stat_on_api`
60
+
57
61
  ***
58
62
 
59
63
  ### wins\_count?
60
64
 
61
65
  > `optional` **wins\_count?**: `number`
62
66
 
67
+ Times the prize has been won, across all players. Present only when `expose_game_stat_on_api` is enabled
68
+
63
69
  ***
64
70
 
65
71
  ### weekdays?
66
72
 
67
73
  > `optional` **weekdays?**: `number`[]
68
74
 
75
+ ISO weekday numbers (1 = Monday … 7 = Sunday) the prize can be won on; absent = any day. Present only when `expose_game_stat_on_api` is enabled
76
+
69
77
  ***
70
78
 
71
79
  ### active\_from\_ts?
72
80
 
73
81
  > `optional` **active\_from\_ts?**: `number`
74
82
 
83
+ Prize availability window start (epoch ms), evaluated against `relative_period_timezone`. Present only when `expose_game_stat_on_api` is enabled
84
+
75
85
  ***
76
86
 
77
87
  ### active\_till\_ts?
78
88
 
79
89
  > `optional` **active\_till\_ts?**: `number`
80
90
 
91
+ Prize availability window end (epoch ms), evaluated against `relative_period_timezone`. Present only when `expose_game_stat_on_api` is enabled
92
+
81
93
  ***
82
94
 
83
95
  ### relative\_period\_timezone?
84
96
 
85
97
  > `optional` **relative\_period\_timezone?**: `number`
86
98
 
99
+ Timezone offset in minutes for `weekdays` / active-window evaluation (UTC minus local, as in JS `Date.getTimezoneOffset()`)
100
+
87
101
  ***
88
102
 
89
103
  ### is\_surcharge?
90
104
 
91
105
  > `optional` **is\_surcharge?**: `boolean`
92
106
 
107
+ When true, the prize stays winnable at `pool` 0 (unlimited stock)
108
+
93
109
  ***
94
110
 
95
111
  ### is\_deleted?
96
112
 
97
113
  > `optional` **is\_deleted?**: `boolean`
98
114
 
115
+ Always `false` in API responses — deleted prizes are excluded server-side
116
+
99
117
  ***
100
118
 
101
119
  ### prize\_details\_json?
@@ -158,6 +158,8 @@ Latest-expiring spin's expiration time for this user (epoch ms); `null`/absent w
158
158
 
159
159
  > `optional` **expose\_game\_stat\_on\_api?**: `boolean`
160
160
 
161
+ Operator template setting. When enabled, the per-prize stock statistics (`pool`, `wins_count`, `weekdays`, `active_from_ts` / `active_till_ts`) are populated on `prizes`; when disabled (default) the server strips them from the response (`pool` is kept for MatchX / Quiz games).
162
+
161
163
  ***
162
164
 
163
165
  ### requires\_prize\_claim?
@@ -125,6 +125,22 @@ The name of the action button in modal pop-up (additional)
125
125
 
126
126
  ***
127
127
 
128
+ ### second\_btn?
129
+
130
+ > `optional` **second\_btn?**: `string`
131
+
132
+ Deep link that will trigger some action in modal pop-up (second button)
133
+
134
+ ***
135
+
136
+ ### second\_btn\_action\_title?
137
+
138
+ > `optional` **second\_btn\_action\_title?**: `string`
139
+
140
+ The name of the action button in modal pop-up (second button)
141
+
142
+ ***
143
+
128
144
  ### out\_of\_stock\_message?
129
145
 
130
146
  > `optional` **out\_of\_stock\_message?**: `string`
@@ -137,7 +153,7 @@ Message when the prize pool is empty for that specific prize
137
153
 
138
154
  > `optional` **pool?**: `number`
139
155
 
140
- Number of items in stock
156
+ 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
157
 
142
158
  ***
143
159
 
@@ -145,7 +161,7 @@ Number of items in stock
145
161
 
146
162
  > `optional` **pool\_initial?**: `number`
147
163
 
148
- Initial number of items in stock
164
+ Initial (configured) stock of the prize. Populated regardless of `expose_game_stat_on_api`
149
165
 
150
166
  ***
151
167
 
@@ -153,7 +169,7 @@ Initial number of items in stock
153
169
 
154
170
  > `optional` **wins\_count?**: `number`
155
171
 
156
- Number of wins in game
172
+ 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
173
 
158
174
  ***
159
175
 
@@ -161,7 +177,7 @@ Number of wins in game
161
177
 
162
178
  > `optional` **weekdays?**: `number`[]
163
179
 
164
- Number of days of week, when the prize can be available
180
+ 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
181
 
166
182
  ***
167
183
 
@@ -169,7 +185,7 @@ Number of days of week, when the prize can be available
169
185
 
170
186
  > `optional` **active\_from\_ts?**: `number`
171
187
 
172
- Holds time from which prize will become available, for the prizes that are targeted to be available from specific time (UNIX timestamp)
188
+ 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
189
 
174
190
  ***
175
191
 
@@ -177,7 +193,7 @@ Holds time from which prize will become available, for the prizes that are targe
177
193
 
178
194
  > `optional` **active\_till\_ts?**: `number`
179
195
 
180
- Holds time till which prize will become available, for the prizes that are targeted to be available from specific time (UNIX timestamp)
196
+ 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
197
 
182
198
  ***
183
199
 
@@ -185,7 +201,7 @@ Holds time till which prize will become available, for the prizes that are targe
185
201
 
186
202
  > `optional` **relative\_period\_timezone?**: `number`
187
203
 
188
- Time zone to ensure each day aligns with your local midnight.
204
+ 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
205
 
190
206
  ***
191
207
 
@@ -193,7 +209,7 @@ Time zone to ensure each day aligns with your local midnight.
193
209
 
194
210
  > `optional` **is\_surcharge?**: `boolean`
195
211
 
196
- Flag indicating that the prize is surcharged (available all the time, despite pool numbers)
212
+ When true, the prize stays winnable even when its `pool` reaches 0 (effectively unlimited stock)
197
213
 
198
214
  ***
199
215
 
@@ -201,7 +217,7 @@ Flag indicating that the prize is surcharged (available all the time, despite po
201
217
 
202
218
  > `optional` **is\_deleted?**: `boolean`
203
219
 
204
- Flag indicating the state of the prize
220
+ Always `false` in API responses — deleted prizes are excluded server-side
205
221
 
206
222
  ***
207
223
 
@@ -200,7 +200,7 @@ List of prizes for mini-games
200
200
 
201
201
  > `optional` **expose\_game\_stat\_on\_api?**: `boolean`
202
202
 
203
- When enabled, the number of items in the pool and number of won items will be exposed in the Retention API and in the UI Widgets
203
+ 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
204
 
205
205
  ***
206
206
 
@@ -240,7 +240,7 @@ The amount of steps to complete the game and gather the prize
240
240
 
241
241
  > `optional` **custom\_section\_id?**: `number`
242
242
 
243
- Hold the id of the custom section
243
+ ID of the operator-defined custom section (widget menu grouping) the mini-game is assigned to
244
244
 
245
245
  ***
246
246
 
@@ -288,4 +288,4 @@ The period of time in milliseconds during which the user can do the maximum numb
288
288
 
289
289
  > `optional` **expose\_user\_spin\_id?**: [`SAWExposeUserSpinIdName`](../enumerations/SAWExposeUserSpinIdName.md)
290
290
 
291
- The ID of the user spin id to expose on the game
291
+ 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
@@ -118,7 +118,7 @@ Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage
118
118
  - `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
119
119
  - `resolution_score` (number) — Points awarded for this event based on prediction accuracy
120
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
121
+ - `odds_details` ({ odd_value: { [key: string]: number } }) — Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …). Dual-purpose by event type: - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`). - Quiz: when the round's `show_users_preference` is `true`, these are aggregated **user-preference percentages** — what other users predicted, summing to ~100 (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
122
122
  - `question_image` (string) — URL of a question-specific image (quiz events)
123
123
  - `user_score` (number) — Current user's total score in this round
124
124
  - `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
@@ -117,7 +117,7 @@ Array of `GamePickRound`. Each item:
117
117
  - `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
118
118
  - `resolution_score` (number) — Points awarded for this event based on prediction accuracy
119
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
120
+ - `odds_details` ({ odd_value: { [key: string]: number } }) — Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …). Dual-purpose by event type: - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`). - Quiz: when the round's `show_users_preference` is `true`, these are aggregated **user-preference percentages** — what other users predicted, summing to ~100 (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
121
121
  - `question_image` (string) — URL of a question-specific image (quiz events)
122
122
  - `user_score` (number) — Current user's total score in this round
123
123
  - `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
@@ -117,7 +117,7 @@ Array of `GamePickRound`. Each item:
117
117
  - `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
118
118
  - `resolution_score` (number) — Points awarded for this event based on prediction accuracy
119
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
120
+ - `odds_details` ({ odd_value: { [key: string]: number } }) — Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …). Dual-purpose by event type: - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`). - Quiz: when the round's `show_users_preference` is `true`, these are aggregated **user-preference percentages** — what other users predicted, summing to ~100 (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
121
121
  - `question_image` (string) — URL of a question-specific image (quiz events)
122
122
  - `user_score` (number) — Current user's total score in this round
123
123
  - `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
@@ -119,7 +119,7 @@ Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage
119
119
  - `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
120
120
  - `resolution_score` (number) — Points awarded for this event based on prediction accuracy
121
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
122
+ - `odds_details` ({ odd_value: { [key: string]: number } }) — Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …). Dual-purpose by event type: - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`). - Quiz: when the round's `show_users_preference` is `true`, these are aggregated **user-preference percentages** — what other users predicted, summing to ~100 (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
123
123
  - `question_image` (string) — URL of a question-specific image (quiz events)
124
124
  - `user_score` (number) — Current user's total score in this round
125
125
  - `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
@@ -118,7 +118,7 @@ Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage
118
118
  - `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
119
119
  - `resolution_score` (number) — Points awarded for this event based on prediction accuracy
120
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
121
+ - `odds_details` ({ odd_value: { [key: string]: number } }) — Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …). Dual-purpose by event type: - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`). - Quiz: when the round's `show_users_preference` is `true`, these are aggregated **user-preference percentages** — what other users predicted, summing to ~100 (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
122
122
  - `question_image` (string) — URL of a question-specific image (quiz events)
123
123
  - `user_score` (number) — Current user's total score in this round
124
124
  - `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
@@ -118,7 +118,7 @@ Wrapped in `GamesApiResponse`: `errCode` (number — `0` = success), `errMessage
118
118
  - `resolution_type_id` (GamePickResolutionType) — How the user's prediction was scored after resolution
119
119
  - `resolution_score` (number) — Points awarded for this event based on prediction accuracy
120
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
121
+ - `odds_details` ({ odd_value: { [key: string]: number } }) — Per-outcome numbers keyed by the outcome value (`'1'` / `'x'` / `'2'`, `'yes'` / `'no'`, …). Dual-purpose by event type: - Sports / MatchX: decimal **betting odds** (e.g. `{ "1": 2.45, "x": 3.26, "2": 3.01 }`). - Quiz: when the round's `show_users_preference` is `true`, these are aggregated **user-preference percentages** — what other users predicted, summing to ~100 (e.g. `{ "1": 33, "x": 25, "2": 42 }`). Render as the "what others predicted" bar.
122
122
  - `question_image` (string) — URL of a question-specific image (quiz events)
123
123
  - `user_score` (number) — Current user's total score in this round
124
124
  - `user_placed_bet` (boolean) — Whether the current user has submitted any predictions in this round
@@ -33,7 +33,7 @@ _None._
33
33
 
34
34
  ## Behavioral contract
35
35
  **Preconditions**
36
- - User must be authenticated. Visitor mode not supported.
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**: not supported.
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)