@smartico/public-api 0.0.431 → 0.0.433

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.
@@ -137,6 +137,8 @@ export declare enum ClassId {
137
137
  BNR_GET_BANNER_PLACEMENTS_RESPONSE = 951,
138
138
  BNR_GET_BANNER_CONTENT_REQUEST = 952,
139
139
  BNR_GET_BANNER_CONTENT_RESPONSE = 953,
140
+ TERMS_AND_CONDITIONS_REQUEST = 954,
141
+ TERMS_AND_CONDITIONS_RESPONSE = 955,
140
142
  REGISTER_PUSH_NOTIFICATIONS_TOKEN_REQ = 1003,
141
143
  REGISTER_PUSH_NOTIFICATIONS_TOKEN_RESP = 2003,
142
144
  FORM_SHOW_PUSH = 1050,
@@ -0,0 +1,12 @@
1
+ import { ProtocolMessage } from '../Base/ProtocolMessage';
2
+ /**
3
+ * Asks for the label's widget disclaimer ("additional T&C") text with any
4
+ * personalisation placeholders already resolved for the current player.
5
+ *
6
+ * Requires an identified session — the text is resolved against the player's
7
+ * own state, so it cannot be requested before identification.
8
+ */
9
+ export interface TermsAndConditionsRequest extends ProtocolMessage {
10
+ /** Overrides the session language used to resolve the text. Defaults to the player's language. */
11
+ force_language?: string;
12
+ }
@@ -0,0 +1,14 @@
1
+ import { ProtocolResponse } from '../Base/ProtocolResponse';
2
+ /**
3
+ * The label's widget disclaimer ("additional T&C") text, resolved for the
4
+ * current player.
5
+ *
6
+ * The value is the configured disclaimer with its personalisation placeholders
7
+ * substituted. Placeholders that cannot be resolved are left as-is rather than
8
+ * blanked. May be `null` or an empty string when no disclaimer is configured,
9
+ * in which case nothing should be rendered. The text may contain HTML.
10
+ */
11
+ export interface TermsAndConditionsResponse extends ProtocolResponse {
12
+ /** The resolved disclaimer text, or `null` / `''` when none is configured. */
13
+ widget_disclaimer_text?: string;
14
+ }
@@ -6,5 +6,7 @@ export * from './GetTranslationsRequest';
6
6
  export * from './GetTranslationsResponse';
7
7
  export * from './PublicLabelSettings';
8
8
  export * from './PublicProperties';
9
+ export * from './TermsAndConditionsRequest';
10
+ export * from './TermsAndConditionsResponse';
9
11
  export * from './ResponseIdentify';
10
12
  export * from './TranslationArea';
@@ -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;
@@ -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>;
@@ -116,6 +116,7 @@ export interface PublicProperties {
116
116
  core_registration_date?: number;
117
117
  core_recommended_deposit_amount?: number;
118
118
  core_recommended_casino_bet_amount?: number;
119
+ core_recommended_sport_bet_amount?: number;
119
120
  }
120
121
  declare enum ClassId {
121
122
  PING = 1,
@@ -831,6 +832,8 @@ export interface TUserProfile {
831
832
  core_recommended_deposit_amount?: number;
832
833
  /** The recommended casino bet amount for the user */
833
834
  core_recommended_casino_bet_amount?: number;
835
+ /** The recommended sport bet amount for the user */
836
+ core_recommended_sport_bet_amount?: number;
834
837
  }
835
838
  /**
836
839
  * TLevel describes the information of each level defined in the system
@@ -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
@@ -260,6 +260,9 @@ export interface TUserProfile {
260
260
  /** AI-recommended casino bet amount for this user. Undefined when no
261
261
  * recommendation is currently available. */
262
262
  core_recommended_casino_bet_amount?: number;
263
+ /** AI-recommended sport bet amount for this user. Undefined when no
264
+ * recommendation is currently available. */
265
+ core_recommended_sport_bet_amount?: number;
263
266
  /** Display name of the user's current level (e.g. `"Silver"`); resolve the id via `getCurrentLevel()`. */
264
267
  ach_level_current?: string;
265
268
  /** `true` when the user is in the gamification A/B control group (gamification UI suppressed). */