@betorigami/games 1.2.1 → 1.3.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/index.d.ts +77 -56
- package/dist/index.mjs +683 -673
- package/package.json +1 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
-
import { KenoRiskLevel } from '@betorigami/calculations';
|
|
4
3
|
import { ContextProvider } from '@lit/context';
|
|
5
|
-
import
|
|
4
|
+
import Big$1 from 'big.js';
|
|
6
5
|
import { CSSResult, LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
7
6
|
|
|
8
7
|
declare enum Currency {
|
|
@@ -3503,6 +3502,22 @@ declare class HapticController {
|
|
|
3503
3502
|
click(): void;
|
|
3504
3503
|
lightClick(): void;
|
|
3505
3504
|
}
|
|
3505
|
+
declare enum DiceDirection {
|
|
3506
|
+
ABOVE = "ABOVE",
|
|
3507
|
+
BELOW = "BELOW"
|
|
3508
|
+
}
|
|
3509
|
+
declare enum KenoRiskLevel {
|
|
3510
|
+
CLASSIC = "CLASSIC",
|
|
3511
|
+
LOW_RISK = "LOW_RISK",
|
|
3512
|
+
MEDIUM_RISK = "MEDIUM_RISK",
|
|
3513
|
+
HIGH_RISK = "HIGH_RISK"
|
|
3514
|
+
}
|
|
3515
|
+
declare const VALID_KENO_EDGES: readonly [
|
|
3516
|
+
1,
|
|
3517
|
+
2,
|
|
3518
|
+
3
|
|
3519
|
+
];
|
|
3520
|
+
export type KenoEdge = (typeof VALID_KENO_EDGES)[number];
|
|
3506
3521
|
declare enum OrigamiActionType {
|
|
3507
3522
|
START_BET = "START_BET",// bet started but not yet ended send to the /bet webhook
|
|
3508
3523
|
END_BET = "END_BET",// bet has been completed. Can be started and ended in 1 webhook or started in 1 and ended in another. send to the /bet webhook
|
|
@@ -3510,10 +3525,6 @@ declare enum OrigamiActionType {
|
|
|
3510
3525
|
INTERMEDIATE_BET_ACTION = "INTERMEDIATE_BET_ACTION",// bet amount was increased without game ending, such as doubling down in blackjack
|
|
3511
3526
|
INTERMEDIATE_NON_BET_ACTION = "INTERMEDIATE_NON_BET_ACTION"
|
|
3512
3527
|
}
|
|
3513
|
-
declare enum DiceDirection {
|
|
3514
|
-
ABOVE = "ABOVE",
|
|
3515
|
-
BELOW = "BELOW"
|
|
3516
|
-
}
|
|
3517
3528
|
export type DiceStartAction = {
|
|
3518
3529
|
direction: DiceDirection;
|
|
3519
3530
|
selectedValue: number;
|
|
@@ -3624,13 +3635,12 @@ declare class SoundController {
|
|
|
3624
3635
|
private buffer;
|
|
3625
3636
|
private spriteMap;
|
|
3626
3637
|
constructor(host: GameHost$2);
|
|
3627
|
-
preload(_file: string): void;
|
|
3628
3638
|
play(soundKey: BaseSound, muted?: boolean, pitch?: number, volume?: number, onEndCallback?: () => void): Promise<AudioBufferSourceNode | void>;
|
|
3629
3639
|
}
|
|
3630
3640
|
export type gameContextType = {
|
|
3631
|
-
|
|
3632
|
-
updateBetAmount: (newAmount:
|
|
3633
|
-
updateBalance: (newAmount:
|
|
3641
|
+
betAmount: string;
|
|
3642
|
+
updateBetAmount: (newAmount: Big$1) => void;
|
|
3643
|
+
updateBalance: (newAmount: Big$1) => void;
|
|
3634
3644
|
currency: Currency;
|
|
3635
3645
|
currencyDecimals: number;
|
|
3636
3646
|
showCurrencyAsText: boolean;
|
|
@@ -3656,9 +3666,10 @@ export type gameContextType = {
|
|
|
3656
3666
|
hapticController?: HapticController;
|
|
3657
3667
|
lobbyUrl: string;
|
|
3658
3668
|
depositUrl?: string;
|
|
3659
|
-
maxPayout: number;
|
|
3660
|
-
minBet: number;
|
|
3661
|
-
maxBet: number;
|
|
3669
|
+
maxPayout: number | null;
|
|
3670
|
+
minBet: number | null;
|
|
3671
|
+
maxBet: number | null;
|
|
3672
|
+
edge: number;
|
|
3662
3673
|
footerPosition: "ABOVE" | "BELOW";
|
|
3663
3674
|
logoUrl: string | null;
|
|
3664
3675
|
};
|
|
@@ -3675,9 +3686,10 @@ export declare class GameProviderWrapper extends OrigamiElement {
|
|
|
3675
3686
|
origamiGame: OrigamiGame;
|
|
3676
3687
|
lobbyUrl: string;
|
|
3677
3688
|
depositUrl: string | undefined;
|
|
3678
|
-
maxPayout: number;
|
|
3679
|
-
minBet: number;
|
|
3680
|
-
maxBet: number;
|
|
3689
|
+
maxPayout: number | null;
|
|
3690
|
+
minBet: number | null;
|
|
3691
|
+
maxBet: number | null;
|
|
3692
|
+
edge: number;
|
|
3681
3693
|
footerPosition: "ABOVE" | "BELOW";
|
|
3682
3694
|
logoUrl: string | null;
|
|
3683
3695
|
private betAmount;
|
|
@@ -3709,8 +3721,8 @@ export declare class GameProviderWrapper extends OrigamiElement {
|
|
|
3709
3721
|
updateInstantBetEnabled(enabled: boolean): void;
|
|
3710
3722
|
updateAutobetNumberOfBets(numberOfBets: number): void;
|
|
3711
3723
|
updateMainWidth(width: number): void;
|
|
3712
|
-
updateBetAmount(newAmount:
|
|
3713
|
-
updateBalance(newAmount:
|
|
3724
|
+
updateBetAmount(newAmount: Big$1): void;
|
|
3725
|
+
updateBalance(newAmount: Big$1): void;
|
|
3714
3726
|
private _boundCalculateScale;
|
|
3715
3727
|
private setupResizeObserver;
|
|
3716
3728
|
private cleanupResizeObserver;
|
|
@@ -3753,7 +3765,7 @@ export interface MinesState {
|
|
|
3753
3765
|
numGemsFound: number;
|
|
3754
3766
|
numGemsRemaining: number;
|
|
3755
3767
|
state: MinesFlowState;
|
|
3756
|
-
betAmount:
|
|
3768
|
+
betAmount: Big$1;
|
|
3757
3769
|
}
|
|
3758
3770
|
export type AfterBetEffect = "Reset" | "Increase";
|
|
3759
3771
|
declare const defaultAutobetValues: {
|
|
@@ -3769,15 +3781,6 @@ export type BetMode = "Manual" | "Auto";
|
|
|
3769
3781
|
export type AutobetToggleEvent = CustomEvent<AutobetValues & {
|
|
3770
3782
|
numberOfBets: string;
|
|
3771
3783
|
}>;
|
|
3772
|
-
export type SliderChangeEvent = CustomEvent<{
|
|
3773
|
-
value: number;
|
|
3774
|
-
}>;
|
|
3775
|
-
export type DiceMultiplierChangeEvent = CustomEvent<{
|
|
3776
|
-
multiplier: string;
|
|
3777
|
-
}>;
|
|
3778
|
-
export type DiceWinChanceChangeEvent = CustomEvent<{
|
|
3779
|
-
winChance: string;
|
|
3780
|
-
}>;
|
|
3781
3784
|
export type LimboMultiplierChangeEvent = CustomEvent<{
|
|
3782
3785
|
multiplier: string;
|
|
3783
3786
|
}>;
|
|
@@ -3806,7 +3809,7 @@ export interface AutobetSettings {
|
|
|
3806
3809
|
autobetBets?: number;
|
|
3807
3810
|
}
|
|
3808
3811
|
export interface GameBetResult {
|
|
3809
|
-
pnl:
|
|
3812
|
+
pnl: Big$1;
|
|
3810
3813
|
gameOutcome: "Win" | "Loss" | "Draw";
|
|
3811
3814
|
hasError: boolean;
|
|
3812
3815
|
errorMessage?: string;
|
|
@@ -3828,12 +3831,11 @@ declare abstract class GameComponent extends OrigamiElement {
|
|
|
3828
3831
|
protected forceUIUpdate(): Promise<void>;
|
|
3829
3832
|
protected executeInstantOrAnimated<T>(instantOperation: () => Promise<T> | T, animatedOperation: () => Promise<T> | T): Promise<T>;
|
|
3830
3833
|
protected ensureMinimumDisplayTime(hasWin?: boolean, winDisplayTime?: number, lossDisplayTime?: number): Promise<void>;
|
|
3831
|
-
firstUpdated(): void;
|
|
3832
3834
|
disconnectedCallback(): void;
|
|
3833
3835
|
toggleAutobet(event: AutobetToggleEvent): Promise<void>;
|
|
3834
3836
|
protected abstract executeAutobet(_autobetSettings: AutobetSettings, _currentBetAmount: string): Promise<GameBetResult>;
|
|
3835
3837
|
protected adjustBetAmount(autobetSettings: AutobetSettings, gameOutcome: "Win" | "Loss" | "Draw", originalBetAmount: string, currentBetAmount: string): string;
|
|
3836
|
-
protected isPnLWithinLimits(autobetSettings: AutobetSettings, totalPnL:
|
|
3838
|
+
protected isPnLWithinLimits(autobetSettings: AutobetSettings, totalPnL: Big$1): boolean;
|
|
3837
3839
|
protected updateHistoryWithBet(betResult: BetResult): void;
|
|
3838
3840
|
protected showError(message: string): void;
|
|
3839
3841
|
}
|
|
@@ -3850,6 +3852,9 @@ declare class DiceApi {
|
|
|
3850
3852
|
private authToken;
|
|
3851
3853
|
private baseUrl;
|
|
3852
3854
|
static totalDiceValue: number;
|
|
3855
|
+
static minWinChance: number;
|
|
3856
|
+
static inputValuePrecision: number;
|
|
3857
|
+
static getMaxWinChance(edge: number): number;
|
|
3853
3858
|
constructor(authToken: string, baseUrl: string);
|
|
3854
3859
|
startBet(data: DiceStartArgs): Promise<{
|
|
3855
3860
|
success: true;
|
|
@@ -3860,20 +3865,25 @@ declare class DiceApi {
|
|
|
3860
3865
|
error: string;
|
|
3861
3866
|
data?: undefined;
|
|
3862
3867
|
}>;
|
|
3863
|
-
static getMultiplier(selectedValue: number, diceDirection: DiceDirection): string;
|
|
3868
|
+
static getMultiplier(edge: number, selectedValue: number, diceDirection: DiceDirection): string;
|
|
3864
3869
|
static getWinChance(selectedValue: number, diceDirection: DiceDirection): string;
|
|
3865
|
-
static getSelectedValueFromMultiplier(
|
|
3866
|
-
static getSelectedValueFromWinChance(winChancePercentage:
|
|
3870
|
+
static getSelectedValueFromMultiplier(edge: number, multiplier: string, diceDirection: DiceDirection): number;
|
|
3871
|
+
static getSelectedValueFromWinChance(winChancePercentage: string, diceDirection: DiceDirection): number;
|
|
3867
3872
|
static getSelectedValueFromRollOver(selectedValue: number): number;
|
|
3868
|
-
static
|
|
3869
|
-
static
|
|
3873
|
+
static getWinChanceFromSelectedValue(selectedValue: number, diceDirection: DiceDirection): string;
|
|
3874
|
+
static getMinMultiplier(edge: number): string;
|
|
3875
|
+
static getMaxMultiplier(edge: number): string;
|
|
3876
|
+
static isValidMultiplier(edge: number, multiplier: string): boolean;
|
|
3877
|
+
static isValidWinChance(winChance: string, edge: number): boolean;
|
|
3870
3878
|
}
|
|
3871
3879
|
declare class MockDiceApi {
|
|
3872
|
-
private
|
|
3880
|
+
private readonly edge;
|
|
3881
|
+
constructor(edge: number);
|
|
3873
3882
|
startBet(data: DiceStartArgs): Promise<{
|
|
3874
3883
|
success: true;
|
|
3875
3884
|
data: BetResult;
|
|
3876
3885
|
}>;
|
|
3886
|
+
private static getRandomValueInRange;
|
|
3877
3887
|
}
|
|
3878
3888
|
export declare class DiceGame extends GameComponent {
|
|
3879
3889
|
static styles: import("lit").CSSResult[];
|
|
@@ -3884,11 +3894,12 @@ export declare class DiceGame extends GameComponent {
|
|
|
3884
3894
|
private isWin;
|
|
3885
3895
|
private resultValue;
|
|
3886
3896
|
private history;
|
|
3897
|
+
private _multiplierInputValid;
|
|
3898
|
+
private _winChanceInputValid;
|
|
3887
3899
|
private _diceManualEl?;
|
|
3888
3900
|
private _diceAutoEl?;
|
|
3889
3901
|
get isToggleDisabled(): boolean;
|
|
3890
3902
|
get areInputsDisabled(): boolean;
|
|
3891
|
-
firstUpdated(): void;
|
|
3892
3903
|
private isSpacebarDisabled;
|
|
3893
3904
|
private handleSpacebar;
|
|
3894
3905
|
diceRollOverToggle: () => void;
|
|
@@ -3900,9 +3911,6 @@ export declare class DiceGame extends GameComponent {
|
|
|
3900
3911
|
private handleBetExecution;
|
|
3901
3912
|
addToHistory(multiplier: number, won: boolean, id: string): void;
|
|
3902
3913
|
protected executeAutobet(_autobetSettings: AutobetSettings, currentBetAmount: string): Promise<GameBetResult>;
|
|
3903
|
-
sliderInputChange: (e: SliderChangeEvent) => void;
|
|
3904
|
-
diceMultiplierChange: (e: DiceMultiplierChangeEvent) => void;
|
|
3905
|
-
diceWinChanceChange: (e: DiceWinChanceChangeEvent) => void;
|
|
3906
3914
|
render(): import("lit-html").TemplateResult<1>;
|
|
3907
3915
|
}
|
|
3908
3916
|
export type KenoStartArgs = {
|
|
@@ -3929,12 +3937,14 @@ declare class KenoApi {
|
|
|
3929
3937
|
}>;
|
|
3930
3938
|
}
|
|
3931
3939
|
declare class MockKenoApi {
|
|
3932
|
-
private
|
|
3933
|
-
|
|
3934
|
-
startBet
|
|
3940
|
+
private readonly edge;
|
|
3941
|
+
constructor(edge: KenoEdge);
|
|
3942
|
+
startBet(data: KenoStartArgs): Promise<{
|
|
3935
3943
|
success: true;
|
|
3936
3944
|
data: BetResult;
|
|
3937
3945
|
}>;
|
|
3946
|
+
private static generateRandomTiles;
|
|
3947
|
+
private calculateMultiplier;
|
|
3938
3948
|
}
|
|
3939
3949
|
export declare class KenoGame extends GameComponent {
|
|
3940
3950
|
private isManualPlaying;
|
|
@@ -3973,7 +3983,7 @@ export declare class KenoGame extends GameComponent {
|
|
|
3973
3983
|
private handleAutoPick;
|
|
3974
3984
|
private handleClearTable;
|
|
3975
3985
|
constructor();
|
|
3976
|
-
firstUpdated(): Promise<void>;
|
|
3986
|
+
firstUpdated(changedProperties: Map<string | number | symbol, unknown>): Promise<void>;
|
|
3977
3987
|
}
|
|
3978
3988
|
export type LimboStartArgs = {
|
|
3979
3989
|
language: Language;
|
|
@@ -3986,6 +3996,11 @@ export type LimboStartArgs = {
|
|
|
3986
3996
|
declare class LimboApi {
|
|
3987
3997
|
private authToken;
|
|
3988
3998
|
private baseUrl;
|
|
3999
|
+
static inputValuePrecision: number;
|
|
4000
|
+
static minMultiplier: number;
|
|
4001
|
+
static maxMultiplier: number;
|
|
4002
|
+
static getMinWinChance(edge: number): string;
|
|
4003
|
+
static getMaxWinChance(edge: number): string;
|
|
3989
4004
|
constructor(authToken: string, baseUrl: string);
|
|
3990
4005
|
startBet: (data: LimboStartArgs) => Promise<{
|
|
3991
4006
|
success: true;
|
|
@@ -3996,18 +4011,20 @@ declare class LimboApi {
|
|
|
3996
4011
|
error: string;
|
|
3997
4012
|
data?: undefined;
|
|
3998
4013
|
}>;
|
|
3999
|
-
static calculateMultiplier(winChance: number): string;
|
|
4000
|
-
static calculateWinChance(targetMultiplier: number): string;
|
|
4014
|
+
static calculateMultiplier(winChance: number, edge: number): string;
|
|
4015
|
+
static calculateWinChance(targetMultiplier: number, edge: number): string;
|
|
4001
4016
|
static calculateProfitOnWin(amount: string, targetMultiplier: number): string;
|
|
4002
4017
|
static isValidMultiplier(multiplier: string): boolean;
|
|
4003
|
-
static isValidWinChance(winChance: string): boolean;
|
|
4018
|
+
static isValidWinChance(winChance: string, edge: number): boolean;
|
|
4004
4019
|
}
|
|
4005
4020
|
declare class MockLimboApi {
|
|
4006
|
-
private
|
|
4007
|
-
|
|
4021
|
+
private readonly edge;
|
|
4022
|
+
constructor(edge: number);
|
|
4023
|
+
startBet(data: LimboStartArgs): Promise<{
|
|
4008
4024
|
success: true;
|
|
4009
4025
|
data: BetResult;
|
|
4010
4026
|
}>;
|
|
4027
|
+
private getRandomMultiplier;
|
|
4011
4028
|
}
|
|
4012
4029
|
export declare class LimboGame extends GameComponent {
|
|
4013
4030
|
static styles: import("lit").CSSResult[];
|
|
@@ -4018,6 +4035,8 @@ export declare class LimboGame extends GameComponent {
|
|
|
4018
4035
|
private history;
|
|
4019
4036
|
private betTargetMultiplier;
|
|
4020
4037
|
private betId;
|
|
4038
|
+
private _multiplierInputValid;
|
|
4039
|
+
private _winChanceInputValid;
|
|
4021
4040
|
private _limboManualEl?;
|
|
4022
4041
|
private _limboAutoEl?;
|
|
4023
4042
|
get isToggleDisabled(): boolean;
|
|
@@ -4114,16 +4133,14 @@ declare class MinesApi {
|
|
|
4114
4133
|
};
|
|
4115
4134
|
static deriveOutcome: (bet?: BetResult) => MinesGameOutcome | null;
|
|
4116
4135
|
static deriveAutoOutcome: (bet?: BetResult | null) => MinesGameOutcome | null;
|
|
4117
|
-
static calculateMinesMultiplier: (gemsFound: number, mines: number) =>
|
|
4136
|
+
static calculateMinesMultiplier: (gemsFound: number, mines: number, edge: number) => Big$1;
|
|
4118
4137
|
static getState: (bet: BetResult) => MinesState;
|
|
4119
4138
|
}
|
|
4120
4139
|
declare class MockMinesApi {
|
|
4140
|
+
private readonly edge;
|
|
4121
4141
|
private static activeBet;
|
|
4122
4142
|
private static minePositions;
|
|
4123
|
-
|
|
4124
|
-
private static generateMinePositions;
|
|
4125
|
-
private static createBetAction;
|
|
4126
|
-
private static createMockBetResult;
|
|
4143
|
+
constructor(edge: number);
|
|
4127
4144
|
startManualBet(data: MinesManualStartArgs): Promise<{
|
|
4128
4145
|
success: true;
|
|
4129
4146
|
data: BetResult;
|
|
@@ -4159,6 +4176,10 @@ declare class MockMinesApi {
|
|
|
4159
4176
|
success: true;
|
|
4160
4177
|
data: BetResult;
|
|
4161
4178
|
}>;
|
|
4179
|
+
private static getRandomValueInRange;
|
|
4180
|
+
private static generateMinePositions;
|
|
4181
|
+
private static createBetAction;
|
|
4182
|
+
private createMockBetResult;
|
|
4162
4183
|
}
|
|
4163
4184
|
export declare class MinesGame extends GameComponent {
|
|
4164
4185
|
private minesCount;
|
|
@@ -4180,7 +4201,7 @@ export declare class MinesGame extends GameComponent {
|
|
|
4180
4201
|
get minesApi(): MinesApi | MockMinesApi;
|
|
4181
4202
|
addToHistory(multiplier: number, won: boolean, id: string): void;
|
|
4182
4203
|
getMinesActiveBet(): Promise<void>;
|
|
4183
|
-
firstUpdated(): Promise<void>;
|
|
4204
|
+
firstUpdated(changedProperties: Map<string | number | symbol, unknown>): Promise<void>;
|
|
4184
4205
|
protected updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
4185
4206
|
get getMinesState(): MinesState | null;
|
|
4186
4207
|
protected executeAutobet(_autobetSettings: AutobetSettings, currentBetAmount: string): Promise<GameBetResult>;
|