@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.
- package/CLAUDE.md +103 -0
- package/README.md +32 -10
- package/dist/Base/ClassId.d.ts +2 -0
- package/dist/Jackpots/JackpotDetails.d.ts +14 -15
- package/dist/Jackpots/JackpotPot.d.ts +10 -6
- package/dist/MiniGames/SAWGameType.d.ts +3 -1
- package/dist/MiniGames/SAWTemplateUI.d.ts +7 -0
- package/dist/Raffle/GetRaffleWonPrizesRequest.d.ts +9 -0
- package/dist/Raffle/GetRaffleWonPrizesResponse.d.ts +52 -0
- package/dist/Raffle/index.d.ts +2 -0
- package/dist/SmarticoAPI.d.ts +6 -1
- package/dist/SmarticoLib/index.d.ts +5 -1
- package/dist/WSAPI/WSAPIAvatars.d.ts +267 -49
- package/dist/WSAPI/WSAPIBonuses.d.ts +224 -10
- package/dist/WSAPI/WSAPIGamePick.d.ts +538 -253
- package/dist/WSAPI/WSAPIGeneral.d.ts +156 -14
- package/dist/WSAPI/WSAPIInbox.d.ts +547 -58
- package/dist/WSAPI/WSAPIJackpots.d.ts +292 -57
- package/dist/WSAPI/WSAPILeaderBoard.d.ts +127 -13
- package/dist/WSAPI/WSAPIMiniGames.d.ts +465 -49
- package/dist/WSAPI/WSAPIRaffles.d.ts +576 -52
- package/dist/WSAPI/WSAPITournaments.d.ts +3 -3
- package/dist/WSAPI/WSAPITypes.d.ts +243 -132
- package/dist/WSAPI/WSAPIUser.d.ts +193 -43
- package/dist/index.js +3412 -616
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +3395 -609
- package/dist/index.modern.mjs.map +1 -1
- package/docs/Callbacks.md +162 -0
- package/docs/SmarticoObject.md +445 -0
- package/docs/Transforms.md +99 -0
- package/docs/api/README.md +26 -0
- package/docs/api/classes/WSAPIAvatars.md +282 -54
- package/docs/api/classes/WSAPIBonuses.md +233 -12
- package/docs/api/classes/WSAPIClans.md +380 -10
- package/docs/api/classes/WSAPIGamePick.md +555 -26
- package/docs/api/classes/WSAPIGeneral.md +165 -16
- package/docs/api/classes/WSAPIInbox.md +588 -64
- package/docs/api/classes/WSAPIJackpots.md +320 -66
- package/docs/api/classes/WSAPILeaderBoard.md +133 -15
- package/docs/api/classes/WSAPIMiniGames.md +501 -64
- package/docs/api/classes/WSAPIMissions.md +58 -79
- package/docs/api/classes/WSAPIRaffles.md +647 -69
- package/docs/api/classes/WSAPIStore.md +83 -108
- package/docs/api/classes/WSAPITournaments.md +495 -28
- package/docs/api/classes/WSAPIUser.md +520 -83
- package/docs/api/documents/Callbacks.md +162 -0
- package/docs/api/documents/SmarticoObject.md +445 -0
- package/docs/api/documents/Transforms.md +99 -0
- package/docs/api/enumerations/BonusStatus-1.md +11 -6
- package/docs/api/enumerations/JoinClanErrorCode.md +81 -0
- package/docs/api/enumerations/TournamentRegistrationError.md +12 -0
- package/docs/api/functions/clanTournamentPlayersTransform.md +13 -0
- package/docs/api/interfaces/AvatarCustomized.md +25 -0
- package/docs/api/interfaces/AvatarDefinition.md +94 -0
- package/docs/api/interfaces/AvatarPrompt.md +45 -0
- package/docs/api/interfaces/BonusMetaMap-1.md +4 -1
- package/docs/api/interfaces/BonusTemplateMetaMap-1.md +9 -4
- package/docs/api/interfaces/Clan.md +4 -0
- package/docs/api/interfaces/ClanInfo.md +109 -0
- package/docs/api/interfaces/ClanMember.md +53 -0
- package/docs/api/interfaces/ClanTournamentPlayerRaw.md +67 -0
- package/docs/api/interfaces/GemsDiamondsLog.md +43 -0
- package/docs/api/interfaces/GetClanInfoResponse.md +61 -0
- package/docs/api/interfaces/GetClanTournamentPlayersResponse.md +81 -0
- package/docs/api/interfaces/GetRaffleWonPrizesRequest.md +59 -0
- package/docs/api/interfaces/GetRaffleWonPrizesResponse.md +95 -0
- package/docs/api/interfaces/InboxMarkMessageAction.md +10 -2
- package/docs/api/interfaces/JackpotDetails.md +14 -15
- package/docs/api/interfaces/JackpotPot.md +9 -6
- package/docs/api/interfaces/LeaderBoardDetailsT.md +14 -8
- package/docs/api/interfaces/LeaderBoardUserT.md +8 -5
- package/docs/api/interfaces/LeaderBoardsRewardsT.md +7 -0
- package/docs/api/interfaces/PointsLog.md +43 -0
- package/docs/api/interfaces/RaffleWonPrize.md +59 -0
- package/docs/api/interfaces/RaffleWonPrizePublicMeta.md +27 -0
- package/docs/api/interfaces/RaffleWonPrizeUser.md +43 -0
- package/docs/api/interfaces/TAchCategory.md +2 -7
- package/docs/api/interfaces/TAvatarCustomized.md +4 -4
- package/docs/api/interfaces/TAvatarDefinition.md +13 -14
- package/docs/api/interfaces/TAvatarPrompt.md +6 -6
- package/docs/api/interfaces/TBonus.md +16 -8
- package/docs/api/interfaces/TBuyStoreItemResult.md +4 -29
- package/docs/api/interfaces/TClaimBonusResult.md +5 -5
- package/docs/api/interfaces/TClan.md +8 -4
- package/docs/api/interfaces/TClanInfo.md +47 -0
- package/docs/api/interfaces/TClanJoinResult.md +11 -1
- package/docs/api/interfaces/TClanTournamentPlayer.md +55 -0
- package/docs/api/interfaces/TClanTournamentPlayersResult.md +27 -0
- package/docs/api/interfaces/TClans.md +3 -1
- package/docs/api/interfaces/TGetTranslations.md +4 -0
- package/docs/api/interfaces/TInboxMessage.md +14 -6
- package/docs/api/interfaces/TInboxMessageBody.md +18 -12
- package/docs/api/interfaces/TLevel.md +17 -20
- package/docs/api/interfaces/TLevelCurrent.md +19 -18
- package/docs/api/interfaces/TMiniGamePlayBatchResult.md +14 -6
- package/docs/api/interfaces/TMiniGamePlayResult.md +9 -4
- package/docs/api/interfaces/TMissionClaimRewardResult.md +1 -9
- package/docs/api/interfaces/TMissionOptInResult.md +1 -5
- package/docs/api/interfaces/TMissionOrBadge.md +4 -7
- package/docs/api/interfaces/TRaffleOptinResponse.md +4 -2
- package/docs/api/interfaces/TSegmentCheckResult.md +10 -0
- package/docs/api/interfaces/TSetAvatarResult.md +3 -3
- package/docs/api/interfaces/TStoreItem.md +3 -13
- package/docs/api/interfaces/TTournament.md +1 -1
- package/docs/api/interfaces/TTournamentDetailed.md +1 -1
- package/docs/api/interfaces/TTournamentRegistrationResult.md +4 -2
- package/docs/api/interfaces/TUICustomSection.md +23 -19
- package/docs/api/interfaces/TUserProfile.md +18 -16
- package/docs/api/interfaces/TransformedRaffleClaimPrizeResponse.md +6 -2
- package/docs/api/interfaces/UserLevelExtraCountersT.md +9 -2
- package/docs/api/type-aliases/ActivityLogEntry.md +3 -0
- package/docs/native/ADDING_METHODS.md +7 -2
- package/docs/native/PROTOCOL.md +337 -0
- package/docs/ui/avatars/UIGuide_getAvatarPrompts.md +100 -0
- package/docs/ui/avatars/UIGuide_getAvatarsCustomized.md +90 -0
- package/docs/ui/avatars/UIGuide_getAvatarsList.md +105 -0
- package/docs/ui/avatars/UIGuide_setAvatar.md +118 -0
- package/docs/ui/bonuses/UIGuide_claimBonus.md +144 -0
- package/docs/ui/bonuses/UIGuide_getBonuses.md +176 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetActiveRound.md +99 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetActiveRounds.md +76 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetBoard.md +81 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetGameInfo.md +78 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetHistory.md +55 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetRoundInfoForUser.md +71 -0
- package/docs/ui/gamepick/UIGuide_gamePickGetUserInfo.md +64 -0
- package/docs/ui/gamepick/UIGuide_gamePickSubmitSelection.md +103 -0
- package/docs/ui/gamepick/UIGuide_gamePickSubmitSelectionQuiz.md +67 -0
- package/docs/ui/general/UIGuide_getCustomSections.md +137 -0
- package/docs/ui/general/UIGuide_getRelatedItemsForGame.md +140 -0
- package/docs/ui/inbox/UIGuide_deleteInboxMessage.md +135 -0
- package/docs/ui/inbox/UIGuide_getInboxMessageBody.md +133 -0
- package/docs/ui/inbox/UIGuide_getInboxMessages.md +186 -0
- package/docs/ui/inbox/UIGuide_markInboxMessageAsRead.md +122 -0
- package/docs/ui/inbox/UIGuide_markUnmarkInboxMessageAsFavorite.md +84 -0
- package/docs/ui/jackpots/UIGuide_getJackpotEligibleGames.md +73 -0
- package/docs/ui/jackpots/UIGuide_getJackpotWinners.md +83 -0
- package/docs/ui/jackpots/UIGuide_jackpotGet.md +138 -0
- package/docs/ui/jackpots/UIGuide_jackpotOptIn.md +85 -0
- package/docs/ui/jackpots/UIGuide_jackpotOptOut.md +65 -0
- package/docs/ui/leaderboard/UIGuide_getLeaderBoard.md +166 -0
- package/docs/ui/minigames/UIGuide_getMiniGames.md +153 -0
- package/docs/ui/minigames/UIGuide_getMiniGamesHistory.md +90 -0
- package/docs/ui/minigames/UIGuide_playMiniGame.md +150 -0
- package/docs/ui/minigames/UIGuide_playMiniGameBatch.md +128 -0
- package/docs/ui/raffles/UIGuide_claimRafflePrize.md +99 -0
- package/docs/ui/raffles/UIGuide_getRaffleDrawRun.md +117 -0
- package/docs/ui/raffles/UIGuide_getRaffleDrawRunsHistory.md +92 -0
- package/docs/ui/raffles/UIGuide_getRaffleWonPrizes.md +120 -0
- package/docs/ui/raffles/UIGuide_getRaffles.md +175 -0
- package/docs/ui/raffles/UIGuide_requestRaffleOptin.md +114 -0
- package/docs/ui/user/UIGuide_getActivityLog.md +130 -0
- package/docs/ui/user/UIGuide_getLevels.md +47 -42
- package/package.json +1 -1
- package/src/Base/ClassId.ts +2 -0
- package/src/Jackpots/JackpotDetails.ts +14 -15
- package/src/Jackpots/JackpotPot.ts +10 -6
- package/src/MiniGames/SAWGameType.ts +3 -0
- package/src/MiniGames/SAWTemplateUI.ts +10 -0
- package/src/Raffle/GetRaffleWonPrizesRequest.ts +12 -0
- package/src/Raffle/GetRaffleWonPrizesResponse.ts +56 -0
- package/src/Raffle/index.ts +3 -1
- package/src/SmarticoAPI.ts +14 -1
- package/src/SmarticoLib/index.ts +4 -0
- package/src/WSAPI/WSAPIAvatars.ts +267 -49
- package/src/WSAPI/WSAPIBonuses.ts +224 -10
- package/src/WSAPI/WSAPIGamePick.ts +538 -253
- package/src/WSAPI/WSAPIGeneral.ts +156 -14
- package/src/WSAPI/WSAPIInbox.ts +545 -56
- package/src/WSAPI/WSAPIJackpots.ts +297 -61
- package/src/WSAPI/WSAPILeaderBoard.ts +127 -13
- package/src/WSAPI/WSAPIMiniGames.ts +465 -49
- package/src/WSAPI/WSAPIRaffles.ts +592 -64
- package/src/WSAPI/WSAPITournaments.ts +3 -3
- package/src/WSAPI/WSAPITypes.ts +243 -132
- package/src/WSAPI/WSAPIUser.ts +193 -43
- package/tsconfig.json +9 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# UI Guide — `requestRaffleOptin`
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
- Action-focused mutation. The user is on a draw card / detail
|
|
5
|
+
page for a draw with `requires_optin === true`, and they click
|
|
6
|
+
"Opt in".
|
|
7
|
+
- Success (`err_code === 0`) means the user is registered for this
|
|
8
|
+
run. Tickets earned within the run's eligibility window will
|
|
9
|
+
participate in the draw.
|
|
10
|
+
- Opt-in is **per-run** — recurring draws require a fresh opt-in
|
|
11
|
+
for each new run.
|
|
12
|
+
|
|
13
|
+
## Argument mapping
|
|
14
|
+
|
|
15
|
+
The three IDs come from different fields on the embedded draw:
|
|
16
|
+
|
|
17
|
+
| Argument | Source |
|
|
18
|
+
|---|---|
|
|
19
|
+
| `raffle_id` | `TRaffle.id` (the parent raffle) |
|
|
20
|
+
| `draw_id` | `TRaffleDraw.id` (schedule_id, **stable** across recurring runs) |
|
|
21
|
+
| `raffle_run_id` | `TRaffleDraw.run_id` (per-execution instance ID) |
|
|
22
|
+
|
|
23
|
+
Don't confuse `draw.id` with `draw.run_id` — both are needed.
|
|
24
|
+
|
|
25
|
+
## Loading state
|
|
26
|
+
|
|
27
|
+
- **Trigger**: set an in-flight flag (`optingIn = true`)
|
|
28
|
+
immediately on click.
|
|
29
|
+
- **Visual**: replace the button label with animated dots; disable
|
|
30
|
+
the button.
|
|
31
|
+
- **Reset**: clear the flag on response.
|
|
32
|
+
|
|
33
|
+
## Idempotency UI guard
|
|
34
|
+
|
|
35
|
+
The SDK does NOT prevent double-clicks. A second call on the same
|
|
36
|
+
`raffle_run_id` returns `err_code === 1` with `err_message`
|
|
37
|
+
indicating the user is already opted in. Guard the call site:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
const [optingIn, setOptingIn] = useState(false);
|
|
41
|
+
|
|
42
|
+
const onOptIn = async (draw: TRaffleDraw) => {
|
|
43
|
+
if (optingIn) return; // in-flight guard
|
|
44
|
+
if (draw.user_opted_in) return; // already opted in
|
|
45
|
+
setOptingIn(true);
|
|
46
|
+
const r = await window._smartico.api.requestRaffleOptin({
|
|
47
|
+
raffle_id: raffleId,
|
|
48
|
+
draw_id: draw.id, // schedule_id, NOT run_id
|
|
49
|
+
raffle_run_id: draw.run_id,
|
|
50
|
+
});
|
|
51
|
+
setOptingIn(false);
|
|
52
|
+
handleResponse(r);
|
|
53
|
+
};
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Treat `err_code === 1` with an "already opted in" message as
|
|
57
|
+
**idempotent success** in the UI.
|
|
58
|
+
|
|
59
|
+
## Action button decision matrix
|
|
60
|
+
|
|
61
|
+
CTA label per state on the draw card (evaluate in priority order):
|
|
62
|
+
|
|
63
|
+
| Condition | CTA |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `current_state === Executed` (3) | No opt-in CTA (draw is finished) |
|
|
66
|
+
| `current_state === WinnerSelection` (2) | No opt-in CTA (drawing in progress) |
|
|
67
|
+
| `!requires_optin` | No opt-in CTA (tickets participate automatically) |
|
|
68
|
+
| `requires_optin && user_opted_in` | Disabled "Fully opted in" pill (informational) |
|
|
69
|
+
| `requires_optin && !user_opted_in && is_active && current_state !== Executed` | Enabled "Opt in" button |
|
|
70
|
+
| `requires_optin && !is_active` | No opt-in CTA (draw is inactive) |
|
|
71
|
+
|
|
72
|
+
After opt-in success, `user_opted_in` flips to `true` on the next
|
|
73
|
+
`getRaffles` refresh (which fires automatically via `onUpdate`).
|
|
74
|
+
|
|
75
|
+
## Per-error-code handling
|
|
76
|
+
|
|
77
|
+
| `err_code` | Action |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `0` (success) | Show "Fully opted in" pill; success toast optional |
|
|
80
|
+
| `1` + "already opted in" | Treat as success — same UI as above |
|
|
81
|
+
| `1` + "no need to opt-in" | Hide the opt-in CTA — the draw doesn't actually require it |
|
|
82
|
+
| `1` + "raffle id does not match" | Show a generic error toast; this is a programming bug — verify the IDs being passed |
|
|
83
|
+
| `1` + control-group message | Show a gating message ("Not eligible") |
|
|
84
|
+
| Other non-zero | Generic error toast with `err_message`. Allow retry. |
|
|
85
|
+
|
|
86
|
+
## Refresh after response
|
|
87
|
+
|
|
88
|
+
The SDK auto-refreshes the raffles cache on every opt-in response
|
|
89
|
+
(success OR failure). The `onUpdate` callback registered via
|
|
90
|
+
[`getRaffles`](../../api/classes/WSAPIRaffles.md#getraffles) fires
|
|
91
|
+
with the refreshed list — `user_opted_in` reflects the new state.
|
|
92
|
+
**Don't manually call `getRaffles()` after the opt-in response.**
|
|
93
|
+
|
|
94
|
+
## Animations / transitions
|
|
95
|
+
|
|
96
|
+
- **Loading dots**: 3-dot animation on the button while in flight.
|
|
97
|
+
- **Success state flip**: button transitions from "Opt in" to
|
|
98
|
+
"Fully opted in" (~150 ms ease-out). The default Smartico UI
|
|
99
|
+
uses a 500 ms delay before re-fetching, then the state flip is
|
|
100
|
+
observed on the refreshed list.
|
|
101
|
+
- **No celebration animation** — opt-in is a quiet success.
|
|
102
|
+
|
|
103
|
+
## Mobile vs desktop
|
|
104
|
+
|
|
105
|
+
- **Loading state**: identical (dots).
|
|
106
|
+
- **CTA placement**: desktop usually inline on the draw row; mobile
|
|
107
|
+
may use a sticky CTA at the bottom of the draw detail.
|
|
108
|
+
|
|
109
|
+
## Performance
|
|
110
|
+
|
|
111
|
+
- Single round-trip per click.
|
|
112
|
+
- The `getRaffles` auto-refresh after the response is a separate
|
|
113
|
+
network call (the cache is invalidated). For UIs that already
|
|
114
|
+
have fresh state, this is redundant but harmless.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# UI Guide — `getActivityLog`
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
- Returns the user's unified balance-change history — every points / gems /
|
|
5
|
+
diamonds transaction in the requested window, newest-first.
|
|
6
|
+
- Power an "Activity" / "History" tab showing wins, claims, purchases,
|
|
7
|
+
level-up rewards, and operator adjustments.
|
|
8
|
+
- 30 s SDK cache + push refresh on every wallet change (with a caveat —
|
|
9
|
+
see below).
|
|
10
|
+
|
|
11
|
+
## List view organization
|
|
12
|
+
|
|
13
|
+
Single flat list, server-sorted newest-first by `create_date`. The default
|
|
14
|
+
Smartico UI groups rows visually by calendar day (e.g. "Today", "Yesterday",
|
|
15
|
+
"24 May").
|
|
16
|
+
|
|
17
|
+
### Time-period filter chips
|
|
18
|
+
|
|
19
|
+
The default Smartico UI exposes these filters on top:
|
|
20
|
+
|
|
21
|
+
| Chip | `startTimeSeconds` | `endTimeSeconds` |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| Today | today 00:00 local | now + 60 s |
|
|
24
|
+
| This week | Monday 00:00 local | now + 60 s |
|
|
25
|
+
| Previous week | Prev Monday 00:00 | Prev Sunday 23:59:59 |
|
|
26
|
+
| Last 24 h (default) | now − 86400 | now + 60 s |
|
|
27
|
+
|
|
28
|
+
Custom UIs can pick any window; the server scans the full range.
|
|
29
|
+
|
|
30
|
+
## Item card / row
|
|
31
|
+
|
|
32
|
+
Fields rendered per row:
|
|
33
|
+
|
|
34
|
+
| Field | Source | Notes |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| Currency icon | `type` (`UserBalanceType`) | points / gems / diamonds icon |
|
|
37
|
+
| Amount | `amount` | Prepend `+` if positive; color green when `>= 0`, red when negative |
|
|
38
|
+
| Balance after | `balance` | Right-aligned column |
|
|
39
|
+
| Source label | `source_type_id` (`PointChangeSourceType`) | See mapping table below |
|
|
40
|
+
| Timestamp | `create_date` (epoch s × 1000) | Relative ("2h ago") or HH:MM |
|
|
41
|
+
|
|
42
|
+
## Source label mapping
|
|
43
|
+
|
|
44
|
+
For consistency with the default Smartico UI, group source IDs into these
|
|
45
|
+
display buckets:
|
|
46
|
+
|
|
47
|
+
| `PointChangeSourceType` | Display label |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `Journey` (1), `ManualAdjustment` (6), `AutomationRule` (12), `API` (18) | "Marketing" |
|
|
50
|
+
| `AchievementTaskCompletion` (2) | "Mission Task" |
|
|
51
|
+
| `AchievementCompletion` (3) | "Mission" |
|
|
52
|
+
| `LevelsStructureChange` (4) | "Level" |
|
|
53
|
+
| `StorePurchase` (5) | "Store" |
|
|
54
|
+
| `Leaderboard` (7) | "Leaderboard" |
|
|
55
|
+
| `Tournament` (11), `TournamentRegistration` (13), `TournamentRegistrationCancellation` (14) | "Tournament" |
|
|
56
|
+
| `RefundPoints` (15) | "Refund" |
|
|
57
|
+
| `PlayMiniGame` (16), `WinMiniGame` (17) | "Mini-Game" |
|
|
58
|
+
| `DynamicFormula` (19) | "Formula" |
|
|
59
|
+
| `Raffle` (21) | "Raffle" |
|
|
60
|
+
| `Avatars` (22) | "Avatar" |
|
|
61
|
+
| *(any unknown)* | "Other" |
|
|
62
|
+
|
|
63
|
+
## Pagination
|
|
64
|
+
|
|
65
|
+
`from` and `to` are offset + ceiling, NOT timestamps:
|
|
66
|
+
|
|
67
|
+
- `offset = from`
|
|
68
|
+
- `limit = min(to - from, 50)` — server hard-caps at 50 rows per request.
|
|
69
|
+
|
|
70
|
+
For infinite scroll, advance `from` by 50 each page. Detect end of list when
|
|
71
|
+
the returned array length is less than the requested page size.
|
|
72
|
+
|
|
73
|
+
## Subscription model — `onUpdate` caveat
|
|
74
|
+
|
|
75
|
+
The `onUpdate` callback fires whenever the user's points / gems / diamonds
|
|
76
|
+
balance changes. **The pushed payload is a FIXED re-fetch** of:
|
|
77
|
+
|
|
78
|
+
- `startTimeSeconds = now - 600` (last 10 minutes)
|
|
79
|
+
- `endTimeSeconds = now`
|
|
80
|
+
- `from = 0`, `to = 50`
|
|
81
|
+
|
|
82
|
+
It does NOT use the original call's parameters. Consumers maintaining a long
|
|
83
|
+
historical view (e.g. 30 days) should treat `onUpdate` as a "new transactions
|
|
84
|
+
arrived" hint and re-call `getActivityLog` with their own params:
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
const log = await window._smartico.api.getActivityLog({
|
|
88
|
+
startTimeSeconds: thirtyDaysAgo,
|
|
89
|
+
endTimeSeconds: now,
|
|
90
|
+
from: 0, to: 50,
|
|
91
|
+
onUpdate: async (refreshed) => {
|
|
92
|
+
console.log('[smartico] wallet changed — refreshed last-10-min payload arrived');
|
|
93
|
+
// To keep the 30-day view current, re-fetch with the original params:
|
|
94
|
+
const fresh = await window._smartico.api.getActivityLog({
|
|
95
|
+
startTimeSeconds: thirtyDaysAgo,
|
|
96
|
+
endTimeSeconds: Math.floor(Date.now() / 1000),
|
|
97
|
+
from: 0, to: 50,
|
|
98
|
+
});
|
|
99
|
+
console.log('[smartico] re-rendered full 30-day list with', fresh.length, 'rows');
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Empty / loading / error states
|
|
105
|
+
|
|
106
|
+
- **Empty**: "No activity in this period" — common for new users or
|
|
107
|
+
narrow time windows.
|
|
108
|
+
- **Loading (cold fetch)**: skeleton list (5 placeholder rows).
|
|
109
|
+
- **Error**: keep prior list if any; non-blocking banner.
|
|
110
|
+
|
|
111
|
+
## Refresh
|
|
112
|
+
|
|
113
|
+
- 30 s SDK cache absorbs rapid tab switches.
|
|
114
|
+
- Push triggers fire on every wallet change; the SDK handles invalidation
|
|
115
|
+
internally.
|
|
116
|
+
- For the user's CURRENT balance (not the activity log), read
|
|
117
|
+
[`getUserProfile`](../../api/classes/WSAPIUser.md#getuserprofile) — the
|
|
118
|
+
activity log is for historical detail, not for the current balance widget.
|
|
119
|
+
|
|
120
|
+
## Mobile vs desktop
|
|
121
|
+
|
|
122
|
+
- **Desktop**: row shows activity icon · source label · amount · balance · time.
|
|
123
|
+
- **Mobile**: row stacks activity + source label on the left, amount + balance
|
|
124
|
+
on the right.
|
|
125
|
+
|
|
126
|
+
## Performance
|
|
127
|
+
|
|
128
|
+
- 30 s cache + push invalidation makes repeated tab opens cheap.
|
|
129
|
+
- 50-row page limit — paginate via `from` for full history.
|
|
130
|
+
- Don't poll — the `onUpdate` callback handles change detection.
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# UI Guide — `getLevels`
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
|
+
|
|
4
5
|
- Returns the full level ladder for the label — one `TLevel` per
|
|
5
|
-
|
|
6
|
+
active level, server-sorted by `required_points` ASC.
|
|
6
7
|
- Use as a lookup table to resolve `ach_level_current_id` from
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
`[getUserProfile](../../api/classes/WSAPIUser.md#getuserprofile)`
|
|
9
|
+
into a richer level object, or as the source for a level map UI.
|
|
9
10
|
- Loading indicator: skip on cache hit (30 s); show a brief shimmer
|
|
10
|
-
|
|
11
|
+
on cold fetch (typically 100–300 ms).
|
|
11
12
|
|
|
12
13
|
## List view organization
|
|
13
14
|
|
|
@@ -41,23 +42,25 @@ of filtering them out.
|
|
|
41
42
|
|
|
42
43
|
Fields rendered per tile:
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
45
|
+
|
|
46
|
+
| Field | Use |
|
|
47
|
+
| ------------------ | ---------------------------------------------------------------------------------------------------- |
|
|
48
|
+
| `image` | Tile icon (square, 256×256 px source). |
|
|
49
|
+
| `name` | Tile heading. |
|
|
50
|
+
| `description` | Optional sub-text under the heading; the default UI shows this in the detail modal, not on the tile. |
|
|
51
|
+
| `required_points` | Threshold display: `"{N} pts to reach"` or progress bar. |
|
|
52
|
+
| `ordinal_position` | Tile order; matches array order. |
|
|
53
|
+
|
|
51
54
|
|
|
52
55
|
**Locked vs unlocked treatment** — apply a `disabled` class to tiles
|
|
53
56
|
where the user hasn't met the threshold:
|
|
54
57
|
|
|
55
58
|
- Points-only leveling (most labels): `disabled = ach_points_ever < required_points`
|
|
56
59
|
- Sliding-window leveling: also check
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
`level_counter_1 < required_level_counter_1` (and `_2`) from
|
|
61
|
+
`[getUserLevelExtraCounters](../../api/classes/WSAPIUser.md#getuserlevelextracounters)`.
|
|
59
62
|
- Manual-only leveling: `disabled` unless the level matches the
|
|
60
|
-
|
|
63
|
+
user's current `ach_level_current_id`.
|
|
61
64
|
|
|
62
65
|
The default Smartico UI uses CSS-only treatment for locked tiles —
|
|
63
66
|
no padlock icon, no greyscale by default. Brands can add those via
|
|
@@ -70,8 +73,8 @@ When the user taps a tile, open a modal showing:
|
|
|
70
73
|
- Hero image (`image`)
|
|
71
74
|
- Title (`name`), description (`description`)
|
|
72
75
|
- Progress block: for the user's current level, three stacked
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
progress bars (points / counter 1 / counter 2) — see "Sliding-window
|
|
77
|
+
leveling" below. For other levels, just the requirement display.
|
|
75
78
|
- Custom fields rendered from `custom_data` (operator-defined).
|
|
76
79
|
|
|
77
80
|
`custom_data` is typed as `string` but at runtime is `any` — the SDK
|
|
@@ -95,7 +98,7 @@ The operator names the counters via translation keys
|
|
|
95
98
|
(`levelsCounter1Name`, `levelsCounter2Name`) — typical values are
|
|
96
99
|
"Total Deposits", "Total Wagering", etc. The SDK does not expose the
|
|
97
100
|
operator's chosen labels; resolve them via
|
|
98
|
-
[
|
|
101
|
+
`[getTranslations](../../api/classes/WSAPIGeneral.md#gettranslations)`.
|
|
99
102
|
|
|
100
103
|
On points-only labels, both `required_level_counter_*` fields are
|
|
101
104
|
`null` — skip rendering the counter rows.
|
|
@@ -105,58 +108,60 @@ On points-only labels, both `required_level_counter_*` fields are
|
|
|
105
108
|
Two formulas are in use; pick whichever fits your design:
|
|
106
109
|
|
|
107
110
|
- **From-zero (default Smartico UI uses this)**:
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
`ach_points_ever / next_level.required_points × 100`. Shows
|
|
112
|
+
"absolute" progress; never decreases as the user gains points.
|
|
110
113
|
- **From-current-level-floor (SDK uses this in
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
up; better for "how far through this level" UX.
|
|
114
|
+
`[getCurrentLevel](../../api/classes/WSAPIUser.md#getcurrentlevel)`)**:
|
|
115
|
+
`(ach_points_ever − current.required_points) / (next.required_points − current.required_points) × 100`. Resets to 0 when the user levels
|
|
116
|
+
up; better for "how far through this level" UX.
|
|
115
117
|
|
|
116
118
|
Both bound at 100; at the max level the bar shows full.
|
|
117
119
|
|
|
118
120
|
## Image / asset specs
|
|
119
121
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
|
|
123
|
+
| Field | Aspect | Notes |
|
|
124
|
+
| ------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
|
|
122
125
|
| `image` | 1:1 (square), 256×256 px documented source | Render in a square tile container; fallback: text-only tile with the level name if `image` is missing. |
|
|
123
126
|
|
|
127
|
+
|
|
124
128
|
## Empty / loading / error states
|
|
125
129
|
|
|
126
130
|
- **Loading (cold fetch)**: render a skeleton grid (3–6 placeholder
|
|
127
|
-
|
|
131
|
+
tiles) sized to the eventual layout.
|
|
128
132
|
- **Loading (cache hit)**: do not render a loading state — the
|
|
129
|
-
|
|
133
|
+
promise resolves within a microtask.
|
|
130
134
|
- **Empty result**: `[]` means no levels are configured for the
|
|
131
|
-
|
|
132
|
-
|
|
135
|
+
label. Hide the level UI entirely (or render a neutral
|
|
136
|
+
"no levels configured" placeholder).
|
|
133
137
|
- **Error**: keep the prior list visible if any; show a small
|
|
134
|
-
|
|
138
|
+
non-blocking error banner; retry on next user-driven action.
|
|
135
139
|
|
|
136
140
|
## Animations / transitions
|
|
137
141
|
|
|
138
142
|
- **Tile entry**: stagger fade-in (~30 ms per tile) on first render.
|
|
139
143
|
- **Level-up celebration**: when `ach_level_current_id` flips on a
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
+
push (detect via `[getUserProfile](../../api/classes/WSAPIUser.md#getuserprofile)`'s
|
|
145
|
+
`props_change`), animate the newly-reached tile (scale-up,
|
|
146
|
+
shine sweep). The default Smartico UI does this on the header
|
|
147
|
+
badge, not on the level-map tiles.
|
|
144
148
|
|
|
145
149
|
## Mobile vs desktop
|
|
146
150
|
|
|
147
151
|
- **Grid columns**: desktop responsive (3–5 columns depending on
|
|
148
|
-
|
|
152
|
+
viewport); mobile 2 columns.
|
|
149
153
|
- **Detail view**: desktop opens as a centered modal with backdrop
|
|
150
|
-
|
|
154
|
+
dim; mobile opens as a full-screen sheet.
|
|
151
155
|
- **Counter rows in detail**: identical on both — three stacked
|
|
152
|
-
|
|
156
|
+
progress bars on Logic 2 labels.
|
|
153
157
|
|
|
154
158
|
## Performance
|
|
155
159
|
|
|
156
160
|
- The 30 s cache deduplicates rapid refetches; a poll loop hitting
|
|
157
|
-
|
|
158
|
-
|
|
161
|
+
`getLevels()` every 5 s effectively translates to one network
|
|
162
|
+
round-trip per 30 s.
|
|
159
163
|
- `getLevels` is suitable to call once at app boot and cache the
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
164
|
+
array in your own state (re-fetch only when the user's level
|
|
165
|
+
changes per `props_change`, since the operator-driven ladder
|
|
166
|
+
rarely changes mid-session).
|
|
167
|
+
|
package/package.json
CHANGED
package/src/Base/ClassId.ts
CHANGED
|
@@ -185,6 +185,8 @@ export enum ClassId {
|
|
|
185
185
|
RAF_CLAIM_PRIZE_RESPONSE = 909,
|
|
186
186
|
RAF_OPTIN_REQUEST = 916,
|
|
187
187
|
RAF_OPTIN_RESPONSE = 917,
|
|
188
|
+
RAF_GET_WON_PRIZES_REQUEST = 920,
|
|
189
|
+
RAF_GET_WON_PRIZES_RESPONSE = 921,
|
|
188
190
|
/*
|
|
189
191
|
RAF_GET_TICKETS_REQUEST = 902,
|
|
190
192
|
RAF_GET_TICKETS_RESPONSE = 903,
|
|
@@ -4,34 +4,33 @@ import { JackpotPublicMeta } from './JackpotPublicMeta';
|
|
|
4
4
|
import { JackpotType } from './JackpotType';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Flag is_opted_in indicates if the current user is opted in to the jackpot
|
|
7
|
+
* One jackpot template the user is eligible for, with its live pot snapshot.
|
|
8
|
+
* Returned by `jackpotGet()`.
|
|
10
9
|
*/
|
|
11
10
|
interface JackpotDetails {
|
|
12
|
-
/** ID of the
|
|
11
|
+
/** Stable numeric ID of the template; pass to opt-in / opt-out / winners / eligible-games methods. */
|
|
13
12
|
jp_template_id: number;
|
|
14
|
-
/**
|
|
13
|
+
/** Whether the jackpot has a shared pot or one independent per user; see {@link JackpotType}. */
|
|
15
14
|
jp_type_id: JackpotType;
|
|
16
|
-
/**
|
|
15
|
+
/** Display data: name, description, image_url, winner / not-winner HTML templates, custom_data (JSON-parsed). */
|
|
17
16
|
jp_public_meta: JackpotPublicMeta;
|
|
18
|
-
/**
|
|
17
|
+
/** Native jackpot currency (ISO 4217). Used for winner-history amounts. */
|
|
19
18
|
jp_currency: string;
|
|
20
|
-
/**
|
|
19
|
+
/** Current user's wallet currency. Used to display the pot via `pot.current_pot_amount_user_currency`. */
|
|
21
20
|
user_currency: string;
|
|
22
|
-
/**
|
|
21
|
+
/** Whether the contribution is a fixed amount or a percentage of the bet; see {@link JackpotContributionType}. */
|
|
23
22
|
contribution_type: JackpotContributionType;
|
|
24
|
-
/**
|
|
23
|
+
/** Amount of contribution per qualifying bet — fixed value or percentage depending on `contribution_type`. */
|
|
25
24
|
contribution_value: number;
|
|
26
|
-
/**
|
|
25
|
+
/** Live pot snapshot (amount, temperature, last explosion timestamp). */
|
|
27
26
|
pot: JackpotPot;
|
|
28
|
-
/**
|
|
27
|
+
/** `true` when the current user is currently opted in. */
|
|
29
28
|
is_opted_in: boolean;
|
|
30
|
-
/**
|
|
29
|
+
/** `true` when every game in the operator catalog contributes; if `true`, skip `getJackpotEligibleGames`. */
|
|
31
30
|
ach_related_game_allow_all: boolean;
|
|
32
|
-
/**
|
|
31
|
+
/** Number of users currently opted in; always `1` for `JackpotType.Personal`. */
|
|
33
32
|
registration_count: number;
|
|
34
|
-
/**
|
|
33
|
+
/** Operator flag: whether the winners list should be displayed. Enforced client-side only — gate `getJackpotWinners` calls on this. */
|
|
35
34
|
expose_winners_over_api: boolean;
|
|
36
35
|
}
|
|
37
36
|
|
|
@@ -9,18 +9,22 @@ enum JackPotTemparature {
|
|
|
9
9
|
BURNING = 3,
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Live snapshot of one jackpot pot's value and temperature.
|
|
14
|
+
* Embedded on `JackpotDetails.pot`; refreshed at the 1 s SDK cache TTL.
|
|
15
|
+
*/
|
|
12
16
|
interface JackpotPot {
|
|
13
|
-
/** ID
|
|
17
|
+
/** Template ID this pot belongs to. */
|
|
14
18
|
jp_template_id: number;
|
|
15
|
-
/** ID of the
|
|
19
|
+
/** Stable numeric ID of the current pot instance (rotates when the pot explodes). */
|
|
16
20
|
jp_pot_id: number;
|
|
17
|
-
/**
|
|
21
|
+
/** Current pot amount in the jackpot's native currency (`jp_currency`). */
|
|
18
22
|
current_pot_amount: number;
|
|
19
|
-
/**
|
|
23
|
+
/** Current pot amount converted to the user's wallet currency (`user_currency`). */
|
|
20
24
|
current_pot_amount_user_currency: number;
|
|
21
|
-
/**
|
|
25
|
+
/** Unix ms timestamp of when this pot last exploded; `0` if it has never exploded. */
|
|
22
26
|
explode_date_ts: number;
|
|
23
|
-
/**
|
|
27
|
+
/** Heat band of the pot relative to its explosion range; see {@link JackPotTemparature}. */
|
|
24
28
|
current_pot_temperature: JackPotTemparature;
|
|
25
29
|
}
|
|
26
30
|
|
|
@@ -11,6 +11,7 @@ export enum SAWGameType {
|
|
|
11
11
|
Voyager = 10,
|
|
12
12
|
Plinko = 11,
|
|
13
13
|
CoinFlip = 12,
|
|
14
|
+
CustomMinigame = 13,
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export enum SAWGameTypeName {
|
|
@@ -26,6 +27,7 @@ export enum SAWGameTypeName {
|
|
|
26
27
|
Voyager = 'voyager',
|
|
27
28
|
Plinko = 'plinko',
|
|
28
29
|
CoinFlip = 'coin_flip',
|
|
30
|
+
CustomMinigame = 'custom_minigame',
|
|
29
31
|
Unknown = 'unknown',
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -45,6 +47,7 @@ export const SAWGameTypeNamed = (type: SAWGameType): SAWGameTypeName => {
|
|
|
45
47
|
[SAWGameType.Voyager]: SAWGameTypeName.Voyager,
|
|
46
48
|
[SAWGameType.Plinko]: SAWGameTypeName.Plinko,
|
|
47
49
|
[SAWGameType.CoinFlip]: SAWGameTypeName.CoinFlip,
|
|
50
|
+
[SAWGameType.CustomMinigame]: SAWGameTypeName.CustomMinigame,
|
|
48
51
|
}[type] || SAWGameTypeName.Unknown
|
|
49
52
|
);
|
|
50
53
|
};
|
|
@@ -455,6 +455,16 @@ export interface SAWTemplateUI {
|
|
|
455
455
|
*/
|
|
456
456
|
game_difficulty?: SAWGameDifficultyType;
|
|
457
457
|
|
|
458
|
+
// ─── Custom Minigame specific ─────────────────────────────────────────────
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* URL of the operator-hosted custom mini-game, loaded inside an iframe by
|
|
462
|
+
* the widget for `SAWGameType.CustomMinigame`. The operator is trusted, so
|
|
463
|
+
* the iframe is rendered without a sandbox.
|
|
464
|
+
* Back-Office label: _"Game URL"_.
|
|
465
|
+
*/
|
|
466
|
+
custom_game_url?: string;
|
|
467
|
+
|
|
458
468
|
/**
|
|
459
469
|
* Minutes for the Voyager seed window.
|
|
460
470
|
* The seed window is the range of seeds that can be used to generate the map.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProtocolMessage } from "../Base/ProtocolMessage";
|
|
2
|
+
|
|
3
|
+
export interface GetRaffleWonPrizesRequest extends ProtocolMessage {
|
|
4
|
+
/** ID of the raffle to fetch the current user's won prizes for. */
|
|
5
|
+
raffle_id: number;
|
|
6
|
+
|
|
7
|
+
/** Zero-based index of the first won-prize row to return (pagination). */
|
|
8
|
+
offset: number;
|
|
9
|
+
|
|
10
|
+
/** Maximum number of won-prize rows to return (pagination). */
|
|
11
|
+
limit: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ProtocolResponse } from '../Base/ProtocolResponse';
|
|
2
|
+
|
|
3
|
+
/** Presentation meta for a won prize. */
|
|
4
|
+
export interface RaffleWonPrizePublicMeta {
|
|
5
|
+
/** Name of the prize, e.g. '1 $'. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Indicates whether the chance to win should be hidden in the UI. */
|
|
8
|
+
hide_chance_to_win: boolean;
|
|
9
|
+
/** URL of the image that represents the prize. */
|
|
10
|
+
image_url: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** A single prize the user won within the raffle. */
|
|
14
|
+
export interface RaffleWonPrize {
|
|
15
|
+
/** Unique ID of the winning row (pass to `claimRafflePrize` when `requires_claim` is `true`). */
|
|
16
|
+
raf_won_id: number;
|
|
17
|
+
/** ID of the prize definition. */
|
|
18
|
+
prize_id: number;
|
|
19
|
+
/** Run-instance ID of the draw that awarded this prize. */
|
|
20
|
+
raffle_run_id: number;
|
|
21
|
+
/** Schedule ID of the draw that awarded this prize. */
|
|
22
|
+
draw_id: number;
|
|
23
|
+
/** Presentation meta (name / image). */
|
|
24
|
+
public_meta: RaffleWonPrizePublicMeta;
|
|
25
|
+
/** Whether this prize requires a claim action from the user. */
|
|
26
|
+
requires_claim: boolean;
|
|
27
|
+
/** Epoch ms when the prize was claimed; `null` when not yet claimed. */
|
|
28
|
+
claimed_date: number | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The user the won-prizes list belongs to. */
|
|
32
|
+
export interface RaffleWonPrizeUser {
|
|
33
|
+
/** Internal user ID. */
|
|
34
|
+
user_id: number;
|
|
35
|
+
/** Avatar image: a full URL for a system avatar, otherwise an avatar token to resolve against the widget's avatar domain. */
|
|
36
|
+
avatar_id: string;
|
|
37
|
+
/** Numeric ID of the user's selected avatar definition. */
|
|
38
|
+
avatar_real_id: number;
|
|
39
|
+
/** Public username; server-masked for other users (e.g. `"32:r*****"`). */
|
|
40
|
+
public_username?: string;
|
|
41
|
+
/** Always `null` on the wire — use `avatar_id`. */
|
|
42
|
+
avatar_url?: string | null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface GetRaffleWonPrizesResponse extends ProtocolResponse {
|
|
46
|
+
/** The user the won prizes belong to; `null` when `won_prizes` is empty. */
|
|
47
|
+
user: RaffleWonPrizeUser | null;
|
|
48
|
+
/** Page of won prizes for the requested raffle, newest-first. */
|
|
49
|
+
won_prizes: RaffleWonPrize[];
|
|
50
|
+
/** Total number of won prizes for this user/raffle across all draws (for pagination). */
|
|
51
|
+
total: number;
|
|
52
|
+
/** Zero-based offset of this page (echoes the resolved request). */
|
|
53
|
+
offset: number;
|
|
54
|
+
/** Page size (echoes the resolved request). */
|
|
55
|
+
limit: number;
|
|
56
|
+
}
|
package/src/Raffle/index.ts
CHANGED
|
@@ -14,4 +14,6 @@ export * from './RaffleClaimPrizeRequest';
|
|
|
14
14
|
export * from './RaffleClaimPrizeResponse';
|
|
15
15
|
export * from './RaffleDrawPublicMeta';
|
|
16
16
|
export * from './RaffleOptinRequest';
|
|
17
|
-
export * from './RaffleOptinResponse';
|
|
17
|
+
export * from './RaffleOptinResponse';
|
|
18
|
+
export * from './GetRaffleWonPrizesRequest';
|
|
19
|
+
export * from './GetRaffleWonPrizesResponse';
|
package/src/SmarticoAPI.ts
CHANGED
|
@@ -139,7 +139,7 @@ import { GetRafflesRequest } from './Raffle/GetRafflesRequest';
|
|
|
139
139
|
import { GetActivityLogRequest, GetActivityLogResponse, ActivityLogTransform } from './ActivityLog';
|
|
140
140
|
import { GetClanListRequest, GetClanListResponse, GetClanInfoRequest, GetClanInfoResponse, JoinClanRequest, JoinClanResponse } from './Clans';
|
|
141
141
|
import { InboxCategories } from './Inbox/InboxCategories';
|
|
142
|
-
import { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse, RaffleClaimPrizeRequest, RaffleClaimPrizeResponse, RaffleOptinRequest, RaffleOptinResponse, drawRunTransform } from './Raffle';
|
|
142
|
+
import { GetDrawRunRequest, GetDrawRunResponse, GetRaffleDrawRunsHistoryRequest, GetRaffleDrawRunsHistoryResponse, RaffleClaimPrizeRequest, RaffleClaimPrizeResponse, RaffleOptinRequest, RaffleOptinResponse, drawRunTransform, GetRaffleWonPrizesRequest, GetRaffleWonPrizesResponse } from './Raffle';
|
|
143
143
|
import { GetAvatarsListResponse, avatarDefinitionTransform } from './Avatars/GetAvatarsListResponse';
|
|
144
144
|
import { GetAvatarsCustomizedResponse, avatarCustomizedTransform } from './Avatars/GetAvatarsCustomizedResponse';
|
|
145
145
|
import { GetAvatarPromptsResponse, avatarPromptTransform } from './Avatars/GetAvatarPromptsResponse';
|
|
@@ -1641,6 +1641,19 @@ class SmarticoAPI {
|
|
|
1641
1641
|
|
|
1642
1642
|
}
|
|
1643
1643
|
|
|
1644
|
+
public async getRaffleWonPrizes(
|
|
1645
|
+
user_ext_id: string,
|
|
1646
|
+
props: { raffle_id: number; offset: number; limit: number },
|
|
1647
|
+
): Promise<GetRaffleWonPrizesResponse> {
|
|
1648
|
+
const message = this.buildMessage<GetRaffleWonPrizesRequest, GetRaffleWonPrizesResponse>(
|
|
1649
|
+
user_ext_id,
|
|
1650
|
+
ClassId.RAF_GET_WON_PRIZES_REQUEST,
|
|
1651
|
+
props,
|
|
1652
|
+
);
|
|
1653
|
+
|
|
1654
|
+
return await this.send<GetRaffleWonPrizesResponse>(message, ClassId.RAF_GET_WON_PRIZES_RESPONSE);
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1644
1657
|
public async getActivityLog(
|
|
1645
1658
|
user_ext_id: string,
|
|
1646
1659
|
startTimeSeconds: number,
|