@kalamba/sdk 0.8.1 → 0.9.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.
package/dist/plugins.d.ts CHANGED
@@ -97,6 +97,52 @@ declare interface ForwardToPluginsMessageMap<SourceDomain extends DomainPrefix>
97
97
 
98
98
  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];
99
99
 
100
+ declare type FreeRound = {
101
+ conf: {
102
+ base: number;
103
+ multiplier: number;
104
+ numAwarded: number;
105
+ };
106
+ data: {
107
+ numPlayed: number;
108
+ win: number;
109
+ numLeft: number;
110
+ };
111
+ id: string;
112
+ rejectable: boolean;
113
+ skippable: boolean;
114
+ status: 'PENDING' | 'ACTIVE' | 'FINISHED';
115
+ type: string;
116
+ };
117
+
118
+ declare type FreeRoundsAction = {
119
+ action: 'ACCEPT' | 'DECLINE' | 'SKIP';
120
+ id: string;
121
+ };
122
+
123
+ declare type FreeRoundsResponse = {
124
+ action: 'ACCEPT' | 'DECLINE' | 'SKIP';
125
+ id: string;
126
+ };
127
+
128
+ declare type FreeRoundsState = {
129
+ conf: {
130
+ betMultiplier: number;
131
+ baseBet: number;
132
+ numAwarded: number;
133
+ };
134
+ data: {
135
+ numPlayed: number;
136
+ winAmount: number;
137
+ numLeft: number;
138
+ };
139
+ id: string;
140
+ rejectable: boolean;
141
+ skippable: boolean;
142
+ status: 'PENDING' | 'ACTIVE' | 'FINISHED';
143
+ type: string;
144
+ };
145
+
100
146
  declare type GameAction = string;
101
147
 
102
148
  declare type GameEventName = 'OPEN_GAME' | 'SPIN_RESULT' | 'BG_RESULT' | 'ERROR';
@@ -118,7 +164,9 @@ export declare class KalambaBullseyePlugin extends RgsPlygin {
118
164
  initialize(init: KalambaWebSocketClientInit): void;
119
165
  reconnect(init: KalambaWebSocketClientInit): Promise<void>;
120
166
  openGame(): Promise<OpenGameResponse>;
121
- play(payload: PlayRequest): Promise<PlayResponse>;
167
+ play(payload: PlayRequest & {
168
+ payloadToInject?: Record<string, unknown>;
169
+ }): Promise<PlayResponse>;
122
170
  registerFromSdkEvents(): void;
123
171
  }
124
172
 
