@hizi.io/engine-sdk 0.1.9
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/README.md +212 -0
- package/lib/api.d.ts +198 -0
- package/lib/api.js +352 -0
- package/lib/constants.d.ts +44 -0
- package/lib/constants.js +56 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.js +37 -0
- package/lib/network.d.ts +9 -0
- package/lib/network.js +63 -0
- package/lib/types/balance.d.ts +20 -0
- package/lib/types/balance.js +2 -0
- package/lib/types/blackjack.d.ts +163 -0
- package/lib/types/blackjack.js +22 -0
- package/lib/types/buyFeatureOption.d.ts +11 -0
- package/lib/types/buyFeatureOption.js +2 -0
- package/lib/types/collectOptions.d.ts +8 -0
- package/lib/types/collectOptions.js +2 -0
- package/lib/types/crash.d.ts +223 -0
- package/lib/types/crash.js +80 -0
- package/lib/types/freePlayInfo.d.ts +11 -0
- package/lib/types/freePlayInfo.js +2 -0
- package/lib/types/gameResult.d.ts +48 -0
- package/lib/types/gameResult.js +2 -0
- package/lib/types/gameRoundInfo.d.ts +19 -0
- package/lib/types/gameRoundInfo.js +2 -0
- package/lib/types/gameSettings.d.ts +133 -0
- package/lib/types/gameSettings.js +16 -0
- package/lib/types/gameState.d.ts +20 -0
- package/lib/types/gameState.js +2 -0
- package/lib/types/index.d.ts +32 -0
- package/lib/types/index.js +22 -0
- package/lib/types/keno.d.ts +34 -0
- package/lib/types/keno.js +18 -0
- package/lib/types/loadConfigConfig.d.ts +42 -0
- package/lib/types/loadConfigConfig.js +2 -0
- package/lib/types/loginOptions.d.ts +7 -0
- package/lib/types/loginOptions.js +2 -0
- package/lib/types/mines.d.ts +26 -0
- package/lib/types/mines.js +19 -0
- package/lib/types/network.d.ts +24 -0
- package/lib/types/network.js +2 -0
- package/lib/types/pfVerifyOptions.d.ts +48 -0
- package/lib/types/pfVerifyOptions.js +2 -0
- package/lib/types/placeBetOptions.d.ts +16 -0
- package/lib/types/placeBetOptions.js +2 -0
- package/lib/types/progressionCounter.d.ts +65 -0
- package/lib/types/progressionCounter.js +2 -0
- package/lib/types/replies.d.ts +107 -0
- package/lib/types/replies.js +2 -0
- package/lib/types/roulette.d.ts +53 -0
- package/lib/types/roulette.js +11 -0
- package/lib/types/scenarioInfo.d.ts +12 -0
- package/lib/types/scenarioInfo.js +2 -0
- package/lib/types/sessionOptions.d.ts +7 -0
- package/lib/types/sessionOptions.js +2 -0
- package/lib/types/spinAward.d.ts +31 -0
- package/lib/types/spinAward.js +12 -0
- package/lib/types/spinInfo.d.ts +9 -0
- package/lib/types/spinInfo.js +2 -0
- package/lib/types/tokenData.d.ts +7 -0
- package/lib/types/tokenData.js +2 -0
- package/lib/websocket.d.ts +27 -0
- package/lib/websocket.js +186 -0
- package/package.json +19 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/** Screen orientation lock modes. */
|
|
2
|
+
export declare enum ForcedOrientation {
|
|
3
|
+
none = 0,
|
|
4
|
+
landscape = 1,
|
|
5
|
+
portrait = 2
|
|
6
|
+
}
|
|
7
|
+
/** Win odds metrics that can be shown to the player. */
|
|
8
|
+
export declare enum DisplayWinOdds {
|
|
9
|
+
maxPayout = "maxPayout",
|
|
10
|
+
maxWin = "maxWin"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Operator-configured platform settings controlling UI features and gameplay limits.
|
|
14
|
+
* Returned once in the `login()` response.
|
|
15
|
+
*/
|
|
16
|
+
export interface IGameSettings {
|
|
17
|
+
/** Whether the autoplay feature is available. */
|
|
18
|
+
autoplayEnabled: boolean;
|
|
19
|
+
/** Whether a loss limit must be set before starting autoplay. */
|
|
20
|
+
autoplayLossLimitRequired: boolean;
|
|
21
|
+
/** @deprecated Whether to show a coin-based display alongside currency. */
|
|
22
|
+
displayCoins: boolean;
|
|
23
|
+
/** Whether jackpot odds should be shown to the player. */
|
|
24
|
+
displayJackpotOdds: boolean;
|
|
25
|
+
/** Whether the RTP percentage should be shown to the player. */
|
|
26
|
+
displayRTP: boolean;
|
|
27
|
+
/** Whether the experienced RTP (for Bonus Spin games) should be shown to the player. */
|
|
28
|
+
displayXRTP: boolean;
|
|
29
|
+
/** Lock the game to a specific screen orientation. */
|
|
30
|
+
forceOrientation: ForcedOrientation;
|
|
31
|
+
/** Whether wager/gamble games (e.g. card color) are available. */
|
|
32
|
+
gambleEnabled: boolean;
|
|
33
|
+
/** URL to the player's game history page. */
|
|
34
|
+
historyURL: string;
|
|
35
|
+
/** URL to the platform home/lobby. */
|
|
36
|
+
homeURL: string;
|
|
37
|
+
/** Message displayed during game loading. */
|
|
38
|
+
loadMsg: string;
|
|
39
|
+
/** Maximum exposure per session. */
|
|
40
|
+
maxExposure: number;
|
|
41
|
+
/** Maximum allowed stake amount. */
|
|
42
|
+
maxStake: number;
|
|
43
|
+
/** Maximum allowed stake for buy-feature/package purchases. */
|
|
44
|
+
maxPackageStake: number;
|
|
45
|
+
/** Minimum allowed stake amount. */
|
|
46
|
+
minStake: number;
|
|
47
|
+
/** Minimum milliseconds to show the loading screen. */
|
|
48
|
+
minLoadTime: number;
|
|
49
|
+
/** Minimum milliseconds between spins. */
|
|
50
|
+
minSpinTime: number;
|
|
51
|
+
/** Whether multiple game instances can run simultaneously. */
|
|
52
|
+
multipleInstancesAllowed: boolean;
|
|
53
|
+
/** Whether reality-check dialog shows win/loss totals. */
|
|
54
|
+
rcDisplayWinLoss: boolean;
|
|
55
|
+
/** Whether reality-check reminders are enabled. */
|
|
56
|
+
rcEnabled: boolean;
|
|
57
|
+
/** Interval in seconds between reality-check prompts. */
|
|
58
|
+
rcInterval: number;
|
|
59
|
+
/** Whether the player can stop spinning mid-sequence. */
|
|
60
|
+
stopEnabled: boolean;
|
|
61
|
+
/** URL to the deposit/top-up page. */
|
|
62
|
+
topupURL: string;
|
|
63
|
+
/** Whether turbo/fast spin mode is available. */
|
|
64
|
+
turboEnabled: boolean;
|
|
65
|
+
/** Whether the home/lobby button should be shown. */
|
|
66
|
+
homeEnabled: boolean;
|
|
67
|
+
/** Whether min spin time adjusts dynamically based on animation length. */
|
|
68
|
+
dynamicMinSpinTime: boolean;
|
|
69
|
+
/** Browser navigation target for external links (home, history, etc.). */
|
|
70
|
+
redirectTarget: 'self' | 'parent' | 'top';
|
|
71
|
+
/** Whether buy-feature (bonus buy) is enabled. */
|
|
72
|
+
packageBuyEnabled: boolean;
|
|
73
|
+
/** Index into the stakes array for the default bet amount. */
|
|
74
|
+
defaultStakeIndex: number;
|
|
75
|
+
/** Whether the operator platform handles error display instead of the game. */
|
|
76
|
+
operatorHandlesErrors: boolean;
|
|
77
|
+
/** Whether to display a clock in the game UI. */
|
|
78
|
+
displayClock: boolean;
|
|
79
|
+
/** Whether this is a social/free-to-play (non-real-money) session. */
|
|
80
|
+
isSocial: boolean;
|
|
81
|
+
/** Whether currency symbols/codes should be displayed. */
|
|
82
|
+
displayCurrency: boolean;
|
|
83
|
+
/** Operator-defined custom stake values (overrides default stakes if non-empty). */
|
|
84
|
+
customStakes: number[];
|
|
85
|
+
/** URL to the loss-limit management page. */
|
|
86
|
+
lossLimitURL: string;
|
|
87
|
+
/** Whether the player can collect a partial win amount. */
|
|
88
|
+
partialCollectEnabled: boolean;
|
|
89
|
+
/** Whether to hide the game provider logo. */
|
|
90
|
+
hideCompanyLogo: boolean;
|
|
91
|
+
/** Whether to abbreviate large monetary amounts (e.g. 1.2K). */
|
|
92
|
+
abbreviateAmounts: boolean;
|
|
93
|
+
/** Whether to show the exact RTP value instead of a rounded one. */
|
|
94
|
+
showExactRTP: boolean;
|
|
95
|
+
/** Jurisdiction code governing regulatory behaviour. */
|
|
96
|
+
jurisdiction: string;
|
|
97
|
+
/** Whether to force the default stake on every session start. */
|
|
98
|
+
forceDefaultStake: boolean;
|
|
99
|
+
/** Whether to disable fullscreen mode on mobile devices. */
|
|
100
|
+
disableFullScreenMobile: boolean;
|
|
101
|
+
/** Whether to show the paytable automatically when the game loads. */
|
|
102
|
+
displayPaytableOnEnterGame: boolean;
|
|
103
|
+
/** Setting keys that should not be persisted between sessions. */
|
|
104
|
+
doNotStoreSettings: string[];
|
|
105
|
+
/** Session timeout duration in seconds (0 = no timeout). */
|
|
106
|
+
sessionTimeoutInSeconds: number;
|
|
107
|
+
/** Whether to display the net position (win minus loss) to the player. */
|
|
108
|
+
displayNetPosition: boolean;
|
|
109
|
+
/** Whether to hide the balance display in demo/fun mode. */
|
|
110
|
+
hideDemoBalance: boolean;
|
|
111
|
+
/** Whether to prevent automatic redirects (e.g. on session expiry). */
|
|
112
|
+
preventRedirect: boolean;
|
|
113
|
+
/** Whether the browser refresh/reload action is disabled. */
|
|
114
|
+
refreshDisabled: boolean;
|
|
115
|
+
/** Which win-odds metrics to display to the player. */
|
|
116
|
+
displayWinOdds: DisplayWinOdds[];
|
|
117
|
+
/** Whether to show a session timer, or a custom label string for it. */
|
|
118
|
+
displaySessionTimer: boolean | string;
|
|
119
|
+
/** Whether to skip win celebrations for wins equal to or less than the stake. */
|
|
120
|
+
skipWinsEqualToOrLessThanStake: boolean;
|
|
121
|
+
/** Whether `reportAnimationEnd()` must be called after each spin animation completes. */
|
|
122
|
+
reportAnimationEnd: boolean;
|
|
123
|
+
/** The launcher platform type. */
|
|
124
|
+
launcherType: 'reelLink' | 'online';
|
|
125
|
+
/** Whether autoplay UI shows total stake (stake x spins) instead of per-spin stake. */
|
|
126
|
+
autoplayShowTotalStake: boolean;
|
|
127
|
+
/** Whether error messages should be translated to the player's locale. */
|
|
128
|
+
translateErrors: boolean;
|
|
129
|
+
/** ISO 4217 currency code to display (overrides the session currency). */
|
|
130
|
+
currencyToDisplay: string;
|
|
131
|
+
/** Additional operator-specific fields. */
|
|
132
|
+
[key: string]: unknown;
|
|
133
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DisplayWinOdds = exports.ForcedOrientation = void 0;
|
|
4
|
+
/** Screen orientation lock modes. */
|
|
5
|
+
var ForcedOrientation;
|
|
6
|
+
(function (ForcedOrientation) {
|
|
7
|
+
ForcedOrientation[ForcedOrientation["none"] = 0] = "none";
|
|
8
|
+
ForcedOrientation[ForcedOrientation["landscape"] = 1] = "landscape";
|
|
9
|
+
ForcedOrientation[ForcedOrientation["portrait"] = 2] = "portrait";
|
|
10
|
+
})(ForcedOrientation || (exports.ForcedOrientation = ForcedOrientation = {}));
|
|
11
|
+
/** Win odds metrics that can be shown to the player. */
|
|
12
|
+
var DisplayWinOdds;
|
|
13
|
+
(function (DisplayWinOdds) {
|
|
14
|
+
DisplayWinOdds["maxPayout"] = "maxPayout";
|
|
15
|
+
DisplayWinOdds["maxWin"] = "maxWin";
|
|
16
|
+
})(DisplayWinOdds || (exports.DisplayWinOdds = DisplayWinOdds = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Historical record of a game round transaction (bet, collect, or wager). */
|
|
2
|
+
export interface IGameState {
|
|
3
|
+
/** Unique identifier for this game round. */
|
|
4
|
+
hash: string;
|
|
5
|
+
/** Transaction type (e.g. "placeBet", "collect", "wager"). */
|
|
6
|
+
type: string;
|
|
7
|
+
/** ISO timestamp of when this transaction was processed. */
|
|
8
|
+
processedOn?: string;
|
|
9
|
+
/** Result data, if the transaction produced an outcome. */
|
|
10
|
+
result?: {
|
|
11
|
+
winAmount?: number;
|
|
12
|
+
info: Record<string, unknown>;
|
|
13
|
+
};
|
|
14
|
+
/** Total amount wagered in this transaction. */
|
|
15
|
+
amountWagered?: number;
|
|
16
|
+
/** Amount collected/credited to the player. */
|
|
17
|
+
collected?: number;
|
|
18
|
+
/** Reason for this state entry (for debugging/audit). */
|
|
19
|
+
reason?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type { TNetworkResponse, TNetworkSuccess, TNetworkError, IErrorResponse } from './network.js';
|
|
2
|
+
export type { IBalanceEntry, IBalanceReply } from './balance.js';
|
|
3
|
+
export type { IGameSettings } from './gameSettings.js';
|
|
4
|
+
export { ForcedOrientation, DisplayWinOdds } from './gameSettings.js';
|
|
5
|
+
export type { ITokenData } from './tokenData.js';
|
|
6
|
+
export type { IGameState } from './gameState.js';
|
|
7
|
+
export type { IGameRoundInfo } from './gameRoundInfo.js';
|
|
8
|
+
export type { IFreePlayInfo } from './freePlayInfo.js';
|
|
9
|
+
export type { TPlayerChoiceFeatureAward, TPlayerChoiceCashAward, TPlayerChoiceAward } from './spinAward.js';
|
|
10
|
+
export { isCashChoice, isFeatureChoice } from './spinAward.js';
|
|
11
|
+
export type { ISpinInfo } from './spinInfo.js';
|
|
12
|
+
export type { IScenarioInfo } from './scenarioInfo.js';
|
|
13
|
+
export type { IGameResult } from './gameResult.js';
|
|
14
|
+
export type { IBuyFeatureOption } from './buyFeatureOption.js';
|
|
15
|
+
export type { ILoadConfigConfig } from './loadConfigConfig.js';
|
|
16
|
+
export type { IProgressionCounterConfig, IProgressionEvent, TRandomChoiceAward, TRandomChoiceFeatureAward, TRandomChoiceCashAward, TProgressionAwarded } from './progressionCounter.js';
|
|
17
|
+
export type { IConnectReply, ILoadConfigReply, IPlaceBetReply, ICollectReply, IRngDataEntry, IPfVerifyReply } from './replies.js';
|
|
18
|
+
export type { ISessionOptions } from './sessionOptions.js';
|
|
19
|
+
export type { ILoginOptions } from './loginOptions.js';
|
|
20
|
+
export type { IPlaceBetOptions } from './placeBetOptions.js';
|
|
21
|
+
export type { ICollectOptions } from './collectOptions.js';
|
|
22
|
+
export type { IPfVerifyOptions, IPfVerifyAction } from './pfVerifyOptions.js';
|
|
23
|
+
export type { TRouletteBetType, TRouletteBetSelection, TRouletteEvenMoneyBetType, IRouletteBet, IRouletteBetSettlement, IRouletteScenario, } from './roulette.js';
|
|
24
|
+
export { rouletteAdditionalData } from './roulette.js';
|
|
25
|
+
export type { TBlackjackRank, TBlackjackSuit, IBlackjackCard, TBlackjackAction, TBlackjackActionKind, IBlackjackSideBets, IBlackjackInitialBet, IBlackjackChoice, IBlackjackHand, IBlackjackDealer, IBlackjackPerfectPairsBet, IBlackjackTwentyOnePlusThreeBet, IBlackjackInsuranceBet, IBlackjackScenario, } from './blackjack.js';
|
|
26
|
+
export { blackjackInitialData, blackjackActionData } from './blackjack.js';
|
|
27
|
+
export type { ICrashBetRequest, ICrashBet, ICrashScenario, ICrashLoadConfig, TCrashEventName, ICrashRoundStartedPayload, ICrashRoundTickPayload, ICrashBetCashedOutPayload, ICrashRoundEndedPayload, ICrashBalanceUpdatedPayload, TCrashEvent, } from './crash.js';
|
|
28
|
+
export { CRASH_EVENTS, crashPlaceBetData, crashCollectData } from './crash.js';
|
|
29
|
+
export type { TMinesTile, IMinesScenario, } from './mines.js';
|
|
30
|
+
export { minesPickData } from './mines.js';
|
|
31
|
+
export type { IKenoScenario } from './keno.js';
|
|
32
|
+
export { kenoPickData } from './keno.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.kenoPickData = exports.minesPickData = exports.crashCollectData = exports.crashPlaceBetData = exports.CRASH_EVENTS = exports.blackjackActionData = exports.blackjackInitialData = exports.rouletteAdditionalData = exports.isFeatureChoice = exports.isCashChoice = exports.DisplayWinOdds = exports.ForcedOrientation = void 0;
|
|
4
|
+
var gameSettings_js_1 = require("./gameSettings.js");
|
|
5
|
+
Object.defineProperty(exports, "ForcedOrientation", { enumerable: true, get: function () { return gameSettings_js_1.ForcedOrientation; } });
|
|
6
|
+
Object.defineProperty(exports, "DisplayWinOdds", { enumerable: true, get: function () { return gameSettings_js_1.DisplayWinOdds; } });
|
|
7
|
+
var spinAward_js_1 = require("./spinAward.js");
|
|
8
|
+
Object.defineProperty(exports, "isCashChoice", { enumerable: true, get: function () { return spinAward_js_1.isCashChoice; } });
|
|
9
|
+
Object.defineProperty(exports, "isFeatureChoice", { enumerable: true, get: function () { return spinAward_js_1.isFeatureChoice; } });
|
|
10
|
+
var roulette_js_1 = require("./roulette.js");
|
|
11
|
+
Object.defineProperty(exports, "rouletteAdditionalData", { enumerable: true, get: function () { return roulette_js_1.rouletteAdditionalData; } });
|
|
12
|
+
var blackjack_js_1 = require("./blackjack.js");
|
|
13
|
+
Object.defineProperty(exports, "blackjackInitialData", { enumerable: true, get: function () { return blackjack_js_1.blackjackInitialData; } });
|
|
14
|
+
Object.defineProperty(exports, "blackjackActionData", { enumerable: true, get: function () { return blackjack_js_1.blackjackActionData; } });
|
|
15
|
+
var crash_js_1 = require("./crash.js");
|
|
16
|
+
Object.defineProperty(exports, "CRASH_EVENTS", { enumerable: true, get: function () { return crash_js_1.CRASH_EVENTS; } });
|
|
17
|
+
Object.defineProperty(exports, "crashPlaceBetData", { enumerable: true, get: function () { return crash_js_1.crashPlaceBetData; } });
|
|
18
|
+
Object.defineProperty(exports, "crashCollectData", { enumerable: true, get: function () { return crash_js_1.crashCollectData; } });
|
|
19
|
+
var mines_js_1 = require("./mines.js");
|
|
20
|
+
Object.defineProperty(exports, "minesPickData", { enumerable: true, get: function () { return mines_js_1.minesPickData; } });
|
|
21
|
+
var keno_js_1 = require("./keno.js");
|
|
22
|
+
Object.defineProperty(exports, "kenoPickData", { enumerable: true, get: function () { return keno_js_1.kenoPickData; } });
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keno-specific payloads carried through `IPlaceBetOptions.additionalData`
|
|
3
|
+
* and returned in `IGameResult.scenario`.
|
|
4
|
+
*
|
|
5
|
+
* The player either picks numbers explicitly or lets the engine auto-pick.
|
|
6
|
+
*/
|
|
7
|
+
/** The scenario returned in `IGameResult.scenario` for keno rounds. */
|
|
8
|
+
export interface IKenoScenario {
|
|
9
|
+
/** How many numbers the player picked for this round. */
|
|
10
|
+
picks: number;
|
|
11
|
+
/** Risk level for this round (e.g. `"low"`, `"medium"`, `"high"`). */
|
|
12
|
+
risk: string;
|
|
13
|
+
/** Player's chosen numbers (1-indexed). */
|
|
14
|
+
playerNumbers: number[];
|
|
15
|
+
/** Numbers drawn by the engine (1-indexed). */
|
|
16
|
+
drawnNumbers: number[];
|
|
17
|
+
/** Count of overlap between `playerNumbers` and `drawnNumbers`. */
|
|
18
|
+
matches: number;
|
|
19
|
+
/** Payout multiplier applied to the stake. */
|
|
20
|
+
multiplier: number;
|
|
21
|
+
/** Total size of the draw pool. */
|
|
22
|
+
gridSize: number;
|
|
23
|
+
/** How many numbers are drawn per round. */
|
|
24
|
+
drawCount: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Build a `placeBet` additionalData payload for a keno pick.
|
|
28
|
+
*
|
|
29
|
+
* @param playerNumbers Optional player-selected numbers (1-indexed).
|
|
30
|
+
* Must match the picks count for the selected feature. Omit to let the engine auto-pick.
|
|
31
|
+
*/
|
|
32
|
+
export declare function kenoPickData(playerNumbers?: number[]): {
|
|
33
|
+
playerNumbers?: number[];
|
|
34
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Keno-specific payloads carried through `IPlaceBetOptions.additionalData`
|
|
4
|
+
* and returned in `IGameResult.scenario`.
|
|
5
|
+
*
|
|
6
|
+
* The player either picks numbers explicitly or lets the engine auto-pick.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.kenoPickData = kenoPickData;
|
|
10
|
+
/**
|
|
11
|
+
* Build a `placeBet` additionalData payload for a keno pick.
|
|
12
|
+
*
|
|
13
|
+
* @param playerNumbers Optional player-selected numbers (1-indexed).
|
|
14
|
+
* Must match the picks count for the selected feature. Omit to let the engine auto-pick.
|
|
15
|
+
*/
|
|
16
|
+
function kenoPickData(playerNumbers) {
|
|
17
|
+
return playerNumbers ? { playerNumbers } : {};
|
|
18
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { IBuyFeatureOption } from './buyFeatureOption.js';
|
|
2
|
+
import type { IProgressionCounterConfig } from './progressionCounter.js';
|
|
3
|
+
/**
|
|
4
|
+
* Game configuration returned by `loadConfig()`.
|
|
5
|
+
* Contains stakes, RTP, and available features for the game.
|
|
6
|
+
*/
|
|
7
|
+
export interface ILoadConfigConfig {
|
|
8
|
+
/** Unique game identifier. */
|
|
9
|
+
gameCode: string;
|
|
10
|
+
/** Game type (e.g. "blackjack", "crash", "keno", "mines", "roulette"). Omitted for default DB-driven slot/plinko games. */
|
|
11
|
+
gameType?: string;
|
|
12
|
+
/** Available stake amounts the player can choose from. */
|
|
13
|
+
stakes?: number[];
|
|
14
|
+
/** Minimum allowed stake (currency-multiplied units). Present when the game config sets it. */
|
|
15
|
+
minStake?: number;
|
|
16
|
+
/** Maximum allowed stake (currency-multiplied units). Present when the game config sets it. */
|
|
17
|
+
maxStake?: number;
|
|
18
|
+
/** Return-to-player percentage (e.g. 95.5 for 95.5% RTP). */
|
|
19
|
+
rtp: number;
|
|
20
|
+
/** Optional maximum payout cap. */
|
|
21
|
+
maxPayoutCap?: number;
|
|
22
|
+
/** Optional maximum win amount eligible for wagering. */
|
|
23
|
+
maxWagerableWin?: number;
|
|
24
|
+
/** Optional minimum win amount eligible for wagering. */
|
|
25
|
+
minWagerableWin?: number;
|
|
26
|
+
/** Engine version string. */
|
|
27
|
+
version: string;
|
|
28
|
+
/** Available buy-feature options (each with an added `id` field). */
|
|
29
|
+
buyFeatures?: (IBuyFeatureOption & {
|
|
30
|
+
id: string;
|
|
31
|
+
})[];
|
|
32
|
+
/** Available wager feature names (e.g. "color-red"). */
|
|
33
|
+
wagerFeatures?: string[];
|
|
34
|
+
/** Available wager-stake feature names for multi-step wager games (e.g. mines, frogger). */
|
|
35
|
+
wagerStakeFeatures?: string[];
|
|
36
|
+
/** Progression counter configurations for this game. */
|
|
37
|
+
progressionCounters?: IProgressionCounterConfig[];
|
|
38
|
+
/** Current progression counter values loaded from player data. */
|
|
39
|
+
progressionCounterValues?: Record<string, number>;
|
|
40
|
+
/** Additional game-specific fields from loadConfig.json. */
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Options for the {@link login} call. */
|
|
2
|
+
export interface ILoginOptions {
|
|
3
|
+
/** The operator-provided login endpoint URL (from the launch URL query string). */
|
|
4
|
+
loginURL: string;
|
|
5
|
+
/** Short-lived launch token (from the launch URL query string). */
|
|
6
|
+
launchToken: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mines-specific payloads carried through `IPlaceBetOptions.additionalData`
|
|
3
|
+
* and returned in `IGameResult.scenario`.
|
|
4
|
+
*
|
|
5
|
+
* Mines is a multi-step wager game: the initial `placeBet` opens a round, and
|
|
6
|
+
* each subsequent `placeBet` reveals one tile. The round continues until the
|
|
7
|
+
* player hits a bomb or cashes out via `collect()`.
|
|
8
|
+
*/
|
|
9
|
+
export type TMinesTile = null | 'bomb' | 'picked';
|
|
10
|
+
/** The scenario returned in `IGameResult.scenario` for mines rounds. */
|
|
11
|
+
export interface IMinesScenario {
|
|
12
|
+
/** Board state: null = unknown, 'picked' = safe pick, 'bomb' = mine. */
|
|
13
|
+
board: TMinesTile[];
|
|
14
|
+
/** Current cumulative win multiplier. */
|
|
15
|
+
currentMultiplier: number;
|
|
16
|
+
/** Number of mines on the board. */
|
|
17
|
+
mineCount: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Build a `placeBet` additionalData payload for a mines tile pick.
|
|
21
|
+
*
|
|
22
|
+
* @param pickPosition Zero-based index of the tile to reveal.
|
|
23
|
+
*/
|
|
24
|
+
export declare function minesPickData(pickPosition: number): {
|
|
25
|
+
pickPosition: number;
|
|
26
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Mines-specific payloads carried through `IPlaceBetOptions.additionalData`
|
|
4
|
+
* and returned in `IGameResult.scenario`.
|
|
5
|
+
*
|
|
6
|
+
* Mines is a multi-step wager game: the initial `placeBet` opens a round, and
|
|
7
|
+
* each subsequent `placeBet` reveals one tile. The round continues until the
|
|
8
|
+
* player hits a bomb or cashes out via `collect()`.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.minesPickData = minesPickData;
|
|
12
|
+
/**
|
|
13
|
+
* Build a `placeBet` additionalData payload for a mines tile pick.
|
|
14
|
+
*
|
|
15
|
+
* @param pickPosition Zero-based index of the tile to reveal.
|
|
16
|
+
*/
|
|
17
|
+
function minesPickData(pickPosition) {
|
|
18
|
+
return { pickPosition };
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discriminated union wrapping all SDK API responses.
|
|
3
|
+
* Check `success` before accessing `result` or `error`.
|
|
4
|
+
*/
|
|
5
|
+
export type TNetworkResponse<T> = TNetworkSuccess<T> | TNetworkError;
|
|
6
|
+
/** Successful API response. Access the payload via `result`. */
|
|
7
|
+
export type TNetworkSuccess<T> = {
|
|
8
|
+
success: true;
|
|
9
|
+
result: T;
|
|
10
|
+
};
|
|
11
|
+
/** Failed API response. Inspect `error` for the failure reason. */
|
|
12
|
+
export type TNetworkError = {
|
|
13
|
+
success: false;
|
|
14
|
+
error: IErrorResponse;
|
|
15
|
+
};
|
|
16
|
+
/** Error details returned when an API call fails. */
|
|
17
|
+
export interface IErrorResponse {
|
|
18
|
+
/** Machine-readable error code (stringified `API_RETURNCODES` value or engine-specific id). Prefers the `X-H-ERROR-ID` response header, falling back to the response body. */
|
|
19
|
+
code: string;
|
|
20
|
+
/** Human-readable error description. Prefers the `X-H-ERROR-MSG(-BASE64)` response header, falling back to the response body or HTTP status text. */
|
|
21
|
+
message: string;
|
|
22
|
+
/** Optional operator-specific data for custom error handling. */
|
|
23
|
+
passThroughData?: unknown;
|
|
24
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ISessionOptions } from './sessionOptions.js';
|
|
2
|
+
/**
|
|
3
|
+
* One replay action. Field used depends on the game type:
|
|
4
|
+
*
|
|
5
|
+
* - **blackjack** — `{ action: { kind: 'hit' | 'stand' | … } }`. Raw
|
|
6
|
+
* `TRulesAction` object passed straight to the rules engine.
|
|
7
|
+
* - **mines** — `{ pickPosition: number }` for every step (including the
|
|
8
|
+
* opening pick). `playerChoiceIndex` only when the engine surfaced a
|
|
9
|
+
* mid-round choice.
|
|
10
|
+
* - **fixed-odds / slot / frogger / hi-lo / over-under / plinko** —
|
|
11
|
+
* `{ playerChoiceIndex: number }` for each wager-feature / playerChoice
|
|
12
|
+
* step. Initial spin needs no entry in `actions`.
|
|
13
|
+
*
|
|
14
|
+
* Other one-shot rounds (roulette / keno / crash) take no actions; the
|
|
15
|
+
* opening request fields are sufficient.
|
|
16
|
+
*/
|
|
17
|
+
export interface IPfVerifyAction {
|
|
18
|
+
/** Blackjack: raw `TRulesAction` (e.g. `{ kind: 'hit' }`). */
|
|
19
|
+
action?: Record<string, unknown>;
|
|
20
|
+
/** Fixed-odds / mines: index into the previous step's `engineData.playerChoice`. */
|
|
21
|
+
playerChoiceIndex?: number;
|
|
22
|
+
/** Mines: tile picked at this step. */
|
|
23
|
+
pickPosition?: number;
|
|
24
|
+
}
|
|
25
|
+
/** Options for the {@link pfVerify} call. */
|
|
26
|
+
export interface IPfVerifyOptions extends ISessionOptions {
|
|
27
|
+
/** The revealed `serverSeed` from the round's `pf` block. */
|
|
28
|
+
serverSeed: string;
|
|
29
|
+
/** The `clientSeed` bound to that round. */
|
|
30
|
+
clientSeed: string;
|
|
31
|
+
/**
|
|
32
|
+
* Nonce at which the round's PF chain begins. Defaults to `0`. Set it
|
|
33
|
+
* only if the round opened mid-stream against an existing PF session.
|
|
34
|
+
*/
|
|
35
|
+
startNonce?: number;
|
|
36
|
+
/** The stake the round opened with. Required by games that need it to settle (blackjack, fixed-odds wager). */
|
|
37
|
+
stake?: number;
|
|
38
|
+
/** Buy-feature id the round opened on, if any (mines mine-count, slot bonus buy, …). */
|
|
39
|
+
featureToBuy?: string;
|
|
40
|
+
/** Mirror the round's opening payload — currently blackjack `{ sideBets }`. */
|
|
41
|
+
initialData?: Record<string, unknown>;
|
|
42
|
+
/** Roulette `IRouletteBet[]` or crash `ICrashBet[]` — the round's opening bets. */
|
|
43
|
+
bets?: unknown[];
|
|
44
|
+
/** Keno: the player numbers, if the round was opened with explicit picks. */
|
|
45
|
+
playerNumbers?: number[];
|
|
46
|
+
/** Continuation actions in order. Shape per game — see {@link IPfVerifyAction}. */
|
|
47
|
+
actions?: IPfVerifyAction[];
|
|
48
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ISessionOptions } from './sessionOptions.js';
|
|
2
|
+
/** Options for the {@link placeBet} call. */
|
|
3
|
+
export interface IPlaceBetOptions extends ISessionOptions {
|
|
4
|
+
/** Stake amount in minor currency units. Required for the first call of a game round. */
|
|
5
|
+
stake?: number;
|
|
6
|
+
/** Set `true` to consume a free play ticket instead of deducting from balance. */
|
|
7
|
+
useTicket?: boolean;
|
|
8
|
+
/** Feature type of the free play ticket being consumed. */
|
|
9
|
+
useTicketFeatureType?: string;
|
|
10
|
+
/** Buy-feature ID to purchase (e.g. `'freespin'`). See `config.buyFeatures`. */
|
|
11
|
+
featureToBuy?: string;
|
|
12
|
+
/** Index of the selected option when `engineData.playerChoice` is set. */
|
|
13
|
+
playerChoiceIndex?: number;
|
|
14
|
+
/** Additional game-specific parameters. */
|
|
15
|
+
additionalData?: Record<string, unknown>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { TPlayerChoiceAward, TPlayerChoiceCashAward, TPlayerChoiceFeatureAward } from './spinAward.js';
|
|
2
|
+
/** Feature award with optional weighting for random selection. */
|
|
3
|
+
export type TRandomChoiceFeatureAward = TPlayerChoiceFeatureAward & {
|
|
4
|
+
weighting?: number;
|
|
5
|
+
};
|
|
6
|
+
/** Cash award with optional weighting for random selection. */
|
|
7
|
+
export type TRandomChoiceCashAward = TPlayerChoiceCashAward & {
|
|
8
|
+
weighting?: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A single option in a counter's `randomChoice` `onComplete.awards` array.
|
|
12
|
+
* Independently either a feature-spin award or a cash award.
|
|
13
|
+
*/
|
|
14
|
+
export type TRandomChoiceAward = TRandomChoiceFeatureAward | TRandomChoiceCashAward;
|
|
15
|
+
/**
|
|
16
|
+
* Counter completion configuration — selection mode (`playerChoice` or
|
|
17
|
+
* `randomChoice`) is at the top level; each individual award option is
|
|
18
|
+
* independently a feature-spin award or a cash award. The two kinds may
|
|
19
|
+
* be mixed freely in the same array.
|
|
20
|
+
*/
|
|
21
|
+
export type TProgressionAwarded = {
|
|
22
|
+
type: 'playerChoice';
|
|
23
|
+
awards: TPlayerChoiceAward[];
|
|
24
|
+
} | {
|
|
25
|
+
type: 'randomChoice';
|
|
26
|
+
awards: TRandomChoiceAward[];
|
|
27
|
+
};
|
|
28
|
+
/** Configuration for a single progression counter defined at the game config level. */
|
|
29
|
+
export interface IProgressionCounterConfig {
|
|
30
|
+
/** Counter name — matches keys in entry `progressionAwards`. */
|
|
31
|
+
name: string;
|
|
32
|
+
/** Award granted when the counter reaches 1.0. Each option in the awards array is independently a feature spin or cash payout. */
|
|
33
|
+
onComplete: TProgressionAwarded;
|
|
34
|
+
/** If true, maintain a separate counter per stake level. */
|
|
35
|
+
stakeSpecific: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Per-scenario progression counter event emitted on a `placeBet` response.
|
|
39
|
+
* One entry per counter that had activity during the current scenario step —
|
|
40
|
+
* either an increment, a threshold crossing, or both. The frontend reads
|
|
41
|
+
* these to animate the counter change and the prize award at the moment
|
|
42
|
+
* they happen, instead of seeing only the entry's end-of-round state.
|
|
43
|
+
*
|
|
44
|
+
* - `delta` / `value`: the increment applied and the counter's value
|
|
45
|
+
* after this step (post any threshold reset).
|
|
46
|
+
* - `cashWin` / `featureAwards` / `playerChoiceRequested`: present when
|
|
47
|
+
* the increment crossed `1.0` and `onComplete` fired. Multiple awards
|
|
48
|
+
* on the same step (delta ≥ 1.0, or a `playerChoice` plus a cash
|
|
49
|
+
* resolution from a later iteration) aggregate into a single event.
|
|
50
|
+
* `playerChoice` resolutions also surface as `engineData.playerChoice`.
|
|
51
|
+
*/
|
|
52
|
+
export interface IProgressionEvent {
|
|
53
|
+
/** Counter name (matches an entry in `progressionCounters`). */
|
|
54
|
+
counter: string;
|
|
55
|
+
/** Increment applied this step. */
|
|
56
|
+
delta: number;
|
|
57
|
+
/** Counter value after this step's delta and any threshold reset. */
|
|
58
|
+
value: number;
|
|
59
|
+
/** Total cash awarded by `randomChoice` resolutions on this step, in stake-multiplier units. */
|
|
60
|
+
cashWin?: number;
|
|
61
|
+
/** Feature awards merged into `spinInfo` by `randomChoice` resolutions on this step. */
|
|
62
|
+
featureAwards?: TRandomChoiceFeatureAward[];
|
|
63
|
+
/** Set when a threshold crossing on this step required player input. */
|
|
64
|
+
playerChoiceRequested?: boolean;
|
|
65
|
+
}
|