@smartico/public-api 0.0.410 → 0.0.412

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 (51) hide show
  1. package/README.md +1 -1
  2. package/dist/Jackpots/JackpotPublicMeta.d.ts +1 -1
  3. package/dist/Level/LevelPublicMeta.d.ts +1 -1
  4. package/dist/MiniGames/SAWPrize.d.ts +9 -0
  5. package/dist/MiniGames/SAWPrizeUI.d.ts +1 -0
  6. package/dist/MiniGames/SAWTemplate.d.ts +25 -0
  7. package/dist/Raffle/Raffle.d.ts +1 -1
  8. package/dist/SmarticoLib/index.d.ts +3 -3
  9. package/dist/WSAPI/WSAPIMiniGames.d.ts +7 -1
  10. package/dist/WSAPI/WSAPIMissions.d.ts +40 -12
  11. package/dist/WSAPI/WSAPITypes.d.ts +40 -37
  12. package/dist/index.js +49 -13
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.modern.mjs +49 -13
  15. package/dist/index.modern.mjs.map +1 -1
  16. package/docs/api/classes/WSAPIMiniGames.md +7 -1
  17. package/docs/api/classes/WSAPIMissions.md +40 -12
  18. package/docs/api/interfaces/JackpotPublicMeta.md +1 -1
  19. package/docs/api/interfaces/LevelPublicMeta.md +1 -1
  20. package/docs/api/interfaces/RafflePublicMeta.md +1 -1
  21. package/docs/api/interfaces/SAWPrize.md +18 -0
  22. package/docs/api/interfaces/SAWPrizeUI.md +2 -0
  23. package/docs/api/interfaces/SAWTemplate.md +46 -0
  24. package/docs/api/interfaces/TMiniGamePrize.md +28 -20
  25. package/docs/api/interfaces/TMiniGameTemplate.md +12 -13
  26. package/docs/api/interfaces/TMissionOrBadge.md +6 -4
  27. package/docs/api/interfaces/TRaffle.md +1 -1
  28. package/docs/capabilities/getBadges.md +4 -4
  29. package/docs/capabilities/getMiniGames.md +30 -29
  30. package/docs/capabilities/getMissions.md +44 -16
  31. package/docs/capabilities/getRaffles.md +1 -1
  32. package/docs/capabilities/jackpotGet.md +1 -1
  33. package/docs/capabilities/miniGameWinAcknowledgeRequest.md +7 -1
  34. package/docs/native/PROTOCOL.md +4 -0
  35. package/docs/ui/minigames/UIGuide_getMiniGames.md +22 -0
  36. package/docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md +90 -0
  37. package/docs/ui/minigames/UIGuide_playMiniGame.md +12 -3
  38. package/docs/ui/missions/UIGuide_getMissions.md +44 -24
  39. package/package.json +1 -1
  40. package/src/Jackpots/JackpotPublicMeta.ts +1 -1
  41. package/src/Level/LevelPublicMeta.ts +1 -1
  42. package/src/MiniGames/SAWGetTemplatesResponse.ts +1 -0
  43. package/src/MiniGames/SAWPrize.ts +9 -0
  44. package/src/MiniGames/SAWPrizeUI.ts +2 -1
  45. package/src/MiniGames/SAWTemplate.ts +28 -4
  46. package/src/Raffle/Raffle.ts +1 -1
  47. package/src/SmarticoAPI.ts +5 -0
  48. package/src/SmarticoLib/index.ts +3 -3
  49. package/src/WSAPI/WSAPIMiniGames.ts +7 -1
  50. package/src/WSAPI/WSAPIMissions.ts +40 -12
  51. package/src/WSAPI/WSAPITypes.ts +42 -39
@@ -64,7 +64,9 @@ URL of the image of the mission or badge, 256x256px
64
64
 
65
65
  > **is\_completed**: `boolean`
66
66
 
67
- Indicator if the mission is completed or badge is granted
67
+ Indicator if the mission is completed or badge is granted. Stays `false` for
68
+ Recurring-upon-completion missions even after cycles complete — use `completion_count`
69
+ to detect completed cycles (see `getMissions` bucketing).
68
70
 
69
71
  ***
70
72
 
@@ -311,7 +313,7 @@ ID of specific Custom Section type
311
313
 
312
314
  > `optional` **max\_completion\_count?**: `number`
313
315
 
314
- Max number of times the user can complete a mission in case if mission type is Recurring upon completion. NULL equals infinite.
316
+ Max number of times the user can complete a mission in case if mission type is Recurring upon completion. NULL equals infinite (still recurring — not "no cap disables recurring").
315
317
 
316
318
  ***
317
319
 
@@ -319,7 +321,7 @@ Max number of times the user can complete a mission in case if mission type is R
319
321
 
320
322
  > `optional` **completion\_count?**: `number`
321
323
 
322
- Current completion count for Recurring upon completion missions
324
+ Current completion count for Recurring-upon-completion missions. Non-null ONLY for that mission type, so its presence identifies one; `> 0` means at least one cycle completed.
323
325
 
324
326
  ***
325
327
 
@@ -336,7 +338,7 @@ Note that if a mission has an "Active till" date defined, this field is not rele
336
338
 
