shufflecom-calculations 4.1.1 → 4.1.3

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.
@@ -0,0 +1,17 @@
1
+ import { RandomNumberGenerator } from './random-number-generator.interface';
2
+
3
+ export class TrueRandomRng implements RandomNumberGenerator {
4
+ getRandomIntsWithReplacement({ min, max, count }: { min: number; max: number; count: number }): number[] {
5
+ return Array.from({ length: count }, () => min + Math.floor(Math.random() * (max - min + 1)));
6
+ }
7
+
8
+ getRandomIntsWithoutReplacement({ min, max, count }: { min: number; max: number; count: number }): number[] {
9
+ const pool = Array.from({ length: max - min + 1 }, (_, i) => min + i);
10
+ const result: number[] = [];
11
+ for (let i = 0; i < count; i++) {
12
+ const index = Math.floor(Math.random() * pool.length);
13
+ result.push(pool.splice(index, 1)[0]);
14
+ }
15
+ return result;
16
+ }
17
+ }
package/src/index.ts CHANGED
@@ -51,3 +51,5 @@ export * from './games/coinflip/coinflip-rules';
51
51
  export * from './games/coinflip/coinflip-classic';
52
52
  export * from './games/coinflip/coinflip-classic-progressive';
53
53
  export * from './games/coinflip/coinflip-target';
54
+ export * from './games/floor-is-lava';
55
+ export * from './games/floor-is-lava-rules';
@@ -638,21 +638,12 @@ export class MarketLayout {
638
638
  marketDisplayType: SportsMarketDisplayType;
639
639
  }
640
640
 
641
- export enum MarketInfoVariantKey {
642
- MAP = 'MAP',
643
- }
644
-
645
- export type MapVariant = string;
646
-
647
641
  export class BaseDisplayGroup {
648
642
  groupKey: string;
649
643
  groupName: string;
650
644
  groupSortName: string;
651
645
  selectionGroups: SelectionGroup[] | null;
652
646
  layout: MarketLayout;
653
- variantData: Nullable<{
654
- [MarketInfoVariantKey.MAP]?: MapVariant; // used for map market of oddin
655
- }>;
656
647
  is2UpAvailable: boolean;
657
648
  }
658
649
 
@@ -720,10 +711,16 @@ export class SportsNewMarketOddsUpdate extends SportsMarketOddsBase {
720
711
  expiryTime: Nullable<Date>;
721
712
  }
722
713
 
714
+ export class SgmSubGroup {
715
+ group: SportsMarketGroup;
716
+ weight: number;
717
+ }
718
+
723
719
  export class SportsMarketInfo {
724
720
  odds: SportsNewMarketOddsUpdate[];
725
721
  display: DisplayGroup[];
726
722
  updatedAt: Nullable<Date>;
723
+ sgmSubGroups: Nullable<SgmSubGroup[]>;
727
724
  }
728
725
 
729
726
  export class SportsMarketSubInfo extends SportsMarketInfo {