@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.
@@ -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>;
@@ -5,5 +5,6 @@ export declare class KenoAuto extends OrigamiElement {
5
5
  disableBet: boolean;
6
6
  readonly autobetInProgress = false;
7
7
  static styles: import('lit').CSSResult[];
8
+ private actionButtons;
8
9
  render(): import('lit').TemplateResult<1>;
9
10
  }
@@ -11,7 +11,6 @@ export declare class KenoGame extends GameComponent {
11
11
  private history;
12
12
  private selectedTiles;
13
13
  private resultTiles;
14
- authToken: string;
15
14
  gameWinPopupShowing: boolean;
16
15
  private gameOver;
17
16
  private wonAmount;
@@ -11,7 +11,6 @@ export declare class LimboGame extends GameComponent {
11
11
  private targetMultiplier;
12
12
  private resultMultiplier;
13
13
  private isManualPlaying;
14
- authToken: string;
15
14
  private isWin;
16
15
  private history;
17
16
  private betTargetMultiplier;
@@ -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
  }
@@ -7,7 +7,6 @@ export declare class MinesGame extends GameComponent {
7
7
  private minesCount;
8
8
  private autobetSelectedTiles;
9
9
  private minesData;
10
- authToken: string;
11
10
  get isGameActive(): boolean;
12
11
  get minesApi(): MinesApi | MockMinesApi;
13
12
  getMinesActiveBet(): Promise<void>;
@@ -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 = "primary" | "secondary" | "danger" | "ghost" | "icon";
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: "left" | "right";
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: "Win" | "Loss" | "Draw";
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: "Win" | "Loss" | "Draw", originalBetAmount: string, currentBetAmount: string): string;
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 = "Manual" | "Autobet";
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,5 +1,5 @@
1
1
  import { LitElement, TemplateResult } from 'lit';
2
- type GameType = "Keno" | "Mines";
2
+ type GameType = 'Keno' | 'Mines';
3
3
  export declare class GameWinPopup extends LitElement {
4
4
  static styles: import('lit').CSSResult[];
5
5
  winAmount: string;
@@ -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 = 'reset' | 'increase';
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 = "BTC" | "ETH" | "USDT" | "SOL";
4
- export type FiatCurrency = "USD" | "EUR" | "GBP";
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: "primary" | "secondary";
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;
@@ -7,6 +7,7 @@ export declare class Toggle extends OrigamiElement {
7
7
  disabled: boolean;
8
8
  name: string;
9
9
  class: string;
10
+ noRightBorderRadius: boolean;
10
11
  private handleOptionClick;
11
12
  render(): import('lit').TemplateResult<1>;
12
13
  }
@@ -1,6 +1,6 @@
1
1
  import { LitElement } from 'lit';
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";
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: "light" | "dark";
19
+ theme: 'light' | 'dark';
20
20
  delay: number;
21
21
  hideDelay: number;
22
22
  private tooltipRef;
@@ -9,6 +9,7 @@ export type gameContextType = {
9
9
  showFavorites: boolean;
10
10
  balance: number;
11
11
  baseUrl: string;
12
+ authToken: string;
12
13
  };
13
14
  export declare const gameContext: {
14
15
  __context__: gameContextType;
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
- import { GameProviderWrapper } from './components/shared/GameProviderWrapper';
6
- export { DiceGame, KenoGame, LimboGame, MinesGame, GameProviderWrapper };
6
+ export { DiceGame, KenoGame, LimboGame, GameProviderWrapper, MinesGame };