@smartico/public-api 0.0.379 → 0.0.381
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/.nvmrc +1 -1
- package/CLAUDE.md +103 -0
- package/README.md +53 -2
- 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/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/Store/BuyStoreItemErrorCode.d.ts +9 -1
- package/dist/Tournaments/TournamentRegistrationError.d.ts +3 -1
- package/dist/WSAPI/WSAPI.d.ts +13 -1235
- package/dist/WSAPI/WSAPIAvatars.d.ts +296 -0
- package/dist/WSAPI/WSAPIBase.d.ts +71 -0
- package/dist/WSAPI/WSAPIBonuses.d.ts +240 -0
- package/dist/WSAPI/WSAPIClans.d.ts +388 -0
- package/dist/WSAPI/WSAPIGamePick.d.ts +593 -0
- package/dist/WSAPI/WSAPIGeneral.d.ts +172 -0
- package/dist/WSAPI/WSAPIInbox.d.ts +615 -0
- package/dist/WSAPI/WSAPIJackpots.d.ts +344 -0
- package/dist/WSAPI/WSAPILeaderBoard.d.ts +139 -0
- package/dist/WSAPI/WSAPIMiniGames.d.ts +510 -0
- package/dist/WSAPI/WSAPIMissions.d.ts +517 -0
- package/dist/WSAPI/WSAPIRaffles.d.ts +643 -0
- package/dist/WSAPI/WSAPIStore.d.ts +656 -0
- package/dist/WSAPI/WSAPITournaments.d.ts +501 -0
- package/dist/WSAPI/WSAPITypes.d.ts +376 -205
- package/dist/WSAPI/WSAPIUser.d.ts +533 -0
- package/dist/index.js +6745 -1661
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +6324 -1342
- 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 +82 -2
- package/docs/api/classes/WSAPIAvatars.md +344 -0
- package/docs/api/classes/WSAPIBonuses.md +271 -0
- package/docs/api/classes/WSAPIClans.md +436 -0
- package/docs/api/classes/WSAPIGamePick.md +710 -0
- package/docs/api/classes/WSAPIGeneral.md +212 -0
- package/docs/api/classes/WSAPIInbox.md +801 -0
- package/docs/api/classes/WSAPIJackpots.md +439 -0
- package/docs/api/classes/WSAPILeaderBoard.md +157 -0
- package/docs/api/classes/WSAPIMiniGames.md +612 -0
- package/docs/api/classes/WSAPIMissions.md +590 -0
- package/docs/api/classes/WSAPIRaffles.md +773 -0
- package/docs/api/classes/WSAPIStore.md +719 -0
- package/docs/api/classes/WSAPITournaments.md +571 -0
- package/docs/api/classes/WSAPIUser.md +637 -0
- 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/AchievementClaimPeriodTypeId.md +13 -0
- package/docs/api/enumerations/BonusStatus-1.md +11 -6
- package/docs/api/enumerations/BuyStoreItemErrorCode.md +32 -0
- 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/ClanPrizePublicMeta.md +41 -0
- package/docs/api/interfaces/ClanPrizeStructureEntry.md +7 -1
- package/docs/api/interfaces/ClanPublicMeta.md +4 -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/SAWTemplateUI.md +10 -0
- package/docs/api/interfaces/TAchCategory.md +14 -4
- 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 -11
- 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 +6 -3
- package/docs/api/interfaces/TMissionOptInResult.md +6 -3
- package/docs/api/interfaces/TMissionOrBadge.md +5 -4
- 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 +11 -1
- package/docs/api/interfaces/TTournament.md +1 -1
- package/docs/api/interfaces/TTournamentDetailed.md +9 -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/UserAchievement.md +1 -1
- 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/clans/UIGuide_getClanInfo.md +153 -0
- package/docs/ui/clans/UIGuide_getClans.md +172 -0
- package/docs/ui/clans/UIGuide_joinClan.md +196 -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/missions/UIGuide_getAchCategories.md +17 -0
- package/docs/ui/missions/UIGuide_getBadges.md +237 -0
- package/docs/ui/missions/UIGuide_getMissions.md +268 -0
- package/docs/ui/missions/UIGuide_requestMissionClaimReward.md +21 -0
- package/docs/ui/missions/UIGuide_requestMissionOptIn.md +16 -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/store/UIGuide_buyStoreItem.md +133 -0
- package/docs/ui/store/UIGuide_getStoreCategories.md +19 -0
- package/docs/ui/store/UIGuide_getStoreItems.md +264 -0
- package/docs/ui/store/UIGuide_getStorePurchasedItems.md +122 -0
- package/docs/ui/tournaments/UIGuide_getClanTournamentPlayers.md +140 -0
- package/docs/ui/tournaments/UIGuide_getTournamentInstanceInfo.md +265 -0
- package/docs/ui/tournaments/UIGuide_getTournamentsList.md +236 -0
- package/docs/ui/tournaments/UIGuide_registerInTournament.md +156 -0
- package/docs/ui/user/UIGuide_getActivityLog.md +130 -0
- package/docs/ui/user/UIGuide_getLevels.md +167 -0
- package/docs/ui/user/UIGuide_getUserProfile.md +213 -0
- package/package.json +3 -3
- package/scripts/postdoc-cleanup.js +195 -0
- package/src/Base/ClassId.ts +2 -0
- package/src/Jackpots/JackpotDetails.ts +14 -15
- package/src/Jackpots/JackpotPot.ts +10 -6
- package/src/Missions/MissionsUtils.ts +5 -2
- 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/Store/BuyStoreItemErrorCode.ts +8 -0
- package/src/Store/StoreItem.ts +1 -0
- package/src/Store/StoreItemPurchased.ts +1 -0
- package/src/Store/StoreItemType.ts +1 -1
- package/src/Tournaments/TournamentRegistrationError.ts +4 -0
- package/src/WSAPI/WSAPI.ts +27 -2007
- package/src/WSAPI/WSAPIAvatars.ts +345 -0
- package/src/WSAPI/WSAPIBase.ts +93 -0
- package/src/WSAPI/WSAPIBonuses.ts +268 -0
- package/src/WSAPI/WSAPIClans.ts +417 -0
- package/src/WSAPI/WSAPIGamePick.ts +667 -0
- package/src/WSAPI/WSAPIGeneral.ts +199 -0
- package/src/WSAPI/WSAPIInbox.ts +711 -0
- package/src/WSAPI/WSAPIJackpots.ts +448 -0
- package/src/WSAPI/WSAPILeaderBoard.ts +154 -0
- package/src/WSAPI/WSAPIMiniGames.ts +597 -0
- package/src/WSAPI/WSAPIMissions.ts +572 -0
- package/src/WSAPI/WSAPIRaffles.ts +703 -0
- package/src/WSAPI/WSAPIStore.ts +732 -0
- package/src/WSAPI/WSAPITournaments.ts +541 -0
- package/src/WSAPI/WSAPITypes.ts +376 -207
- package/src/WSAPI/WSAPIUser.ts +606 -0
- package/tsconfig.json +26 -2
- package/docs/api/classes/WSAPI.md +0 -1927
package/docs/native/PROTOCOL.md
CHANGED
|
@@ -72,6 +72,17 @@ This document describes the low-level protocol for communicating with Smartico b
|
|
|
72
72
|
- [getTournamentsList](#gettournamentslist)
|
|
73
73
|
- [getTournamentInstanceInfo](#gettournamentinstanceinfo)
|
|
74
74
|
- [registerInTournament](#registerintournament)
|
|
75
|
+
- [getClanTournamentPlayers](#getclantournamentplayers)
|
|
76
|
+
|
|
77
|
+
#### Clans
|
|
78
|
+
- [getClans](#getclans)
|
|
79
|
+
- [getClanInfo](#getclaninfo)
|
|
80
|
+
- [joinClan](#joinclan)
|
|
81
|
+
|
|
82
|
+
#### Avatars
|
|
83
|
+
- [getAvatarsList](#getavatarslist)
|
|
84
|
+
- [getAvatarsCustomized](#getavatarscustomized)
|
|
85
|
+
- [getAvatarPrompts](#getavatarprompts)
|
|
75
86
|
|
|
76
87
|
#### Leaderboard
|
|
77
88
|
- [getLeaderBoard](#getleaderboard)
|
|
@@ -114,6 +125,7 @@ This document describes the low-level protocol for communicating with Smartico b
|
|
|
114
125
|
- [getRaffleDrawRunsHistory](#getraffledrawrunshistory)
|
|
115
126
|
- [claimRafflePrize](#claimraffleprize)
|
|
116
127
|
- [requestRaffleOptin](#requestraffleoptin)
|
|
128
|
+
- [getRaffleWonPrizes](#getrafflewonprizes)
|
|
117
129
|
|
|
118
130
|
---
|
|
119
131
|
|
|
@@ -1647,6 +1659,213 @@ No method-specific fields. Returns only the common response fields (see [Common
|
|
|
1647
1659
|
|
|
1648
1660
|
---
|
|
1649
1661
|
|
|
1662
|
+
### getClanTournamentPlayers
|
|
1663
|
+
|
|
1664
|
+
Get the players of a specific clan within a clan-based tournament instance.
|
|
1665
|
+
|
|
1666
|
+
#### Request
|
|
1667
|
+
|
|
1668
|
+
**ClassId:** `576` (GET_CLAN_TOURNAMENT_PLAYERS_REQUEST)
|
|
1669
|
+
|
|
1670
|
+
| Field | Type | Description |
|
|
1671
|
+
|-------|------|-------------|
|
|
1672
|
+
| `tournament_instance_id` | `number` | Tournament instance ID |
|
|
1673
|
+
| `clan_id` | `number` | Clan ID whose players to fetch |
|
|
1674
|
+
| `force_language` | `string` | Optional language override |
|
|
1675
|
+
|
|
1676
|
+
#### Response
|
|
1677
|
+
|
|
1678
|
+
**ClassId:** `577` (GET_CLAN_TOURNAMENT_PLAYERS_RESPONSE)
|
|
1679
|
+
|
|
1680
|
+
| Field | Type | Description |
|
|
1681
|
+
|-------|------|-------------|
|
|
1682
|
+
| `clan_id` | `number` | The clan ID |
|
|
1683
|
+
| `clan_public_meta` | `object` | `{ name: string, image_url: string }` |
|
|
1684
|
+
| `players` | [`ClanTournamentPlayerRaw[]`](../api/interfaces/ClanTournamentPlayerRaw.md) | Ranked players of the clan in this tournament |
|
|
1685
|
+
|
|
1686
|
+
> **Note:** `players[]` fields are **camelCase** (`userId`, `cleanExtUserId`, `userAltName`, `isMe`), unlike most other responses in this protocol. `userAltName` is the display name; `scores` is the player's tournament score; `position` is the rank within the clan.
|
|
1687
|
+
|
|
1688
|
+
---
|
|
1689
|
+
|
|
1690
|
+
## Clans
|
|
1691
|
+
|
|
1692
|
+
### getClans
|
|
1693
|
+
|
|
1694
|
+
Get the list of clans available to the current user, plus the user's own clan membership state.
|
|
1695
|
+
|
|
1696
|
+
#### Request
|
|
1697
|
+
|
|
1698
|
+
**ClassId:** `570` (GET_CLAN_LIST_REQUEST)
|
|
1699
|
+
|
|
1700
|
+
No method-specific fields. Send only the common fields (see [Common Message Fields](#common-message-fields)).
|
|
1701
|
+
|
|
1702
|
+
#### Response
|
|
1703
|
+
|
|
1704
|
+
**ClassId:** `571` (GET_CLAN_LIST_RESPONSE)
|
|
1705
|
+
|
|
1706
|
+
| Field | Type | Description |
|
|
1707
|
+
|-------|------|-------------|
|
|
1708
|
+
| `clans` | [`Clan[]`](../api/interfaces/Clan.md) | Available clans |
|
|
1709
|
+
| `user_clan_id` | `number \| null` | Clan ID the current user belongs to; `null` if clanless |
|
|
1710
|
+
| `cooldown_until` | `string \| null` | Cooldown end as a date string (e.g. `"29/03/2026 10:00:00"`); `null` if no cooldown |
|
|
1711
|
+
| `join_date` | `number \| null` | Epoch ms when the user joined their clan; `null` if clanless |
|
|
1712
|
+
|
|
1713
|
+
**Example:**
|
|
1714
|
+
|
|
1715
|
+
```json
|
|
1716
|
+
{
|
|
1717
|
+
"cid": 571,
|
|
1718
|
+
"clans": [
|
|
1719
|
+
{
|
|
1720
|
+
"clan_id": 12,
|
|
1721
|
+
"public_meta": { "name": "Wolves", "description": "Top pack", "image_url": "https://.../wolves.png" },
|
|
1722
|
+
"member_count": 18,
|
|
1723
|
+
"capacity_limit": 30,
|
|
1724
|
+
"entry_fee_currency_type_id": 0,
|
|
1725
|
+
"entry_fee_amount": 100,
|
|
1726
|
+
"rating_position": 3,
|
|
1727
|
+
"rating_score": 45200
|
|
1728
|
+
}
|
|
1729
|
+
],
|
|
1730
|
+
"user_clan_id": 12,
|
|
1731
|
+
"cooldown_until": null,
|
|
1732
|
+
"join_date": 1742212800000
|
|
1733
|
+
}
|
|
1734
|
+
```
|
|
1735
|
+
|
|
1736
|
+
> **Note:** `entry_fee_currency_type_id`: `0` = Points, `1` = Gems, `2` = Diamonds, `3` = Free. `rating_position` is the F1-style clan rank (ascending, `1` = best).
|
|
1737
|
+
|
|
1738
|
+
---
|
|
1739
|
+
|
|
1740
|
+
### getClanInfo
|
|
1741
|
+
|
|
1742
|
+
Get the full details of a single clan, including its member roster.
|
|
1743
|
+
|
|
1744
|
+
#### Request
|
|
1745
|
+
|
|
1746
|
+
**ClassId:** `572` (GET_CLAN_INFO_REQUEST)
|
|
1747
|
+
|
|
1748
|
+
| Field | Type | Description |
|
|
1749
|
+
|-------|------|-------------|
|
|
1750
|
+
| `clan_id` | `number` | Clan ID to fetch |
|
|
1751
|
+
|
|
1752
|
+
#### Response
|
|
1753
|
+
|
|
1754
|
+
**ClassId:** `573` (GET_CLAN_INFO_RESPONSE)
|
|
1755
|
+
|
|
1756
|
+
| Field | Type | Description |
|
|
1757
|
+
|-------|------|-------------|
|
|
1758
|
+
| `clanInfo` | [`ClanInfo`](../api/interfaces/ClanInfo.md) | Clan details + `members[]` roster |
|
|
1759
|
+
|
|
1760
|
+
> **Note:** `ClanInfo` extends the `Clan` fields and adds `label_id`, `cooldown_until`, and `members` (an array of [`ClanMember`](../api/interfaces/ClanMember.md)). Member `avatar_id` is the raw avatar id — build the image URL from it client-side (the JS SDK adds an `avatar_url`; the raw protocol response does not).
|
|
1761
|
+
|
|
1762
|
+
---
|
|
1763
|
+
|
|
1764
|
+
### joinClan
|
|
1765
|
+
|
|
1766
|
+
Join (or switch to) a clan. On labels with no cooldown, switching clans re-charges the entry fee — guard against accidental re-joins of the user's current clan.
|
|
1767
|
+
|
|
1768
|
+
#### Request
|
|
1769
|
+
|
|
1770
|
+
**ClassId:** `574` (JOIN_CLAN_REQUEST)
|
|
1771
|
+
|
|
1772
|
+
| Field | Type | Description |
|
|
1773
|
+
|-------|------|-------------|
|
|
1774
|
+
| `clan_id` | `number` | Clan ID to join |
|
|
1775
|
+
| `join_source_id` | `number` | Origin of the join action (operator-defined; `0` if unspecified) |
|
|
1776
|
+
|
|
1777
|
+
#### Response
|
|
1778
|
+
|
|
1779
|
+
**ClassId:** `575` (JOIN_CLAN_RESPONSE)
|
|
1780
|
+
|
|
1781
|
+
| Field | Type | Description |
|
|
1782
|
+
|-------|------|-------------|
|
|
1783
|
+
| `errCode` | `number` | Result code; `0` = success (see Error Codes below) |
|
|
1784
|
+
| `errMsg` | `string` | Optional error message on a non-zero `errCode` |
|
|
1785
|
+
|
|
1786
|
+
### Error Codes
|
|
1787
|
+
|
|
1788
|
+
| Code | Description |
|
|
1789
|
+
|------|-------------|
|
|
1790
|
+
| `0` | Success — join completed |
|
|
1791
|
+
| `1000` | Invalid parameters |
|
|
1792
|
+
| `1001` | Clan not found for this label |
|
|
1793
|
+
| `1002` | Clan is full (`member_count >= capacity_limit`) |
|
|
1794
|
+
| `1003` | Insufficient funds for the entry fee |
|
|
1795
|
+
| `1004` | User does not satisfy the clan's entry conditions / segment |
|
|
1796
|
+
| `1006` | User is within the clan-switch cooldown window |
|
|
1797
|
+
| `1007` | Clan is archived |
|
|
1798
|
+
|
|
1799
|
+
---
|
|
1800
|
+
|
|
1801
|
+
## Avatars
|
|
1802
|
+
|
|
1803
|
+
Avatar selection (`setAvatar`) is documented under [User](#setavatar). The methods below read the avatar catalog and the user's AI-customized avatars.
|
|
1804
|
+
|
|
1805
|
+
### getAvatarsList
|
|
1806
|
+
|
|
1807
|
+
Get the avatar catalog available to the current user.
|
|
1808
|
+
|
|
1809
|
+
#### Request
|
|
1810
|
+
|
|
1811
|
+
**ClassId:** `560` (GET_AVATARS_LIST_REQUEST)
|
|
1812
|
+
|
|
1813
|
+
No method-specific fields. Send only the common fields (see [Common Message Fields](#common-message-fields)).
|
|
1814
|
+
|
|
1815
|
+
#### Response
|
|
1816
|
+
|
|
1817
|
+
**ClassId:** `561` (GET_AVATARS_LIST_RESPONSE)
|
|
1818
|
+
|
|
1819
|
+
| Field | Type | Description |
|
|
1820
|
+
|-------|------|-------------|
|
|
1821
|
+
| `avatars` | [`AvatarDefinition[]`](../api/interfaces/AvatarDefinition.md) | Avatar catalog with per-user unlock flags |
|
|
1822
|
+
|
|
1823
|
+
> **Note:** The image path is nested at `public_meta.url` (the JS SDK flattens it to `url` / `avatar_url`). `avatar_source_type_id`: `0` = free / always available, non-zero = earned or purchased. Hide entries where `hide_until_achieved === true && is_given === false`.
|
|
1824
|
+
|
|
1825
|
+
---
|
|
1826
|
+
|
|
1827
|
+
### getAvatarsCustomized
|
|
1828
|
+
|
|
1829
|
+
Get the user's previously generated AI-customized avatar variants.
|
|
1830
|
+
|
|
1831
|
+
#### Request
|
|
1832
|
+
|
|
1833
|
+
**ClassId:** `562` (GET_AVATARS_CUSTOMIZED_REQUEST)
|
|
1834
|
+
|
|
1835
|
+
No method-specific fields. Send only the common fields (see [Common Message Fields](#common-message-fields)).
|
|
1836
|
+
|
|
1837
|
+
#### Response
|
|
1838
|
+
|
|
1839
|
+
**ClassId:** `563` (GET_AVATARS_CUSTOMIZED_RESPONSE)
|
|
1840
|
+
|
|
1841
|
+
| Field | Type | Description |
|
|
1842
|
+
|-------|------|-------------|
|
|
1843
|
+
| `avatars` | [`AvatarCustomized[]`](../api/interfaces/AvatarCustomized.md) | AI-generated variants, each tied to a base avatar by `avatar_real_id` |
|
|
1844
|
+
|
|
1845
|
+
---
|
|
1846
|
+
|
|
1847
|
+
### getAvatarPrompts
|
|
1848
|
+
|
|
1849
|
+
Get the AI style prompts available for avatar customization.
|
|
1850
|
+
|
|
1851
|
+
#### Request
|
|
1852
|
+
|
|
1853
|
+
**ClassId:** `564` (GET_AVATAR_PROMPTS_REQUEST)
|
|
1854
|
+
|
|
1855
|
+
No method-specific fields. Send only the common fields (see [Common Message Fields](#common-message-fields)).
|
|
1856
|
+
|
|
1857
|
+
#### Response
|
|
1858
|
+
|
|
1859
|
+
**ClassId:** `565` (GET_AVATAR_PROMPTS_RESPONSE)
|
|
1860
|
+
|
|
1861
|
+
| Field | Type | Description |
|
|
1862
|
+
|-------|------|-------------|
|
|
1863
|
+
| `prompts` | [`AvatarPrompt[]`](../api/interfaces/AvatarPrompt.md) | Available AI style prompts |
|
|
1864
|
+
|
|
1865
|
+
> **Note:** Prompt name/icon are nested at `public_meta.name` / `public_meta.icon_url`. `cost_currency_type_id`: `0` = points, `1` = gems, `2` = diamonds; `cost_value` is the amount.
|
|
1866
|
+
|
|
1867
|
+
---
|
|
1868
|
+
|
|
1650
1869
|
## Leaderboard
|
|
1651
1870
|
|
|
1652
1871
|
### getLeaderBoard
|
|
@@ -2455,6 +2674,124 @@ No method-specific fields. Returns only the common response fields (see [Common
|
|
|
2455
2674
|
|
|
2456
2675
|
---
|
|
2457
2676
|
|
|
2677
|
+
### getRaffleWonPrizes
|
|
2678
|
+
|
|
2679
|
+
Get every prize the current user has won within a single raffle — across all of that raffle's draws (recurring, one-shot, and grand; all historical runs) — newest-won first, paginated. Requires an authenticated user; visitor/anonymous sessions are rejected.
|
|
2680
|
+
|
|
2681
|
+
### Request
|
|
2682
|
+
|
|
2683
|
+
**ClassId:** `920`
|
|
2684
|
+
|
|
2685
|
+
**Example:**
|
|
2686
|
+
|
|
2687
|
+
```json
|
|
2688
|
+
{
|
|
2689
|
+
"cid": 920,
|
|
2690
|
+
"uuid": "550e8400-e29b-41d4-a716-446655440000",
|
|
2691
|
+
"ts": 1704067200000,
|
|
2692
|
+
"raffle_id": 123,
|
|
2693
|
+
"offset": 0,
|
|
2694
|
+
"limit": 20
|
|
2695
|
+
}
|
|
2696
|
+
```
|
|
2697
|
+
|
|
2698
|
+
**Fields:**
|
|
2699
|
+
|
|
2700
|
+
| Field | Type | Required | Description |
|
|
2701
|
+
|-------|------|----------|-------------|
|
|
2702
|
+
| `raffle_id` | `number` | ✓ | ID of the raffle |
|
|
2703
|
+
| `offset` | `number` | - | Zero-based index of the first row to return. Default `0` |
|
|
2704
|
+
| `limit` | `number` | - | Page size. Defaults to a per-label setting when omitted; not clamped server-side, so always send an explicit value |
|
|
2705
|
+
| `force_language` | `string` | - | Overrides the language used to localise `won_prizes[].public_meta.name`. Defaults to the user's profile language |
|
|
2706
|
+
|
|
2707
|
+
Rate-limited to ~30 requests per 60 s with a ~5 s minimum gap between calls.
|
|
2708
|
+
|
|
2709
|
+
---
|
|
2710
|
+
|
|
2711
|
+
### Response
|
|
2712
|
+
|
|
2713
|
+
**ClassId:** `921`
|
|
2714
|
+
|
|
2715
|
+
**Example:**
|
|
2716
|
+
|
|
2717
|
+
```json
|
|
2718
|
+
{
|
|
2719
|
+
"cid": 921,
|
|
2720
|
+
"errCode": 0,
|
|
2721
|
+
"errMsg": "",
|
|
2722
|
+
"user": {
|
|
2723
|
+
"user_id": 149600373,
|
|
2724
|
+
"avatar_id": "https://cdn.example.com/avatar.webp",
|
|
2725
|
+
"avatar_real_id": 29,
|
|
2726
|
+
"public_username": "32:r*****",
|
|
2727
|
+
"avatar_url": null
|
|
2728
|
+
},
|
|
2729
|
+
"won_prizes": [
|
|
2730
|
+
{
|
|
2731
|
+
"raf_won_id": 9795826,
|
|
2732
|
+
"prize_id": 389,
|
|
2733
|
+
"raffle_run_id": 659016,
|
|
2734
|
+
"draw_id": 272,
|
|
2735
|
+
"public_meta": {
|
|
2736
|
+
"name": "1 $",
|
|
2737
|
+
"hide_chance_to_win": false,
|
|
2738
|
+
"image_url": "https://cdn.example.com/prize.png"
|
|
2739
|
+
},
|
|
2740
|
+
"requires_claim": false,
|
|
2741
|
+
"claimed_date": 1779978607539
|
|
2742
|
+
}
|
|
2743
|
+
],
|
|
2744
|
+
"total": 103,
|
|
2745
|
+
"offset": 0,
|
|
2746
|
+
"limit": 20
|
|
2747
|
+
}
|
|
2748
|
+
```
|
|
2749
|
+
|
|
2750
|
+
**Fields:**
|
|
2751
|
+
|
|
2752
|
+
| Field | Type | Description |
|
|
2753
|
+
|-------|------|-------------|
|
|
2754
|
+
| `user` | [`RaffleWonPrizeUser`](../api/interfaces/RaffleWonPrizeUser.md) \| `null` | The user the prizes belong to. `null` when `won_prizes` is empty |
|
|
2755
|
+
| `won_prizes` | [`RaffleWonPrize[]`](../api/interfaces/RaffleWonPrize.md) | Won prizes for this page, newest-first |
|
|
2756
|
+
| `total` | `number` | Full count of the user's won prizes for this raffle across all draws (for pagination) |
|
|
2757
|
+
| `offset` | `number` | Echo of the resolved request offset |
|
|
2758
|
+
| `limit` | `number` | Echo of the resolved request limit |
|
|
2759
|
+
|
|
2760
|
+
`user` sub-object:
|
|
2761
|
+
|
|
2762
|
+
| Field | Type | Description |
|
|
2763
|
+
|-------|------|-------------|
|
|
2764
|
+
| `user_id` | `number` | Internal user ID |
|
|
2765
|
+
| `avatar_id` | `string` | Full URL for a system avatar, otherwise an avatar token to resolve against the avatar domain |
|
|
2766
|
+
| `avatar_real_id` | `number` | Numeric ID of the selected avatar definition |
|
|
2767
|
+
| `public_username` | `string` | Server-masked username (e.g. `"32:r*****"`) |
|
|
2768
|
+
| `avatar_url` | `null` | Always `null` on the wire — use `avatar_id` |
|
|
2769
|
+
|
|
2770
|
+
`won_prizes[]` item:
|
|
2771
|
+
|
|
2772
|
+
| Field | Type | Description |
|
|
2773
|
+
|-------|------|-------------|
|
|
2774
|
+
| `raf_won_id` | `number` | Winning-row ID. Pass as `won_id` to [claimRafflePrize](#claimraffleprize) when `requires_claim` is `true` and `claimed_date` is `null` |
|
|
2775
|
+
| `prize_id` | `number` | ID of the prize definition |
|
|
2776
|
+
| `raffle_run_id` | `number` | Run-instance ID of the awarding draw |
|
|
2777
|
+
| `draw_id` | `number` | Schedule ID of the awarding draw |
|
|
2778
|
+
| `public_meta.name` | `string` | Prize name (localised; honours `force_language`) |
|
|
2779
|
+
| `public_meta.hide_chance_to_win` | `boolean` | Whether to hide the chance-to-win in the UI |
|
|
2780
|
+
| `public_meta.image_url` | `string` | CDN URL for the prize artwork |
|
|
2781
|
+
| `requires_claim` | `boolean` | Whether the prize requires an explicit claim action |
|
|
2782
|
+
| `claimed_date` | `number` \| `null` | Epoch ms when claimed; `null` when not yet claimed |
|
|
2783
|
+
|
|
2784
|
+
---
|
|
2785
|
+
|
|
2786
|
+
### Error Codes
|
|
2787
|
+
|
|
2788
|
+
| Code | Description |
|
|
2789
|
+
|------|-------------|
|
|
2790
|
+
| `0` | Success. Also returned with an empty `won_prizes[]` / `total: 0` and `user: null` when the user has no wins or is not eligible to see the raffle |
|
|
2791
|
+
| `1` | System error (includes unauthenticated/visitor session, unknown raffle, or any server-side failure) |
|
|
2792
|
+
|
|
2793
|
+
---
|
|
2794
|
+
|
|
2458
2795
|
## Engagement Tracking
|
|
2459
2796
|
|
|
2460
2797
|
### reportEngagementImpression
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# UI Guide — `getAvatarPrompts`
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
- Returns the AI style prompts (e.g. "Cartoon", "Watercolor", "Cyberpunk")
|
|
5
|
+
available for avatar customization.
|
|
6
|
+
- Each prompt declares a cost in points / gems / diamonds — applying the
|
|
7
|
+
prompt deducts that cost server-side as part of the AI generation
|
|
8
|
+
request.
|
|
9
|
+
- Use to power the style-picker list inside the customization modal.
|
|
10
|
+
- 30 s cache; no push subscription; lazy-load on customization-modal
|
|
11
|
+
open.
|
|
12
|
+
|
|
13
|
+
## List view organization
|
|
14
|
+
|
|
15
|
+
Single flat list. No tabs / no sort hint from the server — present in
|
|
16
|
+
the order returned.
|
|
17
|
+
|
|
18
|
+
The default Smartico UI shows prompts as a vertical scrollable list with
|
|
19
|
+
one row per prompt.
|
|
20
|
+
|
|
21
|
+
## Item card / row
|
|
22
|
+
|
|
23
|
+
Fields rendered per row:
|
|
24
|
+
|
|
25
|
+
| Field | Source | Notes |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| Style icon | `icon_url` | 1:1, ~48 × 48 px |
|
|
28
|
+
| Name | `name` | Display label of the style |
|
|
29
|
+
| Cost icon | derived from `cost_currency_type_id` | Points / gems / diamonds icon |
|
|
30
|
+
| Cost amount | `cost_value` | Numeric, e.g. "100" |
|
|
31
|
+
|
|
32
|
+
**Click target**: tap selects the prompt; selection drives the AI
|
|
33
|
+
generation request.
|
|
34
|
+
|
|
35
|
+
## Affordability check
|
|
36
|
+
|
|
37
|
+
Compare `cost_value` against the live balance from
|
|
38
|
+
[`getUserProfile`](../../api/classes/WSAPIUser.md#getuserprofile)
|
|
39
|
+
based on `cost_currency_type_id`:
|
|
40
|
+
|
|
41
|
+
| `cost_currency_type_id` | Balance source |
|
|
42
|
+
|---|---|
|
|
43
|
+
| `0` | `profile.points_balance` |
|
|
44
|
+
| `1` | `profile.gems_balance` |
|
|
45
|
+
| `2` | `profile.diamonds_balance` |
|
|
46
|
+
|
|
47
|
+
Prompts the user cannot afford should be visually disabled but still
|
|
48
|
+
visible — the server is the source of truth and enforces the balance
|
|
49
|
+
check authoritatively. The default Smartico UI dims unaffordable
|
|
50
|
+
prompts but does NOT hide them.
|
|
51
|
+
|
|
52
|
+
## Status-specific visual treatments
|
|
53
|
+
|
|
54
|
+
| Status | Visual |
|
|
55
|
+
|---|---|
|
|
56
|
+
| Affordable | Normal |
|
|
57
|
+
| Unaffordable | Dimmed / desaturated; CTA disabled |
|
|
58
|
+
| Selected | Highlight ring / accent border |
|
|
59
|
+
|
|
60
|
+
## Empty / loading / error states
|
|
61
|
+
|
|
62
|
+
- **Empty**: "No customization styles available" — usually means the AI
|
|
63
|
+
customization feature is disabled on the label.
|
|
64
|
+
- **Loading**: skeleton list (3–4 placeholder rows).
|
|
65
|
+
- **Error**: non-blocking banner; keep prior list.
|
|
66
|
+
|
|
67
|
+
## Refresh
|
|
68
|
+
|
|
69
|
+
- 30 s SDK cache.
|
|
70
|
+
- Not invalidated by
|
|
71
|
+
[`setAvatar`](../../api/classes/WSAPIAvatars.md#setavatar) — prompts
|
|
72
|
+
are catalog metadata, independent of the user's active avatar.
|
|
73
|
+
- Not invalidated by the AI generation HTTP POST (prompts don't change
|
|
74
|
+
per-user).
|
|
75
|
+
- No push subscription.
|
|
76
|
+
|
|
77
|
+
## Triggering AI generation (out of scope for the SDK)
|
|
78
|
+
|
|
79
|
+
When the user picks a prompt and confirms, the consumer POSTs to the
|
|
80
|
+
operator-configured `avatar-customize` HTTP endpoint with the chosen
|
|
81
|
+
`prompt_id`, the base `avatar_real_id`, and the base avatar URL. The
|
|
82
|
+
server runs the AI generation (synchronous HTTP — the request blocks
|
|
83
|
+
until generation completes) and returns a new CDN URL.
|
|
84
|
+
|
|
85
|
+
After success, re-call
|
|
86
|
+
[`getAvatarsCustomized`](../../api/classes/WSAPIAvatars.md#getavatarscustomized)
|
|
87
|
+
to surface the new variant, then optionally apply it with
|
|
88
|
+
[`setAvatar`](../../api/classes/WSAPIAvatars.md#setavatar).
|
|
89
|
+
|
|
90
|
+
## Mobile vs desktop
|
|
91
|
+
|
|
92
|
+
- **Row density**: identical on both.
|
|
93
|
+
- **Modal layout**: full-screen sheet on mobile; centered dialog on
|
|
94
|
+
desktop.
|
|
95
|
+
|
|
96
|
+
## Performance
|
|
97
|
+
|
|
98
|
+
- 30 s cache absorbs modal re-opens.
|
|
99
|
+
- Lazy-load — call on modal open, not on app boot.
|
|
100
|
+
- Pre-load icon images at modal open time for snappy scrolling.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# UI Guide — `getAvatarsCustomized`
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
- Returns the user's previously generated AI-customized avatar variants.
|
|
5
|
+
- Each entry is one AI-generated image tied to a base avatar
|
|
6
|
+
(`avatar_real_id` refers to the base from
|
|
7
|
+
[`getAvatarsList`](../../api/classes/WSAPIAvatars.md#getavatarslist)).
|
|
8
|
+
- Power the "My variants" carousel inside the customization modal.
|
|
9
|
+
- 30 s cache; no push subscription.
|
|
10
|
+
|
|
11
|
+
## List view organization
|
|
12
|
+
|
|
13
|
+
Variants are best grouped client-side by `avatar_real_id`, then sorted
|
|
14
|
+
within each group by `dt_created` descending (newest first):
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
const byBase = new Map<number, TAvatarCustomized[]>();
|
|
18
|
+
for (const v of variants) {
|
|
19
|
+
const list = byBase.get(v.avatar_real_id) ?? [];
|
|
20
|
+
list.push(v);
|
|
21
|
+
byBase.set(v.avatar_real_id, list);
|
|
22
|
+
}
|
|
23
|
+
for (const list of byBase.values()) {
|
|
24
|
+
list.sort((a, b) => b.dt_created.localeCompare(a.dt_created));
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The default Smartico UI presents variants as a horizontally-scrollable
|
|
29
|
+
carousel under each base avatar in the customization modal.
|
|
30
|
+
|
|
31
|
+
## Item card / row
|
|
32
|
+
|
|
33
|
+
Fields rendered per variant:
|
|
34
|
+
|
|
35
|
+
| Field | Source | Notes |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| Variant image | `url` | 256 × 256 px |
|
|
38
|
+
| Creation date | `dt_created` | Optional — "Generated 2 days ago" |
|
|
39
|
+
| Apply CTA | local | Tap to set as profile avatar via [`setAvatar`](../../api/classes/WSAPIAvatars.md#setavatar) |
|
|
40
|
+
|
|
41
|
+
**Click target**: tap selects the variant in the preview area; "Apply"
|
|
42
|
+
in the bottom bar calls
|
|
43
|
+
[`setAvatar({ avatar_url: variant.url, avatar_real_id: variant.avatar_real_id })`](../../api/classes/WSAPIAvatars.md#setavatar).
|
|
44
|
+
|
|
45
|
+
## Image / asset specs
|
|
46
|
+
|
|
47
|
+
- **Variant**: 256 × 256 px (1:1) — typically rendered larger than
|
|
48
|
+
catalog tiles to showcase the AI generation.
|
|
49
|
+
- **Format**: WebP when supported; PNG fallback.
|
|
50
|
+
- **Origin**: served from the operator-configured avatar CDN.
|
|
51
|
+
|
|
52
|
+
## Empty / loading / error states
|
|
53
|
+
|
|
54
|
+
- **Empty (new user, no variants)**: show only the base avatar preview;
|
|
55
|
+
do not render an empty carousel. The default Smartico UI shows the
|
|
56
|
+
selected base avatar as a single-item fallback.
|
|
57
|
+
- **Loading**: skeleton placeholder over the preview area.
|
|
58
|
+
- **Error**: keep the prior list if any; non-blocking error banner.
|
|
59
|
+
|
|
60
|
+
## Refresh
|
|
61
|
+
|
|
62
|
+
- 30 s SDK cache.
|
|
63
|
+
- [`setAvatar`](../../api/classes/WSAPIAvatars.md#setavatar) clears this
|
|
64
|
+
cache as a side effect.
|
|
65
|
+
- **AI generation is outside this SDK.** After the operator-configured
|
|
66
|
+
`avatar-customize` HTTP POST resolves successfully, re-call
|
|
67
|
+
`getAvatarsCustomized()` to surface the new variant (the SDK cannot
|
|
68
|
+
auto-invalidate because the customization request is not WS-based).
|
|
69
|
+
- No push subscription.
|
|
70
|
+
|
|
71
|
+
## Relation to `getAvatarsList`
|
|
72
|
+
|
|
73
|
+
AI variants do NOT appear in
|
|
74
|
+
[`getAvatarsList`](../../api/classes/WSAPIAvatars.md#getavatarslist) —
|
|
75
|
+
they're stored separately under the user record. A combined "all my
|
|
76
|
+
avatars" view requires merging both collections client-side.
|
|
77
|
+
|
|
78
|
+
## Mobile vs desktop
|
|
79
|
+
|
|
80
|
+
- **Carousel**: horizontal scroll on mobile; arrow navigation + scroll
|
|
81
|
+
on desktop.
|
|
82
|
+
- **Preview size**: 256 × 256 px on both; mobile fits one variant per
|
|
83
|
+
screen width.
|
|
84
|
+
|
|
85
|
+
## Performance
|
|
86
|
+
|
|
87
|
+
- 30 s cache absorbs picker re-opens.
|
|
88
|
+
- Pre-load variant images at customization-modal open time.
|
|
89
|
+
- Don't poll — variants only change after a customization run, which
|
|
90
|
+
the consumer controls.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# UI Guide — `getAvatarsList`
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
- Returns the avatar catalog plus per-user unlock flags (`is_given`, `is_in_use`).
|
|
5
|
+
- Use to power the avatar picker grid in the user profile screen.
|
|
6
|
+
- 30 s cache; no push subscription. Re-call after
|
|
7
|
+
[`setAvatar`](../../api/classes/WSAPIAvatars.md#setavatar) to refresh
|
|
8
|
+
`is_in_use`.
|
|
9
|
+
|
|
10
|
+
## Grid layout
|
|
11
|
+
|
|
12
|
+
Single flat grid — no tabs / no filter chips in the default Smartico UI.
|
|
13
|
+
|
|
14
|
+
Pre-render pipeline:
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
const visible = avatars
|
|
18
|
+
.filter((a) => !a.hide_until_achieved || a.is_given)
|
|
19
|
+
.sort((a, b) => a.priority - b.priority);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
| Property | Value |
|
|
23
|
+
|---|---|
|
|
24
|
+
| Tile aspect ratio | 1:1 (square) |
|
|
25
|
+
| Default tile size | 128 × 128 px |
|
|
26
|
+
| Column count | 3 on mobile (~360 px), 4–5 on desktop |
|
|
27
|
+
| Sort | `priority` ascending (lower = first) |
|
|
28
|
+
| Visibility filter | drop `hide_until_achieved && !is_given` |
|
|
29
|
+
|
|
30
|
+
## Item card / tile
|
|
31
|
+
|
|
32
|
+
Fields rendered per tile:
|
|
33
|
+
|
|
34
|
+
| Field | Source | Notes |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| Avatar image | `avatar_url` | 128 × 128 px |
|
|
37
|
+
| "In use" overlay | `is_in_use === true` | Checkmark badge top-right |
|
|
38
|
+
| Lock overlay | `!is_given && avatar_source_type_id !== 0` | "?" placeholder instead of image; grayscale/dim |
|
|
39
|
+
| Selection ring | local UI state | Apply ring when user taps but hasn't confirmed |
|
|
40
|
+
|
|
41
|
+
**Click target**: single tap selects the avatar (local state). A separate
|
|
42
|
+
"Apply" button submits — tap-to-select is NOT tap-to-apply.
|
|
43
|
+
|
|
44
|
+
## Action button decision matrix
|
|
45
|
+
|
|
46
|
+
The picker has a bottom bar with an "Apply" button:
|
|
47
|
+
|
|
48
|
+
| State | Apply button |
|
|
49
|
+
|---|---|
|
|
50
|
+
| Selected avatar `is_in_use` | Label "In Use", disabled |
|
|
51
|
+
| Selected avatar `is_given` (or free) | Label "Apply", enabled |
|
|
52
|
+
| Selected avatar locked | Apply hidden / disabled; show unlock requirement instead |
|
|
53
|
+
| Apply in flight | Disabled with spinner |
|
|
54
|
+
|
|
55
|
+
## Image / asset specs
|
|
56
|
+
|
|
57
|
+
- **Tile**: 128 × 128 px (1:1).
|
|
58
|
+
- **Detail / preview**: 256 × 256 px (1:1).
|
|
59
|
+
- **Format**: WebP when supported by the browser; PNG fallback.
|
|
60
|
+
- **CDN resize path**: the `avatar_url` is the full-resolution image; the
|
|
61
|
+
consumer should request the resize variant for grid tiles to save
|
|
62
|
+
bandwidth (e.g. `…/resize/128/128/webp/…`). The exact path scheme is
|
|
63
|
+
operator-configured.
|
|
64
|
+
|
|
65
|
+
## Status-specific visual treatments
|
|
66
|
+
|
|
67
|
+
| Status | Visual |
|
|
68
|
+
|---|---|
|
|
69
|
+
| In use | Checkmark overlay top-right |
|
|
70
|
+
| Selected (not yet applied) | Highlight ring around the tile |
|
|
71
|
+
| Locked (earned, not given) | "?" placeholder image; dimmed |
|
|
72
|
+
| `hide_until_achieved` and not given | Filtered out — does NOT render |
|
|
73
|
+
|
|
74
|
+
## Empty / loading / error states
|
|
75
|
+
|
|
76
|
+
- **Loading (cold fetch)**: skeleton grid (6–9 placeholder tiles).
|
|
77
|
+
- **Empty**: "No avatars available" — uncommon, suggests label
|
|
78
|
+
misconfiguration.
|
|
79
|
+
- **Error**: keep the previous catalog if present; non-blocking error
|
|
80
|
+
banner.
|
|
81
|
+
|
|
82
|
+
## Refresh
|
|
83
|
+
|
|
84
|
+
- 30 s SDK cache deduplicates rapid re-fetches.
|
|
85
|
+
- No push subscription. Re-call after a successful
|
|
86
|
+
[`setAvatar`](../../api/classes/WSAPIAvatars.md#setavatar) (the SDK
|
|
87
|
+
auto-clears the cache so the next call goes through).
|
|
88
|
+
- When the user earns a new avatar (`is_given` flips server-side), the
|
|
89
|
+
change surfaces only on the next call after the cache window expires.
|
|
90
|
+
|
|
91
|
+
## Mobile vs desktop
|
|
92
|
+
|
|
93
|
+
- **Tile size**: identical; column count adjusts to viewport width.
|
|
94
|
+
- **Picker layout**: full-screen sheet on mobile; centered modal on
|
|
95
|
+
desktop.
|
|
96
|
+
|
|
97
|
+
## Performance
|
|
98
|
+
|
|
99
|
+
- 30 s cache + immediate post-mutation invalidation balances staleness
|
|
100
|
+
vs. roundtrip count.
|
|
101
|
+
- Pre-load grid images at picker open time (the user almost always opens
|
|
102
|
+
the picker to scan multiple avatars).
|
|
103
|
+
- AI-customized variants do NOT appear in this list — they live in
|
|
104
|
+
[`getAvatarsCustomized`](../../api/classes/WSAPIAvatars.md#getavatarscustomized).
|
|
105
|
+
Combine the two collections client-side if the UI shows them together.
|