@smartico/public-api 0.0.380 → 0.0.382

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 (178) hide show
  1. package/CLAUDE.md +103 -0
  2. package/README.md +32 -10
  3. package/dist/Base/ClassId.d.ts +2 -0
  4. package/dist/Jackpots/JackpotDetails.d.ts +14 -15
  5. package/dist/Jackpots/JackpotPot.d.ts +10 -6
  6. package/dist/MiniGames/SAWGameType.d.ts +3 -1
  7. package/dist/MiniGames/SAWTemplateUI.d.ts +7 -0
  8. package/dist/Raffle/GetRaffleWonPrizesRequest.d.ts +9 -0
  9. package/dist/Raffle/GetRaffleWonPrizesResponse.d.ts +52 -0
  10. package/dist/Raffle/index.d.ts +2 -0
  11. package/dist/SmarticoAPI.d.ts +6 -1
  12. package/dist/SmarticoLib/index.d.ts +5 -1
  13. package/dist/WSAPI/WSAPIAvatars.d.ts +267 -49
  14. package/dist/WSAPI/WSAPIBonuses.d.ts +224 -10
  15. package/dist/WSAPI/WSAPIGamePick.d.ts +538 -253
  16. package/dist/WSAPI/WSAPIGeneral.d.ts +156 -14
  17. package/dist/WSAPI/WSAPIInbox.d.ts +547 -58
  18. package/dist/WSAPI/WSAPIJackpots.d.ts +292 -57
  19. package/dist/WSAPI/WSAPILeaderBoard.d.ts +127 -13
  20. package/dist/WSAPI/WSAPIMiniGames.d.ts +465 -49
  21. package/dist/WSAPI/WSAPIRaffles.d.ts +576 -52
  22. package/dist/WSAPI/WSAPITournaments.d.ts +3 -3
  23. package/dist/WSAPI/WSAPITypes.d.ts +243 -132
  24. package/dist/WSAPI/WSAPIUser.d.ts +193 -43
  25. package/dist/index.js +3412 -616
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.modern.mjs +3395 -609
  28. package/dist/index.modern.mjs.map +1 -1
  29. package/docs/Callbacks.md +162 -0
  30. package/docs/SmarticoObject.md +445 -0
  31. package/docs/Transforms.md +99 -0
  32. package/docs/api/README.md +26 -0
  33. package/docs/api/classes/WSAPIAvatars.md +282 -54
  34. package/docs/api/classes/WSAPIBonuses.md +233 -12
  35. package/docs/api/classes/WSAPIClans.md +380 -10
  36. package/docs/api/classes/WSAPIGamePick.md +555 -26
  37. package/docs/api/classes/WSAPIGeneral.md +165 -16
  38. package/docs/api/classes/WSAPIInbox.md +588 -64
  39. package/docs/api/classes/WSAPIJackpots.md +320 -66
  40. package/docs/api/classes/WSAPILeaderBoard.md +133 -15
  41. package/docs/api/classes/WSAPIMiniGames.md +501 -64
  42. package/docs/api/classes/WSAPIMissions.md +58 -79
  43. package/docs/api/classes/WSAPIRaffles.md +647 -69
  44. package/docs/api/classes/WSAPIStore.md +83 -108
  45. package/docs/api/classes/WSAPITournaments.md +495 -28
  46. package/docs/api/classes/WSAPIUser.md +520 -83
  47. package/docs/api/documents/Callbacks.md +162 -0
  48. package/docs/api/documents/SmarticoObject.md +445 -0
  49. package/docs/api/documents/Transforms.md +99 -0
  50. package/docs/api/enumerations/BonusStatus-1.md +11 -6
  51. package/docs/api/enumerations/JoinClanErrorCode.md +81 -0
  52. package/docs/api/enumerations/TournamentRegistrationError.md +12 -0
  53. package/docs/api/functions/clanTournamentPlayersTransform.md +13 -0
  54. package/docs/api/interfaces/AvatarCustomized.md +25 -0
  55. package/docs/api/interfaces/AvatarDefinition.md +94 -0
  56. package/docs/api/interfaces/AvatarPrompt.md +45 -0
  57. package/docs/api/interfaces/BonusMetaMap-1.md +4 -1
  58. package/docs/api/interfaces/BonusTemplateMetaMap-1.md +9 -4
  59. package/docs/api/interfaces/Clan.md +4 -0
  60. package/docs/api/interfaces/ClanInfo.md +109 -0
  61. package/docs/api/interfaces/ClanMember.md +53 -0
  62. package/docs/api/interfaces/ClanTournamentPlayerRaw.md +67 -0
  63. package/docs/api/interfaces/GemsDiamondsLog.md +43 -0
  64. package/docs/api/interfaces/GetClanInfoResponse.md +61 -0
  65. package/docs/api/interfaces/GetClanTournamentPlayersResponse.md +81 -0
  66. package/docs/api/interfaces/GetRaffleWonPrizesRequest.md +59 -0
  67. package/docs/api/interfaces/GetRaffleWonPrizesResponse.md +95 -0
  68. package/docs/api/interfaces/InboxMarkMessageAction.md +10 -2
  69. package/docs/api/interfaces/JackpotDetails.md +14 -15
  70. package/docs/api/interfaces/JackpotPot.md +9 -6
  71. package/docs/api/interfaces/LeaderBoardDetailsT.md +14 -8
  72. package/docs/api/interfaces/LeaderBoardUserT.md +8 -5
  73. package/docs/api/interfaces/LeaderBoardsRewardsT.md +7 -0
  74. package/docs/api/interfaces/PointsLog.md +43 -0
  75. package/docs/api/interfaces/RaffleWonPrize.md +59 -0
  76. package/docs/api/interfaces/RaffleWonPrizePublicMeta.md +27 -0
  77. package/docs/api/interfaces/RaffleWonPrizeUser.md +43 -0
  78. package/docs/api/interfaces/TAchCategory.md +2 -7
  79. package/docs/api/interfaces/TAvatarCustomized.md +4 -4
  80. package/docs/api/interfaces/TAvatarDefinition.md +13 -14
  81. package/docs/api/interfaces/TAvatarPrompt.md +6 -6
  82. package/docs/api/interfaces/TBonus.md +16 -8
  83. package/docs/api/interfaces/TBuyStoreItemResult.md +4 -29
  84. package/docs/api/interfaces/TClaimBonusResult.md +5 -5
  85. package/docs/api/interfaces/TClan.md +8 -4
  86. package/docs/api/interfaces/TClanInfo.md +47 -0
  87. package/docs/api/interfaces/TClanJoinResult.md +11 -1
  88. package/docs/api/interfaces/TClanTournamentPlayer.md +55 -0
  89. package/docs/api/interfaces/TClanTournamentPlayersResult.md +27 -0
  90. package/docs/api/interfaces/TClans.md +3 -1
  91. package/docs/api/interfaces/TGetTranslations.md +4 -0
  92. package/docs/api/interfaces/TInboxMessage.md +14 -6
  93. package/docs/api/interfaces/TInboxMessageBody.md +18 -12
  94. package/docs/api/interfaces/TLevel.md +17 -20
  95. package/docs/api/interfaces/TLevelCurrent.md +19 -18
  96. package/docs/api/interfaces/TMiniGamePlayBatchResult.md +14 -6
  97. package/docs/api/interfaces/TMiniGamePlayResult.md +9 -4
  98. package/docs/api/interfaces/TMissionClaimRewardResult.md +1 -9
  99. package/docs/api/interfaces/TMissionOptInResult.md +1 -5
  100. package/docs/api/interfaces/TMissionOrBadge.md +4 -7
  101. package/docs/api/interfaces/TRaffleOptinResponse.md +4 -2
  102. package/docs/api/interfaces/TSegmentCheckResult.md +10 -0
  103. package/docs/api/interfaces/TSetAvatarResult.md +3 -3
  104. package/docs/api/interfaces/TStoreItem.md +3 -13
  105. package/docs/api/interfaces/TTournament.md +1 -1
  106. package/docs/api/interfaces/TTournamentDetailed.md +1 -1
  107. package/docs/api/interfaces/TTournamentRegistrationResult.md +4 -2
  108. package/docs/api/interfaces/TUICustomSection.md +23 -19
  109. package/docs/api/interfaces/TUserProfile.md +18 -16
  110. package/docs/api/interfaces/TransformedRaffleClaimPrizeResponse.md +6 -2
  111. package/docs/api/interfaces/UserLevelExtraCountersT.md +9 -2
  112. package/docs/api/type-aliases/ActivityLogEntry.md +3 -0
  113. package/docs/native/ADDING_METHODS.md +7 -2
  114. package/docs/native/PROTOCOL.md +337 -0
  115. package/docs/ui/avatars/UIGuide_getAvatarPrompts.md +100 -0
  116. package/docs/ui/avatars/UIGuide_getAvatarsCustomized.md +90 -0
  117. package/docs/ui/avatars/UIGuide_getAvatarsList.md +105 -0
  118. package/docs/ui/avatars/UIGuide_setAvatar.md +118 -0
  119. package/docs/ui/bonuses/UIGuide_claimBonus.md +144 -0
  120. package/docs/ui/bonuses/UIGuide_getBonuses.md +176 -0
  121. package/docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md +99 -0
  122. package/docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md +76 -0
  123. package/docs/ui/gamepick/UIGuide_gamePickGetBoard.md +81 -0
  124. package/docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md +78 -0
  125. package/docs/ui/gamepick/UIGuide_gamePickGetHistory.md +55 -0
  126. package/docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md +71 -0
  127. package/docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md +64 -0
  128. package/docs/ui/gamepick/UIGuide_gamePickSubmitSelection.md +103 -0
  129. package/docs/ui/gamepick/UIGuide_gamePickSubmitSelectionQuiz.md +67 -0
  130. package/docs/ui/general/UIGuide_getCustomSections.md +137 -0
  131. package/docs/ui/general/UIGuide_getRelatedItemsForGame.md +140 -0
  132. package/docs/ui/inbox/UIGuide_deleteInboxMessage.md +135 -0
  133. package/docs/ui/inbox/UIGuide_getInboxMessageBody.md +133 -0
  134. package/docs/ui/inbox/UIGuide_getInboxMessages.md +186 -0
  135. package/docs/ui/inbox/UIGuide_markInboxMessageAsRead.md +122 -0
  136. package/docs/ui/inbox/UIGuide_markUnmarkInboxMessageAsFavorite.md +84 -0
  137. package/docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md +73 -0
  138. package/docs/ui/jackpots/UIGuide_getJackpotWinners.md +83 -0
  139. package/docs/ui/jackpots/UIGuide_jackpotGet.md +138 -0
  140. package/docs/ui/jackpots/UIGuide_jackpotOptIn.md +85 -0
  141. package/docs/ui/jackpots/UIGuide_jackpotOptOut.md +65 -0
  142. package/docs/ui/leaderboard/UIGuide_getLeaderBoard.md +166 -0
  143. package/docs/ui/minigames/UIGuide_getMiniGames.md +153 -0
  144. package/docs/ui/minigames/UIGuide_getMiniGamesHistory.md +90 -0
  145. package/docs/ui/minigames/UIGuide_playMiniGame.md +150 -0
  146. package/docs/ui/minigames/UIGuide_playMiniGameBatch.md +128 -0
  147. package/docs/ui/raffles/UIGuide_claimRafflePrize.md +99 -0
  148. package/docs/ui/raffles/UIGuide_getRaffleDrawRun.md +117 -0
  149. package/docs/ui/raffles/UIGuide_getRaffleDrawRunsHistory.md +92 -0
  150. package/docs/ui/raffles/UIGuide_getRaffleWonPrizes.md +120 -0
  151. package/docs/ui/raffles/UIGuide_getRaffles.md +175 -0
  152. package/docs/ui/raffles/UIGuide_requestRaffleOptin.md +114 -0
  153. package/docs/ui/user/UIGuide_getActivityLog.md +130 -0
  154. package/docs/ui/user/UIGuide_getLevels.md +47 -42
  155. package/package.json +1 -1
  156. package/src/Base/ClassId.ts +2 -0
  157. package/src/Jackpots/JackpotDetails.ts +14 -15
  158. package/src/Jackpots/JackpotPot.ts +10 -6
  159. package/src/MiniGames/SAWGameType.ts +3 -0
  160. package/src/MiniGames/SAWTemplateUI.ts +10 -0
  161. package/src/Raffle/GetRaffleWonPrizesRequest.ts +12 -0
  162. package/src/Raffle/GetRaffleWonPrizesResponse.ts +56 -0
  163. package/src/Raffle/index.ts +3 -1
  164. package/src/SmarticoAPI.ts +14 -1
  165. package/src/SmarticoLib/index.ts +4 -0
  166. package/src/WSAPI/WSAPIAvatars.ts +267 -49
  167. package/src/WSAPI/WSAPIBonuses.ts +224 -10
  168. package/src/WSAPI/WSAPIGamePick.ts +538 -253
  169. package/src/WSAPI/WSAPIGeneral.ts +156 -14
  170. package/src/WSAPI/WSAPIInbox.ts +545 -56
  171. package/src/WSAPI/WSAPIJackpots.ts +297 -61
  172. package/src/WSAPI/WSAPILeaderBoard.ts +127 -13
  173. package/src/WSAPI/WSAPIMiniGames.ts +465 -49
  174. package/src/WSAPI/WSAPIRaffles.ts +592 -64
  175. package/src/WSAPI/WSAPITournaments.ts +3 -3
  176. package/src/WSAPI/WSAPITypes.ts +243 -132
  177. package/src/WSAPI/WSAPIUser.ts +193 -43
  178. package/tsconfig.json +9 -1
