@getenginex/sdk-igaming 0.8.1 → 0.10.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/CHANGELOG.md +14 -0
- package/README.md +4 -3
- package/dist/index.cjs +593 -318
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +351 -16
- package/dist/index.d.ts +351 -16
- package/dist/index.js +593 -318
- package/dist/index.js.map +1 -1
- package/dist/query/index.cjs +5 -3
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +10 -5
- package/dist/query/index.d.ts +10 -5
- package/dist/query/index.js +5 -3
- package/dist/query/index.js.map +1 -1
- package/dist/testing/index.cjs +192 -12
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +10 -0
- package/dist/testing/index.d.ts +10 -0
- package/dist/testing/index.js +193 -13
- package/dist/testing/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,160 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CallOptions, Page, CursorPageInput, CursorPage, NoParams, EnginexClient } from '@getenginex/sdk';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Status of a sportsbook bet, without the gateway's `BET_STATUS_` prefix and in lowercase. A new value the SDK
|
|
5
|
+
* does not know yet may arrive (a number as text, when the gateway does not know it either): handle the
|
|
6
|
+
* default case.
|
|
7
|
+
* @category Bets
|
|
8
|
+
*/
|
|
9
|
+
type BetStatus = 'pending' | 'open' | 'won' | 'lost' | 'void' | 'cashed_out' | 'partially_settled' | 'unspecified' | (string & {});
|
|
10
|
+
/**
|
|
11
|
+
* Result of a selection, without the gateway's `SELECTION_RESULT_` prefix and in lowercase. A new value may
|
|
12
|
+
* arrive: handle the default case.
|
|
13
|
+
* @category Bets
|
|
14
|
+
*/
|
|
15
|
+
type BetSelectionResult = 'pending' | 'won' | 'lost' | 'void' | 'half_won' | 'half_lost' | 'unspecified' | (string & {});
|
|
16
|
+
/**
|
|
17
|
+
* A sportsbook bet of the player (`GET /bets`).
|
|
18
|
+
*
|
|
19
|
+
* Amounts are in minor units of the **operator's currency** (`enginex.config.get()`): the gateway sends no
|
|
20
|
+
* currency per bet.
|
|
21
|
+
* @category Bets
|
|
22
|
+
*/
|
|
23
|
+
interface Bet {
|
|
24
|
+
/** Bet id, for {@link BetsApi.get}, {@link BetsApi.getCashoutOffer} and {@link BetsApi.cashout}. */
|
|
25
|
+
id: string;
|
|
26
|
+
/** Status, e.g. `pending`, `won`, `cashed_out`. */
|
|
27
|
+
status: BetStatus;
|
|
28
|
+
/** Stake in minor units (never negative). */
|
|
29
|
+
stake: number;
|
|
30
|
+
/** Potential return in minor units (never negative). */
|
|
31
|
+
potentialReturn: number;
|
|
32
|
+
/** Total odds (decimal), e.g. `2.35`. */
|
|
33
|
+
totalOdds: number;
|
|
34
|
+
/** Placement date, ISO 8601 (UTC); `null` when the gateway did not have one. */
|
|
35
|
+
createdAt: string | null;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A selection of a bet ({@link BetDetails.selections}).
|
|
39
|
+
* @category Bets
|
|
40
|
+
*/
|
|
41
|
+
interface BetSelection {
|
|
42
|
+
/** Event name. */
|
|
43
|
+
eventName: string;
|
|
44
|
+
/** Market name. */
|
|
45
|
+
marketName: string;
|
|
46
|
+
/** Selection (outcome) name. */
|
|
47
|
+
selectionName: string;
|
|
48
|
+
/** Odds (decimal) of the selection. */
|
|
49
|
+
odds: number;
|
|
50
|
+
/** Result, e.g. `pending`, `won`. */
|
|
51
|
+
result: BetSelectionResult;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A bet with its selections (`GET /bets/{id}`).
|
|
55
|
+
* @category Bets
|
|
56
|
+
*/
|
|
57
|
+
interface BetDetails extends Bet {
|
|
58
|
+
/** The bet's selections; `[]` when the gateway sends none. */
|
|
59
|
+
selections: BetSelection[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Pagination of {@link BetsApi.list}. There is no status filter: the gateway ignores one, so filter
|
|
63
|
+
* `items` in the app.
|
|
64
|
+
* @category Bets
|
|
65
|
+
*/
|
|
66
|
+
interface ListBetsInput {
|
|
67
|
+
/** Page (starts at 1). Gateway default: 1. */
|
|
68
|
+
page?: number;
|
|
69
|
+
/** Items per page, from 1 to 100. Gateway default: 20 (out of range also becomes 20). */
|
|
70
|
+
perPage?: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Cash-out offer of a bet (`GET /bets/{id}/cashout`). Offers expire: read it again shortly before cashing out.
|
|
74
|
+
* @category Bets
|
|
75
|
+
*/
|
|
76
|
+
interface CashoutOffer {
|
|
77
|
+
/** Bet id. */
|
|
78
|
+
betId: string;
|
|
79
|
+
/** Whether the bet can be cashed out now. `false`: do not show the cash-out button. */
|
|
80
|
+
available: boolean;
|
|
81
|
+
/** Amount offered, in minor units of the operator's currency (never negative; `0` without an offer). */
|
|
82
|
+
cashoutAmount: number;
|
|
83
|
+
/** Expiry of the offer, ISO 8601 (UTC); `null` without an offer. */
|
|
84
|
+
expiresAt: string | null;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Result of a cash-out ({@link BetsApi.cashout}).
|
|
88
|
+
* @category Bets
|
|
89
|
+
*/
|
|
90
|
+
interface CashoutResult {
|
|
91
|
+
/** Bet id. */
|
|
92
|
+
betId: string;
|
|
93
|
+
/** Amount paid, in minor units of the operator's currency (never negative). */
|
|
94
|
+
cashoutAmount: number;
|
|
95
|
+
/** Status of the bet after the cash-out, as the gateway sends it (`cashed_out`). */
|
|
96
|
+
status: 'cashed_out' | (string & {});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The player's sportsbook bets: history, details, cash-out offer and cash-out. Every method requires login.
|
|
100
|
+
* Placing bets is not part of this namespace.
|
|
101
|
+
* @category Bets
|
|
102
|
+
*/
|
|
103
|
+
interface BetsApi {
|
|
104
|
+
/**
|
|
105
|
+
* The player's bets, from newest to oldest, paginated. The gateway sends no currency: format the amounts with the
|
|
106
|
+
* operator's currency (`enginex.config.get()`).
|
|
107
|
+
* @example
|
|
108
|
+
* const { currency } = await enginex.config.get()
|
|
109
|
+
* const page = await igaming.bets.list({ perPage: 20 })
|
|
110
|
+
* page.items.forEach((bet) => render(bet.status, formatMoney(bet.stake, currency, 'pt-BR')))
|
|
111
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for a `page`/`perPage` out of range;
|
|
112
|
+
* `VALIDATION_ERROR` for a negative amount or one that does not fit in a safe integer (even in `'warn'`);
|
|
113
|
+
* `UNAUTHENTICATED` without a session.
|
|
114
|
+
*/
|
|
115
|
+
list(input?: ListBetsInput, options?: CallOptions): Promise<Page<Bet>>;
|
|
116
|
+
/**
|
|
117
|
+
* A bet with its selections.
|
|
118
|
+
* @example
|
|
119
|
+
* const bet = await igaming.bets.get({ betId })
|
|
120
|
+
* bet.selections.forEach((s) => console.log(s.eventName, s.selectionName, s.result))
|
|
121
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for an empty `betId`; `BET_NOT_FOUND`/`NOT_FOUND`
|
|
122
|
+
* (404) for an unknown id; `UNAUTHENTICATED` without a session.
|
|
123
|
+
*/
|
|
124
|
+
get(input: {
|
|
125
|
+
betId: string;
|
|
126
|
+
}, options?: CallOptions): Promise<BetDetails>;
|
|
127
|
+
/**
|
|
128
|
+
* The bet's current cash-out offer. Show the cash-out button only with `available: true`, and read it again
|
|
129
|
+
* before cashing out (offers expire).
|
|
130
|
+
* @example
|
|
131
|
+
* const offer = await igaming.bets.getCashoutOffer({ betId })
|
|
132
|
+
* if (offer.available) showCashout(offer.cashoutAmount, offer.expiresAt)
|
|
133
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for an empty `betId`; `BET_NOT_FOUND`/`NOT_FOUND`
|
|
134
|
+
* (404) for an unknown id; `UNAUTHENTICATED` without a session.
|
|
135
|
+
*/
|
|
136
|
+
getCashoutOffer(input: {
|
|
137
|
+
betId: string;
|
|
138
|
+
}, options?: CallOptions): Promise<CashoutOffer>;
|
|
139
|
+
/**
|
|
140
|
+
* Cashes out the bet at the current offer. Idempotent: it sends an `Idempotency-Key` (the one in
|
|
141
|
+
* `options.idempotencyKey` or, without it, one generated per call). To retry a cash-out whose outcome is
|
|
142
|
+
* unknown (network error, timeout, 5xx), call again with the **same** `idempotencyKey`: the gateway answers
|
|
143
|
+
* the first result instead of cashing out twice. Through `createIgamingMutations` the key is kept for you
|
|
144
|
+
* after an ambiguous failure.
|
|
145
|
+
* @example
|
|
146
|
+
* const idempotencyKey = crypto.randomUUID()
|
|
147
|
+
* const result = await igaming.bets.cashout({ betId }, { idempotencyKey })
|
|
148
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for an empty `betId` or an `idempotencyKey`
|
|
149
|
+
* with surrounding spaces or longer than 255 characters; `FAILED_PRECONDITION` (422) when there is no
|
|
150
|
+
* offer; `CASHOUT_UNAVAILABLE` (it arrives with HTTP 500: the gateway does not map it yet, identify it by the
|
|
151
|
+
* code); `KEY_IN_USE` (409) while a cash-out with the same key is still being processed;
|
|
152
|
+
* `PAYLOAD_MISMATCH` (422) for a key reused on another request; `UNAUTHENTICATED` without a session.
|
|
153
|
+
*/
|
|
154
|
+
cashout(input: {
|
|
155
|
+
betId: string;
|
|
156
|
+
}, options?: CallOptions): Promise<CashoutResult>;
|
|
157
|
+
}
|
|
2
158
|
|
|
3
159
|
/**
|
|
4
160
|
* Money value of a campaign, in minor units of the currency (e.g. cents). The decimal places
|
|
@@ -420,6 +576,11 @@ interface CampaignWageringPolicy {
|
|
|
420
576
|
rounding: CampaignRoundingMode;
|
|
421
577
|
/** Minimum odds for the sports bet to count. */
|
|
422
578
|
sportsbookContributionOdds?: CampaignOddsPolicy;
|
|
579
|
+
/**
|
|
580
|
+
* Ceiling on the restricted balance that becomes real money when the rollover completes ("maximum
|
|
581
|
+
* withdrawal"): the remainder above it is forfeited. Absent: the whole remaining balance converts.
|
|
582
|
+
*/
|
|
583
|
+
maximumConversion?: CampaignMoney;
|
|
423
584
|
};
|
|
424
585
|
}
|
|
425
586
|
/**
|
|
@@ -956,6 +1117,12 @@ interface Game {
|
|
|
956
1117
|
* @category Casino
|
|
957
1118
|
*/
|
|
958
1119
|
type GameSort = 'popular' | 'new' | 'az';
|
|
1120
|
+
/**
|
|
1121
|
+
* The viewer's device, to filter the catalog: the casino leaves out the games that only run on the other
|
|
1122
|
+
* one. Any other value rejects with `CONFIGURATION_ERROR` before the request (the gateway would answer 400).
|
|
1123
|
+
* @category Casino
|
|
1124
|
+
*/
|
|
1125
|
+
type GameDevice = 'mobile' | 'desktop';
|
|
959
1126
|
/**
|
|
960
1127
|
* Filters and pagination of {@link CasinoApi.listGames}.
|
|
961
1128
|
* @category Casino
|
|
@@ -974,11 +1141,52 @@ interface ListGamesInput {
|
|
|
974
1141
|
ids?: string[];
|
|
975
1142
|
/** Ordering. An unknown value is ignored by the gateway. */
|
|
976
1143
|
sort?: GameSort;
|
|
1144
|
+
/**
|
|
1145
|
+
* The viewer's device: the casino leaves out the games that only run on the other one. Omitted: no device
|
|
1146
|
+
* filter (every game).
|
|
1147
|
+
*/
|
|
1148
|
+
device?: GameDevice;
|
|
977
1149
|
/** Page (starts at 1). Gateway default: 1. */
|
|
978
1150
|
page?: number;
|
|
979
1151
|
/** Items per page, from 1 to 100. Gateway default: 20 (out of range also becomes 20). */
|
|
980
1152
|
perPage?: number;
|
|
981
1153
|
}
|
|
1154
|
+
/**
|
|
1155
|
+
* State of the operator's casino, as the gateway reports it next to the game list
|
|
1156
|
+
* ({@link CasinoAvailability.status}): `available`, `no_casino_configured`, `temporarily_unavailable`,
|
|
1157
|
+
* `switching` (the operator is switching providers) or `maintenance`. A new value the SDK does not know yet
|
|
1158
|
+
* may arrive: handle the default case (e.g. as a generic empty state).
|
|
1159
|
+
* @category Casino
|
|
1160
|
+
*/
|
|
1161
|
+
type CasinoAvailabilityStatus = 'available' | 'no_casino_configured' | 'temporarily_unavailable' | 'switching' | 'maintenance' | (string & {});
|
|
1162
|
+
/**
|
|
1163
|
+
* Why the catalog may be empty or partial, without it being an error ({@link GamesPage.availability}).
|
|
1164
|
+
* @category Casino
|
|
1165
|
+
*/
|
|
1166
|
+
interface CasinoAvailability {
|
|
1167
|
+
/**
|
|
1168
|
+
* State of the casino. The gateway reports an unset state as `available`, and so does the SDK for an
|
|
1169
|
+
* absent or empty one. An unknown value arrives in lowercase: decide in the app whether it opens the casino
|
|
1170
|
+
* (failing closed, e.g. as `temporarily_unavailable`, is the safe choice).
|
|
1171
|
+
*/
|
|
1172
|
+
status: CasinoAvailabilityStatus;
|
|
1173
|
+
/** Code of the operator's primary provider; `null` when the gateway sends none. */
|
|
1174
|
+
primaryProviderCode: string | null;
|
|
1175
|
+
/** What the casino reports as missing (e.g. provider codes not yet set up); `[]` when nothing is. */
|
|
1176
|
+
missing: string[];
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* A page of {@link CasinoApi.listGames}: the usual {@link Page} plus the casino's availability.
|
|
1180
|
+
* @category Casino
|
|
1181
|
+
*/
|
|
1182
|
+
interface GamesPage extends Page<Game> {
|
|
1183
|
+
/**
|
|
1184
|
+
* State of the casino the gateway reports next to the list (maintenance, provider switch, temporary
|
|
1185
|
+
* unavailability, no casino configured). `null` when the gateway does not send it (an older gateway) or
|
|
1186
|
+
* the installed `@getenginex/sdk` is older than 0.11.0.
|
|
1187
|
+
*/
|
|
1188
|
+
availability: CasinoAvailability | null;
|
|
1189
|
+
}
|
|
982
1190
|
/**
|
|
983
1191
|
* Catalog category with active games (`GET /games/categories`).
|
|
984
1192
|
* @category Casino
|
|
@@ -1027,6 +1235,12 @@ interface LaunchGameInput {
|
|
|
1027
1235
|
* (SSR/Node) pass it explicitly.
|
|
1028
1236
|
*/
|
|
1029
1237
|
returnUrl?: string;
|
|
1238
|
+
/**
|
|
1239
|
+
* Absolute URL (http/https) of the app's deposit page: the provider shows it inside the game as a link
|
|
1240
|
+
* (e.g. when the balance runs out). The gateway forwards it only when it is absolute; anything else is
|
|
1241
|
+
* dropped without an error. Omitted: the game shows no deposit link.
|
|
1242
|
+
*/
|
|
1243
|
+
depositUrl?: string;
|
|
1030
1244
|
/**
|
|
1031
1245
|
* Game language (e.g. `pt-BR`). When omitted, the gateway uses the request's `Accept-Language`, which the SDK
|
|
1032
1246
|
* fills in with the client's `locale` (see `enginex.setLocale`).
|
|
@@ -1166,6 +1380,86 @@ interface BiggestWinner {
|
|
|
1166
1380
|
/** Prize date, ISO 8601 (UTC). */
|
|
1167
1381
|
wonAt: string;
|
|
1168
1382
|
}
|
|
1383
|
+
/**
|
|
1384
|
+
* A published jackpot of the operator's lobby ({@link CasinoApi.listJackpots}).
|
|
1385
|
+
* @category Casino
|
|
1386
|
+
*/
|
|
1387
|
+
interface CasinoJackpot {
|
|
1388
|
+
/** Public jackpot id (`jackpot_` + 64 hex characters), for {@link CasinoApi.listJackpotGames}. */
|
|
1389
|
+
id: string;
|
|
1390
|
+
/** Display name. */
|
|
1391
|
+
name: string;
|
|
1392
|
+
/** Currency code, always the one requested (e.g. `BRL`). */
|
|
1393
|
+
currency: string;
|
|
1394
|
+
/**
|
|
1395
|
+
* Current value in minor units of `currency` (the gateway sends it as text; the SDK converts). Never
|
|
1396
|
+
* negative; a value that does not fit in a safe integer leaves the jackpot out instead of showing it rounded.
|
|
1397
|
+
*/
|
|
1398
|
+
amount: number;
|
|
1399
|
+
/** Decimal places of `currency` (the ISO 4217 ones, e.g. `2` for BRL, `0` for CLP, `3` for KWD), to format `amount`. */
|
|
1400
|
+
currencyDecimalPlaces: number;
|
|
1401
|
+
}
|
|
1402
|
+
/**
|
|
1403
|
+
* The lobby's published jackpots ({@link CasinoApi.listJackpots}).
|
|
1404
|
+
* @category Casino
|
|
1405
|
+
*/
|
|
1406
|
+
interface CasinoJackpots {
|
|
1407
|
+
/** Published jackpots in the requested currency, without repeated ids; `[]` when there are none. */
|
|
1408
|
+
items: CasinoJackpot[];
|
|
1409
|
+
/** Id of the featured jackpot, when it is one of `items`; otherwise `null`. */
|
|
1410
|
+
featuredId: string | null;
|
|
1411
|
+
}
|
|
1412
|
+
/**
|
|
1413
|
+
* Input of {@link CasinoApi.listJackpots}.
|
|
1414
|
+
* @category Casino
|
|
1415
|
+
*/
|
|
1416
|
+
interface ListJackpotsInput {
|
|
1417
|
+
/** The site's currency, ISO 4217 in uppercase (e.g. `BRL`, from `enginex.config.get()`). */
|
|
1418
|
+
currency: string;
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* Input of {@link CasinoApi.listJackpotGames}. Page 1 has no cursor; every next page needs the previous
|
|
1422
|
+
* page's {@link JackpotGamesPage.nextCursor}.
|
|
1423
|
+
* @category Casino
|
|
1424
|
+
*/
|
|
1425
|
+
interface ListJackpotGamesInput {
|
|
1426
|
+
/** Jackpot id ({@link CasinoJackpot.id}). */
|
|
1427
|
+
jackpotId: string;
|
|
1428
|
+
/** The site's currency, the same as in {@link CasinoApi.listJackpots}. */
|
|
1429
|
+
currency: string;
|
|
1430
|
+
/** The viewer's device. Omitted: no device filter. */
|
|
1431
|
+
device?: GameDevice;
|
|
1432
|
+
/** Page (starts at 1). Default: 1. Above 1 it requires `cursor`. */
|
|
1433
|
+
page?: number;
|
|
1434
|
+
/** Items per page, from 1 to 48. Gateway default: 24. */
|
|
1435
|
+
perPage?: number;
|
|
1436
|
+
/** The previous page's {@link JackpotGamesPage.nextCursor}. */
|
|
1437
|
+
cursor?: string;
|
|
1438
|
+
}
|
|
1439
|
+
/**
|
|
1440
|
+
* How the jackpot's game list was resolved: `verified` (the games the provider confirms take part in the
|
|
1441
|
+
* jackpot) or `demonstration` (an illustrative selection). A new value may arrive: handle the default case.
|
|
1442
|
+
* @category Casino
|
|
1443
|
+
*/
|
|
1444
|
+
type JackpotGamesMode = 'verified' | 'demonstration' | (string & {});
|
|
1445
|
+
/**
|
|
1446
|
+
* A page of a jackpot's games ({@link CasinoApi.listJackpotGames}), paginated by cursor.
|
|
1447
|
+
* @category Casino
|
|
1448
|
+
*/
|
|
1449
|
+
interface JackpotGamesPage {
|
|
1450
|
+
/** Game cards on this page; `[]` when there are none. */
|
|
1451
|
+
items: Game[];
|
|
1452
|
+
/** How the list was resolved. */
|
|
1453
|
+
mode: JackpotGamesMode;
|
|
1454
|
+
/** Page number, as requested. */
|
|
1455
|
+
page: number;
|
|
1456
|
+
/** Items per page, as requested. */
|
|
1457
|
+
perPage: number;
|
|
1458
|
+
/** Whether there is a next page. */
|
|
1459
|
+
hasNext: boolean;
|
|
1460
|
+
/** Cursor for the next page (pass it with `page + 1`); `null` on the last one. */
|
|
1461
|
+
nextCursor: string | null;
|
|
1462
|
+
}
|
|
1169
1463
|
/**
|
|
1170
1464
|
* Catalog, game launch and casino history. The catalog (`listGames`, `listCategories`,
|
|
1171
1465
|
* `listProviders`, `getGame`) is public; the other methods require login.
|
|
@@ -1177,17 +1471,17 @@ interface CasinoApi {
|
|
|
1177
1471
|
* login (the catalog does not depend on the player).
|
|
1178
1472
|
*
|
|
1179
1473
|
* Maintenance, a provider switch, temporary unavailability or an operator without a casino do **not**
|
|
1180
|
-
* become errors: the gateway answers 200 and reports the reason in
|
|
1181
|
-
*
|
|
1182
|
-
* a generic empty state.
|
|
1474
|
+
* become errors: the gateway answers 200 and reports the reason in {@link GamesPage.availability}, next to
|
|
1475
|
+
* the list. In those cases the list may come empty, without an error: branch on `availability.status`.
|
|
1183
1476
|
* @example
|
|
1184
|
-
* const page = await igaming.casino.listGames({ category: 'slots', sort: 'popular', perPage: 24 })
|
|
1477
|
+
* const page = await igaming.casino.listGames({ category: 'slots', sort: 'popular', perPage: 24, device: 'mobile' })
|
|
1478
|
+
* if (page.availability?.status === 'maintenance') showMaintenance()
|
|
1185
1479
|
* page.items.forEach((game) => renderCard(game.name, game.thumbnail))
|
|
1186
|
-
* @throws {EnginexError} `
|
|
1187
|
-
*
|
|
1188
|
-
* service itself fails.
|
|
1480
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for a `device` other than `mobile`/`desktop`;
|
|
1481
|
+
* `INVALID_ARGUMENT` (400) for `search` above 100 characters or more than 100 `ids`;
|
|
1482
|
+
* `UNAVAILABLE`/`PROVIDER_ERROR` (503) only when the call to the casino service itself fails.
|
|
1189
1483
|
*/
|
|
1190
|
-
listGames(input?: ListGamesInput, options?: CallOptions): Promise<
|
|
1484
|
+
listGames(input?: ListGamesInput, options?: CallOptions): Promise<GamesPage>;
|
|
1191
1485
|
/**
|
|
1192
1486
|
* Categories with active games, to build lobby tabs/filters. Public.
|
|
1193
1487
|
* @example
|
|
@@ -1277,6 +1571,40 @@ interface CasinoApi {
|
|
|
1277
1571
|
* `UNAUTHENTICATED` without a session.
|
|
1278
1572
|
*/
|
|
1279
1573
|
getBiggestWinners(input?: GetBiggestWinnersInput, options?: CallOptions): Promise<BiggestWinner[]>;
|
|
1574
|
+
/**
|
|
1575
|
+
* The lobby's published jackpots in the site's currency. Public (it does not send the session). A
|
|
1576
|
+
* `currency` other than the site's answers an empty list. An entry the SDK cannot show safely (no id or
|
|
1577
|
+
* name, another currency, a negative or non-integer amount, an amount that does not fit in a safe integer,
|
|
1578
|
+
* or invalid decimal places) is left out, and a repeated id keeps the first one.
|
|
1579
|
+
*
|
|
1580
|
+
* Available on gateways with lobby jackpots (the `dev` environment today); elsewhere the route answers 404.
|
|
1581
|
+
* @example
|
|
1582
|
+
* const { currency } = await enginex.config.get()
|
|
1583
|
+
* const { items, featuredId } = await igaming.casino.listJackpots({ currency: currency.code })
|
|
1584
|
+
* const featured = items.find((jackpot) => jackpot.id === featuredId)
|
|
1585
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) if `currency` is not three uppercase letters;
|
|
1586
|
+
* `INVALID_ARGUMENT` (400) for a currency the gateway does not support; `UNAVAILABLE` (503) when the site's
|
|
1587
|
+
* currency or the casino service is unavailable; `NOT_FOUND` (404) on a gateway without lobby jackpots.
|
|
1588
|
+
*/
|
|
1589
|
+
listJackpots(input: ListJackpotsInput, options?: CallOptions): Promise<CasinoJackpots>;
|
|
1590
|
+
/**
|
|
1591
|
+
* Game cards of a published jackpot, paginated by cursor. Public (it does not send the session). Ask for page
|
|
1592
|
+
* 1 without a cursor, then for `page + 1` with the previous page's `nextCursor` while `hasNext`.
|
|
1593
|
+
*
|
|
1594
|
+
* Available on gateways with lobby jackpots (the `dev` environment today); elsewhere the route answers 404.
|
|
1595
|
+
* @example
|
|
1596
|
+
* let page = await igaming.casino.listJackpotGames({ jackpotId, currency: 'BRL', device: 'mobile' })
|
|
1597
|
+
* while (page.hasNext && page.nextCursor) {
|
|
1598
|
+
* page = await igaming.casino.listJackpotGames({ jackpotId, currency: 'BRL', device: 'mobile', page: page.page + 1, cursor: page.nextCursor })
|
|
1599
|
+
* }
|
|
1600
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for an empty `jackpotId`, a `currency` that is not
|
|
1601
|
+
* three uppercase letters, a `device` other than `mobile`/`desktop`, a `page` that is not an integer ≥ 1, a
|
|
1602
|
+
* `perPage` outside 1 to 48 or a `page` above 1 without `cursor`; `INVALID_ARGUMENT` (400) for an id that is
|
|
1603
|
+
* not a public jackpot id or an invalid cursor; `NOT_FOUND` (404) for a jackpot that is not published in
|
|
1604
|
+
* that currency (or a gateway without lobby jackpots); `UNAVAILABLE` (503) when the casino service fails or
|
|
1605
|
+
* answers an inconsistent page.
|
|
1606
|
+
*/
|
|
1607
|
+
listJackpotGames(input: ListJackpotGamesInput, options?: CallOptions): Promise<JackpotGamesPage>;
|
|
1280
1608
|
}
|
|
1281
1609
|
|
|
1282
1610
|
/**
|
|
@@ -1286,6 +1614,11 @@ interface CasinoApi {
|
|
|
1286
1614
|
* @category Loyalty
|
|
1287
1615
|
*/
|
|
1288
1616
|
type RedemptionType = 'bonus' | 'cash' | 'free_bet' | (string & {});
|
|
1617
|
+
/**
|
|
1618
|
+
* Benefits of a loyalty tier as the operator wrote them: an object keyed by benefit or a list of benefits.
|
|
1619
|
+
* @category Loyalty
|
|
1620
|
+
*/
|
|
1621
|
+
type LoyaltyTierBenefits = Record<string, unknown> | unknown[];
|
|
1289
1622
|
/**
|
|
1290
1623
|
* The player's loyalty status (`GET /loyalty`).
|
|
1291
1624
|
* @category Loyalty
|
|
@@ -1306,12 +1639,12 @@ interface LoyaltyStatus {
|
|
|
1306
1639
|
/** Total deposited over the player's lifetime, in minor units (the currency does not come with it). */
|
|
1307
1640
|
lifetimeDeposited: number;
|
|
1308
1641
|
/**
|
|
1309
|
-
* Benefits of the current tier, read from the JSON text the gateway passes along
|
|
1310
|
-
* by the operator (the contract only says "benefits of the current tier"):
|
|
1311
|
-
* when it comes empty or absent, and also when it is
|
|
1312
|
-
* `onValidationIssue` is notified, without the content).
|
|
1642
|
+
* Benefits of the current tier, read from the JSON text the gateway passes along: an object (keyed by benefit)
|
|
1643
|
+
* or a list. The format is defined by the operator (the contract only says "benefits of the current tier"):
|
|
1644
|
+
* check before displaying. `null` when it comes empty or absent, and also when it is neither a JSON object nor
|
|
1645
|
+
* a JSON array (in this case `onValidationIssue` is notified, without the content).
|
|
1313
1646
|
*/
|
|
1314
|
-
tierBenefits:
|
|
1647
|
+
tierBenefits: LoyaltyTierBenefits | null;
|
|
1315
1648
|
/** When the tier expires (ISO 8601, UTC); `null` when the gateway does not send it. */
|
|
1316
1649
|
tierExpiresAt: string | null;
|
|
1317
1650
|
}
|
|
@@ -1350,7 +1683,7 @@ interface LoyaltyApi {
|
|
|
1350
1683
|
* const loyalty = await igaming.loyalty.get()
|
|
1351
1684
|
* console.log(loyalty.currentPoints, loyalty.currentTier, loyalty.tierBenefits)
|
|
1352
1685
|
* @throws {EnginexError} `UNAUTHENTICATED` without a session. With `validation: 'strict'`,
|
|
1353
|
-
* `VALIDATION_ERROR` if `tier_benefits_json` is
|
|
1686
|
+
* `VALIDATION_ERROR` if `tier_benefits_json` is neither a JSON object nor a JSON array.
|
|
1354
1687
|
*/
|
|
1355
1688
|
get(params?: NoParams, options?: CallOptions): Promise<LoyaltyStatus>;
|
|
1356
1689
|
/**
|
|
@@ -1734,6 +2067,8 @@ interface IgamingClient {
|
|
|
1734
2067
|
referrals: ReferralsApi;
|
|
1735
2068
|
/** FIRST sportsbook: session to open the sportsbook in an iframe. */
|
|
1736
2069
|
sportsbook: SportsbookApi;
|
|
2070
|
+
/** The player's sportsbook bets: history, details, cash-out offer and cash-out. */
|
|
2071
|
+
bets: BetsApi;
|
|
1737
2072
|
}
|
|
1738
2073
|
/**
|
|
1739
2074
|
* Creates the iGaming namespaces on top of a `@getenginex/sdk` client. It creates no session, tenant or
|
|
@@ -1757,4 +2092,4 @@ interface IgamingClient {
|
|
|
1757
2092
|
*/
|
|
1758
2093
|
declare function createIgaming(client: EnginexClient): IgamingClient;
|
|
1759
2094
|
|
|
1760
|
-
export { type ActivityAggregateQualification, type BalanceCreditReward, type BiggestWinner, type BonusApi, type BonusOverview, type BonusOverviewCurrency, type BonusPosition, type BonusPositionState, type BonusPositionTerminalAction, type CampaignCashoutMode, type CampaignContent, type CampaignEntryPolicyCode, type CampaignExactRatio, type CampaignLocalizedContent, type CampaignMaximumBet, type CampaignMoney, type CampaignOddsPolicy, type CampaignOffer, type CampaignParticipation, type CampaignParticipationStatus, type CampaignPercentCalculation, type CampaignPolicy, type CampaignProductScope, type CampaignQualification, type CampaignReward, type CampaignRewardClaimPolicyCode, type CampaignRewardGrant, type CampaignRewardGrantState, type CampaignRewardKind, type CampaignRewardValidity, type CampaignRoundingMode, type CampaignStackingPolicy, type CampaignTermsAcceptance, type CampaignTermsAcceptanceRecord, type CampaignTimeWindow, type CampaignUsePolicy, type CampaignWageringPolicy, type CampaignWageringProgress, type CasinoActivitySelector, type CasinoApi, type CasinoFreeSpinsReward, type CasinoPageInput, type CasinoTransaction, type CasinoTransactionType, type DepositSettledQualification, type Game, type GameCategory, type GameLaunch, type GameProvider, type GameSession, type GameSessionStatus, type GameSort, type GetBiggestWinnersInput, type IgamingClient, type LaunchGameInput, type LaunchTarget, type ListBonusPositionsInput, type ListGamesInput, type ListMissionsInput, type ListReferralsInput, type LoyaltyApi, type LoyaltyStatus, type Mission, type MissionObjectiveType, type MissionRewardType, type MissionType, type MissionsApi, type OptInInput, type PromoCodeOffer, type RedeemPointsInput, type RedeemedPoints, type RedemptionType, type Referral, type ReferralHistory, type ReferralInfo, type ReferralMoney, type ReferralProgress, type ReferralRules, type ReferralStatus, type ReferralTotals, type ReferralsApi, type SportsActivitySelector, type SportsBetCoverageReward, type SportsBetType, type SportsBonusBetReward, type SportsbookApi, type SportsbookSession, type UserEventQualification, type UserMission, type UserMissionStatus, createIgaming };
|
|
2095
|
+
export { type ActivityAggregateQualification, type BalanceCreditReward, type Bet, type BetDetails, type BetSelection, type BetSelectionResult, type BetStatus, type BetsApi, type BiggestWinner, type BonusApi, type BonusOverview, type BonusOverviewCurrency, type BonusPosition, type BonusPositionState, type BonusPositionTerminalAction, type CampaignCashoutMode, type CampaignContent, type CampaignEntryPolicyCode, type CampaignExactRatio, type CampaignLocalizedContent, type CampaignMaximumBet, type CampaignMoney, type CampaignOddsPolicy, type CampaignOffer, type CampaignParticipation, type CampaignParticipationStatus, type CampaignPercentCalculation, type CampaignPolicy, type CampaignProductScope, type CampaignQualification, type CampaignReward, type CampaignRewardClaimPolicyCode, type CampaignRewardGrant, type CampaignRewardGrantState, type CampaignRewardKind, type CampaignRewardValidity, type CampaignRoundingMode, type CampaignStackingPolicy, type CampaignTermsAcceptance, type CampaignTermsAcceptanceRecord, type CampaignTimeWindow, type CampaignUsePolicy, type CampaignWageringPolicy, type CampaignWageringProgress, type CashoutOffer, type CashoutResult, type CasinoActivitySelector, type CasinoApi, type CasinoAvailability, type CasinoAvailabilityStatus, type CasinoFreeSpinsReward, type CasinoJackpot, type CasinoJackpots, type CasinoPageInput, type CasinoTransaction, type CasinoTransactionType, type DepositSettledQualification, type Game, type GameCategory, type GameDevice, type GameLaunch, type GameProvider, type GameSession, type GameSessionStatus, type GameSort, type GamesPage, type GetBiggestWinnersInput, type IgamingClient, type JackpotGamesMode, type JackpotGamesPage, type LaunchGameInput, type LaunchTarget, type ListBetsInput, type ListBonusPositionsInput, type ListGamesInput, type ListJackpotGamesInput, type ListJackpotsInput, type ListMissionsInput, type ListReferralsInput, type LoyaltyApi, type LoyaltyStatus, type LoyaltyTierBenefits, type Mission, type MissionObjectiveType, type MissionRewardType, type MissionType, type MissionsApi, type OptInInput, type PromoCodeOffer, type RedeemPointsInput, type RedeemedPoints, type RedemptionType, type Referral, type ReferralHistory, type ReferralInfo, type ReferralMoney, type ReferralProgress, type ReferralRules, type ReferralStatus, type ReferralTotals, type ReferralsApi, type SportsActivitySelector, type SportsBetCoverageReward, type SportsBetType, type SportsBonusBetReward, type SportsbookApi, type SportsbookSession, type UserEventQualification, type UserMission, type UserMissionStatus, createIgaming };
|