@kalamba/sdk 0.39.0 → 0.43.0

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.
@@ -68,7 +68,6 @@ type NestedRecord<K extends string | number | symbol, V> = { [k in K]: V | Neste
68
68
  type WrapperConfig = {
69
69
  gameName: string;
70
70
  gameVersion: string;
71
- gameHistoryUrl?: string;
72
71
  showFreeRounds: boolean;
73
72
  showPromoPanel: boolean;
74
73
  showRealityCheck: boolean;
@@ -80,9 +79,11 @@ type WrapperState = {
80
79
  isSdkConfigured: boolean;
81
80
  balance: number;
82
81
  bet: Bet;
82
+ updateBalance: boolean;
83
83
  openGameResponse?: OpenGameResponse['contract'];
84
84
  lastPlayResponse?: PlayResponse['contract'];
85
85
  freeRoundId?: string;
86
+ playBlockers: Promise<void>[];
86
87
  };
87
88
  type AutoplayLimit = {
88
89
  enabled: boolean;
@@ -140,6 +141,7 @@ interface SdkConfig {
140
141
  showClock: boolean;
141
142
  showCloseGame: boolean;
142
143
  showCurrency: boolean;
144
+ showDeconstructedBet: boolean;
143
145
  showFastPlay: boolean;
144
146
  showFeatureBuy: boolean;
145
147
  showFeatureIntro: boolean;
@@ -375,6 +377,9 @@ type SdkOnlyMessagePayloadMap = {
375
377
  freeRoundsPopup: never;
376
378
  };
377
379
  type WrapperOnlyMessagePayloadMap = {
380
+ balance: {
381
+ balance: number;
382
+ };
378
383
  bet: Bet;
379
384
  cashier: Cashier;
380
385
  close: never;
@@ -383,11 +388,11 @@ type WrapperOnlyMessagePayloadMap = {
383
388
  freeze: never;
384
389
  history: History;
385
390
  resume: never;
386
- state: WrapperState;
387
391
  suspend: never;
388
392
  unfreeze: never;
389
393
  legalBets: Record<number, number[]>;
390
394
  play: PlayRequestEnhanced;
395
+ playReady: never;
391
396
  freeRounds: FreeRoundsAction;
392
397
  freeRoundsOffer: FreeRound;
393
398
  freeRoundsInfo: FreeRound;
@@ -469,7 +469,7 @@ function formatCurrencyPure(config, number, { as, from } = {
469
469
  from: CurrencyNumber.Money
470
470
  }, formatOptions) {
471
471
  if (!["string", "number"].includes(typeof number)) return "NaN";
472
- const { canShowCurrency = true, coinValueInCents, currency, locales } = config;
472
+ const { canShowCurrency = true, coinValueInCents = 1, currency, locales } = config;
473
473
  if (from === CurrencyNumber.Coins) number = coinsToMoney(+number, coinValueInCents);
474
474
  try {
475
475
  const options = getCurrencyNumberFormatOptions(currency);
@@ -68,7 +68,6 @@ type NestedRecord<K extends string | number | symbol, V> = { [k in K]: V | Neste
68
68
  type WrapperConfig = {
69
69
  gameName: string;
70
70
  gameVersion: string;
71
- gameHistoryUrl?: string;
72
71
  showFreeRounds: boolean;
73
72
  showPromoPanel: boolean;
74
73
  showRealityCheck: boolean;
@@ -80,9 +79,11 @@ type WrapperState = {
80
79
  isSdkConfigured: boolean;
81
80
  balance: number;
82
81
  bet: Bet;
82
+ updateBalance: boolean;
83
83
  openGameResponse?: OpenGameResponse['contract'];
84
84
  lastPlayResponse?: PlayResponse['contract'];
85
85
  freeRoundId?: string;
86
+ playBlockers: Promise<void>[];
86
87
  };
87
88
  type AutoplayLimit = {
88
89
  enabled: boolean;
@@ -140,6 +141,7 @@ interface SdkConfig {
140
141
  showClock: boolean;
141
142
  showCloseGame: boolean;
142
143
  showCurrency: boolean;
144
+ showDeconstructedBet: boolean;
143
145
  showFastPlay: boolean;
144
146
  showFeatureBuy: boolean;
145
147
  showFeatureIntro: boolean;
@@ -375,6 +377,9 @@ type SdkOnlyMessagePayloadMap = {
375
377
  freeRoundsPopup: never;
376
378
  };
377
379
  type WrapperOnlyMessagePayloadMap = {
380
+ balance: {
381
+ balance: number;
382
+ };
378
383
  bet: Bet;
379
384
  cashier: Cashier;
380
385
  close: never;
@@ -383,11 +388,11 @@ type WrapperOnlyMessagePayloadMap = {
383
388
  freeze: never;
384
389
  history: History;
385
390
  resume: never;
386
- state: WrapperState;
387
391
  suspend: never;
388
392
  unfreeze: never;
389
393
  legalBets: Record<number, number[]>;
390
394
  play: PlayRequestEnhanced;
395
+ playReady: never;
391
396
  freeRounds: FreeRoundsAction;
392
397
  freeRoundsOffer: FreeRound;
393
398
  freeRoundsInfo: FreeRound;
@@ -468,7 +468,7 @@ function formatCurrencyPure(config, number, { as, from } = {
468
468
  from: CurrencyNumber.Money
469
469
  }, formatOptions) {
470
470
  if (!["string", "number"].includes(typeof number)) return "NaN";
471
- const { canShowCurrency = true, coinValueInCents, currency, locales } = config;
471
+ const { canShowCurrency = true, coinValueInCents = 1, currency, locales } = config;
472
472
  if (from === CurrencyNumber.Coins) number = coinsToMoney(+number, coinValueInCents);
473
473
  try {
474
474
  const options = getCurrencyNumberFormatOptions(currency);
@@ -2,7 +2,7 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- import { A as OpenGameRequest, C as FreeRoundsResponse, N as PlayRequestEnhanced, P as PlayResponse, S as FreeRoundsRequest, W as RgsErrorWithType, _ as ForwardToPluginsMessagePayload, c as ContractPlayPayload, f as DomainMessagePayload, h as ForwardToPluginsMessage, it as WrapperState, j as OpenGameResponse, nt as WrapperConfig, q as SdkConfig, t as I18n, u as DomainMessage, w as GetBalanceResponse } from "./i18n-D5qNV_RZ.js";
5
+ import { A as OpenGameRequest, C as FreeRoundsResponse, N as PlayRequestEnhanced, P as PlayResponse, S as FreeRoundsRequest, W as RgsErrorWithType, _ as ForwardToPluginsMessagePayload, c as ContractPlayPayload, f as DomainMessagePayload, h as ForwardToPluginsMessage, it as WrapperState, j as OpenGameResponse, nt as WrapperConfig, q as SdkConfig, t as I18n, u as DomainMessage, w as GetBalanceResponse } from "./i18n-DK-Smr79.cjs";
6
6
 
7
7
  //#region src/common/logger.d.ts
8
8
  declare function createLogger(prefix: string, style: string): (message: string, ...args: any[]) => void;
@@ -60,8 +60,9 @@ declare abstract class RgsPlugin extends WithLogger {
60
60
  static LOG_STYLES: string;
61
61
  config: WrapperConfig;
62
62
  sdkConfig: SdkConfig;
63
+ state: WrapperState;
63
64
  error?: RgsErrorWithType;
64
- constructor(config: WrapperConfig, sdkConfig: SdkConfig);
65
+ constructor(config: WrapperConfig, sdkConfig: SdkConfig, state: WrapperState);
65
66
  protected on<M extends DomainMessage<'wrapper'> | ForwardToPluginsMessage<'rgs'>>(message: M, listener: (payload: M extends DomainMessage<'wrapper'> ? DomainMessagePayload<'wrapper', M> : M extends ForwardToPluginsMessage<'rgs'> ? ForwardToPluginsMessagePayload<'rgs', M> : never) => void, options?: AddEventListenerOptions): () => void;
66
67
  protected send<M extends DomainMessage<'rgs'>>(message: M, ...[payload]: DomainMessagePayload<'rgs', M> extends never ? [] : undefined extends DomainMessagePayload<'rgs', M> ? [] | [DomainMessagePayload<'rgs', M>] : [DomainMessagePayload<'rgs', M>]): void;
67
68
  openGame(payload: OpenGameRequest): Promise<OpenGameResponse>;
@@ -2,7 +2,7 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- import { A as OpenGameRequest, C as FreeRoundsResponse, N as PlayRequestEnhanced, P as PlayResponse, S as FreeRoundsRequest, W as RgsErrorWithType, _ as ForwardToPluginsMessagePayload, c as ContractPlayPayload, f as DomainMessagePayload, h as ForwardToPluginsMessage, it as WrapperState, j as OpenGameResponse, nt as WrapperConfig, q as SdkConfig, t as I18n, u as DomainMessage, w as GetBalanceResponse } from "./i18n-ChV9TVRC.cjs";
5
+ import { A as OpenGameRequest, C as FreeRoundsResponse, N as PlayRequestEnhanced, P as PlayResponse, S as FreeRoundsRequest, W as RgsErrorWithType, _ as ForwardToPluginsMessagePayload, c as ContractPlayPayload, f as DomainMessagePayload, h as ForwardToPluginsMessage, it as WrapperState, j as OpenGameResponse, nt as WrapperConfig, q as SdkConfig, t as I18n, u as DomainMessage, w as GetBalanceResponse } from "./i18n-BtKlSq1-.js";
6
6
 
7
7
  //#region src/common/logger.d.ts
8
8
  declare function createLogger(prefix: string, style: string): (message: string, ...args: any[]) => void;
@@ -60,8 +60,9 @@ declare abstract class RgsPlugin extends WithLogger {
60
60
  static LOG_STYLES: string;
61
61
  config: WrapperConfig;
62
62
  sdkConfig: SdkConfig;
63
+ state: WrapperState;
63
64
  error?: RgsErrorWithType;
64
- constructor(config: WrapperConfig, sdkConfig: SdkConfig);
65
+ constructor(config: WrapperConfig, sdkConfig: SdkConfig, state: WrapperState);
65
66
  protected on<M extends DomainMessage<'wrapper'> | ForwardToPluginsMessage<'rgs'>>(message: M, listener: (payload: M extends DomainMessage<'wrapper'> ? DomainMessagePayload<'wrapper', M> : M extends ForwardToPluginsMessage<'rgs'> ? ForwardToPluginsMessagePayload<'rgs', M> : never) => void, options?: AddEventListenerOptions): () => void;
66
67
  protected send<M extends DomainMessage<'rgs'>>(message: M, ...[payload]: DomainMessagePayload<'rgs', M> extends never ? [] : undefined extends DomainMessagePayload<'rgs', M> ? [] | [DomainMessagePayload<'rgs', M>] : [DomainMessagePayload<'rgs', M>]): void;
67
68
  openGame(payload: OpenGameRequest): Promise<OpenGameResponse>;
package/dist/index.cjs CHANGED
@@ -2,8 +2,9 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
6
  const require_errors = require('./errors-BUjKnbx5.cjs');
6
- const require_i18n = require('./i18n-PWy1viak.cjs');
7
+ const require_i18n = require('./i18n-By5KuEqp.cjs');
7
8
  let lodash_es = require("lodash-es");
8
9
 
9
10
  //#region src/sdk/KalambaSdk.ts
package/dist/index.d.cts CHANGED
@@ -2,7 +2,7 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- import { $ as ToRgsPluginsForwardedMessageMap, A as OpenGameRequest, B as PrefixedMessagePayload, C as FreeRoundsResponse, D as MessageMap, E as Message, F as PluginDomain, G as RgsOnlyMessagePayloadMap, H as RealityCheckConfig, I as PrefixedForwardToPluginsMessage, J as SdkError, K as RgsResponse, L as PrefixedMessage, M as PlayRequest, N as PlayRequestEnhanced, O as MessageMessageEvent, P as PlayResponse, Q as ToCasinoPluginsForwardedMessageMap, R as PrefixedMessageMap, S as FreeRoundsRequest, T as History, U as RgsErrorData, V as PrefixedMessagePayloadMap, W as RgsErrorWithType, X as Settings, Y as SdkOnlyMessagePayloadMap, Z as TelemetryOnlyMessagePayloadMap, _ as ForwardToPluginsMessagePayload, a as CashierConfig, b as FreeRound, c as ContractPlayPayload, ct as TimeoutError, d as DomainMessageMessageEvent, dt as FormatCurrencyOptions, et as ToSdkForwardedMessageMap, f as DomainMessagePayload, g as ForwardToPluginsMessageMap, h as ForwardToPluginsMessage, i as Cashier, it as WrapperState, j as OpenGameResponse, k as MessagePayload, l as DomainAllowedPayloadMap, lt as CurrencyFormat, m as DomainToMessagePayloadMap, n as AutoplayLimit, nt as WrapperConfig, o as CasinoOnlyMessagePayloadMap, ot as RgsError, p as DomainPrefix, q as SdkConfig, r as Bet, rt as WrapperOnlyMessagePayloadMap, s as ContractOpenGamePayload, st as RgsErrorCode, t as I18n, tt as ToTelemetryPluginsForwardedMessageMap, u as DomainMessage, ut as CurrencyNumber, v as ForwardToSdkMessage, w as GetBalanceResponse, x as FreeRoundsAction, y as ForwardToSdkMessagePayload, z as PrefixedMessageMessageEvent } from "./i18n-ChV9TVRC.cjs";
5
+ import { $ as ToRgsPluginsForwardedMessageMap, A as OpenGameRequest, B as PrefixedMessagePayload, C as FreeRoundsResponse, D as MessageMap, E as Message, F as PluginDomain, G as RgsOnlyMessagePayloadMap, H as RealityCheckConfig, I as PrefixedForwardToPluginsMessage, J as SdkError, K as RgsResponse, L as PrefixedMessage, M as PlayRequest, N as PlayRequestEnhanced, O as MessageMessageEvent, P as PlayResponse, Q as ToCasinoPluginsForwardedMessageMap, R as PrefixedMessageMap, S as FreeRoundsRequest, T as History, U as RgsErrorData, V as PrefixedMessagePayloadMap, W as RgsErrorWithType, X as Settings, Y as SdkOnlyMessagePayloadMap, Z as TelemetryOnlyMessagePayloadMap, _ as ForwardToPluginsMessagePayload, a as CashierConfig, b as FreeRound, c as ContractPlayPayload, ct as TimeoutError, d as DomainMessageMessageEvent, dt as FormatCurrencyOptions, et as ToSdkForwardedMessageMap, f as DomainMessagePayload, g as ForwardToPluginsMessageMap, h as ForwardToPluginsMessage, i as Cashier, it as WrapperState, j as OpenGameResponse, k as MessagePayload, l as DomainAllowedPayloadMap, lt as CurrencyFormat, m as DomainToMessagePayloadMap, n as AutoplayLimit, nt as WrapperConfig, o as CasinoOnlyMessagePayloadMap, ot as RgsError, p as DomainPrefix, q as SdkConfig, r as Bet, rt as WrapperOnlyMessagePayloadMap, s as ContractOpenGamePayload, st as RgsErrorCode, t as I18n, tt as ToTelemetryPluginsForwardedMessageMap, u as DomainMessage, ut as CurrencyNumber, v as ForwardToSdkMessage, w as GetBalanceResponse, x as FreeRoundsAction, y as ForwardToSdkMessagePayload, z as PrefixedMessageMessageEvent } from "./i18n-DK-Smr79.cjs";
6
6
 
7
7
  //#region src/sdk/KalambaSdk.d.ts
8
8
  type MessageType = 'openGame' | 'play';
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- import { $ as ToRgsPluginsForwardedMessageMap, A as OpenGameRequest, B as PrefixedMessagePayload, C as FreeRoundsResponse, D as MessageMap, E as Message, F as PluginDomain, G as RgsOnlyMessagePayloadMap, H as RealityCheckConfig, I as PrefixedForwardToPluginsMessage, J as SdkError, K as RgsResponse, L as PrefixedMessage, M as PlayRequest, N as PlayRequestEnhanced, O as MessageMessageEvent, P as PlayResponse, Q as ToCasinoPluginsForwardedMessageMap, R as PrefixedMessageMap, S as FreeRoundsRequest, T as History, U as RgsErrorData, V as PrefixedMessagePayloadMap, W as RgsErrorWithType, X as Settings, Y as SdkOnlyMessagePayloadMap, Z as TelemetryOnlyMessagePayloadMap, _ as ForwardToPluginsMessagePayload, a as CashierConfig, b as FreeRound, c as ContractPlayPayload, ct as TimeoutError, d as DomainMessageMessageEvent, dt as FormatCurrencyOptions, et as ToSdkForwardedMessageMap, f as DomainMessagePayload, g as ForwardToPluginsMessageMap, h as ForwardToPluginsMessage, i as Cashier, it as WrapperState, j as OpenGameResponse, k as MessagePayload, l as DomainAllowedPayloadMap, lt as CurrencyFormat, m as DomainToMessagePayloadMap, n as AutoplayLimit, nt as WrapperConfig, o as CasinoOnlyMessagePayloadMap, ot as RgsError, p as DomainPrefix, q as SdkConfig, r as Bet, rt as WrapperOnlyMessagePayloadMap, s as ContractOpenGamePayload, st as RgsErrorCode, t as I18n, tt as ToTelemetryPluginsForwardedMessageMap, u as DomainMessage, ut as CurrencyNumber, v as ForwardToSdkMessage, w as GetBalanceResponse, x as FreeRoundsAction, y as ForwardToSdkMessagePayload, z as PrefixedMessageMessageEvent } from "./i18n-D5qNV_RZ.js";
5
+ import { $ as ToRgsPluginsForwardedMessageMap, A as OpenGameRequest, B as PrefixedMessagePayload, C as FreeRoundsResponse, D as MessageMap, E as Message, F as PluginDomain, G as RgsOnlyMessagePayloadMap, H as RealityCheckConfig, I as PrefixedForwardToPluginsMessage, J as SdkError, K as RgsResponse, L as PrefixedMessage, M as PlayRequest, N as PlayRequestEnhanced, O as MessageMessageEvent, P as PlayResponse, Q as ToCasinoPluginsForwardedMessageMap, R as PrefixedMessageMap, S as FreeRoundsRequest, T as History, U as RgsErrorData, V as PrefixedMessagePayloadMap, W as RgsErrorWithType, X as Settings, Y as SdkOnlyMessagePayloadMap, Z as TelemetryOnlyMessagePayloadMap, _ as ForwardToPluginsMessagePayload, a as CashierConfig, b as FreeRound, c as ContractPlayPayload, ct as TimeoutError, d as DomainMessageMessageEvent, dt as FormatCurrencyOptions, et as ToSdkForwardedMessageMap, f as DomainMessagePayload, g as ForwardToPluginsMessageMap, h as ForwardToPluginsMessage, i as Cashier, it as WrapperState, j as OpenGameResponse, k as MessagePayload, l as DomainAllowedPayloadMap, lt as CurrencyFormat, m as DomainToMessagePayloadMap, n as AutoplayLimit, nt as WrapperConfig, o as CasinoOnlyMessagePayloadMap, ot as RgsError, p as DomainPrefix, q as SdkConfig, r as Bet, rt as WrapperOnlyMessagePayloadMap, s as ContractOpenGamePayload, st as RgsErrorCode, t as I18n, tt as ToTelemetryPluginsForwardedMessageMap, u as DomainMessage, ut as CurrencyNumber, v as ForwardToSdkMessage, w as GetBalanceResponse, x as FreeRoundsAction, y as ForwardToSdkMessagePayload, z as PrefixedMessageMessageEvent } from "./i18n-BtKlSq1-.js";
6
6
 
7
7
  //#region src/sdk/KalambaSdk.d.ts
8
8
  type MessageType = 'openGame' | 'play';
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
5
  import { i as TimeoutError, r as RgsErrorCode, t as RgsError } from "./errors-CakYyMwc.js";
6
- import { t as I18n } from "./i18n-ChMSjf9e.js";
6
+ import { t as I18n } from "./i18n-x1i0_DY3.js";
7
7
  import { merge } from "lodash-es";
8
8
 
9
9
  //#region src/sdk/KalambaSdk.ts
package/dist/plugins.cjs CHANGED
@@ -2,7 +2,8 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- const require_i18n = require('./i18n-PWy1viak.cjs');
5
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6
+ const require_i18n = require('./i18n-By5KuEqp.cjs');
6
7
  const require_logger = require('./logger-BR4jdx4T.cjs');
7
8
 
8
9
  //#region src/plugins/CasinoPlugin.ts
@@ -44,11 +45,13 @@ var RgsPlugin = class extends require_logger.WithLogger {
44
45
  static LOG_STYLES = "color:#aa0000;font-weight:bold;";
45
46
  config;
46
47
  sdkConfig;
48
+ state;
47
49
  error;
48
- constructor(config, sdkConfig) {
50
+ constructor(config, sdkConfig, state) {
49
51
  super();
50
52
  this.config = config;
51
53
  this.sdkConfig = sdkConfig;
54
+ this.state = state;
52
55
  this.on("openGame", async (payload) => {
53
56
  try {
54
57
  this.error = void 0;
@@ -160,10 +163,9 @@ var Tracker = class extends require_logger.WithLogger {
160
163
  this.sdkConfig = sdkConfig;
161
164
  }
162
165
  };
163
- var Tracker_default = Tracker;
164
166
 
165
167
  //#endregion
166
168
  exports.CasinoPlugin = CasinoPlugin;
167
169
  exports.RgsPlugin = RgsPlugin;
168
170
  exports.TelemetryPlugin = TelemetryPlugin;
169
- exports.Tracker = Tracker_default;
171
+ exports.Tracker = Tracker;
@@ -2,5 +2,5 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- import { i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-BzPOroT0.cjs";
5
+ import { i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-COZddK-N.cjs";
6
6
  export { CasinoPlugin, RgsPlugin, TelemetryPlugin, Tracker };
package/dist/plugins.d.ts CHANGED
@@ -2,5 +2,5 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- import { i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-D3qNaa1S.js";
5
+ import { i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-Ddzn0JlB.js";
6
6
  export { CasinoPlugin, RgsPlugin, TelemetryPlugin, Tracker };
package/dist/plugins.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- import { t as I18n } from "./i18n-ChMSjf9e.js";
5
+ import { t as I18n } from "./i18n-x1i0_DY3.js";
6
6
  import { t as WithLogger } from "./logger-f0OQvO5X.js";
7
7
 
8
8
  //#region src/plugins/CasinoPlugin.ts
@@ -44,11 +44,13 @@ var RgsPlugin = class extends WithLogger {
44
44
  static LOG_STYLES = "color:#aa0000;font-weight:bold;";
45
45
  config;
46
46
  sdkConfig;
47
+ state;
47
48
  error;
48
- constructor(config, sdkConfig) {
49
+ constructor(config, sdkConfig, state) {
49
50
  super();
50
51
  this.config = config;
51
52
  this.sdkConfig = sdkConfig;
53
+ this.state = state;
52
54
  this.on("openGame", async (payload) => {
53
55
  try {
54
56
  this.error = void 0;
@@ -160,7 +162,6 @@ var Tracker = class extends WithLogger {
160
162
  this.sdkConfig = sdkConfig;
161
163
  }
162
164
  };
163
- var Tracker_default = Tracker;
164
165
 
165
166
  //#endregion
166
- export { CasinoPlugin, RgsPlugin, TelemetryPlugin, Tracker_default as Tracker };
167
+ export { CasinoPlugin, RgsPlugin, TelemetryPlugin, Tracker };
package/dist/wrapper.cjs CHANGED
@@ -2,8 +2,10 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
6
  const require_errors = require('./errors-BUjKnbx5.cjs');
6
7
  let lodash_es = require("lodash-es");
8
+ let zustand_vanilla = require("zustand/vanilla");
7
9
  let uuid = require("uuid");
8
10
 
9
11
  //#region src/common/PayloadInjectionManager.ts
@@ -58,17 +60,19 @@ var KalambaSdkWrapper = class {
58
60
  showBars: true,
59
61
  skipErrors: []
60
62
  };
61
- #state = {
63
+ #store = (0, zustand_vanilla.createStore)(() => ({
62
64
  isSdkConfigured: false,
63
65
  balance: 0,
64
66
  bet: {
65
67
  base: 0,
66
68
  multiplier: 0
67
69
  },
70
+ updateBalance: true,
68
71
  openGameResponse: void 0,
69
72
  lastPlayResponse: void 0,
70
- freeRoundId: void 0
71
- };
73
+ freeRoundId: void 0,
74
+ playBlockers: []
75
+ }));
72
76
  #sdkConfigManager;
73
77
  #payloadInjectionManager;
74
78
  #wakeLock;
@@ -78,7 +82,7 @@ var KalambaSdkWrapper = class {
78
82
  this.#payloadInjectionManager = new PayloadInjectionManager();
79
83
  this.injectPayload = this.injectPayload.bind(this);
80
84
  this.#plugins = {
81
- rgs: new plugins.rgs(this.config, this.sdkConfig),
85
+ rgs: new plugins.rgs(this.config, this.sdkConfig, this.state),
82
86
  casino: plugins.casino.map((casinoPlugin) => new casinoPlugin(this.config, this.sdkConfig, this.state, this.injectPayload)),
83
87
  telemetry: plugins.telemetry.map(({ plugin, trackers }) => new plugin(trackers.map((tracker) => new tracker(this.config, this.sdkConfig)), this.config, this.sdkConfig))
84
88
  };
@@ -97,12 +101,13 @@ var KalambaSdkWrapper = class {
97
101
  this.on("sdk:playCycleStart", async () => {
98
102
  await this.requestWakeLock();
99
103
  if (this.state.freeRoundId) return;
104
+ this.send("balance", { balance: this.state.balance - this.state.bet.base * this.state.bet.multiplier });
105
+ });
106
+ this.on("sdk:play", async (payload) => {
100
107
  this.setState((state) => ({
101
108
  ...state,
102
- balance: state.balance - state.bet.base * state.bet.multiplier
109
+ playBlockers: []
103
110
  }));
104
- });
105
- this.on("sdk:play", async (payload) => {
106
111
  const payloadToInject = await this.#payloadInjectionManager.getPayload(payload.contract);
107
112
  this.send("play", {
108
113
  ...payload,
@@ -117,14 +122,6 @@ var KalambaSdkWrapper = class {
117
122
  if (freeRound && this.state.freeRoundId) this.send("freeRoundsInfo", freeRound);
118
123
  });
119
124
  this.on("rgs:openGameResponse", async (response) => {
120
- this.setState((state) => ({
121
- ...state,
122
- openGameResponse: response.contract
123
- }));
124
- if (this.sdkConfig.api.integration !== "bspot") this.setState((state) => ({
125
- ...state,
126
- balance: response.contract.balance.coins
127
- }));
128
125
  this.on("playReady", () => {
129
126
  this.handleFreeRounds(response.contract.freeRounds[0]);
130
127
  });
@@ -134,6 +131,13 @@ var KalambaSdkWrapper = class {
134
131
  isSdkConfigured: true
135
132
  }));
136
133
  this.send("configured", this.sdkConfig);
134
+ this.send("legalBets", response.contract.bet.available);
135
+ this.send("bet", response.contract.bet.lastPaid ?? response.contract.bet.default);
136
+ this.setState((state) => ({
137
+ ...state,
138
+ openGameResponse: response.contract
139
+ }));
140
+ if (this.state.updateBalance) this.send("balance", { balance: response.contract.balance.coins });
137
141
  });
138
142
  this.on("rgs:openGameError", async (error) => {
139
143
  if (error.type === "timeout" && !this.config.skipErrors.includes("TIMEOUT")) this.send("error", {
@@ -153,12 +157,13 @@ var KalambaSdkWrapper = class {
153
157
  lastPlayResponse: response.contract
154
158
  }));
155
159
  });
160
+ this.on("playEnd", async () => {
161
+ await Promise.all(this.state.playBlockers);
162
+ this.send("playReady");
163
+ });
156
164
  this.on("playCycleEnd", () => {
157
165
  this.releaseWakeLock();
158
- if (this.sdkConfig.api.integration !== "bspot") this.setState((state) => ({
159
- ...state,
160
- balance: this.state.lastPlayResponse.balance.coins
161
- }));
166
+ if (this.state.updateBalance) this.send("balance", { balance: this.state.lastPlayResponse.balance.coins });
162
167
  this.handleFreeRounds(this.state.lastPlayResponse.freeRounds[0]);
163
168
  });
164
169
  this.on("rgs:playError", async (error) => {
@@ -198,13 +203,24 @@ var KalambaSdkWrapper = class {
198
203
  }
199
204
  get state() {
200
205
  const that = this;
201
- return new Proxy({}, { get(_target, prop) {
202
- return Reflect.get(that.#state, prop);
203
- } });
206
+ return new Proxy({}, {
207
+ get(_target, prop) {
208
+ return Reflect.get(that.#store.getState(), prop);
209
+ },
210
+ set(_target, prop, value) {
211
+ that.setState((state) => ({
212
+ ...state,
213
+ [prop]: value
214
+ }));
215
+ return true;
216
+ }
217
+ });
204
218
  }
205
219
  setState(setter) {
206
- this.#state = setter(this.#state);
207
- this.send("state", this.#state);
220
+ this.#store.setState(setter(this.#store.getState()));
221
+ }
222
+ subscribe(listener) {
223
+ return this.#store.subscribe(listener);
208
224
  }
209
225
  forwardMessages() {
210
226
  this.forwardToPlugins("casino", [
@@ -441,6 +457,7 @@ var SdkConfigManager = class {
441
457
  showClock: false,
442
458
  showCloseGame: false,
443
459
  showCurrency: true,
460
+ showDeconstructedBet: false,
444
461
  showFastPlay: false,
445
462
  showFeatureBuy: false,
446
463
  showFeatureIntro: false,
@@ -561,7 +578,10 @@ function jurisdictionConfigOverrides(config, jurisdiction) {
561
578
  },
562
579
  minimumSpinDuration: 3
563
580
  };
564
- case "IT": return { feature: { showPaylineLines: true } };
581
+ case "IT": return { feature: {
582
+ showDeconstructedBet: true,
583
+ showPaylineLines: true
584
+ } };
565
585
  case "NL": return {
566
586
  autoplay: { enabled: false },
567
587
  feature: { showFeatureBuy: false }
@@ -692,6 +712,7 @@ var KalambaSdkConfigManager = class extends SdkConfigManager {
692
712
  showClock: config.badge.showClock,
693
713
  showCloseGame: config.badge.showCloseGameButton && (!config.badge.showCloseGameButtonOptional || !!this.config.api.homeUrl),
694
714
  showCurrency: config.badge.showCurrency,
715
+ showDeconstructedBet: config.badge.showDeconstructedBet,
695
716
  showFastPlay: config.badge.showTurboButton,
696
717
  showFeatureBuy: config.badge.showHyperBonus,
697
718
  showFunModeBanner: config.badge.showFunBanner,
@@ -2,8 +2,8 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- import { E as Message, at as DeepPartial, b as FreeRound, f as DomainMessagePayload, it as WrapperState, k as MessagePayload, nt as WrapperConfig, q as SdkConfig, u as DomainMessage } from "./i18n-ChV9TVRC.cjs";
6
- import { a as PayloadInjectionManager, i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-BzPOroT0.cjs";
5
+ import { E as Message, at as DeepPartial, b as FreeRound, f as DomainMessagePayload, it as WrapperState, k as MessagePayload, nt as WrapperConfig, q as SdkConfig, u as DomainMessage } from "./i18n-DK-Smr79.cjs";
6
+ import { a as PayloadInjectionManager, i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-COZddK-N.cjs";
7
7
 
8
8
  //#region src/common/config/SdkConfigManager.d.ts
9
9
  declare abstract class SdkConfigManager {
@@ -37,6 +37,7 @@ declare class KalambaSdkWrapper {
37
37
  });
38
38
  get state(): WrapperState;
39
39
  setState(setter: (currentState: WrapperState) => WrapperState): void;
40
+ subscribe(listener: (state: WrapperState) => void): () => void;
40
41
  forwardMessages(): void;
41
42
  get config(): WrapperConfig;
42
43
  get sdkConfig(): SdkConfig;
package/dist/wrapper.d.ts CHANGED
@@ -2,8 +2,8 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- import { E as Message, at as DeepPartial, b as FreeRound, f as DomainMessagePayload, it as WrapperState, k as MessagePayload, nt as WrapperConfig, q as SdkConfig, u as DomainMessage } from "./i18n-D5qNV_RZ.js";
6
- import { a as PayloadInjectionManager, i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-D3qNaa1S.js";
5
+ import { E as Message, at as DeepPartial, b as FreeRound, f as DomainMessagePayload, it as WrapperState, k as MessagePayload, nt as WrapperConfig, q as SdkConfig, u as DomainMessage } from "./i18n-BtKlSq1-.js";
6
+ import { a as PayloadInjectionManager, i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-Ddzn0JlB.js";
7
7
 
8
8
  //#region src/common/config/SdkConfigManager.d.ts
9
9
  declare abstract class SdkConfigManager {
@@ -37,6 +37,7 @@ declare class KalambaSdkWrapper {
37
37
  });
38
38
  get state(): WrapperState;
39
39
  setState(setter: (currentState: WrapperState) => WrapperState): void;
40
+ subscribe(listener: (state: WrapperState) => void): () => void;
40
41
  forwardMessages(): void;
41
42
  get config(): WrapperConfig;
42
43
  get sdkConfig(): SdkConfig;
package/dist/wrapper.js CHANGED
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import { n as RgsErrorAction } from "./errors-CakYyMwc.js";
6
6
  import { flow, merge, sortBy, sortedUniq } from "lodash-es";
7
+ import { createStore } from "zustand/vanilla";
7
8
  import { v4 } from "uuid";
8
9
 
9
10
  //#region src/common/PayloadInjectionManager.ts
@@ -58,17 +59,19 @@ var KalambaSdkWrapper = class {
58
59
  showBars: true,
59
60
  skipErrors: []
60
61
  };
61
- #state = {
62
+ #store = createStore(() => ({
62
63
  isSdkConfigured: false,
63
64
  balance: 0,
64
65
  bet: {
65
66
  base: 0,
66
67
  multiplier: 0
67
68
  },
69
+ updateBalance: true,
68
70
  openGameResponse: void 0,
69
71
  lastPlayResponse: void 0,
70
- freeRoundId: void 0
71
- };
72
+ freeRoundId: void 0,
73
+ playBlockers: []
74
+ }));
72
75
  #sdkConfigManager;
73
76
  #payloadInjectionManager;
74
77
  #wakeLock;
@@ -78,7 +81,7 @@ var KalambaSdkWrapper = class {
78
81
  this.#payloadInjectionManager = new PayloadInjectionManager();
79
82
  this.injectPayload = this.injectPayload.bind(this);
80
83
  this.#plugins = {
81
- rgs: new plugins.rgs(this.config, this.sdkConfig),
84
+ rgs: new plugins.rgs(this.config, this.sdkConfig, this.state),
82
85
  casino: plugins.casino.map((casinoPlugin) => new casinoPlugin(this.config, this.sdkConfig, this.state, this.injectPayload)),
83
86
  telemetry: plugins.telemetry.map(({ plugin, trackers }) => new plugin(trackers.map((tracker) => new tracker(this.config, this.sdkConfig)), this.config, this.sdkConfig))
84
87
  };
@@ -97,12 +100,13 @@ var KalambaSdkWrapper = class {
97
100
  this.on("sdk:playCycleStart", async () => {
98
101
  await this.requestWakeLock();
99
102
  if (this.state.freeRoundId) return;
103
+ this.send("balance", { balance: this.state.balance - this.state.bet.base * this.state.bet.multiplier });
104
+ });
105
+ this.on("sdk:play", async (payload) => {
100
106
  this.setState((state) => ({
101
107
  ...state,
102
- balance: state.balance - state.bet.base * state.bet.multiplier
108
+ playBlockers: []
103
109
  }));
104
- });
105
- this.on("sdk:play", async (payload) => {
106
110
  const payloadToInject = await this.#payloadInjectionManager.getPayload(payload.contract);
107
111
  this.send("play", {
108
112
  ...payload,
@@ -117,14 +121,6 @@ var KalambaSdkWrapper = class {
117
121
  if (freeRound && this.state.freeRoundId) this.send("freeRoundsInfo", freeRound);
118
122
  });
119
123
  this.on("rgs:openGameResponse", async (response) => {
120
- this.setState((state) => ({
121
- ...state,
122
- openGameResponse: response.contract
123
- }));
124
- if (this.sdkConfig.api.integration !== "bspot") this.setState((state) => ({
125
- ...state,
126
- balance: response.contract.balance.coins
127
- }));
128
124
  this.on("playReady", () => {
129
125
  this.handleFreeRounds(response.contract.freeRounds[0]);
130
126
  });
@@ -134,6 +130,13 @@ var KalambaSdkWrapper = class {
134
130
  isSdkConfigured: true
135
131
  }));
136
132
  this.send("configured", this.sdkConfig);
133
+ this.send("legalBets", response.contract.bet.available);
134
+ this.send("bet", response.contract.bet.lastPaid ?? response.contract.bet.default);
135
+ this.setState((state) => ({
136
+ ...state,
137
+ openGameResponse: response.contract
138
+ }));
139
+ if (this.state.updateBalance) this.send("balance", { balance: response.contract.balance.coins });
137
140
  });
138
141
  this.on("rgs:openGameError", async (error) => {
139
142
  if (error.type === "timeout" && !this.config.skipErrors.includes("TIMEOUT")) this.send("error", {
@@ -153,12 +156,13 @@ var KalambaSdkWrapper = class {
153
156
  lastPlayResponse: response.contract
154
157
  }));
155
158
  });
159
+ this.on("playEnd", async () => {
160
+ await Promise.all(this.state.playBlockers);
161
+ this.send("playReady");
162
+ });
156
163
  this.on("playCycleEnd", () => {
157
164
  this.releaseWakeLock();
158
- if (this.sdkConfig.api.integration !== "bspot") this.setState((state) => ({
159
- ...state,
160
- balance: this.state.lastPlayResponse.balance.coins
161
- }));
165
+ if (this.state.updateBalance) this.send("balance", { balance: this.state.lastPlayResponse.balance.coins });
162
166
  this.handleFreeRounds(this.state.lastPlayResponse.freeRounds[0]);
163
167
  });
164
168
  this.on("rgs:playError", async (error) => {
@@ -198,13 +202,24 @@ var KalambaSdkWrapper = class {
198
202
  }
199
203
  get state() {
200
204
  const that = this;
201
- return new Proxy({}, { get(_target, prop) {
202
- return Reflect.get(that.#state, prop);
203
- } });
205
+ return new Proxy({}, {
206
+ get(_target, prop) {
207
+ return Reflect.get(that.#store.getState(), prop);
208
+ },
209
+ set(_target, prop, value) {
210
+ that.setState((state) => ({
211
+ ...state,
212
+ [prop]: value
213
+ }));
214
+ return true;
215
+ }
216
+ });
204
217
  }
205
218
  setState(setter) {
206
- this.#state = setter(this.#state);
207
- this.send("state", this.#state);
219
+ this.#store.setState(setter(this.#store.getState()));
220
+ }
221
+ subscribe(listener) {
222
+ return this.#store.subscribe(listener);
208
223
  }
209
224
  forwardMessages() {
210
225
  this.forwardToPlugins("casino", [
@@ -441,6 +456,7 @@ var SdkConfigManager = class {
441
456
  showClock: false,
442
457
  showCloseGame: false,
443
458
  showCurrency: true,
459
+ showDeconstructedBet: false,
444
460
  showFastPlay: false,
445
461
  showFeatureBuy: false,
446
462
  showFeatureIntro: false,
@@ -561,7 +577,10 @@ function jurisdictionConfigOverrides(config, jurisdiction) {
561
577
  },
562
578
  minimumSpinDuration: 3
563
579
  };
564
- case "IT": return { feature: { showPaylineLines: true } };
580
+ case "IT": return { feature: {
581
+ showDeconstructedBet: true,
582
+ showPaylineLines: true
583
+ } };
565
584
  case "NL": return {
566
585
  autoplay: { enabled: false },
567
586
  feature: { showFeatureBuy: false }
@@ -692,6 +711,7 @@ var KalambaSdkConfigManager = class extends SdkConfigManager {
692
711
  showClock: config.badge.showClock,
693
712
  showCloseGame: config.badge.showCloseGameButton && (!config.badge.showCloseGameButtonOptional || !!this.config.api.homeUrl),
694
713
  showCurrency: config.badge.showCurrency,
714
+ showDeconstructedBet: config.badge.showDeconstructedBet,
695
715
  showFastPlay: config.badge.showTurboButton,
696
716
  showFeatureBuy: config.badge.showHyperBonus,
697
717
  showFunModeBanner: config.badge.showFunBanner,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kalamba/sdk",
3
- "version": "0.39.0",
3
+ "version": "0.43.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "type": "module",
6
6
  "files": [
@@ -38,7 +38,7 @@
38
38
  "lodash-es": "4.17.23",
39
39
  "uuid": "13.0.0",
40
40
  "zod": "4.3.6",
41
- "zustand": "5.0.9"
41
+ "zustand": "5.0.11"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/lodash-es": "4.17.12",
@@ -46,7 +46,7 @@
46
46
  "@types/react-dom": "19.1.6",
47
47
  "react": "19.1.0",
48
48
  "react-dom": "19.1.0",
49
- "tsdown": "0.20.1",
49
+ "tsdown": "0.20.3",
50
50
  "vitest": "3.2.4"
51
51
  },
52
52
  "scripts": {