@kalamba/sdk 0.30.0 → 0.37.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/plugins.d.ts CHANGED
@@ -1,1032 +1,6 @@
1
- declare type AuthenticateResponse = WebSocketResponse<'Authenticate', {
2
- code: (typeof AuthenticateResponseCode)[keyof typeof AuthenticateResponseCode];
3
- }, Record<string, unknown> & {
4
- contract: {
5
- balance: number;
6
- balanceVersion: number;
7
- coinValueInCents: number;
8
- countryCode: string;
9
- currencyCode: string;
10
- jurisdictionCode: string;
11
- uiMessages: UiMessage[];
12
- username: string;
13
- };
14
- }>;
15
-
16
- declare type AuthenticateResponse_2 = {
17
- contract: {
18
- balance: {
19
- coins: number;
20
- version: number;
21
- };
22
- coinValueInCents: number;
23
- country: string;
24
- currency: string;
25
- jurisdiction: string | null;
26
- uiMessages: unknown[];
27
- username: string;
28
- };
29
- };
30
-
31
- declare const AuthenticateResponseCode: {
32
- readonly ALREADY_LOGGED_IN: 4;
33
- readonly DENIED: 2;
34
- readonly ERROR: 5;
35
- readonly NOT_FOUND: 3;
36
- readonly OK: 1;
37
- };
38
-
39
- declare type AutoplayLimit = {
40
- enabled: boolean;
41
- showNoLimit: boolean;
42
- showCustomLimit: boolean;
43
- options: number[];
44
- };
45
-
46
- export declare class BasicPlugin extends CasinoPlugin {
47
- constructor(...args: ConstructorParameters<typeof CasinoPlugin>);
48
- registerToSdkEvents(): void;
49
- registerFromSdkEvents(): void;
50
- }
51
-
52
- declare type Bet = {
53
- base: number;
54
- multiplier: number;
55
- };
56
-
57
- declare type Cashier = {
58
- type: 'ON_DEMAND' | 'BALANCE_LOW' | 'BALANCE_INSUFFICIENT';
59
- };
60
-
61
- declare type CashierConfig = {
62
- enabled: boolean;
63
- balanceThreshold: number[];
64
- };
65
-
66
- declare type CasinoOnlyMessagePayloadMap = {
67
- balance: {
68
- balance: number;
69
- };
70
- bet: Bet;
71
- cashier: Cashier;
72
- choice: {
73
- id: string;
74
- };
75
- close: never;
76
- freeze: never;
77
- getBalance: never;
78
- help?: {
79
- show: boolean;
80
- };
81
- history: History_2;
82
- paytable?: {
83
- show: boolean;
84
- };
85
- play: PlayRequest;
86
- resume: never;
87
- settings: Settings;
88
- suspend: never;
89
- unfreeze: never;
90
- };
91
-
92
- export declare abstract class CasinoPlugin {
93
- config: WrapperConfig;
94
- sdkConfig: SdkConfig;
95
- constructor(config: WrapperConfig, sdkConfig: SdkConfig);
96
- protected on<M extends DomainMessage<'wrapper'> | ForwardToPluginsMessage<'casino'>>(message: M, listener: (payload: M extends DomainMessage<'wrapper'> ? DomainMessagePayload<'wrapper', M> : M extends ForwardToPluginsMessage<'casino'> ? ForwardToPluginsMessagePayload<'casino', M> : never) => void, options?: AddEventListenerOptions): void;
97
- protected send<M extends DomainMessage<'casino'>>(message: M, ...[payload]: DomainMessagePayload<'casino', M> extends never ? [] : undefined extends DomainMessagePayload<'casino', M> ? [] | [DomainMessagePayload<'casino', M>] : [DomainMessagePayload<'casino', M>]): void;
98
- }
99
-
100
- declare type ContractPlayPayload = {
101
- [key: string]: any;
102
- bet: Bet | null;
103
- forcedOutcomes?: unknown;
104
- };
105
-
106
- export declare class DebuggingPlugin extends CasinoPlugin {
107
- #private;
108
- constructor(...args: ConstructorParameters<typeof CasinoPlugin>);
109
- registerSdkToDebugEvents(): void;
110
- }
111
-
112
- declare type Decoder = (data: any) => unknown;
113
-
114
- declare type Decoders = keyof typeof decoders;
115
-
116
- declare const decoders: {
117
- json: (text: string, reviver?: (this: any, key: string, value: any) => any) => any;
118
- };
119
-
120
- declare type DomainAllowedPayloadMap<P extends DomainPrefix> = DomainToMessagePayloadMap[P];
121
-
122
- declare type DomainMessage<P extends DomainPrefix> = keyof DomainAllowedPayloadMap<P>;
123
-
124
- declare type DomainMessagePayload<P extends DomainPrefix, M extends DomainMessage<P>> = DomainAllowedPayloadMap<P>[M];
125
-
126
- declare type DomainPrefix = keyof DomainToMessagePayloadMap & string;
127
-
128
- declare type DomainToMessagePayloadMap = {
129
- sdk: SdkOnlyMessagePayloadMap;
130
- wrapper: WrapperOnlyMessagePayloadMap;
131
- casino: CasinoOnlyMessagePayloadMap;
132
- rgs: RgsOnlyMessagePayloadMap;
133
- telemetry: TelemetryOnlyMessagePayloadMap;
134
- };
135
-
136
- declare type Encoders = keyof typeof encoders;
137
-
138
- declare const encoders: {
139
- json: {
140
- (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
141
- (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
142
- };
143
- };
144
-
145
- export declare class EveryMatrixPlugin extends CasinoPlugin {
146
- constructor(...args: ConstructorParameters<typeof CasinoPlugin>);
147
- postMessage(event: unknown, payload?: Record<string, unknown>): void;
148
- registerToSdkEvents(): void;
149
- registerFromSdkEvents(): void;
150
- }
151
-
152
- declare type ForwardToPluginsMessage<P extends PluginDomain> = keyof ForwardToPluginsMessageMap<'sdk'>[P] | keyof ForwardToPluginsMessageMap<'rgs'>[P] | keyof ForwardToPluginsMessageMap<'casino'>[P] | keyof ForwardToPluginsMessageMap<'telemetry'>[P];
153
-
154
- declare interface ForwardToPluginsMessageMap<SourceDomain extends DomainPrefix> {
155
- casino: ToCasinoPluginsForwardedMessageMap[SourceDomain];
156
- rgs: ToRgsPluginsForwardedMessageMap[SourceDomain];
157
- telemetry: ToTelemetryPluginsForwardedMessageMap[SourceDomain];
158
- }
159
-
160
- declare type ForwardToPluginsMessagePayload<P extends PluginDomain, M extends ForwardToPluginsMessage<P>> = ForwardToPluginsMessageMap<'sdk'>[P][M] & ForwardToPluginsMessageMap<'rgs'>[P][M] & ForwardToPluginsMessageMap<'casino'>[P][M] & ForwardToPluginsMessageMap<'telemetry'>[P][M];
161
-
162
- declare type FreeRound = {
163
- conf: {
164
- base: number;
165
- multiplier: number;
166
- numAwarded: number;
167
- };
168
- data: {
169
- numPlayed: number;
170
- win: number;
171
- numLeft: number;
172
- };
173
- id: string;
174
- rejectable: boolean;
175
- skippable: boolean;
176
- status: 'PENDING' | 'ACTIVE' | 'FINISHED';
177
- type: string;
178
- };
179
-
180
- declare type FreeRoundsAction = {
181
- action: 'ACCEPT' | 'DECLINE' | 'SKIP';
182
- id: string;
183
- };
184
-
185
- declare type FreeRoundsRequest = {
186
- id: string;
187
- action: 'ACCEPT' | 'DECLINE' | 'SKIP';
188
- };
189
-
190
- declare type FreeRoundsResponse = {
191
- action: 'ACCEPT' | 'DECLINE' | 'SKIP';
192
- id: string;
193
- };
194
-
195
- declare type FreeRoundsState = {
196
- conf: {
197
- betMultiplier: number;
198
- baseBet: number;
199
- numAwarded: number;
200
- };
201
- data: {
202
- numPlayed: number;
203
- winAmount: number;
204
- numLeft: number;
205
- };
206
- id: string;
207
- rejectable: boolean;
208
- skippable: boolean;
209
- status: 'PENDING' | 'ACTIVE' | 'FINISHED';
210
- type: string;
211
- };
212
-
213
- declare type GameAction = string;
214
-
215
- declare type GameEvent<Body = Record<string, unknown>> = WebSocketResponse<'GameEvent', {
216
- code: (typeof GameEventResponseCode)[keyof typeof GameEventResponseCode];
217
- }, Body & {
218
- correlationSeqId: number;
219
- event: GameEventName;
220
- seqId: number;
221
- }>;
222
-
223
- declare type GameEventName = 'OPEN_GAME' | 'SPIN_RESULT' | 'BG_RESULT' | 'ERROR';
224
-
225
- declare const GameEventResponseCode: {
226
- readonly OK: 1;
227
- };
228
-
229
- declare type GetBalanceResponse = {
230
- balance: number;
231
- };
232
-
233
- export declare class GigPlugin extends CasinoPlugin {
234
- constructor(...args: ConstructorParameters<typeof CasinoPlugin>);
235
- postMessage(event: unknown): void;
236
- registerToSdkEvents(): void;
237
- registerFromSdkEvents(): void;
238
- }
239
-
240
- declare type History_2 = {
241
- source: 'realityCheck' | 'settings' | 'casino';
242
- };
243
-
244
- export declare const KalambaBullseyeParsers: {
245
- parseAuthenticateResponse: typeof parseAuthenticateResponse;
246
- parseAuthenticateError: typeof parseAuthenticateError;
247
- parseOpenGameResponse: typeof parseOpenGameResponse;
248
- parseOpenGameError: typeof parseOpenGameError;
249
- parsePlayResponse: typeof parsePlayResponse;
250
- parsePlayError: typeof parsePlayError;
251
- };
252
-
253
- export declare class KalambaBullseyePlugin extends RgsPlugin {
254
- socket: KalambaWebSocketClient;
255
- constructor(...args: ConstructorParameters<typeof RgsPlugin>);
256
- initialize(init: KalambaWebSocketClientInit): void;
257
- reconnect(): Promise<void>;
258
- openGame(): Promise<OpenGameResponse>;
259
- play(payload: PlayRequestEnhanced): Promise<PlayResponse>;
260
- freeRounds(payload: FreeRoundsRequest): Promise<FreeRoundsResponse>;
261
- getBalance(): Promise<GetBalanceResponse>;
262
- showHistory(): Promise<void>;
263
- }
264
-
265
- export declare class KalambaStargazerPlugin extends TelemetryPlugin {
266
- #private;
267
- FPS_SAMPLE_INTERVAL: number;
268
- constructor(...args: ConstructorParameters<typeof TelemetryPlugin>);
269
- registerEvents(): Promise<void>;
270
- reportFpsSample(): void;
271
- reportFpsRound(): void;
272
- getExtraUiInteractionData(): {
273
- orientation: string;
274
- stateType: string;
275
- };
276
- deviceInfo(): Promise<Record<string, unknown>>;
277
- }
278
-
279
- export declare class KalambaStargazerTracker extends Tracker {
280
- #private;
281
- processQueueForced: OmitFirstParam<typeof KalambaStargazerTracker.processQueue>;
282
- constructor(...args: ConstructorParameters<typeof Tracker>);
283
- subscribe(): void;
284
- schedule(): void;
285
- send(payload: Record<string, unknown>[]): void;
286
- addToQueue(payload: Record<string, unknown>): void;
287
- processQueue(forced?: boolean): void;
288
- track(eventName: unknown, eventParams: Record<string, unknown>): void;
289
- }
290
-
291
- declare class KalambaWebSocketClient extends WebSocketClient {
292
- #private;
293
- cId: number;
294
- mId: number;
295
- seqId: number;
296
- gameCode: string;
297
- eventListeners: KalambaWebSocketClientEventListeners;
298
- constructor(init: KalambaWebSocketClientInit, options: KalambaWebSocketClientOptions);
299
- private handleRealityCheck;
300
- addEventListener<K extends keyof KalambaWebSocketClientEventMap>(type: K, listener: KalambaWebSocketClientEventListener<K>): void;
301
- removeEventListener<K extends keyof KalambaWebSocketClientEventMap>(type: K, listener: KalambaWebSocketClientEventListener<K>): void;
302
- onMessage: (event: any) => void;
303
- private buildHeader;
304
- private buildPayload;
305
- private getBodyExtras;
306
- private request;
307
- freeRounds(body: {
308
- action: 'ACCEPT' | 'DECLINE' | 'SKIP';
309
- id: string;
310
- }): Promise<unknown>;
311
- authenticate(reconnect?: boolean): Promise<Record<string, unknown> & {
312
- contract: {
313
- balance: number;
314
- balanceVersion: number;
315
- coinValueInCents: number;
316
- countryCode: string;
317
- currencyCode: string;
318
- jurisdictionCode: string;
319
- uiMessages: UiMessage[];
320
- username: string;
321
- };
322
- }>;
323
- getBalance(): Promise<{
324
- balance: number;
325
- balanceVersion: string;
326
- }>;
327
- openGame(): Promise<Record<string, unknown> & {
328
- contract: {
329
- availableMultipliersPerBaseBet: Record<number, number[]>;
330
- balanceInCoins: number;
331
- balanceVersion: number;
332
- defaultBet: {
333
- baseBet: number;
334
- betMultiplier: number;
335
- };
336
- lastBet?: {
337
- baseBet: number;
338
- betMultiplier: number;
339
- };
340
- lastMainGameBet?: {
341
- baseBet: number;
342
- betMultiplier: number;
343
- };
344
- maxBetInCoins?: number;
345
- maxWinInCoins?: number;
346
- metaData: {
347
- rtpValues: {
348
- key: string;
349
- rtpValue: string;
350
- }[];
351
- maxWin: {
352
- key: string;
353
- maxWinValueXBet: number;
354
- maxWinOdds: number;
355
- }[];
356
- version: string;
357
- };
358
- uiMessages: UiMessage[];
359
- gameModelFile: string;
360
- roundId?: string;
361
- sessionId: string;
362
- roundWin: number;
363
- totalWin: number;
364
- realityCheck?: RealityCheckState;
365
- stateTypeThisRound: string;
366
- stateTypeNextRound: string;
367
- nextSpinType: string;
368
- serverTime: number;
369
- freeRounds?: FreeRoundsState[];
370
- };
371
- opaqueGameServerToUi: unknown;
372
- data: unknown;
373
- event: "OPEN_GAME";
374
- } & {
375
- correlationSeqId: number;
376
- event: GameEventName;
377
- seqId: number;
378
- }>;
379
- private sendAcknowledgement;
380
- sendAction(action: GameAction, data: any): Promise<Record<string, unknown> & {
381
- contract: {
382
- balanceInCoins: number;
383
- balanceVersion: number;
384
- lastBet?: {
385
- baseBet: number;
386
- betMultiplier: number;
387
- };
388
- lastMainGameBet: {
389
- baseBet: number;
390
- betMultiplier: number;
391
- };
392
- uiMessages: UiMessage[];
393
- roundId: string;
394
- roundWin: number;
395
- totalWin: number;
396
- realityCheck?: RealityCheckState;
397
- stateTypeThisRound: string;
398
- stateTypeNextRound: string;
399
- nextSpinType: string;
400
- serverTime: number;
401
- freeRounds?: FreeRoundsState[];
402
- };
403
- opaqueGameServerToUi: unknown;
404
- data: unknown;
405
- event: "SPIN_RESULT" | "BG_RESULT";
406
- } & {
407
- correlationSeqId: number;
408
- event: GameEventName;
409
- seqId: number;
410
- }>;
411
- setRequestTimeoutMs(ms: number): void;
412
- }
413
-
414
- declare type KalambaWebSocketClientEventListener<K extends keyof KalambaWebSocketClientEventMap> = (ev: KalambaWebSocketClientEventMap[K]) => any;
415
-
416
- declare type KalambaWebSocketClientEventListeners = {
417
- [K in keyof KalambaWebSocketClientEventMap]: KalambaWebSocketClientEventListener<K>[];
418
- };
419
-
420
- declare type KalambaWebSocketClientEventMap = WebSocketClientEventMap & {
421
- realityCheck: RealityCheck['body'];
422
- };
423
-
424
- declare interface KalambaWebSocketClientInit {
425
- apiUrl: string;
426
- cageCode: string;
427
- gameCode: string;
428
- operatorCode: string;
429
- playMode: string;
430
- token: string;
431
- username: string;
432
- }
433
-
434
- declare interface KalambaWebSocketClientOptions {
435
- gameVersion: string;
436
- requestTimeoutMs: number;
437
- }
438
-
439
- export declare class LoggingTracker extends Tracker {
440
- track(event: unknown, data: Record<string, unknown>): void;
441
- }
442
-
443
- declare type NestedRecord<K extends string | number | symbol, V> = {
444
- [k in K]: V | NestedRecord<K, V>;
445
- };
446
-
447
- declare type OmitFirstParam<T extends (...args: any[]) => any> = T extends (arg: any, ...rest: infer R) => infer Result ? (...args: R) => Result : never;
448
-
449
- declare type OpenGameGameEvent = GameEvent<Record<string, unknown> & {
450
- contract: {
451
- availableMultipliersPerBaseBet: Record<number, number[]>;
452
- balanceInCoins: number;
453
- balanceVersion: number;
454
- defaultBet: {
455
- baseBet: number;
456
- betMultiplier: number;
457
- };
458
- lastBet?: {
459
- baseBet: number;
460
- betMultiplier: number;
461
- };
462
- lastMainGameBet?: {
463
- baseBet: number;
464
- betMultiplier: number;
465
- };
466
- maxBetInCoins?: number;
467
- maxWinInCoins?: number;
468
- metaData: {
469
- rtpValues: {
470
- key: string;
471
- rtpValue: string;
472
- }[];
473
- maxWin: {
474
- key: string;
475
- maxWinValueXBet: number;
476
- maxWinOdds: number;
477
- }[];
478
- version: string;
479
- };
480
- uiMessages: UiMessage[];
481
- gameModelFile: string;
482
- roundId?: string;
483
- sessionId: string;
484
- roundWin: number;
485
- totalWin: number;
486
- realityCheck?: RealityCheckState;
487
- stateTypeThisRound: string;
488
- stateTypeNextRound: string;
489
- nextSpinType: string;
490
- serverTime: number;
491
- freeRounds?: FreeRoundsState[];
492
- };
493
- opaqueGameServerToUi: unknown;
494
- data: unknown;
495
- event: 'OPEN_GAME';
496
- }>;
497
-
498
- declare type OpenGameResponse = {
499
- contract: {
500
- bet: {
501
- available: Record<number, number[]>;
502
- default: Bet;
503
- max: number | null;
504
- last: Bet | null;
505
- lastPaid: Bet | null;
506
- };
507
- balance: {
508
- coins: number;
509
- version: number;
510
- };
511
- freeRounds: FreeRound[];
512
- gameModel: string;
513
- metaData: {
514
- rtpValues: {
515
- key: string;
516
- rtpValue: string;
517
- }[];
518
- maxWin: {
519
- key: string;
520
- maxWinValueXBet: number;
521
- maxWinOdds: number;
522
- }[];
523
- version: string;
524
- };
525
- roundId?: string;
526
- serverTime: number;
527
- sessionId: string;
528
- stateType: {
529
- thisRound: string;
530
- nextRound: string;
531
- };
532
- uiMessages: unknown[];
533
- win: {
534
- max: number | null;
535
- round: number;
536
- total: number;
537
- };
538
- };
539
- data: unknown;
540
- };
541
-
542
- export declare class OryxPlugin extends CasinoPlugin {
543
- constructor(...args: ConstructorParameters<typeof CasinoPlugin>);
544
- registerToSdkEvents(): void;
545
- registerFromSdkEvents(): void;
546
- }
547
-
548
- export declare class PariplayPlugin extends CasinoPlugin {
549
- constructor(...args: ConstructorParameters<typeof CasinoPlugin>);
550
- postMessage(type: string, data?: unknown): void;
551
- coinsToCurrency(coins: number): number;
552
- handleContinueButton(button: any, next: any): void;
553
- handleLinkButton(button: any, next: any): void;
554
- handleQuitButton(button: any, next: any): void;
555
- handleCashierButton(button: any, next: any): void;
556
- handleHistoryButton(button: any, next: any): void;
557
- get buttonActions(): any;
558
- processInfoUiMessages(uiMessages: any[]): any;
559
- registerToSdkEvents(): void;
560
- registerFromSdkEvents(): void;
561
- }
562
-
563
- declare function parseAuthenticateError(errorResponse: any): RgsErrorData;
564
-
565
- declare function parseAuthenticateResponse(authResponse: AuthenticateResponse['body']): AuthenticateResponse_2;
566
-
567
- declare function parseOpenGameError(errorResponse: any): RgsErrorData;
568
-
569
- declare function parseOpenGameResponse(authResponse: AuthenticateResponse['body'], openGameResponse: OpenGameGameEvent['body'], dataDecoder?: Decoder): OpenGameResponse;
570
-
571
- declare function parsePlayError(errorResponse: any): RgsErrorData;
572
-
573
- declare function parsePlayResponse(playResponse: ResultGameEvent['body'], dataDecoder?: Decoder): PlayResponse;
574
-
575
- declare type PlayRequest = {
576
- contract: ContractPlayPayload;
577
- extra?: unknown;
578
- };
579
-
580
- declare type PlayRequestEnhanced = PlayRequest & {
581
- payloadToInject?: Record<string, unknown>;
582
- };
583
-
584
- declare type PlayResponse = {
585
- contract: {
586
- bet: {
587
- last: Bet | null;
588
- lastPaid: Bet;
589
- };
590
- balance: {
591
- coins: number;
592
- version: number;
593
- };
594
- freeRounds: FreeRound[];
595
- roundId: string;
596
- serverTime: number;
597
- stateType: {
598
- thisRound: string;
599
- nextRound: string;
600
- };
601
- uiMessages: unknown[];
602
- win: {
603
- round: number;
604
- total: number;
605
- };
606
- };
607
- data: unknown;
608
- };
609
-
610
- declare type PluginDomain = keyof ForwardToPluginsMessageMap<any>;
611
-
612
- export declare class QuantaPlugin extends CasinoPlugin {
613
- constructor(...args: ConstructorParameters<typeof CasinoPlugin>);
614
- postMessage(event: unknown): void;
615
- registerFromSdkEvents(): void;
616
- }
617
-
618
- declare type RealityCheck = WebSocketResponse<'RealityCheck', Record<string, unknown>, {
619
- duration: number;
620
- sumBetAmount: number;
621
- sumWinAmount: number;
622
- }>;
623
-
624
- declare type RealityCheckConfig = {
625
- sessionDurationPeriodFormat: 'seconds' | 'minutes' | 'hours';
626
- showCloseGame: boolean;
627
- showHistory: boolean;
628
- showNetPosition: boolean;
629
- showSessionDuration: boolean;
630
- showSumBets: boolean;
631
- showSumWins: boolean;
632
- };
633
-
634
- declare type RealityCheckState = {
635
- duration: number;
636
- sumBetAmount: number;
637
- sumWinAmount: number;
638
- };
639
-
640
- export declare class RelaxFEIMPlugin extends CasinoPlugin {
641
- VERSION: string;
642
- constructor(...args: ConstructorParameters<typeof CasinoPlugin>);
643
- registerToSdkEvents(): void;
644
- registerFromSdkEvents(): void;
645
- }
646
-
647
- declare type ResponseMessageName = 'Authenticate' | 'GameAction' | 'GameEvent' | 'GetBalance' | 'OpenGame' | 'Ping' | 'RealityCheck';
648
-
649
- declare type ResultGameEvent = GameEvent<Record<string, unknown> & {
650
- contract: {
651
- balanceInCoins: number;
652
- balanceVersion: number;
653
- lastBet?: {
654
- baseBet: number;
655
- betMultiplier: number;
656
- };
657
- lastMainGameBet: {
658
- baseBet: number;
659
- betMultiplier: number;
660
- };
661
- uiMessages: UiMessage[];
662
- roundId: string;
663
- roundWin: number;
664
- totalWin: number;
665
- realityCheck?: RealityCheckState;
666
- stateTypeThisRound: string;
667
- stateTypeNextRound: string;
668
- nextSpinType: string;
669
- serverTime: number;
670
- freeRounds?: FreeRoundsState[];
671
- };
672
- opaqueGameServerToUi: unknown;
673
- data: unknown;
674
- event: 'SPIN_RESULT' | 'BG_RESULT';
675
- }>;
676
-
677
- declare const RgsErrorCode: {
678
- readonly CONNECTION_ERROR: "CONNECTION_ERROR";
679
- readonly INVALID_BET_CURRENCY: "INVALID_BET_CURRENCY";
680
- readonly INVALID_BET: "INVALID_BET";
681
- readonly INVALID_CAGE_CODE: "INVALID_CAGE_CODE";
682
- readonly INVALID_CLIENT_TYPE: "INVALID_CLIENT_TYPE";
683
- readonly INVALID_MESSAGE_FORMAT: "INVALID_MESSAGE_FORMAT";
684
- readonly INVALID_SESSION: "INVALID_SESSION";
685
- readonly TOO_HIGH_BET_FREQUENCY: "TOO_HIGH_BET_FREQUENCY";
686
- readonly TOO_HIGH_ACTION_FREQUENCY: "TOO_HIGH_ACTION_FREQUENCY";
687
- readonly USER_LOCK_INVALID_PARAMS: "USER_LOCK_INVALID_PARAMS";
688
- readonly USER_ALREADY_LOCKED: "USER_ALREADY_LOCKED";
689
- readonly GAME_SERVER_ERROR: "GAME_SERVER_ERROR";
690
- readonly SESSION_MANAGEMENT_ERROR: "SESSION_MANAGEMENT_ERROR";
691
- readonly MESSAGE_SENDER_ERROR: "MESSAGE_SENDER_ERROR";
692
- readonly FREE_ROUNDS_PROCESSING_ERROR: "FREE_ROUNDS_PROCESSING_ERROR";
693
- readonly WEB_SESSION_NOT_OPEN: "WEB_SESSION_NOT_OPEN";
694
- readonly GAMING_LIMITS_REACHED: "GAMING_LIMITS_REACHED";
695
- readonly OUT_OF_MONEY: "OUT_OF_MONEY";
696
- readonly UNFINISHED_ROUND_IN_PROGRESS: "UNFINISHED_ROUND_IN_PROGRESS";
697
- readonly ACCESS_DENIED: "ACCESS_DENIED";
698
- readonly CREDENTIALS_NOT_FOUND: "CREDENTIALS_NOT_FOUND";
699
- readonly ALREADY_LOGGED_IN: "ALREADY_LOGGED_IN";
700
- readonly GAME_UNAVAILABLE: "GAME_UNAVAILABLE";
701
- readonly BONUS_RESTRICTION: "BONUS_RESTRICTION";
702
- readonly TOO_MANY_OPEN_GAMES: "TOO_MANY_OPEN_GAMES";
703
- readonly GAME_FROZEN: "GAME_FROZEN";
704
- readonly WALLET_PROCESSING_ERROR: "WALLET_PROCESSING_ERROR";
705
- readonly FORCED_OUTCOMES_NOT_ALLOWED: "FORCED_OUTCOMES_NOT_ALLOWED";
706
- readonly MISSING_GAME_STATE: "MISSING_GAME_STATE";
707
- readonly DATA_ACCESS_ERROR: "DATA_ACCESS_ERROR";
708
- readonly UNKNOWN: "UNKNOWN";
709
- };
710
-
711
- declare type RgsErrorData = {
712
- code: keyof typeof RgsErrorCode;
713
- details?: unknown;
714
- };
715
-
716
- declare type RgsErrorWithType = {
717
- type: 'timeout';
718
- } | {
719
- type: 'error';
720
- data: RgsErrorData;
721
- };
722
-
723
- declare type RgsOnlyMessagePayloadMap = {
724
- error: SdkError;
725
- openGameError: RgsErrorWithType;
726
- openGameResponse: OpenGameResponse;
727
- playError: RgsErrorWithType;
728
- playResponse: PlayResponse;
729
- freeRoundsResponse: FreeRoundsResponse;
730
- freeRoundsError: RgsErrorWithType;
731
- realityCheck: {
732
- duration: number;
733
- sumBetAmount: number;
734
- sumWinAmount: number;
735
- };
736
- balance: {
737
- balance: number;
738
- };
739
- };
740
-
741
- export declare abstract class RgsPlugin {
742
- config: WrapperConfig;
743
- sdkConfig: SdkConfig;
744
- error?: RgsErrorWithType;
745
- constructor(config: WrapperConfig, sdkConfig: SdkConfig);
746
- 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;
747
- 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;
748
- openGame(): Promise<OpenGameResponse>;
749
- play(payload: PlayRequestEnhanced): Promise<PlayResponse>;
750
- freeRounds(payload: FreeRoundsRequest): Promise<FreeRoundsResponse>;
751
- getBalance(): Promise<GetBalanceResponse>;
752
- showHistory(): Promise<void>;
753
- }
754
-
755
- declare interface SdkConfig {
756
- api: {
757
- brand: string;
758
- cashierUrl?: string;
759
- coinValueInCents: number;
760
- country: string;
761
- currency: string;
762
- game: string;
763
- gameHistoryUrl: string;
764
- homeUrl?: string;
765
- integration: string;
766
- integrationData?: unknown;
767
- jurisdiction: string | null;
768
- playMode: 'FUN' | 'REAL';
769
- user: string;
770
- sessionId: string;
771
- backendSessionId?: string;
772
- };
773
- ui: {
774
- autoplay: {
775
- enabled: boolean;
776
- rounds: AutoplayLimit;
777
- lossLimit: AutoplayLimit;
778
- winLimit: AutoplayLimit;
779
- simple: boolean;
780
- stopOnFeature: boolean;
781
- };
782
- cashier: CashierConfig;
783
- feature: {
784
- allowTelemetry: boolean;
785
- allowFullscreen: boolean;
786
- allowGamble: boolean;
787
- allowQuickStop: boolean;
788
- showCashier: boolean;
789
- showClock: boolean;
790
- showCloseGame: boolean;
791
- showCurrency: boolean;
792
- showFastPlay: boolean;
793
- showFeatureBuy: boolean;
794
- showFeatureIntro: boolean;
795
- showFeatureOutro: boolean;
796
- showFunModeBanner: boolean;
797
- showHistory: boolean;
798
- showLowWinCelebration: boolean;
799
- showMaximumWin: boolean;
800
- showNetPosition: boolean;
801
- showPaylineLines: boolean;
802
- showPaytable: boolean;
803
- showRoundId: boolean;
804
- showRtp: boolean;
805
- showRules: boolean;
806
- showSessionDuration: boolean;
807
- showUi: boolean;
808
- };
809
- language: string;
810
- minimumSpinDuration: number;
811
- requestTimeoutMs: number;
812
- incompleteGameResolution: {
813
- type: 'NONE' | 'MANUAL';
814
- } | {
815
- daysToAutoResolution: number;
816
- type: 'AUTOMATIC';
817
- };
818
- realityCheck: RealityCheckConfig;
819
- skipInsufficientFundsCheck: boolean;
820
- skipSplash: boolean;
821
- cheatPanel: boolean;
822
- };
823
- }
824
-
825
- declare type SdkError = {
826
- messageCode: string;
827
- type: 'CLOSE' | 'RELOAD' | 'CONTINUE';
828
- } & ({
829
- message: string;
830
- } | {
831
- messageKey: string;
832
- });
833
-
834
- declare type SdkOnlyMessagePayloadMap = {
835
- configure: Partial<WrapperConfig>;
836
- autoplay: {
837
- action: 'start' | 'stop' | 'pause' | 'resume';
838
- };
839
- balance: {
840
- balance: number;
841
- };
842
- bet: Bet;
843
- cashier: Cashier;
844
- choice: {
845
- message: string;
846
- options: {
847
- id: string;
848
- label: string;
849
- }[];
850
- };
851
- close: never;
852
- error: SdkError;
853
- fullscreen: {
854
- lock?: OrientationLockType;
855
- };
856
- history: History_2;
857
- loadEnd: never;
858
- loadProgress: {
859
- progress: number;
860
- };
861
- loadStart: never;
862
- openGame: never;
863
- play: PlayRequest;
864
- playCycleEnd: PlayResponse;
865
- playCycleStart: ContractPlayPayload;
866
- playEnd: PlayResponse;
867
- playReady: never;
868
- playStart: ContractPlayPayload;
869
- /**
870
- * ```typescript
871
- * {
872
- * my_custom_error: 'Something went wrong',
873
- * RgsError: {
874
- * OUT_OF_MONEY: 'You are out of credits',
875
- * }
876
- * }
877
- * ```
878
- */
879
- translations: NestedRecord<string, string>;
880
- settings: Settings;
881
- 'telemetry.click': {
882
- location: string;
883
- name: string;
884
- };
885
- 'telemetry.orientationChange': never;
886
- freeRounds: FreeRoundsAction;
887
- freeRoundsPopup: never;
888
- };
889
-
890
- declare type Settings = {
891
- fastPlay?: boolean;
892
- sounds?: boolean;
893
- music?: boolean;
894
- };
895
-
896
- export declare class SoftSwissPlugin extends CasinoPlugin {
897
- constructor(...args: ConstructorParameters<typeof CasinoPlugin>);
898
- postMessage(event: unknown, payload?: Record<string, unknown>): void;
899
- registerFromSdkEvents(): void;
900
- }
901
-
902
- declare type TelemetryOnlyMessagePayloadMap = {
903
- [key: string]: unknown;
904
- };
905
-
906
- export declare abstract class TelemetryPlugin {
907
- trackers: Tracker[];
908
- config: WrapperConfig;
909
- sdkConfig: SdkConfig;
910
- constructor(trackers: Tracker[], config: WrapperConfig, sdkConfig: SdkConfig);
911
- protected on<M extends DomainMessage<'wrapper'> | ForwardToPluginsMessage<'telemetry'>>(message: M, listener: (payload: M extends DomainMessage<'wrapper'> ? DomainMessagePayload<'wrapper', M> : M extends ForwardToPluginsMessage<'telemetry'> ? ForwardToPluginsMessagePayload<'telemetry', M> : never) => void, options?: AddEventListenerOptions): void;
912
- protected track(event: unknown, data: Record<string, unknown>): void;
913
- }
914
-
915
- declare type ToCasinoPluginsForwardedMessageMap = {
916
- sdk: Pick<SdkOnlyMessagePayloadMap, 'autoplay' | 'balance' | 'bet' | 'cashier' | 'choice' | 'close' | 'configure' | 'error' | 'history' | 'loadEnd' | 'loadProgress' | 'loadStart' | 'openGame' | 'play' | 'playCycleEnd' | 'playCycleStart' | 'playEnd' | 'playReady' | 'playStart' | 'settings' | 'fullscreen'>;
917
- casino: undefined;
918
- rgs: Pick<RgsOnlyMessagePayloadMap, 'playResponse' | 'playError' | 'openGameResponse'>;
919
- telemetry: undefined;
920
- wrapper: undefined;
921
- };
922
-
923
- declare type ToRgsPluginsForwardedMessageMap = {
924
- sdk: Pick<SdkOnlyMessagePayloadMap, 'history' | 'openGame' | 'play'>;
925
- casino: Pick<CasinoOnlyMessagePayloadMap, 'play' | 'cashier' | 'close' | 'history' | 'getBalance'>;
926
- rgs: undefined;
927
- telemetry: undefined;
928
- wrapper: undefined;
929
- };
930
-
931
- declare type ToTelemetryPluginsForwardedMessageMap = {
932
- sdk: Pick<SdkOnlyMessagePayloadMap, 'autoplay' | 'error' | 'loadStart' | 'loadProgress' | 'loadEnd' | 'playCycleStart' | 'playCycleEnd' | 'settings' | 'telemetry.click' | 'telemetry.orientationChange'>;
933
- casino: undefined;
934
- rgs: Pick<RgsOnlyMessagePayloadMap, 'openGameResponse' | 'openGameError' | 'playResponse' | 'playError'>;
935
- telemetry: undefined;
936
- wrapper: undefined;
937
- };
938
-
939
- export declare abstract class Tracker {
940
- config: WrapperConfig;
941
- sdkConfig: SdkConfig;
942
- constructor(config: WrapperConfig, sdkConfig: SdkConfig);
943
- abstract track(event: unknown, data: Record<string, unknown>): void;
944
- }
945
-
946
- export declare class TukoPlugin extends CasinoPlugin {
947
- PING_INTERVAL: number;
948
- constructor(...args: ConstructorParameters<typeof CasinoPlugin>);
949
- ping(url: string): void;
950
- registerToSdkEvents(): void;
951
- registerFromSdkEvents(): void;
952
- }
953
-
954
- declare type UiMessage = unknown;
955
-
956
- declare class WebSocketClient {
957
- socket: WebSocket | null;
958
- webSocketUrl: string;
959
- eventListeners: WebSocketClientEventListeners;
960
- constructor(webSocketUrl: string);
961
- connect: () => Promise<unknown>;
962
- send: (payload: any) => void;
963
- close: () => void;
964
- addEventListener<K extends keyof WebSocketClientEventMap>(type: K, listener: WebSocketClientEventListener<K>): void;
965
- removeEventListener<K extends keyof WebSocketClientEventMap>(type: K, listener: WebSocketClientEventListener<K>): void;
966
- handleClose: (event: WebSocketEventMap["close"]) => void;
967
- handleError: (event: WebSocketEventMap["error"]) => void;
968
- handleMessage: (event: WebSocketEventMap["message"]) => void;
969
- handleOpen: (event: WebSocketEventMap["open"]) => void;
970
- }
971
-
972
- declare type WebSocketClientEventListener<K extends keyof WebSocketClientEventMap> = (ev: WebSocketClientEventMap[K]) => any;
973
-
974
- declare type WebSocketClientEventListeners = {
975
- [K in keyof WebSocketClientEventMap]: WebSocketClientEventListener<K>[];
976
- };
977
-
978
- declare type WebSocketClientEventMap = Pick<WebSocketEventMap, 'close' | 'error' | 'message'>;
979
-
980
- declare interface WebSocketResponse<Name extends ResponseMessageName, Header = Record<string, unknown>, Body = unknown> {
981
- body: Body;
982
- header: Header & {
983
- cId: number;
984
- mId: number;
985
- name: Name;
986
- };
987
- }
988
-
989
- declare type WrapperConfig = {
990
- dataDecoder?: Decoders;
991
- dataEncoder?: Encoders;
992
- gameName: string;
993
- gameVersion: string;
994
- gameHistoryUrl?: string;
995
- showFreeRounds: boolean;
996
- showPromoPanel: boolean;
997
- showRealityCheck: boolean;
998
- showErrors: boolean;
999
- showBars: boolean;
1000
- skipErrors: ((typeof RgsErrorCode)[keyof typeof RgsErrorCode] | 'TIMEOUT')[];
1001
- };
1002
-
1003
- declare type WrapperOnlyMessagePayloadMap = {
1004
- bet: Bet;
1005
- close: never;
1006
- configured: SdkConfig;
1007
- error: SdkError;
1008
- freeze: never;
1009
- history: History_2;
1010
- resume: never;
1011
- state: WrapperState;
1012
- suspend: never;
1013
- unfreeze: never;
1014
- legalBets: Record<number, number[]>;
1015
- play: PlayRequestEnhanced;
1016
- freeRounds: FreeRoundsAction;
1017
- freeRoundsOffer: FreeRound;
1018
- freeRoundsInfo: FreeRound;
1019
- freeRoundsComplete: FreeRound;
1020
- freeRoundsPopup: never;
1021
- };
1022
-
1023
- declare type WrapperState = {
1024
- isSdkConfigured: boolean;
1025
- balance: number;
1026
- bet: Bet;
1027
- openGameResponse?: OpenGameResponse;
1028
- lastPlayResponse?: PlayResponse;
1029
- freeRoundId?: string;
1030
- };
1031
-
1032
- export { }
1
+ /**
2
+ * BSD 3-Clause License
3
+ * Copyright (c) 2026, Kalamba Games Limited
4
+ */
5
+ import { i as CasinoPlugin, n as Tracker, r as RgsPlugin, t as TelemetryPlugin } from "./index-B_FWnjNV.js";
6
+ export { CasinoPlugin, RgsPlugin, TelemetryPlugin, Tracker };