@kalamba/sdk 0.10.0 → 0.13.1

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.
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * BSD 3-Clause License
3
- * Copyright (c) 2024, Kalamba Games Limited
3
+ * Copyright (c) 2025, Kalamba Games Limited
4
4
  */
5
- var N = Object.defineProperty;
6
- var S = (_, E, O) => E in _ ? N(_, E, { enumerable: !0, configurable: !0, writable: !0, value: O }) : _[E] = O;
7
- var R = (_, E, O) => (S(_, typeof E != "symbol" ? E + "" : E, O), O);
5
+ var R = Object.defineProperty;
6
+ var S = (_, E, O) => E in _ ? R(_, E, { enumerable: !0, configurable: !0, writable: !0, value: O }) : _[E] = O;
7
+ var N = (_, E, O) => (S(_, typeof E != "symbol" ? E + "" : E, O), O);
8
8
  const I = {
9
9
  CONNECTION_ERROR: "CONNECTION_ERROR",
10
10
  INVALID_BET_CURRENCY: "INVALID_BET_CURRENCY",
@@ -55,7 +55,7 @@ const I = {
55
55
  FREE_ROUNDS_PROCESSING_ERROR: "RELOAD",
56
56
  WEB_SESSION_NOT_OPEN: "RELOAD",
57
57
  GAMING_LIMITS_REACHED: "CLOSE",
58
- OUT_OF_MONEY: "CLOSE",
58
+ OUT_OF_MONEY: "CONTINUE",
59
59
  UNFINISHED_ROUND_IN_PROGRESS: "CLOSE",
60
60
  ACCESS_DENIED: "CLOSE",
61
61
  CREDENTIALS_NOT_FOUND: "CLOSE",
@@ -73,7 +73,7 @@ const I = {
73
73
  class L extends Error {
74
74
  constructor(O) {
75
75
  super();
76
- R(this, "data");
76
+ N(this, "data");
77
77
  this.name = "RgsError", this.data = O;
78
78
  }
79
79
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * BSD 3-Clause License
3
- * Copyright (c) 2024, Kalamba Games Limited
3
+ * Copyright (c) 2025, Kalamba Games Limited
4
4
  */
5
- "use strict";var N=Object.defineProperty;var S=(_,E,O)=>E in _?N(_,E,{enumerable:!0,configurable:!0,writable:!0,value:O}):_[E]=O;var R=(_,E,O)=>(S(_,typeof E!="symbol"?E+"":E,O),O);const A={CONNECTION_ERROR:"CONNECTION_ERROR",INVALID_BET_CURRENCY:"INVALID_BET_CURRENCY",INVALID_BET:"INVALID_BET",INVALID_CAGE_CODE:"INVALID_CAGE_CODE",INVALID_CLIENT_TYPE:"INVALID_CLIENT_TYPE",INVALID_MESSAGE_FORMAT:"INVALID_MESSAGE_FORMAT",INVALID_SESSION:"INVALID_SESSION",TOO_HIGH_BET_FREQUENCY:"TOO_HIGH_BET_FREQUENCY",TOO_HIGH_ACTION_FREQUENCY:"TOO_HIGH_ACTION_FREQUENCY",USER_LOCK_INVALID_PARAMS:"USER_LOCK_INVALID_PARAMS",USER_ALREADY_LOCKED:"USER_ALREADY_LOCKED",GAME_SERVER_ERROR:"GAME_SERVER_ERROR",SESSION_MANAGEMENT_ERROR:"SESSION_MANAGEMENT_ERROR",MESSAGE_SENDER_ERROR:"MESSAGE_SENDER_ERROR",FREE_ROUNDS_PROCESSING_ERROR:"FREE_ROUNDS_PROCESSING_ERROR",WEB_SESSION_NOT_OPEN:"WEB_SESSION_NOT_OPEN",GAMING_LIMITS_REACHED:"GAMING_LIMITS_REACHED",OUT_OF_MONEY:"OUT_OF_MONEY",UNFINISHED_ROUND_IN_PROGRESS:"UNFINISHED_ROUND_IN_PROGRESS",ACCESS_DENIED:"ACCESS_DENIED",CREDENTIALS_NOT_FOUND:"CREDENTIALS_NOT_FOUND",ALREADY_LOGGED_IN:"ALREADY_LOGGED_IN",GAME_UNAVAILABLE:"GAME_UNAVAILABLE",BONUS_RESTRICTION:"BONUS_RESTRICTION",TOO_MANY_OPEN_GAMES:"TOO_MANY_OPEN_GAMES",GAME_FROZEN:"GAME_FROZEN",WALLET_PROCESSING_ERROR:"WALLET_PROCESSING_ERROR",FORCED_OUTCOMES_NOT_ALLOWED:"FORCED_OUTCOMES_NOT_ALLOWED",MISSING_GAME_STATE:"MISSING_GAME_STATE",DATA_ACCESS_ERROR:"DATA_ACCESS_ERROR",UNKNOWN:"UNKNOWN"},I={CONNECTION_ERROR:"RELOAD",INVALID_BET_CURRENCY:"CLOSE",INVALID_BET:"CONTINUE",INVALID_CAGE_CODE:"CLOSE",INVALID_CLIENT_TYPE:"CLOSE",INVALID_MESSAGE_FORMAT:"CLOSE",INVALID_SESSION:"CLOSE",TOO_HIGH_BET_FREQUENCY:"CONTINUE",TOO_HIGH_ACTION_FREQUENCY:"CONTINUE",USER_LOCK_INVALID_PARAMS:"CLOSE",USER_ALREADY_LOCKED:"CLOSE",GAME_SERVER_ERROR:"RELOAD",SESSION_MANAGEMENT_ERROR:"RELOAD",MESSAGE_SENDER_ERROR:"RELOAD",FREE_ROUNDS_PROCESSING_ERROR:"RELOAD",WEB_SESSION_NOT_OPEN:"RELOAD",GAMING_LIMITS_REACHED:"CLOSE",OUT_OF_MONEY:"CLOSE",UNFINISHED_ROUND_IN_PROGRESS:"CLOSE",ACCESS_DENIED:"CLOSE",CREDENTIALS_NOT_FOUND:"CLOSE",ALREADY_LOGGED_IN:"CLOSE",GAME_UNAVAILABLE:"CLOSE",BONUS_RESTRICTION:"CLOSE",TOO_MANY_OPEN_GAMES:"CLOSE",GAME_FROZEN:"CLOSE",WALLET_PROCESSING_ERROR:"CLOSE",FORCED_OUTCOMES_NOT_ALLOWED:"CONTINUE",MISSING_GAME_STATE:"RELOAD",DATA_ACCESS_ERROR:"RELOAD",UNKNOWN:"CLOSE"};class C extends Error{constructor(O){super();R(this,"data");this.name="RgsError",this.data=O}}class L extends Error{constructor(){super(),this.name="TimeoutError"}}exports.RgsError=C;exports.RgsErrorAction=I;exports.RgsErrorCode=A;exports.TimeoutError=L;
5
+ "use strict";var N=Object.defineProperty;var S=(_,E,O)=>E in _?N(_,E,{enumerable:!0,configurable:!0,writable:!0,value:O}):_[E]=O;var R=(_,E,O)=>(S(_,typeof E!="symbol"?E+"":E,O),O);const A={CONNECTION_ERROR:"CONNECTION_ERROR",INVALID_BET_CURRENCY:"INVALID_BET_CURRENCY",INVALID_BET:"INVALID_BET",INVALID_CAGE_CODE:"INVALID_CAGE_CODE",INVALID_CLIENT_TYPE:"INVALID_CLIENT_TYPE",INVALID_MESSAGE_FORMAT:"INVALID_MESSAGE_FORMAT",INVALID_SESSION:"INVALID_SESSION",TOO_HIGH_BET_FREQUENCY:"TOO_HIGH_BET_FREQUENCY",TOO_HIGH_ACTION_FREQUENCY:"TOO_HIGH_ACTION_FREQUENCY",USER_LOCK_INVALID_PARAMS:"USER_LOCK_INVALID_PARAMS",USER_ALREADY_LOCKED:"USER_ALREADY_LOCKED",GAME_SERVER_ERROR:"GAME_SERVER_ERROR",SESSION_MANAGEMENT_ERROR:"SESSION_MANAGEMENT_ERROR",MESSAGE_SENDER_ERROR:"MESSAGE_SENDER_ERROR",FREE_ROUNDS_PROCESSING_ERROR:"FREE_ROUNDS_PROCESSING_ERROR",WEB_SESSION_NOT_OPEN:"WEB_SESSION_NOT_OPEN",GAMING_LIMITS_REACHED:"GAMING_LIMITS_REACHED",OUT_OF_MONEY:"OUT_OF_MONEY",UNFINISHED_ROUND_IN_PROGRESS:"UNFINISHED_ROUND_IN_PROGRESS",ACCESS_DENIED:"ACCESS_DENIED",CREDENTIALS_NOT_FOUND:"CREDENTIALS_NOT_FOUND",ALREADY_LOGGED_IN:"ALREADY_LOGGED_IN",GAME_UNAVAILABLE:"GAME_UNAVAILABLE",BONUS_RESTRICTION:"BONUS_RESTRICTION",TOO_MANY_OPEN_GAMES:"TOO_MANY_OPEN_GAMES",GAME_FROZEN:"GAME_FROZEN",WALLET_PROCESSING_ERROR:"WALLET_PROCESSING_ERROR",FORCED_OUTCOMES_NOT_ALLOWED:"FORCED_OUTCOMES_NOT_ALLOWED",MISSING_GAME_STATE:"MISSING_GAME_STATE",DATA_ACCESS_ERROR:"DATA_ACCESS_ERROR",UNKNOWN:"UNKNOWN"},I={CONNECTION_ERROR:"RELOAD",INVALID_BET_CURRENCY:"CLOSE",INVALID_BET:"CONTINUE",INVALID_CAGE_CODE:"CLOSE",INVALID_CLIENT_TYPE:"CLOSE",INVALID_MESSAGE_FORMAT:"CLOSE",INVALID_SESSION:"CLOSE",TOO_HIGH_BET_FREQUENCY:"CONTINUE",TOO_HIGH_ACTION_FREQUENCY:"CONTINUE",USER_LOCK_INVALID_PARAMS:"CLOSE",USER_ALREADY_LOCKED:"CLOSE",GAME_SERVER_ERROR:"RELOAD",SESSION_MANAGEMENT_ERROR:"RELOAD",MESSAGE_SENDER_ERROR:"RELOAD",FREE_ROUNDS_PROCESSING_ERROR:"RELOAD",WEB_SESSION_NOT_OPEN:"RELOAD",GAMING_LIMITS_REACHED:"CLOSE",OUT_OF_MONEY:"CONTINUE",UNFINISHED_ROUND_IN_PROGRESS:"CLOSE",ACCESS_DENIED:"CLOSE",CREDENTIALS_NOT_FOUND:"CLOSE",ALREADY_LOGGED_IN:"CLOSE",GAME_UNAVAILABLE:"CLOSE",BONUS_RESTRICTION:"CLOSE",TOO_MANY_OPEN_GAMES:"CLOSE",GAME_FROZEN:"CLOSE",WALLET_PROCESSING_ERROR:"CLOSE",FORCED_OUTCOMES_NOT_ALLOWED:"CONTINUE",MISSING_GAME_STATE:"RELOAD",DATA_ACCESS_ERROR:"RELOAD",UNKNOWN:"CLOSE"};class C extends Error{constructor(O){super();R(this,"data");this.name="RgsError",this.data=O}}class L extends Error{constructor(){super(),this.name="TimeoutError"}}exports.RgsError=C;exports.RgsErrorAction=I;exports.RgsErrorCode=A;exports.TimeoutError=L;
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * BSD 3-Clause License
3
- * Copyright (c) 2024, Kalamba Games Limited
3
+ * Copyright (c) 2025, Kalamba Games Limited
4
4
  */
5
- "use strict";var b=(r,i,t)=>{if(!i.has(r))throw TypeError("Cannot "+t)};var m=(r,i,t)=>(b(r,i,"read from private field"),t?t.call(r):i.get(r)),e=(r,i,t)=>{if(i.has(r))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(r):i.set(r,t)},u=(r,i,t,n)=>(b(r,i,"write to private field"),n?n.call(r,t):i.set(r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("./errors-358575c3.cjs");function A(r){const i=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&i==="[object Date]"?new r.constructor(+r):typeof r=="number"||i==="[object Number]"||typeof r=="string"||i==="[object String]"?new Date(r):new Date(NaN)}function U(r){const i=A(r);return i.setHours(23,59,59,999),i}function L(){return U(Date.now())}function P(r){const i=A(r);return i.setHours(0,0,0,0),i}function k(){return P(Date.now())}const G=3e4;var F,S;class ${constructor(i){e(this,F,void 0);e(this,S,G);u(this,F,i)}buildHeaders(){const i={};return m(this,F).token&&(i.Authorization=`Bearer ${m(this,F).token}`),i}async request(i,t){const n=new URL(i,m(this,F).apiUrl??window.location.origin);return n.search=new URLSearchParams({...t}).toString(),await(await fetch(n,{signal:AbortSignal.timeout(m(this,S)),headers:this.buildHeaders()})).json()}async getRounds(i){return this.request("/rounds",i)}async getRound(i,t){return this.request(`/rounds/${i}`,t)}}F=new WeakMap,S=new WeakMap;const N={limit:100,page:0};var s,l;class I{constructor({config:i}){e(this,s,void 0);e(this,l,void 0);u(this,s,i),u(this,l,new $({apiUrl:i.api.gameHistoryUrl}))}async getRound(i,{pagination:t=N}={}){return m(this,l).getRound(i,{gameCode:m(this,s).api.game,operatorCode:m(this,s).api.brand,username:m(this,s).api.user,...t})}async getLastRound(){return m(this,s).api.lastRoundId?this.getRound(m(this,s).api.lastRoundId):null}async getRounds({searchPeriod:i={fromDateTime:k(),toDateTime:L()},pagination:t=N}={}){const n=m(this,s).api.user.replace(/^user_/,"").replace(new RegExp(`_${m(this,s).api.integration}$`),"");return m(this,l).getRounds({gameCode:m(this,s).api.game,operatorCode:m(this,s).api.integration,username:n,fromDataTime:i.fromDateTime.toISOString(),toDateTime:i.toDateTime.toISOString(),...t})}}s=new WeakMap,l=new WeakMap;function _(r,i){return r*i/100}function O(r,i,t){if(!["string","number"].includes(typeof i))return"NaN";const{locales:n}=r;try{return new Intl.NumberFormat(n,{...t,numberingSystem:"latn",style:"decimal"}).format(+i)}catch{return`${i}`}}const w="XTS";var y=(r=>(r.Currency="Currency",r.Number="Number",r))(y||{}),f=(r=>(r.Coins="Coins",r.Money="Money",r))(f||{});const T={ARSB:{displayAs:"ARS",maximumFractionDigits:2,minimumFractionDigits:2},CHIPS:{maximumFractionDigits:0,minimumFractionDigits:0},BNB:{maximumFractionDigits:6,minimumFractionDigits:6},BUSD:{maximumFractionDigits:4,minimumFractionDigits:4},BTC:{maximumFractionDigits:8,minimumFractionDigits:2},mBTC:{maximumFractionDigits:5,minimumFractionDigits:2},uBTC:{maximumFractionDigits:2,minimumFractionDigits:2},BCH:{maximumFractionDigits:8,minimumFractionDigits:2},mBCH:{maximumFractionDigits:2,minimumFractionDigits:2},ETH:{maximumFractionDigits:8,minimumFractionDigits:2},mETH:{maximumFractionDigits:5,minimumFractionDigits:2},uETH:{maximumFractionDigits:2,minimumFractionDigits:2},SOC:{maximumFractionDigits:8,minimumFractionDigits:2},LTC:{maximumFractionDigits:8,minimumFractionDigits:2},mLTC:{maximumFractionDigits:5,minimumFractionDigits:2},uLTC:{maximumFractionDigits:2,minimumFractionDigits:2},DOG:{maximumFractionDigits:4,minimumFractionDigits:2},USDC:{maximumFractionDigits:4,minimumFractionDigits:4},USDT:{maximumFractionDigits:4,minimumFractionDigits:2},TRX:{maximumFractionDigits:2,minimumFractionDigits:2},TUSD:{maximumFractionDigits:2,minimumFractionDigits:2},DAI:{maximumFractionDigits:2,minimumFractionDigits:2},XMR:{maximumFractionDigits:4,minimumFractionDigits:4},CBET:{maximumFractionDigits:0,minimumFractionDigits:0},kCBET:{maximumFractionDigits:2,minimumFractionDigits:2},SHIB:{maximumFractionDigits:0,minimumFractionDigits:0},kSHIB:{maximumFractionDigits:4,minimumFractionDigits:2},NEO:{maximumFractionDigits:4,minimumFractionDigits:4},BSV:{maximumFractionDigits:4,minimumFractionDigits:4},EOS:{maximumFractionDigits:4,minimumFractionDigits:4},DASH:{maximumFractionDigits:4,minimumFractionDigits:4},XLM:{maximumFractionDigits:2,minimumFractionDigits:2},KRW:{maximumFractionDigits:2,minimumFractionDigits:2},kVND:{maximumFractionDigits:4,minimumFractionDigits:2},kIDR:{maximumFractionDigits:4,minimumFractionDigits:2},RSD:{maximumFractionDigits:2,minimumFractionDigits:2},STAKEGC:{displayAs:"GC",maximumFractionDigits:0,minimumFractionDigits:0},STAKESC:{displayAs:"SC",maximumFractionDigits:2,minimumFractionDigits:2},"BK.":{maximumFractionDigits:2,minimumFractionDigits:2},"BT.":{maximumFractionDigits:2,minimumFractionDigits:2},"FC.":{maximumFractionDigits:2,minimumFractionDigits:2},"GC.":{maximumFractionDigits:2,minimumFractionDigits:2},"SC.":{maximumFractionDigits:2,minimumFractionDigits:2},GLD:{displayAs:"GC.",maximumFractionDigits:2,minimumFractionDigits:2},SS1:{displayAs:"SC.",maximumFractionDigits:2,minimumFractionDigits:2},SWEP:{displayAs:"SC.",maximumFractionDigits:2,minimumFractionDigits:2},GCLC:{displayAs:"GC.",maximumFractionDigits:2,minimumFractionDigits:2},SVC:{maximumFractionDigits:2,minimumFractionDigits:2},DOT:{maximumFractionDigits:4,minimumFractionDigits:4},SOL:{maximumFractionDigits:4,minimumFractionDigits:4},XRP:{maximumFractionDigits:4,minimumFractionDigits:4},ADA:{maximumFractionDigits:4,minimumFractionDigits:4},TON:{maximumFractionDigits:4,minimumFractionDigits:4},FTN:{maximumFractionDigits:4,minimumFractionDigits:4}};function M(r){return r in T}function j(r){return M(r)?{...T[r],currency:w}:{currency:r}}function q(r,i,t){const n=i.format(+r);return M(t)?n.replace(w,T[t].displayAs??t):n}function K(r,i,t){const{maximumFractionDigits:n,minimumFractionDigits:o}=t.resolvedOptions();return O(r,i,{maximumFractionDigits:n,minimumFractionDigits:o})}function V(r,i,{as:t}={as:"Currency"}){const{canShowCurrency:n,currency:o}=r;return t==="Number"||!n?`${i}`:`${i} ${o}`}function v(r,i,{as:t,from:n}={as:"Currency",from:"Money"},o){if(!["string","number"].includes(typeof i))return"NaN";const{canShowCurrency:a=!0,coinValueInCents:g,currency:x,locales:E}=r;n==="Coins"&&(i=_(+i,g));try{const H=j(x),R=new Intl.NumberFormat(E,{...H,...o,currencyDisplay:"symbol",numberingSystem:"latn",style:"currency"});return t==="Number"||!a?K(r,i,R):q(i,R,x)}catch{return V(r,i,{as:t})}}var c;class B{constructor({config:i}){e(this,c,void 0);u(this,c,i)}formatNumber(i,t){const n={locales:[m(this,c).ui.language]};return O(n,i,t)}formatCurrency(i,t={as:y.Currency,from:f.Money},n){const o=m(this,c).ui.feature.showCurrency,a=m(this,c).api.coinValueInCents,g=m(this,c).api.currency||w,x=[m(this,c).ui.language];return v({canShowCurrency:o,coinValueInCents:a,currency:g,locales:x},i,t,n)}formatCoins(i,t){return this.formatCurrency(i,{as:y.Number,from:f.Coins},t)}formatCoinsWithCurrency(i,t){return this.formatCurrency(i,{as:y.Currency,from:f.Coins},t)}formatMoney(i,t){return this.formatCurrency(i,{as:y.Number,from:f.Money},t)}formatMoneyWithCurrency(i,t){return this.formatCurrency(i,{as:y.Currency,from:f.Money},t)}}c=new WeakMap;const X=()=>{};var d,h,C,p;class z{constructor({messagePort:i}){e(this,d,void 0);e(this,h,void 0);e(this,C,void 0);e(this,p,void 0);u(this,p,i),this.on("configured",t=>{u(this,d,t),u(this,C,new B({config:t})),u(this,h,new I({config:t}))}),this.on("playResponse",t=>{this.config.api.lastRoundId=t.contract.roundId})}get config(){if(!m(this,d))throw new Error("config is not initialized, you must open game first");return m(this,d)}get history(){if(!m(this,h))throw new Error("config is not initialized, you must open game first");return m(this,h)}get i18n(){if(!m(this,C))throw new Error("i18n is not initialized, you must open game first");return m(this,C)}request(i,...[t]){return new Promise(n=>{this.on(`${i}Response`,o=>n({type:"response",response:o}),{once:!0}),this.on(`${i}Error`,o=>n({type:"error",error:o}),{once:!0}),this.send(i,t)})}on(i,t,n){const o=function a(g){g.data.message===`kalamba:wrapper:${i}`&&(X("on",g.data.message.replace(/^kalamba:/,""),g.data.payload),t(g.data.payload),n!=null&&n.once&&window.removeEventListener("message",a))};window.addEventListener("message",o)}send(i,...[t]){m(this,p).postMessage({message:`kalamba:sdk:${i}`,payload:t},"*")}configure(i){this.send("configure",i)}async openGame(){const i=new Promise(n=>this.on("configured",n,{once:!0})),t=await this.request("openGame");if(t.type==="response")return await i,t.response;throw t.error.type==="timeout"?new D.TimeoutError:new D.RgsError(t.error.data)}async play(i,t,n="SPIN"){const o={contract:i,extra:t,actionType:n},a=await this.request("play",o);if(a.type==="response")return a.response;throw a.error.type==="timeout"?new D.TimeoutError:new D.RgsError(a.error.data)}}d=new WeakMap,h=new WeakMap,C=new WeakMap,p=new WeakMap;exports.RgsError=D.RgsError;exports.RgsErrorCode=D.RgsErrorCode;exports.TimeoutError=D.TimeoutError;exports.History=I;exports.I18n=B;exports.KalambaSdk=z;
5
+ "use strict";var b=(r,i,t)=>{if(!i.has(r))throw TypeError("Cannot "+t)};var m=(r,i,t)=>(b(r,i,"read from private field"),t?t.call(r):i.get(r)),e=(r,i,t)=>{if(i.has(r))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(r):i.set(r,t)},u=(r,i,t,n)=>(b(r,i,"write to private field"),n?n.call(r,t):i.set(r,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const D=require("./errors-db453887.cjs");function A(r){const i=Object.prototype.toString.call(r);return r instanceof Date||typeof r=="object"&&i==="[object Date]"?new r.constructor(+r):typeof r=="number"||i==="[object Number]"||typeof r=="string"||i==="[object String]"?new Date(r):new Date(NaN)}function U(r){const i=A(r);return i.setHours(23,59,59,999),i}function L(){return U(Date.now())}function P(r){const i=A(r);return i.setHours(0,0,0,0),i}function k(){return P(Date.now())}const G=3e4;var F,S;class ${constructor(i){e(this,F,void 0);e(this,S,G);u(this,F,i)}buildHeaders(){const i={};return m(this,F).token&&(i.Authorization=`Bearer ${m(this,F).token}`),i}async request(i,t){const n=new URL(i,m(this,F).apiUrl??window.location.origin);return n.search=new URLSearchParams({...t}).toString(),await(await fetch(n,{signal:AbortSignal.timeout(m(this,S)),headers:this.buildHeaders()})).json()}async getRounds(i){return this.request("/rounds",i)}async getRound(i,t){return this.request(`/rounds/${i}`,t)}}F=new WeakMap,S=new WeakMap;const N={limit:100,page:0};var s,l;class I{constructor({config:i}){e(this,s,void 0);e(this,l,void 0);u(this,s,i),u(this,l,new $({apiUrl:i.api.gameHistoryUrl}))}async getRound(i,{pagination:t=N}={}){return m(this,l).getRound(i,{gameCode:m(this,s).api.game,operatorCode:m(this,s).api.brand,username:m(this,s).api.user,...t})}async getLastRound(){return m(this,s).api.lastRoundId?this.getRound(m(this,s).api.lastRoundId):null}async getRounds({searchPeriod:i={fromDateTime:k(),toDateTime:L()},pagination:t=N}={}){const n=m(this,s).api.user.replace(/^user_/,"").replace(new RegExp(`_${m(this,s).api.integration}$`),"");return m(this,l).getRounds({gameCode:m(this,s).api.game,operatorCode:m(this,s).api.integration,username:n,fromDataTime:i.fromDateTime.toISOString(),toDateTime:i.toDateTime.toISOString(),...t})}}s=new WeakMap,l=new WeakMap;function _(r,i){return r*i/100}function O(r,i,t){if(!["string","number"].includes(typeof i))return"NaN";const{locales:n}=r;try{return new Intl.NumberFormat(n,{...t,numberingSystem:"latn",style:"decimal"}).format(+i)}catch{return`${i}`}}const w="XTS";var y=(r=>(r.Currency="Currency",r.Number="Number",r))(y||{}),f=(r=>(r.Coins="Coins",r.Money="Money",r))(f||{});const T={ARSB:{displayAs:"ARS",maximumFractionDigits:2,minimumFractionDigits:2},CHIPS:{maximumFractionDigits:0,minimumFractionDigits:0},BNB:{maximumFractionDigits:6,minimumFractionDigits:6},BUSD:{maximumFractionDigits:4,minimumFractionDigits:4},BTC:{maximumFractionDigits:8,minimumFractionDigits:2},mBTC:{maximumFractionDigits:5,minimumFractionDigits:2},uBTC:{maximumFractionDigits:2,minimumFractionDigits:2},BCH:{maximumFractionDigits:8,minimumFractionDigits:2},mBCH:{maximumFractionDigits:2,minimumFractionDigits:2},ETH:{maximumFractionDigits:8,minimumFractionDigits:2},mETH:{maximumFractionDigits:5,minimumFractionDigits:2},uETH:{maximumFractionDigits:2,minimumFractionDigits:2},SOC:{maximumFractionDigits:8,minimumFractionDigits:2},LTC:{maximumFractionDigits:8,minimumFractionDigits:2},mLTC:{maximumFractionDigits:5,minimumFractionDigits:2},uLTC:{maximumFractionDigits:2,minimumFractionDigits:2},DOG:{maximumFractionDigits:4,minimumFractionDigits:2},USDC:{maximumFractionDigits:4,minimumFractionDigits:4},USDT:{maximumFractionDigits:4,minimumFractionDigits:2},TRX:{maximumFractionDigits:2,minimumFractionDigits:2},TUSD:{maximumFractionDigits:2,minimumFractionDigits:2},DAI:{maximumFractionDigits:2,minimumFractionDigits:2},XMR:{maximumFractionDigits:4,minimumFractionDigits:4},CBET:{maximumFractionDigits:0,minimumFractionDigits:0},kCBET:{maximumFractionDigits:2,minimumFractionDigits:2},SHIB:{maximumFractionDigits:0,minimumFractionDigits:0},kSHIB:{maximumFractionDigits:4,minimumFractionDigits:2},NEO:{maximumFractionDigits:4,minimumFractionDigits:4},BSV:{maximumFractionDigits:4,minimumFractionDigits:4},EOS:{maximumFractionDigits:4,minimumFractionDigits:4},DASH:{maximumFractionDigits:4,minimumFractionDigits:4},XLM:{maximumFractionDigits:2,minimumFractionDigits:2},KRW:{maximumFractionDigits:2,minimumFractionDigits:2},kVND:{maximumFractionDigits:4,minimumFractionDigits:2},kIDR:{maximumFractionDigits:4,minimumFractionDigits:2},RSD:{maximumFractionDigits:2,minimumFractionDigits:2},STAKEGC:{displayAs:"GC",maximumFractionDigits:0,minimumFractionDigits:0},STAKESC:{displayAs:"SC",maximumFractionDigits:2,minimumFractionDigits:2},"BK.":{maximumFractionDigits:2,minimumFractionDigits:2},"BT.":{maximumFractionDigits:2,minimumFractionDigits:2},"FC.":{maximumFractionDigits:2,minimumFractionDigits:2},"GC.":{maximumFractionDigits:2,minimumFractionDigits:2},"SC.":{maximumFractionDigits:2,minimumFractionDigits:2},GC:{maximumFractionDigits:2,minimumFractionDigits:2},SC:{maximumFractionDigits:2,minimumFractionDigits:2},GLD:{displayAs:"GC.",maximumFractionDigits:2,minimumFractionDigits:2},SS1:{displayAs:"SC.",maximumFractionDigits:2,minimumFractionDigits:2},SWEP:{displayAs:"SC.",maximumFractionDigits:2,minimumFractionDigits:2},GCLC:{displayAs:"GC.",maximumFractionDigits:2,minimumFractionDigits:2},SWPC:{displayAs:"SC",maximumFractionDigits:2,minimumFractionDigits:2},LUKC:{displayAs:"LC",maximumFractionDigits:2,minimumFractionDigits:2},SVC:{maximumFractionDigits:2,minimumFractionDigits:2},DOT:{maximumFractionDigits:4,minimumFractionDigits:4},SOL:{maximumFractionDigits:4,minimumFractionDigits:4},XRP:{maximumFractionDigits:2,minimumFractionDigits:2},ADA:{maximumFractionDigits:2,minimumFractionDigits:2},TON:{maximumFractionDigits:4,minimumFractionDigits:4},FTN:{maximumFractionDigits:4,minimumFractionDigits:4},OMR:{maximumFractionDigits:2,minimumFractionDigits:2},JOD:{maximumFractionDigits:2,minimumFractionDigits:2},BHD:{maximumFractionDigits:2,minimumFractionDigits:2},KWD:{maximumFractionDigits:2,minimumFractionDigits:2},BNS:{maximumFractionDigits:2,minimumFractionDigits:2}};function B(r){return r in T}function K(r){return B(r)?{...T[r],currency:w}:{currency:r}}function j(r,i,t){const n=i.format(+r);return B(t)?n.replace(w,T[t].displayAs??t):n}function q(r,i,t){const{maximumFractionDigits:n,minimumFractionDigits:o}=t.resolvedOptions();return O(r,i,{maximumFractionDigits:n,minimumFractionDigits:o})}function V(r,i,{as:t}={as:"Currency"}){const{canShowCurrency:n,currency:o}=r;return t==="Number"||!n?`${i}`:`${i} ${o}`}function W(r,i,{as:t,from:n}={as:"Currency",from:"Money"},o){if(!["string","number"].includes(typeof i))return"NaN";const{canShowCurrency:a=!0,coinValueInCents:g,currency:x,locales:R}=r;n==="Coins"&&(i=_(+i,g));try{const H=K(x),E=new Intl.NumberFormat(R,{...H,...o,currencyDisplay:"symbol",numberingSystem:"latn",style:"currency"});return t==="Number"||!a?q(r,i,E):j(i,E,x)}catch{return V(r,i,{as:t})}}var c;class M{constructor({config:i}){e(this,c,void 0);u(this,c,i)}formatNumber(i,t){const n={locales:[m(this,c).ui.language]};return O(n,i,t)}formatCurrency(i,t={as:y.Currency,from:f.Money},n){const o=m(this,c).ui.feature.showCurrency,a=m(this,c).api.coinValueInCents,g=m(this,c).api.currency||w,x=[m(this,c).ui.language];return W({canShowCurrency:o,coinValueInCents:a,currency:g,locales:x},i,t,n)}formatCoins(i,t){return this.formatCurrency(i,{as:y.Number,from:f.Coins},t)}formatCoinsWithCurrency(i,t){return this.formatCurrency(i,{as:y.Currency,from:f.Coins},t)}formatMoney(i,t){return this.formatCurrency(i,{as:y.Number,from:f.Money},t)}formatMoneyWithCurrency(i,t){return this.formatCurrency(i,{as:y.Currency,from:f.Money},t)}}c=new WeakMap;const v=()=>{};var C,d,h,p;class X{constructor({messagePort:i}){e(this,C,void 0);e(this,d,void 0);e(this,h,void 0);e(this,p,void 0);u(this,p,i),this.on("configured",t=>{u(this,C,t),u(this,h,new M({config:t})),u(this,d,new I({config:t}))}),this.on("playResponse",t=>{this.config.api.lastRoundId=t.contract.roundId})}get config(){if(!m(this,C))throw new Error("config is not initialized, you must open game first");return m(this,C)}get history(){if(!m(this,d))throw new Error("config is not initialized, you must open game first");return m(this,d)}get i18n(){if(!m(this,h))throw new Error("i18n is not initialized, you must open game first");return m(this,h)}request(i,...[t]){return new Promise(n=>{this.on(`${i}Response`,o=>n({type:"response",response:o}),{once:!0}),this.on(`${i}Error`,o=>n({type:"error",error:o}),{once:!0}),this.send(i,t)})}on(i,t,n){const o=function a(g){g.data.message===`kalamba:wrapper:${i}`&&(v("on",g.data.message.replace(/^kalamba:/,""),g.data.payload),t(g.data.payload),n!=null&&n.once&&window.removeEventListener("message",a))};window.addEventListener("message",o)}send(i,...[t]){m(this,p).postMessage({message:`kalamba:sdk:${i}`,payload:t},"*")}configure(i){this.send("configure",i)}async openGame(){const i=new Promise(n=>this.on("configured",n,{once:!0})),t=await this.request("openGame");if(t.type==="response")return await i,t.response;throw t.error.type==="timeout"?new D.TimeoutError:new D.RgsError(t.error.data)}async play(i,t,n="SPIN"){const o={contract:i,extra:t,actionType:n},a=await this.request("play",o);if(a.type==="response")return a.response;throw a.error.type==="timeout"?new D.TimeoutError:new D.RgsError(a.error.data)}}C=new WeakMap,d=new WeakMap,h=new WeakMap,p=new WeakMap;exports.RgsError=D.RgsError;exports.RgsErrorCode=D.RgsErrorCode;exports.TimeoutError=D.TimeoutError;exports.History=I;exports.I18n=M;exports.KalambaSdk=X;
package/dist/index.d.ts CHANGED
@@ -200,7 +200,7 @@ export declare type OpenGameResponse = {
200
200
  bet: {
201
201
  available: Record<number, number[]>;
202
202
  default: Bet;
203
- max: number;
203
+ max: number | null;
204
204
  last: Bet | null;
205
205
  lastPaid: Bet | null;
206
206
  };
@@ -231,6 +231,7 @@ export declare type OpenGameResponse = {
231
231
  };
232
232
  uiMessages: unknown[];
233
233
  win: {
234
+ max: number | null;
234
235
  round: number;
235
236
  total: number;
236
237
  };
@@ -398,6 +399,7 @@ export declare interface SdkConfig {
398
399
  playMode: 'FUN' | 'REAL';
399
400
  user: string;
400
401
  sessionId: string;
402
+ backendSessionId?: string;
401
403
  lastRoundId?: string;
402
404
  };
403
405
  ui: {
@@ -436,7 +438,6 @@ export declare interface SdkConfig {
436
438
  showUi: boolean;
437
439
  };
438
440
  language: string;
439
- maximumBet?: number;
440
441
  minimumSpinDuration: number;
441
442
  requestTimeoutMs: number;
442
443
  incompleteGameResolution: {
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * BSD 3-Clause License
3
- * Copyright (c) 2024, Kalamba Games Limited
3
+ * Copyright (c) 2025, Kalamba Games Limited
4
4
  */
5
5
  var N = (n, i, t) => {
6
6
  if (!i.has(n))
@@ -11,8 +11,8 @@ var m = (n, i, t) => (N(n, i, "read from private field"), t ? t.call(n) : i.get(
11
11
  throw TypeError("Cannot add the same private member more than once");
12
12
  i instanceof WeakSet ? i.add(n) : i.set(n, t);
13
13
  }, u = (n, i, t, r) => (N(n, i, "write to private field"), r ? r.call(n, t) : i.set(n, t), t);
14
- import { T as b, R as E } from "./errors-afd9f527.js";
15
- import { a as ii } from "./errors-afd9f527.js";
14
+ import { T as b, R as A } from "./errors-7cbbda8a.js";
15
+ import { a as ii } from "./errors-7cbbda8a.js";
16
16
  function I(n) {
17
17
  const i = Object.prototype.toString.call(n);
18
18
  return n instanceof Date || typeof n == "object" && i === "[object Date]" ? new n.constructor(+n) : typeof n == "number" || i === "[object Number]" || typeof n == "string" || i === "[object String]" ? new Date(n) : /* @__PURE__ */ new Date(NaN);
@@ -31,12 +31,12 @@ function L(n) {
31
31
  function P() {
32
32
  return L(Date.now());
33
33
  }
34
- const k = 3e4;
34
+ const G = 3e4;
35
35
  var D, x;
36
- class G {
36
+ class k {
37
37
  constructor(i) {
38
38
  e(this, D, void 0);
39
- e(this, x, k);
39
+ e(this, x, G);
40
40
  u(this, D, i);
41
41
  }
42
42
  buildHeaders() {
@@ -60,7 +60,7 @@ class G {
60
60
  }
61
61
  }
62
62
  D = new WeakMap(), x = new WeakMap();
63
- const A = {
63
+ const E = {
64
64
  limit: 100,
65
65
  page: 0
66
66
  };
@@ -71,12 +71,12 @@ class $ {
71
71
  }) {
72
72
  e(this, s, void 0);
73
73
  e(this, f, void 0);
74
- u(this, s, i), u(this, f, new G({
74
+ u(this, s, i), u(this, f, new k({
75
75
  apiUrl: i.api.gameHistoryUrl
76
76
  }));
77
77
  }
78
78
  async getRound(i, {
79
- pagination: t = A
79
+ pagination: t = E
80
80
  } = {}) {
81
81
  return m(this, f).getRound(i, {
82
82
  gameCode: m(this, s).api.game,
@@ -93,7 +93,7 @@ class $ {
93
93
  fromDateTime: P(),
94
94
  toDateTime: U()
95
95
  },
96
- pagination: t = A
96
+ pagination: t = E
97
97
  } = {}) {
98
98
  const r = m(this, s).api.user.replace(/^user_/, "").replace(new RegExp(`_${m(this, s).api.integration}$`), "");
99
99
  return m(this, f).getRounds({
@@ -208,11 +208,15 @@ const w = {
208
208
  "FC.": { maximumFractionDigits: 2, minimumFractionDigits: 2 },
209
209
  "GC.": { maximumFractionDigits: 2, minimumFractionDigits: 2 },
210
210
  "SC.": { maximumFractionDigits: 2, minimumFractionDigits: 2 },
211
+ GC: { maximumFractionDigits: 2, minimumFractionDigits: 2 },
212
+ SC: { maximumFractionDigits: 2, minimumFractionDigits: 2 },
211
213
  GLD: { displayAs: "GC.", maximumFractionDigits: 2, minimumFractionDigits: 2 },
212
214
  SS1: { displayAs: "SC.", maximumFractionDigits: 2, minimumFractionDigits: 2 },
213
215
  // Softswiss
214
216
  SWEP: { displayAs: "SC.", maximumFractionDigits: 2, minimumFractionDigits: 2 },
215
217
  GCLC: { displayAs: "GC.", maximumFractionDigits: 2, minimumFractionDigits: 2 },
218
+ SWPC: { displayAs: "SC", maximumFractionDigits: 2, minimumFractionDigits: 2 },
219
+ LUKC: { displayAs: "LC", maximumFractionDigits: 2, minimumFractionDigits: 2 },
216
220
  // Silvercash
217
221
  SVC: { maximumFractionDigits: 2, minimumFractionDigits: 2 },
218
222
  // Polkadot
@@ -220,19 +224,29 @@ const w = {
220
224
  // Solana
221
225
  SOL: { maximumFractionDigits: 4, minimumFractionDigits: 4 },
222
226
  // XRP
223
- XRP: { maximumFractionDigits: 4, minimumFractionDigits: 4 },
227
+ XRP: { maximumFractionDigits: 2, minimumFractionDigits: 2 },
224
228
  // Cardano
225
- ADA: { maximumFractionDigits: 4, minimumFractionDigits: 4 },
229
+ ADA: { maximumFractionDigits: 2, minimumFractionDigits: 2 },
226
230
  // Toncoin
227
231
  TON: { maximumFractionDigits: 4, minimumFractionDigits: 4 },
228
232
  // Fasttoken
229
- FTN: { maximumFractionDigits: 4, minimumFractionDigits: 4 }
233
+ FTN: { maximumFractionDigits: 4, minimumFractionDigits: 4 },
234
+ // Omani Rial
235
+ OMR: { maximumFractionDigits: 2, minimumFractionDigits: 2 },
236
+ // Jordanian Dinar
237
+ JOD: { maximumFractionDigits: 2, minimumFractionDigits: 2 },
238
+ // Bahraini Dinar
239
+ BHD: { maximumFractionDigits: 2, minimumFractionDigits: 2 },
240
+ // Kuwaiti Dinar
241
+ KWD: { maximumFractionDigits: 2, minimumFractionDigits: 2 },
242
+ // MicroGame
243
+ BNS: { maximumFractionDigits: 2, minimumFractionDigits: 2 }
230
244
  /* eslint-enable sort-keys-fix/sort-keys-fix */
231
245
  };
232
246
  function B(n) {
233
247
  return n in w;
234
248
  }
235
- function j(n) {
249
+ function K(n) {
236
250
  return B(n) ? {
237
251
  ...w[n],
238
252
  currency: S
@@ -240,47 +254,47 @@ function j(n) {
240
254
  currency: n
241
255
  };
242
256
  }
243
- function q(n, i, t) {
257
+ function j(n, i, t) {
244
258
  const r = i.format(+n);
245
259
  return B(t) ? r.replace(S, w[t].displayAs ?? t) : r;
246
260
  }
247
- function V(n, i, t) {
248
- const { maximumFractionDigits: r, minimumFractionDigits: o } = t.resolvedOptions();
249
- return O(n, i, { maximumFractionDigits: r, minimumFractionDigits: o });
261
+ function q(n, i, t) {
262
+ const { maximumFractionDigits: r, minimumFractionDigits: a } = t.resolvedOptions();
263
+ return O(n, i, { maximumFractionDigits: r, minimumFractionDigits: a });
250
264
  }
251
- function K(n, i, { as: t } = {
265
+ function V(n, i, { as: t } = {
252
266
  as: "Currency"
253
267
  /* Currency */
254
268
  }) {
255
- const { canShowCurrency: r, currency: o } = n;
256
- return t === "Number" || !r ? `${i}` : `${i} ${o}`;
269
+ const { canShowCurrency: r, currency: a } = n;
270
+ return t === "Number" || !r ? `${i}` : `${i} ${a}`;
257
271
  }
258
- function X(n, i, { as: t, from: r } = {
272
+ function W(n, i, { as: t, from: r } = {
259
273
  as: "Currency",
260
274
  from: "Money"
261
275
  /* Money */
262
- }, o) {
276
+ }, a) {
263
277
  if (!["string", "number"].includes(typeof i))
264
278
  return "NaN";
265
- const { canShowCurrency: a = !0, coinValueInCents: g, currency: C, locales: T } = n;
279
+ const { canShowCurrency: o = !0, coinValueInCents: g, currency: h, locales: T } = n;
266
280
  r === "Coins" && (i = _(+i, g));
267
281
  try {
268
- const M = j(C), R = new Intl.NumberFormat(T, {
282
+ const M = K(h), R = new Intl.NumberFormat(T, {
269
283
  ...M,
270
- ...o,
284
+ ...a,
271
285
  currencyDisplay: "symbol",
272
286
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
273
287
  // @ts-ignore
274
288
  numberingSystem: "latn",
275
289
  style: "currency"
276
290
  });
277
- return t === "Number" || !a ? V(n, i, R) : q(i, R, C);
291
+ return t === "Number" || !o ? q(n, i, R) : j(i, R, h);
278
292
  } catch {
279
- return K(n, i, { as: t });
293
+ return V(n, i, { as: t });
280
294
  }
281
295
  }
282
296
  var c;
283
- class v {
297
+ class X {
284
298
  constructor({ config: i }) {
285
299
  e(this, c, void 0);
286
300
  u(this, c, i);
@@ -290,12 +304,12 @@ class v {
290
304
  return O(r, i, t);
291
305
  }
292
306
  formatCurrency(i, t = { as: F.Currency, from: y.Money }, r) {
293
- const o = m(this, c).ui.feature.showCurrency, a = m(this, c).api.coinValueInCents, g = m(this, c).api.currency || S, C = [m(this, c).ui.language];
294
- return X({
295
- canShowCurrency: o,
296
- coinValueInCents: a,
307
+ const a = m(this, c).ui.feature.showCurrency, o = m(this, c).api.coinValueInCents, g = m(this, c).api.currency || S, h = [m(this, c).ui.language];
308
+ return W({
309
+ canShowCurrency: a,
310
+ coinValueInCents: o,
297
311
  currency: g,
298
- locales: C
312
+ locales: h
299
313
  }, i, t, r);
300
314
  }
301
315
  formatCoins(i, t) {
@@ -312,17 +326,17 @@ class v {
312
326
  }
313
327
  }
314
328
  c = new WeakMap();
315
- const z = () => {
329
+ const v = () => {
316
330
  };
317
- var l, h, p, d;
331
+ var l, C, p, d;
318
332
  class Y {
319
333
  constructor({ messagePort: i }) {
320
334
  e(this, l, void 0);
321
- e(this, h, void 0);
335
+ e(this, C, void 0);
322
336
  e(this, p, void 0);
323
337
  e(this, d, void 0);
324
338
  u(this, d, i), this.on("configured", (t) => {
325
- u(this, l, t), u(this, p, new v({ config: t })), u(this, h, new $({ config: t }));
339
+ u(this, l, t), u(this, p, new X({ config: t })), u(this, C, new $({ config: t }));
326
340
  }), this.on("playResponse", (t) => {
327
341
  this.config.api.lastRoundId = t.contract.roundId;
328
342
  });
@@ -333,9 +347,9 @@ class Y {
333
347
  return m(this, l);
334
348
  }
335
349
  get history() {
336
- if (!m(this, h))
350
+ if (!m(this, C))
337
351
  throw new Error("config is not initialized, you must open game first");
338
- return m(this, h);
352
+ return m(this, C);
339
353
  }
340
354
  get i18n() {
341
355
  if (!m(this, p))
@@ -344,16 +358,16 @@ class Y {
344
358
  }
345
359
  request(i, ...[t]) {
346
360
  return new Promise((r) => {
347
- this.on(`${i}Response`, (o) => r({ type: "response", response: o }), {
361
+ this.on(`${i}Response`, (a) => r({ type: "response", response: a }), {
348
362
  once: !0
349
- }), this.on(`${i}Error`, (o) => r({ type: "error", error: o }), { once: !0 }), this.send(i, t);
363
+ }), this.on(`${i}Error`, (a) => r({ type: "error", error: a }), { once: !0 }), this.send(i, t);
350
364
  });
351
365
  }
352
366
  on(i, t, r) {
353
- const o = function a(g) {
354
- g.data.message === `kalamba:wrapper:${i}` && (z("on", g.data.message.replace(/^kalamba:/, ""), g.data.payload), t(g.data.payload), r != null && r.once && window.removeEventListener("message", a));
367
+ const a = function o(g) {
368
+ g.data.message === `kalamba:wrapper:${i}` && (v("on", g.data.message.replace(/^kalamba:/, ""), g.data.payload), t(g.data.payload), r != null && r.once && window.removeEventListener("message", o));
355
369
  };
356
- window.addEventListener("message", o);
370
+ window.addEventListener("message", a);
357
371
  }
358
372
  // TODO error messages
359
373
  send(i, ...[t]) {
@@ -372,21 +386,21 @@ class Y {
372
386
  const i = new Promise((r) => this.on("configured", r, { once: !0 })), t = await this.request("openGame");
373
387
  if (t.type === "response")
374
388
  return await i, t.response;
375
- throw t.error.type === "timeout" ? new b() : new E(t.error.data);
389
+ throw t.error.type === "timeout" ? new b() : new A(t.error.data);
376
390
  }
377
391
  async play(i, t, r = "SPIN") {
378
- const o = { contract: i, extra: t, actionType: r }, a = await this.request("play", o);
379
- if (a.type === "response")
380
- return a.response;
381
- throw a.error.type === "timeout" ? new b() : new E(a.error.data);
392
+ const a = { contract: i, extra: t, actionType: r }, o = await this.request("play", a);
393
+ if (o.type === "response")
394
+ return o.response;
395
+ throw o.error.type === "timeout" ? new b() : new A(o.error.data);
382
396
  }
383
397
  }
384
- l = new WeakMap(), h = new WeakMap(), p = new WeakMap(), d = new WeakMap();
398
+ l = new WeakMap(), C = new WeakMap(), p = new WeakMap(), d = new WeakMap();
385
399
  export {
386
400
  $ as History,
387
- v as I18n,
401
+ X as I18n,
388
402
  Y as KalambaSdk,
389
- E as RgsError,
403
+ A as RgsError,
390
404
  ii as RgsErrorCode,
391
405
  b as TimeoutError
392
406
  };