@betorigami/game-ui-shared 3.0.0 → 4.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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as Big } from 'big.js';
|
|
1
2
|
import { RequiredContext } from './context/required-context';
|
|
2
3
|
import { HotkeyDefinition } from '../../controllers/hotkey.controller';
|
|
3
4
|
import { ChipEvent } from '../../shared/chip-state.utils';
|
|
@@ -29,6 +30,7 @@ export declare abstract class ChipTableGameComponent extends GameComponent {
|
|
|
29
30
|
protected get maxPerClickAmount(): string;
|
|
30
31
|
protected get isDoubleDisabled(): boolean;
|
|
31
32
|
watchDerivedChips(_prev?: unknown, _next?: unknown): void;
|
|
33
|
+
protected getAutobetStake(): Big;
|
|
32
34
|
protected onBetAmountChange: (oldBetAmount: string, newBetAmount: string) => void;
|
|
33
35
|
protected adjustPerClickAmount(action: 'half' | 'double' | 'reset'): void;
|
|
34
36
|
protected handlePerClickAmountChange: (e: CustomEvent<{
|
|
@@ -20,6 +20,7 @@ export interface GameBetResult {
|
|
|
20
20
|
hasError: boolean;
|
|
21
21
|
errorCode?: ErrorCode;
|
|
22
22
|
errorMessage?: string;
|
|
23
|
+
afterBalance: Big | null;
|
|
23
24
|
}
|
|
24
25
|
export declare abstract class GameComponent extends OrigamiElement {
|
|
25
26
|
protected readonly locale: RequiredContext<{
|
|
@@ -86,6 +87,14 @@ export declare abstract class GameComponent extends OrigamiElement {
|
|
|
86
87
|
disconnectedCallback(): void;
|
|
87
88
|
toggleAutobet(event: AutobetToggleEvent): Promise<void>;
|
|
88
89
|
protected abstract executeAutobet(autobetSettings: AutobetSettingsWithId, currentBetAmount: string): Promise<GameBetResult>;
|
|
90
|
+
protected getAutobetStake(currentBetAmount: string): Big;
|
|
91
|
+
/**
|
|
92
|
+
* Stops autobet before a round the provider would reject for insufficient balance, sparing it a lock
|
|
93
|
+
* and a write it would only undo. The balance comes from the last response rather than the wallet,
|
|
94
|
+
* since a game can show a balance that trails the provider's while results are still animating. An
|
|
95
|
+
* unknown balance, or a demo session where no provider is involved, lets the round through.
|
|
96
|
+
*/
|
|
97
|
+
private canAffordAutobet;
|
|
89
98
|
protected adjustBetAmount(autobetSettings: AutobetSettingsWithId, gameOutcome: 'Win' | 'Loss' | 'Draw', originalBetAmount: string, currentBetAmount: string): string;
|
|
90
99
|
protected isPnLWithinLimits(autobetSettings: AutobetSettingsWithId, totalPnL: Big): boolean;
|
|
91
100
|
protected updateHistoryWithBet(betResult: NewBetItem): void;
|
|
@@ -35,6 +35,7 @@ export declare class GenericAutobet extends OrigamiElement {
|
|
|
35
35
|
willUpdate(changedProperties: Map<string | symbol, unknown>): void;
|
|
36
36
|
triggerPrimaryAction(): void;
|
|
37
37
|
isPrimaryActionDisabled(): boolean;
|
|
38
|
+
private get isBetButtonDisabled();
|
|
38
39
|
private _handleWinPercentageChange;
|
|
39
40
|
private _handleLossPercentageChange;
|
|
40
41
|
private _handleStopOnProfitChange;
|