@opexa/portal-components 0.0.100 → 0.0.101

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.
Files changed (130) hide show
  1. package/dist/client/hooks/index.d.ts +65 -0
  2. package/dist/client/hooks/index.js +65 -0
  3. package/dist/client/services/index.d.ts +4 -0
  4. package/dist/client/services/index.js +4 -0
  5. package/dist/client/utils/index.d.ts +3 -0
  6. package/dist/client/utils/index.js +3 -0
  7. package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +2 -0
  8. package/dist/components/CashbackBonus/CashbackBonus.client.js +9 -0
  9. package/dist/components/CashbackBonus/CashbackBonus.d.ts +10 -0
  10. package/dist/components/CashbackBonus/CashbackBonus.js +5 -0
  11. package/dist/components/CashbackBonus/index.d.ts +1 -0
  12. package/dist/components/CashbackBonus/index.js +1 -0
  13. package/dist/components/Games/GameContext.d.ts +2 -0
  14. package/dist/components/Games/GameContext.js +2 -0
  15. package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +2 -0
  16. package/dist/components/JackpotCounter/JackpotCounter.client.js +66 -0
  17. package/dist/components/JackpotCounter/JackpotCounter.d.ts +17 -0
  18. package/dist/components/JackpotCounter/JackpotCounter.js +21 -0
  19. package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +18 -0
  20. package/dist/components/JackpotCounter/JackpotCounterItem.js +109 -0
  21. package/dist/components/JackpotCounter/JackpotCounterItem.module.css +184 -0
  22. package/dist/components/JackpotCounter/index.d.ts +1 -0
  23. package/dist/components/JackpotCounter/index.js +1 -0
  24. package/dist/components/Jackpots/JackpotDesktop.d.ts +1 -0
  25. package/dist/components/Jackpots/JackpotDesktop.js +45 -0
  26. package/dist/components/Jackpots/JackpotGameProviders.d.ts +5 -0
  27. package/dist/components/Jackpots/JackpotGameProviders.js +41 -0
  28. package/dist/components/Jackpots/JackpotItemDesktop.d.ts +9 -0
  29. package/dist/components/Jackpots/JackpotItemDesktop.js +43 -0
  30. package/dist/components/Jackpots/JackpotItemMobile.d.ts +9 -0
  31. package/dist/components/Jackpots/JackpotItemMobile.js +44 -0
  32. package/dist/components/Jackpots/JackpotMobile.d.ts +1 -0
  33. package/dist/components/Jackpots/JackpotMobile.js +46 -0
  34. package/dist/components/Jackpots/JackpotRules.d.ts +5 -0
  35. package/dist/components/Jackpots/JackpotRules.js +11 -0
  36. package/dist/components/Jackpots/Jackpots.client.d.ts +2 -0
  37. package/dist/components/Jackpots/Jackpots.client.js +29 -0
  38. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +5 -6
  39. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
  40. package/dist/components/Jackpots/JackpotsContext.d.ts +4 -0
  41. package/dist/components/Jackpots/JackpotsContext.js +3 -0
  42. package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +3 -1
  43. package/dist/components/Jackpots/JackpotsList/JackpotsList.js +7 -7
  44. package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
  45. package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +6 -7
  46. package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +8 -2
  47. package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +4 -5
  48. package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.d.ts +0 -4
  49. package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.js +0 -23
  50. package/dist/components/Jackpots/useJackpotData.d.ts +14 -0
  51. package/dist/components/Jackpots/useJackpotData.js +93 -0
  52. package/dist/components/Jackpots/useJackpotItemData.d.ts +20 -0
  53. package/dist/components/Jackpots/useJackpotItemData.js +87 -0
  54. package/dist/components/Messages/MessageItem.d.ts +4 -0
  55. package/dist/components/Messages/MessageItem.js +34 -0
  56. package/dist/components/PortalProvider/WebVitals.d.ts +1 -0
  57. package/dist/components/PortalProvider/WebVitals.js +8 -0
  58. package/dist/components/Promo/PromoContent.d.ts +2 -0
  59. package/dist/components/Promo/PromoContent.js +9 -0
  60. package/dist/components/Promos/PromoCarousel.d.ts +2 -0
  61. package/dist/components/Promos/PromoCarousel.js +41 -0
  62. package/dist/components/Promos/PromoGrid.d.ts +2 -0
  63. package/dist/components/Promos/PromoGrid.js +12 -0
  64. package/dist/components/Promos/PromoItem.d.ts +7 -0
  65. package/dist/components/Promos/PromoItem.js +10 -0
  66. package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +2 -0
  67. package/dist/components/TournamentCounter/TournamentCounter.client.js +50 -0
  68. package/dist/components/TournamentCounter/TournamentCounter.d.ts +8 -0
  69. package/dist/components/TournamentCounter/TournamentCounter.js +21 -0
  70. package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +8 -0
  71. package/dist/components/TournamentCounter/TournamentCounterItem.js +106 -0
  72. package/dist/components/TournamentCounter/index.d.ts +1 -0
  73. package/dist/components/TournamentCounter/index.js +1 -0
  74. package/dist/components/Tournaments/TournamentDesktop.d.ts +1 -0
  75. package/dist/components/Tournaments/TournamentDesktop.js +57 -0
  76. package/dist/components/Tournaments/TournamentGameProviders.d.ts +5 -0
  77. package/dist/components/Tournaments/TournamentGameProviders.js +38 -0
  78. package/dist/components/Tournaments/TournamentItemDesktop.d.ts +7 -0
  79. package/dist/components/Tournaments/TournamentItemDesktop.js +56 -0
  80. package/dist/components/Tournaments/TournamentItemMobile.d.ts +7 -0
  81. package/dist/components/Tournaments/TournamentItemMobile.js +54 -0
  82. package/dist/components/Tournaments/TournamentMobile.d.ts +1 -0
  83. package/dist/components/Tournaments/TournamentMobile.js +55 -0
  84. package/dist/components/Tournaments/TournamentRules.d.ts +5 -0
  85. package/dist/components/Tournaments/TournamentRules.js +11 -0
  86. package/dist/components/Tournaments/Tournaments.client.d.ts +2 -0
  87. package/dist/components/Tournaments/Tournaments.client.js +20 -0
  88. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
  89. package/dist/components/Tournaments/TournamentsContext.d.ts +4 -0
  90. package/dist/components/Tournaments/TournamentsContext.js +3 -0
  91. package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
  92. package/dist/components/Tournaments/useTournamentData.d.ts +10 -0
  93. package/dist/components/Tournaments/useTournamentData.js +72 -0
  94. package/dist/components/Tournaments/useTournamentItemData.d.ts +16 -0
  95. package/dist/components/Tournaments/useTournamentItemData.js +64 -0
  96. package/dist/components/index.d.ts +33 -0
  97. package/dist/components/index.js +33 -0
  98. package/dist/icons/index.d.ts +65 -0
  99. package/dist/icons/index.js +65 -0
  100. package/dist/images/hacksaw-gaming.png +0 -0
  101. package/dist/next.config.js +4 -0
  102. package/dist/server/services/index.d.ts +4 -0
  103. package/dist/server/services/index.js +4 -0
  104. package/dist/server/utils/index.d.ts +29 -0
  105. package/dist/server/utils/index.js +29 -0
  106. package/dist/services/queries.js +2351 -2351
  107. package/dist/styles/theme.css +697 -697
  108. package/dist/ui/index.d.ts +26 -0
  109. package/dist/ui/index.js +26 -0
  110. package/dist/utils/index.d.ts +17 -0
  111. package/dist/utils/index.js +17 -0
  112. package/package.json +162 -162
  113. package/dist/services/account.service.d.ts +0 -341
  114. package/dist/services/account.service.js +0 -233
  115. package/dist/services/auth.service.d.ts +0 -80
  116. package/dist/services/auth.service.js +0 -152
  117. package/dist/services/cmsPortal.service.d.ts +0 -43
  118. package/dist/services/cmsPortal.service.js +0 -148
  119. package/dist/services/file.service.d.ts +0 -33
  120. package/dist/services/file.service.js +0 -18
  121. package/dist/services/game.service.d.ts +0 -44
  122. package/dist/services/game.service.js +0 -33
  123. package/dist/services/portal.service.d.ts +0 -37
  124. package/dist/services/portal.service.js +0 -44
  125. package/dist/services/report.service.d.ts +0 -223
  126. package/dist/services/report.service.js +0 -72
  127. package/dist/services/trigger.service.d.ts +0 -94
  128. package/dist/services/trigger.service.js +0 -88
  129. package/dist/services/wallet.service.d.ts +0 -475
  130. package/dist/services/wallet.service.js +0 -365