@@ -0,0 +1,81 @@
1
+ # UI Guide — `gamePickGetBoard`
2
+
3
+ ## Overview
4
+ - Returns a leaderboard scoped to one round, OR (with `round_id: -1`) the
5
+ season / overall leaderboard for the template.
6
+ - Powers leaderboard screens within the Game Pick experience.
7
+ - No cache; no push subscription.
8
+
9
+ ## List view organization
10
+
11
+ Server-ranked. `users[]` is the public top list; `my_user` carries the
12
+ current user's row separately (renders as a sticky "you are here" footer).
13
+
14
+ ## Row layout
15
+
16
+ Each leaderboard row shows:
17
+
18
+ | Field | Source | Notes |
19
+ |---|---|---|
20
+ | Rank | `gp_position` | Big number or "—" when null (not yet ranked) |
21
+ | Avatar | `avatar_url` | 32×32 px (1:1) |
22
+ | Username | `public_username` | May be masked / anonymized by label settings — see below |
23
+ | Score | `resolution_score` | Total score in the scoped period |
24
+ | Stats (full / part / lost) | `full_wins_count`, `part_wins_count`, `lost_count` | Optional inline pills |
25
+
26
+ ### Username masking
27
+
28
+ Label settings can anonymize `public_username` for other players. Pair the
29
+ username with the avatar so the user can still recognize themselves visually
30
+ even when usernames are masked.
31
+
32
+ ## "You are here" footer (`my_user`)
33
+
34
+ When the response includes `my_user`, render it as a sticky footer always
35
+ visible at the bottom of the leaderboard. This gives the user a fixed
36
+ anchor regardless of scroll position. When `my_user` is `null` (user
37
+ hasn't predicted in this scope), render a CTA: "Play a round to join the
38
+ leaderboard."
39
+
40
+ ## `round_id` modes
41
+
42
+ | `round_id` | Returns |
43
+ |---|---|
44
+ | Positive | Per-round leaderboard (only scores from that round's events) |
45
+ | `-1` | Season / overall leaderboard (aggregated across all rounds of the template) |
46
+
47
+ Use a top tab or segmented control to let the user switch between per-round
48
+ and season views.
49
+
50
+ ## Empty / loading / error states
51
+
52
+ - **Empty**: "No players ranked yet — be the first!"
53
+ - **Loading**: skeleton row list (5–10 placeholders).
54
+ - **Error (`errCode: 100002`)**: "Game not found" — bounce back.
55
+ - **Error (`errCode: 100000`)**: "Session expired" — re-init.
56
+
57
+ ## Refresh
58
+
59
+ - No SDK cache.
60
+ - Poll every 30–60 s while the leaderboard is on screen to surface rank
61
+ changes after events resolve.
62
+ - Re-call after every successful round resolution (status transitions to
63
+ `RoundResolved` (4)).
64
+
65
+ ## Click-through (view another player's picks)
66
+
67
+ From a leaderboard row, allow the user to tap-through to
68
+ [`gamePickGetRoundInfoForUser`](../../api/classes/WSAPIGamePick.md#gamepickgetroundinfoforuser)
69
+ using `users[].int_user_id` to inspect that player's predictions. The default
70
+ Smartico UI opens this in a modal / sheet over the leaderboard.
71
+
72
+ ## Mobile vs desktop
73
+
74
+ - **Mobile**: full-width rows; sticky footer for `my_user`.
75
+ - **Desktop**: full-width rows centered with max-width; sticky footer.
76
+
77
+ ## Performance
78
+
79
+ - Server-paginated implicitly — typical responses are top 20–100 players
80
+ plus the user's row.
81
+ - No virtualization needed unless the response is >200 rows.
@@ -0,0 +1,78 @@
1
+ # UI Guide — `gamePickGetGameInfo`
2
+
3
+ ## Overview
4
+ - Returns the game template configuration + metadata for every round
5
+ (without events).
6
+ - Powers the game welcome / lobby screen.
7
+ - Lighter than
8
+ [`gamePickGetActiveRounds`](../../api/classes/WSAPIGamePick.md#gamepickgetactiverounds)
9
+ because it omits the per-round event payload.
10
+ - No cache; no push subscription.
11
+
12
+ ## Welcome / lobby layout
13
+
14
+ The default Smartico UI uses this for the top-level Game Pick screen:
15
+
16
+ | Section | Source |
17
+ |---|---|
18
+ | Game title | `sawTemplate.saw_template_ui_definition.name` |
19
+ | Branding image | `sawTemplate.saw_template_ui_definition` (theme-dependent) |
20
+ | Buy-in chip | `saw_buyin_type_id` + `buyin_cost_*` (see table below) |
21
+ | Attempts counter | `spin_count` (visible when `saw_buyin_type_id` is Spins) |
22
+ | Rounds list | `allRounds[]` |
23
+
24
+ ## Buy-in chip mapping (`saw_buyin_type_id`)
25
+
26
+ | Value | Display |
27
+ |---|---|
28
+ | Free (0) | "Free to play" pill |
29
+ | Points (1) | "100 points" with points icon |
30
+ | Gems (2) | "10 gems" with gems icon |
31
+ | Diamonds (3) | "1 diamond" with diamonds icon |
32
+ | Spins (4) | "X attempts left" using `spin_count` |
33
+
34
+ ## Rounds metadata list
35
+
36
+ Each row in `allRounds[]` carries:
37
+
38
+ | Field | Source | Notes |
39
+ |---|---|---|
40
+ | Round name | `round_name` | Title |
41
+ | Description | `round_description` | Subtitle |
42
+ | Window | `open_date`, `last_bet_date` | "Open • Bets close in 2h" |
43
+ | Status pill | `round_status_id` | Same mapping as [`gamePickGetActiveRounds`](../../api/classes/WSAPIGamePick.md#gamepickgetactiverounds) |
44
+
45
+ Click a row → fetch
46
+ [`gamePickGetActiveRound`](../../api/classes/WSAPIGamePick.md#gamepickgetactiveround)
47
+ for that `round_id` (events are not in this response).
48
+
49
+ ## When to use this vs `gamePickGetActiveRounds`
50
+
51
+ | Use this method | Use `gamePickGetActiveRounds` |
52
+ |---|---|
53
+ | Welcome / lobby screen showing all rounds (open + closed + resolved) | Only open rounds with their event lists |
54
+ | When you only need round metadata (titles, windows) | When you want to render prediction inputs inline |
55
+ | Lighter payload — skips events | Heavier — full event payload |
56
+
57
+ ## Refresh
58
+
59
+ - No cache.
60
+ - Re-call after a successful submit to refresh `spin_count`.
61
+ - Otherwise re-call on screen mount.
62
+
63
+ ## Error states
64
+
65
+ | `errCode` | Treatment |
66
+ |---|---|
67
+ | `100002` (template not found) | Show "Game not available" |
68
+ | `100000` (auth) | Re-init session |
69
+
70
+ ## Mobile vs desktop
71
+
72
+ - **Mobile**: header + rounds stacked vertically.
73
+ - **Desktop**: header on top, rounds in a 2-column grid below.
74
+
75
+ ## Performance
76
+
77
+ - Single round-trip with no event payload — much smaller than
78
+ [`gamePickGetActiveRounds`](../../api/classes/WSAPIGamePick.md#gamepickgetactiverounds).
@@ -0,0 +1,55 @@
1
+ # UI Guide — `gamePickGetHistory`
2
+
3
+ ## Overview
4
+ - Returns the full round history (active + resolved) for a MatchX or Quiz
5
+ game template, newest-first.
6
+ - Powers the "Past predictions" / history tab.
7
+ - No cache; no push subscription.
8
+
9
+ ## List view organization
10
+
11
+ Server-sorted newest-first. No client-side sort needed. Optionally tab by:
12
+
13
+ - "Resolved" — filter to `is_resolved === true`.
14
+ - "Awaiting resolution" — filter to `round_status_id ===
15
+ AllEventsResolved_ButNotRound` (3).
16
+ - "Open" — same content as
17
+ [`gamePickGetActiveRounds`](../../api/classes/WSAPIGamePick.md#gamepickgetactiverounds);
18
+ the history endpoint includes these too but the default Smartico UI keeps
19
+ them in the lobby instead.
20
+
21
+ ## Item card / row
22
+
23
+ Each row shows:
24
+
25
+ | Field | Source | Notes |
26
+ |---|---|---|
27
+ | Round name | `round_name` | Title |
28
+ | Resolved on | `resolution_date` or `last_bet_date` | "Resolved 22 May" |
29
+ | User score | `user_score` | Right-aligned |
30
+ | Full / partial / lost counts | `events` aggregated by `resolution_type_id` | Optional summary |
31
+ | Status pill | `round_status_id` | Same mapping as [`gamePickGetActiveRounds`](../../api/classes/WSAPIGamePick.md#gamepickgetactiverounds) |
32
+
33
+ **Click target**: open the round detail (typically a read-only view showing
34
+ the user's picks plus event resolution badges).
35
+
36
+ ## Empty / loading / error states
37
+
38
+ - **Empty**: "No past predictions yet — play a round to see your history."
39
+ - **Loading**: skeleton list (3–5 placeholders).
40
+ - **Error**: keep prior list if any; non-blocking banner.
41
+
42
+ ## Refresh
43
+
44
+ - No cache.
45
+ - Re-call when the user opens the history tab. No need to poll — resolved
46
+ rounds don't change once `round_status_id` reaches `RoundResolved` (4).
47
+
48
+ ## Mobile vs desktop
49
+
50
+ - Identical row density on both.
51
+
52
+ ## Performance
53
+
54
+ - The history endpoint can return a long list for active games. Consider
55
+ client-side pagination or virtualization if rendering 100+ rows.
@@ -0,0 +1,71 @@
1
+ # UI Guide — `gamePickGetRoundInfoForUser`
2
+
3
+ ## Overview
4
+ - Returns a round with another player's predictions instead of the
5
+ current user's.
6
+ - Use to power "view this player's picks" modals opened from leaderboard
7
+ rows.
8
+ - The `int_user_id` comes from
9
+ [`gamePickGetBoard`](../../api/classes/WSAPIGamePick.md#gamepickgetboard)
10
+ (`users[].int_user_id`).
11
+ - No cache.
12
+
13
+ ## Modal layout
14
+
15
+ Open as a modal / sheet over the leaderboard. Top-to-bottom sections:
16
+
17
+ 1. **Header**: target player's avatar + username + rank ("Rank #3 · 240
18
+ pts").
19
+ 2. **Round summary**: round name + final score line.
20
+ 3. **Event list**: one row per event with the target user's pick + the
21
+ resolution result.
22
+
23
+ ## Event row layout
24
+
25
+ Same as
26
+ [`gamePickGetActiveRound`](../../api/classes/WSAPIGamePick.md#gamepickgetactiveround)
27
+ but with two key differences:
28
+
29
+ | Field | Difference |
30
+ |---|---|
31
+ | `user_selection` / `team{1,2}_user_selection` | Shows the TARGET user's picks, not the current user's |
32
+ | Input | Read-only — no edit affordance |
33
+ | Resolution badge | `resolution_type_id` ({@link GamePickResolutionType}) drives the badge — same mapping as the active round detail |
34
+
35
+ ## Stable `int_user_id` semantics
36
+
37
+ `int_user_id` is stable within a single game template but NOT portable
38
+ across templates. Always source it fresh from
39
+ [`gamePickGetBoard`](../../api/classes/WSAPIGamePick.md#gamepickgetboard)
40
+ in the current template — don't cache across template boundaries.
41
+
42
+ ## Empty / error states
43
+
44
+ | `errCode` | Treatment |
45
+ |---|---|
46
+ | `4` (round / event / user not found) | Show "This player has no predictions for this round" — close the modal |
47
+ | `100002` (template not found) | Bounce back |
48
+ | `100000` (auth) | Re-init session |
49
+
50
+ When the target user has no picks (rare — every leaderboard entry has at
51
+ least one pick), the response succeeds with all events showing empty
52
+ selection fields. Render as "No picks recorded for this round".
53
+
54
+ ## Refresh
55
+
56
+ - No cache.
57
+ - Re-fetch on modal open. Don't poll — another player's predictions are
58
+ fixed once they submit.
59
+
60
+ ## Mobile vs desktop
61
+
62
+ - **Mobile**: full-screen modal sheet sliding up from the bottom.
63
+ - **Desktop**: centered modal with backdrop.
64
+
65
+ ## Performance
66
+
67
+ - Single round-trip. Same payload size as
68
+ [`gamePickGetActiveRound`](../../api/classes/WSAPIGamePick.md#gamepickgetactiveround)
69
+ (full event list).
70
+ - Lazy-load — don't fetch until the user explicitly opens a leaderboard
71
+ row.
@@ -0,0 +1,64 @@
1
+ # UI Guide — `gamePickGetUserInfo`
2
+
3
+ ## Overview
4
+ - Returns the user's profile within the Game Pick games server — display
5
+ name, avatar, mirrored balances, last sync timestamp.
6
+ - Used for the in-game profile header. NOT a source of truth for the
7
+ user's live Smartico balance — use
8
+ [`getUserProfile`](../../api/classes/WSAPIUser.md#getuserprofile) for
9
+ that.
10
+ - No cache; no push subscription.
11
+
12
+ ## Render layout
13
+
14
+ The default Smartico UI uses this in the Game Pick header / profile panel:
15
+
16
+ | Element | Source |
17
+ |---|---|
18
+ | Avatar | `avatar_url` (40–64 px square) |
19
+ | Username | `public_username` |
20
+ | "Set custom username" CTA | shown when `pubic_username_set === false` |
21
+ | Points balance | `ach_points_balance` |
22
+ | Gems balance | `ach_gems_balance` |
23
+ | Diamonds balance | `ach_diamonds_balance` |
24
+ | Last sync hint | `last_wallet_sync_time` (small text "Synced 30s ago") |
25
+
26
+ ## Balance freshness caveat
27
+
28
+ The balances here are a server-side mirror, updated at most every ~60 s
29
+ from the user's true Smartico balance. For widget components outside the
30
+ Game Pick context, or for affordability gating, prefer
31
+ [`getUserProfile`](../../api/classes/WSAPIUser.md#getuserprofile) — it
32
+ reflects the live balance with push subscription updates.
33
+
34
+ Within Game Pick itself, the mirrored balance is what the games server
35
+ uses to enforce buy-ins, so it's the correct value to display alongside
36
+ "Cost: 100 points" affordances.
37
+
38
+ ## First-call lazy provisioning
39
+
40
+ On the user's very first call for a given template, the games server
41
+ lazily creates their record. The call may take an extra ~200 ms on first
42
+ call as a result. Subsequent calls are normal latency.
43
+
44
+ ## Refresh
45
+
46
+ - No SDK cache.
47
+ - Re-call after every successful submit
48
+ ([`gamePickSubmitSelection`](../../api/classes/WSAPIGamePick.md#gamepicksubmitselection)
49
+ or
50
+ [`gamePickSubmitSelectionQuiz`](../../api/classes/WSAPIGamePick.md#gamepicksubmitselectionquiz))
51
+ to refresh the mirrored balances.
52
+ - Don't poll faster than every 60 s — the server-side mirror only
53
+ refreshes that often.
54
+
55
+ ## Mobile vs desktop
56
+
57
+ - **Mobile**: condensed avatar + username; balances in a row underneath.
58
+ - **Desktop**: avatar + name on the left, balances aligned right.
59
+
60
+ ## Performance
61
+
62
+ - Single round-trip.
63
+ - For multi-balance display elsewhere, prefer `getUserProfile` to avoid
64
+ the ~1-minute staleness of the mirror.
@@ -0,0 +1,103 @@
1
+ # UI Guide — `gamePickSubmitSelection` (MatchX)
2
+
3
+ ## Overview
4
+ - Submits all MatchX score predictions for a round in one shot.
5
+ - First successful submit charges one buy-in (per `saw_buyin_type_id`);
6
+ subsequent edits within the same round are free.
7
+ - Server hard-rejects submits after `last_bet_date` with `errCode: 3` (no
8
+ buy-in consumed).
9
+
10
+ ## Loading state
11
+
12
+ User taps "Submit" → enter in-flight state (spinner + disabled button).
13
+ Server typically responds in 200–600 ms.
14
+
15
+ ```ts
16
+ const [submitting, setSubmitting] = useState(false);
17
+
18
+ const onSubmit = async () => {
19
+ if (submitting) return;
20
+ setSubmitting(true);
21
+ const r = await window._smartico.api.gamePickSubmitSelection({
22
+ saw_template_id,
23
+ round,
24
+ });
25
+ setSubmitting(false);
26
+ handleResult(r);
27
+ };
28
+ ```
29
+
30
+ ## Idempotency guard
31
+
32
+ Re-submit is safe (returns `errCode: 3` and never double-charges) but the
33
+ double-roundtrip wastes time. Guard the call site as above.
34
+
35
+ ## Action button decision matrix
36
+
37
+ UI behavior per `errCode`:
38
+
39
+ | `errCode` | Action |
40
+ |---|---|
41
+ | `0` (success) | Show "Predictions saved" toast; refresh round to surface persisted picks; offer link to leaderboard |
42
+ | `3` (no changes / all events closed) | Silent — assume user clicked Submit with no edits |
43
+ | `4` (round / event not found) | Refresh active rounds; show "Round no longer available" |
44
+ | `40001` (no spins left) | Disable Submit; show "Out of attempts" + top-up CTA |
45
+ | `40003` (insufficient points) | Disable Submit; show insufficient-points message naming the deficit |
46
+ | `40004` (max spins cap hit) | Show "Daily limit reached — try again tomorrow" |
47
+ | `40007` (template not active) | Show "Game not currently available"; bounce back to lobby |
48
+ | `40009` (segment mismatch) | Show "This game isn't available to you" |
49
+ | `40011` / `40012` (gems / diamonds) | Same as `40003` for the matching currency |
50
+ | `100002` (template not found) | Show "Game not found"; bounce back |
51
+ | `100000` (auth) | Re-init session |
52
+ | Other non-zero | Generic error toast; allow retry |
53
+
54
+ ## Buy-in feedback
55
+
56
+ On the FIRST successful submit, the server deducts the buy-in. The default
57
+ Smartico UI shows a confirmation toast naming the cost ("100 points
58
+ deducted — good luck!"). The user's balance updates via
59
+ [`getUserProfile`](../../api/classes/WSAPIUser.md#getuserprofile)'s
60
+ `props_change` channel — re-render any balance widgets.
61
+
62
+ ## Refresh after success
63
+
64
+ - Re-call
65
+ [`gamePickGetActiveRound`](../../api/classes/WSAPIGamePick.md#gamepickgetactiveround)
66
+ for this round to surface `user_placed_bet === true` and
67
+ `has_not_submitted_changes === false`.
68
+ - The user's balance updates push automatically via the user-properties
69
+ channel.
70
+ - Score is awarded later, after the operator resolves the round (status
71
+ transitions to `RoundResolved` (4)).
72
+
73
+ ## Selection format
74
+
75
+ Each event must include:
76
+
77
+ ```ts
78
+ {
79
+ gp_event_id: number,
80
+ team1_user_selection: number, // predicted score for team 1
81
+ team2_user_selection: number, // predicted score for team 2
82
+ }
83
+ ```
84
+
85
+ Events not included in the submit are treated as "no change".
86
+
87
+ ## Mobile vs desktop
88
+
89
+ - **Mobile**: full-width Submit button anchored to bottom of viewport.
90
+ - **Desktop**: Submit button bottom-right of the round detail card.
91
+
92
+ ## Animations / transitions
93
+
94
+ - Submit tap → button morphs to spinner.
95
+ - On success → green checkmark briefly replaces the spinner; then toast
96
+ fades in.
97
+ - On error → spinner clears; error toast slides in; button re-enables.
98
+
99
+ ## Performance
100
+
101
+ - Single round-trip per submit.
102
+ - Server only writes events whose selections changed (delta UPSERT),
103
+ so submitting the full event list is efficient.
@@ -0,0 +1,67 @@
1
+ # UI Guide — `gamePickSubmitSelectionQuiz` (Quiz)
2
+
3
+ ## Overview
4
+ - Submits all Quiz answers for a round in one shot.
5
+ - First successful submit charges one buy-in (per `saw_buyin_type_id`).
6
+ - Same error-handling matrix as
7
+ [`gamePickSubmitSelection`](../../api/classes/WSAPIGamePick.md#gamepicksubmitselection).
8
+
9
+ ## Loading state and idempotency guard
10
+
11
+ Identical to
12
+ [`gamePickSubmitSelection`](../../api/classes/WSAPIGamePick.md#gamepicksubmitselection)
13
+ — spinner on click, guard against double-tap, single round-trip.
14
+
15
+ ## Action button decision matrix
16
+
17
+ Identical to
18
+ [`gamePickSubmitSelection`](../../api/classes/WSAPIGamePick.md#gamepicksubmitselection)
19
+ — see that UI guide for the full per-`errCode` table. The codes returned
20
+ are the same set.
21
+
22
+ The reported analytics event differs: this method emits
23
+ `minigame_quiz_prediction` instead of `minigame_matchx_prediction`.
24
+
25
+ ## Selection format
26
+
27
+ Each event must include:
28
+
29
+ ```ts
30
+ {
31
+ gp_event_id: number,
32
+ user_selection: string, // e.g. '1' / '2' / 'x' (1×2 market)
33
+ // or 'yes' / 'no' (binary market)
34
+ // or operator-defined string (custom)
35
+ }
36
+ ```
37
+
38
+ The accepted `user_selection` values depend on `market_type_id` on the event:
39
+
40
+ | Market | Valid `user_selection` values |
41
+ |---|---|
42
+ | 1×2 | `'1'`, `'x'`, `'2'` |
43
+ | Yes / No | `'yes'`, `'no'` |
44
+ | Custom | Operator-defined; check the event's `event_meta` for allowed values |
45
+
46
+ ## Quiz UI patterns
47
+
48
+ - **Radio button set** per event row — exactly one answer selectable.
49
+ - **Locked after deadline**: when `is_open_for_bets === false`, render the
50
+ user's prior selection as read-only and disable the input.
51
+
52
+ ## Refresh after success
53
+
54
+ Same as
55
+ [`gamePickSubmitSelection`](../../api/classes/WSAPIGamePick.md#gamepicksubmitselection):
56
+ re-fetch the active round to surface persisted state; balance updates push
57
+ via the user-properties channel; score is awarded after operator
58
+ resolution.
59
+
60
+ ## Mobile vs desktop
61
+
62
+ - **Mobile**: vertical radio button list.
63
+ - **Desktop**: horizontal button group per event.
64
+
65
+ ## Performance
66
+
67
+ - Single round-trip; delta UPSERT — only changed selections are written.
@@ -0,0 +1,137 @@
1
+ # UI Guide — `getCustomSections`
2
+
3
+ ## Overview
4
+ - Returns the user-eligible custom sections that the operator configured in the
5
+ BO. Each section is a nav-level entry the consumer renders in a side menu /
6
+ bottom-bar / desktop sidebar.
7
+ - `section_type_id` (see `AchCustomSectionType`) is the dispatch key — it tells
8
+ the consumer which page component to mount when the user opens the section.
9
+ - 30 s cache; no push subscription.
10
+
11
+ ## Nav layout
12
+
13
+ Render sections in the order returned — do NOT re-sort client-side. The operator
14
+ chose the order; preserve it.
15
+
16
+ | Surface | Default Smartico UI behavior |
17
+ |---|---|
18
+ | Mobile hamburger menu | `menu_img` (left) + `menu_name` (label) |
19
+ | Desktop sidebar / new navbar | `menu_img` + `menu_name` row |
20
+ | Home bottom tab bar | `menu_img` as the icon for each tab |
21
+
22
+ ## Section type → page mapping
23
+
24
+ `section_type_id` drives the component to mount:
25
+
26
+ | `AchCustomSectionType` | Page behavior |
27
+ |---|---|
28
+ | `HTML_PAGE` (1) | Render `body` as raw HTML in a sandboxed container |
29
+ | `MISSIONS_CATEGORY` (2) | Mount the missions page; filter to missions in this section |
30
+ | `TOURNAMENTS_CATEGORY` (3) | Mount the tournaments page; filter to tournaments in this section |
31
+ | `LEVELS` (4) | Liquid-template page; render `body` inside an iframe with the data context selected via `liquid_entity_data` |
32
+ | `MINI_GAMES` (5) | Mount the SAW page; filter mini-games to this section |
33
+ | `MISSION_CUSTOM_LAYOUT` (6) | Themed card-grid mission view; apply `theme` + optional `custom_skin_images` + `generic_custom_css` |
34
+ | `MATCH_X_AND_QUIZ` (7) | Mount the SAW page; filter to MatchX / Quiz games only |
35
+ | `REDIRECT_LINK` (9) | Do NOT mount a page; on click resolve `url_or_dp` (Smartico DP string or external URL) |
36
+ | `LOOTBOX_WEEKLY` (10) | Mount the SAW page; filter to weekly lootbox templates |
37
+ | `LOOTBOX_CALENDAR_DAYS` (11) | Mount the SAW page; filter to calendar-day lootbox templates |
38
+ | `STORE` (12) | Mount the store page; filter items by `shop_category_ids` |
39
+ | `RAFFLE` (13) | Mount the raffle page; show the raffle referenced by `raffle_id` |
40
+ | `BADGES` (14) | Mount the badges page; filter to `ach_category_ids` |
41
+
42
+ If a `section_type_id` value is not in this map, skip the section silently —
43
+ the operator might have configured a type the consumer doesn't yet support.
44
+
45
+ ## Item card / nav row
46
+
47
+ Fields rendered per section in the nav:
48
+
49
+ | Field | Source | Notes |
50
+ |---|---|---|
51
+ | Icon | `menu_img` | 64 × 64 px (1:1). Fallback chain: `.webp → .png` |
52
+ | Label | `menu_name` | Server-pre-translated |
53
+ | Notification badge | derived (see below) | Per-section unread count |
54
+
55
+ **Notification badges** — the default Smartico UI shows an unread count for
56
+ sections of these types:
57
+
58
+ - `MISSIONS_CATEGORY`: count of new missions
59
+ - `BADGES`: count of new badges
60
+ - `TOURNAMENTS_CATEGORY`: count of new tournaments
61
+ - `MINI_GAMES`: count of spinnable templates
62
+ - `LOOTBOX_WEEKLY` / `LOOTBOX_CALENDAR_DAYS`: count of spinnable lootboxes
63
+ - `MATCH_X_AND_QUIZ`: count of unfinished MatchX / Quiz games
64
+
65
+ Other types (`HTML_PAGE`, `LEVELS`, `STORE`, `RAFFLE`, `REDIRECT_LINK`) don't
66
+ typically need a badge — the default UI omits them.
67
+
68
+ ## Theming (`MISSION_CUSTOM_LAYOUT` only)
69
+
70
+ The `theme` field applies only to `MISSION_CUSTOM_LAYOUT` sections — it does
71
+ not override the global widget theme for other types. The default Smartico UI
72
+ maps `GENERIC` to a configurable layout (using `custom_skin_images` +
73
+ `generic_custom_css`) and other values (`valentines-light`, `valentines-dark`,
74
+ `euro-2024`) to fixed seasonal layouts.
75
+
76
+ ## Liquid templates (`LEVELS` type)
77
+
78
+ For `section_type_id === LEVELS`, render `body` (the operator-authored Liquid
79
+ template) inside a sandboxed iframe. Inject the data context selected by
80
+ `liquid_entity_data` — each ID names one entity collection the consumer
81
+ should pass into the template:
82
+
83
+ | `LiquidEntityData` ID | Context name |
84
+ |---|---|
85
+ | `Missions` (1) | `missions` |
86
+ | `Store` (2) | `items` + `storeItems` |
87
+ | `Tournaments` (3) | `tournaments` |
88
+ | `MiniGames` (4) | `miniGames` |
89
+ | `Levels` (5) | `levels` |
90
+ | `Jackpots` (6) | `jackpots` |
91
+ | `Bonus` (7) | `bonuses` |
92
+ | `Badges` (9) | `badges` + `badgeCategories` |
93
+ | `Tournament` (10) | `singleTournament` (from `ach_tournament_id`) |
94
+ | `Raffles` (11) | `raffles` |
95
+ | `SingleRaffle` (12) | `singleRaffle` (from `raffle_id`) |
96
+
97
+ Also always inject `userInfo`, `liquidParams` (URL params), `storeCategories`,
98
+ `badgeCategories` for any Liquid section.
99
+
100
+ Provide a `_smartico` proxy so inner template JS can call public SDK methods
101
+ (`openMission()`, `openTournament()`, etc.) back to the parent frame via
102
+ postMessage.
103
+
104
+ ## Image / asset specs
105
+
106
+ - **Nav icon (`menu_img`)**: 64 × 64 px (1:1).
107
+ - **Format**: WebP when supported; PNG fallback.
108
+ - **Fallback chain**: `.webp → .png → default placeholder`.
109
+
110
+ ## Empty / loading / error states
111
+
112
+ - **Empty (no sections)**: render the built-in pages only (Missions /
113
+ Tournaments / Store / etc.) — no custom-section additions.
114
+ - **Loading (cold fetch)**: skeleton nav placeholders (3–5 rows).
115
+ - **Error**: keep prior nav state if any; non-blocking banner.
116
+
117
+ ## Refresh
118
+
119
+ - 30 s SDK cache absorbs nav re-mounts.
120
+ - No push subscription. Sections become eligible (or ineligible) when the
121
+ user's segments / level change server-side; the next call after the cache
122
+ window expires picks the new set up.
123
+
124
+ ## Mobile vs desktop
125
+
126
+ - **Mobile**: hamburger menu OR bottom tab bar (depending on the consumer's
127
+ shell).
128
+ - **Desktop**: persistent sidebar with icon + label.
129
+ - **Tab bar overflow**: when sections exceed the tab bar capacity (default 5),
130
+ the default Smartico UI moves overflow into a "More" menu.
131
+
132
+ ## Performance
133
+
134
+ - Cache for 30 s; fetch once at app boot.
135
+ - Pre-load `menu_img` icons at first nav render.
136
+ - For Liquid sections (`LEVELS`), lazy-load the iframe — don't mount it until
137
+ the user navigates to the section.