@getenginex/sdk-igaming 0.10.0 → 0.11.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/index.js CHANGED
@@ -1,106 +1,16 @@
1
+ import { createClubApi, LOCALE, rejectInput, pageInputProblem, nonNegativeMinorUnits, optionalTimestamp, nullableList, protoEnum, optionalText, currencyOrEmpty, minorUnits, integerText, list, text, count, durationSeconds } from './chunk-LMBQDSFV.js';
2
+ export { keepsClubIdempotencyKey } from './chunk-LMBQDSFV.js';
1
3
  import { EnginexError } from '@getenginex/sdk';
2
4
  import * as extension from '@getenginex/sdk/extension';
3
- import { lazy, wire, decimalPlaces, currencyCode, money as money$1, strictValue, moneyText } from '@getenginex/sdk/extension';
4
- import * as z4 from 'zod/mini';
5
+ import { lazy, wire, decimalPlaces, currencyCode, money as money$1 } from '@getenginex/sdk/extension';
6
+ import * as z2 from 'zod/mini';
5
7
 
6
- // src/client.ts
7
-
8
- // src/internal/input.ts
9
- function rejectInput(transport, message, route) {
10
- return Promise.reject(
11
- transport.reportError({ code: "CONFIGURATION_ERROR", message, status: 0 }, { ...route, attempt: 0 })
12
- );
13
- }
14
- function pageInputProblem(name, input) {
15
- if (input === void 0) return void 0;
16
- if (typeof input !== "object" || input === null || Array.isArray(input)) return `${name}: input must be an object.`;
17
- const { page, perPage } = input;
18
- if (page !== void 0 && (typeof page !== "number" || !Number.isSafeInteger(page) || page < 1))
19
- return `${name}: page must be an integer \u2265 1.`;
20
- if (perPage !== void 0 && (typeof perPage !== "number" || !Number.isInteger(perPage) || perPage < 1 || perPage > 100))
21
- return `${name}: perPage must be an integer from 1 to 100.`;
22
- return void 0;
23
- }
24
- function optionalTimestamp() {
25
- return z4.pipe(
26
- z4.nullish(z4.string().check(z4.refine((value) => value === "" || !Number.isNaN(Date.parse(value)), "invalid date"))),
27
- z4.transform((value) => value == null || value === "" || Date.parse(value) === 0 ? null : value)
28
- );
29
- }
30
- function optionalText() {
31
- return z4.pipe(
32
- z4.nullish(z4.string()),
33
- z4.transform((value) => value == null || value === "" ? null : value)
34
- );
35
- }
36
- function nullableList(item) {
37
- return z4.pipe(
38
- z4.nullish(z4.array(item)),
39
- z4.transform((value) => value ?? [])
40
- );
41
- }
42
- function protoEnum(prefix) {
43
- return z4.pipe(
44
- z4.optional(z4.union([z4.string(), z4.number()])),
45
- z4.transform((value) => {
46
- if (value === void 0 || value === 0) return "unspecified";
47
- if (typeof value === "number") return String(value);
48
- return (value.startsWith(prefix) ? value.slice(prefix.length) : value).toLowerCase();
49
- })
50
- );
51
- }
52
- function minorUnits() {
53
- return moneyText();
54
- }
55
- function currencyOrEmpty() {
56
- return currencyCode({ allowEmpty: true });
57
- }
58
- var NON_NEGATIVE_MONEY = "Expected money in minor units: a non-negative integer within the safe range of number";
59
- function nonNegativeMinorUnits() {
60
- return z4.pipe(
61
- strictValue(
62
- (v) => typeof v === "number" && Number.isSafeInteger(v) && v >= 0 || typeof v === "string" && /^\d+$/.test(v) && Number.isSafeInteger(Number(v)),
63
- NON_NEGATIVE_MONEY
64
- ),
65
- // `|| 0`: a JSON `-0` comes out as `0`.
66
- z4.transform((v) => Number(v) || 0)
67
- );
68
- }
69
- var INTEGER_TEXT = "Expected an integer within the safe range of number";
70
- function integerText() {
71
- return z4.pipe(
72
- z4.union([
73
- z4.string().check(
74
- z4.refine((value) => /^-?\d+$/.test(value) && Number.isSafeInteger(Number(value)), { message: INTEGER_TEXT })
75
- ),
76
- z4.number().check(z4.refine((value) => Number.isSafeInteger(value), { message: INTEGER_TEXT }))
77
- ]),
78
- z4.transform(Number)
79
- );
80
- }
81
- function text() {
82
- return z4._default(z4.string(), "");
83
- }
84
- function count() {
85
- return z4._default(z4.number(), 0);
86
- }
87
- function list(item) {
88
- return z4._default(z4.array(item), []);
89
- }
90
- function durationSeconds() {
91
- return z4.pipe(
92
- z4.string().check(z4.regex(/^-?\d+(\.\d+)?s$/, { message: 'Expected a protobuf duration, e.g. "86400s"' })),
93
- z4.transform((value) => Number(value.slice(0, -1)))
94
- );
95
- }
96
-
97
- // src/modules/bets.ts
98
8
  var betFields = () => ({
99
- id: z4.string(),
9
+ id: z2.string(),
100
10
  status: protoEnum("BET_STATUS_"),
101
11
  stake: nonNegativeMinorUnits(),
102
12
  potential_return: nonNegativeMinorUnits(),
103
- total_odds: z4.number(),
13
+ total_odds: z2.number(),
104
14
  created_at: optionalTimestamp()
105
15
  });
106
16
  var betSchema = /* @__PURE__ */ lazy(() => wire(betFields()));
@@ -109,10 +19,10 @@ var betDetailsSchema = /* @__PURE__ */ lazy(
109
19
  ...betFields(),
110
20
  selections: nullableList(
111
21
  wire({
112
- event_name: z4.string(),
113
- market_name: z4.string(),
114
- selection_name: z4.string(),
115
- odds: z4.number(),
22
+ event_name: z2.string(),
23
+ market_name: z2.string(),
24
+ selection_name: z2.string(),
25
+ odds: z2.number(),
116
26
  result: protoEnum("SELECTION_RESULT_")
117
27
  })
118
28
  )
@@ -120,14 +30,14 @@ var betDetailsSchema = /* @__PURE__ */ lazy(
120
30
  );
121
31
  var offerSchema = /* @__PURE__ */ lazy(
122
32
  () => wire({
123
- bet_id: z4.string(),
124
- available: z4.boolean(),
33
+ bet_id: z2.string(),
34
+ available: z2.boolean(),
125
35
  cashout_amount: nonNegativeMinorUnits(),
126
36
  expires_at: optionalTimestamp()
127
37
  })
128
38
  );
129
39
  var cashoutSchema = /* @__PURE__ */ lazy(
130
- () => wire({ bet_id: z4.string(), cashout_amount: nonNegativeMinorUnits(), status: z4.string() })
40
+ () => wire({ bet_id: z2.string(), cashout_amount: nonNegativeMinorUnits(), status: z2.string() })
131
41
  );
132
42
  var LIST_ROUTE = { method: "GET", path: "/bets" };
133
43
  var GET_ROUTE = { method: "GET", path: "/bets/{betId}" };
@@ -199,148 +109,148 @@ function createBetsApi(transport) {
199
109
  }
200
110
  };