337
339
  > `optional` **availability\_status?**: [`AchievementAvailabilityStatus`](../enumerations/AchievementAvailabilityStatus.md)
338
340
 
339
- Availability status of the mission depends on the defined time limits
341
+ Timer/window state derived from the mission's time limits (which countdown to show / whether the window elapsed). NOT a tab-bucketing signal — it ignores `completion_count`, so bucket sections from the raw fields instead (see `getMissions`).
340
342
 
341
343
  ***
342
344
 
@@ -56,7 +56,7 @@ URL of the mobile image that represents the raffle, 300x142px
56
56
 
57
57
  Custom data as string or JSON string that can be used in API to build custom UI
58
58
  You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice
59
- Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
59
+ Read more here - https://help.smartico.ai/welcome/products/tools-and-guides/custom-fields-attributes
60
60
 
61
61
  ***
62
62
 
@@ -21,7 +21,7 @@ Array of `TMissionOrBadge`. Each item:
21
21
  - `description` (string) — Description of the mission or badge, translated to the user language
22
22
  - `reward` (string) — Description of the mission reward if defined
23
23
  - `image` (string) — URL of the image of the mission or badge, 256x256px
24
- - `is_completed` (boolean) — Indicator if the mission is completed or badge is granted
24
+ - `is_completed` (boolean) — Indicator if the mission is completed or badge is granted. Stays `false` for Recurring-upon-completion missions even after cycles complete — use `completion_count` to detect completed cycles (see `getMissions` bucketing).
25
25
  - `is_locked` (boolean) — Indicator if the mission is locked. Means that it's visible to the user, but he cannot progress in it until it's unlocked. Mission may optionally contain the explanation of what should be done to unlock it in the unlock_mission_description property
26
26
  - `unlock_mission_description` (string) — Optional explaination of what should be done to unlock the mission
27
27
  - `is_requires_optin` (boolean) — Indicator if the mission requires opt-in. Means that user should explicitly opt-in to the mission in order to start progressing in it
@@ -79,10 +79,10 @@ Array of `TMissionOrBadge`. Each item:
79
79
  - `completed_this_week` (boolean) — Flag for mission/badge indicating that mission/badge completed this week
80
80
  - `completed_this_month` (boolean) — Flag for mission/badge indicating that mission/badge completed this month
81
81
  - `custom_section_type_id` (number) — ID of specific Custom Section type
82
- - `max_completion_count` (number) — Max number of times the user can complete a mission in case if mission type is Recurring upon completion. NULL equals infinite.
83
- - `completion_count` (number) — Current completion count for Recurring upon completion missions
82
+ - `max_completion_count` (number) — Max number of times the user can complete a mission in case if mission type is Recurring upon completion. NULL equals infinite (still recurring — not "no cap disables recurring").
83
+ - `completion_count` (number) — Current completion count for Recurring-upon-completion missions. Non-null ONLY for that mission type, so its presence identifies one; `> 0` means at least one cycle completed.
84
84
  - `next_recurrence_date_ts` (number) — The date/timestamp for recurring missions, which indicating the time remaining until the next recurrence of the mission. Note that if a mission has an "Active till" date defined, this field is not relevant after that date.
85
- - `availability_status` (AchievementAvailabilityStatus) — Availability status of the mission depends on the defined time limits
85
+ - `availability_status` (AchievementAvailabilityStatus) — Timer/window state derived from the mission's time limits (which countdown to show / whether the window elapsed). NOT a tab-bucketing signal — it ignores `completion_count`, so bucket sections from the raw fields instead (see `getMissions`).
86
86
  - `claim_button_title` (string) — Title for the claim reward button
87
87
  - `claim_button_action` (string) — Action for the claim reward button
88
88
  - `prize_claim_expiration_date` (number) — The date/timestamp indicating when the mission claim will expire
@@ -30,35 +30,36 @@ 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) — if the game is limit to the number of spins that user can do during period of time, this property shows the epoch time in UTC when the next attempt will be available. Note that you need to enable 'Show time to the next available spin' setting on mini-game template in the backoffice Important: this field will not be populated if “Max number of attempts a user can do” is set to value different from 1
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 jackpont amount, if jackpot is enabled.
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[]) — List of prizes for mini-games
44
+ - `prizes` (TMiniGamePrize[]) — Prizes configured for this game — see `TMiniGamePrize`
45
45
  - `id` (number) — ID of the prize
46
- - `name` (string) — The visual name of the prize
47
- - `prize_type` (MiniGamePrizeTypeName) — The type of the prize, no-prize, points, bonus, manual, spin, jackpot
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 (mobile)
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) — for scratch card defines position of prize in the list
53
- - `sectors` (number[]) — List of sectors for the prize
54
- - `acknowledge_type` (SAWAcknowledgeTypeName) — Type of acknowledge message for users
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
- - `acknowledge_dp` (string) — Deep link that will trigger some action in modal pop-up
57
- - `acknowledge_action_title` (string) — The name of the action button in modal pop-up
58
- - `acknowledge_dp_additional` (string) — Deep link that will trigger some action in modal pop-up (additional)
59
- - `acknowledge_action_title_additional` (string) — The name of the action button in modal pop-up (additional)
60
- - `second_btn` (string) — Deep link that will trigger some action in modal pop-up (second button)
61
- - `second_btn_action_title` (string) — The name of the action button in modal pop-up (second button)
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
62
63
  - `out_of_stock_message` (string) — Message when the prize pool is empty for that specific prize
