@kalamba/sdk 0.37.0 → 0.38.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.
@@ -343,6 +343,11 @@ const CUSTOM_CURRENCIES = {
343
343
  maximumFractionDigits: 2,
344
344
  minimumFractionDigits: 2
345
345
  },
346
+ CMBC: {
347
+ displayAs: "CMB",
348
+ maximumFractionDigits: 2,
349
+ minimumFractionDigits: 2
350
+ },
346
351
  FC: {
347
352
  displayAs: "",
348
353
  maximumFractionDigits: 2,
@@ -216,6 +216,11 @@ type SdkError = {
216
216
  } | {
217
217
  messageKey: string;
218
218
  });
219
+ type OpenGameRequest = {
220
+ contract?: ContractOpenGamePayload;
221
+ extra?: unknown;
222
+ };
223
+ type ContractOpenGamePayload = Record<string, never>;
219
224
  type OpenGameResponse = {
220
225
  contract: {
221
226
  bet: {
@@ -342,7 +347,7 @@ type SdkOnlyMessagePayloadMap = {
342
347
  progress: number;
343
348
  };
344
349
  loadStart: never;
345
- openGame: never;
350
+ openGame: OpenGameRequest;
346
351
  play: PlayRequest;
347
352
  playCycleEnd: PlayResponse;
348
353
  playCycleStart: ContractPlayPayload;
@@ -522,4 +527,4 @@ declare class I18n {
522
527
  formatMoneyWithCurrency(amount: number | string, formatOptions?: Intl.NumberFormatOptions): string;
523
528
  }
524
529
  //#endregion
525
- export { ToTelemetryPluginsForwardedMessageMap as $, PlayRequest as A, RealityCheckConfig as B, GetBalanceResponse as C, MessageMessageEvent as D, MessageMap as E, PrefixedMessage as F, SdkConfig as G, RgsErrorWithType as H, PrefixedMessageMap as I, Settings as J, SdkError as K, PrefixedMessageMessageEvent as L, PlayResponse as M, PluginDomain as N, MessagePayload as O, PrefixedForwardToPluginsMessage as P, ToSdkForwardedMessageMap as Q, PrefixedMessagePayload as R, FreeRoundsResponse as S, Message as T, RgsOnlyMessagePayloadMap as U, RgsErrorData as V, RgsResponse as W, ToCasinoPluginsForwardedMessageMap as X, TelemetryOnlyMessagePayloadMap as Y, ToRgsPluginsForwardedMessageMap as Z, ForwardToSdkMessage as _, CashierConfig as a, RgsErrorCode as at, FreeRoundsAction as b, DomainAllowedPayloadMap as c, CurrencyNumber as ct, DomainMessagePayload as d, WrapperConfig as et, DomainPrefix as f, ForwardToPluginsMessagePayload as g, ForwardToPluginsMessageMap as h, Cashier as i, RgsError as it, PlayRequestEnhanced as j, OpenGameResponse as k, DomainMessage as l, FormatCurrencyOptions as lt, ForwardToPluginsMessage as m, AutoplayLimit as n, WrapperState as nt, CasinoOnlyMessagePayloadMap as o, TimeoutError as ot, DomainToMessagePayloadMap as p, SdkOnlyMessagePayloadMap as q, Bet as r, DeepPartial as rt, ContractPlayPayload as s, CurrencyFormat as st, I18n as t, WrapperOnlyMessagePayloadMap as tt, DomainMessageMessageEvent as u, ForwardToSdkMessagePayload as v, History as w, FreeRoundsRequest as x, FreeRound as y, PrefixedMessagePayloadMap as z };
530
+ export { ToRgsPluginsForwardedMessageMap as $, OpenGameRequest as A, PrefixedMessagePayload as B, FreeRoundsResponse as C, MessageMap as D, Message as E, PluginDomain as F, RgsOnlyMessagePayloadMap as G, RealityCheckConfig as H, PrefixedForwardToPluginsMessage as I, SdkError as J, RgsResponse as K, PrefixedMessage as L, PlayRequest as M, PlayRequestEnhanced as N, MessageMessageEvent as O, PlayResponse as P, ToCasinoPluginsForwardedMessageMap as Q, PrefixedMessageMap as R, FreeRoundsRequest as S, History as T, RgsErrorData as U, PrefixedMessagePayloadMap as V, RgsErrorWithType as W, Settings as X, SdkOnlyMessagePayloadMap as Y, TelemetryOnlyMessagePayloadMap as Z, ForwardToPluginsMessagePayload as _, CashierConfig as a, DeepPartial as at, FreeRound as b, ContractPlayPayload as c, TimeoutError as ct, DomainMessageMessageEvent as d, FormatCurrencyOptions as dt, ToSdkForwardedMessageMap as et, DomainMessagePayload as f, ForwardToPluginsMessageMap as g, ForwardToPluginsMessage as h, Cashier as i, WrapperState as it, OpenGameResponse as j, MessagePayload as k, DomainAllowedPayloadMap as l, CurrencyFormat as lt, DomainToMessagePayloadMap as m, AutoplayLimit as n, WrapperConfig as nt, CasinoOnlyMessagePayloadMap as o, RgsError as ot, DomainPrefix as p, SdkConfig as q, Bet as r, WrapperOnlyMessagePayloadMap as rt, ContractOpenGamePayload as s, RgsErrorCode as st, I18n as t, ToTelemetryPluginsForwardedMessageMap as tt, DomainMessage as u, CurrencyNumber as ut, ForwardToSdkMessage as v, GetBalanceResponse as w, FreeRoundsAction as x, ForwardToSdkMessagePayload as y, PrefixedMessageMessageEvent as z };
@@ -216,6 +216,11 @@ type SdkError = {
216
216
  } | {
217
217
  messageKey: string;
218
218
  });
219
+ type OpenGameRequest = {
220
+ contract?: ContractOpenGamePayload;
221
+ extra?: unknown;
222
+ };
223
+ type ContractOpenGamePayload = Record<string, never>;
219
224
  type OpenGameResponse = {
220
225
  contract: {
221
226
  bet: {
@@ -342,7 +347,7 @@ type SdkOnlyMessagePayloadMap = {
342
347
  progress: number;
343
348
  };
344
349
  loadStart: never;
345
- openGame: never;
350
+ openGame: OpenGameRequest;
346
351
  play: PlayRequest;
347
352
  playCycleEnd: PlayResponse;
348
353
  playCycleStart: ContractPlayPayload;
@@ -522,4 +527,4 @@ declare class I18n {
522
527
  formatMoneyWithCurrency(amount: number | string, formatOptions?: Intl.NumberFormatOptions): string;
523
528
  }
524
529
  //#endregion
525
- export { ToTelemetryPluginsForwardedMessageMap as $, PlayRequest as A, RealityCheckConfig as B, GetBalanceResponse as C, MessageMessageEvent as D, MessageMap as E, PrefixedMessage as F, SdkConfig as G, RgsErrorWithType as H, PrefixedMessageMap as I, Settings as J, SdkError as K, PrefixedMessageMessageEvent as L, PlayResponse as M, PluginDomain as N, MessagePayload as O, PrefixedForwardToPluginsMessage as P, ToSdkForwardedMessageMap as Q, PrefixedMessagePayload as R, FreeRoundsResponse as S, Message as T, RgsOnlyMessagePayloadMap as U, RgsErrorData as V, RgsResponse as W, ToCasinoPluginsForwardedMessageMap as X, TelemetryOnlyMessagePayloadMap as Y, ToRgsPluginsForwardedMessageMap as Z, ForwardToSdkMessage as _, CashierConfig as a, RgsErrorCode as at, FreeRoundsAction as b, DomainAllowedPayloadMap as c, CurrencyNumber as ct, DomainMessagePayload as d, WrapperConfig as et, DomainPrefix as f, ForwardToPluginsMessagePayload as g, ForwardToPluginsMessageMap as h, Cashier as i, RgsError as it, PlayRequestEnhanced as j, OpenGameResponse as k, DomainMessage as l, FormatCurrencyOptions as lt, ForwardToPluginsMessage as m, AutoplayLimit as n, WrapperState as nt, CasinoOnlyMessagePayloadMap as o, TimeoutError as ot, DomainToMessagePayloadMap as p, SdkOnlyMessagePayloadMap as q, Bet as r, DeepPartial as rt, ContractPlayPayload as s, CurrencyFormat as st, I18n as t, WrapperOnlyMessagePayloadMap as tt, DomainMessageMessageEvent as u, ForwardToSdkMessagePayload as v, History as w, FreeRoundsRequest as x, FreeRound as y, PrefixedMessagePayloadMap as z };
530
+ export { ToRgsPluginsForwardedMessageMap as $, OpenGameRequest as A, PrefixedMessagePayload as B, FreeRoundsResponse as C, MessageMap as D, Message as E, PluginDomain as F, RgsOnlyMessagePayloadMap as G, RealityCheckConfig as H, PrefixedForwardToPluginsMessage as I, SdkError as J, RgsResponse as K, PrefixedMessage as L, PlayRequest as M, PlayRequestEnhanced as N, MessageMessageEvent as O, PlayResponse as P, ToCasinoPluginsForwardedMessageMap as Q, PrefixedMessageMap as R, FreeRoundsRequest as S, History as T, RgsErrorData as U, PrefixedMessagePayloadMap as V, RgsErrorWithType as W, Settings as X, SdkOnlyMessagePayloadMap as Y, TelemetryOnlyMessagePayloadMap as Z, ForwardToPluginsMessagePayload as _, CashierConfig as a, DeepPartial as at, FreeRound as b, ContractPlayPayload as c, TimeoutError as ct, DomainMessageMessageEvent as d, FormatCurrencyOptions as dt, ToSdkForwardedMessageMap as et, DomainMessagePayload as f, ForwardToPluginsMessageMap as g, ForwardToPluginsMessage as h, Cashier as i, WrapperState as it, OpenGameResponse as j, MessagePayload as k, DomainAllowedPayloadMap as l, CurrencyFormat as lt, DomainToMessagePayloadMap as m, AutoplayLimit as n, WrapperConfig as nt, CasinoOnlyMessagePayloadMap as o, RgsError as ot, DomainPrefix as p, SdkConfig as q, Bet as r, WrapperOnlyMessagePayloadMap as rt, ContractOpenGamePayload as s, RgsErrorCode as st, I18n as t, ToTelemetryPluginsForwardedMessageMap as tt, DomainMessage as u, CurrencyNumber as ut, ForwardToSdkMessage as v, GetBalanceResponse as w, FreeRoundsAction as x, ForwardToSdkMessagePayload as y, PrefixedMessageMessageEvent as z };
@@ -344,6 +344,11 @@ const CUSTOM_CURRENCIES = {
344
344
  maximumFractionDigits: 2,
345
345
  minimumFractionDigits: 2
346
346
  },
347
+ CMBC: {
348
+ displayAs: "CMB",
349
+ maximumFractionDigits: 2,
350
+ minimumFractionDigits: 2
351
+ },
347
352
  FC: {
348
353
  displayAs: "",
349
354
  maximumFractionDigits: 2,
@@ -2,7 +2,7 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- import { C as GetBalanceResponse, G as SdkConfig, H as RgsErrorWithType, M as PlayResponse, S as FreeRoundsResponse, d as DomainMessagePayload, et as WrapperConfig, g as ForwardToPluginsMessagePayload, j as PlayRequestEnhanced, k as OpenGameResponse, l as DomainMessage, m as ForwardToPluginsMessage, nt as WrapperState, s as ContractPlayPayload, t as I18n, x as FreeRoundsRequest } from "./i18n-Dff1pHdh.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-D58gDMXP.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;
@@ -64,7 +64,7 @@ declare abstract class RgsPlugin extends WithLogger {
64
64
  constructor(config: WrapperConfig, sdkConfig: SdkConfig);
65
65
  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
66
  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
- openGame(): Promise<OpenGameResponse>;
67
+ openGame(payload: OpenGameRequest): Promise<OpenGameResponse>;
68
68
  play(payload: PlayRequestEnhanced): Promise<PlayResponse>;
69
69
  freeRounds(payload: FreeRoundsRequest): Promise<FreeRoundsResponse>;
70
70
  getBalance(): Promise<GetBalanceResponse>;
@@ -2,7 +2,7 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- import { C as GetBalanceResponse, G as SdkConfig, H as RgsErrorWithType, M as PlayResponse, S as FreeRoundsResponse, d as DomainMessagePayload, et as WrapperConfig, g as ForwardToPluginsMessagePayload, j as PlayRequestEnhanced, k as OpenGameResponse, l as DomainMessage, m as ForwardToPluginsMessage, nt as WrapperState, s as ContractPlayPayload, t as I18n, x as FreeRoundsRequest } from "./i18n-CM87VHyx.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-CmwXmJaL.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;
@@ -64,7 +64,7 @@ declare abstract class RgsPlugin extends WithLogger {
64
64
  constructor(config: WrapperConfig, sdkConfig: SdkConfig);
65
65
  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
66
  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
- openGame(): Promise<OpenGameResponse>;
67
+ openGame(payload: OpenGameRequest): Promise<OpenGameResponse>;
68
68
  play(payload: PlayRequestEnhanced): Promise<PlayResponse>;
69
69
  freeRounds(payload: FreeRoundsRequest): Promise<FreeRoundsResponse>;
70
70
  getBalance(): Promise<GetBalanceResponse>;
package/dist/index.cjs CHANGED
@@ -3,7 +3,8 @@
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
5
  const require_errors = require('./errors-BUjKnbx5.cjs');
6
- const require_i18n = require('./i18n-NIrYZyLs.cjs');
6
+ const require_i18n = require('./i18n-PWy1viak.cjs');
7
+ let lodash_es = require("lodash-es");
7
8
 
8
9
  //#region src/sdk/KalambaSdk.ts
9
10
  const logIn = () => {};
@@ -26,10 +27,10 @@ var KalambaSdk = class {
26
27
  #config;
27
28
  #i18n;
28
29
  #messagePort;
29
- #codecs;
30
+ #codecs = defaultCodecs;
30
31
  constructor({ messagePort, codecs }) {
31
32
  this.#messagePort = messagePort;
32
- this.#codecs = codecs ?? defaultCodecs;
33
+ (0, lodash_es.merge)(this.#codecs, codecs);
33
34
  this.on("configured", (config) => {
34
35
  this.#config = config;
35
36
  this.#i18n = new require_i18n.I18n({ config });
@@ -74,9 +75,13 @@ var KalambaSdk = class {
74
75
  configure(payload) {
75
76
  this.send("configure", payload);
76
77
  }
77
- async openGame() {
78
+ async openGame(contract, extra) {
78
79
  const configuredPromise = new Promise((resolve) => this.on("configured", resolve, { once: true }));
79
- const responseData = await this.request("openGame");
80
+ const payload = {
81
+ contract,
82
+ extra: this.#codecs.openGame.request.encode(extra)
83
+ };
84
+ const responseData = await this.request("openGame", payload);
80
85
  if (responseData.type === "response") {
81
86
  await configuredPromise;
82
87
  return {
@@ -87,12 +92,10 @@ var KalambaSdk = class {
87
92
  else throw new require_errors.RgsError(responseData.error.data);
88
93
  }
89
94
  async play(contract, extra) {
90
- console.log("debug 1 payload", contract, extra);
91
95
  const payload = {
92
96
  contract,
93
97
  extra: this.#codecs.play.request.encode(extra)
94
98
  };
95
- console.log("debug payload", payload);
96
99
  const responseData = await this.request("play", payload);
97
100
  if (responseData.type === "response") return {
98
101
  contract: responseData.response.contract,
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 ToTelemetryPluginsForwardedMessageMap, A as PlayRequest, B as RealityCheckConfig, C as GetBalanceResponse, D as MessageMessageEvent, E as MessageMap, F as PrefixedMessage, G as SdkConfig, H as RgsErrorWithType, I as PrefixedMessageMap, J as Settings, K as SdkError, L as PrefixedMessageMessageEvent, M as PlayResponse, N as PluginDomain, O as MessagePayload, P as PrefixedForwardToPluginsMessage, Q as ToSdkForwardedMessageMap, R as PrefixedMessagePayload, S as FreeRoundsResponse, T as Message, U as RgsOnlyMessagePayloadMap, V as RgsErrorData, W as RgsResponse, X as ToCasinoPluginsForwardedMessageMap, Y as TelemetryOnlyMessagePayloadMap, Z as ToRgsPluginsForwardedMessageMap, _ as ForwardToSdkMessage, a as CashierConfig, at as RgsErrorCode, b as FreeRoundsAction, c as DomainAllowedPayloadMap, ct as CurrencyNumber, d as DomainMessagePayload, et as WrapperConfig, f as DomainPrefix, g as ForwardToPluginsMessagePayload, h as ForwardToPluginsMessageMap, i as Cashier, it as RgsError, j as PlayRequestEnhanced, k as OpenGameResponse, l as DomainMessage, lt as FormatCurrencyOptions, m as ForwardToPluginsMessage, n as AutoplayLimit, nt as WrapperState, o as CasinoOnlyMessagePayloadMap, ot as TimeoutError, p as DomainToMessagePayloadMap, q as SdkOnlyMessagePayloadMap, r as Bet, s as ContractPlayPayload, st as CurrencyFormat, t as I18n, tt as WrapperOnlyMessagePayloadMap, u as DomainMessageMessageEvent, v as ForwardToSdkMessagePayload, w as History, x as FreeRoundsRequest, y as FreeRound, z as PrefixedMessagePayloadMap } from "./i18n-Dff1pHdh.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-D58gDMXP.cjs";
6
6
 
7
7
  //#region src/sdk/KalambaSdk.d.ts
8
8
  type MessageType = 'openGame' | 'play';
@@ -32,7 +32,7 @@ declare class KalambaSdk<TCodecs extends Codecs = typeof defaultCodecs> {
32
32
  codecs
33
33
  }: {
34
34
  messagePort: Window;
35
- codecs?: TCodecs;
35
+ codecs?: Partial<TCodecs>;
36
36
  });
37
37
  get config(): SdkConfig;
38
38
  get i18n(): I18n;
@@ -40,7 +40,7 @@ declare class KalambaSdk<TCodecs extends Codecs = typeof defaultCodecs> {
40
40
  on<M extends DomainMessage<'wrapper'> | ForwardToSdkMessage>(message: M, listener: (payload: M extends DomainMessage<'wrapper'> ? DomainMessagePayload<'wrapper', M> : M extends ForwardToSdkMessage ? ForwardToSdkMessagePayload<M> : never) => void, options?: AddEventListenerOptions): void;
41
41
  send<M extends DomainMessage<'sdk'>>(message: M, ...[payload]: DomainMessagePayload<'sdk', M> extends never ? [] : undefined extends DomainMessagePayload<'sdk', M> ? [] | [DomainMessagePayload<'sdk', M>] : [DomainMessagePayload<'sdk', M>]): void;
42
42
  configure(payload: DomainMessagePayload<'sdk', 'configure'>): void;
43
- openGame(): Promise<{
43
+ openGame(contract?: ContractOpenGamePayload, extra?: Parameters<TCodecs['openGame']['request']['encode']>[0]): Promise<{
44
44
  contract: {
45
45
  bet: {
46
46
  available: Record<number, number[]>;
@@ -110,4 +110,4 @@ declare class KalambaSdk<TCodecs extends Codecs = typeof defaultCodecs> {
110
110
  }>;
111
111
  }
112
112
  //#endregion
113
- export { AutoplayLimit, Bet, Cashier, CashierConfig, CasinoOnlyMessagePayloadMap, ContractPlayPayload, CurrencyFormat, CurrencyNumber, DomainAllowedPayloadMap, DomainMessage, DomainMessageMessageEvent, DomainMessagePayload, DomainPrefix, DomainToMessagePayloadMap, FormatCurrencyOptions, ForwardToPluginsMessage, ForwardToPluginsMessageMap, ForwardToPluginsMessagePayload, ForwardToSdkMessage, ForwardToSdkMessagePayload, FreeRound, FreeRoundsAction, FreeRoundsRequest, FreeRoundsResponse, GetBalanceResponse, History, I18n, KalambaSdk, Message, MessageMap, MessageMessageEvent, MessagePayload, OpenGameResponse, PlayRequest, PlayRequestEnhanced, PlayResponse, PluginDomain, PrefixedForwardToPluginsMessage, PrefixedMessage, PrefixedMessageMap, PrefixedMessageMessageEvent, PrefixedMessagePayload, PrefixedMessagePayloadMap, RealityCheckConfig, RgsError, RgsErrorCode, RgsErrorData, RgsErrorWithType, RgsOnlyMessagePayloadMap, RgsResponse, SdkConfig, SdkError, SdkOnlyMessagePayloadMap, Settings, TelemetryOnlyMessagePayloadMap, TimeoutError, ToCasinoPluginsForwardedMessageMap, ToRgsPluginsForwardedMessageMap, ToSdkForwardedMessageMap, ToTelemetryPluginsForwardedMessageMap, WrapperConfig, WrapperOnlyMessagePayloadMap, WrapperState };
113
+ export { AutoplayLimit, Bet, Cashier, CashierConfig, CasinoOnlyMessagePayloadMap, ContractOpenGamePayload, ContractPlayPayload, CurrencyFormat, CurrencyNumber, DomainAllowedPayloadMap, DomainMessage, DomainMessageMessageEvent, DomainMessagePayload, DomainPrefix, DomainToMessagePayloadMap, FormatCurrencyOptions, ForwardToPluginsMessage, ForwardToPluginsMessageMap, ForwardToPluginsMessagePayload, ForwardToSdkMessage, ForwardToSdkMessagePayload, FreeRound, FreeRoundsAction, FreeRoundsRequest, FreeRoundsResponse, GetBalanceResponse, History, I18n, KalambaSdk, Message, MessageMap, MessageMessageEvent, MessagePayload, OpenGameRequest, OpenGameResponse, PlayRequest, PlayRequestEnhanced, PlayResponse, PluginDomain, PrefixedForwardToPluginsMessage, PrefixedMessage, PrefixedMessageMap, PrefixedMessageMessageEvent, PrefixedMessagePayload, PrefixedMessagePayloadMap, RealityCheckConfig, RgsError, RgsErrorCode, RgsErrorData, RgsErrorWithType, RgsOnlyMessagePayloadMap, RgsResponse, SdkConfig, SdkError, SdkOnlyMessagePayloadMap, Settings, TelemetryOnlyMessagePayloadMap, TimeoutError, ToCasinoPluginsForwardedMessageMap, ToRgsPluginsForwardedMessageMap, ToSdkForwardedMessageMap, ToTelemetryPluginsForwardedMessageMap, WrapperConfig, WrapperOnlyMessagePayloadMap, WrapperState };
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 ToTelemetryPluginsForwardedMessageMap, A as PlayRequest, B as RealityCheckConfig, C as GetBalanceResponse, D as MessageMessageEvent, E as MessageMap, F as PrefixedMessage, G as SdkConfig, H as RgsErrorWithType, I as PrefixedMessageMap, J as Settings, K as SdkError, L as PrefixedMessageMessageEvent, M as PlayResponse, N as PluginDomain, O as MessagePayload, P as PrefixedForwardToPluginsMessage, Q as ToSdkForwardedMessageMap, R as PrefixedMessagePayload, S as FreeRoundsResponse, T as Message, U as RgsOnlyMessagePayloadMap, V as RgsErrorData, W as RgsResponse, X as ToCasinoPluginsForwardedMessageMap, Y as TelemetryOnlyMessagePayloadMap, Z as ToRgsPluginsForwardedMessageMap, _ as ForwardToSdkMessage, a as CashierConfig, at as RgsErrorCode, b as FreeRoundsAction, c as DomainAllowedPayloadMap, ct as CurrencyNumber, d as DomainMessagePayload, et as WrapperConfig, f as DomainPrefix, g as ForwardToPluginsMessagePayload, h as ForwardToPluginsMessageMap, i as Cashier, it as RgsError, j as PlayRequestEnhanced, k as OpenGameResponse, l as DomainMessage, lt as FormatCurrencyOptions, m as ForwardToPluginsMessage, n as AutoplayLimit, nt as WrapperState, o as CasinoOnlyMessagePayloadMap, ot as TimeoutError, p as DomainToMessagePayloadMap, q as SdkOnlyMessagePayloadMap, r as Bet, s as ContractPlayPayload, st as CurrencyFormat, t as I18n, tt as WrapperOnlyMessagePayloadMap, u as DomainMessageMessageEvent, v as ForwardToSdkMessagePayload, w as History, x as FreeRoundsRequest, y as FreeRound, z as PrefixedMessagePayloadMap } from "./i18n-CM87VHyx.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-CmwXmJaL.js";
6
6
 
7
7
  //#region src/sdk/KalambaSdk.d.ts
8
8
  type MessageType = 'openGame' | 'play';
@@ -32,7 +32,7 @@ declare class KalambaSdk<TCodecs extends Codecs = typeof defaultCodecs> {
32
32
  codecs
33
33
  }: {
34
34
  messagePort: Window;
35
- codecs?: TCodecs;
35
+ codecs?: Partial<TCodecs>;
36
36
  });
37
37
  get config(): SdkConfig;
38
38
  get i18n(): I18n;
@@ -40,7 +40,7 @@ declare class KalambaSdk<TCodecs extends Codecs = typeof defaultCodecs> {
40
40
  on<M extends DomainMessage<'wrapper'> | ForwardToSdkMessage>(message: M, listener: (payload: M extends DomainMessage<'wrapper'> ? DomainMessagePayload<'wrapper', M> : M extends ForwardToSdkMessage ? ForwardToSdkMessagePayload<M> : never) => void, options?: AddEventListenerOptions): void;
41
41
  send<M extends DomainMessage<'sdk'>>(message: M, ...[payload]: DomainMessagePayload<'sdk', M> extends never ? [] : undefined extends DomainMessagePayload<'sdk', M> ? [] | [DomainMessagePayload<'sdk', M>] : [DomainMessagePayload<'sdk', M>]): void;
42
42
  configure(payload: DomainMessagePayload<'sdk', 'configure'>): void;
43
- openGame(): Promise<{
43
+ openGame(contract?: ContractOpenGamePayload, extra?: Parameters<TCodecs['openGame']['request']['encode']>[0]): Promise<{
44
44
  contract: {
45
45
  bet: {
46
46
  available: Record<number, number[]>;
@@ -110,4 +110,4 @@ declare class KalambaSdk<TCodecs extends Codecs = typeof defaultCodecs> {
110
110
  }>;
111
111
  }
112
112
  //#endregion
113
- export { AutoplayLimit, Bet, Cashier, CashierConfig, CasinoOnlyMessagePayloadMap, ContractPlayPayload, CurrencyFormat, CurrencyNumber, DomainAllowedPayloadMap, DomainMessage, DomainMessageMessageEvent, DomainMessagePayload, DomainPrefix, DomainToMessagePayloadMap, FormatCurrencyOptions, ForwardToPluginsMessage, ForwardToPluginsMessageMap, ForwardToPluginsMessagePayload, ForwardToSdkMessage, ForwardToSdkMessagePayload, FreeRound, FreeRoundsAction, FreeRoundsRequest, FreeRoundsResponse, GetBalanceResponse, History, I18n, KalambaSdk, Message, MessageMap, MessageMessageEvent, MessagePayload, OpenGameResponse, PlayRequest, PlayRequestEnhanced, PlayResponse, PluginDomain, PrefixedForwardToPluginsMessage, PrefixedMessage, PrefixedMessageMap, PrefixedMessageMessageEvent, PrefixedMessagePayload, PrefixedMessagePayloadMap, RealityCheckConfig, RgsError, RgsErrorCode, RgsErrorData, RgsErrorWithType, RgsOnlyMessagePayloadMap, RgsResponse, SdkConfig, SdkError, SdkOnlyMessagePayloadMap, Settings, TelemetryOnlyMessagePayloadMap, TimeoutError, ToCasinoPluginsForwardedMessageMap, ToRgsPluginsForwardedMessageMap, ToSdkForwardedMessageMap, ToTelemetryPluginsForwardedMessageMap, WrapperConfig, WrapperOnlyMessagePayloadMap, WrapperState };
113
+ export { AutoplayLimit, Bet, Cashier, CashierConfig, CasinoOnlyMessagePayloadMap, ContractOpenGamePayload, ContractPlayPayload, CurrencyFormat, CurrencyNumber, DomainAllowedPayloadMap, DomainMessage, DomainMessageMessageEvent, DomainMessagePayload, DomainPrefix, DomainToMessagePayloadMap, FormatCurrencyOptions, ForwardToPluginsMessage, ForwardToPluginsMessageMap, ForwardToPluginsMessagePayload, ForwardToSdkMessage, ForwardToSdkMessagePayload, FreeRound, FreeRoundsAction, FreeRoundsRequest, FreeRoundsResponse, GetBalanceResponse, History, I18n, KalambaSdk, Message, MessageMap, MessageMessageEvent, MessagePayload, OpenGameRequest, OpenGameResponse, PlayRequest, PlayRequestEnhanced, PlayResponse, PluginDomain, PrefixedForwardToPluginsMessage, PrefixedMessage, PrefixedMessageMap, PrefixedMessageMessageEvent, PrefixedMessagePayload, PrefixedMessagePayloadMap, RealityCheckConfig, RgsError, RgsErrorCode, RgsErrorData, RgsErrorWithType, RgsOnlyMessagePayloadMap, RgsResponse, SdkConfig, SdkError, SdkOnlyMessagePayloadMap, Settings, TelemetryOnlyMessagePayloadMap, TimeoutError, ToCasinoPluginsForwardedMessageMap, ToRgsPluginsForwardedMessageMap, ToSdkForwardedMessageMap, ToTelemetryPluginsForwardedMessageMap, WrapperConfig, WrapperOnlyMessagePayloadMap, WrapperState };
package/dist/index.js CHANGED
@@ -3,7 +3,8 @@
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-vzEFUHe0.js";
6
+ import { t as I18n } from "./i18n-ChMSjf9e.js";
7
+ import { merge } from "lodash-es";
7
8
 
8
9
  //#region src/sdk/KalambaSdk.ts
9
10
  const logIn = () => {};
@@ -26,10 +27,10 @@ var KalambaSdk = class {
26
27
  #config;
27
28
  #i18n;
28
29
  #messagePort;
29
- #codecs;
30
+ #codecs = defaultCodecs;
30
31
  constructor({ messagePort, codecs }) {
31
32
  this.#messagePort = messagePort;
32
- this.#codecs = codecs ?? defaultCodecs;
33
+ merge(this.#codecs, codecs);
33
34
  this.on("configured", (config) => {
34
35
  this.#config = config;
35
36
  this.#i18n = new I18n({ config });
@@ -74,9 +75,13 @@ var KalambaSdk = class {
74
75
  configure(payload) {
75
76
  this.send("configure", payload);
76
77
  }
77
- async openGame() {
78
+ async openGame(contract, extra) {
78
79
  const configuredPromise = new Promise((resolve) => this.on("configured", resolve, { once: true }));
79
- const responseData = await this.request("openGame");
80
+ const payload = {
81
+ contract,
82
+ extra: this.#codecs.openGame.request.encode(extra)
83
+ };
84
+ const responseData = await this.request("openGame", payload);
80
85
  if (responseData.type === "response") {
81
86
  await configuredPromise;
82
87
  return {
@@ -87,12 +92,10 @@ var KalambaSdk = class {
87
92
  else throw new RgsError(responseData.error.data);
88
93
  }
89
94
  async play(contract, extra) {
90
- console.log("debug 1 payload", contract, extra);
91
95
  const payload = {
92
96
  contract,
93
97
  extra: this.#codecs.play.request.encode(extra)
94
98
  };
95
- console.log("debug payload", payload);
96
99
  const responseData = await this.request("play", payload);
97
100
  if (responseData.type === "response") return {
98
101
  contract: responseData.response.contract,
package/dist/plugins.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- const require_i18n = require('./i18n-NIrYZyLs.cjs');
5
+ const require_i18n = require('./i18n-PWy1viak.cjs');
6
6
  const require_logger = require('./logger-BR4jdx4T.cjs');
7
7
 
8
8
  //#region src/plugins/CasinoPlugin.ts
@@ -46,10 +46,10 @@ var RgsPlugin = class extends require_logger.WithLogger {
46
46
  super();
47
47
  this.config = config;
48
48
  this.sdkConfig = sdkConfig;
49
- this.on("openGame", async () => {
49
+ this.on("openGame", async (payload) => {
50
50
  try {
51
51
  this.error = void 0;
52
- const response = await this.openGame();
52
+ const response = await this.openGame(payload);
53
53
  this.send("openGameResponse", response);
54
54
  } catch (e) {
55
55
  this.error = e;
@@ -98,7 +98,7 @@ var RgsPlugin = class extends require_logger.WithLogger {
98
98
  payload
99
99
  });
100
100
  }
101
- async openGame() {
101
+ async openGame(payload) {
102
102
  throw new Error("Not implemented");
103
103
  }
104
104
  async play(payload) {
@@ -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-l1uA5NOP.cjs";
5
+ import { i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-CXau6Ghs.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-B_FWnjNV.js";
5
+ import { i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-m-m_dirH.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-vzEFUHe0.js";
5
+ import { t as I18n } from "./i18n-ChMSjf9e.js";
6
6
  import { t as WithLogger } from "./logger-f0OQvO5X.js";
7
7
 
8
8
  //#region src/plugins/CasinoPlugin.ts
@@ -46,10 +46,10 @@ var RgsPlugin = class extends WithLogger {
46
46
  super();
47
47
  this.config = config;
48
48
  this.sdkConfig = sdkConfig;
49
- this.on("openGame", async () => {
49
+ this.on("openGame", async (payload) => {
50
50
  try {
51
51
  this.error = void 0;
52
- const response = await this.openGame();
52
+ const response = await this.openGame(payload);
53
53
  this.send("openGameResponse", response);
54
54
  } catch (e) {
55
55
  this.error = e;
@@ -98,7 +98,7 @@ var RgsPlugin = class extends WithLogger {
98
98
  payload
99
99
  });
100
100
  }
101
- async openGame() {
101
+ async openGame(payload) {
102
102
  throw new Error("Not implemented");
103
103
  }
104
104
  async play(payload) {
@@ -2,8 +2,8 @@
2
2
  * BSD 3-Clause License
3
3
  * Copyright (c) 2026, Kalamba Games Limited
4
4
  */
5
- import { G as SdkConfig, O as MessagePayload, T as Message, d as DomainMessagePayload, et as WrapperConfig, l as DomainMessage, nt as WrapperState, rt as DeepPartial, y as FreeRound } from "./i18n-Dff1pHdh.cjs";
6
- import { a as PayloadInjectionManager, i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-l1uA5NOP.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-D58gDMXP.cjs";
6
+ import { a as PayloadInjectionManager, i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-CXau6Ghs.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 { G as SdkConfig, O as MessagePayload, T as Message, d as DomainMessagePayload, et as WrapperConfig, l as DomainMessage, nt as WrapperState, rt as DeepPartial, y as FreeRound } from "./i18n-CM87VHyx.js";
6
- import { a as PayloadInjectionManager, i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-B_FWnjNV.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-CmwXmJaL.js";
6
+ import { a as PayloadInjectionManager, i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-m-m_dirH.js";
7
7
 
8
8
  //#region src/common/config/SdkConfigManager.d.ts
9
9
  declare abstract class SdkConfigManager {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kalamba/sdk",
3
- "version": "0.37.0",
3
+ "version": "0.38.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "type": "module",
6
6
  "files": [