@@ -1,365 +0,0 @@
1
- import { cache } from 'react';
2
- import { WALLET_GRAPHQL_ENDPOINT } from '../constants/index.js';
3
- import { graphqlRequest } from './graphqlRequest.js';
4
- import { AVAILABLE_PROMOS, BONUS, BONUSES, BONUSES_IDS, CASHBACK, CASHBACK_BONUS, CASHBACK_BONUSES, CASHBACK_BONUSES_IDS, CASHBACKS, CLAIM_CASHBACK_BONUS, CLAIM_SPOT_BONUS, CREATE_AIO_INSTAPAY_WITHDRAWAL, CREATE_AIO_ONLINE_BANK_DEPOSIT, CREATE_AIO_QRPH_DEPOSIT, CREATE_BANK_WITHDRAWAL, CREATE_GAME_SESSION, CREATE_GCASH_DEPOSIT, CREATE_GCASH_DIRECT_WEBPAY_DEPOSIT, CREATE_GCASH_WITHDRAWAL, CREATE_MANUAL_BANK_DEPOSIT, CREATE_MANUAL_BANK_WITHDRAWAL, CREATE_MANUAL_UPI_DEPOSIT, CREATE_MANUAL_UPI_WITHDRAWAL, CREATE_MAYA_APP_DEPOSIT, CREATE_MAYA_APP_WITHDRAWAL, CREATE_MAYA_DEPOSIT, CREATE_MAYA_WITHDRAWAL, CURRENT_BONUS, DEPOSIT, END_GAME_SESSION, FAVORITE_GAMES, GAME_SESSION, INSTAPAY_BANK_LIST, MARK_GAME_AS_FAVORITE, MAYA_SESSION, POINTS_WALLET, PROMO, PROMOS, REDEEM_POINTS_TO_CASH, REMAINING_DAILY_WITHDRAWALS_COUNT, TOUCH_GCASH_DEPOSIT, TOUCH_QRPH_DEPOSIT, UNMARK_GAME_AS_FAVORITE, VALIDATE_MAYA_SESSION, WALLET, } from './queries.js';
5
- import { sha256 } from './sha256.js';
6
- export const getPromos = cache(async (options) => {
7
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, PROMOS, undefined, options);
8
- return res.promos;
9
- });
10
- export const getCashbacks = cache(async (options) => {
11
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACKS, undefined, options);
12
- return res.cashbacks;
13
- });
14
- export const getPromo = cache(async (id, options) => {
15
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, PROMO, { id }, options);
16
- return res.node ?? null;
17
- });
18
- export const getCashback = cache(async (id, options) => {
19
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACK, { id }, options);
20
- return res.node ?? null;
21
- });
22
- export const getAvailablePromos = cache(async (input, options) => {
23
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, AVAILABLE_PROMOS, { filter: { ...input } }, options);
24
- return res.availablePromos;
25
- });
26
- export const getCashbackBonuses = cache(async (options) => {
27
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACK_BONUSES, undefined, options);
28
- return res.cashbackBonuses ?? [];
29
- });
30
- export const getCashbackBonusesCount = cache(async (options) => {
31
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACK_BONUSES_IDS, undefined, options);
32
- return res.cashbackBonuses?.length ?? 0;
33
- });
34
- export const claimCashbackBonus = async (id, options) => {
35
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CLAIM_CASHBACK_BONUS, { input: { id } }, options);
36
- if (res.claimCashbackBonus) {
37
- const error = new Error();
38
- error.name = res.claimCashbackBonus.name;
39
- error.message = res.claimCashbackBonus.message;
40
- Error.captureStackTrace?.(error, claimCashbackBonus);
41
- throw error;
42
- }
43
- };
44
- export const getBonus = cache(async (id, options) => {
45
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, BONUS, { id }, options);
46
- return res.node ?? null;
47
- });
48
- export const getCurrentBonus = cache(async (options) => {
49
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CURRENT_BONUS, undefined, options);
50
- return res.currentBonus ?? null;
51
- });
52
- export const getCashbackBonus = cache(async (id, options) => {
53
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACK_BONUS, { id }, options);
54
- return res.node ?? null;
55
- });
56
- export const getWallet = cache(async (options) => {
57
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, WALLET, undefined, options);
58
- if (!res.wallet)
59
- return null;
60
- return {
61
- balance: res.wallet.balance,
62
- bonus: res.wallet.bonus?.balance ?? null,
63
- };
64
- });
65
- export const getDeposit = cache(async (id, options) => {
66
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, DEPOSIT, { id }, options);
67
- return res.node ?? null;
68
- });
69
- export const createGCashDeposit = async (input, options) => {
70
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_GCASH_DEPOSIT, { input }, options);
71
- if (res.createGCashDeposit) {
72
- const error = new Error();
73
- error.name = res.createGCashDeposit.name;
74
- error.message = res.createGCashDeposit.message;
75
- Error.captureStackTrace?.(error, createGCashDeposit);
76
- throw error;
77
- }
78
- };
79
- export const createGCashDirectWebpayDeposit = async (input, options) => {
80
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_GCASH_DIRECT_WEBPAY_DEPOSIT, { input }, options);
81
- if (res.createGCashDirectWebpayDeposit) {
82
- const error = new Error();
83
- error.name = res.createGCashDirectWebpayDeposit.name;
84
- error.message = res.createGCashDirectWebpayDeposit.message;
85
- Error.captureStackTrace?.(error, createGCashDirectWebpayDeposit);
86
- throw error;
87
- }
88
- };
89
- export const createMayaDeposit = async (input, options) => {
90
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_MAYA_DEPOSIT, { input }, options);
91
- if (res.createMayaDeposit) {
92
- const error = new Error();
93
- error.name = res.createMayaDeposit.name;
94
- error.message = res.createMayaDeposit.message;
95
- Error.captureStackTrace?.(error, createMayaDeposit);
96
- throw error;
97
- }
98
- };
99
- export const createAIOQRPHDeposit = async (input, options) => {
100
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_AIO_QRPH_DEPOSIT, { input }, options);
101
- if (res.createAIOQRPHDeposit) {
102
- const error = new Error();
103
- error.name = res.createAIOQRPHDeposit.name;
104
- error.message = res.createAIOQRPHDeposit.message;
105
- Error.captureStackTrace?.(error, createAIOQRPHDeposit);
106
- throw error;
107
- }
108
- };
109
- export const createAIOOnlineBankDeposit = async (input, options) => {
110
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_AIO_ONLINE_BANK_DEPOSIT, { input }, options);
111
- if (res.createAIOOnlineBankDeposit) {
112
- const error = new Error();
113
- error.name = res.createAIOOnlineBankDeposit.name;
114
- error.message = res.createAIOOnlineBankDeposit.message;
115
- Error.captureStackTrace?.(error, createAIOOnlineBankDeposit);
116
- throw error;
117
- }
118
- };
119
- export const createManualBankDeposit = async (input, options) => {
120
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_MANUAL_BANK_DEPOSIT, { input }, options);
121
- if (res.createManualBankDeposit) {
122
- const error = new Error();
123
- error.name = res.createManualBankDeposit.name;
124
- error.message = res.createManualBankDeposit.message;
125
- Error.captureStackTrace?.(error, createManualBankDeposit);
126
- throw error;
127
- }
128
- };
129
- export const createManualUPIDeposit = async (input, options) => {
130
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_MANUAL_UPI_DEPOSIT, { input }, options);
131
- if (res.createManualUPIDeposit) {
132
- const error = new Error();
133
- error.name = res.createManualUPIDeposit.name;
134
- error.message = res.createManualUPIDeposit.message;
135
- Error.captureStackTrace?.(error, createManualUPIDeposit);
136
- throw error;
137
- }
138
- };
139
- export const createMayaAppDeposit = async (input, options) => {
140
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_MAYA_APP_DEPOSIT, { input }, options);
141
- if (res.createMayaAppDeposit) {
142
- const error = new Error();
143
- error.name = res.createMayaAppDeposit.name;
144
- error.message = res.createMayaAppDeposit.message;
145
- Error.captureStackTrace?.(error, createMayaAppDeposit);
146
- throw error;
147
- }
148
- };
149
- export const createGCashWithdrawal = async (input, options) => {
150
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_GCASH_WITHDRAWAL, {
151
- input: {
152
- ...input,
153
- transactionPassword: await sha256(input.transactionPassword),
154
- },
155
- }, options);
156
- if (res.createGCashWithdrawal) {
157
- const error = new Error();
158
- error.name = res.createGCashWithdrawal.name;
159
- error.message = res.createGCashWithdrawal.message;
160
- Error.captureStackTrace?.(error, createGCashWithdrawal);
161
- throw error;
162
- }
163
- };
164
- export const createMayaWithdrawal = async (input, options) => {
165
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_MAYA_WITHDRAWAL, {
166
- input: {
167
- ...input,
168
- transactionPassword: await sha256(input.transactionPassword),
169
- },
170
- }, options);
171
- if (res.createMayaWithdrawal) {
172
- const error = new Error();
173
- error.name = res.createMayaWithdrawal.name;
174
- error.message = res.createMayaWithdrawal.message;
175
- Error.captureStackTrace?.(error, createMayaWithdrawal);
176
- throw error;
177
- }
178
- };
179
- export const createMayaAppWithdrawal = async (input, options) => {
180
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_MAYA_APP_WITHDRAWAL, {
181
- input: {
182
- ...input,
183
- transactionPassword: await sha256(input.transactionPassword),
184
- },
185
- }, options);
186
- if (res.createMayaAppWithdrawal) {
187
- const error = new Error();
188
- error.name = res.createMayaAppWithdrawal.name;
189
- error.message = res.createMayaAppWithdrawal.message;
190
- Error.captureStackTrace?.(error, createMayaAppWithdrawal);
191
- throw error;
192
- }
193
- };
194
- export const createBankWithdrawal = async (input, options) => {
195
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_BANK_WITHDRAWAL, {
196
- input: {
197
- ...input,
198
- transactionPassword: await sha256(input.transactionPassword),
199
- },
200
- }, options);
201
- if (res.createBankWithdrawal) {
202
- const error = new Error();
203
- error.name = res.createBankWithdrawal.name;
204
- error.message = res.createBankWithdrawal.message;
205
- Error.captureStackTrace?.(error, createBankWithdrawal);
206
- throw error;
207
- }
208
- };
209
- export const createAIOInstapayWithdrawal = async (input, options) => {
210
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_AIO_INSTAPAY_WITHDRAWAL, {
211
- input: {
212
- ...input,
213
- transactionPassword: await sha256(input.transactionPassword),
214
- },
215
- }, options);
216
- if (res.createAIOInstapayWithdrawal) {
217
- const error = new Error();
218
- error.name = res.createAIOInstapayWithdrawal.name;
219
- error.message = res.createAIOInstapayWithdrawal.message;
220
- Error.captureStackTrace?.(error, createAIOInstapayWithdrawal);
221
- throw error;
222
- }
223
- };
224
- export const createManualUpiWithdrawal = async (input, options) => {
225
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_MANUAL_UPI_WITHDRAWAL, { input }, options);
226
- if (res.createManualUpiWithdrawal) {
227
- const error = new Error();
228
- error.name = res.createManualUpiWithdrawal.name;
229
- error.message = res.createManualUpiWithdrawal.message;
230
- Error.captureStackTrace?.(error, createManualUpiWithdrawal);
231
- throw error;
232
- }
233
- };
234
- export const createManualBankWithdrawal = async (input, options) => {
235
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_MANUAL_BANK_WITHDRAWAL, { input }, options);
236
- if (res.createManualBankWithdrawal) {
237
- const error = new Error();
238
- error.name = res.createManualBankWithdrawal.name;
239
- error.message = res.createManualBankWithdrawal.message;
240
- Error.captureStackTrace?.(error, createManualBankWithdrawal);
241
- throw error;
242
- }
243
- };
244
- export const getInstapayBankList = cache(async (options) => {
245
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, INSTAPAY_BANK_LIST, undefined, options);
246
- return res.instapayBankList;
247
- });
248
- export const getRemainingDailyWithdrawalsCount = cache(async (options) => {
249
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, REMAINING_DAILY_WITHDRAWALS_COUNT, undefined, options);
250
- return res.remainingDailyWithdrawalsCount;
251
- });
252
- export const getPointsWallet = cache(async (options) => {
253
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, POINTS_WALLET, undefined, options);
254
- return res.pointsWallet ?? null;
255
- });
256
- export const redeemPointsToCash = async (amount, options) => {
257
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, REDEEM_POINTS_TO_CASH, { input: { amount } }, options);
258
- if (res.redeemPointsToCash) {
259
- const error = new Error();
260
- error.name = res.redeemPointsToCash.name;
261
- error.message = res.redeemPointsToCash.message;
262
- Error.captureStackTrace?.(error, redeemPointsToCash);
263
- throw error;
264
- }
265
- };
266
- export const getMayaSession = cache(async (id, options) => {
267
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, MAYA_SESSION, { id }, options);
268
- return res.mayaSession ?? null;
269
- });
270
- export const getGameSession = cache(async (id, options) => {
271
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, GAME_SESSION, { id }, options);
272
- return res.node ?? null;
273
- });
274
- export const createGameSession = async (input, options) => {
275
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_GAME_SESSION, { input }, options);
276
- if (res.createGameSession) {
277
- const error = new Error();
278
- error.name = res.createGameSession.name;
279
- error.message = res.createGameSession.message;
280
- Error.captureStackTrace?.(error, createGameSession);
281
- throw error;
282
- }
283
- };
284
- export const endGameSession = async (id, options) => {
285
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, END_GAME_SESSION, { input: { id } }, options);
286
- if (!res.endGameSession) {
287
- const error = new Error();
288
- error.name = 'UnknownError';
289
- error.message = 'Something went wrong';
290
- Error.captureStackTrace?.(error, endGameSession);
291
- throw error;
292
- }
293
- };
294
- export const validateMayaSession = async (options) => {
295
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, VALIDATE_MAYA_SESSION, undefined, options);
296
- if (!res.validateMayaSession) {
297
- const error = new Error();
298
- error.name = 'UnknownError';
299
- error.message = 'Something went wrong';
300
- Error.captureStackTrace?.(error, validateMayaSession);
301
- throw error;
302
- }
303
- };
304
- export const getBonuses = cache(async (options) => {
305
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, BONUSES, undefined, options);
306
- return res.bonuses ?? [];
307
- });
308
- export const getBonusesCount = cache(async (options) => {
309
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, BONUSES_IDS, undefined, options);
310
- return res.bonuses?.length ?? 0;
311
- });
312
- export const claimSpotBonus = async (code, options) => {
313
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CLAIM_SPOT_BONUS, { code }, options);
314
- if (res.claimSpotBonus) {
315
- const error = new Error();
316
- error.name = res.claimSpotBonus.name;
317
- error.message = res.claimSpotBonus.message;
318
- Error.captureStackTrace?.(error, claimSpotBonus);
319
- throw error;
320
- }
321
- };
322
- export const touchGCashDeposit = async (id, options) => {
323
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, TOUCH_GCASH_DEPOSIT, { input: { id } }, options);
324
- if (!res.touchGCashDeposit) {
325
- const error = new Error();
326
- error.name = 'UnknownError';
327
- error.message = 'Something went wrong';
328
- Error.captureStackTrace?.(error, touchGCashDeposit);
329
- throw error;
330
- }
331
- };
332
- export const touchQRPHDeposit = async (id, options) => {
333
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, TOUCH_QRPH_DEPOSIT, { input: { id } }, options);
334
- if (!res.touchQRPHDeposit) {
335
- const error = new Error();
336
- error.name = 'UnknownError';
337
- error.message = 'Something went wrong';
338
- Error.captureStackTrace?.(error, touchQRPHDeposit);
339
- throw error;
340
- }
341
- };
342
- export const markGameAsFavorite = async (id, options) => {
343
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, MARK_GAME_AS_FAVORITE, { input: { id } }, options);
344
- if (!res.markGameAsFavorite) {
345
- const error = new Error();
346
- error.name = 'UnknownError';
347
- error.message = 'Something went wrong';
348
- Error.captureStackTrace?.(error, markGameAsFavorite);
349
- throw error;
350
- }
351
- };
352
- export const unmarkGameAsFavorite = async (id, options) => {
353
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, UNMARK_GAME_AS_FAVORITE, { input: { id } }, options);
354
- if (!res.unmarkGameAsFavorite) {
355
- const error = new Error();
356
- error.name = 'UnknownError';
357
- error.message = 'Something went wrong';
358
- Error.captureStackTrace?.(error, unmarkGameAsFavorite);
359
- throw error;
360
- }
361
- };
362
- export const getFavoriteGames = cache(async (options) => {
363
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, FAVORITE_GAMES, undefined, options);
364
- return res.favoriteGames;
365
- });