@@ -164,7 +212,10 @@ declare class KalambaWebSocketClient extends WebSocketClient {
164
212
  private buildPayload;
165
213
  private getBodyExtras;
166
214
  private request;
167
- activateFreeRound(body: any): Promise<WebSocketResponse<any, Record<string, unknown>, unknown>>;
215
+ freeRounds(body: {
216
+ action: 'ACCEPT' | 'REJECT' | 'SKIP';
217
+ id: string;
218
+ }): Promise<unknown>;
168
219
  authenticate(reconnect?: boolean): Promise<Record<string, unknown> & {
169
220
  contract: {
170
221
  balance: number;
@@ -213,15 +264,12 @@ declare class KalambaWebSocketClient extends WebSocketClient {
213
264
  sessionId: string;
214
265
  roundWin: number;
215
266
  totalWin: number;
216
- realityCheck?: {
217
- duration: number;
218
- sumBetAmount: number;
219
- sumWinAmount: number;
220
- } | undefined;
267
+ realityCheck?: RealityCheckState | undefined;
221
268
  stateTypeThisRound: string;
222
269
  stateTypeNextRound: string;
223
270
  nextSpinType: string;
224
271
  serverTime: number;
272
+ freeRounds?: FreeRoundsState[] | undefined;
225
273
  };
226
274
  opaqueGameServerToUi: unknown;
227
275
  data: unknown;
@@ -248,15 +296,12 @@ declare class KalambaWebSocketClient extends WebSocketClient {
248
296
  roundId: string;
249
297
  roundWin: number;
250
298
  totalWin: number;
251
- realityCheck?: {
252
- duration: number;
253
- sumBetAmount: number;
254
- sumWinAmount: number;
255
- } | undefined;
299
+ realityCheck?: RealityCheckState | undefined;
256
300
  stateTypeThisRound: string;
257
301
  stateTypeNextRound: string;
258
302
  nextSpinType: string;
259
303
  serverTime: number;
304
+ freeRounds?: FreeRoundsState[] | undefined;
260
305
  };
261
306
  opaqueGameServerToUi: unknown;
262
307
  data: unknown;
@@ -298,6 +343,10 @@ export declare class LoggingTracker extends Tracker {
298
343
  track(event: unknown, data: Record<string, unknown>): void;
299
344
  }
300
345
 
346
+ declare type NestedRecord<K extends string | number | symbol, V> = {
347
+ [k in K]: V | NestedRecord<K, V>;
348
+ };
349
+
301
350
  declare type OmitFirstParam<T extends (...args: any[]) => any> = T extends (arg: any, ...rest: infer R) => infer Result ? (...args: R) => Result : never;
302
351
 
303
352
  declare type OpenGameResponse = {
@@ -313,6 +362,7 @@ declare type OpenGameResponse = {
313
362
  coins: number;
314
363
  version: number;
315
364
  };
365
+ freeRounds: FreeRound[];
316
366
  gameModel: string;
317
367
  metaData: {
318
368
  rtpValues: {
@@ -379,6 +429,7 @@ declare type PlayResponse = {
379
429
  coins: number;
380
430
  version: number;
381
431
  };
432
+ freeRounds: FreeRound[];
382
433
  roundId: string;
383
434
  serverTime: number;
384
435
  stateType: {
@@ -412,6 +463,12 @@ declare type RealityCheckConfig = {
412
463
  showSumWins: boolean;
413
464
  };
414
465
 
466
+ declare type RealityCheckState = {
467
+ duration: number;
468
+ sumBetAmount: number;
469
+ sumWinAmount: number;
470
+ };
471
+
415
472
  export declare class RelaxFEIMPlugin extends CasinoPlugin {
416
473
  VERSION: string;
417
474
  constructor(...args: ConstructorParameters<typeof CasinoPlugin>);
@@ -472,6 +529,8 @@ declare type RgsOnlyMessagePayloadMap = {
472
529
  openGameResponse: OpenGameResponse;
473
530
  playError: RgsErrorWithType;
474
531
  playResponse: PlayResponse;
532
+ freeRoundsResponse: FreeRoundsResponse;
533
+ freeRoundsError: RgsErrorWithType;
475
534
  realityCheck: {
476
535
  duration: number;
477
536
  sumBetAmount: number;
@@ -598,9 +657,7 @@ declare type SdkOnlyMessagePayloadMap = {
598
657
  playCycleEnd: PlayResponse;
599
658
  playCycleStart: ContractPlayPayload;
600
659
  playEnd: PlayResponse;
601
- playReady: {
602
- ready: boolean;
603
- };
660
+ playReady: never;
604
661
  playStart: ContractPlayPayload;
605
662
  /**
606
663
  * ```typescript
@@ -614,16 +671,15 @@ declare type SdkOnlyMessagePayloadMap = {
614
671
  * }
615
672
  * ```
616
673
  */
617
- translations: Record<string, Record<string, string>>;
674
+ translations: Record<string, NestedRecord<string, string>>;
618
675
  settings: Settings;
619
676
  'telemetry.click': {
620
677
  location: string;
621
678
  name: string;
622
679
  };
623
680
  'telemetry.orientationChange': never;
624
- freeRoundsOffer: any;
625
- freeRoundsInfo: any;
626
- freeRoundsComplete: any;
681
+ freeRounds: FreeRoundsAction;
682
+ freeRoundsPopup: never;
627
683
  };
628
684
 
629
685
  declare type Settings = {
@@ -739,11 +795,23 @@ declare type WrapperOnlyMessagePayloadMap = {
739
795
  state: WrapperState;
740
796
  suspend: never;
741
797
  unfreeze: never;
798
+ legalBets: Record<number, number[]>;
799
+ play: PlayRequest & {
800
+ payloadToInject?: Record<string, unknown>;
801
+ };
802
+ freeRounds: FreeRoundsAction;
803
+ freeRoundsOffer: FreeRound;
804
+ freeRoundsInfo: FreeRound;
805
+ freeRoundsComplete: FreeRound;
806
+ freeRoundsPopup: never;
742
807
  };
743
808
 
744
809
  declare type WrapperState = {
745
810
  balance: number;
746
811
  bet: Bet;
812
+ openGameResponse?: OpenGameResponse;
813
+ lastPlayResponse?: PlayResponse;
814
+ freeRoundId?: string;
747
815
  };
748
816
 
749
817
  export { }