@getenginex/sdk-igaming 0.6.0 → 0.8.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 +32 -0
- package/dist/index.cjs +214 -156
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +274 -102
- package/dist/index.d.ts +274 -102
- package/dist/index.js +215 -157
- package/dist/index.js.map +1 -1
- package/dist/query/index.cjs +1 -2
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +5 -7
- package/dist/query/index.d.ts +5 -7
- package/dist/query/index.js +1 -2
- package/dist/query/index.js.map +1 -1
- package/dist/testing/index.cjs +91 -66
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +3 -4
- package/dist/testing/index.d.ts +3 -4
- package/dist/testing/index.js +92 -67
- package/dist/testing/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CursorPageInput, CallOptions, CursorPage,
|
|
1
|
+
import { CursorPageInput, CallOptions, CursorPage, NoParams, Page, EnginexClient } from '@getenginex/sdk';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Money value of a campaign, in minor units of the currency (e.g. cents). The decimal places
|
|
@@ -577,6 +577,44 @@ interface CampaignTermsAcceptanceRecord {
|
|
|
577
577
|
/** Acceptance date, ISO 8601 (UTC). */
|
|
578
578
|
acceptedAt?: string;
|
|
579
579
|
}
|
|
580
|
+
/**
|
|
581
|
+
* Where the bonus balance granted by a participation stands: `active` (still to wager or to use),
|
|
582
|
+
* `converted` (became real balance), `expired` or `forfeited` (e.g. lost to a withdrawal). A new value the SDK
|
|
583
|
+
* does not know yet may arrive: handle the default case.
|
|
584
|
+
* @category Bonus
|
|
585
|
+
*/
|
|
586
|
+
type CampaignRewardGrantState = 'active' | 'converted' | 'expired' | 'forfeited' | 'unspecified' | (string & {});
|
|
587
|
+
/**
|
|
588
|
+
* Rollover progress of a granted bonus.
|
|
589
|
+
* @category Bonus
|
|
590
|
+
*/
|
|
591
|
+
interface CampaignWageringProgress {
|
|
592
|
+
/** Amount to wager. */
|
|
593
|
+
required: CampaignMoney;
|
|
594
|
+
/** Amount already wagered. */
|
|
595
|
+
accumulated: CampaignMoney;
|
|
596
|
+
/** When the rollover was completed, ISO 8601 (UTC). */
|
|
597
|
+
completedAt?: string;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* The bonus balance a participation granted. protojson leaves zeros out: a missing amount comes as `0` in the
|
|
601
|
+
* currency of the grant's other amounts (or `''` when none has one).
|
|
602
|
+
* @category Bonus
|
|
603
|
+
*/
|
|
604
|
+
interface CampaignRewardGrant {
|
|
605
|
+
/** Where the balance stands. An `active` grant keeps the bonus among the player's active ones even after the participation completed. */
|
|
606
|
+
state: CampaignRewardGrantState;
|
|
607
|
+
/** Amount granted. */
|
|
608
|
+
granted: CampaignMoney;
|
|
609
|
+
/** Bonus balance left. */
|
|
610
|
+
balance: CampaignMoney;
|
|
611
|
+
/** Amount converted to real balance. */
|
|
612
|
+
converted: CampaignMoney;
|
|
613
|
+
/** When the bonus balance expires, ISO 8601 (UTC). */
|
|
614
|
+
expiresAt?: string;
|
|
615
|
+
/** Rollover progress, when the bonus has a wagering requirement. */
|
|
616
|
+
wagering?: CampaignWageringProgress;
|
|
617
|
+
}
|
|
580
618
|
/**
|
|
581
619
|
* The player's participation in a campaign, with the reward and the texts as they were when they joined.
|
|
582
620
|
* @category Bonus
|
|
@@ -609,6 +647,8 @@ interface CampaignParticipation {
|
|
|
609
647
|
/** Terms acceptance, if there was one. */
|
|
610
648
|
termsAcceptance?: CampaignTermsAcceptanceRecord;
|
|
611
649
|
};
|
|
650
|
+
/** The bonus balance granted, once the reward was credited; missing before that. */
|
|
651
|
+
rewardGrant?: CampaignRewardGrant;
|
|
612
652
|
}
|
|
613
653
|
/**
|
|
614
654
|
* Terms acceptance of the campaign, sent on opt-in or on promo code redemption.
|
|
@@ -642,6 +682,95 @@ interface PromoCodeOffer {
|
|
|
642
682
|
/** The texts in the requested language. */
|
|
643
683
|
localizedContent: CampaignLocalizedContent;
|
|
644
684
|
}
|
|
685
|
+
/**
|
|
686
|
+
* The player's restricted bonus balance in one currency (amounts in minor units of `currency`; amounts of
|
|
687
|
+
* different currencies are never added).
|
|
688
|
+
* @category Bonus
|
|
689
|
+
*/
|
|
690
|
+
interface BonusOverviewCurrency {
|
|
691
|
+
/** Currency code, e.g. `BRL`. */
|
|
692
|
+
currency: string;
|
|
693
|
+
/** Decimal places of the currency, to format the amounts. */
|
|
694
|
+
decimalPlaces: number;
|
|
695
|
+
/** Bonus balance in open positions. */
|
|
696
|
+
restrictedTotal: number;
|
|
697
|
+
/** Part of `restrictedTotal` whose position expires in the next 7 days. */
|
|
698
|
+
expiring7d: number;
|
|
699
|
+
/** Open bonus positions. */
|
|
700
|
+
openPositions: number;
|
|
701
|
+
/** Nearest expiry among the open positions, ISO 8601 (UTC). */
|
|
702
|
+
nextExpiresAt?: string;
|
|
703
|
+
/** Bonus balance already converted to real balance. */
|
|
704
|
+
converted: number;
|
|
705
|
+
/** Campaigns with a conversion above zero. */
|
|
706
|
+
convertedCampaigns: number;
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* Result of {@link BonusApi.getOverview}.
|
|
710
|
+
* @category Bonus
|
|
711
|
+
*/
|
|
712
|
+
interface BonusOverview {
|
|
713
|
+
/** One line per currency; empty for a player without bonus history. */
|
|
714
|
+
currencies: BonusOverviewCurrency[];
|
|
715
|
+
/** When the figures were computed, ISO 8601 (UTC). */
|
|
716
|
+
asOf?: string;
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* State of a bonus position: `open` or `terminal`. A new value may arrive.
|
|
720
|
+
* @category Bonus
|
|
721
|
+
*/
|
|
722
|
+
type BonusPositionState = 'open' | 'terminal' | (string & {});
|
|
723
|
+
/**
|
|
724
|
+
* How a terminal position ended, in lowercase: `expire`, `forfeit`, `convert` or `admin_cancel`.
|
|
725
|
+
* @category Bonus
|
|
726
|
+
*/
|
|
727
|
+
type BonusPositionTerminalAction = 'expire' | 'forfeit' | 'convert' | 'admin_cancel' | (string & {});
|
|
728
|
+
/**
|
|
729
|
+
* One bonus position of the player (the restricted balance of one grant) with its rollover progress. Amounts
|
|
730
|
+
* in minor units of `currency`.
|
|
731
|
+
* @category Bonus
|
|
732
|
+
*/
|
|
733
|
+
interface BonusPosition {
|
|
734
|
+
/** Position id. */
|
|
735
|
+
positionId: string;
|
|
736
|
+
/** Campaign id: the name to show comes from the campaign's offer (`localizedContent`). */
|
|
737
|
+
campaignId: string;
|
|
738
|
+
/** Currency code, e.g. `BRL`. */
|
|
739
|
+
currency: string;
|
|
740
|
+
/** Decimal places of the currency. */
|
|
741
|
+
decimalPlaces: number;
|
|
742
|
+
/** Amount granted. */
|
|
743
|
+
granted: number;
|
|
744
|
+
/** Bonus balance left. */
|
|
745
|
+
restricted: number;
|
|
746
|
+
/** Converted to real balance. */
|
|
747
|
+
converted: number;
|
|
748
|
+
/** Amount to wager. */
|
|
749
|
+
required: number;
|
|
750
|
+
/** Already wagered. */
|
|
751
|
+
wagered: number;
|
|
752
|
+
/** Still to wager. */
|
|
753
|
+
remaining: number;
|
|
754
|
+
/** `open` or `terminal`. */
|
|
755
|
+
state: BonusPositionState;
|
|
756
|
+
/** How it ended (terminal positions only). */
|
|
757
|
+
terminalAction?: BonusPositionTerminalAction;
|
|
758
|
+
/** When the bonus balance expires, ISO 8601 (UTC). */
|
|
759
|
+
expiresAt?: string;
|
|
760
|
+
/** When the position was created, ISO 8601 (UTC). */
|
|
761
|
+
createdAt?: string;
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Filters and pagination of {@link BonusApi.listPositions}. On the wire `pageSize` goes as `limit` (1 to 100,
|
|
765
|
+
* gateway default 25).
|
|
766
|
+
* @category Bonus
|
|
767
|
+
*/
|
|
768
|
+
interface ListBonusPositionsInput extends CursorPageInput {
|
|
769
|
+
/** Only open or only terminal positions. Default: all. */
|
|
770
|
+
state?: 'open' | 'terminal';
|
|
771
|
+
/** Currency code. Default: all. */
|
|
772
|
+
currency?: string;
|
|
773
|
+
}
|
|
645
774
|
/**
|
|
646
775
|
* Bonus campaigns and promo codes. Only `listPublicOffers` is public; the other methods require login.
|
|
647
776
|
* @category Bonus
|
|
@@ -764,6 +893,26 @@ interface BonusApi {
|
|
|
764
893
|
getParticipation(input: {
|
|
765
894
|
participationId: string;
|
|
766
895
|
}, options?: CallOptions): Promise<CampaignParticipation>;
|
|
896
|
+
/**
|
|
897
|
+
* The player's restricted bonus balance, one line per currency: total, what expires in 7 days, open
|
|
898
|
+
* positions and what was converted to real balance.
|
|
899
|
+
* @example
|
|
900
|
+
* const { currencies } = await igaming.bonus.getOverview()
|
|
901
|
+
* const brl = currencies.find((c) => c.currency === 'BRL')
|
|
902
|
+
* @throws {EnginexError} `UNAUTHENTICATED` without a session; `VALIDATION_ERROR`, also in `'warn'`, with money
|
|
903
|
+
* outside the format.
|
|
904
|
+
*/
|
|
905
|
+
getOverview(params?: NoParams, options?: CallOptions): Promise<BonusOverview>;
|
|
906
|
+
/**
|
|
907
|
+
* The player's bonus positions with their rollover progress, newest first. Cursor-paginated.
|
|
908
|
+
* @example
|
|
909
|
+
* const { items } = await igaming.bonus.listPositions({ state: 'open' })
|
|
910
|
+
* items.forEach((p) => showProgress(p.wagered, p.required))
|
|
911
|
+
* @throws {EnginexError} `INVALID_ARGUMENT` (400) for a `pageSize` outside 1-100, an unknown `state` or an
|
|
912
|
+
* unsupported currency; `UNAUTHENTICATED` without a session; `VALIDATION_ERROR`, also in `'warn'`, with money
|
|
913
|
+
* outside the format.
|
|
914
|
+
*/
|
|
915
|
+
listPositions(input?: ListBonusPositionsInput, options?: CallOptions): Promise<CursorPage<BonusPosition>>;
|
|
767
916
|
}
|
|
768
917
|
|
|
769
918
|
/**
|
|
@@ -1346,66 +1495,123 @@ interface MissionsApi {
|
|
|
1346
1495
|
}
|
|
1347
1496
|
|
|
1348
1497
|
/**
|
|
1349
|
-
*
|
|
1350
|
-
*
|
|
1351
|
-
*
|
|
1352
|
-
* `
|
|
1498
|
+
* Where a referred player stands, as the referrer sees it, in lowercase (the bonus service's
|
|
1499
|
+
* `CAMPAIGN_REFERRAL_STATUS_*`):
|
|
1500
|
+
* - `registered`: signed up, no deposit yet;
|
|
1501
|
+
* - `deposited`: deposited, real net loss still below the target;
|
|
1502
|
+
* - `in_hold`: qualified, waiting for the hold to end;
|
|
1503
|
+
* - `paid`: the referrer's reward is pending or granted;
|
|
1504
|
+
* - `not_eligible`: closed without reward by a block;
|
|
1505
|
+
* - `expired`: the window ended without qualifying;
|
|
1506
|
+
* - `cancelled`: paid, then cancelled.
|
|
1507
|
+
*
|
|
1508
|
+
* A status the SDK does not know yet arrives as the gateway sent it, in lowercase: handle the default case.
|
|
1509
|
+
* @category Referrals
|
|
1510
|
+
*/
|
|
1511
|
+
type ReferralStatus = 'registered' | 'deposited' | 'in_hold' | 'paid' | 'not_eligible' | 'expired' | 'cancelled' | (string & {});
|
|
1512
|
+
/**
|
|
1513
|
+
* Money of the referral program, in minor units of `currency` (the gateway sends the amount as text; the SDK
|
|
1514
|
+
* converts).
|
|
1515
|
+
* @category Referrals
|
|
1516
|
+
*/
|
|
1517
|
+
interface ReferralMoney {
|
|
1518
|
+
/** Value in minor units of `currency`. */
|
|
1519
|
+
amount: number;
|
|
1520
|
+
/** Currency code, e.g. `BRL`; `''` when the gateway sent none. */
|
|
1521
|
+
currency: string;
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* Rules of the operator's active referral campaign (part of {@link ReferralInfo}).
|
|
1525
|
+
* @category Referrals
|
|
1526
|
+
*/
|
|
1527
|
+
interface ReferralRules {
|
|
1528
|
+
/** The referrer's reward per qualified referral. */
|
|
1529
|
+
reward: ReferralMoney;
|
|
1530
|
+
/** Real net loss the referred player must reach (bets minus wins with real money) to qualify. */
|
|
1531
|
+
minimumRealNetLoss: ReferralMoney;
|
|
1532
|
+
/** Days the referred player has, from the sign-up, to qualify. */
|
|
1533
|
+
refereeWindowDays: number;
|
|
1534
|
+
/** Hours a qualified referral waits before the reward is paid. */
|
|
1535
|
+
holdHours: number;
|
|
1536
|
+
/** Wagering multiplier of the reward, as an exact decimal in text (e.g. `"80"`). */
|
|
1537
|
+
wageringMultiplier: string;
|
|
1538
|
+
/** Most of the reward that can be converted into withdrawable money; `null` without a cap. */
|
|
1539
|
+
maximumConversion: ReferralMoney | null;
|
|
1540
|
+
}
|
|
1541
|
+
/**
|
|
1542
|
+
* How many of the player's referrals are in each status (integers), across all pages.
|
|
1353
1543
|
* @category Referrals
|
|
1354
1544
|
*/
|
|
1355
|
-
|
|
1545
|
+
interface ReferralTotals {
|
|
1546
|
+
/** In `registered`. */
|
|
1547
|
+
registered: number;
|
|
1548
|
+
/** In `deposited`. */
|
|
1549
|
+
deposited: number;
|
|
1550
|
+
/** In `in_hold`. */
|
|
1551
|
+
inHold: number;
|
|
1552
|
+
/** In `paid`. */
|
|
1553
|
+
paid: number;
|
|
1554
|
+
/** In `not_eligible`. */
|
|
1555
|
+
notEligible: number;
|
|
1556
|
+
/** In `expired`. */
|
|
1557
|
+
expired: number;
|
|
1558
|
+
/** In `cancelled`. */
|
|
1559
|
+
cancelled: number;
|
|
1560
|
+
}
|
|
1356
1561
|
/**
|
|
1357
|
-
* The player's referral code,
|
|
1358
|
-
* (integers): the gateway sends them as a float in major units and the SDK converts.
|
|
1562
|
+
* The player's referral code, the active program rules and the totals per status (`GET /referrals`).
|
|
1359
1563
|
* @category Referrals
|
|
1360
1564
|
*/
|
|
1361
1565
|
interface ReferralInfo {
|
|
1362
|
-
/**
|
|
1566
|
+
/**
|
|
1567
|
+
* `false` when the operator has no active referral campaign (and `rules` is `null`). Referrals already made keep
|
|
1568
|
+
* their windows open, so the totals and the history may still have rows.
|
|
1569
|
+
*/
|
|
1570
|
+
enabled: boolean;
|
|
1571
|
+
/** The player's referral code, from the profile; `null` when the gateway sends it empty. */
|
|
1363
1572
|
code: string | null;
|
|
1364
|
-
/**
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
/**
|
|
1380
|
-
|
|
1381
|
-
|
|
1573
|
+
/**
|
|
1574
|
+
* Rules of the active campaign; `null` when there is none, and also when the gateway sends them without the
|
|
1575
|
+
* reward or the minimum real net loss (the program cannot be described without them).
|
|
1576
|
+
*/
|
|
1577
|
+
rules: ReferralRules | null;
|
|
1578
|
+
/** Totals per status. */
|
|
1579
|
+
totals: ReferralTotals;
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* The referred player's progress toward qualifying, in the campaign's currency.
|
|
1583
|
+
* @category Referrals
|
|
1584
|
+
*/
|
|
1585
|
+
interface ReferralProgress {
|
|
1586
|
+
/** Whether the referred player already deposited. */
|
|
1587
|
+
depositDone: boolean;
|
|
1588
|
+
/** Real net loss accumulated so far (`0` when the gateway sends none). */
|
|
1589
|
+
realNetLoss: ReferralMoney;
|
|
1590
|
+
/** Real net loss required to qualify (the campaign's minimum). */
|
|
1591
|
+
target: ReferralMoney;
|
|
1592
|
+
/** `max(0, target - realNetLoss)`; computed by the SDK when the gateway leaves it out. */
|
|
1593
|
+
remaining: ReferralMoney;
|
|
1594
|
+
}
|
|
1595
|
+
/**
|
|
1596
|
+
* A referral of the history (`GET /referrals/history`): one row per referred player.
|
|
1382
1597
|
* @category Referrals
|
|
1383
1598
|
*/
|
|
1384
1599
|
interface Referral {
|
|
1385
1600
|
/** Referral id. */
|
|
1386
1601
|
id: string;
|
|
1387
|
-
/** Referee's name, as the gateway sends it; `null` when empty. It is personal data: do not log it. */
|
|
1388
|
-
refereeName: string | null;
|
|
1389
1602
|
/**
|
|
1390
|
-
*
|
|
1391
|
-
*
|
|
1392
|
-
* `null` when the gateway sends empty or something that is not an email. The raw email is never exposed.
|
|
1603
|
+
* The referred player's name, **already masked by the bonus service** (e.g. `"Ma••• R."`): show it as it is,
|
|
1604
|
+
* never mask it again. `null` when empty.
|
|
1393
1605
|
*/
|
|
1394
|
-
|
|
1395
|
-
/**
|
|
1396
|
-
code: string;
|
|
1397
|
-
/** Status. */
|
|
1606
|
+
refereeName: string | null;
|
|
1607
|
+
/** Where the referred player stands (see {@link ReferralStatus}). */
|
|
1398
1608
|
status: ReferralStatus;
|
|
1399
|
-
/**
|
|
1400
|
-
referrerBonus: number;
|
|
1401
|
-
/** Referee's bonus, in minor units. */
|
|
1402
|
-
refereeBonus: number;
|
|
1403
|
-
/** When the referral was created (ISO 8601, UTC); `null` if the gateway does not send it. */
|
|
1609
|
+
/** Sign-up of the referred player (ISO 8601, UTC); `null` if the gateway does not send it. */
|
|
1404
1610
|
createdAt: string | null;
|
|
1405
|
-
/**
|
|
1406
|
-
|
|
1407
|
-
/**
|
|
1408
|
-
|
|
1611
|
+
/** End of the window to qualify (ISO 8601, UTC); `null` if the gateway does not send it. */
|
|
1612
|
+
deadlineAt: string | null;
|
|
1613
|
+
/** Progress toward qualifying; `null` when the gateway sends no target. */
|
|
1614
|
+
progress: ReferralProgress | null;
|
|
1409
1615
|
}
|
|
1410
1616
|
/**
|
|
1411
1617
|
* Input of {@link ReferralsApi.listHistory}.
|
|
@@ -1414,81 +1620,47 @@ interface Referral {
|
|
|
1414
1620
|
interface ListReferralsInput {
|
|
1415
1621
|
/** Page (starts at 1; integer ≥ 1). Gateway default: 1. */
|
|
1416
1622
|
page?: number;
|
|
1417
|
-
/** Items per page (integer from 1 to 100). Gateway default: 20
|
|
1623
|
+
/** Items per page (integer from 1 to 100). Gateway default: 20. On the wire it goes as `limit`. */
|
|
1418
1624
|
perPage?: number;
|
|
1419
1625
|
}
|
|
1420
1626
|
/**
|
|
1421
|
-
* Page of the referral history, with the
|
|
1627
|
+
* Page of the referral history, with the player's referral code.
|
|
1422
1628
|
* @category Referrals
|
|
1423
1629
|
*/
|
|
1424
1630
|
type ReferralHistory = Page<Referral> & {
|
|
1425
|
-
/**
|
|
1426
|
-
|
|
1427
|
-
/** Total earned from referrals, in minor units (the currency does not come with it). */
|
|
1428
|
-
totalEarned: number;
|
|
1631
|
+
/** The player's referral code; `null` when the gateway sends it empty. */
|
|
1632
|
+
code: string | null;
|
|
1429
1633
|
};
|
|
1430
1634
|
/**
|
|
1431
|
-
*
|
|
1432
|
-
*
|
|
1433
|
-
*/
|
|
1434
|
-
interface RegisterReferralInput {
|
|
1435
|
-
/** Another player's referral code (non-empty text; leading and trailing spaces are removed). */
|
|
1436
|
-
code: string;
|
|
1437
|
-
}
|
|
1438
|
-
/**
|
|
1439
|
-
* Referral registered by {@link ReferralsApi.register}.
|
|
1440
|
-
* @category Referrals
|
|
1441
|
-
*/
|
|
1442
|
-
interface RegisteredReferral {
|
|
1443
|
-
/** Referral id. */
|
|
1444
|
-
id: string;
|
|
1445
|
-
/** Referral code registered. */
|
|
1446
|
-
code: string;
|
|
1447
|
-
/** Initial status (probably `pending`; the contract does not say). */
|
|
1448
|
-
status: ReferralStatus;
|
|
1449
|
-
/** Referee's bonus, in minor units. */
|
|
1450
|
-
refereeBonus: number;
|
|
1451
|
-
/** When it was created (ISO 8601, UTC); `null` if the gateway does not send it. */
|
|
1452
|
-
createdAt: string | null;
|
|
1453
|
-
}
|
|
1454
|
-
/**
|
|
1455
|
-
* The player's referrals. All three methods require login. Whoever is signing up passes the code in the core's
|
|
1456
|
-
* `auth.register({ referralCode })`; the `register` here is for someone who already has an account.
|
|
1635
|
+
* The player's referrals. Both methods require login. A new player passes the code they were invited with in
|
|
1636
|
+
* the core's `auth.register({ referralCode })`: that is the only way to register a referral.
|
|
1457
1637
|
* @category Referrals
|
|
1458
1638
|
*/
|
|
1459
1639
|
interface ReferralsApi {
|
|
1460
1640
|
/**
|
|
1461
|
-
* The player's referral code,
|
|
1641
|
+
* The player's referral code, the active program rules and the totals per status. Build the invitation
|
|
1642
|
+
* link in the app (your sign-up route with the code), so it always points at your site.
|
|
1462
1643
|
* @example
|
|
1463
|
-
* const
|
|
1464
|
-
*
|
|
1465
|
-
*
|
|
1466
|
-
*
|
|
1644
|
+
* const info = await igaming.referrals.get()
|
|
1645
|
+
* if (!info.enabled) showProgramUnavailable()
|
|
1646
|
+
* else showInvite(`${location.origin}/sign-up?ref=${info.code}`, info.rules)
|
|
1647
|
+
* @throws {EnginexError} `UNAUTHENTICATED` without a session; `UNAVAILABLE` when the bonus service does not
|
|
1648
|
+
* answer; `VALIDATION_ERROR`, also in `'warn'`, with money or currency outside the format.
|
|
1467
1649
|
*/
|
|
1468
1650
|
get(params?: NoParams, options?: CallOptions): Promise<ReferralInfo>;
|
|
1469
1651
|
/**
|
|
1470
|
-
* Referral history, paginated. Pagination comes inside `data` (not in the
|
|
1471
|
-
* the SDK builds the `Page` and computes `totalPages` (`0` without items); a page beyond the
|
|
1472
|
-
* `items: []`.
|
|
1652
|
+
* Referral history, paginated, one row per referred player. Pagination comes inside `data` (not in the
|
|
1653
|
+
* envelope's `meta`): the SDK builds the `Page` and computes `totalPages` (`0` without items); a page beyond the
|
|
1654
|
+
* end returns `items: []`.
|
|
1473
1655
|
* @example
|
|
1474
|
-
* const { items, totalPages
|
|
1475
|
-
* items.forEach((r) => console.log(r.
|
|
1656
|
+
* const { items, totalPages } = await igaming.referrals.listHistory({ perPage: 20 })
|
|
1657
|
+
* items.forEach((r) => console.log(r.refereeName, r.status, r.progress?.remaining.amount))
|
|
1476
1658
|
* @throws {EnginexError} `CONFIGURATION_ERROR` (without a request) for a `page` that is not an integer ≥ 1 or
|
|
1477
|
-
* a `perPage` outside 1–100 or not an integer; `UNAUTHENTICATED` without a session; `
|
|
1478
|
-
*
|
|
1659
|
+
* a `perPage` outside 1–100 or not an integer; `UNAUTHENTICATED` without a session; `UNAVAILABLE` when the
|
|
1660
|
+
* bonus service does not answer; `VALIDATION_ERROR`, also in `'warn'`, with money or currency outside the
|
|
1661
|
+
* format.
|
|
1479
1662
|
*/
|
|
1480
1663
|
listHistory(input?: ListReferralsInput, options?: CallOptions): Promise<ReferralHistory>;
|
|
1481
|
-
/**
|
|
1482
|
-
* Registers another player's referral code on the logged-in account (after signup). Answers
|
|
1483
|
-
* HTTP 201.
|
|
1484
|
-
* @example
|
|
1485
|
-
* const result = await igaming.referrals.register({ code: 'ANA123' })
|
|
1486
|
-
* console.log(result.status, result.refereeBonus)
|
|
1487
|
-
* @throws {EnginexError} `CONFIGURATION_ERROR` (without a request) if `code` is not non-empty text;
|
|
1488
|
-
* `UNAUTHENTICATED` without a session; the service refuses a nonexistent, already used or out-of-rule code:
|
|
1489
|
-
* decide by `error.code` (the contract does not list the codes).
|
|
1490
|
-
*/
|
|
1491
|
-
register(input: RegisterReferralInput, options?: CallOptions): Promise<RegisteredReferral>;
|
|
1492
1664
|
}
|
|
1493
1665
|
|
|
1494
1666
|
/**
|
|
@@ -1558,7 +1730,7 @@ interface IgamingClient {
|
|
|
1558
1730
|
missions: MissionsApi;
|
|
1559
1731
|
/** Loyalty: points balance, tier, benefits and redemption. */
|
|
1560
1732
|
loyalty: LoyaltyApi;
|
|
1561
|
-
/** Referrals: code
|
|
1733
|
+
/** Referrals: code, program rules, totals per status and history with each referral's progress. */
|
|
1562
1734
|
referrals: ReferralsApi;
|
|
1563
1735
|
/** FIRST sportsbook: session to open the sportsbook in an iframe. */
|
|
1564
1736
|
sportsbook: SportsbookApi;
|
|
@@ -1585,4 +1757,4 @@ interface IgamingClient {
|
|
|
1585
1757
|
*/
|
|
1586
1758
|
declare function createIgaming(client: EnginexClient): IgamingClient;
|
|
1587
1759
|
|
|
1588
|
-
export { type ActivityAggregateQualification, type BalanceCreditReward, type BiggestWinner, type BonusApi, 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 CampaignRewardKind, type CampaignRewardValidity, type CampaignRoundingMode, type CampaignStackingPolicy, type CampaignTermsAcceptance, type CampaignTermsAcceptanceRecord, type CampaignTimeWindow, type CampaignUsePolicy, type CampaignWageringPolicy, 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 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
|
|
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 };
|