@betorigami/games 0.5.2 → 0.6.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/DiceGame.d.ts +0 -3
- package/dist/components/keno/KenoControls/KenoAuto.d.ts +1 -0
- package/dist/components/keno/KenoGame.d.ts +0 -1
- package/dist/components/limbo/LimboGame.d.ts +0 -1
- package/dist/components/mines/Controls/MinesAuto.d.ts +1 -0
- package/dist/components/mines/Controls/MinesManual.d.ts +0 -2
- package/dist/components/mines/MinesGame.d.ts +0 -1
- package/dist/components/mines/MinesGrid/MinesGrid.d.ts +2 -0
- package/dist/components/shared/Button/Button.d.ts +1 -1
- package/dist/components/shared/Button/ButtonGroup.d.ts +1 -1
- package/dist/components/shared/GameComponent.d.ts +2 -2
- package/dist/components/shared/GameProviderWrapper.d.ts +1 -0
- package/dist/components/shared/GameSidebar/GameSidebar.d.ts +1 -1
- package/dist/components/shared/GameWinPopup/GameWinPopup.d.ts +1 -1
- package/dist/components/shared/GenericAutobet/GenericAutobet.d.ts +1 -2
- package/dist/components/shared/Inputs/BetAmountInput/BetAmountInput.d.ts +2 -0
- package/dist/components/shared/Inputs/CurrencyInput/RawCurrencyInput.d.ts +3 -3
- package/dist/components/shared/Inputs/Input/Input.d.ts +3 -0
- package/dist/components/shared/Toggle/Toggle.d.ts +1 -0
- package/dist/components/shared/Tooltip/Tooltip.d.ts +3 -3
- package/dist/components/shared/context/game.context.d.ts +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +6861 -1212
- package/dist/shared/origami-element.d.ts +3 -3
- package/dist/utils/scroll.d.ts +1 -1
- package/package.json +10 -9
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DiceMultiplierChangeEvent, DiceWinChanceChangeEvent, SliderChangeEvent } from '../../shared/event-map';
|
|
2
2
|
import { AutobetSettings, GameBetResult, GameComponent } from '../shared/GameComponent';
|
|
3
|
-
import { gameContextType } from '../shared/context/game.context';
|
|
4
3
|
import { DiceApi } from './dice.api';
|
|
5
4
|
import { MockDiceApi } from './dice.mock.api';
|
|
6
5
|
export interface DiceHistory {
|
|
@@ -12,13 +11,11 @@ export declare class DiceGame extends GameComponent {
|
|
|
12
11
|
private diceDirection;
|
|
13
12
|
private selectedValue;
|
|
14
13
|
private isManualPlaying;
|
|
15
|
-
authToken: string;
|
|
16
14
|
private showDice;
|
|
17
15
|
private isWin;
|
|
18
16
|
private resultValue;
|
|
19
17
|
private history;
|
|
20
18
|
get diceApi(): DiceApi | MockDiceApi;
|
|
21
|
-
gameData?: gameContextType;
|
|
22
19
|
dicePlay(): Promise<void>;
|
|
23
20
|
addToHistory(multiplier: number, won: boolean): void;
|
|
24
21
|
protected executeBet(_autobetSettings: AutobetSettings, currentBetAmount: string): Promise<GameBetResult>;
|
|
@@ -6,6 +6,7 @@ export declare class MinesAuto extends OrigamiElement {
|
|
|
6
6
|
readonly autobetInProgress = false;
|
|
7
7
|
profitOnWin: string;
|
|
8
8
|
minesCount: number;
|
|
9
|
+
disableBet: boolean;
|
|
9
10
|
gameData?: gameContextType;
|
|
10
11
|
static styles: import('lit').CSSResult[];
|
|
11
12
|
private _handleMinesCountChange;
|
|
@@ -2,10 +2,8 @@ import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
|
2
2
|
import { MinesState } from '../mines.constants';
|
|
3
3
|
export declare class MinesManual extends OrigamiElement {
|
|
4
4
|
inputsDisabled: boolean;
|
|
5
|
-
minesCount: number;
|
|
6
5
|
minesState: MinesState | null;
|
|
7
6
|
isGameActive: boolean;
|
|
8
|
-
selectedTilesCount: number;
|
|
9
7
|
static styles: import('lit').CSSResult[];
|
|
10
8
|
render(): import('lit').TemplateResult<1>;
|
|
11
9
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
+
import { gameContextType } from '../../shared/context/game.context';
|
|
2
3
|
import { MinesFlowState } from '../mines.constants';
|
|
3
4
|
export interface Tile {
|
|
4
5
|
id: number;
|
|
@@ -18,6 +19,7 @@ export declare class MinesGrid extends OrigamiElement {
|
|
|
18
19
|
} | null;
|
|
19
20
|
hasWon: boolean;
|
|
20
21
|
hitBomb: boolean;
|
|
22
|
+
gameData?: gameContextType;
|
|
21
23
|
get tiles(): {
|
|
22
24
|
id: number;
|
|
23
25
|
isMine: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
-
export type ButtonVariant =
|
|
2
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'ghost' | 'icon';
|
|
3
3
|
export declare class Button extends OrigamiElement {
|
|
4
4
|
static styles: import('lit').CSSResult[];
|
|
5
5
|
static shadowRootOptions: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
2
|
export declare class ButtonGroup extends OrigamiElement {
|
|
3
3
|
static styles: import('lit').CSSResult[];
|
|
4
|
-
position:
|
|
4
|
+
position: 'left' | 'right';
|
|
5
5
|
render(): import('lit').TemplateResult<1>;
|
|
6
6
|
}
|
|
@@ -15,7 +15,7 @@ export interface AutobetSettings {
|
|
|
15
15
|
}
|
|
16
16
|
export interface GameBetResult {
|
|
17
17
|
pnl: BigNumber;
|
|
18
|
-
gameOutcome:
|
|
18
|
+
gameOutcome: 'Win' | 'Loss' | 'Draw';
|
|
19
19
|
hasError: boolean;
|
|
20
20
|
errorMessage?: string;
|
|
21
21
|
}
|
|
@@ -30,6 +30,6 @@ export declare abstract class GameComponent extends OrigamiElement {
|
|
|
30
30
|
gameData?: gameContextType;
|
|
31
31
|
toggleAutobet(event: AutobetToggleEvent): Promise<void>;
|
|
32
32
|
protected abstract executeBet(_autobetSettings: AutobetSettings, _currentBetAmount: string): Promise<GameBetResult>;
|
|
33
|
-
protected adjustBetAmount(autobetSettings: AutobetSettings, gameOutcome:
|
|
33
|
+
protected adjustBetAmount(autobetSettings: AutobetSettings, gameOutcome: 'Win' | 'Loss' | 'Draw', originalBetAmount: string, currentBetAmount: string): string;
|
|
34
34
|
protected isPnLWithinLimits(autobetSettings: AutobetSettings, totalPnL: BigNumber): boolean;
|
|
35
35
|
}
|
|
@@ -8,6 +8,7 @@ export declare class GameProviderWrapper extends OrigamiElement {
|
|
|
8
8
|
showFavorites: boolean;
|
|
9
9
|
balance: number;
|
|
10
10
|
baseUrl: string;
|
|
11
|
+
authToken: string;
|
|
11
12
|
private betAmount;
|
|
12
13
|
protected _gameProvider: ContextProvider<{
|
|
13
14
|
__context__: import('./context/game.context').gameContextType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
|
-
export type BetMode =
|
|
2
|
+
export type BetMode = 'Manual' | 'Autobet';
|
|
3
3
|
export declare class GameSidebar extends OrigamiElement {
|
|
4
4
|
static styles: import('lit').CSSResult[];
|
|
5
5
|
mode: BetMode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as OrigamiElement } from '../../../shared/origami-element';
|
|
2
2
|
import { ContextProvider } from '@lit/context';
|
|
3
3
|
import { Currency } from '../../../shared/constants';
|
|
4
|
-
export type AfterBetEffect = '
|
|
4
|
+
export type AfterBetEffect = 'Reset' | 'Increase';
|
|
5
5
|
export declare const defaultAutobetValues: {
|
|
6
6
|
onWinPercentage: string;
|
|
7
7
|
onLossPercentage: string;
|
|
@@ -32,7 +32,6 @@ export declare class GenericAutobet extends OrigamiElement {
|
|
|
32
32
|
__context__: import('./context/autobet.context').AutobetContextType;
|
|
33
33
|
}, this>;
|
|
34
34
|
updateNumberOfBets(numberOfBets: string): void;
|
|
35
|
-
private _updateAutobetSettings;
|
|
36
35
|
private _handleWinPercentageChange;
|
|
37
36
|
private _handleLossPercentageChange;
|
|
38
37
|
private _handleStopOnProfitChange;
|
|
@@ -5,6 +5,8 @@ import { Currency } from '../CurrencyInput/RawCurrencyInput';
|
|
|
5
5
|
export declare class BetAmountInput extends OrigamiElement {
|
|
6
6
|
static styles: import('lit').CSSResult[];
|
|
7
7
|
gameData?: gameContextType;
|
|
8
|
+
private isFocused;
|
|
9
|
+
private _gameContext;
|
|
8
10
|
firstUpdated(): void;
|
|
9
11
|
private value;
|
|
10
12
|
currency: Currency;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as OrigamiElement } from '../../../../shared/origami-element';
|
|
2
2
|
import { Input } from '../Input/Input';
|
|
3
|
-
export type Currency =
|
|
4
|
-
export type FiatCurrency =
|
|
3
|
+
export type Currency = 'BTC' | 'ETH' | 'USDT' | 'SOL';
|
|
4
|
+
export type FiatCurrency = 'USD' | 'EUR' | 'GBP';
|
|
5
5
|
export declare class RawCurrencyInput extends OrigamiElement {
|
|
6
6
|
label: string;
|
|
7
7
|
currency: Currency;
|
|
@@ -21,7 +21,7 @@ export declare class RawCurrencyInput extends OrigamiElement {
|
|
|
21
21
|
maxBetEnabled: boolean;
|
|
22
22
|
dimmed: boolean;
|
|
23
23
|
maxPayoutUSD: number;
|
|
24
|
-
variant:
|
|
24
|
+
variant: 'primary' | 'secondary';
|
|
25
25
|
required: boolean;
|
|
26
26
|
displayInFiat: boolean;
|
|
27
27
|
input: Input;
|
|
@@ -56,6 +56,9 @@ export declare class Input extends OrigamiElement {
|
|
|
56
56
|
* This ensures that what you paste is what you get, even with invalid number characters like 'e'
|
|
57
57
|
*/
|
|
58
58
|
private handlePaste;
|
|
59
|
+
/**
|
|
60
|
+
* Extracts numeric value from a string
|
|
61
|
+
*/
|
|
59
62
|
private handleClick;
|
|
60
63
|
private handleAnimationEnd;
|
|
61
64
|
private handleFocus;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
export type TooltipPosition =
|
|
3
|
-
export type TooltipTrigger =
|
|
2
|
+
export type TooltipPosition = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
3
|
+
export type TooltipTrigger = 'hover' | 'click' | 'focus' | 'manual';
|
|
4
4
|
export declare class Tooltip extends LitElement {
|
|
5
5
|
static styles: import('lit').CSSResult[];
|
|
6
6
|
/** The text content to display in the tooltip */
|
|
@@ -16,7 +16,7 @@ export declare class Tooltip extends LitElement {
|
|
|
16
16
|
disabled: boolean;
|
|
17
17
|
/** Distance in pixels between the tooltip arrow edge and the target */
|
|
18
18
|
offset: number;
|
|
19
|
-
theme:
|
|
19
|
+
theme: 'light' | 'dark';
|
|
20
20
|
delay: number;
|
|
21
21
|
hideDelay: number;
|
|
22
22
|
private tooltipRef;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { GameProviderWrapper } from './components/shared/GameProviderWrapper';
|
|
1
2
|
import { DiceGame } from './components/dice/DiceGame';
|
|
2
3
|
import { KenoGame } from './components/keno/KenoGame';
|
|
3
4
|
import { LimboGame } from './components/limbo/LimboGame';
|
|
4
5
|
import { MinesGame } from './components/mines/MinesGame';
|
|
5
|
-
|
|
6
|
-
export { DiceGame, KenoGame, LimboGame, MinesGame, GameProviderWrapper };
|
|
6
|
+
export { DiceGame, KenoGame, LimboGame, GameProviderWrapper, MinesGame };
|