@betorigami/games 3.6.5 → 3.7.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.
@@ -10,6 +10,7 @@ export declare class BlackjackGame extends GameComponent {
10
10
  canonicalState: BlackjackState | null;
11
11
  visibleState: BlackjackVisibleState;
12
12
  private history;
13
+ private undoOptimisticDeduction;
13
14
  controlsLocked: boolean;
14
15
  private _loadingAction;
15
16
  suppressNextContentAnimations: boolean;
@@ -56,6 +57,8 @@ export declare class BlackjackGame extends GameComponent {
56
57
  revertToStandardModeIfNoSideBets(): void;
57
58
  finishRound(betData: BetResult): Promise<void>;
58
59
  private lockOutOfSync;
60
+ private handleGameplayFailure;
61
+ protected recoverFromUnknownOutcome(): Promise<boolean>;
59
62
  executeNextAction(type: BlackjackNextArgs['type']): Promise<BetResult | null>;
60
63
  blackjackPlay(): Promise<void>;
61
64
  protected executeAutobet(_autobetSettings: AutobetSettingsWithId, _currentBetAmount: string): Promise<GameBetResult>;
@@ -1,4 +1,5 @@
1
1
  import { ProviderApi, BetResult, ErrorBetResult } from '@betorigami/game-ui-shared';
2
+ import { CurrencyCode } from '@betorigami/money';
2
3
  export type BlackjackStartArgs = {
3
4
  mainBetAmount: string;
4
5
  pairBonusAmount?: string;
@@ -13,9 +14,12 @@ export type BlackjackNextResult = {
13
14
  success: true;
14
15
  data: BetResult;
15
16
  } | ErrorBetResult;
17
+ export type BlackjackActiveBet = BetResult & {
18
+ mainBetAmount: string | null;
19
+ };
16
20
  export type BlackjackGetActiveBetResult = {
17
21
  success: true;
18
- data: BetResult | null;
22
+ data: BlackjackActiveBet | null;
19
23
  } | ErrorBetResult;
20
24
  export interface IBlackjackApi {
21
25
  startBet(data: BlackjackStartArgs): Promise<BlackjackStartResult>;
@@ -24,8 +28,10 @@ export interface IBlackjackApi {
24
28
  }
25
29
  export declare class BlackjackApi implements IBlackjackApi {
26
30
  private readonly client;
27
- constructor(client: ProviderApi.Client);
31
+ private readonly getCurrency;
32
+ constructor(client: ProviderApi.Client, getCurrency: () => CurrencyCode);
28
33
  startBet(data: BlackjackStartArgs): Promise<BlackjackStartResult>;
29
34
  next(data: BlackjackNextArgs): Promise<BlackjackNextResult>;
30
35
  getActiveBet(): Promise<BlackjackGetActiveBetResult>;
36
+ private readMainBetAmount;
31
37
  }
@@ -30,6 +30,7 @@ export type BlackjackVisibleState = {
30
30
  };
31
31
  export declare const createInitialVisibleState: () => BlackjackVisibleState;
32
32
  export declare const extractBlackjackState: (bet: BetResult) => BlackjackState | null;
33
+ export declare const extractMainBetAmount: (bet: BetResult) => string | null;
33
34
  export declare const deriveValidActions: (state: BlackjackState | null) => readonly BlackjackActionType[];
34
35
  export declare const deriveStage: (state: BlackjackState) => BlackjackVisibleState["stage"];
35
36
  export declare const deriveOutcomes: (state: BlackjackState | null) => {
@@ -11,12 +11,14 @@ export declare class MinesGame extends GameComponent {
11
11
  private isSelectingRandomTile;
12
12
  private isCheckingForSession;
13
13
  private readonly reveals;
14
+ private resync;
14
15
  static styles: import('lit').CSSResult[];
15
16
  private _minesManualEl?;
16
17
  private _minesAutoEl?;
17
18
  private readonly sessionWatcher;
18
19
  get isToggleDisabled(): boolean;
19
20
  get areInputsDisabled(): boolean;
21
+ private get isBusy();
20
22
  get isGameActive(): boolean;
21
23
  private readonly _getMinesApi;
22
24
  getMinesApi(): IMinesApi;
@@ -28,6 +30,13 @@ export declare class MinesGame extends GameComponent {
28
30
  private playGemReveal;
29
31
  private lockOutOfSync;
30
32
  private handleGameplayFailure;
33
+ private resyncRound;
34
+ /**
35
+ * The round is read as part of the recovery, so the board is held from the failure until both the
36
+ * balance and the round are back. Both are read with nothing in flight: reveals already sent are
37
+ * answered first, and a re-sync that started before the failure may have read the round too early.
38
+ */
39
+ protected recoverFromUnknownOutcome(): Promise<boolean>;
31
40
  getMinesActiveBet(): Promise<void>;
32
41
  firstUpdated(changedProperties: Map<string | number | symbol, unknown>): Promise<void>;
33
42
  protected updated(changedProperties: Map<string | number | symbol, unknown>): void;
@@ -17,6 +17,8 @@ export declare class PlinkoGame extends GameComponent {
17
17
  private ballsInFlight;
18
18
  private lastSubBassTime;
19
19
  private pendingResultsByBetId;
20
+ private betsInFlight;
21
+ private betsAnsweredResolvers;
20
22
  private balanceLedger;
21
23
  private betQueue;
22
24
  private _plinkoManualEl?;
@@ -36,6 +38,12 @@ export declare class PlinkoGame extends GameComponent {
36
38
  */
37
39
  private queuedBetExecution;
38
40
  plinkoPlay(): Promise<void>;
41
+ private betsAnswered;
42
+ /**
43
+ * The provider's balance is only read once nothing is in flight, so it holds every bet that was answered.
44
+ * The balance on screen trails it by the payouts of balls still falling, so those are taken back out.
45
+ */
46
+ protected recoverFromUnknownOutcome(): Promise<boolean>;
39
47
  protected executeAutobet(autobetSettings: AutobetSettingsWithId, currentBetAmount: string): Promise<GameBetResult>;
40
48
  /**
41
49
  * Resolves multiplier and win status from a bin hit event.
@@ -10,6 +10,11 @@ export declare class PlinkoBalanceLedger {
10
10
  placeBet<T extends {
11
11
  success: boolean;
12
12
  }>(stake: string | Big, request: () => Promise<T>): Promise<T>;
13
+ /**
14
+ * Called once the displayed balance has been replaced by the provider's. That one already includes the
15
+ * payouts of balls that have been answered but not landed, so they are taken back out until each lands.
16
+ */
17
+ rebase(unpaidPayouts: Big): void;
13
18
  creditPayout(payout: string | Big): void;
14
19
  private debitBet;
15
20
  private refundBet;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betorigami/games",
3
- "version": "3.6.5",
3
+ "version": "3.7.1",
4
4
  "author": "",
5
5
  "license": "UNLICENSED",
6
6
  "description": "",
@@ -29,8 +29,9 @@
29
29
  "matter-js": "^0.18.0",
30
30
  "web-haptics": "^0.0.6",
31
31
  "@betorigami/game-calculations": "13.0.0",
32
- "@betorigami/game-ui-shared": "7.0.0",
33
- "@betorigami/game-ui-wheel": "1.2.5"
32
+ "@betorigami/game-ui-shared": "8.0.0",
33
+ "@betorigami/game-ui-wheel": "1.2.6",
34
+ "@betorigami/money": "0.5.1"
34
35
  },
35
36
  "devDependencies": {
36
37
  "@playwright/test": "^1.53.0",
@@ -1,12 +0,0 @@
1
- import { OrigamiElement } from '@betorigami/game-ui-shared';
2
- import { PlinkoRowCount } from '../plinko.constants';
3
- export declare class PlinkoRowsSlider extends OrigamiElement {
4
- private readonly locale;
5
- private readonly services;
6
- static styles: import('lit').CSSResult[];
7
- value: PlinkoRowCount;
8
- disabled: boolean;
9
- private _displayValue;
10
- protected updated(changedProperties: Map<PropertyKey, unknown>): void;
11
- render(): import('lit').TemplateResult<1>;
12
- }
@@ -1 +0,0 @@
1
- export declare const plinkoRowsSliderStyles: import('lit').CSSResult;