@kalamba/sdk 0.39.0 → 0.42.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.
- package/dist/{i18n-ChV9TVRC.d.cts → i18n-40l1CUXq.d.ts} +2 -0
- package/dist/{i18n-PWy1viak.cjs → i18n-By5KuEqp.cjs} +1 -1
- package/dist/{i18n-D5qNV_RZ.d.ts → i18n-C9qVulRQ.d.cts} +2 -0
- package/dist/{i18n-ChMSjf9e.js → i18n-x1i0_DY3.js} +1 -1
- package/dist/{index-D3qNaa1S.d.ts → index-18Ae87g0.d.cts} +3 -2
- package/dist/{index-BzPOroT0.d.cts → index-DbbkVIkz.d.ts} +3 -2
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/plugins.cjs +6 -4
- package/dist/plugins.d.cts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +5 -4
- package/dist/wrapper.cjs +32 -14
- package/dist/wrapper.d.cts +2 -2
- package/dist/wrapper.d.ts +2 -2
- package/dist/wrapper.js +31 -14
- package/package.json +3 -3
|
@@ -80,6 +80,7 @@ type WrapperState = {
|
|
|
80
80
|
isSdkConfigured: boolean;
|
|
81
81
|
balance: number;
|
|
82
82
|
bet: Bet;
|
|
83
|
+
updateBalance: boolean;
|
|
83
84
|
openGameResponse?: OpenGameResponse['contract'];
|
|
84
85
|
lastPlayResponse?: PlayResponse['contract'];
|
|
85
86
|
freeRoundId?: string;
|
|
@@ -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;
|
|
@@ -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);
|
|
@@ -80,6 +80,7 @@ type WrapperState = {
|
|
|
80
80
|
isSdkConfigured: boolean;
|
|
81
81
|
balance: number;
|
|
82
82
|
bet: Bet;
|
|
83
|
+
updateBalance: boolean;
|
|
83
84
|
openGameResponse?: OpenGameResponse['contract'];
|
|
84
85
|
lastPlayResponse?: PlayResponse['contract'];
|
|
85
86
|
freeRoundId?: string;
|
|
@@ -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;
|
|
@@ -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-
|
|
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-C9qVulRQ.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-
|
|
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-40l1CUXq.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-
|
|
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-
|
|
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-C9qVulRQ.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-
|
|
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-40l1CUXq.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-
|
|
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
|
-
|
|
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 =
|
|
171
|
+
exports.Tracker = Tracker;
|
package/dist/plugins.d.cts
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-
|
|
5
|
+
import { i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-18Ae87g0.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-
|
|
5
|
+
import { i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-DbbkVIkz.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-
|
|
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,
|
|
167
|
+
export { CasinoPlugin, RgsPlugin, TelemetryPlugin, Tracker };
|
package/dist/wrapper.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
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");
|
|
7
8
|
let uuid = require("uuid");
|
|
@@ -65,6 +66,7 @@ var KalambaSdkWrapper = class {
|
|
|
65
66
|
base: 0,
|
|
66
67
|
multiplier: 0
|
|
67
68
|
},
|
|
69
|
+
updateBalance: true,
|
|
68
70
|
openGameResponse: void 0,
|
|
69
71
|
lastPlayResponse: void 0,
|
|
70
72
|
freeRoundId: void 0
|
|
@@ -78,7 +80,7 @@ var KalambaSdkWrapper = class {
|
|
|
78
80
|
this.#payloadInjectionManager = new PayloadInjectionManager();
|
|
79
81
|
this.injectPayload = this.injectPayload.bind(this);
|
|
80
82
|
this.#plugins = {
|
|
81
|
-
rgs: new plugins.rgs(this.config, this.sdkConfig),
|
|
83
|
+
rgs: new plugins.rgs(this.config, this.sdkConfig, this.state),
|
|
82
84
|
casino: plugins.casino.map((casinoPlugin) => new casinoPlugin(this.config, this.sdkConfig, this.state, this.injectPayload)),
|
|
83
85
|
telemetry: plugins.telemetry.map(({ plugin, trackers }) => new plugin(trackers.map((tracker) => new tracker(this.config, this.sdkConfig)), this.config, this.sdkConfig))
|
|
84
86
|
};
|
|
@@ -117,14 +119,6 @@ var KalambaSdkWrapper = class {
|
|
|
117
119
|
if (freeRound && this.state.freeRoundId) this.send("freeRoundsInfo", freeRound);
|
|
118
120
|
});
|
|
119
121
|
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
122
|
this.on("playReady", () => {
|
|
129
123
|
this.handleFreeRounds(response.contract.freeRounds[0]);
|
|
130
124
|
});
|
|
@@ -134,6 +128,16 @@ var KalambaSdkWrapper = class {
|
|
|
134
128
|
isSdkConfigured: true
|
|
135
129
|
}));
|
|
136
130
|
this.send("configured", this.sdkConfig);
|
|
131
|
+
this.send("legalBets", response.contract.bet.available);
|
|
132
|
+
this.send("bet", response.contract.bet.lastPaid ?? response.contract.bet.default);
|
|
133
|
+
this.setState((state) => ({
|
|
134
|
+
...state,
|
|
135
|
+
openGameResponse: response.contract
|
|
136
|
+
}));
|
|
137
|
+
if (this.state.updateBalance) this.setState((state) => ({
|
|
138
|
+
...state,
|
|
139
|
+
balance: response.contract.balance.coins
|
|
140
|
+
}));
|
|
137
141
|
});
|
|
138
142
|
this.on("rgs:openGameError", async (error) => {
|
|
139
143
|
if (error.type === "timeout" && !this.config.skipErrors.includes("TIMEOUT")) this.send("error", {
|
|
@@ -155,7 +159,7 @@ var KalambaSdkWrapper = class {
|
|
|
155
159
|
});
|
|
156
160
|
this.on("playCycleEnd", () => {
|
|
157
161
|
this.releaseWakeLock();
|
|
158
|
-
if (this.
|
|
162
|
+
if (this.state.updateBalance) this.setState((state) => ({
|
|
159
163
|
...state,
|
|
160
164
|
balance: this.state.lastPlayResponse.balance.coins
|
|
161
165
|
}));
|
|
@@ -198,9 +202,18 @@ var KalambaSdkWrapper = class {
|
|
|
198
202
|
}
|
|
199
203
|
get state() {
|
|
200
204
|
const that = this;
|
|
201
|
-
return new Proxy({}, {
|
|
202
|
-
|
|
203
|
-
|
|
205
|
+
return new Proxy({}, {
|
|
206
|
+
get(_target, prop) {
|
|
207
|
+
return Reflect.get(that.#state, 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
219
|
this.#state = setter(this.#state);
|
|
@@ -441,6 +454,7 @@ var SdkConfigManager = class {
|
|
|
441
454
|
showClock: false,
|
|
442
455
|
showCloseGame: false,
|
|
443
456
|
showCurrency: true,
|
|
457
|
+
showDeconstructedBet: false,
|
|
444
458
|
showFastPlay: false,
|
|
445
459
|
showFeatureBuy: false,
|
|
446
460
|
showFeatureIntro: false,
|
|
@@ -561,7 +575,10 @@ function jurisdictionConfigOverrides(config, jurisdiction) {
|
|
|
561
575
|
},
|
|
562
576
|
minimumSpinDuration: 3
|
|
563
577
|
};
|
|
564
|
-
case "IT": return { feature: {
|
|
578
|
+
case "IT": return { feature: {
|
|
579
|
+
showDeconstructedBet: true,
|
|
580
|
+
showPaylineLines: true
|
|
581
|
+
} };
|
|
565
582
|
case "NL": return {
|
|
566
583
|
autoplay: { enabled: false },
|
|
567
584
|
feature: { showFeatureBuy: false }
|
|
@@ -692,6 +709,7 @@ var KalambaSdkConfigManager = class extends SdkConfigManager {
|
|
|
692
709
|
showClock: config.badge.showClock,
|
|
693
710
|
showCloseGame: config.badge.showCloseGameButton && (!config.badge.showCloseGameButtonOptional || !!this.config.api.homeUrl),
|
|
694
711
|
showCurrency: config.badge.showCurrency,
|
|
712
|
+
showDeconstructedBet: config.badge.showDeconstructedBet,
|
|
695
713
|
showFastPlay: config.badge.showTurboButton,
|
|
696
714
|
showFeatureBuy: config.badge.showHyperBonus,
|
|
697
715
|
showFunModeBanner: config.badge.showFunBanner,
|
package/dist/wrapper.d.cts
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-
|
|
6
|
-
import { a as PayloadInjectionManager, i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-
|
|
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-C9qVulRQ.cjs";
|
|
6
|
+
import { a as PayloadInjectionManager, i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-18Ae87g0.cjs";
|
|
7
7
|
|
|
8
8
|
//#region src/common/config/SdkConfigManager.d.ts
|
|
9
9
|
declare abstract class SdkConfigManager {
|
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-
|
|
6
|
-
import { a as PayloadInjectionManager, i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-
|
|
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-40l1CUXq.js";
|
|
6
|
+
import { a as PayloadInjectionManager, i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-DbbkVIkz.js";
|
|
7
7
|
|
|
8
8
|
//#region src/common/config/SdkConfigManager.d.ts
|
|
9
9
|
declare abstract class SdkConfigManager {
|
package/dist/wrapper.js
CHANGED
|
@@ -65,6 +65,7 @@ var KalambaSdkWrapper = class {
|
|
|
65
65
|
base: 0,
|
|
66
66
|
multiplier: 0
|
|
67
67
|
},
|
|
68
|
+
updateBalance: true,
|
|
68
69
|
openGameResponse: void 0,
|
|
69
70
|
lastPlayResponse: void 0,
|
|
70
71
|
freeRoundId: void 0
|
|
@@ -78,7 +79,7 @@ var KalambaSdkWrapper = class {
|
|
|
78
79
|
this.#payloadInjectionManager = new PayloadInjectionManager();
|
|
79
80
|
this.injectPayload = this.injectPayload.bind(this);
|
|
80
81
|
this.#plugins = {
|
|
81
|
-
rgs: new plugins.rgs(this.config, this.sdkConfig),
|
|
82
|
+
rgs: new plugins.rgs(this.config, this.sdkConfig, this.state),
|
|
82
83
|
casino: plugins.casino.map((casinoPlugin) => new casinoPlugin(this.config, this.sdkConfig, this.state, this.injectPayload)),
|
|
83
84
|
telemetry: plugins.telemetry.map(({ plugin, trackers }) => new plugin(trackers.map((tracker) => new tracker(this.config, this.sdkConfig)), this.config, this.sdkConfig))
|
|
84
85
|
};
|
|
@@ -117,14 +118,6 @@ var KalambaSdkWrapper = class {
|
|
|
117
118
|
if (freeRound && this.state.freeRoundId) this.send("freeRoundsInfo", freeRound);
|
|
118
119
|
});
|
|
119
120
|
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
121
|
this.on("playReady", () => {
|
|
129
122
|
this.handleFreeRounds(response.contract.freeRounds[0]);
|
|
130
123
|
});
|
|
@@ -134,6 +127,16 @@ var KalambaSdkWrapper = class {
|
|
|
134
127
|
isSdkConfigured: true
|
|
135
128
|
}));
|
|
136
129
|
this.send("configured", this.sdkConfig);
|
|
130
|
+
this.send("legalBets", response.contract.bet.available);
|
|
131
|
+
this.send("bet", response.contract.bet.lastPaid ?? response.contract.bet.default);
|
|
132
|
+
this.setState((state) => ({
|
|
133
|
+
...state,
|
|
134
|
+
openGameResponse: response.contract
|
|
135
|
+
}));
|
|
136
|
+
if (this.state.updateBalance) this.setState((state) => ({
|
|
137
|
+
...state,
|
|
138
|
+
balance: response.contract.balance.coins
|
|
139
|
+
}));
|
|
137
140
|
});
|
|
138
141
|
this.on("rgs:openGameError", async (error) => {
|
|
139
142
|
if (error.type === "timeout" && !this.config.skipErrors.includes("TIMEOUT")) this.send("error", {
|
|
@@ -155,7 +158,7 @@ var KalambaSdkWrapper = class {
|
|
|
155
158
|
});
|
|
156
159
|
this.on("playCycleEnd", () => {
|
|
157
160
|
this.releaseWakeLock();
|
|
158
|
-
if (this.
|
|
161
|
+
if (this.state.updateBalance) this.setState((state) => ({
|
|
159
162
|
...state,
|
|
160
163
|
balance: this.state.lastPlayResponse.balance.coins
|
|
161
164
|
}));
|
|
@@ -198,9 +201,18 @@ var KalambaSdkWrapper = class {
|
|
|
198
201
|
}
|
|
199
202
|
get state() {
|
|
200
203
|
const that = this;
|
|
201
|
-
return new Proxy({}, {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
+
return new Proxy({}, {
|
|
205
|
+
get(_target, prop) {
|
|
206
|
+
return Reflect.get(that.#state, prop);
|
|
207
|
+
},
|
|
208
|
+
set(_target, prop, value) {
|
|
209
|
+
that.setState((state) => ({
|
|
210
|
+
...state,
|
|
211
|
+
[prop]: value
|
|
212
|
+
}));
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
204
216
|
}
|
|
205
217
|
setState(setter) {
|
|
206
218
|
this.#state = setter(this.#state);
|
|
@@ -441,6 +453,7 @@ var SdkConfigManager = class {
|
|
|
441
453
|
showClock: false,
|
|
442
454
|
showCloseGame: false,
|
|
443
455
|
showCurrency: true,
|
|
456
|
+
showDeconstructedBet: false,
|
|
444
457
|
showFastPlay: false,
|
|
445
458
|
showFeatureBuy: false,
|
|
446
459
|
showFeatureIntro: false,
|
|
@@ -561,7 +574,10 @@ function jurisdictionConfigOverrides(config, jurisdiction) {
|
|
|
561
574
|
},
|
|
562
575
|
minimumSpinDuration: 3
|
|
563
576
|
};
|
|
564
|
-
case "IT": return { feature: {
|
|
577
|
+
case "IT": return { feature: {
|
|
578
|
+
showDeconstructedBet: true,
|
|
579
|
+
showPaylineLines: true
|
|
580
|
+
} };
|
|
565
581
|
case "NL": return {
|
|
566
582
|
autoplay: { enabled: false },
|
|
567
583
|
feature: { showFeatureBuy: false }
|
|
@@ -692,6 +708,7 @@ var KalambaSdkConfigManager = class extends SdkConfigManager {
|
|
|
692
708
|
showClock: config.badge.showClock,
|
|
693
709
|
showCloseGame: config.badge.showCloseGameButton && (!config.badge.showCloseGameButtonOptional || !!this.config.api.homeUrl),
|
|
694
710
|
showCurrency: config.badge.showCurrency,
|
|
711
|
+
showDeconstructedBet: config.badge.showDeconstructedBet,
|
|
695
712
|
showFastPlay: config.badge.showTurboButton,
|
|
696
713
|
showFeatureBuy: config.badge.showHyperBonus,
|
|
697
714
|
showFunModeBanner: config.badge.showFunBanner,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kalamba/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.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.
|
|
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.
|
|
49
|
+
"tsdown": "0.20.3",
|
|
50
50
|
"vitest": "3.2.4"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|