63
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
64
65
  - `pool_initial` (number) — Initial (configured) stock of the prize. Populated regardless of `expose_game_stat_on_api`
@@ -69,19 +70,19 @@ Array of `TMiniGameTemplate`. Each item:
69
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)
70
71
  - `is_surcharge` (boolean) — When true, the prize stays winnable even when its `pool` reaches 0 (effectively unlimited stock)
71
72
  - `is_deleted` (boolean) — Always `false` in API responses — deleted prizes are excluded server-side
72
- - `custom_data` (any) — The custom data of the mini-game defined by operator in the BackOffice. Can be a JSON object, string or number
73
- - `prize_modifiers` (PrizeModifiers[]) — Prize modifiers that will multiply by 2x, 5x or 10x the current total. This will not affect the final Prize Amount that will be awarded.
74
- - `allow_split_decimal` (boolean) — When enabled, you can split prize value by decimal values
75
- - `hide_prize_from_history` (boolean) — When enabled, you can hide prize from prize history
76
- - `requirements_to_get_prize` (string) — Requirements to claim the prize (lootbox specific)
77
- - `max_give_period_type_id` (AttemptPeriodType) — The period type for the prize to be given: Time from last attempt, Calendar days UTC, Calendar days user time zone, Lifetime
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`
78
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"
79
- - `relative_period_timezone` (number) — Time zone to ensure each day aligns with your local midnight.
80
- - `activeFromDate` (number) — Holds time from which template will become available, for the template that are targeted to be available from specific time (UNIX timestamp)
81
- - `activeTillDate` (number) — Holds time till which template will become available, for the templates that are targeted to be available from specific time (UNIX timestamp)
82
- - `steps_to_finish_game` (number) — The amount of steps to complete the game and gather the prize
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)
83
84
  - `custom_section_id` (number) — ID of the operator-defined custom section (widget menu grouping) the mini-game is assigned to
84
- - `saw_template_ui_definition` (SAWTemplateUI) — The UI definition of the mini-game
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
85
86
  - `skin` (string)
86
87
  - `name` (string)
87
88
  - `description` (string)
@@ -126,8 +127,8 @@ Array of `TMiniGameTemplate`. Each item:
126
127
  id: string;
127
128
  content: string;
128
129
  })
129
- - `game_layout` (SAWGameLayoutName) — The layout of the game
130
- - `show_prize_history` (boolean) — When enabled the prize history icon is visible on a certain template
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
131
132
  - `max_number_of_attempts` (number) — The maximum number of attempts that user can do during period of time
132
133
  - `max_spins_period_ms` (number) — The period of time in milliseconds during which the user can do the maximum number of attempts
133
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
@@ -22,7 +22,7 @@ Array of `TMissionOrBadge`. Each item:
22
22
  - `description` (string) — Description of the mission or badge, translated to the user language
23
23
  - `reward` (string) — Description of the mission reward if defined
24
24
  - `image` (string) — URL of the image of the mission or badge, 256x256px
25
- - `is_completed` (boolean) — Indicator if the mission is completed or badge is granted
25
+ - `is_completed` (boolean) — Indicator if the mission is completed or badge is granted. Stays `false` for Recurring-upon-completion missions even after cycles complete — use `completion_count` to detect completed cycles (see `getMissions` bucketing).
26
26
  - `is_locked` (boolean) — Indicator if the mission is locked. Means that it's visible to the user, but he cannot progress in it until it's unlocked. Mission may optionally contain the explanation of what should be done to unlock it in the unlock_mission_description property
27
27
  - `unlock_mission_description` (string) — Optional explaination of what should be done to unlock the mission
28
28
  - `is_requires_optin` (boolean) — Indicator if the mission requires opt-in. Means that user should explicitly opt-in to the mission in order to start progressing in it
@@ -80,10 +80,10 @@ Array of `TMissionOrBadge`. Each item:
80
80
  - `completed_this_week` (boolean) — Flag for mission/badge indicating that mission/badge completed this week
81
81
  - `completed_this_month` (boolean) — Flag for mission/badge indicating that mission/badge completed this month
82
82
  - `custom_section_type_id` (number) — ID of specific Custom Section type
83
- - `max_completion_count` (number) — Max number of times the user can complete a mission in case if mission type is Recurring upon completion. NULL equals infinite.
84
- - `completion_count` (number) — Current completion count for Recurring upon completion missions
83
+ - `max_completion_count` (number) — Max number of times the user can complete a mission in case if mission type is Recurring upon completion. NULL equals infinite (still recurring — not "no cap disables recurring").
84
+ - `completion_count` (number) — Current completion count for Recurring-upon-completion missions. Non-null ONLY for that mission type, so its presence identifies one; `> 0` means at least one cycle completed.
85
85
  - `next_recurrence_date_ts` (number) — The date/timestamp for recurring missions, which indicating the time remaining until the next recurrence of the mission. Note that if a mission has an "Active till" date defined, this field is not relevant after that date.
86
- - `availability_status` (AchievementAvailabilityStatus) — Availability status of the mission depends on the defined time limits
86
+ - `availability_status` (AchievementAvailabilityStatus) — Timer/window state derived from the mission's time limits (which countdown to show / whether the window elapsed). NOT a tab-bucketing signal — it ignores `completion_count`, so bucket sections from the raw fields instead (see `getMissions`).
87
87
  - `claim_button_title` (string) — Title for the claim reward button
88
88
  - `claim_button_action` (string) — Action for the claim reward button
89
89
  - `prize_claim_expiration_date` (number) — The date/timestamp indicating when the mission claim will expire
@@ -132,18 +132,46 @@ Client-side filtering you may still want: missions with
132
132
  `only_in_custom_section: true` are intended for their custom-section
133
133
  view only and should be hidden from the main mission list.
134
134
 
135
- **Reading state from the returned mission**
136
- Drive availability chips ("missed", "coming soon", "needs opt-in",
137
- "in progress", "expired") from `availability_status` (enum
138
- `AchievementAvailabilityStatus`) — it's the canonical derived
139
- state and reflects all server-side timing/visibility rules in one
140
- field. For time-limited and recurring missions, `dt_start` doubles
141
- as the opt-in timestamp (for opt-in missions) or unlock timestamp
142
- (for previously-locked missions); the expiration of a time-limited
143
- mission is `dt_start + time_limit_ms`. `next_recurrence_date_ts`
144
- is populated for `RECURRING` / `RECURRING_QUANTITY` missions but
145
- is no longer meaningful once the mission's `active_till_ts` has
146
- passed.
135
+ **Status bucketing (which tab / section a mission belongs to)**
136
+ There is no pre-computed bucket field — assign each mission to exactly
137
+ ONE section reading the raw state fields directly (NOT `availability_status`;
138
+ see "Timers" below). Priority order, FIRST match wins:
139
+ 1. **Missed / Expired** — not completed and the window has closed:
140
+ `!is_completed && ((time_limit_ms && dt_start && dt_start + time_limit_ms < Date.now())`
141
+ `|| (active_till_ts && active_till_ts < Date.now()))`. Do NOT gate this on
142
+ opt-in — an opt-in mission whose window closed before the user ever
143
+ opted in is still Missed. Sort by `position` ASC.
144
+ 2. **Completed** — `is_completed === true`, OR (recurring-upon-completion
145
+ missions) at least one cycle done / the cap reached — see the recurring
146
+ caveats below. Sort by `complete_date_ts` DESC.
147
+ 3. **Locked** — `is_locked === true`, OR not yet started
148
+ (`active_from_ts > Date.now()`). Sort by `position` ASC.
149
+ 4. **In-progress** — `is_opted_in === true`, OR (no opt-in required and
150
+ `progress > 0`). Sort by `position` ASC.
151
+ 5. **Available** — everything else (opt-in required but not yet joined, or
152
+ an unrestricted mission not yet started). Sort by `position` ASC.
153
+
154
+ **Recurring-upon-completion caveats** (the common mis-bucketing trap):
155
+ - `is_completed` NEVER flips true for a recurring-upon-completion mission
156
+ (only for one-shot missions) — detect a completed cycle from
157
+ `completion_count > 0`, not `is_completed`.
158
+ - A non-null `completion_count` is what identifies a recurring-upon-completion
159
+ mission. `max_completion_count === null` means an INFINITE cap (still
160
+ recurring — never read null as "not recurring"), so only test
161
+ `completion_count >= max_completion_count` when `max_completion_count` is set.
162
+
163
+ **Timers & timestamps** (display only — NOT bucketing)
164
+ `availability_status` (enum `AchievementAvailabilityStatus`) is the
165
+ timer/window signal: use it to pick WHICH countdown to show and whether the
166
+ window has elapsed — NOT to choose the section. It does not read
167
+ `completion_count`, and between cycles the server may keep reporting the
168
+ just-elapsed cycle's `Missed*` value even after `dt_start` / `active_till_ts`
169
+ are cleared for the next attempt, so bucketing by it sends recurring missions
170
+ to the wrong tab. For time-limited / opt-in missions `dt_start` is the opt-in
171
+ timestamp (or unlock timestamp for previously-locked missions), and a
172
+ time-limited mission expires at `dt_start + time_limit_ms`.
173
+ `next_recurrence_date_ts` is populated for `RECURRING` / `RECURRING_QUANTITY`
174
+ missions but is no longer meaningful once `active_till_ts` has passed.
147
175
 
148
176
  **Refresh after a mutation**
149
177
  After `requestMissionOptIn(...)` or `requestMissionClaimReward(...)`
@@ -21,7 +21,7 @@ Array of `TRaffle`. Each item:
21
21
  - `custom_section_id` (number) — ID of the custom section that is linked to the raffle in the Gamification widget
22
22
  - `image_url` (string) — URL of the image that represents the raffle, 890x193px
23
23
  - `image_url_mobile` (string) — URL of the mobile image that represents the raffle, 300x142px
24
- - `custom_data` (string) — Custom data as string or JSON string that can be used in API to build custom UI You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice Read more here - https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes
24
+ - `custom_data` (string) — Custom data as string or JSON string that can be used in API to build custom UI You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice Read more here - https://help.smartico.ai/welcome/products/tools-and-guides/custom-fields-attributes
25
25
  - `start_date` (number) — Date of start
26
26
  - `end_date` (number) — Date of end
27
27
  - `max_tickets_count` (number) — Maximum numer of tickets that can be given to all users for the whole period of raffle
@@ -30,7 +30,7 @@ Array of `JackpotDetails`. Each item:
30
30
  - `content` (string)
31
31
  - `placeholder1` (string) — custom value of placeholder1 defined by operator and can be used in the HTML templates
32
32
  - `placeholder2` (string) — custom value of placeholder2 defined by operator and can be used in the HTML templates
33
- - `custom_data` (string) — Custom data as string or JSON string that can be used in API to build custom UI You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice Read more here - <https://help.smartico.ai/welcome/products/general-concepts/custom-fields-attributes>
33
+ - `custom_data` (string) — Custom data as string or JSON string that can be used in API to build custom UI You can request from Smartico to define fields for your specific case that will be managed from Smartico BackOffice Read more here - <https://help.smartico.ai/welcome/products/tools-and-guides/custom-fields-attributes>
34
34
  - `jp_currency` (string) — Native jackpot currency (ISO 4217). Used for winner-history amounts.
35
35
  - `user_currency` (string) — Current user's wallet currency. Used to display the pot via `pot.current_pot_amount_user_currency`.
36
36
  - `contribution_type` (JackpotContributionType) — Whether the contribution is a fixed amount or a percentage of the bet; see `JackpotContributionType`.
@@ -44,7 +44,11 @@ next `getMiniGamesHistory` fetch the row shows `is_claimed:
44
44
  true` with no prize attached. Use this for game mechanics where the
45
45
  player can decline or forfeit the drawn prize — e.g. a
46
46
  gamble/discard step, or a client-driven game where the user's final
47
- action decides whether the pre-drawn prize is actually won. It only
47
+ action decides whether the pre-drawn prize is actually won (the
48
+ default Smartico UI does this for the Voyager game: failing the
49
+ star-collection run finalises the spin as lost). When configured,
50
+ the prize's `aknowledge_message_lose` is the operator's result copy
51
+ for this case — show it instead of `aknowledge_message`. It only
48
52
  works on a spin that is not yet finalised, so it requires playing
49
53
  with `acknowledge: false` and calling promptly — once the automatic
50
54
  acknowledge or the server-side fallback (below) has finalised the
@@ -74,6 +78,8 @@ call here.
74
78
  - Either way the spin's `is_claimed` flips to `true` on the next
75
79
  `getMiniGamesHistory` fetch.
76
80
 
81
+ **UI guidance**: see [UI Guide — `miniGameWinAcknowledgeRequest`](../../docs/ui/minigames/UIGuide_miniGameWinAcknowledgeRequest.md).
82
+
77
83
  **Visitor mode**: not supported.
78
84
 
79
85
  ## Example
@@ -1329,6 +1329,8 @@ No method-specific fields. Send only the common fields (see [Common Message Fiel
1329
1329
  |-------|------|-------------|
1330
1330
  | `templates` | [`SAWTemplate[]`](../api/interfaces/SAWTemplate.md) | Array of mini-game templates |
1331
1331
 
1332
+ Note: per-prize stock statistics (`pool`, `wins_count`, `weekdays`, `active_from_ts` / `active_till_ts`) are present on each template's `prizes` only when the template's `expose_game_stat_on_api` is enabled; otherwise the server strips them (`pool` is kept for MatchX / Quiz game types).
1333
+
1332
1334
  ---
1333
1335
 
1334
1336
  ### playMiniGame
@@ -1509,6 +1511,8 @@ Acknowledge a mini-game spin push. Sent after handling `SAW_SHOW_SPIN_PUSH` (707
1509
1511
 
1510
1512
  Acknowledge multiple mini-game wins at once. Used after `playMiniGameBatch`.
1511
1513
 
1514
+ The batch acknowledge always finalises spins as **won** — `lose` is not supported here. To finalise a spin as lost, send a single [miniGameWinAcknowledge](#minigamewinacknowledge) (704) with `lose: true`.
1515
+
1512
1516
  #### Request
1513
1517
 
1514
1518
  **ClassId:** `714`
@@ -75,6 +75,28 @@ keyed on `saw_game_type`. For custom UIs, render the matching
75
75
  component per game type — they share the same `playMiniGame`
76
76
  trigger (except `PrizeDrop`, `MatchX`, `Quiz` as noted).
77
77
 
78
+ ## Prize-field usage per game type
79
+
80
+ Several `prizes[]` fields only matter for specific renderers:
81
+
82
+ | Prize field | Used by | How |
83
+ |---|---|---|
84
+ | `sectors` | Spin-a-Wheel | Wheel sector indices the prize occupies — place the prize label/icon on those sectors. |
85
+ | `position` | Scratch Card | Sort prizes ascending by `position` to lay out the scratch grid. |
86
+ | `font_size` / `font_size_mobile` | Wheel, Scratch | Px size for the prize label on the game surface; mobile falls back to desktop. |
87
+ | `prize_modifiers` | Treasure Hunt, Voyager | Modifier tiles (2x…/10, 0, reset) applied to the running revealed total — presentation only; the award is still `prize_value`. |
88
+ | `allow_split_decimal` | Treasure Hunt, Voyager | Whether per-step revealed amounts may be fractional. |
89
+ | `requirements_to_get_prize` | Lootboxes | Text shown when the prize isn't yet available to the user. |
90
+ | `out_of_stock_message` | All (with stock) | Shown when the prize's pool is depleted. |
91
+ | `icon`, `name` | All | Prize strip, game surface, win modal. `name` arrives with the live jackpot value inlined. |
92
+ | `acknowledge_*`, `second_btn*`, `aknowledge_message(_lose)` | All | Win-modal contents — see [UI Guide — `playMiniGame`](UIGuide_playMiniGame.md) "Prize reveal modals". |
93
+
94
+ Template-side companions: `game_layout` picks the Lootbox grid
95
+ variant, `steps_to_finish_game` sizes step games, and
96
+ `expose_user_spin_id` asks the win view to display the player's
97
+ external user id (`'userId'`) or the spin's transaction id
98
+ (`'spinId'`) for transparency/audit.
99
+
78
100
  ## Action button decision matrix
79
101
 
80
102
  CTA on the card / detail view (evaluate in priority order):
@@ -0,0 +1,90 @@
1
+ # UI Guide — `miniGameWinAcknowledgeRequest`
2
+
3
+ Action-focused method — no list/card rendering of its own. It finalises
4
+ a spin played with `acknowledge: false`: as **won** (default) or as
5
+ **lost** (`{ lose: true }`). The UI patterns below cover the three
6
+ call sites: an explicit Claim CTA, a decline/forfeit outcome, and
7
+ history-row recovery.
8
+
9
+ ## When the UI calls this
10
+
11
+ | Flow | Trigger | Call |
12
+ |---|---|---|
13
+ | Explicit claim | User taps "Claim" in the prize modal (`acknowledge_type === 'ExplicitAcknowledge'`) after `playMiniGame(id, { acknowledge: false })` | `miniGameWinAcknowledgeRequest(r.request_id)` |
14
+ | Decline / forfeit | Game outcome or user choice says the drawn prize is NOT won (skill games like Voyager, gamble/discard steps) | `miniGameWinAcknowledgeRequest(r.request_id, { lose: true })` |
15
+ | History recovery | User taps "Claim" on a `getMiniGamesHistory` row with `is_claimed === false` | `miniGameWinAcknowledgeRequest(row.client_request_id)` |
16
+
17
+ ## Action button decision matrix
18
+
19
+ - **Win path (Claim CTA)**: enable the button as soon as the play
20
+ result is shown; disable it (with a spinner) while the request is
21
+ in flight; on resolve, show the prize's `aknowledge_message` modal
22
+ copy and refresh balance widgets (`getUserProfile`) and
23
+ `getMiniGames`.
24
+ - **Lose path**: no user-facing "lose the prize" button in most
25
+ designs — the game flow decides. The default Smartico UI sends
26
+ `lose: true` when the Voyager run fails (not all stars collected),
27
+ then shows the prize's `aknowledge_message_lose` copy (fall back to
28
+ a generic "Better luck next time" treatment when the operator
29
+ didn't configure it).
30
+ - **If you DO offer an explicit decline choice** (keep-or-gamble
31
+ UIs): render "Claim" and "Decline" side by side, disable both on
32
+ first tap, and treat the two calls as mutually exclusive — the
33
+ first one to reach the server wins; the other becomes a no-op.
34
+ - **History recovery rows**: see
35
+ [UI Guide — `getMiniGamesHistory`](UIGuide_getMiniGamesHistory.md)
36
+ for the row-level Claim CTA.
37
+
38
+ ## Timing constraints (drive the UX)
39
+
40
+ - Standard prizes are auto-finalised as WON by a server-side fallback
41
+ after ~1–3 minutes. A decline/forfeit decision must therefore be
42
+ sent promptly after the spin — don't park the choice behind an
43
+ unbounded modal. After the fallback fires, `lose: true` is a no-op
44
+ and the prize stays credited.
45
+ - "Explicit claim" prizes are exempt from the fallback: the Claim CTA
46
+ can wait indefinitely, and an unclaimed prize is simply never
47
+ credited. Surface unclaimed spins via the history view.
48
+
49
+ ## Idempotency guard
50
+
51
+ The call is idempotent server-side (no double credit), so a
52
+ double-tap is harmless — but still disable the button in flight to
53
+ avoid duplicate requests and modal flicker.
54
+
55
+ ## Result handling
56
+
57
+ ```ts
58
+ const r = await window._smartico.api.playMiniGame(game.id, { acknowledge: false });
59
+ if (r.err_code === 0) {
60
+ const prize = game.prizes.find(p => p.id === r.prize_id);
61
+ // ... run the game / show the Claim UI ...
62
+
63
+ if (playerWon) {
64
+ await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id);
65
+ console.log('[smartico] win finalised — show', prize?.aknowledge_message,
66
+ 'and refresh getUserProfile / getMiniGames');
67
+ } else {
68
+ await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id, { lose: true });
69
+ console.log('[smartico] spin finalised as lost — show',
70
+ prize?.aknowledge_message_lose ?? 'a generic "Better luck next time" message');
71
+ }
72
+ }
73
+ ```
74
+
75
+ ## Empty / loading / error states
76
+
77
+ - In flight: spinner on the CTA, inputs locked.
78
+ - On network failure: re-enable the CTA and let the user retry — the
79
+ operation is safe to repeat. For standard prizes the server-side
80
+ fallback will eventually deliver the win even if every retry fails
81
+ (a pending decline, however, is lost once the fallback fires).
82
+ - No dedicated error codes: a non-zero `err_code` is a generic server
83
+ error — show a generic error toast.
84
+
85
+ ## Related guides
86
+
87
+ - [UI Guide — `playMiniGame`](UIGuide_playMiniGame.md) — prize reveal
88
+ modals, `acknowledge_type` matrix, decline/forfeit flow.
89
+ - [UI Guide — `getMiniGamesHistory`](UIGuide_getMiniGamesHistory.md) —
90
+ unclaimed-row recovery.
@@ -100,7 +100,10 @@ Modal contents per prize:
100
100
  - Icon: `prize.icon` (1:1)
101
101
  - Title: `prize.name`
102
102
  - Message: `prize.aknowledge_message` (note the typo in the field
103
- name — `aknowledge` not `acknowledge`)
103
+ name — `aknowledge` not `acknowledge`). When the spin is finalised
104
+ as lost (see "Decline / forfeit" below), show
105
+ `prize.aknowledge_message_lose` instead, falling back to a generic
106
+ "Better luck next time" when not configured.
104
107
  - CTA: `prize.acknowledge_action_title` with action
105
108
  `prize.acknowledge_dp` (pass through `_smartico.dp()` for safe
106
109
  execution)
@@ -112,7 +115,9 @@ Modal contents per prize:
112
115
  Some game mechanics let the player decline or forfeit the drawn
113
116
  prize — a gamble/discard step, a "keep it or risk it" offer, or a
114
117
  game where the player's final action decides whether the pre-drawn
115
- prize is actually won. Implement these with manual finalisation:
118
+ prize is actually won (the default Smartico UI does this for the
119
+ Voyager game: failing the star-collection run forfeits the drawn
120
+ prize). Implement these with manual finalisation:
116
121
 
117
122
  1. Play with `acknowledge: false` so the SDK does not auto-finalise.
118
123
  2. Run the game / choice UI.
@@ -122,7 +127,8 @@ prize is actually won. Implement these with manual finalisation:
122
127
  - Decline / lose →
123
128
  `miniGameWinAcknowledgeRequest(request_id, { lose: true })` —
124
129
  prize NOT credited, returned to the prize pool for other
125
- players. Show the same "Better luck next time" treatment as a
130
+ players. Show `prize.aknowledge_message_lose` when configured,
131
+ else the same "Better luck next time" treatment as a
126
132
  `no-prize` slot (below).
127
133
 
128
134
  Timing: standard prizes are auto-finalised as WON by the
@@ -132,6 +138,9 @@ the prize stays credited. "Explicit claim" prizes are exempt from
132
138
  the fallback, so those have no time pressure. Once a spin is
133
139
  finalised either way, further acknowledge calls are no-ops.
134
140
 
141
+ Full CTA / retry / timing patterns: see
142
+ [UI Guide — `miniGameWinAcknowledgeRequest`](UIGuide_miniGameWinAcknowledgeRequest.md).
143
+
135
144
  ## "No prize" handling
136
145
 
137
146
  When the won prize has `prize_type === 'no-prize'`, the user has
@@ -13,31 +13,43 @@
13
13
  field. Consumers apply the bucketing filter chain below themselves.
14
14
 
15
15
  ## Status bucketing
16
- Partition the array using this **priority order — first match wins**:
16
+ Partition the array using this **priority order — first match wins** —
17
+ reading the raw state fields directly (NOT `availability_status`; see the
18
+ note below):
17
19
 
18
- 1. **Missed** — time window passed before completion. Test:
19
- `(!is_completed) && ((is_requires_optin && is_opted_in || !is_requires_optin)`
20
- ` && time_limit_ms && dt_start && (dt_start + time_limit_ms) < Date.now())`
21
- `|| (active_till_ts && active_till_ts < Date.now())`.
22
- Sort: `position` ASC.
23
- 2. **Completed** — `is_completed === true`, OR for missions of type
24
- `AchievementStatus.RecurringUponCompletion`,
25
- `max_completion_count === completion_count` (cap reached) OR
26
- `completion_count > 0` (at least one cycle completed).
20
+ 1. **Missed / Expired** — not completed and the window has closed:
21
+ `(!is_completed) && ((time_limit_ms && dt_start && (dt_start + time_limit_ms) < Date.now())`
22
+ `|| (active_till_ts && active_till_ts < Date.now()))`.
23
+ Do NOT gate this on opt-in — an opt-in mission whose window closed
24
+ before the user ever opted in still belongs in Missed. Sort: `position` ASC.
25
+ 2. **Completed** — `is_completed === true`, OR (recurring-upon-completion
26
+ missions) at least one cycle done / the cap reached:
27
+ `completion_count > 0`, or `max_completion_count != null && completion_count >= max_completion_count`.
28
+ `is_completed` NEVER flips for recurring-upon-completion missions, so use
29
+ `completion_count`; a non-null `completion_count` is what identifies the
30
+ type, and `max_completion_count === null` means an INFINITE cap (still
31
+ recurring), so only compare against it when it is set.
27
32
  Sort: `complete_date_ts` DESC (most recent first).
28
33
  3. **Locked** — `is_locked === true`, OR not yet available
29
34
  (`active_from_ts > Date.now()`). Sort: `position` ASC.
30
- 4. **Available (in-progress)** — none of the above.
31
- Sort: `position` ASC.
35
+ 4. **In progress** — `is_opted_in === true`, OR (no opt-in required and
36
+ `progress > 0`). Sort: `position` ASC.
37
+ 5. **Available** — everything else: opt-in required but not yet joined, or
38
+ an unrestricted mission not yet started. Sort: `position` ASC.
32
39
 
33
40
  Each mission belongs to exactly ONE bucket. Many UIs render these as
34
- status tabs / sections. The `availability_status` field
35
- ([AchievementAvailabilityStatus](../../api/enumerations/AchievementAvailabilityStatus.md)) is authoritative for **timer /
36
- window state** (which countdown to show, whether the window has
37
- elapsed) — but it is NOT a substitute for bucketing: distinguishing
38
- "locked" from "opt-in required" requires reading `is_locked` and
39
- `is_opted_in` directly. An "Overview" tab curating featured +
40
- in-progress + a sample locked is a common pattern.
41
+ status tabs / sections; an "Overview" tab curating featured + in-progress +
42
+ a sample locked is a common pattern.
43
+
44
+ **Do not bucket by `availability_status`.** That field
45
+ ([AchievementAvailabilityStatus](../../api/enumerations/AchievementAvailabilityStatus.md))
46
+ is the **timer / window** signal only — which countdown to show, whether the
47
+ window elapsed. It does NOT read `completion_count`, so for
48
+ recurring-upon-completion missions it reports a stale `Missed*` value from the
49
+ just-elapsed cycle even after `dt_start` / `active_till_ts` are cleared for the
50
+ next attempt — using it to bucket sends recurring missions to the wrong tab.
51
+ Distinguishing "locked" from "opt-in required" likewise needs `is_locked` /
52
+ `is_opted_in` read directly.
41
53
 
42
54
  ## Mission card / tile (list view)
43
55
 
@@ -53,7 +65,10 @@ Fields to render on the card:
53
65
  - Description (fallback chain): `description` → `unlock_mission_description`
54
66
  (when `is_locked`) → `tasks[0].name` (when no description and tasks
55
67
  exist).
56
- - Progress bar — render only when `progress > 0` (the 0–100 integer).
68
+ - Progress bar — render only when `progress > 0` (the 0–100 integer),
69
+ with one exception: a mission that requires opt-in and isn't opted in
70
+ yet (`is_requires_optin && !is_opted_in`) shows the bar at 0%, so the
71
+ card/modal signals it has a progress track waiting behind opt-in.
57
72
  Hide for completed recurring missions (`AchievementStatus.RecurringUponCompletion`
58
73
  on the Completed tab) to avoid showing residual percentage from a
59
74
  prior cycle.
@@ -103,8 +118,11 @@ Top-to-bottom structure (omit sections whose source field is empty):
103
118
  list is redundant). Each task row: completion indicator
104
119
  (checkbox/circle) + `task.name`. Append "N / M" using
105
120
  `execution_count_actual / execution_count_expected` when the
106
- operator has enabled count display. Show a points stamp for
107
- tasks with `points_reward > 0`.
121
+ operator has enabled count display. A single task can grant MORE
122
+ THAN ONE reward type — render one reward badge per non-zero amount
123
+ among `points_reward`, `gems_reward` and `diamonds_reward` (stack
124
+ them when a task grants several), each with that reward type's icon.
125
+ Don't assume points-only.
108
126
  13. Progress bar (conditional, same rule as card).
109
127
  14. Reward block (`reward`).
110
128
  15. Related games — only games where `game_public_meta.enabled === true`.
@@ -193,8 +211,10 @@ on click — it does NOT wait for the claim RPC to succeed. Consequences:
193
211
  Missions stay visible in the Missed bucket unless an operator
194
212
  config hides expired missions after N days.
195
213
  - **In progress**: default styling.
196
- - **Opt-in required**: same as in-progress; the status chip alone
197
- signals "opt-in required".
214
+ - **Opt-in required** (`is_requires_optin && !is_opted_in`): styled like
215
+ in-progress, but the status chip carries a "Requires opt-in" label
216
+ (not "Available") to signal the mission needs opt-in before progress
217
+ starts; pair it with the 0%-progress bar noted above.
198
218
  - **Featured**: replace the ribbon (when no `ribbon` is set) with a
199
219
  "featured" modifier; some brands use a gold border / glow.
200
220
  - **Claimable** (claim button visible): add a "claimable" modifier
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.410",
3
+ "version": "0.0.412",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",