@betorigami/game-ui-shared 7.0.0 → 8.0.0
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/shared/GameComponent.d.ts +17 -3
- package/dist/components/shared/GameProviderWrapper.d.ts +1 -0
- package/dist/components/shared/context/slices/wallet.context.d.ts +1 -0
- package/dist/index.d.ts +0 -3
- package/dist/index.mjs +2378 -2550
- package/dist/shared/event-map.d.ts +0 -5
- package/dist/shared/get-game-outcome.d.ts +2 -1
- package/dist/shared/provider-api/error-codes.d.ts +2 -0
- package/package.json +1 -1
- package/dist/components/shared/Inputs/ChipInput/ChipInput.d.ts +0 -19
- package/dist/components/shared/Inputs/ChipInput/ChipInput.styles.d.ts +0 -1
- package/dist/components/shared/Inputs/ChipInput/chip-input.constants.d.ts +0 -4
|
@@ -22,12 +22,12 @@ export type BetFailure = {
|
|
|
22
22
|
readonly validationMessage: string;
|
|
23
23
|
};
|
|
24
24
|
export type GameBetResult = {
|
|
25
|
-
readonly
|
|
25
|
+
readonly success: true;
|
|
26
26
|
readonly pnl: Big;
|
|
27
27
|
readonly gameOutcome: GameOutcome;
|
|
28
28
|
readonly afterBalance: Big | null;
|
|
29
29
|
} | ({
|
|
30
|
-
readonly
|
|
30
|
+
readonly success: false;
|
|
31
31
|
} & BetFailure);
|
|
32
32
|
export declare abstract class GameComponent extends OrigamiElement {
|
|
33
33
|
protected readonly locale: RequiredContext<{
|
|
@@ -49,9 +49,11 @@ export declare abstract class GameComponent extends OrigamiElement {
|
|
|
49
49
|
protected hasPendingBet: boolean;
|
|
50
50
|
protected autobetInProgress: boolean;
|
|
51
51
|
protected autobetStopping: boolean;
|
|
52
|
+
protected isRecovering: boolean;
|
|
52
53
|
static styles: import('lit').CSSResult[];
|
|
53
54
|
protected onBetAmountChange: (_oldBetAmount: string, _newBetAmount: string) => void;
|
|
54
55
|
private deferredBetReset;
|
|
56
|
+
private recovery;
|
|
55
57
|
get isToggleDisabled(): boolean;
|
|
56
58
|
get areInputsDisabled(): boolean;
|
|
57
59
|
/**
|
|
@@ -108,7 +110,19 @@ export declare abstract class GameComponent extends OrigamiElement {
|
|
|
108
110
|
protected setActiveBetNonce(nonce: number): void;
|
|
109
111
|
protected checkSessionExpired: (errorCode: ErrorCode) => void;
|
|
110
112
|
protected lockUi: (lock: UiLockContent) => void;
|
|
111
|
-
protected
|
|
113
|
+
protected showErrorOrLockUi(failure: BetFailure): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Brings the game back in line with the provider after an unknown outcome, and resolves to whether it
|
|
116
|
+
* could. Only reads from the provider: a bet is never sent again, since the first one may have landed.
|
|
117
|
+
*/
|
|
118
|
+
protected recoverFromUnknownOutcome(): Promise<boolean>;
|
|
119
|
+
/**
|
|
120
|
+
* Failures that arrive together share one recovery, so the provider is asked once and the player is told
|
|
121
|
+
* once. A game awaits this from inside the bet that failed, so its controls stay in the loading state they
|
|
122
|
+
* already have for a pending bet. isRecovering is for a game with no single pending bet to lean on.
|
|
123
|
+
*/
|
|
124
|
+
private recoverOrLockUi;
|
|
125
|
+
private recover;
|
|
112
126
|
protected showError(message: string): void;
|
|
113
127
|
protected showAlert(alert: AlertRequest): void;
|
|
114
128
|
protected playWinFeedback(): void;
|
|
@@ -105,6 +105,7 @@ export declare class GameProviderWrapper extends OrigamiElement {
|
|
|
105
105
|
private createWallet;
|
|
106
106
|
private publish;
|
|
107
107
|
private fetchBalance;
|
|
108
|
+
refreshBalance(): Promise<boolean>;
|
|
108
109
|
private fetchPublicKey;
|
|
109
110
|
updateHotkeysOpenEnabled(enabled: boolean): void;
|
|
110
111
|
updateShowMaxBetButton(enabled: boolean): void;
|
|
@@ -7,6 +7,7 @@ export type WalletContextType = {
|
|
|
7
7
|
uiLock: UiLockContent | null;
|
|
8
8
|
autobetNumberOfBets: number;
|
|
9
9
|
updateBalance: (newAmount: Big) => void;
|
|
10
|
+
refreshBalance: () => Promise<boolean>;
|
|
10
11
|
updateBetAmount: (newAmount: Big) => void;
|
|
11
12
|
updateAutobetNumberOfBets: (numberOfBets: number) => void;
|
|
12
13
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -43,9 +43,6 @@ export type { HistoryItem as HistoryPillItem } from './components/shared/History
|
|
|
43
43
|
export * from './components/shared/HotkeysModal/HotKeysModal.styles';
|
|
44
44
|
export * from './components/shared/HotkeysModal/HotkeysModal';
|
|
45
45
|
export * from './components/shared/Inputs/BetAmountInput/BetAmountInput';
|
|
46
|
-
export * from './components/shared/Inputs/ChipInput/ChipInput.styles';
|
|
47
|
-
export * from './components/shared/Inputs/ChipInput/ChipInput';
|
|
48
|
-
export * from './components/shared/Inputs/ChipInput/chip-input.constants';
|
|
49
46
|
export * from './components/shared/Inputs/CurrencyInput/RawCurrencyInput.styles';
|
|
50
47
|
export * from './components/shared/Inputs/CurrencyInput/RawCurrencyInput';
|
|
51
48
|
export * from './components/shared/Inputs/Input/Input.styles';
|