@getenginex/sdk-igaming 0.10.1 → 0.12.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 +61 -0
- package/README.md +4 -3
- package/dist/chunk-5ERRD3OA.js +648 -0
- package/dist/chunk-5ERRD3OA.js.map +1 -0
- package/dist/index.cjs +725 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +895 -8
- package/dist/index.d.ts +895 -8
- package/dist/index.js +427 -397
- package/dist/index.js.map +1 -1
- package/dist/query/index.cjs +73 -7
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +24 -5
- package/dist/query/index.d.ts +24 -5
- package/dist/query/index.js +61 -8
- package/dist/query/index.js.map +1 -1
- package/dist/testing/index.cjs +499 -14
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +42 -4
- package/dist/testing/index.d.ts +42 -4
- package/dist/testing/index.js +499 -14
- package/dist/testing/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -1607,6 +1607,750 @@ interface CasinoApi {
|
|
|
1607
1607
|
listJackpotGames(input: ListJackpotGamesInput, options?: CallOptions): Promise<JackpotGamesPage>;
|
|
1608
1608
|
}
|
|
1609
1609
|
|
|
1610
|
+
/**
|
|
1611
|
+
* Text per locale, as the operator wrote it (`{ "pt-BR": "...", "en": "..." }`). `{}` when the gateway sends none.
|
|
1612
|
+
* @category Club
|
|
1613
|
+
*/
|
|
1614
|
+
type ClubLocalized = Record<string, string>;
|
|
1615
|
+
/**
|
|
1616
|
+
* Money of the club, in minor units of `currency`.
|
|
1617
|
+
* @category Club
|
|
1618
|
+
*/
|
|
1619
|
+
interface ClubMoney {
|
|
1620
|
+
/** Value in minor units of `currency` (the gateway sends it as int64 text; the SDK converts). Never negative. */
|
|
1621
|
+
amount: number;
|
|
1622
|
+
/** ISO 4217 currency code, e.g. `BRL`. */
|
|
1623
|
+
currency: string;
|
|
1624
|
+
/**
|
|
1625
|
+
* Decimal places of `amount` as the gateway resolved them (the currency's ISO exponent; for a free-spin
|
|
1626
|
+
* denomination, the provider's scale); `null` when the gateway omits them.
|
|
1627
|
+
*/
|
|
1628
|
+
decimalPlaces: number | null;
|
|
1629
|
+
}
|
|
1630
|
+
/**
|
|
1631
|
+
* Kind of a club reward, in lowercase. A kind the SDK does not know yet arrives as the gateway sent it, in
|
|
1632
|
+
* lowercase: handle the default case.
|
|
1633
|
+
* @category Club
|
|
1634
|
+
*/
|
|
1635
|
+
type ClubRewardKind = 'coins' | 'digital' | 'cashback' | 'bonus_balance' | 'free_spins' | 'tournament_ticket' | 'real_balance' | 'manual' | 'unspecified' | (string & {});
|
|
1636
|
+
/**
|
|
1637
|
+
* Coin award published in place of a reward in a given situation (e.g. the player already holds the ticket).
|
|
1638
|
+
* @category Club
|
|
1639
|
+
*/
|
|
1640
|
+
interface ClubAlternateReward {
|
|
1641
|
+
/** Kind of the alternate, `coins` today. */
|
|
1642
|
+
kind: ClubRewardKind;
|
|
1643
|
+
/** Label per locale. */
|
|
1644
|
+
label: ClubLocalized;
|
|
1645
|
+
/** Quantity (integer). */
|
|
1646
|
+
quantity: number;
|
|
1647
|
+
}
|
|
1648
|
+
/**
|
|
1649
|
+
* Cashback terms of a `cashback` reward.
|
|
1650
|
+
* @category Club
|
|
1651
|
+
*/
|
|
1652
|
+
interface ClubCashbackTerms {
|
|
1653
|
+
/** Percentage in basis points (`1000` = 10%). */
|
|
1654
|
+
percentageBps: number;
|
|
1655
|
+
/** `edition`, `daily`, `weekly` or another period; `null` when absent. */
|
|
1656
|
+
period: 'edition' | 'daily' | 'weekly' | (string & {}) | null;
|
|
1657
|
+
/** `net_loss` or another basis; `null` when absent. */
|
|
1658
|
+
basis: 'net_loss' | (string & {}) | null;
|
|
1659
|
+
/** Where the cashback is credited: `real`, `restricted` or another; `null` when absent. */
|
|
1660
|
+
destination: 'real' | 'restricted' | (string & {}) | null;
|
|
1661
|
+
/** Start of the frozen basis window (ISO 8601); `null` when absent. */
|
|
1662
|
+
startsAt: string | null;
|
|
1663
|
+
/** End of the frozen basis window (ISO 8601); `null` when absent. */
|
|
1664
|
+
endsAt: string | null;
|
|
1665
|
+
/** Catalogue game ids eligible for the basis. */
|
|
1666
|
+
gameIds: string[];
|
|
1667
|
+
/** Coin award when the basis is zero; `null` when none. */
|
|
1668
|
+
zeroBasisAlternate: ClubAlternateReward | null;
|
|
1669
|
+
/** Coin award when the basis was already rewarded; `null` when none. */
|
|
1670
|
+
priorAwardAlternate: ClubAlternateReward | null;
|
|
1671
|
+
}
|
|
1672
|
+
/**
|
|
1673
|
+
* A club reward: of a wheel slice, a mission chest, a store item or a tournament prize.
|
|
1674
|
+
* @category Club
|
|
1675
|
+
*/
|
|
1676
|
+
interface ClubReward {
|
|
1677
|
+
/** Reward id (`''` when the gateway sends none, e.g. in a projected tournament prize). */
|
|
1678
|
+
id: string;
|
|
1679
|
+
/** Label per locale. */
|
|
1680
|
+
label: ClubLocalized;
|
|
1681
|
+
/** Kind of the reward (see {@link ClubRewardKind}). */
|
|
1682
|
+
kind: ClubRewardKind;
|
|
1683
|
+
/** Quantity (integer: coins, spins, items). */
|
|
1684
|
+
quantity: number;
|
|
1685
|
+
/** Money of the reward; `null` when it has none. */
|
|
1686
|
+
money: ClubMoney | null;
|
|
1687
|
+
/** Free-spin campaign: spins and the catalogue game; `null` when not a campaign. */
|
|
1688
|
+
campaign: {
|
|
1689
|
+
spins: number;
|
|
1690
|
+
gameId: string | null;
|
|
1691
|
+
} | null;
|
|
1692
|
+
/** Cashback terms; `null` when not a cashback. */
|
|
1693
|
+
cashback: ClubCashbackTerms | null;
|
|
1694
|
+
/** Manual delivery (`physical` or `experience`) with the instructions; `null` when not manual. */
|
|
1695
|
+
manual: {
|
|
1696
|
+
deliveryType: 'physical' | 'experience' | (string & {}) | null;
|
|
1697
|
+
instructions: ClubLocalized;
|
|
1698
|
+
} | null;
|
|
1699
|
+
/** Validity in seconds after delivery (integer; `0` without one). */
|
|
1700
|
+
ttlSeconds: number;
|
|
1701
|
+
/** Tournament edition of a `tournament_ticket`; `null` otherwise. */
|
|
1702
|
+
editionId: string | null;
|
|
1703
|
+
/** Coin award when the player already holds the ticket or entry; `null` when none. */
|
|
1704
|
+
ticketOwnedAlternate: ClubAlternateReward | null;
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* Status of a receipt, in lowercase: `pending`, `delivered`, `failed`, `no_value` (a confirmed zero cashback) or a
|
|
1708
|
+
* status the SDK does not know yet.
|
|
1709
|
+
* @category Club
|
|
1710
|
+
*/
|
|
1711
|
+
type ClubReceiptStatus = 'pending' | 'delivered' | 'failed' | 'no_value' | 'unspecified' | (string & {});
|
|
1712
|
+
/**
|
|
1713
|
+
* Receipt of a play, a redemption, a mission chest or a tournament award.
|
|
1714
|
+
* @category Club
|
|
1715
|
+
*/
|
|
1716
|
+
interface ClubReceipt {
|
|
1717
|
+
/** Receipt id. */
|
|
1718
|
+
id: string;
|
|
1719
|
+
/** Status (see {@link ClubReceiptStatus}). */
|
|
1720
|
+
status: ClubReceiptStatus;
|
|
1721
|
+
/** What produced it, in lowercase: `activity` (a wheel, scratch card or gift), `chest` (a mission chest), `store` or `tournament`. */
|
|
1722
|
+
sourceKind: 'activity' | 'chest' | 'store' | 'tournament' | 'unspecified' | (string & {});
|
|
1723
|
+
/** Id of the source (activity, mission right, item, edition); `null` when absent. */
|
|
1724
|
+
sourceId: string | null;
|
|
1725
|
+
/** Wheel slice that was drawn; `null` when not a draw. */
|
|
1726
|
+
sliceId: string | null;
|
|
1727
|
+
/** The reward; `null` when absent. */
|
|
1728
|
+
reward: ClubReward | null;
|
|
1729
|
+
/** Money actually settled; `null` when absent. */
|
|
1730
|
+
settlement: ClubMoney | null;
|
|
1731
|
+
/** Coins spent (integer; `0` when free). */
|
|
1732
|
+
costCoins: number;
|
|
1733
|
+
/** When it was accepted (ISO 8601); `null` when absent. */
|
|
1734
|
+
acceptedAt: string | null;
|
|
1735
|
+
/** When the delivery was confirmed (ISO 8601); `null` while not delivered. */
|
|
1736
|
+
deliveredAt: string | null;
|
|
1737
|
+
/** When the reward expires (ISO 8601); `null` without expiry. */
|
|
1738
|
+
expiresAt: string | null;
|
|
1739
|
+
/** Frozen final rank of a tournament award; `null` otherwise. */
|
|
1740
|
+
tournamentRank: number | null;
|
|
1741
|
+
/** Whether a tournament ticket was consumed. */
|
|
1742
|
+
ticketConsumed: boolean;
|
|
1743
|
+
}
|
|
1744
|
+
/**
|
|
1745
|
+
* A level of the program.
|
|
1746
|
+
* @category Club
|
|
1747
|
+
*/
|
|
1748
|
+
interface ClubLevel {
|
|
1749
|
+
/** Level id. */
|
|
1750
|
+
id: string;
|
|
1751
|
+
/** Name per locale. */
|
|
1752
|
+
name: ClubLocalized;
|
|
1753
|
+
/** XP needed to reach it (integer). */
|
|
1754
|
+
minXp: number;
|
|
1755
|
+
/** Benefit per locale. */
|
|
1756
|
+
benefit: ClubLocalized;
|
|
1757
|
+
}
|
|
1758
|
+
/**
|
|
1759
|
+
* The club program as the player sees it (part of {@link ClubOverview}; also the result of
|
|
1760
|
+
* {@link ClubApi.setMembership}).
|
|
1761
|
+
* @category Club
|
|
1762
|
+
*/
|
|
1763
|
+
interface ClubProgram {
|
|
1764
|
+
/** Whether the program is active for the operator. */
|
|
1765
|
+
enabled: boolean;
|
|
1766
|
+
/** Whether the player joined. */
|
|
1767
|
+
joined: boolean;
|
|
1768
|
+
/** Whether joining is required before playing. */
|
|
1769
|
+
membershipRequired: boolean;
|
|
1770
|
+
/** Whether the player can join now. */
|
|
1771
|
+
canJoin: boolean;
|
|
1772
|
+
/** Whether the history can be read (also when the program is paused). */
|
|
1773
|
+
historyAvailable: boolean;
|
|
1774
|
+
/** Published version: pass it back as `versionId` in every write; `null` without a published version. */
|
|
1775
|
+
versionId: string | null;
|
|
1776
|
+
/** Locale the gateway resolved from `Accept-Language` (the client's locale); `null` when absent. */
|
|
1777
|
+
locale: string | null;
|
|
1778
|
+
/** Key of the membership terms shown for that locale: pass it as `termsLocale` when joining. */
|
|
1779
|
+
termsLocale: string | null;
|
|
1780
|
+
/** Program time zone (IANA); `null` when absent. */
|
|
1781
|
+
timeZone: string | null;
|
|
1782
|
+
/** The player's wallet currency the program uses; `null` while not confirmed. */
|
|
1783
|
+
currency: string | null;
|
|
1784
|
+
/** Name per locale. */
|
|
1785
|
+
name: ClubLocalized;
|
|
1786
|
+
/** Terms per locale. */
|
|
1787
|
+
terms: ClubLocalized;
|
|
1788
|
+
/** Name of the coin per locale. */
|
|
1789
|
+
coinName: ClubLocalized;
|
|
1790
|
+
/** Cover image; `null` when absent. */
|
|
1791
|
+
coverUrl: string | null;
|
|
1792
|
+
/** Levels, in the order the operator published them (a repeated id keeps the first). */
|
|
1793
|
+
levels: ClubLevel[];
|
|
1794
|
+
}
|
|
1795
|
+
/**
|
|
1796
|
+
* Kind of an activity: `wheel`, `scratch`, `gift` or a kind the SDK does not know yet.
|
|
1797
|
+
* @category Club
|
|
1798
|
+
*/
|
|
1799
|
+
type ClubActivityKind = 'wheel' | 'scratch' | 'gift' | 'unspecified' | (string & {});
|
|
1800
|
+
/**
|
|
1801
|
+
* An activity (wheel, scratch card, gift) and the player's state in it.
|
|
1802
|
+
* @category Club
|
|
1803
|
+
*/
|
|
1804
|
+
interface ClubActivityState {
|
|
1805
|
+
/** The activity. */
|
|
1806
|
+
activity: {
|
|
1807
|
+
/** Activity id: pass it to {@link ClubApi.play}. */
|
|
1808
|
+
id: string;
|
|
1809
|
+
/** Kind (see {@link ClubActivityKind}). */
|
|
1810
|
+
kind: ClubActivityKind;
|
|
1811
|
+
/** Name per locale. */
|
|
1812
|
+
name: ClubLocalized;
|
|
1813
|
+
/** Terms per locale. */
|
|
1814
|
+
terms: ClubLocalized;
|
|
1815
|
+
/** Cover image; `null` when absent. */
|
|
1816
|
+
coverUrl: string | null;
|
|
1817
|
+
/** Wheel theme: `emerald`, `midnight`, `berry` or another; `null` when absent. */
|
|
1818
|
+
wheelTheme: 'emerald' | 'midnight' | 'berry' | (string & {}) | null;
|
|
1819
|
+
/** Label of the play button per locale. */
|
|
1820
|
+
playLabel: ClubLocalized;
|
|
1821
|
+
/** Slices, without the draw weights (a repeated id keeps the first). */
|
|
1822
|
+
slices: {
|
|
1823
|
+
id: string;
|
|
1824
|
+
reward: ClubReward | null;
|
|
1825
|
+
}[];
|
|
1826
|
+
};
|
|
1827
|
+
/** Whether the player can play now. */
|
|
1828
|
+
canPlay: boolean;
|
|
1829
|
+
/** Why the player cannot play (e.g. `daily_budget_exhausted`); `null` when absent. */
|
|
1830
|
+
unavailableReason: 'daily_budget_exhausted' | (string & {}) | null;
|
|
1831
|
+
/** The player's last receipt in this activity; `null` when none. */
|
|
1832
|
+
latestReceipt: ClubReceipt | null;
|
|
1833
|
+
/** When the player can play again (ISO 8601); `null` when absent. */
|
|
1834
|
+
availableAt: string | null;
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
* A mission and the player's progress and chest right.
|
|
1838
|
+
* @category Club
|
|
1839
|
+
*/
|
|
1840
|
+
interface ClubMissionState {
|
|
1841
|
+
/** The mission. */
|
|
1842
|
+
mission: {
|
|
1843
|
+
/** Mission id. */
|
|
1844
|
+
id: string;
|
|
1845
|
+
/** Title per locale. */
|
|
1846
|
+
title: ClubLocalized;
|
|
1847
|
+
/** Terms per locale. */
|
|
1848
|
+
terms: ClubLocalized;
|
|
1849
|
+
/** `daily`, `weekly`, `edition` or another, in lowercase. */
|
|
1850
|
+
recurrence: string;
|
|
1851
|
+
/** `fact`, `day`, `edition` or another, in lowercase. */
|
|
1852
|
+
countBy: string;
|
|
1853
|
+
/** Target (integer). */
|
|
1854
|
+
target: number;
|
|
1855
|
+
/** Cover image; `null` when absent. */
|
|
1856
|
+
coverUrl: string | null;
|
|
1857
|
+
};
|
|
1858
|
+
/** Edition (period) of the mission; `null` when absent. */
|
|
1859
|
+
editionId: string | null;
|
|
1860
|
+
/** Progress (integer). */
|
|
1861
|
+
progress: number;
|
|
1862
|
+
/** Chest right: pass it as `activityId` to {@link ClubApi.play} to open the chest; `null` without a right. */
|
|
1863
|
+
rightId: string | null;
|
|
1864
|
+
/**
|
|
1865
|
+
* Version of the right. The gateway sends it on the pending chests of a paused program; `null` when absent.
|
|
1866
|
+
*/
|
|
1867
|
+
rightVersionId: string | null;
|
|
1868
|
+
/** Chest options: pass the chosen `id` as `optionId` to {@link ClubApi.play}. */
|
|
1869
|
+
chestOptions: ClubReward[];
|
|
1870
|
+
/** Whether the chest can be opened now. */
|
|
1871
|
+
canClaim: boolean;
|
|
1872
|
+
/** Receipt of the opened chest; `null` while not opened. */
|
|
1873
|
+
receipt: ClubReceipt | null;
|
|
1874
|
+
/** End of the edition (ISO 8601); `null` when absent. */
|
|
1875
|
+
endsAt: string | null;
|
|
1876
|
+
/** Deadline to open the chest (ISO 8601); `null` when absent. */
|
|
1877
|
+
claimExpiresAt: string | null;
|
|
1878
|
+
/** Days already stamped (`YYYY-MM-DD`). */
|
|
1879
|
+
stampedDays: string[];
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* An item of the coin store and whether the player can redeem it.
|
|
1883
|
+
* @category Club
|
|
1884
|
+
*/
|
|
1885
|
+
interface ClubStoreItemState {
|
|
1886
|
+
/** The item. */
|
|
1887
|
+
item: {
|
|
1888
|
+
/** Item id: pass it as `rewardId` to {@link ClubApi.redeem}. */
|
|
1889
|
+
id: string;
|
|
1890
|
+
/** Label per locale. */
|
|
1891
|
+
label: ClubLocalized;
|
|
1892
|
+
/** Terms per locale. */
|
|
1893
|
+
terms: ClubLocalized;
|
|
1894
|
+
/** Price in coins (integer). */
|
|
1895
|
+
costCoins: number;
|
|
1896
|
+
/** The reward; `null` when absent. */
|
|
1897
|
+
reward: ClubReward | null;
|
|
1898
|
+
/** Cover image; `null` when absent. */
|
|
1899
|
+
coverUrl: string | null;
|
|
1900
|
+
};
|
|
1901
|
+
/** Whether the player can redeem it now. */
|
|
1902
|
+
canRedeem: boolean;
|
|
1903
|
+
/** Why it cannot be redeemed, in lowercase; `null` when absent. */
|
|
1904
|
+
unavailableReason: string | null;
|
|
1905
|
+
}
|
|
1906
|
+
/**
|
|
1907
|
+
* The player's balances, activities, missions and store.
|
|
1908
|
+
* @category Club
|
|
1909
|
+
*/
|
|
1910
|
+
interface ClubRewards {
|
|
1911
|
+
/** XP (integer). */
|
|
1912
|
+
xp: number;
|
|
1913
|
+
/** Coin balance (integer). */
|
|
1914
|
+
coins: number;
|
|
1915
|
+
/** Current level id; `null` when none. */
|
|
1916
|
+
levelId: string | null;
|
|
1917
|
+
/** Activities (a repeated activity id keeps the first). Empty while the program is paused. */
|
|
1918
|
+
activities: ClubActivityState[];
|
|
1919
|
+
/** Missions (a repeated mission right keeps the first). While paused, only the pending chests. */
|
|
1920
|
+
missions: ClubMissionState[];
|
|
1921
|
+
/** Store items (a repeated item id keeps the first). Empty while the program is paused. */
|
|
1922
|
+
storeItems: ClubStoreItemState[];
|
|
1923
|
+
}
|
|
1924
|
+
/**
|
|
1925
|
+
* The club overview (`GET /casino/club`).
|
|
1926
|
+
* @category Club
|
|
1927
|
+
*/
|
|
1928
|
+
interface ClubOverview {
|
|
1929
|
+
/** The program. */
|
|
1930
|
+
program: ClubProgram;
|
|
1931
|
+
/** The player's state; `null` when the program is disabled and has no history. */
|
|
1932
|
+
rewards: ClubRewards | null;
|
|
1933
|
+
}
|
|
1934
|
+
/**
|
|
1935
|
+
* A balance movement of the history.
|
|
1936
|
+
* @category Club
|
|
1937
|
+
*/
|
|
1938
|
+
interface ClubMovement {
|
|
1939
|
+
/** Movement id. */
|
|
1940
|
+
id: string;
|
|
1941
|
+
/** `xp`, `coins` or another kind, in lowercase. */
|
|
1942
|
+
kind: string;
|
|
1943
|
+
/** Units moved (integer; negative for a debit). */
|
|
1944
|
+
units: number;
|
|
1945
|
+
/** Id of the source; `null` when absent. */
|
|
1946
|
+
sourceId: string | null;
|
|
1947
|
+
/** When it happened (ISO 8601); `null` when absent. */
|
|
1948
|
+
occurredAt: string | null;
|
|
1949
|
+
}
|
|
1950
|
+
/**
|
|
1951
|
+
* A page of the club history.
|
|
1952
|
+
* @category Club
|
|
1953
|
+
*/
|
|
1954
|
+
interface ClubHistory {
|
|
1955
|
+
/** Receipts on this page (a repeated id keeps the first). */
|
|
1956
|
+
receipts: ClubReceipt[];
|
|
1957
|
+
/** Movements on this page (a repeated id keeps the first). */
|
|
1958
|
+
movements: ClubMovement[];
|
|
1959
|
+
/** Pass it as `cursor` for the next page; absent on the last one. */
|
|
1960
|
+
nextCursor?: string;
|
|
1961
|
+
}
|
|
1962
|
+
/**
|
|
1963
|
+
* Status of a tournament, in lowercase.
|
|
1964
|
+
* @category Club
|
|
1965
|
+
*/
|
|
1966
|
+
type ClubTournamentStatus = 'draft' | 'upcoming' | 'live' | 'awaiting_confirmation' | 'completed' | 'cancelled' | 'unspecified' | (string & {});
|
|
1967
|
+
/**
|
|
1968
|
+
* The player's registration in a tournament.
|
|
1969
|
+
* @category Club
|
|
1970
|
+
*/
|
|
1971
|
+
interface ClubTournamentRegistration {
|
|
1972
|
+
/** Registration id. */
|
|
1973
|
+
id: string;
|
|
1974
|
+
/** Edition id. */
|
|
1975
|
+
editionId: string;
|
|
1976
|
+
/** Version registered; `null` when absent. */
|
|
1977
|
+
versionId: string | null;
|
|
1978
|
+
/** When the player registered (ISO 8601); `null` when absent. */
|
|
1979
|
+
joinedAt: string | null;
|
|
1980
|
+
}
|
|
1981
|
+
/**
|
|
1982
|
+
* A prize range of a tournament.
|
|
1983
|
+
* @category Club
|
|
1984
|
+
*/
|
|
1985
|
+
interface ClubTournamentPrize {
|
|
1986
|
+
/** First rank of the range (integer). */
|
|
1987
|
+
fromRank: number;
|
|
1988
|
+
/** Last rank of the range (integer). */
|
|
1989
|
+
toRank: number;
|
|
1990
|
+
/** The reward; `null` when absent (e.g. an external listing). */
|
|
1991
|
+
reward: ClubReward | null;
|
|
1992
|
+
/** Announced amount (external listings); `null` when absent. Under `'warn'` a prize with an invalid one is dropped. */
|
|
1993
|
+
announcedAmount: ClubMoney | null;
|
|
1994
|
+
/** Prize terms per locale (`{}` when none). */
|
|
1995
|
+
terms: ClubLocalized;
|
|
1996
|
+
/** Frozen offer conditions of a `bonus_balance`/`free_spins` prize; `null` when none. */
|
|
1997
|
+
offerTerms: {
|
|
1998
|
+
/** Value of each free spin, in the provider's scale; `null` when unconfirmed. */
|
|
1999
|
+
spinDenomination: ClubMoney | null;
|
|
2000
|
+
/** Exact decimal wagering multiplier (`"0"` = no wagering); `null` when unconfirmed. */
|
|
2001
|
+
wageringMultiplier: string | null;
|
|
2002
|
+
/** Validity in seconds; `null` when unconfirmed. */
|
|
2003
|
+
validForSeconds: number | null;
|
|
2004
|
+
/** Expiry of the offer (ISO 8601); `null` when absent. */
|
|
2005
|
+
expiresAt: string | null;
|
|
2006
|
+
/** End of the grant window (ISO 8601); `null` when absent. */
|
|
2007
|
+
grantEndsAt: string | null;
|
|
2008
|
+
} | null;
|
|
2009
|
+
}
|
|
2010
|
+
/**
|
|
2011
|
+
* A club tournament (own or external).
|
|
2012
|
+
* @category Club
|
|
2013
|
+
*/
|
|
2014
|
+
interface ClubTournament {
|
|
2015
|
+
/** Edition id (external ones start with `ext_`). */
|
|
2016
|
+
id: string;
|
|
2017
|
+
/** `own`, `external` or another source, in lowercase. */
|
|
2018
|
+
source: string;
|
|
2019
|
+
/** Published version: pass it as `versionId` to {@link ClubApi.registerForTournament}; `null` when absent. */
|
|
2020
|
+
versionId: string | null;
|
|
2021
|
+
/** Title per locale. */
|
|
2022
|
+
title: ClubLocalized;
|
|
2023
|
+
/** Terms per locale. */
|
|
2024
|
+
terms: ClubLocalized;
|
|
2025
|
+
/** Status (see {@link ClubTournamentStatus}). */
|
|
2026
|
+
status: ClubTournamentStatus;
|
|
2027
|
+
/** Start (ISO 8601); `null` when absent. */
|
|
2028
|
+
startsAt: string | null;
|
|
2029
|
+
/** End (ISO 8601); `null` when absent. */
|
|
2030
|
+
endsAt: string | null;
|
|
2031
|
+
/** Last update (ISO 8601); `null` when absent. */
|
|
2032
|
+
updatedAt: string | null;
|
|
2033
|
+
/** Scoring rule, in lowercase; `null` when absent. */
|
|
2034
|
+
scoringRule: string | null;
|
|
2035
|
+
/** Tie-break rule, in lowercase; `null` when absent. */
|
|
2036
|
+
tieBreak: string | null;
|
|
2037
|
+
/** Currency of the edition (ISO 4217); `null` when absent. */
|
|
2038
|
+
currency: string | null;
|
|
2039
|
+
/** Time zone (IANA); `null` when absent. */
|
|
2040
|
+
timeZone: string | null;
|
|
2041
|
+
/** Catalogue games of the edition (a repeated id keeps the first). */
|
|
2042
|
+
gameIds: string[];
|
|
2043
|
+
/** Prize ranges. */
|
|
2044
|
+
prizes: ClubTournamentPrize[];
|
|
2045
|
+
/** `registration`, `in_game` or another; `null` when no action is confirmed. */
|
|
2046
|
+
joinMode: 'registration' | 'in_game' | (string & {}) | null;
|
|
2047
|
+
/** Locale of the terms shown; `null` when absent. */
|
|
2048
|
+
locale: string | null;
|
|
2049
|
+
/** Whether {@link ClubApi.getRanking} can be read. */
|
|
2050
|
+
rankingAvailable: boolean;
|
|
2051
|
+
/** Whether the player can register now. */
|
|
2052
|
+
canRegister: boolean;
|
|
2053
|
+
/** Whether registering consumes a ticket. */
|
|
2054
|
+
requiresTicket: boolean;
|
|
2055
|
+
/** The player's registration; `null` when not registered. */
|
|
2056
|
+
registration: ClubTournamentRegistration | null;
|
|
2057
|
+
/** The player's award from the frozen result (detail only); `null` when none. */
|
|
2058
|
+
personalAward: ClubReceipt | null;
|
|
2059
|
+
/** Whether the source data is stale. */
|
|
2060
|
+
stale: boolean;
|
|
2061
|
+
/** Registration opening (ISO 8601); `null` when absent. */
|
|
2062
|
+
registrationStartsAt: string | null;
|
|
2063
|
+
/** Registration closing (ISO 8601); `null` when absent. */
|
|
2064
|
+
registrationEndsAt: string | null;
|
|
2065
|
+
/** Cover image; `null` when absent. */
|
|
2066
|
+
coverUrl: string | null;
|
|
2067
|
+
}
|
|
2068
|
+
/**
|
|
2069
|
+
* A page of club tournaments.
|
|
2070
|
+
* @category Club
|
|
2071
|
+
*/
|
|
2072
|
+
interface ClubTournamentPage {
|
|
2073
|
+
/** Tournaments on this page (a repeated id keeps the first). */
|
|
2074
|
+
items: ClubTournament[];
|
|
2075
|
+
/** Whether external tournaments are on the page. */
|
|
2076
|
+
externalAvailable: boolean;
|
|
2077
|
+
/** Whether an external tournament on the page is stale. */
|
|
2078
|
+
externalStale: boolean;
|
|
2079
|
+
/** Pass it as `cursor` for the next page; absent on the last one. */
|
|
2080
|
+
nextCursor?: string;
|
|
2081
|
+
}
|
|
2082
|
+
/**
|
|
2083
|
+
* Another edition of the same external schedule.
|
|
2084
|
+
* @category Club
|
|
2085
|
+
*/
|
|
2086
|
+
interface ClubRelatedTournament {
|
|
2087
|
+
/** Edition id (`ext_...`). */
|
|
2088
|
+
id: string;
|
|
2089
|
+
/** Title per locale. */
|
|
2090
|
+
title: ClubLocalized;
|
|
2091
|
+
/** Status (see {@link ClubTournamentStatus}). */
|
|
2092
|
+
status: ClubTournamentStatus;
|
|
2093
|
+
/** Start (ISO 8601); `null` when absent. */
|
|
2094
|
+
startsAt: string | null;
|
|
2095
|
+
/** End (ISO 8601); `null` when absent. */
|
|
2096
|
+
endsAt: string | null;
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* A page of related editions.
|
|
2100
|
+
* @category Club
|
|
2101
|
+
*/
|
|
2102
|
+
interface ClubRelatedTournamentPage {
|
|
2103
|
+
/** Related editions (a repeated id keeps the first). */
|
|
2104
|
+
items: ClubRelatedTournament[];
|
|
2105
|
+
/** Pass it as `cursor` for the next page; absent on the last one. */
|
|
2106
|
+
nextCursor?: string;
|
|
2107
|
+
}
|
|
2108
|
+
/**
|
|
2109
|
+
* A row of a tournament ranking.
|
|
2110
|
+
* @category Club
|
|
2111
|
+
*/
|
|
2112
|
+
interface ClubRank {
|
|
2113
|
+
/** Position (integer ≥ 1). */
|
|
2114
|
+
position: number;
|
|
2115
|
+
/** Display name, already masked by the source. */
|
|
2116
|
+
displayName: string;
|
|
2117
|
+
/** Score as decimal text (display only). */
|
|
2118
|
+
score: string;
|
|
2119
|
+
}
|
|
2120
|
+
/**
|
|
2121
|
+
* A tournament ranking.
|
|
2122
|
+
* @category Club
|
|
2123
|
+
*/
|
|
2124
|
+
interface ClubRanking {
|
|
2125
|
+
/** Top rows. */
|
|
2126
|
+
entries: ClubRank[];
|
|
2127
|
+
/** The player's row; `null` when not ranked. */
|
|
2128
|
+
personal: ClubRank | null;
|
|
2129
|
+
/** Last update (ISO 8601); `null` when absent. */
|
|
2130
|
+
updatedAt: string | null;
|
|
2131
|
+
/** Whether the ranking is final. */
|
|
2132
|
+
final: boolean;
|
|
2133
|
+
}
|
|
2134
|
+
/**
|
|
2135
|
+
* Result of {@link ClubApi.play}.
|
|
2136
|
+
* @category Club
|
|
2137
|
+
*/
|
|
2138
|
+
interface ClubPlayResult {
|
|
2139
|
+
/** The receipt. */
|
|
2140
|
+
receipt: ClubReceipt;
|
|
2141
|
+
/** Slice drawn; `null` when not a draw (e.g. a mission chest). */
|
|
2142
|
+
sliceId: string | null;
|
|
2143
|
+
/** The player's state after the play; `null` when absent. */
|
|
2144
|
+
rewards: ClubRewards | null;
|
|
2145
|
+
}
|
|
2146
|
+
/**
|
|
2147
|
+
* Cursor pagination of the club listings.
|
|
2148
|
+
* @category Club
|
|
2149
|
+
*/
|
|
2150
|
+
interface ClubCursorInput {
|
|
2151
|
+
/** The previous page's `nextCursor`. Omitted: the first page. */
|
|
2152
|
+
cursor?: string;
|
|
2153
|
+
/** Items per page: an integer from 1 to 100. Omitted: the gateway default. */
|
|
2154
|
+
limit?: number;
|
|
2155
|
+
}
|
|
2156
|
+
/**
|
|
2157
|
+
* Input of {@link ClubApi.listRelatedTournaments}.
|
|
2158
|
+
* @category Club
|
|
2159
|
+
*/
|
|
2160
|
+
interface ListRelatedClubTournamentsInput extends ClubCursorInput {
|
|
2161
|
+
/** External edition (`ext_` followed by letters, digits, `_` or `-`). */
|
|
2162
|
+
editionId: string;
|
|
2163
|
+
}
|
|
2164
|
+
/**
|
|
2165
|
+
* Input of {@link ClubApi.getRanking}.
|
|
2166
|
+
* @category Club
|
|
2167
|
+
*/
|
|
2168
|
+
interface GetClubRankingInput {
|
|
2169
|
+
/** Edition id. */
|
|
2170
|
+
editionId: string;
|
|
2171
|
+
/** Rows: an integer from 1 to 100. Omitted: the gateway default. */
|
|
2172
|
+
limit?: number;
|
|
2173
|
+
}
|
|
2174
|
+
/**
|
|
2175
|
+
* Input of {@link ClubApi.setMembership}: join (with the terms locale shown) or leave.
|
|
2176
|
+
* @category Club
|
|
2177
|
+
*/
|
|
2178
|
+
type SetClubMembershipInput = {
|
|
2179
|
+
/** {@link ClubProgram.versionId}. */
|
|
2180
|
+
versionId: string;
|
|
2181
|
+
/** Join. */
|
|
2182
|
+
joined: true;
|
|
2183
|
+
/** {@link ClubProgram.termsLocale}: the key of the terms the player saw. */
|
|
2184
|
+
termsLocale: string;
|
|
2185
|
+
} | {
|
|
2186
|
+
/** {@link ClubProgram.versionId}. */
|
|
2187
|
+
versionId: string;
|
|
2188
|
+
/** Leave. */
|
|
2189
|
+
joined: false;
|
|
2190
|
+
};
|
|
2191
|
+
/**
|
|
2192
|
+
* Input of {@link ClubApi.play}.
|
|
2193
|
+
* @category Club
|
|
2194
|
+
*/
|
|
2195
|
+
interface PlayClubActivityInput {
|
|
2196
|
+
/** An activity id, or a mission's `rightId` to open its chest. */
|
|
2197
|
+
activityId: string;
|
|
2198
|
+
/** {@link ClubProgram.versionId} (or the mission's `rightVersionId`). */
|
|
2199
|
+
versionId: string;
|
|
2200
|
+
/** Chosen chest option (`chestOptions[i].id`). */
|
|
2201
|
+
optionId?: string;
|
|
2202
|
+
}
|
|
2203
|
+
/**
|
|
2204
|
+
* Input of {@link ClubApi.redeem}.
|
|
2205
|
+
* @category Club
|
|
2206
|
+
*/
|
|
2207
|
+
interface RedeemClubRewardInput {
|
|
2208
|
+
/** Store item id. */
|
|
2209
|
+
rewardId: string;
|
|
2210
|
+
/** {@link ClubProgram.versionId}. */
|
|
2211
|
+
versionId: string;
|
|
2212
|
+
}
|
|
2213
|
+
/**
|
|
2214
|
+
* Input of {@link ClubApi.registerForTournament}.
|
|
2215
|
+
* @category Club
|
|
2216
|
+
*/
|
|
2217
|
+
interface RegisterClubTournamentInput {
|
|
2218
|
+
/** Edition id. */
|
|
2219
|
+
editionId: string;
|
|
2220
|
+
/** {@link ClubTournament.versionId}. */
|
|
2221
|
+
versionId: string;
|
|
2222
|
+
/** Ticket to consume, when the tournament requires one. */
|
|
2223
|
+
ticketId?: string;
|
|
2224
|
+
}
|
|
2225
|
+
/**
|
|
2226
|
+
* The casino club: program, activities (wheel, scratch, gift), missions with chests, coin store, history and
|
|
2227
|
+
* tournaments. Every method requires login. The gateway resolves the texts from the client's locale
|
|
2228
|
+
* (`Accept-Language`): change it with the core's `setLocale`.
|
|
2229
|
+
*
|
|
2230
|
+
* Writes are **idempotent**: each sends an `Idempotency-Key` (the one in `options.idempotencyKey` or one generated per
|
|
2231
|
+
* call; printable ASCII up to 128 characters, without surrounding spaces) that the club service stores. To retry a write whose
|
|
2232
|
+
* outcome is unknown, call again with the **same** key: the service answers the first result. The club answers a
|
|
2233
|
+
* duplicate still in flight with a plain 409 (`ALREADY_EXISTS`, never `KEY_IN_USE`), so a 409 is not a definitive
|
|
2234
|
+
* refusal: keep the key after anything but a 400, 403, 404 or 422 ({@link keepsClubIdempotencyKey} tells which).
|
|
2235
|
+
* Through `createIgamingMutations` the club writes follow that rule for you; an app that persists the key (e.g. per
|
|
2236
|
+
* action in `sessionStorage`, to survive a reload) uses the same helper to decide when to drop it.
|
|
2237
|
+
*
|
|
2238
|
+
* Errors to expect (identify by `error.code`): `NOT_FOUND` (404, also when the club is not active),
|
|
2239
|
+
* `PERMISSION_DENIED` (403), `ALREADY_EXISTS` (409, a conflict with the version, the availability or the account
|
|
2240
|
+
* state), `CLUB_WALLET_UNAVAILABLE` (503, or 409 when the wallet currency is not confirmed), `CLUB_RATE_LIMITED`
|
|
2241
|
+
* (429), `INVALID_ARGUMENT` (400), `UNAVAILABLE` (503).
|
|
2242
|
+
* @category Club
|
|
2243
|
+
*/
|
|
2244
|
+
interface ClubApi {
|
|
2245
|
+
/**
|
|
2246
|
+
* The program, the player's balances, activities, missions and store.
|
|
2247
|
+
* @example
|
|
2248
|
+
* const { program, rewards } = await igaming.club.getOverview()
|
|
2249
|
+
* if (program.enabled && !program.joined && program.canJoin) showJoin(program.terms, program.termsLocale)
|
|
2250
|
+
* @throws {EnginexError} `UNAUTHENTICATED` without a session; `VALIDATION_ERROR`, also in `'warn'`, with money
|
|
2251
|
+
* outside the format.
|
|
2252
|
+
*/
|
|
2253
|
+
getOverview(params?: NoParams, options?: CallOptions): Promise<ClubOverview>;
|
|
2254
|
+
/**
|
|
2255
|
+
* The player's receipts and balance movements, newest first, cursor-paginated.
|
|
2256
|
+
* @example
|
|
2257
|
+
* const page = await igaming.club.listHistory({ limit: 30 })
|
|
2258
|
+
* const next = page.nextCursor && (await igaming.club.listHistory({ cursor: page.nextCursor, limit: 30 }))
|
|
2259
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for a `cursor` that is not text or a `limit` outside
|
|
2260
|
+
* 1–100; `UNAUTHENTICATED` without a session.
|
|
2261
|
+
*/
|
|
2262
|
+
listHistory(input?: ClubCursorInput, options?: CallOptions): Promise<ClubHistory>;
|
|
2263
|
+
/**
|
|
2264
|
+
* Own and external tournaments, merged and cursor-paginated (gateway default: 50 per page).
|
|
2265
|
+
* @example
|
|
2266
|
+
* const { items, nextCursor } = await igaming.club.listTournaments()
|
|
2267
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for a bad `cursor` or `limit`; `NOT_FOUND` when the
|
|
2268
|
+
* club is not active.
|
|
2269
|
+
*/
|
|
2270
|
+
listTournaments(input?: ClubCursorInput, options?: CallOptions): Promise<ClubTournamentPage>;
|
|
2271
|
+
/**
|
|
2272
|
+
* Other editions of the same external schedule as `editionId` (the gateway caps the page at 20). A page that
|
|
2273
|
+
* answers for another edition is read as empty.
|
|
2274
|
+
* @example
|
|
2275
|
+
* const { items } = await igaming.club.listRelatedTournaments({ editionId: 'ext_tlt_123', limit: 10 })
|
|
2276
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for an `editionId` that is not an external edition id,
|
|
2277
|
+
* or a bad `cursor`/`limit`; `NOT_FOUND` for an unknown edition.
|
|
2278
|
+
*/
|
|
2279
|
+
listRelatedTournaments(input: ListRelatedClubTournamentsInput, options?: CallOptions): Promise<ClubRelatedTournamentPage>;
|
|
2280
|
+
/**
|
|
2281
|
+
* A tournament's detail, with the player's registration and award.
|
|
2282
|
+
* @example
|
|
2283
|
+
* const tournament = await igaming.club.getTournament({ editionId })
|
|
2284
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for an empty `editionId` or one over 128 UTF-8 bytes;
|
|
2285
|
+
* `NOT_FOUND` for an unknown edition.
|
|
2286
|
+
*/
|
|
2287
|
+
getTournament(input: {
|
|
2288
|
+
editionId: string;
|
|
2289
|
+
}, options?: CallOptions): Promise<ClubTournament>;
|
|
2290
|
+
/**
|
|
2291
|
+
* A tournament's ranking.
|
|
2292
|
+
* @example
|
|
2293
|
+
* const ranking = await igaming.club.getRanking({ editionId, limit: 20 })
|
|
2294
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for a bad `editionId` or `limit`;
|
|
2295
|
+
* `CLUB_RANKING_UNAVAILABLE` (404) when the source cannot disclose it.
|
|
2296
|
+
*/
|
|
2297
|
+
getRanking(input: GetClubRankingInput, options?: CallOptions): Promise<ClubRanking>;
|
|
2298
|
+
/**
|
|
2299
|
+
* Joins the club (accepting the terms shown in `termsLocale`) or leaves it. Idempotent (see {@link ClubApi}).
|
|
2300
|
+
* @example
|
|
2301
|
+
* const program = await igaming.club.setMembership({ versionId, joined: true, termsLocale })
|
|
2302
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for an empty `versionId`, a `joined` that is not a
|
|
2303
|
+
* boolean, an empty `termsLocale` when joining or a bad `idempotencyKey`; `ALREADY_EXISTS` (409) for a stale
|
|
2304
|
+
* version.
|
|
2305
|
+
*/
|
|
2306
|
+
setMembership(input: SetClubMembershipInput, options?: CallOptions): Promise<ClubProgram>;
|
|
2307
|
+
/**
|
|
2308
|
+
* Plays an activity, or opens a mission chest (`activityId` = `rightId`, `optionId` = the chosen option).
|
|
2309
|
+
* Idempotent (see {@link ClubApi}).
|
|
2310
|
+
* @example
|
|
2311
|
+
* const { receipt, sliceId } = await igaming.club.play({ activityId, versionId }, { idempotencyKey })
|
|
2312
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for an empty `activityId`/`versionId`, a non-text
|
|
2313
|
+
* `optionId` or a bad `idempotencyKey`; `ALREADY_EXISTS` (409) when it cannot be played now.
|
|
2314
|
+
*/
|
|
2315
|
+
play(input: PlayClubActivityInput, options?: CallOptions): Promise<ClubPlayResult>;
|
|
2316
|
+
/**
|
|
2317
|
+
* Redeems a store item with coins. Idempotent (see {@link ClubApi}).
|
|
2318
|
+
* @example
|
|
2319
|
+
* const receipt = await igaming.club.redeem({ rewardId: item.id, versionId }, { idempotencyKey })
|
|
2320
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for an empty `rewardId`/`versionId` or a bad
|
|
2321
|
+
* `idempotencyKey`; `ALREADY_EXISTS` (409) without enough coins or stock.
|
|
2322
|
+
*/
|
|
2323
|
+
redeem(input: RedeemClubRewardInput, options?: CallOptions): Promise<ClubReceipt>;
|
|
2324
|
+
/**
|
|
2325
|
+
* Registers the player in an own tournament. Idempotent (see {@link ClubApi}).
|
|
2326
|
+
* @example
|
|
2327
|
+
* const registration = await igaming.club.registerForTournament({ editionId, versionId: t.versionId })
|
|
2328
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (no request) for an empty `editionId`/`versionId`, a non-text
|
|
2329
|
+
* `ticketId` or a bad `idempotencyKey`; `ALREADY_EXISTS` (409) when registration is closed.
|
|
2330
|
+
*/
|
|
2331
|
+
registerForTournament(input: RegisterClubTournamentInput, options?: CallOptions): Promise<ClubTournamentRegistration>;
|
|
2332
|
+
}
|
|
2333
|
+
/**
|
|
2334
|
+
* Whether a failed club write must keep its `Idempotency-Key` for the retry. The club service stores the key and
|
|
2335
|
+
* answers a duplicate that is still being processed with a plain 409, the same answer as a stale version: releasing
|
|
2336
|
+
* the key after it would let the next tap pay twice. So the key is kept after everything except a definitive
|
|
2337
|
+
* refusal (400, 403, 404, 422) or an error that never reached the club (`CONFIGURATION_ERROR`, `ABORTED`): network
|
|
2338
|
+
* errors, timeouts, 5xx, 401, 409, 429 and a 2xx outside the format all keep it. `createIgamingMutations` applies it
|
|
2339
|
+
* to the `club` writes; use it where the app keeps its own key (e.g. one per action, persisted across a reload).
|
|
2340
|
+
* @param error - What the write rejected with.
|
|
2341
|
+
* @example
|
|
2342
|
+
* try {
|
|
2343
|
+
* await igaming.club.redeem({ rewardId, versionId }, { idempotencyKey: pendingKey })
|
|
2344
|
+
* forget(pendingKey)
|
|
2345
|
+
* } catch (error) {
|
|
2346
|
+
* if (!keepsClubIdempotencyKey(error)) forget(pendingKey)
|
|
2347
|
+
* throw error
|
|
2348
|
+
* }
|
|
2349
|
+
* @throws Never throws: anything that is not an `EnginexError` returns `false`.
|
|
2350
|
+
* @category Club
|
|
2351
|
+
*/
|
|
2352
|
+
declare function keepsClubIdempotencyKey(error: unknown): boolean;
|
|
2353
|
+
|
|
1610
2354
|
/**
|
|
1611
2355
|
* Type of points redemption. The `bonus.proto` mentions `bonus`, `cash` and `free_bet`, but the backend
|
|
1612
2356
|
* treats the field as free text and the contract does not say which ones the operator enables: the SDK sends the value
|
|
@@ -1647,6 +2391,63 @@ interface LoyaltyStatus {
|
|
|
1647
2391
|
tierBenefits: LoyaltyTierBenefits | null;
|
|
1648
2392
|
/** When the tier expires (ISO 8601, UTC); `null` when the gateway does not send it. */
|
|
1649
2393
|
tierExpiresAt: string | null;
|
|
2394
|
+
/**
|
|
2395
|
+
* Whether the VIP points area exists for this player (the program is active or the player has points
|
|
2396
|
+
* history). Show the VIP page only on `true`. `null` when the gateway does not send the program (an older
|
|
2397
|
+
* bonus service): treat it as unknown, not as `false`.
|
|
2398
|
+
*/
|
|
2399
|
+
available: boolean | null;
|
|
2400
|
+
/** Whether the operator's loyalty program is active; `null` when the gateway does not send the program. */
|
|
2401
|
+
programActive: boolean | null;
|
|
2402
|
+
/** Whether the player has points or redemption history; `null` when the gateway does not send the program. */
|
|
2403
|
+
historyAvailable: boolean | null;
|
|
2404
|
+
/**
|
|
2405
|
+
* Whether the player can start a redemption now: the program is active, the balance reaches the minimum and
|
|
2406
|
+
* the gateway confirmed the payout currency of the player's wallet. `false` while a redemption is pending.
|
|
2407
|
+
* The gateway only sends `true` together with {@link LoyaltyStatus.redemptionCurrency} and
|
|
2408
|
+
* {@link LoyaltyStatus.redemptionDecimalPlaces}; check them before showing a value. `null` when the
|
|
2409
|
+
* gateway does not send the program.
|
|
2410
|
+
*/
|
|
2411
|
+
canRedeem: boolean | null;
|
|
2412
|
+
/** Minimum points per redemption (integer ≥ 0; `0` means no minimum besides 1); `null` when absent. */
|
|
2413
|
+
minRedemption: number | null;
|
|
2414
|
+
/**
|
|
2415
|
+
* Value of one point in minor units of {@link LoyaltyStatus.redemptionCurrency} (the contract field is called
|
|
2416
|
+
* `point_value_cents`), never negative; `null` when absent and, in `validation: 'warn'`, when malformed (a
|
|
2417
|
+
* negative, a fraction, ≥ 2^53: reported, never rounded; treat the redemption as unavailable). Preview a redemption as
|
|
2418
|
+
* `points × pointValue` (use `BigInt` if the product can pass `Number.MAX_SAFE_INTEGER`).
|
|
2419
|
+
*/
|
|
2420
|
+
pointValue: number | null;
|
|
2421
|
+
/** ISO 4217 code of the redemption payout (e.g. `BRL`); only comes with `canRedeem: true`, otherwise `null`. */
|
|
2422
|
+
redemptionCurrency: string | null;
|
|
2423
|
+
/**
|
|
2424
|
+
* Decimal places of {@link LoyaltyStatus.pointValue} as the gateway resolved them for
|
|
2425
|
+
* {@link LoyaltyStatus.redemptionCurrency} (an integer from 0 to 8, the platform's minor-unit scale); only comes
|
|
2426
|
+
* with `canRedeem: true`, otherwise `null`.
|
|
2427
|
+
*/
|
|
2428
|
+
redemptionDecimalPlaces: number | null;
|
|
2429
|
+
/**
|
|
2430
|
+
* A redemption the service started and has not settled yet; `null` when there is none. While it exists,
|
|
2431
|
+
* `canRedeem` is `false`: resume it with {@link LoyaltyApi.redeem} and `options.idempotencyKey` set to
|
|
2432
|
+
* its `idempotencyKey` instead of starting another.
|
|
2433
|
+
*/
|
|
2434
|
+
pendingRedemption: PendingLoyaltyRedemption | null;
|
|
2435
|
+
}
|
|
2436
|
+
/**
|
|
2437
|
+
* A pending points redemption ({@link LoyaltyStatus.pendingRedemption}).
|
|
2438
|
+
* @category Loyalty
|
|
2439
|
+
*/
|
|
2440
|
+
interface PendingLoyaltyRedemption {
|
|
2441
|
+
/** Idempotency key of the redemption command; `null` when the gateway sends it empty. */
|
|
2442
|
+
idempotencyKey: string | null;
|
|
2443
|
+
/** Points being redeemed (integer ≥ 0). */
|
|
2444
|
+
points: number;
|
|
2445
|
+
/**
|
|
2446
|
+
* ISO 4217-shaped code of the payout, as the bonus service recorded it; `null` when empty or absent. It is not
|
|
2447
|
+
* money (no amount comes with it), so a malformed code follows the normal rule: `VALIDATION_ERROR` in
|
|
2448
|
+
* `validation: 'strict'`, `null` (reported) in `'warn'`, never the whole page.
|
|
2449
|
+
*/
|
|
2450
|
+
currency: string | null;
|
|
1650
2451
|
}
|
|
1651
2452
|
/**
|
|
1652
2453
|
* Input of {@link LoyaltyApi.redeem}.
|
|
@@ -1665,10 +2466,19 @@ interface RedeemPointsInput {
|
|
|
1665
2466
|
interface RedeemedPoints {
|
|
1666
2467
|
/** Points actually redeemed (integer). */
|
|
1667
2468
|
redeemedPoints: number;
|
|
1668
|
-
/**
|
|
2469
|
+
/**
|
|
2470
|
+
* Redemption value in minor units of `currency`, never negative; `null` when the gateway does not send it. Read
|
|
2471
|
+
* from the exact int64 text `value_minor` when the gateway sends it (the JSON number `value` is only the fallback
|
|
2472
|
+
* of an older gateway); a value ≥ 2^53 rejects the response instead of being rounded.
|
|
2473
|
+
*/
|
|
1669
2474
|
value: number | null;
|
|
1670
2475
|
/** Currency of `value`; `null` when absent. */
|
|
1671
2476
|
currency: string | null;
|
|
2477
|
+
/**
|
|
2478
|
+
* Decimal places of `value` as the gateway resolved them for `currency` (an integer from 0 to 8, the platform's
|
|
2479
|
+
* minor-unit scale); `null` when the gateway does not send them (no value, or a currency it does not know).
|
|
2480
|
+
*/
|
|
2481
|
+
currencyDecimalPlaces: number | null;
|
|
1672
2482
|
/** Id of the bonus generated, when the redemption was into a bonus; `null` otherwise. */
|
|
1673
2483
|
bonusId: string | null;
|
|
1674
2484
|
}
|
|
@@ -1682,15 +2492,24 @@ interface LoyaltyApi {
|
|
|
1682
2492
|
* @example
|
|
1683
2493
|
* const loyalty = await igaming.loyalty.get()
|
|
1684
2494
|
* console.log(loyalty.currentPoints, loyalty.currentTier, loyalty.tierBenefits)
|
|
1685
|
-
* @
|
|
1686
|
-
*
|
|
2495
|
+
* @example
|
|
2496
|
+
* const vip = await igaming.loyalty.get()
|
|
2497
|
+
* if (vip.available !== true) return showUnavailable()
|
|
2498
|
+
* if (vip.canRedeem && vip.redemptionCurrency && vip.redemptionDecimalPlaces !== null && vip.pointValue)
|
|
2499
|
+
* showPreview(BigInt(points) * BigInt(vip.pointValue), vip.redemptionCurrency, vip.redemptionDecimalPlaces)
|
|
2500
|
+
* @throws {EnginexError} `UNAUTHENTICATED` without a session. `VALIDATION_ERROR`, in every validation mode, for
|
|
2501
|
+
* a malformed `redemption_currency` or `redemption_decimal_places` (the payout currency is strict). With
|
|
2502
|
+
* `validation: 'strict'`, also `VALIDATION_ERROR` if `tier_benefits_json` is neither a JSON object nor a JSON
|
|
2503
|
+
* array or another field is malformed (in `'warn'`, a malformed program flag, minimum, point value, pending
|
|
2504
|
+
* redemption or pending redemption currency becomes `null` and is reported).
|
|
1687
2505
|
*/
|
|
1688
2506
|
get(params?: NoParams, options?: CallOptions): Promise<LoyaltyStatus>;
|
|
1689
2507
|
/**
|
|
1690
2508
|
* Exchanges points for a bonus, cash or a free bet. It sends `Idempotency-Key` (generated per call
|
|
1691
|
-
* or the one in `options.idempotencyKey`, kept on the retry after renewing the session)
|
|
1692
|
-
*
|
|
1693
|
-
*
|
|
2509
|
+
* or the one in `options.idempotencyKey`, kept on the retry after renewing the session). The gateway forwards it to
|
|
2510
|
+
* the bonus service, which reserves the redemption by that key: a retry with the same key resumes it (as for
|
|
2511
|
+
* {@link LoyaltyStatus.pendingRedemption}) instead of redeeming again. The service only accepts a UUID (another key
|
|
2512
|
+
* is refused with `INVALID_ARGUMENT`). Two separate clicks are two keys: lock the button until the call finishes.
|
|
1694
2513
|
* @example
|
|
1695
2514
|
* const result = await igaming.loyalty.redeem({ points: 500, redemptionType: 'bonus' })
|
|
1696
2515
|
* console.log(result.redeemedPoints, result.bonusId)
|
|
@@ -1700,7 +2519,10 @@ interface LoyaltyApi {
|
|
|
1700
2519
|
* answers without confirming the redemption (`success: false`, absent or malformed; it also applies in
|
|
1701
2520
|
* `validation: 'warn'`; `message` is the gateway's when it comes, otherwise the SDK's). General rule:
|
|
1702
2521
|
* `UNKNOWN` with a 2xx `status` = unconfirmed operation: re-read the state ({@link LoyaltyApi.get})
|
|
1703
|
-
* before trying again. `
|
|
2522
|
+
* before trying again. `VALIDATION_ERROR`, in every validation mode, when the value or its currency is malformed
|
|
2523
|
+
* (`value_minor` that is not canonical int64 text or is ≥ 2^53, a negative value, `value` and `value_minor`
|
|
2524
|
+
* that disagree, a currency that is not an ISO 4217 code or decimal places outside 0–8): the redemption may have
|
|
2525
|
+
* happened, so re-read {@link LoyaltyApi.get} too. `UNAUTHENTICATED` without a session.
|
|
1704
2526
|
*/
|
|
1705
2527
|
redeem(input: RedeemPointsInput, options?: CallOptions): Promise<RedeemedPoints>;
|
|
1706
2528
|
}
|
|
@@ -1791,6 +2613,56 @@ interface UserMission {
|
|
|
1791
2613
|
periodEnd: string | null;
|
|
1792
2614
|
/** When it was completed (ISO 8601, UTC); `null` while not completed. */
|
|
1793
2615
|
completedAt: string | null;
|
|
2616
|
+
/**
|
|
2617
|
+
* When the reward was claimed (ISO 8601, UTC); `null` when the gateway does not send it. Only on
|
|
2618
|
+
* {@link MissionsApi.getMine} entries (absent from `listMine`), sent with `includeHistory: true`.
|
|
2619
|
+
*/
|
|
2620
|
+
claimedAt?: string | null;
|
|
2621
|
+
/**
|
|
2622
|
+
* Whether the mission is still offered (`true`) or is a past record of the player (`false`). Only
|
|
2623
|
+
* {@link MissionsApi.getMine} with `includeHistory: true` sends it; otherwise `null` (absent from `listMine`). An offer the player has not
|
|
2624
|
+
* progressed on yet comes with `id: ''`.
|
|
2625
|
+
*/
|
|
2626
|
+
offerActive?: boolean | null;
|
|
2627
|
+
/** Description of the mission; `null` when empty or absent (only sent with `includeHistory: true`). */
|
|
2628
|
+
description?: string | null;
|
|
2629
|
+
/** Periodicity; `null` when absent (only sent with `includeHistory: true`). */
|
|
2630
|
+
missionType?: MissionType | null;
|
|
2631
|
+
/** Objective; `null` when absent (only sent with `includeHistory: true`). */
|
|
2632
|
+
objectiveType?: MissionObjectiveType | null;
|
|
2633
|
+
/**
|
|
2634
|
+
* Slug of the game category that counts toward the target; `null` when there is no restriction or the gateway
|
|
2635
|
+
* does not send it (only sent with `includeHistory: true`).
|
|
2636
|
+
*/
|
|
2637
|
+
targetGameCategory?: string | null;
|
|
2638
|
+
}
|
|
2639
|
+
/**
|
|
2640
|
+
* Input of {@link MissionsApi.getMine}.
|
|
2641
|
+
* @category Missions
|
|
2642
|
+
*/
|
|
2643
|
+
interface GetMyMissionsInput {
|
|
2644
|
+
/**
|
|
2645
|
+
* Also return the player's past missions (completed, claimed or expired, with `offerActive: false`) and the
|
|
2646
|
+
* availability flags. Default `false` (only the active missions; the flags come as `null`).
|
|
2647
|
+
*/
|
|
2648
|
+
includeHistory?: boolean;
|
|
2649
|
+
}
|
|
2650
|
+
/**
|
|
2651
|
+
* Result of {@link MissionsApi.getMine}: the player's missions and the availability of the area.
|
|
2652
|
+
* @category Missions
|
|
2653
|
+
*/
|
|
2654
|
+
interface MyMissions {
|
|
2655
|
+
/** The player's missions (the active ones and, with `includeHistory: true`, the past ones). */
|
|
2656
|
+
missions: UserMission[];
|
|
2657
|
+
/**
|
|
2658
|
+
* Whether the missions area exists for this player (there are offers or history). `null` when the gateway did not
|
|
2659
|
+
* answer with the flags (without `includeHistory: true`, or with an older bonus service): unknown, not `false`.
|
|
2660
|
+
*/
|
|
2661
|
+
available: boolean | null;
|
|
2662
|
+
/** Whether the operator offers active missions; `null` as in {@link MyMissions.available}. */
|
|
2663
|
+
offersAvailable: boolean | null;
|
|
2664
|
+
/** Whether the player has mission history; `null` as in {@link MyMissions.available}. */
|
|
2665
|
+
historyAvailable: boolean | null;
|
|
1794
2666
|
}
|
|
1795
2667
|
/**
|
|
1796
2668
|
* Input of {@link MissionsApi.list}.
|
|
@@ -1825,6 +2697,19 @@ interface MissionsApi {
|
|
|
1825
2697
|
* @throws {EnginexError} `UNAUTHENTICATED` without a session.
|
|
1826
2698
|
*/
|
|
1827
2699
|
listMine(params?: NoParams, options?: CallOptions): Promise<UserMission[]>;
|
|
2700
|
+
/**
|
|
2701
|
+
* The player's missions with the availability flags of the area. With `includeHistory: true` it also returns
|
|
2702
|
+
* the past missions and `available`, `offersAvailable` and `historyAvailable`; without it, the same list as
|
|
2703
|
+
* {@link MissionsApi.listMine} and the flags as `null`.
|
|
2704
|
+
* @example
|
|
2705
|
+
* const { missions, available, offersAvailable } = await igaming.missions.getMine({ includeHistory: true })
|
|
2706
|
+
* if (available !== true) return showUnavailable()
|
|
2707
|
+
* const past = missions.filter((m) => m.offerActive === false)
|
|
2708
|
+
* @throws {EnginexError} `CONFIGURATION_ERROR` (without a request) when the input is not an object or
|
|
2709
|
+
* `includeHistory` is not a boolean; `UNAUTHENTICATED` without a session. With `validation: 'strict'`,
|
|
2710
|
+
* `VALIDATION_ERROR` for a malformed response (in `'warn'`, a malformed flag becomes `null` and is reported).
|
|
2711
|
+
*/
|
|
2712
|
+
getMine(input?: GetMyMissionsInput, options?: CallOptions): Promise<MyMissions>;
|
|
1828
2713
|
}
|
|
1829
2714
|
|
|
1830
2715
|
/**
|
|
@@ -2057,6 +2942,8 @@ interface SportsbookApi {
|
|
|
2057
2942
|
interface IgamingClient {
|
|
2058
2943
|
/** Catalog, game launch and casino history. */
|
|
2059
2944
|
casino: CasinoApi;
|
|
2945
|
+
/** Casino club: program, activities, missions with chests, coin store, history and tournaments. */
|
|
2946
|
+
club: ClubApi;
|
|
2060
2947
|
/** Bonus campaigns (offers, opt-in, redemption) and promo codes. */
|
|
2061
2948
|
bonus: BonusApi;
|
|
2062
2949
|
/** Operator missions and the player's progress. */
|
|
@@ -2092,4 +2979,4 @@ interface IgamingClient {
|
|
|
2092
2979
|
*/
|
|
2093
2980
|
declare function createIgaming(client: EnginexClient): IgamingClient;
|
|
2094
2981
|
|
|
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 };
|
|
2982
|
+
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 ClubActivityKind, type ClubActivityState, type ClubAlternateReward, type ClubApi, type ClubCashbackTerms, type ClubCursorInput, type ClubHistory, type ClubLevel, type ClubLocalized, type ClubMissionState, type ClubMoney, type ClubMovement, type ClubOverview, type ClubPlayResult, type ClubProgram, type ClubRank, type ClubRanking, type ClubReceipt, type ClubReceiptStatus, type ClubRelatedTournament, type ClubRelatedTournamentPage, type ClubReward, type ClubRewardKind, type ClubRewards, type ClubStoreItemState, type ClubTournament, type ClubTournamentPage, type ClubTournamentPrize, type ClubTournamentRegistration, type ClubTournamentStatus, type DepositSettledQualification, type Game, type GameCategory, type GameDevice, type GameLaunch, type GameProvider, type GameSession, type GameSessionStatus, type GameSort, type GamesPage, type GetBiggestWinnersInput, type GetClubRankingInput, type GetMyMissionsInput, 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 ListRelatedClubTournamentsInput, type LoyaltyApi, type LoyaltyStatus, type LoyaltyTierBenefits, type Mission, type MissionObjectiveType, type MissionRewardType, type MissionType, type MissionsApi, type MyMissions, type OptInInput, type PendingLoyaltyRedemption, type PlayClubActivityInput, type PromoCodeOffer, type RedeemClubRewardInput, 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 RegisterClubTournamentInput, type SetClubMembershipInput, type SportsActivitySelector, type SportsBetCoverageReward, type SportsBetType, type SportsBonusBetReward, type SportsbookApi, type SportsbookSession, type UserEventQualification, type UserMission, type UserMissionStatus, createIgaming, keepsClubIdempotencyKey };
|