@smartico/public-api 0.0.432 → 0.0.434

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.
@@ -14,7 +14,7 @@ export interface InboxMessageBody {
14
14
  action: string;
15
15
  }[];
16
16
  show_preview?: boolean;
17
- show_duration_sec?: number;
17
+ show_duration_sec?: number | null;
18
18
  enable_zoom_mode?: boolean;
19
19
  open_links?: OpenLinksType;
20
20
  custom_data?: string;
@@ -5,6 +5,8 @@ export interface GetJackpotWinnersResponse extends ProtocolResponse {
5
5
  winners: JackpotWinnerHistory[];
6
6
  /** Whether there are more winners to fetch */
7
7
  has_more: boolean;
8
+ /** Win statistics of the jackpot template */
9
+ win_stats?: JackpotWinStats;
8
10
  }
9
11
  export interface JackpotWinnerHistory {
10
12
  /** Id of the jackpot pot */
@@ -14,7 +16,33 @@ export interface JackpotWinnerHistory {
14
16
  /** Info about jackpot winner */
15
17
  winner: JackPotWinner;
16
18
  }
19
+ export interface JackpotWinStats {
20
+ /** Total number of issued wins of the jackpot template. Wins waiting for manual approval are not counted */
21
+ total_wins: number;
22
+ /** The biggest win of the jackpot template, `null` when there are no wins yet */
23
+ highest_win: JackpotWin | null;
24
+ /** The most recent win of the jackpot template, `null` when there are no wins yet */
25
+ last_win: JackpotWin | null;
26
+ }
27
+ export interface JackpotWin {
28
+ /** Won amount in the Jackpot currency */
29
+ winning_amount: number;
30
+ /** Date of winning in milliseconds */
31
+ win_date_ts: number;
32
+ /** Name of the winner, masked by default. `null` when the jackpot template doesn't expose winners over API */
33
+ public_username: string | null;
34
+ }
35
+ export interface TGetJackpotWinStatsResponse {
36
+ /** The list of jackpot winners */
37
+ winners: JackpotWinnerHistory[];
38
+ /** Win statistics of the jackpot template */
39
+ win_stats: JackpotWinStats;
40
+ }
17
41
  /**
18
42
  * @ignore
19
43
  */
20
44
  export declare const GetJackpotWinnersResponseTransform: (items: JackpotWinnerHistory[]) => JackpotWinnerHistory[];
45
+ /**
46
+ * @ignore
47
+ */
48
+ export declare const GetJackpotWinStatsResponseTransform: (response: GetJackpotWinnersResponse) => TGetJackpotWinStatsResponse;
@@ -390,6 +390,32 @@ export interface SAWTemplateUI {
390
390
  * Back-Office label: _"Use Custom Game"_.
391
391
  */
392
392
  use_custom?: boolean;
393
+ /**
394
+ * Whether a custom mini-game fills the whole mini-game window instead of
395
+ * the default fixed-size frame (800×516 on desktop, 400×745 on mobile).
396
+ *
397
+ * Applies wherever the game is opened — a spin attempt shown to the user,
398
+ * a deep link, or `_smartico.miniGame()` in standalone or inline mode.
399
+ * The `fullscreen` option of `_smartico.miniGame()` overrides it per call.
400
+ *
401
+ * When `false` or omitted, the default frame size is used.
402
+ * Back-Office label: _"Standalone full screen"_.
403
+ */
404
+ standalone_fullscreen?: boolean;
405
+ /**
406
+ * Width of the custom mini-game frame on desktop when opened standalone or inline,
407
+ * as a CSS size (`800px`, `100%`, `90vw`; a bare number is treated as pixels).
408
+ * Empty or invalid values fall back to the default 800px. Ignored on mobile.
409
+ * Back-Office label: _"Standalone width"_.
410
+ */
411
+ standalone_width?: string;
412
+ /**
413
+ * Height of the custom mini-game frame on desktop when opened standalone or inline,
414
+ * as a CSS size (`516px`, `100%`, `90vh`; a bare number is treated as pixels).
415
+ * Empty or invalid values fall back to the default 516px. Ignored on mobile.
416
+ * Back-Office label: _"Standalone height"_.
417
+ */
418
+ standalone_height?: string;
393
419
  /**
394
420
  * Minutes for the Voyager seed window.
395
421
  * The seed window is the range of seeds that can be used to generate the map.
@@ -29,7 +29,7 @@ import { GetAvatarsCustomizedResponse } from './Avatars/GetAvatarsCustomizedResp
29
29
  import { GetAvatarPromptsResponse } from './Avatars/GetAvatarPromptsResponse';
30
30
  import { SetAvatarResponse } from './Avatars';
31
31
  import { AvatarCustomizeResponse } from './Avatars/AvatarCustomizeResponse';
32
- import { GetJackpotWinnersResponse, JackpotWinnerHistory } from './Jackpots/GetJackpotWinnersResponse';
32
+ import { GetJackpotWinnersResponse, JackpotWinnerHistory, TGetJackpotWinStatsResponse } from './Jackpots/GetJackpotWinnersResponse';
33
33
  import { GetJackpotEligibleGamesResponse, TGetJackpotEligibleGamesResponse } from './Jackpots/GetJackpotEligibleGamesResponse';
34
34
  import { GamePickGameInfo, GamePickRound, GamePickRoundBoard, GamePickUserInfo, GamesApiResponse } from './GamePick';
35
35
  interface Tracker {
@@ -113,6 +113,7 @@ declare class SmarticoAPI {
113
113
  }): Promise<JackpotsOptoutResponse>;
114
114
  getJackpotWinners(user_ext_id: string, limit: number, offset: number, jp_template_id: number): Promise<GetJackpotWinnersResponse>;
115
115
  getJackpotWinnersT(user_ext_id: string, limit: number, offset: number, jp_template_id: number): Promise<JackpotWinnerHistory[]>;
116
+ getJackpotWinStatsT(user_ext_id: string, limit: number, offset: number, jp_template_id: number): Promise<TGetJackpotWinStatsResponse>;
116
117
  getJackpotEligibleGames(user_ext_id: string, { jp_template_id }: {
117
118
  jp_template_id: number;
118
119
  }): Promise<GetJackpotEligibleGamesResponse>;
@@ -34,6 +34,24 @@ export interface SmarticoWidgetParams {
34
34
  zoom?: number;
35
35
  /** Force the mobile layout regardless of viewport. */
36
36
  force_mobile?: boolean;
37
+ /**
38
+ * Custom mini-games only ({@link SmarticoGlobal.miniGame}): `true` fills the whole mini-game window,
39
+ * `false` keeps the default fixed-size frame. Overrides the template's "Standalone full screen" setting;
40
+ * when omitted, the template setting is used.
41
+ */
42
+ fullscreen?: boolean;
43
+ /**
44
+ * Custom mini-games only ({@link SmarticoGlobal.miniGame}): desktop width of the game frame as a CSS size
45
+ * (`1000px`, `100%`, `90vw`; a number is treated as pixels). Overrides the template's "Standalone width"
46
+ * and "Standalone full screen" settings. Ignored on mobile.
47
+ */
48
+ frame_width?: string | number;
49
+ /**
50
+ * Custom mini-games only ({@link SmarticoGlobal.miniGame}): desktop height of the game frame as a CSS size
51
+ * (`600px`, `100%`, `90vh`; a number is treated as pixels). Overrides the template's "Standalone height"
52
+ * and "Standalone full screen" settings. Ignored on mobile.
53
+ */
54
+ frame_height?: string | number;
37
55
  }
38
56
  /**
39
57
  * Options passed to {@link SmarticoGlobal.init} / {@link SmarticoGlobal.initVisitorMode}.
@@ -318,6 +318,16 @@ export declare class WSAPIInbox extends WSAPILeaderBoard {
318
318
  * for safe execution — that helper handles URL vs deep-link
319
319
  * routing.
320
320
  *
321
+ * **Preview vs silent delivery**
322
+ * Every message belongs in your inbox list. `show_preview` decides
323
+ * whether it should also pop up briefly when it arrives:
324
+ * - `show_preview !== false` → show a preview popup for
325
+ * `show_duration_sec ?? 7` seconds.
326
+ * - `show_preview === false` → store it silently, with no popup.
327
+ * These fields are returned exactly as the operator configured them;
328
+ * a missing value means the default above, the same as the default
329
+ * Smartico UI.
330
+ *
321
331
  * **Idempotency / Side effects**: safe. Read-only HTTP fetch.
322
332
  *
323
333
  * **UI guidance**: see [UI Guide — `getInboxMessageBody`](../../docs/ui/inbox/UIGuide_getInboxMessageBody.md).
@@ -343,6 +353,12 @@ export declare class WSAPIInbox extends WSAPILeaderBoard {
343
353
  * console.log('[smartico] simple message — show preview_body + single CTA wired to:', body.action,
344
354
  * '— execute via _smartico.dp(body.action)');
345
355
  * }
356
+ *
357
+ * if (body.show_preview !== false) {
358
+ * console.log('[smartico] new message — show a preview popup for', body.show_duration_sec ?? 7, 'seconds');
359
+ * } else {
360
+ * console.log('[smartico] new message — store it in the inbox silently, no popup');
361
+ * }
346
362
  * ```
347
363
  */
348
364
  getInboxMessageBody(messageGuid: string): Promise<TInboxMessageBody>;
@@ -1,5 +1,6 @@
1
1
  import { JackpotDetails, JackpotWinnerHistory, JackpotsOptinResponse, JackpotsOptoutResponse } from '../Jackpots';
2
2
  import { TGetJackpotEligibleGamesResponse } from '../Jackpots/GetJackpotEligibleGamesResponse';
3
+ import { TGetJackpotWinStatsResponse } from '../Jackpots/GetJackpotWinnersResponse';
3
4
  import { WSAPIClans } from './WSAPIClans';
4
5
  /** @group Jackpots */
5
6
  export declare class WSAPIJackpots extends WSAPIClans {
@@ -288,6 +289,81 @@ export declare class WSAPIJackpots extends WSAPIClans {
288
289
  /** Jackpot template ID (required). */
289
290
  jp_template_id?: number;
290
291
  }): Promise<JackpotWinnerHistory[]>;
292
+ /**
293
+ * Returns past winners of a specific jackpot template, paginated, together
294
+ * with the win statistics of that template: total number of wins, the
295
+ * biggest win and the most recent win. Use it for a jackpot info modal /
296
+ * tooltip that shows "Total wins", "Highest win" and "Latest win" next to
297
+ * the winners list.
298
+ *
299
+ * @remarks
300
+ * **Preconditions**
301
+ * - User must be authenticated. Visitor mode not supported.
302
+ * - `jp_template_id` is mandatory.
303
+ * - The consumer SHOULD check
304
+ * `JackpotDetails.expose_winners_over_api` before calling, since
305
+ * the server does not enforce it.
306
+ *
307
+ * **Statistics**
308
+ * - `win_stats` describes the whole jackpot template and does not depend
309
+ * on `limit` / `offset`. Pass `limit: 1` when only the statistics are needed.
310
+ * - Only issued wins are counted — a pot that exploded but still waits for
311
+ * manual approval is not included.
312
+ * - `highest_win` / `last_win` are `null` while the jackpot has no wins,
313
+ * `total_wins` is `0` in that case.
314
+ * - `public_username` of `highest_win` / `last_win` is masked by the same
315
+ * label setting as the winners list, and is `null` when the template
316
+ * doesn't expose winners over API.
317
+ * - The server refreshes the statistics once per minute.
318
+ *
319
+ * **Currency caveat**
320
+ * All amounts (`win_stats.*.winning_amount`,
321
+ * `winners[].winner.winning_amount_jp_currency`) are in the jackpot's
322
+ * NATIVE currency, NOT the user's wallet currency.
323
+ *
324
+ * **Refresh**
325
+ * - The SDK caches each page separately (per `jp_template_id` +
326
+ * `limit` + `offset`) for 30 seconds.
327
+ * - Caches clear on jackpot-win push events and on opt-in / opt-out.
328
+ *
329
+ * **Error handling**
330
+ * Non-zero `errCode` on control-group users or generic server errors. The
331
+ * SDK does NOT enumerate distinct codes — branch on `errCode === 0` and
332
+ * surface `errMsg` on failure.
333
+ *
334
+ * **Visitor mode**: not supported.
335
+ *
336
+ * @returns {@link TGetJackpotWinStatsResponse} —
337
+ * `{ winners: JackpotWinnerHistory[], win_stats: JackpotWinStats }`.
338
+ *
339
+ * @example
340
+ * ```ts
341
+ * const [jp] = await window._smartico.api.jackpotGet({ jp_template_id: 42 });
342
+ *
343
+ * if (!jp || !jp.expose_winners_over_api) {
344
+ * console.log('[smartico] winners hidden by operator config — hide the stats');
345
+ * return;
346
+ * }
347
+ *
348
+ * const { winners, win_stats } = await window._smartico.api.getJackpotWinStats({
349
+ * jp_template_id: 42,
350
+ * limit: 10,
351
+ * offset: 0,
352
+ * });
353
+ * console.log('[smartico] total wins', win_stats.total_wins);
354
+ * console.log('[smartico] highest win', win_stats.highest_win?.winning_amount, jp.jp_currency);
355
+ * console.log('[smartico] latest win', win_stats.last_win?.public_username, win_stats.last_win?.win_date_ts);
356
+ * console.log('[smartico] render', winners.length, 'recent winner rows');
357
+ * ```
358
+ */
359
+ getJackpotWinStats({ limit, offset, jp_template_id, }: {
360
+ /** Page size of the winners list (default 20). */
361
+ limit?: number;
362
+ /** Pagination offset of the winners list (default 0). */
363
+ offset?: number;
364
+ /** Jackpot template ID (required). */
365
+ jp_template_id?: number;
366
+ }): Promise<TGetJackpotWinStatsResponse>;
291
367
  /**
292
368
  * Returns the casino games eligible to contribute to a specific jackpot —
293
369
  * the catalog the user must play to grow the pot. Use to power an
@@ -1083,6 +1083,12 @@ export interface TInboxMessageBody {
1083
1083
  /** Operator-defined custom data. The SDK auto-parses JSON-looking
1084
1084
  * strings, so at runtime this is `any` despite the `string` type. */
1085
1085
  custom_data?: string;
1086
+ /** Whether to show a short preview popup when the message arrives.
1087
+ * `false` means store it in the inbox silently; missing means `true`. */
1088
+ show_preview?: boolean;
1089
+ /** How long the preview popup stays visible, in seconds.
1090
+ * `null` or missing means 7 seconds. */
1091
+ show_duration_sec?: number | null;
1086
1092
  }
1087
1093
  /**
1088
1094
  * InboxMarkMessageAction is the response of the five inbox mutation