@betorigami/games 0.0.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/components/dice/DiceContent/DiceContent.d.ts +14 -0
- package/dist/components/dice/DiceContent/DiceContent.styles.d.ts +1 -0
- package/dist/components/dice/DiceContentBottom/DiceContentBottom.d.ts +15 -0
- package/dist/components/dice/DiceContentBottom/DiceContentBottom.styles.d.ts +1 -0
- package/dist/components/dice/DiceControls/DiceAuto.d.ts +9 -0
- package/dist/components/dice/DiceControls/DiceControls.styles.d.ts +1 -0
- package/dist/components/dice/DiceControls/DiceManual.d.ts +11 -0
- package/dist/components/dice/DiceGame.d.ts +47 -0
- package/dist/components/dice/DiceSlider/DiceSlider.d.ts +16 -0
- package/dist/components/dice/DiceSlider/DiceSlider.styles.d.ts +1 -0
- package/dist/components/dice/dice.api.d.ts +71 -0
- package/dist/components/dice/dice.mock.api.d.ts +13 -0
- package/dist/components/keno/KenoContent/KenoContent.d.ts +17 -0
- package/dist/components/keno/KenoContent/KenoContent.styles.d.ts +1 -0
- package/dist/components/keno/KenoContent/KenoContentBottom.d.ts +14 -0
- package/dist/components/keno/KenoContent/KenoContentBottom.styles.d.ts +1 -0
- package/dist/components/keno/KenoControls/KenoAuto.d.ts +9 -0
- package/dist/components/keno/KenoControls/KenoControls.styles.d.ts +1 -0
- package/dist/components/keno/KenoControls/KenoManual.d.ts +10 -0
- package/dist/components/keno/KenoGame.d.ts +30 -0
- package/dist/components/keno/KenoGrid/KenoGrid.d.ts +24 -0
- package/dist/components/keno/KenoGrid/KenoGrid.styles.d.ts +1 -0
- package/dist/components/keno/KenoTile/KenoTile.d.ts +16 -0
- package/dist/components/keno/KenoTile/KenoTile.styles.d.ts +1 -0
- package/dist/components/keno/keno.api.d.ts +67 -0
- package/dist/components/keno/keno.mock.api.d.ts +15 -0
- package/dist/components/limbo/LimboContent/LimboContent.d.ts +13 -0
- package/dist/components/limbo/LimboContent/LimboContent.styles.d.ts +1 -0
- package/dist/components/limbo/LimboContentBottom/LimboContentBottom.d.ts +14 -0
- package/dist/components/limbo/LimboContentBottom/LimboContentBottom.styles.d.ts +1 -0
- package/dist/components/limbo/LimboControls/LimboAuto.d.ts +9 -0
- package/dist/components/limbo/LimboControls/LimboControls.styles.d.ts +1 -0
- package/dist/components/limbo/LimboControls/LimboManual.d.ts +11 -0
- package/dist/components/limbo/LimboGame.d.ts +27 -0
- package/dist/components/limbo/Multiplier/LimboMultiplier.d.ts +17 -0
- package/dist/components/limbo/Multiplier/LimboMultiplier.styles.d.ts +1 -0
- package/dist/components/limbo/limbo.api.d.ts +62 -0
- package/dist/components/limbo/limbo.mock.api.d.ts +13 -0
- package/dist/components/mines/Controls/MinesAuto.d.ts +13 -0
- package/dist/components/mines/Controls/MinesControls.styles.d.ts +1 -0
- package/dist/components/mines/Controls/MinesManual.d.ts +11 -0
- package/dist/components/mines/MinesGame.d.ts +34 -0
- package/dist/components/mines/MinesGrid/MinesGrid.d.ts +29 -0
- package/dist/components/mines/MinesGrid/MinesGrid.styles.d.ts +1 -0
- package/dist/components/mines/MinesTile/MinesTile.d.ts +21 -0
- package/dist/components/mines/MinesTile/MinesTile.styles.d.ts +1 -0
- package/dist/components/mines/mines.api.d.ts +122 -0
- package/dist/components/mines/mines.constants.d.ts +22 -0
- package/dist/components/mines/mines.mock.api.d.ts +50 -0
- package/dist/components/shared/BetResultModal/BetResultModal.d.ts +45 -0
- package/dist/components/shared/BetResultModal/BetResultModal.styles.d.ts +1 -0
- package/dist/components/shared/Button/Button.d.ts +25 -0
- package/dist/components/shared/Button/Button.styles.d.ts +1 -0
- package/dist/components/shared/Button/ButtonGroup.d.ts +6 -0
- package/dist/components/shared/Button/ButtonGroup.styles.d.ts +1 -0
- package/dist/components/shared/FairnessDetails/FairnessDetails.d.ts +14 -0
- package/dist/components/shared/FairnessDetails/FairnessDetails.styles.d.ts +1 -0
- package/dist/components/shared/Footer/Footer.d.ts +49 -0
- package/dist/components/shared/Footer/Footer.styles.d.ts +1 -0
- package/dist/components/shared/GameComponent.d.ts +35 -0
- package/dist/components/shared/GameLayout/GameLayout.d.ts +40 -0
- package/dist/components/shared/GameLayout/GameLayout.styles.d.ts +1 -0
- package/dist/components/shared/GameProviderWrapper.d.ts +20 -0
- package/dist/components/shared/GameSidebar/GameSidebar.d.ts +15 -0
- package/dist/components/shared/GameSidebar/GameSidebar.styles.d.ts +1 -0
- package/dist/components/shared/GameWinPopup/GameWinPopup.d.ts +18 -0
- package/dist/components/shared/GameWinPopup/GameWinPopup.styles.d.ts +1 -0
- package/dist/components/shared/GenericAutobet/BetCountInput.d.ts +11 -0
- package/dist/components/shared/GenericAutobet/GenericAutobet.d.ts +42 -0
- package/dist/components/shared/GenericAutobet/GenericAutobet.styles.d.ts +1 -0
- package/dist/components/shared/GenericAutobet/context/autobet.context.d.ts +11 -0
- package/dist/components/shared/HistoryPills/HistoryPills.d.ts +20 -0
- package/dist/components/shared/HistoryPills/HistoryPills.styles.d.ts +1 -0
- package/dist/components/shared/Inputs/BetAmountInput/BetAmountInput.d.ts +22 -0
- package/dist/components/shared/Inputs/CurrencyInput/RawCurrencyInput.d.ts +46 -0
- package/dist/components/shared/Inputs/Input/Input.d.ts +68 -0
- package/dist/components/shared/Inputs/Input/Input.styles.d.ts +1 -0
- package/dist/components/shared/Modal/Modal.d.ts +91 -0
- package/dist/components/shared/Modal/Modal.styles.d.ts +2 -0
- package/dist/components/shared/Modal/Portal.d.ts +13 -0
- package/dist/components/shared/Select/Select.d.ts +48 -0
- package/dist/components/shared/Select/Select.styles.d.ts +1 -0
- package/dist/components/shared/Statistics/Statistics.d.ts +43 -0
- package/dist/components/shared/Statistics/Statistics.styles.d.ts +1 -0
- package/dist/components/shared/Toggle/Toggle.d.ts +12 -0
- package/dist/components/shared/Toggle/Toggle.styles.d.ts +1 -0
- package/dist/components/shared/Tooltip/Tooltip.d.ts +54 -0
- package/dist/components/shared/Tooltip/Tooltip.styles.d.ts +1 -0
- package/dist/components/shared/context/game.context.d.ts +15 -0
- package/dist/favicon.ico +0 -0
- package/dist/favicon.png +0 -0
- package/dist/favicon.svg +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +18188 -0
- package/dist/index.umd.js +5695 -0
- package/dist/origami.svg +17 -0
- package/dist/shared/component.styles.d.ts +2 -0
- package/dist/shared/constants.d.ts +8 -0
- package/dist/shared/event-map.d.ts +126 -0
- package/dist/shared/get-game-outcome.d.ts +1 -0
- package/dist/shared/icons/diceCubeIcon.d.ts +1 -0
- package/dist/shared/icons/minesBombIcon.d.ts +1 -0
- package/dist/shared/icons/minesGemIcon.d.ts +1 -0
- package/dist/shared/icons/multiplierIcon.d.ts +1 -0
- package/dist/shared/icons/profitIcon.d.ts +1 -0
- package/dist/shared/icons/rollDirectionIcon.d.ts +1 -0
- package/dist/shared/icons/winChanceIcon.d.ts +1 -0
- package/dist/shared/origami-action.type.d.ts +7 -0
- package/dist/shared/origami-element.d.ts +21 -0
- package/dist/shared/sleep.d.ts +1 -0
- package/dist/shared/watch.d.ts +26 -0
- package/dist/utils/active-elements.d.ts +15 -0
- package/dist/utils/animate.d.ts +22 -0
- package/dist/utils/animation-registry.d.ts +24 -0
- package/dist/utils/event.d.ts +2 -0
- package/dist/utils/focus-trap.d.ts +24 -0
- package/dist/utils/scroll.d.ts +22 -0
- package/dist/utils/slot.controller.d.ts +23 -0
- package/dist/utils/tabbable.d.ts +9 -0
- package/package.json +40 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DiceDirection } from 'shufflecom-calculations';
|
|
2
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
3
|
+
import { DiceHistory } from '../DiceGame';
|
|
4
|
+
export declare class DiceContent extends OrigamiElement {
|
|
5
|
+
static styles: import('lit').CSSResult[];
|
|
6
|
+
selectedValue: number;
|
|
7
|
+
diceDirection: DiceDirection;
|
|
8
|
+
isPlaying: boolean;
|
|
9
|
+
showDice: boolean;
|
|
10
|
+
isWin: boolean;
|
|
11
|
+
resultValue: number | null;
|
|
12
|
+
history: DiceHistory[];
|
|
13
|
+
render(): import('lit').TemplateResult<1>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const diceContentStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DiceDirection } from 'shufflecom-calculations';
|
|
2
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
3
|
+
export declare class DiceContentBottom extends OrigamiElement {
|
|
4
|
+
static styles: import('lit').CSSResult[];
|
|
5
|
+
selectedValue: number;
|
|
6
|
+
diceDirection: DiceDirection;
|
|
7
|
+
winChanceInputFocused: boolean;
|
|
8
|
+
multiplierInputFocused: boolean;
|
|
9
|
+
winChanceInputValue: string;
|
|
10
|
+
multiplierInputValue: string;
|
|
11
|
+
handleMultiplierBlur(): void;
|
|
12
|
+
handleWinChanceBlur(): void;
|
|
13
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
14
|
+
render(): import('lit').TemplateResult<1>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const diceContentBottomStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
export declare class DiceAuto extends OrigamiElement {
|
|
3
|
+
inputsDisabled: boolean;
|
|
4
|
+
autobetStopping: boolean;
|
|
5
|
+
readonly autobetInProgress = false;
|
|
6
|
+
profitOnWin: string;
|
|
7
|
+
betDisabled: boolean;
|
|
8
|
+
render(): import('lit').TemplateResult<1>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const diceControlsStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
import { Currency } from '../../../shared/constants';
|
|
3
|
+
export declare const currencyIcon: import('lit').TemplateResult<1>;
|
|
4
|
+
export declare class DiceManual extends OrigamiElement {
|
|
5
|
+
isPlaying: boolean;
|
|
6
|
+
profitOnWin: string;
|
|
7
|
+
betDisabled: boolean;
|
|
8
|
+
currency: Currency;
|
|
9
|
+
static styles: import('lit').CSSResult[];
|
|
10
|
+
render(): import('lit').TemplateResult<1>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DiceMultiplierChangeEvent, DiceWinChanceChangeEvent, SliderChangeEvent } from '../../shared/event-map';
|
|
2
|
+
import { AutobetSettings, GameBetResult, GameComponent } from '../shared/GameComponent';
|
|
3
|
+
import { gameContextType } from '../shared/context/game.context';
|
|
4
|
+
import { DiceApi } from './dice.api';
|
|
5
|
+
import { MockDiceApi } from './dice.mock.api';
|
|
6
|
+
export interface DiceHistory {
|
|
7
|
+
multiplier: number;
|
|
8
|
+
won: boolean;
|
|
9
|
+
id: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class DiceGame extends GameComponent {
|
|
12
|
+
private diceDirection;
|
|
13
|
+
private selectedValue;
|
|
14
|
+
private isManualPlaying;
|
|
15
|
+
authToken: string;
|
|
16
|
+
private showDice;
|
|
17
|
+
private isWin;
|
|
18
|
+
private resultValue;
|
|
19
|
+
private history;
|
|
20
|
+
get diceApi(): DiceApi | MockDiceApi;
|
|
21
|
+
gameData?: gameContextType;
|
|
22
|
+
dicePlay(): Promise<void>;
|
|
23
|
+
addToHistory(multiplier: number, won: boolean): void;
|
|
24
|
+
protected executeBet(_autobetSettings: AutobetSettings, currentBetAmount: string): Promise<GameBetResult>;
|
|
25
|
+
sliderInputChange: (e: SliderChangeEvent) => void;
|
|
26
|
+
diceMultiplierChange: (e: DiceMultiplierChangeEvent) => void;
|
|
27
|
+
diceWinChanceChange: (e: DiceWinChanceChangeEvent) => void;
|
|
28
|
+
diceRollOverToggle: () => void;
|
|
29
|
+
render(): import('lit').TemplateResult<1>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Done
|
|
33
|
+
* Disable slider and DiceContentBottom inputs when game is in play
|
|
34
|
+
* Height of cube svg
|
|
35
|
+
* markers are not aligned with slider knob
|
|
36
|
+
* Animation for results sliding in. And color
|
|
37
|
+
* Footer should show icon for game stats in mobile
|
|
38
|
+
* Autobet games input should be an input with an icon when input is '0'
|
|
39
|
+
* History pills should be a button with hover and pressed states
|
|
40
|
+
* Height of game content in tablet
|
|
41
|
+
* Order of buttons in sidebar in mobile mode (bet btn on top, toggle at the bottom)
|
|
42
|
+
*
|
|
43
|
+
* Things to improve:
|
|
44
|
+
* Autobet increase/reset button should be wider (should it be wider?)
|
|
45
|
+
* remove the display:grid in style tag in DiceContentBottom
|
|
46
|
+
* Dice slider overflows in mobile due to width of 382px on the history pills. Set it to absolute to prevent this
|
|
47
|
+
*/
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
export declare class DiceSlider extends OrigamiElement {
|
|
3
|
+
static styles: import('lit').CSSResult[];
|
|
4
|
+
step: number;
|
|
5
|
+
isRollLower: boolean;
|
|
6
|
+
value: number;
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
resultValue: number | null;
|
|
11
|
+
showDice: boolean;
|
|
12
|
+
isWin: boolean;
|
|
13
|
+
private handleChange;
|
|
14
|
+
private handleFocus;
|
|
15
|
+
render(): import('lit').TemplateResult<1>;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const diceSliderStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Currency } from '../../shared/constants';
|
|
2
|
+
import { OrigamiActionType } from '../../shared/origami-action.type';
|
|
3
|
+
declare enum DiceDirection {
|
|
4
|
+
ABOVE = "ABOVE",
|
|
5
|
+
BELOW = "BELOW"
|
|
6
|
+
}
|
|
7
|
+
export interface DiceData {
|
|
8
|
+
resultValue: number;
|
|
9
|
+
userValue: number;
|
|
10
|
+
userDiceDirection: DiceDirection;
|
|
11
|
+
}
|
|
12
|
+
interface Action {
|
|
13
|
+
id: string;
|
|
14
|
+
data: {
|
|
15
|
+
dice: DiceData;
|
|
16
|
+
};
|
|
17
|
+
type: OrigamiActionType;
|
|
18
|
+
actionIndex: number;
|
|
19
|
+
originalActionId: string | null;
|
|
20
|
+
betAmount: string;
|
|
21
|
+
payoutAmount: string;
|
|
22
|
+
}
|
|
23
|
+
export interface BetResult {
|
|
24
|
+
id: string;
|
|
25
|
+
tenantId: string;
|
|
26
|
+
userId: string;
|
|
27
|
+
usdRate: number;
|
|
28
|
+
gameId: string;
|
|
29
|
+
currency: Currency;
|
|
30
|
+
edge: number;
|
|
31
|
+
amount: string;
|
|
32
|
+
payout: string;
|
|
33
|
+
afterBalance: string;
|
|
34
|
+
maxPayoutReached: boolean;
|
|
35
|
+
multiplier: number;
|
|
36
|
+
clientSeed: string;
|
|
37
|
+
randomValue: string;
|
|
38
|
+
proof: string | null;
|
|
39
|
+
nonce: string | null;
|
|
40
|
+
completedAt: string | null;
|
|
41
|
+
actions: Action[];
|
|
42
|
+
}
|
|
43
|
+
export type DiceStartArgs = {
|
|
44
|
+
currency: Currency;
|
|
45
|
+
amount: string;
|
|
46
|
+
windowId?: string;
|
|
47
|
+
usdAmount?: number;
|
|
48
|
+
direction: DiceDirection;
|
|
49
|
+
selectedValue: number;
|
|
50
|
+
};
|
|
51
|
+
export declare class DiceApi {
|
|
52
|
+
private authToken;
|
|
53
|
+
private baseUrl;
|
|
54
|
+
static totalDiceValue: number;
|
|
55
|
+
constructor(authToken: string, baseUrl: string);
|
|
56
|
+
startBet(data: DiceStartArgs): Promise<{
|
|
57
|
+
success: true;
|
|
58
|
+
data: BetResult;
|
|
59
|
+
error?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
success: false;
|
|
62
|
+
error: string;
|
|
63
|
+
data?: undefined;
|
|
64
|
+
}>;
|
|
65
|
+
static getMultiplier(selectedValue: number, diceDirection: DiceDirection): string;
|
|
66
|
+
static getWinChance(selectedValue: number, diceDirection: DiceDirection): string;
|
|
67
|
+
static getSelectedValueFromMultiplier(multiplier: number, diceDirection: DiceDirection): number;
|
|
68
|
+
static getSelectedValueFromWinChance(winChancePercentage: number, diceDirection: DiceDirection): number;
|
|
69
|
+
static getSelectedValueFromRollOver(selectedValue: number): number;
|
|
70
|
+
}
|
|
71
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BetResult, DiceApi, DiceStartArgs } from './dice.api';
|
|
2
|
+
export interface MockDiceSettings {
|
|
3
|
+
shouldWin: boolean;
|
|
4
|
+
resultValue?: number;
|
|
5
|
+
multiplier?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class MockDiceApi extends DiceApi {
|
|
8
|
+
private static getRandomValueInRange;
|
|
9
|
+
startBet(data: DiceStartArgs): Promise<{
|
|
10
|
+
success: true;
|
|
11
|
+
data: BetResult;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
import { KenoRiskLevel } from 'shufflecom-calculations';
|
|
3
|
+
export declare class KenoContent extends OrigamiElement {
|
|
4
|
+
static styles: import('lit').CSSResult[];
|
|
5
|
+
selectedTiles: number[];
|
|
6
|
+
resultTiles: number[];
|
|
7
|
+
isPlaying: boolean;
|
|
8
|
+
gameOver: boolean;
|
|
9
|
+
multipliersForSelectedTiles: number;
|
|
10
|
+
wonAmount: string | null;
|
|
11
|
+
gameWinPopupShowing: boolean;
|
|
12
|
+
multiplier: number | null;
|
|
13
|
+
risk: KenoRiskLevel;
|
|
14
|
+
betAmount: string;
|
|
15
|
+
get hitCount(): number;
|
|
16
|
+
render(): import('lit').TemplateResult<1>;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const kenoContentStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { KenoRiskLevel } from 'shufflecom-calculations';
|
|
2
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
3
|
+
export declare class KenoContentBottom extends OrigamiElement {
|
|
4
|
+
static styles: import('lit').CSSResult[];
|
|
5
|
+
selectedTiles: number[];
|
|
6
|
+
risk: KenoRiskLevel;
|
|
7
|
+
betAmount: string;
|
|
8
|
+
hitCount: number;
|
|
9
|
+
multipliersForSelectedTiles: number;
|
|
10
|
+
private hoverItemIndex;
|
|
11
|
+
handleMouseOver(index: number, event: MouseEvent): void;
|
|
12
|
+
handleMouseLeave(): void;
|
|
13
|
+
render(): import('lit').TemplateResult<1>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const kenoContentBottomStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
export declare class KenoAuto extends OrigamiElement {
|
|
3
|
+
inputsDisabled: boolean;
|
|
4
|
+
autobetStopping: boolean;
|
|
5
|
+
disableBet: boolean;
|
|
6
|
+
readonly autobetInProgress = false;
|
|
7
|
+
static styles: import('lit').CSSResult[];
|
|
8
|
+
render(): import('lit').TemplateResult<1>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const kenoControlsStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
import { KenoRiskLevel } from 'shufflecom-calculations';
|
|
3
|
+
export declare class KenoManual extends OrigamiElement {
|
|
4
|
+
inputsDisabled: boolean;
|
|
5
|
+
risk: KenoRiskLevel;
|
|
6
|
+
isPlaying: boolean;
|
|
7
|
+
disableBet: boolean;
|
|
8
|
+
static styles: import('lit').CSSResult[];
|
|
9
|
+
render(): import('lit').TemplateResult<1>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { KenoRiskChangeEvent, KenoTileClickEvent } from '../../shared/event-map';
|
|
2
|
+
import { AutobetSettings, GameBetResult, GameComponent } from '../shared/GameComponent';
|
|
3
|
+
import { KenoApi } from './keno.api';
|
|
4
|
+
import { MockKenoApi } from './keno.mock.api';
|
|
5
|
+
export interface KenoHistory {
|
|
6
|
+
multiplier: number;
|
|
7
|
+
won: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class KenoGame extends GameComponent {
|
|
10
|
+
private isManualPlaying;
|
|
11
|
+
private history;
|
|
12
|
+
private selectedTiles;
|
|
13
|
+
private resultTiles;
|
|
14
|
+
authToken: string;
|
|
15
|
+
gameWinPopupShowing: boolean;
|
|
16
|
+
private gameOver;
|
|
17
|
+
private wonAmount;
|
|
18
|
+
private kenoRisk;
|
|
19
|
+
private autoselectRunning;
|
|
20
|
+
get kenoApi(): KenoApi | MockKenoApi;
|
|
21
|
+
kenoPlay(): Promise<void>;
|
|
22
|
+
addToHistory(multiplier: number, won: boolean): void;
|
|
23
|
+
protected executeBet(_autobetSettings: AutobetSettings, currentBetAmount: string): Promise<GameBetResult>;
|
|
24
|
+
handleTileClick: (e: KenoTileClickEvent) => void;
|
|
25
|
+
handleRiskChange: (e: KenoRiskChangeEvent) => void;
|
|
26
|
+
autoPick: () => Promise<void>;
|
|
27
|
+
clearTable: () => void;
|
|
28
|
+
newGame: () => void;
|
|
29
|
+
render(): import('lit').TemplateResult<1>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
export declare class KenoGrid extends OrigamiElement {
|
|
3
|
+
static styles: import('lit').CSSResult[];
|
|
4
|
+
selectedTiles: number[];
|
|
5
|
+
resultTiles: number[];
|
|
6
|
+
popupShowing: boolean;
|
|
7
|
+
isPlaying: boolean;
|
|
8
|
+
gameOver: boolean;
|
|
9
|
+
wonAmount: string | null;
|
|
10
|
+
enableSounds: boolean;
|
|
11
|
+
ariaLabel: string;
|
|
12
|
+
private audioRefs;
|
|
13
|
+
private winAudioRef;
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
disconnectedCallback(): void;
|
|
16
|
+
get selectedCount(): number;
|
|
17
|
+
get hitCount(): number;
|
|
18
|
+
private initializeSounds;
|
|
19
|
+
private cleanupSounds;
|
|
20
|
+
updated(changedProps: Map<string, unknown>): void;
|
|
21
|
+
private handleTileClick;
|
|
22
|
+
private calculateTileState;
|
|
23
|
+
render(): import('lit').TemplateResult<1>;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const kenoGridStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
export declare enum KenoTileState {
|
|
3
|
+
NORMAL = "NORMAL",
|
|
4
|
+
SELECTED = "SELECTED",
|
|
5
|
+
LOSS = "LOSS",
|
|
6
|
+
WIN = "WIN"
|
|
7
|
+
}
|
|
8
|
+
export declare class KenoTile extends OrigamiElement {
|
|
9
|
+
static styles: import('lit').CSSResult[];
|
|
10
|
+
number: number;
|
|
11
|
+
state: KenoTileState;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
ariaLabel: string;
|
|
14
|
+
private handleClick;
|
|
15
|
+
render(): import('lit').TemplateResult<1>;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const kenoTileStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { KenoRiskLevel } from 'shufflecom-calculations';
|
|
2
|
+
import { Currency } from '../../shared/constants';
|
|
3
|
+
import { OrigamiActionType } from '../../shared/origami-action.type';
|
|
4
|
+
export declare const MAX_SELECTABLE_TILES = 10;
|
|
5
|
+
export declare const TOTAL_KENO_TILES = 40;
|
|
6
|
+
export interface KenoData {
|
|
7
|
+
/** The tiles selected by the player */
|
|
8
|
+
selectedTiles: number[];
|
|
9
|
+
/** The tiles containing gems (results) */
|
|
10
|
+
resultTiles: number[];
|
|
11
|
+
multiplier: number;
|
|
12
|
+
/** Risk level chosen by the player */
|
|
13
|
+
riskLevel: KenoRiskLevel;
|
|
14
|
+
}
|
|
15
|
+
export interface Action {
|
|
16
|
+
id: string;
|
|
17
|
+
data: {
|
|
18
|
+
keno: KenoData;
|
|
19
|
+
};
|
|
20
|
+
type: OrigamiActionType;
|
|
21
|
+
actionIndex: number;
|
|
22
|
+
originalActionId: string | null;
|
|
23
|
+
betAmount: string;
|
|
24
|
+
payoutAmount: string;
|
|
25
|
+
}
|
|
26
|
+
export interface BetResult {
|
|
27
|
+
id: string;
|
|
28
|
+
tenantId: string;
|
|
29
|
+
userId: string;
|
|
30
|
+
usdRate: number;
|
|
31
|
+
gameId: string;
|
|
32
|
+
currency: Currency;
|
|
33
|
+
edge: number;
|
|
34
|
+
amount: string;
|
|
35
|
+
payout: string;
|
|
36
|
+
afterBalance: string;
|
|
37
|
+
maxPayoutReached: boolean;
|
|
38
|
+
multiplier: number;
|
|
39
|
+
clientSeed: string;
|
|
40
|
+
randomValue: string;
|
|
41
|
+
proof: string | null;
|
|
42
|
+
nonce: string | null;
|
|
43
|
+
completedAt: string | null;
|
|
44
|
+
actions: Action[];
|
|
45
|
+
}
|
|
46
|
+
export type KenoStartArgs = {
|
|
47
|
+
currency: Currency;
|
|
48
|
+
amount: string;
|
|
49
|
+
windowId?: string;
|
|
50
|
+
usdAmount?: number;
|
|
51
|
+
riskLevel: KenoRiskLevel;
|
|
52
|
+
selectedTiles: number[];
|
|
53
|
+
};
|
|
54
|
+
export declare class KenoApi {
|
|
55
|
+
private authToken;
|
|
56
|
+
private baseUrl;
|
|
57
|
+
constructor(authToken: string, baseUrl: string);
|
|
58
|
+
startBet(data: KenoStartArgs): Promise<{
|
|
59
|
+
success: true;
|
|
60
|
+
data: BetResult;
|
|
61
|
+
error?: undefined;
|
|
62
|
+
} | {
|
|
63
|
+
success: false;
|
|
64
|
+
error: string;
|
|
65
|
+
data?: undefined;
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BetResult, KenoApi, KenoStartArgs } from './keno.api';
|
|
2
|
+
export interface MockKenoSettings {
|
|
3
|
+
shouldWin?: boolean;
|
|
4
|
+
resultTiles?: number[];
|
|
5
|
+
multiplier?: number;
|
|
6
|
+
hitCount?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class MockKenoApi extends KenoApi {
|
|
9
|
+
private static generateRandomTiles;
|
|
10
|
+
private static calculateMultiplier;
|
|
11
|
+
startBet: (data: KenoStartArgs) => Promise<{
|
|
12
|
+
success: true;
|
|
13
|
+
data: BetResult;
|
|
14
|
+
}>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
import { LimboHistory } from '../LimboGame';
|
|
3
|
+
export declare class LimboContent extends OrigamiElement {
|
|
4
|
+
static styles: import('lit').CSSResult[];
|
|
5
|
+
targetMultiplier: number;
|
|
6
|
+
betTargetMultiplier: number;
|
|
7
|
+
history: LimboHistory[];
|
|
8
|
+
resultMultiplier: number | null;
|
|
9
|
+
isWin: boolean;
|
|
10
|
+
betId: string;
|
|
11
|
+
isPlaying: boolean;
|
|
12
|
+
render(): import('lit').TemplateResult<1>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const limboContentStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
export declare class LimboGameStats extends OrigamiElement {
|
|
3
|
+
static styles: import('lit').CSSResult[];
|
|
4
|
+
targetMultiplier: number;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
winChanceInputFocused: boolean;
|
|
7
|
+
multiplierInputFocused: boolean;
|
|
8
|
+
winChanceInputValue: string;
|
|
9
|
+
multiplierInputValue: string;
|
|
10
|
+
handleWinChanceBlur(): void;
|
|
11
|
+
handleMultiplierBlur(): void;
|
|
12
|
+
targetMultiplierChanged(): void;
|
|
13
|
+
render(): import('lit').TemplateResult<1>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const limboGameStatsStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
export declare class LimboAuto extends OrigamiElement {
|
|
3
|
+
inputsDisabled: boolean;
|
|
4
|
+
autobetStopping: boolean;
|
|
5
|
+
readonly autobetInProgress = false;
|
|
6
|
+
profitOnWin: string;
|
|
7
|
+
betDisabled: boolean;
|
|
8
|
+
render(): import('lit').TemplateResult<1>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const limboControlsStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
import { gameContextType } from '../../shared/context/game.context';
|
|
3
|
+
export declare class LimboManual extends OrigamiElement {
|
|
4
|
+
inputsDisabled: boolean;
|
|
5
|
+
isPlaying: boolean;
|
|
6
|
+
profitOnWin: string;
|
|
7
|
+
betDisabled: boolean;
|
|
8
|
+
gameData?: gameContextType;
|
|
9
|
+
static styles: import('lit').CSSResult[];
|
|
10
|
+
render(): import('lit').TemplateResult<1>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LimboMultiplierAnimationEndEvent, LimboMultiplierChangeEvent, LimboWinChanceChangeEvent } from '../../shared/event-map';
|
|
2
|
+
import { AutobetSettings, GameBetResult, GameComponent } from '../shared/GameComponent';
|
|
3
|
+
import { LimboApi } from './limbo.api';
|
|
4
|
+
import { MockLimboApi } from './limbo.mock.api';
|
|
5
|
+
export interface LimboHistory {
|
|
6
|
+
multiplier: number;
|
|
7
|
+
won: boolean;
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class LimboGame extends GameComponent {
|
|
11
|
+
private targetMultiplier;
|
|
12
|
+
private resultMultiplier;
|
|
13
|
+
private isManualPlaying;
|
|
14
|
+
authToken: string;
|
|
15
|
+
private isWin;
|
|
16
|
+
private history;
|
|
17
|
+
private betTargetMultiplier;
|
|
18
|
+
private betId;
|
|
19
|
+
get limboApi(): LimboApi | MockLimboApi;
|
|
20
|
+
limboPlay(): Promise<void>;
|
|
21
|
+
protected executeBet(_autobetSettings: AutobetSettings, currentBetAmount: string): Promise<GameBetResult>;
|
|
22
|
+
multiplierChange: (e: LimboMultiplierChangeEvent) => void;
|
|
23
|
+
calculateProfitOnWin(): string;
|
|
24
|
+
winChanceChange: (e: LimboWinChanceChangeEvent) => void;
|
|
25
|
+
multiplierAnimationEnd: (e: LimboMultiplierAnimationEndEvent) => void;
|
|
26
|
+
render(): import('lit').TemplateResult<1>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
export declare class LimboMultiplier extends OrigamiElement {
|
|
3
|
+
static styles: import('lit').CSSResult[];
|
|
4
|
+
resultMultiplier: number | null;
|
|
5
|
+
isWin: boolean;
|
|
6
|
+
betId: string;
|
|
7
|
+
betTargetMultiplier: number;
|
|
8
|
+
private currentValue;
|
|
9
|
+
private animationFrame;
|
|
10
|
+
private startTime;
|
|
11
|
+
updated(changedProperties: Map<PropertyKey, unknown>): void;
|
|
12
|
+
disconnectedCallback(): void;
|
|
13
|
+
private startAnimation;
|
|
14
|
+
private updateAnimation;
|
|
15
|
+
private _getMultiplierColor;
|
|
16
|
+
render(): import('lit').TemplateResult<1>;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const limboMultiplierStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Currency } from '../../shared/constants';
|
|
2
|
+
import { OrigamiActionType } from '../../shared/origami-action.type';
|
|
3
|
+
export interface LimboData {
|
|
4
|
+
targetMultiplier: number;
|
|
5
|
+
resultMultiplier: number;
|
|
6
|
+
}
|
|
7
|
+
interface Action {
|
|
8
|
+
id: string;
|
|
9
|
+
data: {
|
|
10
|
+
limbo: LimboData;
|
|
11
|
+
};
|
|
12
|
+
type: OrigamiActionType;
|
|
13
|
+
actionIndex: number;
|
|
14
|
+
originalActionId: string | null;
|
|
15
|
+
betAmount: string;
|
|
16
|
+
payoutAmount: string;
|
|
17
|
+
}
|
|
18
|
+
export interface BetResult {
|
|
19
|
+
id: string;
|
|
20
|
+
tenantId: string;
|
|
21
|
+
userId: string;
|
|
22
|
+
usdRate: number;
|
|
23
|
+
gameId: string;
|
|
24
|
+
currency: Currency;
|
|
25
|
+
edge: number;
|
|
26
|
+
amount: string;
|
|
27
|
+
payout: string;
|
|
28
|
+
afterBalance: string;
|
|
29
|
+
maxPayoutReached: boolean;
|
|
30
|
+
multiplier: number;
|
|
31
|
+
clientSeed: string;
|
|
32
|
+
randomValue: string;
|
|
33
|
+
proof: string | null;
|
|
34
|
+
nonce: string | null;
|
|
35
|
+
completedAt: string | null;
|
|
36
|
+
actions: Action[];
|
|
37
|
+
}
|
|
38
|
+
export type LimboStartArgs = {
|
|
39
|
+
currency: Currency;
|
|
40
|
+
amount: string;
|
|
41
|
+
windowId?: string;
|
|
42
|
+
usdAmount?: number;
|
|
43
|
+
targetMultiplier: number;
|
|
44
|
+
};
|
|
45
|
+
export declare class LimboApi {
|
|
46
|
+
private authToken;
|
|
47
|
+
private baseUrl;
|
|
48
|
+
constructor(authToken: string, baseUrl: string);
|
|
49
|
+
startBet: (data: LimboStartArgs) => Promise<{
|
|
50
|
+
success: true;
|
|
51
|
+
data: BetResult;
|
|
52
|
+
error?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
success: false;
|
|
55
|
+
error: string;
|
|
56
|
+
data?: undefined;
|
|
57
|
+
}>;
|
|
58
|
+
static calculateMultiplier(winChance: number): string;
|
|
59
|
+
static calculateWinChance(targetMultiplier: number): string;
|
|
60
|
+
static calculateProfitOnWin(amount: string, targetMultiplier: number): string;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BetResult, LimboApi, LimboStartArgs } from './limbo.api';
|
|
2
|
+
export interface MockLimboSettings {
|
|
3
|
+
shouldWin: boolean;
|
|
4
|
+
resultMultiplier?: string;
|
|
5
|
+
multiplier?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class MockLimboApi extends LimboApi {
|
|
8
|
+
private static getRandomMultiplier;
|
|
9
|
+
startBet: (data: LimboStartArgs) => Promise<{
|
|
10
|
+
success: true;
|
|
11
|
+
data: BetResult;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
import { gameContextType } from '../../shared/context/game.context';
|
|
3
|
+
export declare class MinesAuto extends OrigamiElement {
|
|
4
|
+
inputsDisabled: boolean;
|
|
5
|
+
autobetStopping: boolean;
|
|
6
|
+
readonly autobetInProgress = false;
|
|
7
|
+
profitOnWin: string;
|
|
8
|
+
minesCount: number;
|
|
9
|
+
gameData?: gameContextType;
|
|
10
|
+
static styles: import('lit').CSSResult[];
|
|
11
|
+
private _handleMinesCountChange;
|
|
12
|
+
render(): import('lit').TemplateResult<1>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const minesControlsStyles: import('lit').CSSResult;
|