201
111
  }
202
- var campaignCurrency = () => z4._default(currencyOrEmpty(), "");
203
- var money = () => wire({ amount: z4._default(minorUnits(), 0), currency: campaignCurrency() });
204
- var timeWindow = () => wire({ starts_at: z4.optional(z4.string()), ends_at: z4.optional(z4.string()) });
205
- var ratio = () => wire({ decimal: z4.optional(z4.string()), basis_points: z4.optional(z4.number()), maximum_scale: count() });
112
+ var campaignCurrency = () => z2._default(currencyOrEmpty(), "");
113
+ var money = () => wire({ amount: z2._default(minorUnits(), 0), currency: campaignCurrency() });
114
+ var timeWindow = () => wire({ starts_at: z2.optional(z2.string()), ends_at: z2.optional(z2.string()) });
115
+ var ratio = () => wire({ decimal: z2.optional(z2.string()), basis_points: z2.optional(z2.number()), maximum_scale: count() });
206
116
  var empty = () => wire({});
207
117
  var policy = (prefix) => wire({ code: protoEnum(prefix), version: count() });
208
118
  var casinoSelector = () => wire({
209
119
  provider_instance_id: text(),
210
- software_ids: list(z4.string()),
211
- game_ids: list(z4.string()),
212
- category_codes: list(z4.string())
120
+ software_ids: list(z2.string()),
121
+ game_ids: list(z2.string()),
122
+ category_codes: list(z2.string())
213
123
  });
214
124
  var sportsSelector = () => wire({
215
- sport_codes: list(z4.string()),
216
- competition_ids: list(z4.string()),
217
- event_ids: list(z4.string()),
218
- market_codes: list(z4.string()),
219
- live: z4.optional(z4.boolean()),
125
+ sport_codes: list(z2.string()),
126
+ competition_ids: list(z2.string()),
127
+ event_ids: list(z2.string()),
128
+ market_codes: list(z2.string()),
129
+ live: z2.optional(z2.boolean()),
220
130
  bet_types: list(protoEnum("SPORTS_BET_TYPE_"))
221
131
  });
222
132
  var qualification = () => wire({
223
133
  version: count(),
224
- immediate: z4.optional(empty()),
225
- user_event: z4.optional(
134
+ immediate: z2.optional(empty()),
135
+ user_event: z2.optional(
226
136
  wire({
227
137
  event_code: text(),
228
138
  event_version: count(),
229
139
  source_authority: text(),
230
- identity_fields: list(z4.string())
140
+ identity_fields: list(z2.string())
231
141
  })
232
142
  ),
233
- deposit_settled: z4.optional(
143
+ deposit_settled: z2.optional(
234
144
  wire({
235
145
  currency: campaignCurrency(),
236
- eligible_method_codes: list(z4.string()),
146
+ eligible_method_codes: list(z2.string()),
237
147
  first_deposit_policy: protoEnum("FIRST_DEPOSIT_POLICY_"),
238
- minimum_settled_net_amount: z4.optional(money()),
239
- maximum_settled_net_amount: z4.optional(money()),
148
+ minimum_settled_net_amount: z2.optional(money()),
149
+ maximum_settled_net_amount: z2.optional(money()),
240
150
  amount_basis: protoEnum("DEPOSIT_AMOUNT_BASIS_")
241
151
  })
242
152
  ),
243
- activity_aggregate: z4.optional(
153
+ activity_aggregate: z2.optional(
244
154
  wire({
245
155
  basis: protoEnum("BASIS_"),
246
156
  product_scope: protoEnum("PRODUCT_SCOPE_"),
247
157
  currency: campaignCurrency(),
248
- window: z4.optional(durationSeconds()),
158
+ window: z2.optional(durationSeconds()),
249
159
  timezone: text(),
250
- late_event_grace: z4.optional(durationSeconds()),
251
- casino: z4.optional(casinoSelector()),
252
- sportsbook: z4.optional(sportsSelector())
160
+ late_event_grace: z2.optional(durationSeconds()),
161
+ casino: z2.optional(casinoSelector()),
162
+ sportsbook: z2.optional(sportsSelector())
253
163
  })
254
164
  )
255
165
  });
256
166
  var validity = () => wire({
257
- no_expiry: z4.optional(empty()),
258
- absolute_expiry: z4.optional(wire({ expires_at: z4.optional(z4.string()) })),
259
- duration_from_grant: z4.optional(wire({ duration: z4.optional(durationSeconds()) }))
167
+ no_expiry: z2.optional(empty()),
168
+ absolute_expiry: z2.optional(wire({ expires_at: z2.optional(z2.string()) })),
169
+ duration_from_grant: z2.optional(wire({ duration: z2.optional(durationSeconds()) }))
260
170
  });
261
171
  var rounding = () => protoEnum("ROUNDING_MODE_");
262
172
  var proceedsClass = () => protoEnum("PROCEEDS_CLASS_");
263
173
  var percent = () => wire({
264
- percentage: z4.optional(ratio()),
174
+ percentage: z2.optional(ratio()),
265
175
  rounding: rounding(),
266
- minimum_reward: z4.optional(money()),
267
- maximum_reward: z4.optional(money())
176
+ minimum_reward: z2.optional(money()),
177
+ maximum_reward: z2.optional(money())
268
178
  });
269
179
  var balanceCredit = () => wire({
270
- fixed_amount: z4.optional(wire({ amount: z4.optional(money()) })),
271
- percent_of_source_amount: z4.optional(percent()),
272
- aggregate_rebate: z4.optional(
180
+ fixed_amount: z2.optional(wire({ amount: z2.optional(money()) })),
181
+ percent_of_source_amount: z2.optional(percent()),
182
+ aggregate_rebate: z2.optional(
273
183
  wire({
274
- percentage: z4.optional(ratio()),
184
+ percentage: z2.optional(ratio()),
275
185
  rounding: rounding(),
276
- minimum_basis: z4.optional(money()),
277
- maximum_reward: z4.optional(money())
186
+ minimum_basis: z2.optional(money()),
187
+ maximum_reward: z2.optional(money())
278
188
  })
279
189
  ),
280
190
  balance_class: protoEnum("BALANCE_CLASS_"),
281
191
  proceeds_class: proceedsClass(),
282
- validity: z4.optional(validity())
192
+ validity: z2.optional(validity())
283
193
  });
284
- var maximumBet = () => wire({ mode: protoEnum("MAXIMUM_BET_MODE_"), campaign_maximum: z4.optional(money()) });
194
+ var maximumBet = () => wire({ mode: protoEnum("MAXIMUM_BET_MODE_"), campaign_maximum: z2.optional(money()) });
285
195
  var oddsPolicy = () => wire({
286
196
  mode: protoEnum("MODE_"),
287
- minimum_total_odds_decimal: z4.optional(z4.string()),
288
- minimum_odds_per_leg_decimal: z4.optional(z4.string()),
289
- minimum_legs: z4.optional(z4.number()),
290
- maximum_legs: z4.optional(z4.number())
197
+ minimum_total_odds_decimal: z2.optional(z2.string()),
198
+ minimum_odds_per_leg_decimal: z2.optional(z2.string()),
199
+ minimum_legs: z2.optional(z2.number()),
200
+ maximum_legs: z2.optional(z2.number())
291
201
  });
292
202
  var cashoutMode = () => protoEnum("RESTRICTED_CASHOUT_MODE_");
293
203
  var usePolicy = () => wire({
294
204
  version: count(),
295
- funds_consumption: z4.optional(policy("FUNDS_CONSUMPTION_POLICY_CODE_")),
296
- casino: z4.optional(wire({ allowed_scopes: list(casinoSelector()), maximum_bet: z4.optional(maximumBet()) })),
297
- sportsbook: z4.optional(
205
+ funds_consumption: z2.optional(policy("FUNDS_CONSUMPTION_POLICY_CODE_")),
206
+ casino: z2.optional(wire({ allowed_scopes: list(casinoSelector()), maximum_bet: z2.optional(maximumBet()) })),
207
+ sportsbook: z2.optional(
298
208
  wire({
299
209
  allowed_scopes: list(sportsSelector()),
300
210
  excluded_scopes: list(sportsSelector()),
301
- maximum_bet: z4.optional(maximumBet()),
302
- funding_odds: z4.optional(oddsPolicy()),
211
+ maximum_bet: z2.optional(maximumBet()),
212
+ funding_odds: z2.optional(oddsPolicy()),
303
213
  cashout_mode: cashoutMode()
304
214
  })
305
215
  ),
306
- casino_and_sportsbook: z4.optional(
216
+ casino_and_sportsbook: z2.optional(
307
217
  wire({
308
218
  allowed_casino_scopes: list(casinoSelector()),
309
219
  allowed_sportsbook_scopes: list(sportsSelector()),
310
220
  excluded_sportsbook_scopes: list(sportsSelector()),
311
- maximum_casino_bet: z4.optional(maximumBet()),
312
- maximum_sportsbook_bet: z4.optional(maximumBet()),
313
- sportsbook_funding_odds: z4.optional(oddsPolicy()),
221
+ maximum_casino_bet: z2.optional(maximumBet()),
222
+ maximum_sportsbook_bet: z2.optional(maximumBet()),
223
+ sportsbook_funding_odds: z2.optional(oddsPolicy()),
314
224
  sportsbook_cashout_mode: cashoutMode()
315
225
  })
316
226
  ),
317
- payout_allocation: z4.optional(policy("PAYOUT_ALLOCATION_POLICY_CODE_"))
227
+ payout_allocation: z2.optional(policy("PAYOUT_ALLOCATION_POLICY_CODE_"))
318
228
  });
319
229
  var wageringPolicy = () => wire({
320
230
  version: count(),
321
- none: z4.optional(empty()),
322
- multiplier: z4.optional(
231
+ none: z2.optional(empty()),
232
+ multiplier: z2.optional(
323
233
  wire({
324
234
  requirement_basis: protoEnum("REQUIREMENT_BASIS_"),
325
- multiplier: z4.optional(ratio()),
235
+ multiplier: z2.optional(ratio()),
326
236
  contribution_rates: list(
327
237
  wire({
328
- casino: z4.optional(casinoSelector()),
329
- sportsbook: z4.optional(sportsSelector()),
330
- rate: z4.optional(ratio())
238
+ casino: z2.optional(casinoSelector()),
239
+ sportsbook: z2.optional(sportsSelector()),
240
+ rate: z2.optional(ratio())
331
241
  })
332
242
  ),
333
- deadline: z4.optional(validity()),
243
+ deadline: z2.optional(validity()),
334
244
  rounding: rounding(),
335
- sportsbook_contribution_odds: z4.optional(oddsPolicy()),
336
- maximum_conversion: z4.optional(money())
245
+ sportsbook_contribution_odds: z2.optional(oddsPolicy()),
246
+ maximum_conversion: z2.optional(money())
337
247
  })
338
248
  )
339
249
  });
340
250
  var stackingPolicy = () => wire({
341
251
  version: count(),
342
- exclusive_in_group: z4.optional(wire({ stacking_group_key: text() })),
343
- multiple_in_group: z4.optional(wire({ stacking_group_key: text(), maximum_active_per_player: count() }))
252
+ exclusive_in_group: z2.optional(wire({ stacking_group_key: text() })),
253
+ multiple_in_group: z2.optional(wire({ stacking_group_key: text(), maximum_active_per_player: count() }))
344
254
  });
345
255
  var reward = () => wire({
346
256
  reward_key: text(),
@@ -348,49 +258,49 @@ var reward = () => wire({
348
258
  reward_kind_version: count(),
349
259
  execution_profile_code: protoEnum("EXECUTION_PROFILE_CODE_"),
350
260
  execution_profile_version: count(),
351
- balance_credit: z4.optional(balanceCredit()),
352
- provider_managed_balance: z4.optional(wire({ provider_code: text() })),
353
- casino_free_spins: z4.optional(
261
+ balance_credit: z2.optional(balanceCredit()),
262
+ provider_managed_balance: z2.optional(wire({ provider_code: text() })),
263
+ casino_free_spins: z2.optional(
354
264
  wire({
355
265
  provider_code: text(),
356
- casino_scope: z4.optional(casinoSelector()),
266
+ casino_scope: z2.optional(casinoSelector()),
357
267
  quantity: count(),
358
- denomination: z4.optional(money()),
268
+ denomination: z2.optional(money()),
359
269
  currency: campaignCurrency(),
360
- grant_window: z4.optional(timeWindow()),
270
+ grant_window: z2.optional(timeWindow()),
361
271
  proceeds_class: proceedsClass(),
362
- maximum_winnings: z4.optional(money())
272
+ maximum_winnings: z2.optional(money())
363
273
  })
364
274
  ),
365
- sports_bonus_bet: z4.optional(
275
+ sports_bonus_bet: z2.optional(
366
276
  wire({
367
277
  provider_code: text(),
368
- sportsbook_scope: z4.optional(sportsSelector()),
369
- amount: z4.optional(money()),
278
+ sportsbook_scope: z2.optional(sportsSelector()),
279
+ amount: z2.optional(money()),
370
280
  quantity: count(),
371
- validity: z4.optional(validity())
281
+ validity: z2.optional(validity())
372
282
  })
373
283
  ),
374
- sports_bet_coverage: z4.optional(
284
+ sports_bet_coverage: z2.optional(
375
285
  wire({
376
286
  provider_code: text(),
377
- qualifying_bet_scope: z4.optional(sportsSelector()),
378
- coverage_cap: z4.optional(money()),
379
- validity: z4.optional(validity())
287
+ qualifying_bet_scope: z2.optional(sportsSelector()),
288
+ coverage_cap: z2.optional(money()),
289
+ validity: z2.optional(validity())
380
290
  })
381
291
  ),
382
- use_policy: z4.optional(usePolicy()),
383
- wagering_policy: z4.optional(wageringPolicy()),
384
- stacking_policy: z4.optional(stackingPolicy()),
385
- restricted_position_selection_policy: z4.optional(
292
+ use_policy: z2.optional(usePolicy()),
293
+ wagering_policy: z2.optional(wageringPolicy()),
294
+ stacking_policy: z2.optional(stackingPolicy()),
295
+ restricted_position_selection_policy: z2.optional(
386
296
  wire({
387
297
  version: count(),
388
- priority_then_earliest_expiry: z4.optional(wire({ selection_priority: z4.optional(z4.number()) }))
298
+ priority_then_earliest_expiry: z2.optional(wire({ selection_priority: z2.optional(z2.number()) }))
389
299
  })
390
300
  )
391
301
  });
392
302
  var localizedContent = () => wire({ locale: text(), display_name: text(), description: text(), terms: text(), terms_revision: text() });
393
- var content = () => wire({ default_locale: text(), supported_locales: list(z4.string()), localized_content: list(localizedContent()) });
303
+ var content = () => wire({ default_locale: text(), supported_locales: list(z2.string()), localized_content: list(localizedContent()) });
394
304
  var offerSchema2 = /* @__PURE__ */ lazy(
395
305
  () => wire({
396
306
  campaign_id: text(),
@@ -398,33 +308,33 @@ var offerSchema2 = /* @__PURE__ */ lazy(
398
308
  publication_id: text(),
399
309
  product_scope: protoEnum("PRODUCT_SCOPE_"),
400
310
  timezone: text(),
401
- enrollment_window: z4.optional(timeWindow()),
402
- qualification_window: z4.optional(timeWindow()),
403
- claim_window: z4.optional(timeWindow()),
404
- entry_policy: z4.optional(policy("ENTRY_POLICY_CODE_")),
405
- reward_claim_policy: z4.optional(policy("REWARD_CLAIM_POLICY_CODE_")),
406
- qualification: z4.optional(qualification()),
407
- reward: z4.optional(reward()),
408
- publication_starts_at: z4.optional(z4.string()),
409
- publication_ends_at: z4.optional(z4.string()),
410
- content: z4.optional(content())
311
+ enrollment_window: z2.optional(timeWindow()),
312
+ qualification_window: z2.optional(timeWindow()),
313
+ claim_window: z2.optional(timeWindow()),
314
+ entry_policy: z2.optional(policy("ENTRY_POLICY_CODE_")),
315
+ reward_claim_policy: z2.optional(policy("REWARD_CLAIM_POLICY_CODE_")),
316
+ qualification: z2.optional(qualification()),
317
+ reward: z2.optional(reward()),
318
+ publication_starts_at: z2.optional(z2.string()),
319
+ publication_ends_at: z2.optional(z2.string()),
320
+ content: z2.optional(content())
411
321
  })
412
322
  );
413
323
  function grantMoney(value, currency) {
414
324
  return { amount: value?.amount ?? 0, currency: value?.currency || currency };
415
325
  }
416
- var rewardGrant = () => z4.pipe(
326
+ var rewardGrant = () => z2.pipe(
417
327
  wire({
418
328
  state: protoEnum("CAMPAIGN_PLAYER_REWARD_GRANT_STATE_"),
419
- granted: z4.optional(money()),
420
- balance: z4.optional(money()),
421
- converted: z4.optional(money()),
422
- expires_at: z4.optional(z4.string()),
423
- wagering: z4.optional(
424
- wire({ required: z4.optional(money()), accumulated: z4.optional(money()), completed_at: z4.optional(z4.string()) })
329
+ granted: z2.optional(money()),
330
+ balance: z2.optional(money()),
331
+ converted: z2.optional(money()),
332
+ expires_at: z2.optional(z2.string()),
333
+ wagering: z2.optional(
334
+ wire({ required: z2.optional(money()), accumulated: z2.optional(money()), completed_at: z2.optional(z2.string()) })
425
335
  )
426
336
  }),
427
- z4.transform(({ state, granted, balance, converted, expiresAt, wagering }) => {
337
+ z2.transform(({ state, granted, balance, converted, expiresAt, wagering }) => {
428
338
  const currency = [granted, balance, converted, wagering?.required, wagering?.accumulated].find((m) => m?.currency)?.currency ?? "";
429
339
  const out = {
430
340
  state,
@@ -444,40 +354,40 @@ var rewardGrant = () => z4.pipe(
444
354
  })
445
355
  );
446
356
  var participationSchema = /* @__PURE__ */ lazy(
447
- () => z4.pipe(
357
+ () => z2.pipe(
448
358
  wire({
449
359
  id: text(),
450
360
  campaign_id: text(),
451
361
  campaign_version_id: text(),
452
362
  reward_key: text(),
453
- qualification_snapshot: z4.optional(qualification()),
363
+ qualification_snapshot: z2.optional(qualification()),
454
364
  // oneof `state`: only one of the cases is filled in.
455
- enrolled: z4.optional(empty()),
456
- qualifying: z4.optional(empty()),
457
- qualified: z4.optional(wire({ qualified_at: z4.optional(z4.string()) })),
458
- reward_pending: z4.optional(empty()),
459
- completed: z4.optional(wire({ completed_at: z4.optional(z4.string()) })),
460
- reward_failed: z4.optional(empty()),
461
- expired: z4.optional(wire({ expired_at: z4.optional(z4.string()) })),
462
- cancelled: z4.optional(empty()),
463
- reward_grant: z4.optional(rewardGrant()),
464
- snapshot: z4.optional(
365
+ enrolled: z2.optional(empty()),
366
+ qualifying: z2.optional(empty()),
367
+ qualified: z2.optional(wire({ qualified_at: z2.optional(z2.string()) })),
368
+ reward_pending: z2.optional(empty()),
369
+ completed: z2.optional(wire({ completed_at: z2.optional(z2.string()) })),
370
+ reward_failed: z2.optional(empty()),
371
+ expired: z2.optional(wire({ expired_at: z2.optional(z2.string()) })),
372
+ cancelled: z2.optional(empty()),
373
+ reward_grant: z2.optional(rewardGrant()),
374
+ snapshot: z2.optional(
465
375
  wire({
466
- reward: z4.optional(reward()),
467
- content: z4.optional(content()),
468
- terms_acceptance: z4.optional(
376
+ reward: z2.optional(reward()),
377
+ content: z2.optional(content()),
378
+ terms_acceptance: z2.optional(
469
379
  wire({
470
380
  locale: text(),
471
381
  terms_revision: text(),
472
382
  terms_digest_sha256_hex: text(),
473
- accepted_at: z4.optional(z4.string())
383
+ accepted_at: z2.optional(z2.string())
474
384
  })
475
385
  )
476
386
  })
477
387
  )
478
388
  }),
479
389
  // The oneof becomes `status` (+ the timestamp of the case); the oneof's keys are not passed on.
480
- z4.transform(
390
+ z2.transform(
481
391
  ({ enrolled, qualifying, qualified, rewardPending, completed, rewardFailed, expired, cancelled, ...rest }) => {
482
392
  const out = { ...rest, status: "unspecified" };
483
393
  if (enrolled) out.status = "enrolled";
@@ -499,7 +409,7 @@ var participationSchema = /* @__PURE__ */ lazy(
499
409
  )
500
410
  )
501
411
  );
502
- var cursorPageSchema = (key, item) => wire({ [key]: list(item), next_cursor: z4.optional(z4.string()) });
412
+ var cursorPageSchema = (key, item) => wire({ [key]: list(item), next_cursor: z2.optional(z2.string()) });
503
413
  var offersPage = /* @__PURE__ */ lazy(() => cursorPageSchema("offers", offerSchema2()));
504
414
  var participationsPage = /* @__PURE__ */ lazy(() => cursorPageSchema("participations", participationSchema()));
505
415
  var offerEnvelope = /* @__PURE__ */ lazy(() => wire({ offer: offerSchema2() }));
@@ -508,68 +418,69 @@ var promoCodeOfferSchema = /* @__PURE__ */ lazy(
508
418
  () => wire({ offer: offerSchema2(), localized_content: localizedContent() })
509
419
  );
510
420
  function toCursorPage(key, data) {
511
- const page = { items: data[key] };
421
+ const items = data[key];
422
+ const page = { items: Array.isArray(items) ? items : [] };
512
423
  if (data.nextCursor) page.nextCursor = data.nextCursor;
513
424
  return page;
514
425
  }
515
- var nullableDate = () => z4.pipe(
516
- z4.nullish(z4.string()),
517
- z4.transform((value) => value ?? void 0)
426
+ var nullableDate = () => z2.pipe(
427
+ z2.nullish(z2.string()),
428
+ z2.transform((value) => value ?? void 0)
518
429
  );
519
430
  function compact(value) {
520
431
  return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0));
521
432
  }
522
433
  var overviewSchema = /* @__PURE__ */ lazy(
523
- () => z4.pipe(
434
+ () => z2.pipe(
524
435
  wire({
525
436
  currencies: list(
526
- z4.pipe(
437
+ z2.pipe(
527
438
  wire({
528
439
  currency: currencyOrEmpty(),
529
- decimal_places: z4.number(),
440
+ decimal_places: z2.number(),
530
441
  restricted_total: minorUnits(),
531
442
  expiring_7d: minorUnits(),
532
- open_positions: z4.number(),
443
+ open_positions: z2.number(),
533
444
  next_expires_at: nullableDate(),
534
445
  converted: minorUnits(),
535
- converted_campaigns: z4.number()
446
+ converted_campaigns: z2.number()
536
447
  }),
537
- z4.transform(compact)
448
+ z2.transform(compact)
538
449
  )
539
450
  ),
540
451
  as_of: nullableDate()
541
452
  }),
542
- z4.transform(compact)
453
+ z2.transform(compact)
543
454
  )
544
455
  );
545
456
  var positionsPage = /* @__PURE__ */ lazy(
546
457
  () => wire({
547
458
  rows: list(
548
- z4.pipe(
459
+ z2.pipe(
549
460
  wire({
550
- position_id: z4.string(),
551
- campaign_id: z4.string(),
461
+ position_id: z2.string(),
462
+ campaign_id: z2.string(),
552
463
  currency: currencyOrEmpty(),
553
- decimal_places: z4.number(),
464
+ decimal_places: z2.number(),
554
465
  granted: minorUnits(),
555
466
  restricted: minorUnits(),
556
467
  converted: minorUnits(),
557
468
  required: minorUnits(),
558
469
  wagered: minorUnits(),
559
470
  remaining: minorUnits(),
560
- state: z4.string(),
471
+ state: z2.string(),
561
472
  // The gateway answers `null` for an action it does not know; known ones are uppercase (`CONVERT`).
562
- terminal_action: z4.pipe(
563
- z4.nullish(z4.string()),
564
- z4.transform((value) => value ? value.toLowerCase() : void 0)
473
+ terminal_action: z2.pipe(
474
+ z2.nullish(z2.string()),
475
+ z2.transform((value) => value ? value.toLowerCase() : void 0)
565
476
  ),
566
477
  expires_at: nullableDate(),
567
478
  created_at: nullableDate()
568
479
  }),
569
- z4.transform((row) => compact(row))
480
+ z2.transform((row) => compact(row))
570
481
  )
571
482
  ),
572
- next_cursor: z4.optional(z4.string())
483
+ next_cursor: z2.optional(z2.string())
573
484
  })
574
485
  );
575
486
  var terms = (acceptance) => acceptance && { locale: acceptance.locale, terms_revision: acceptance.termsRevision };
@@ -663,51 +574,51 @@ function createBonusApi(transport) {
663
574
  }
664
575
  var gameSchema = /* @__PURE__ */ lazy(
665
576
  () => wire({
666
- id: z4.string(),
667
- name: z4.string(),
668
- provider: z4.string(),
669
- category: z4.string(),
670
- type: z4.string(),
671
- thumbnail: z4.string(),
672
- is_new: z4.boolean(),
673
- is_popular: z4.boolean(),
674
- is_live: z4.boolean(),
675
- demo_available: z4.boolean(),
676
- rtp: z4.number(),
677
- volatility: z4.string(),
678
- priority: z4.number()
577
+ id: z2.string(),
578
+ name: z2.string(),
579
+ provider: z2.string(),
580
+ category: z2.string(),
581
+ type: z2.string(),
582
+ thumbnail: z2.string(),
583
+ is_new: z2.boolean(),
584
+ is_popular: z2.boolean(),
585
+ is_live: z2.boolean(),
586
+ demo_available: z2.boolean(),
587
+ rtp: z2.number(),
588
+ volatility: z2.string(),
589
+ priority: z2.number()
679
590
  })
680
591
  );
681
592
  var categoriesSchema = /* @__PURE__ */ lazy(
682
- () => z4.array(
683
- wire({ slug: z4.string(), name: z4.string(), icon: z4.string(), game_count: z4.number(), priority: z4.number() })
593
+ () => nullableList(
594
+ wire({ slug: z2.string(), name: z2.string(), icon: z2.string(), game_count: z2.number(), priority: z2.number() })
684
595
  )
685
596
  );
686
597
  var providersSchema = /* @__PURE__ */ lazy(
687
- () => z4.array(wire({ id: z4.string(), name: z4.string(), game_count: z4.number() }))
598
+ () => nullableList(wire({ id: z2.string(), name: z2.string(), game_count: z2.number() }))
688
599
  );
689
600
  var launchSchema = /* @__PURE__ */ lazy(
690
- () => z4.pipe(
601
+ () => z2.pipe(
691
602
  wire({
692
- session_id: z4.string().check(z4.minLength(1)),
693
- game_url: z4.string().check(z4.minLength(1)),
603
+ session_id: z2.string().check(z2.minLength(1)),
604
+ game_url: z2.string().check(z2.minLength(1)),
694
605
  // Any text: a target the SDK does not know yet must not fail the (strict) launch.
695
- launch_target: z4.optional(z4.string()),
696
- provider_code: z4.optional(z4.string()),
697
- expires_at: z4.optional(z4.string())
606
+ launch_target: z2.optional(z2.string()),
607
+ provider_code: z2.optional(z2.string()),
608
+ expires_at: z2.optional(z2.string())
698
609
  }),
699
610
  // Without a target (an older gateway, or a custom mock), the launch keeps the behavior the SDK documented
700
611
  // before the field existed: an iframe.
701
- z4.transform(({ launchTarget, ...rest }) => ({ ...rest, launchTarget: launchTarget || "iframe" }))
612
+ z2.transform(({ launchTarget, ...rest }) => ({ ...rest, launchTarget: launchTarget || "iframe" }))
702
613
  )
703
614
  );
704
615
  var sessionSchema = /* @__PURE__ */ lazy(
705
616
  () => wire({
706
- id: z4.string(),
707
- game_id: z4.string(),
708
- game_name: z4.string(),
709
- provider: z4.string(),
710
- start_time: z4.string(),
617
+ id: z2.string(),
618
+ game_id: z2.string(),
619
+ game_name: z2.string(),
620
+ provider: z2.string(),
621
+ start_time: z2.string(),
711
622
  total_bet: money$1(),
712
623
  total_win: money$1(),
713
624
  status: protoEnum("SESSION_STATUS_")
@@ -715,63 +626,63 @@ var sessionSchema = /* @__PURE__ */ lazy(
715
626
  );
716
627
  var transactionSchema = /* @__PURE__ */ lazy(
717
628
  () => wire({
718
- id: z4.string(),
719
- game_id: z4.string(),
720
- game_name: z4.string(),
721
- round_id: z4.string(),
629
+ id: z2.string(),
630
+ game_id: z2.string(),
631
+ game_name: z2.string(),
632
+ round_id: z2.string(),
722
633
  type: protoEnum("CASINO_TRANSACTION_TYPE_"),
723
634
  amount: minorUnits(),
724
635
  currency: currencyCode(),
725
636
  currency_decimal_places: decimalPlaces(),
726
- created_at: z4.string()
637
+ created_at: z2.string()
727
638
  })
728
639
  );
729
640
  var winnersSchema = /* @__PURE__ */ lazy(
730
- () => z4.array(
641
+ () => nullableList(
731
642
  wire({
732
- player: z4.string(),
643
+ player: z2.string(),
733
644
  amount: minorUnits(),
734
645
  currency: currencyCode(),
735
646
  currency_decimal_places: decimalPlaces(),
736
- game_id: z4.string(),
737
- game_name: z4.string(),
738
- won_at: z4.string()
647
+ game_id: z2.string(),
648
+ game_name: z2.string(),
649
+ won_at: z2.string()
739
650
  })
740
651
  )
741
652
  );
742
653
  var gamesEnvelopeSchema = /* @__PURE__ */ lazy(
743
654
  () => wire({
744
- availability: z4.pipe(
745
- z4.nullish(
655
+ availability: z2.pipe(
656
+ z2.nullish(
746
657
  wire({
747
658
  // The gateway reports an unset status as `available`; the SDK does the same for an absent/empty one.
748
- status: z4.pipe(
749
- z4.nullish(z4.string()),
750
- z4.transform((value) => value ? value.toLowerCase() : "available")
659
+ status: z2.pipe(
660
+ z2.nullish(z2.string()),
661
+ z2.transform((value) => value ? value.toLowerCase() : "available")
751
662
  ),
752
663
  primary_provider_code: optionalText(),
753
- missing: nullableList(z4.string())
664
+ missing: nullableList(z2.string())
754
665
  })
755
666
  ),
756
- z4.transform((value) => value ?? null)
667
+ z2.transform((value) => value ?? null)
757
668
  )
758
669
  })
759
670
  );
760
671
  var CURRENCY = /^[A-Z]{3}$/;
761
672
  var DECIMAL_PLACES_MAX = 20;
762
673
  var jackpotSchema = /* @__PURE__ */ lazy(
763
- () => z4.pipe(
764
- z4.object({
765
- id: z4.string().check(z4.refine((value) => value.trim() !== "")),
766
- name: z4.string().check(z4.refine((value) => value.trim() !== "")),
767
- currency: z4.string().check(z4.regex(CURRENCY)),
768
- amount_minor: z4.union([
769
- z4.string().check(z4.refine((value) => /^(0|[1-9]\d*)$/.test(value) && Number.isSafeInteger(Number(value)))),
770
- z4.number().check(z4.refine((value) => Number.isSafeInteger(value) && value >= 0))
674
+ () => z2.pipe(
675
+ z2.object({
676
+ id: z2.string().check(z2.refine((value) => value.trim() !== "")),
677
+ name: z2.string().check(z2.refine((value) => value.trim() !== "")),
678
+ currency: z2.string().check(z2.regex(CURRENCY)),
679
+ amount_minor: z2.union([
680
+ z2.string().check(z2.refine((value) => /^(0|[1-9]\d*)$/.test(value) && Number.isSafeInteger(Number(value)))),
681
+ z2.number().check(z2.refine((value) => Number.isSafeInteger(value) && value >= 0))
771
682
  ]),
772
- decimal_places: z4.number().check(z4.refine((value) => Number.isInteger(value) && value >= 0 && value <= DECIMAL_PLACES_MAX))
683
+ decimal_places: z2.number().check(z2.refine((value) => Number.isInteger(value) && value >= 0 && value <= DECIMAL_PLACES_MAX))
773
684
  }),
774
- z4.transform((raw) => ({
685
+ z2.transform((raw) => ({
775
686
  id: raw.id,
776
687
  name: raw.name,
777
688
  currency: raw.currency,
@@ -781,24 +692,24 @@ var jackpotSchema = /* @__PURE__ */ lazy(
781
692
  )
782
693
  );
783
694
  var jackpotsSchema = /* @__PURE__ */ lazy(
784
- () => wire({ items: nullableList(z4.unknown()), featured_id: optionalText() })
695
+ () => wire({ items: nullableList(z2.unknown()), featured_id: optionalText() })
785
696
  );
786
697
  var jackpotGamesSchema = /* @__PURE__ */ lazy(
787
- () => z4.pipe(
698
+ () => z2.pipe(
788
699
  wire({
789
700
  games: nullableList(gameSchema()),
790
- mode: z4.pipe(
791
- z4.string(),
792
- z4.transform((value) => value.toLowerCase())
701
+ mode: z2.pipe(
702
+ z2.string(),
703
+ z2.transform((value) => value.toLowerCase())
793
704
  ),
794
705
  pagination: wire({
795
- page: z4.number(),
796
- per_page: z4.number(),
797
- has_next: z4.boolean(),
706
+ page: z2.number(),
707
+ per_page: z2.number(),
708
+ has_next: z2.boolean(),
798
709
  next_cursor: optionalText()
799
710
  })
800
711
  }),
801
- z4.transform(({ games, mode, pagination }) => ({
712
+ z2.transform(({ games, mode, pagination }) => ({
802
713
  items: games,
803
714
  mode,
804
715
  page: pagination.page,
@@ -930,7 +841,7 @@ function createCasinoApi(transport) {
930
841
  });
931
842
  const items = [];
932
843
  for (const entry of Array.isArray(raw.items) ? raw.items : []) {
933
- const parsed = z4.safeParse(jackpotSchema(), entry);
844
+ const parsed = z2.safeParse(jackpotSchema(), entry);
934
845
  if (!parsed.success || parsed.data.currency !== currency) continue;
935
846
  if (items.some((item) => item.id === parsed.data.id)) continue;
936
847
  items.push(parsed.data);
@@ -964,9 +875,9 @@ var ParsedBenefits = class {
964
875
  }
965
876
  value;
966
877
  };
967
- var tierBenefits = () => z4.pipe(
968
- z4.nullish(z4.string()),
969
- z4.transform((text2, ctx) => {
878
+ var tierBenefits = () => z2.pipe(
879
+ z2.nullish(z2.string()),
880
+ z2.transform((text2, ctx) => {
970
881
  if (text2 == null || text2.trim() === "") return null;
971
882
  let parsed;
972
883
  try {
@@ -980,43 +891,43 @@ var tierBenefits = () => z4.pipe(
980
891
  message: "tier_benefits_json is not a JSON object or array",
981
892
  input: void 0
982
893
  });
983
- return z4.NEVER;
894
+ return z2.NEVER;
984
895
  })
985
896
  );
986
897
  var loyaltySchema = /* @__PURE__ */ lazy(
987
- () => z4.pipe(
898
+ () => z2.pipe(
988
899
  wire({
989
900
  total_points_earned: integerText(),
990
901
  current_points: integerText(),
991
902
  points_redeemed: integerText(),
992
903
  current_tier: optionalText(),
993
904
  tier_points: integerText(),
994
- lifetime_wagered: z4._default(minorUnits(), 0),
995
- lifetime_deposited: z4._default(minorUnits(), 0),
905
+ lifetime_wagered: z2._default(minorUnits(), 0),
906
+ lifetime_deposited: z2._default(minorUnits(), 0),
996
907
  tier_benefits_json: tierBenefits(),
997
908
  tier_expires_at: optionalTimestamp()
998
909
  }),
999
- z4.transform(({ tierBenefitsJson, ...rest }) => {
910
+ z2.transform(({ tierBenefitsJson, ...rest }) => {
1000
911
  const benefits = tierBenefitsJson instanceof ParsedBenefits ? tierBenefitsJson.value : null;
1001
912
  return { ...rest, tierBenefits: benefits };
1002
913
  })
1003
914
  )
1004
915
  );
1005
916
  var redeemSchema = /* @__PURE__ */ lazy(
1006
- () => z4.pipe(
917
+ () => z2.pipe(
1007
918
  wire({
1008
- success: z4.optional(z4.boolean()),
1009
- message: z4.optional(z4.string()),
919
+ success: z2.optional(z2.boolean()),
920
+ message: z2.optional(z2.string()),
1010
921
  redeemed_points: integerText(),
1011
- value: z4.nullish(minorUnits()),
922
+ value: z2.nullish(minorUnits()),
1012
923
  // Currency strict even in `'warn'`; absent, `null` and `''` still become `null`.
1013
- currency: z4.pipe(
1014
- z4.nullish(currencyOrEmpty()),
1015
- z4.transform((value) => value == null || value === "" ? null : value)
924
+ currency: z2.pipe(
925
+ z2.nullish(currencyOrEmpty()),
926
+ z2.transform((value) => value == null || value === "" ? null : value)
1016
927
  ),
1017
928
  bonus_id: optionalText()
1018
929
  }),
1019
- z4.transform((data) => ({
930
+ z2.transform((data) => ({
1020
931
  success: data.success,
1021
932
  message: data.message,
1022
933
  redeemedPoints: data.redeemedPoints,
@@ -1060,12 +971,12 @@ function createLoyaltyApi(transport) {
1060
971
  };
1061
972
  }
1062
973
  function openUnion(values) {
1063
- return z4.pipe(
1064
- z4.pipe(
1065
- z4.string(),
1066
- z4.transform((value) => value.toLowerCase())
974
+ return z2.pipe(
975
+ z2.pipe(
976
+ z2.string(),
977
+ z2.transform((value) => value.toLowerCase())
1067
978
  ),
1068
- z4.enum(values)
979
+ z2.enum(values)
1069
980
  );
1070
981
  }
1071
982
 
@@ -1076,14 +987,14 @@ var REWARD_TYPES = ["bonus", "free_spins", "points", "free_bet"];
1076
987
  var USER_MISSION_STATUSES = ["in_progress", "completed", "expired", "claimed"];
1077
988
  var missionSchema = /* @__PURE__ */ lazy(
1078
989
  () => wire({
1079
- id: z4.string(),
1080
- name: z4.string(),
1081
- description: z4._default(z4.string(), ""),
990
+ id: z2.string(),
991
+ name: z2.string(),
992
+ description: z2._default(z2.string(), ""),
1082
993
  mission_type: openUnion(MISSION_TYPES),
1083
994
  objective_type: openUnion(OBJECTIVE_TYPES),
1084
995
  target_value: integerText(),
1085
996
  target_game_category: optionalText(),
1086
- target_games: nullableList(z4.string()),
997
+ target_games: nullableList(z2.string()),
1087
998
  reward_type: openUnion(REWARD_TYPES),
1088
999
  reward_value: minorUnits(),
1089
1000
  valid_from: optionalTimestamp(),
@@ -1091,16 +1002,16 @@ var missionSchema = /* @__PURE__ */ lazy(
1091
1002
  })
1092
1003
  );
1093
1004
  var userMissionsSchema = /* @__PURE__ */ lazy(
1094
- () => z4.pipe(
1005
+ () => z2.pipe(
1095
1006
  wire({
1096
1007
  missions: nullableList(
1097
1008
  wire({
1098
- id: z4.string(),
1099
- mission_id: z4.string(),
1100
- mission_name: z4._default(z4.string(), ""),
1009
+ id: z2.string(),
1010
+ mission_id: z2.string(),
1011
+ mission_name: z2._default(z2.string(), ""),
1101
1012
  current_progress: integerText(),
1102
1013
  target_value: integerText(),
1103
- progress_percentage: z4.number(),
1014
+ progress_percentage: z2.number(),
1104
1015
  status: openUnion(USER_MISSION_STATUSES),
1105
1016
  reward_type: openUnion(REWARD_TYPES),
1106
1017
  reward_value: minorUnits(),
@@ -1109,7 +1020,7 @@ var userMissionsSchema = /* @__PURE__ */ lazy(
1109
1020
  })
1110
1021
  )
1111
1022
  }),
1112
- z4.transform((data) => data.missions)
1023
+ z2.transform((data) => data.missions)
1113
1024
  )
1114
1025
  );
1115
1026
  function createMissionsApi(transport) {
@@ -1139,25 +1050,25 @@ function createMissionsApi(transport) {
1139
1050
  }
1140
1051
  var DEFAULT_PER_PAGE = 20;
1141
1052
  var HISTORY_PATH = "/referrals/history";
1142
- var count2 = () => z4._default(z4.number().check(z4.refine((value) => Number.isSafeInteger(value) && value >= 0, "invalid counter")), 0);
1143
- var money3 = () => z4.pipe(
1144
- z4.nullish(wire({ minor_units: minorUnits(), currency: z4._default(currencyOrEmpty(), "") })),
1145
- z4.transform(
1053
+ var count2 = () => z2._default(z2.number().check(z2.refine((value) => Number.isSafeInteger(value) && value >= 0, "invalid counter")), 0);
1054
+ var money3 = () => z2.pipe(
1055
+ z2.nullish(wire({ minor_units: minorUnits(), currency: z2._default(currencyOrEmpty(), "") })),
1056
+ z2.transform(
1146
1057
  (value) => value == null ? null : { amount: value.minorUnits, currency: value.currency }
1147
1058
  )
1148
1059
  );
1149
- var rulesSchema = () => z4.pipe(
1150
- z4.nullish(
1060
+ var rulesSchema = () => z2.pipe(
1061
+ z2.nullish(
1151
1062
  wire({
1152
1063
  reward: money3(),
1153
1064
  minimum_real_net_loss: money3(),
1154
1065
  referee_window_days: count2(),
1155
1066
  hold_hours: count2(),
1156
- wagering_multiplier: z4._default(z4.string(), ""),
1067
+ wagering_multiplier: z2._default(z2.string(), ""),
1157
1068
  maximum_conversion: money3()
1158
1069
  })
1159
1070
  ),
1160
- z4.transform((rules) => {
1071
+ z2.transform((rules) => {
1161
1072
  if (rules == null || rules.reward === null || rules.minimumRealNetLoss === null) return null;
1162
1073
  return {
1163
1074
  reward: rules.reward,
@@ -1170,12 +1081,12 @@ var rulesSchema = () => z4.pipe(
1170
1081
  })
1171
1082
  );
1172
1083
  var infoSchema = /* @__PURE__ */ lazy(
1173
- () => z4.pipe(
1084
+ () => z2.pipe(
1174
1085
  wire({
1175
- enabled: z4._default(z4.boolean(), false),
1086
+ enabled: z2._default(z2.boolean(), false),
1176
1087
  referral_code: optionalText(),
1177
1088
  rules: rulesSchema(),
1178
- totals: z4._default(
1089
+ totals: z2._default(
1179
1090
  wire({
1180
1091
  registered: count2(),
1181
1092
  deposited: count2(),
@@ -1188,7 +1099,7 @@ var infoSchema = /* @__PURE__ */ lazy(
1188
1099
  { registered: 0, deposited: 0, inHold: 0, paid: 0, notEligible: 0, expired: 0, cancelled: 0 }
1189
1100
  )
1190
1101
  }),
1191
- z4.transform(
1102
+ z2.transform(
1192
1103
  ({ enabled, referralCode, rules, totals }) => ({ enabled, code: referralCode, rules, totals })
1193
1104
  )
1194
1105
  )
@@ -1197,16 +1108,16 @@ function remainingOf(target, loss) {
1197
1108
  const missing = BigInt(target.amount) - BigInt(loss.amount);
1198
1109
  return { amount: missing > 0n ? Number(missing) : 0, currency: target.currency };
1199
1110
  }
1200
- var progressSchema = () => z4.pipe(
1201
- z4.nullish(
1111
+ var progressSchema = () => z2.pipe(
1112
+ z2.nullish(
1202
1113
  wire({
1203
- deposit_done: z4._default(z4.boolean(), false),
1114
+ deposit_done: z2._default(z2.boolean(), false),
1204
1115
  real_net_loss: money3(),
1205
1116
  target: money3(),
1206
1117
  remaining: money3()
1207
1118
  })
1208
1119
  ),
1209
- z4.transform((progress) => {
1120
+ z2.transform((progress) => {
1210
1121
  if (progress == null || progress.target === null) return null;
1211
1122
  const { target } = progress;
1212
1123
  const realNetLoss = progress.realNetLoss ?? { amount: 0, currency: target.currency };
@@ -1223,9 +1134,9 @@ function statusOf(playerStatus, legacy) {
1223
1134
  if (playerStatus !== null) return playerStatus.replace(/^CAMPAIGN_REFERRAL_STATUS_/, "").toLowerCase();
1224
1135
  return LEGACY_STATUS[(legacy ?? "").toUpperCase()] ?? "registered";
1225
1136
  }
1226
- var referralSchema = () => z4.pipe(
1137
+ var referralSchema = () => z2.pipe(
1227
1138
  wire({
1228
- id: z4.string(),
1139
+ id: z2.string(),
1229
1140
  referee_name: optionalText(),
1230
1141
  status: optionalText(),
1231
1142
  player_status: optionalText(),
@@ -1233,7 +1144,7 @@ var referralSchema = () => z4.pipe(
1233
1144
  deadline_at: optionalTimestamp(),
1234
1145
  progress: progressSchema()
1235
1146
  }),
1236
- z4.transform(
1147
+ z2.transform(
1237
1148
  (r) => ({
1238
1149
  id: r.id,
1239
1150
  refereeName: r.refereeName,
@@ -1248,7 +1159,11 @@ var historySchema = /* @__PURE__ */ lazy(
1248
1159
  () => wire({
1249
1160
  referral_code: optionalText(),
1250
1161
  referrals: nullableList(referralSchema()),
1251
- pagination: z4.optional(wire({ page: count2(), limit: count2(), total_items: count2() }))
1162
+ // A nil pointer (`null`) reads as absent, like an omitted pagination.
1163
+ pagination: z2.pipe(
1164
+ z2.nullish(wire({ page: count2(), limit: count2(), total_items: count2() })),
1165
+ z2.transform((value) => value ?? void 0)
1166
+ )
1252
1167
  })
1253
1168
  );
1254
1169
  var positiveInt = (value, fallback) => typeof value === "number" && Number.isSafeInteger(value) && value >= 1 ? value : fallback;
@@ -1288,12 +1203,12 @@ function createReferralsApi(transport) {
1288
1203
  }
1289
1204
  var HTTP_URL = "Expected an absolute http(s) URL";
1290
1205
  var sessionSchema2 = /* @__PURE__ */ lazy(
1291
- () => z4.pipe(
1206
+ () => z2.pipe(
1292
1207
  wire({
1293
1208
  // The separate token only exists on the wire: the schema declares it (strict contract) and the output drops it.
1294
- operator_token: z4.string(),
1295
- launch_url: z4.string().check(
1296
- z4.refine(
1209
+ operator_token: z2.string(),
1210
+ launch_url: z2.string().check(
1211
+ z2.refine(
1297
1212
  (value) => {
1298
1213
  try {
1299
1214
  const { protocol } = new URL(value);
@@ -1305,10 +1220,10 @@ var sessionSchema2 = /* @__PURE__ */ lazy(
1305
1220
  { message: HTTP_URL }
1306
1221
  )
1307
1222
  ),
1308
- expires_in_seconds: z4.number().check(z4.refine((n) => Number.isFinite(n) && n > 0, { message: "Esperava > 0" }))
1223
+ expires_in_seconds: z2.number().check(z2.refine((n) => Number.isFinite(n) && n > 0, { message: "Esperava > 0" }))
1309
1224
  }),
1310
1225
  // The clock is read when the response is interpreted (= moment of the response).
1311
- z4.transform(({ launchUrl, expiresInSeconds }) => ({
1226
+ z2.transform(({ launchUrl, expiresInSeconds }) => ({
1312
1227
  launchUrl,
1313
1228
  expiresInSeconds,
1314
1229
  expiresAt: Date.now() + expiresInSeconds * 1e3
@@ -1335,6 +1250,7 @@ function createIgaming(client) {
1335
1250
  const transport = extension.getExtensionTransport(client);
1336
1251
  const igaming = {
1337
1252
  casino: createCasinoApi(transport),
1253
+ club: createClubApi(transport),
1338
1254
  bonus: createBonusApi(transport),
1339
1255
  missions: createMissionsApi(transport),
1340
1256
  loyalty: createLoyaltyApi(transport),
@@ -1350,6 +1266,9 @@ function createIgaming(client) {
1350
1266
  });
1351
1267
  }
1352
1268
  extension.registerProductClient(igaming, client);
1269
+ Object.defineProperty(igaming, LOCALE, {
1270
+ value: () => typeof transport.getLocale === "function" ? transport.getLocale() : void 0
1271
+ });
1353
1272
  return igaming;
1354
1273
  }
1355
1274