@opexa/portal-components 0.0.123 → 0.0.125

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 (70) hide show
  1. package/dist/components/BetRecords/BetRecords.client.d.ts +13 -0
  2. package/dist/components/BetRecords/BetRecords.client.js +9 -1
  3. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
  4. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
  5. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
  6. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
  7. package/dist/components/FavoriteGames/FavoriteGames.client.d.ts +7 -1
  8. package/dist/components/FavoriteGames/FavoriteGames.client.js +24 -5
  9. package/dist/components/ForgotPassword/ForgotPasswordForm.js +14 -7
  10. package/dist/components/GameLaunch/GameLaunch.lazy.js +25 -2
  11. package/dist/components/Games/Game.js +25 -2
  12. package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +12 -1
  13. package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +14 -7
  14. package/dist/components/KYC/CaptureSelfie.js +5 -3
  15. package/dist/components/SignIn/MobileNumberSignIn.js +14 -6
  16. package/dist/components/SignIn/NameAndPasswordSignIn.js +1 -1
  17. package/dist/components/SignUp/SignUpForm.js +21 -10
  18. package/dist/components/Tournaments/TournamentsList/TournamentsList.d.ts +12 -1
  19. package/dist/components/Tournaments/TournamentsList/TournamentsListItemGameProviders.js +11 -1
  20. package/dist/components/TransactionRecords/DepositRecordsTable.js +29 -17
  21. package/dist/components/TransactionRecords/TableFilters.d.ts +5 -1
  22. package/dist/components/TransactionRecords/TableFilters.js +105 -31
  23. package/dist/components/TransactionRecords/TransactionRecordsTable.js +21 -9
  24. package/dist/components/TransactionRecords/WithdrawalRecordsTable.js +29 -17
  25. package/dist/services/queries.d.ts +5 -5
  26. package/dist/services/queries.js +13 -18
  27. package/dist/services/trigger.js +2 -2
  28. package/dist/services/wallet.d.ts +7 -6
  29. package/dist/services/wallet.js +14 -12
  30. package/dist/ui/AlertDialog/AlertDialog.d.ts +121 -121
  31. package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
  32. package/dist/ui/Avatar/Avatar.d.ts +9 -9
  33. package/dist/ui/Avatar/avatar.recipe.d.ts +3 -3
  34. package/dist/ui/Badge/Badge.d.ts +12 -12
  35. package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
  36. package/dist/ui/Badge/badge.recipe.d.ts +3 -3
  37. package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
  38. package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
  39. package/dist/ui/Collapsible/Collapsible.d.ts +32 -32
  40. package/dist/ui/Collapsible/collapsible.recipe.d.ts +8 -8
  41. package/dist/ui/Combobox/Combobox.d.ts +42 -42
  42. package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
  43. package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
  44. package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
  45. package/dist/ui/Dialog/Dialog.d.ts +121 -121
  46. package/dist/ui/Dialog/dialog.recipe.d.ts +11 -11
  47. package/dist/ui/Drawer/Drawer.d.ts +33 -33
  48. package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
  49. package/dist/ui/Field/Field.d.ts +21 -21
  50. package/dist/ui/Field/field.recipe.d.ts +3 -3
  51. package/dist/ui/Menu/Menu.d.ts +252 -252
  52. package/dist/ui/Menu/menu.recipe.d.ts +14 -14
  53. package/dist/ui/NumberInput/NumberInput.d.ts +24 -24
  54. package/dist/ui/NumberInput/numberInput.recipe.d.ts +3 -3
  55. package/dist/ui/Popover/Popover.d.ts +121 -121
  56. package/dist/ui/Popover/popover.recipe.d.ts +11 -11
  57. package/dist/ui/Progress/Progress.d.ts +27 -27
  58. package/dist/ui/Progress/progress.recipe.d.ts +3 -3
  59. package/dist/ui/QrCode/QrCode.d.ts +25 -25
  60. package/dist/ui/QrCode/qrCode.recipe.d.ts +5 -5
  61. package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
  62. package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
  63. package/dist/ui/Select/Select.d.ts +45 -45
  64. package/dist/ui/Select/select.recipe.d.ts +3 -3
  65. package/dist/ui/Table/Table.d.ts +21 -21
  66. package/dist/ui/Table/table.anatomy.d.ts +1 -1
  67. package/dist/ui/Table/table.recipe.d.ts +3 -3
  68. package/dist/ui/Tabs/Tabs.d.ts +15 -15
  69. package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
  70. package/package.json +1 -1
@@ -1,7 +1,8 @@
1
1
  import { cache } from 'react';
2
2
  import { WALLET_GRAPHQL_ENDPOINT } from '../constants/index.js';
3
+ import { parseDecimal } from '../utils/parseDecimal.js';
3
4
  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 { AVAILABLE_PROMOS, BONUS, BONUS_BALANCES, BONUS_IDS, BONUSES, CASHBACK, CASHBACK_BONUS, CASHBACK_BONUS_IDS, CASHBACK_BONUSES, 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, 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
6
  import { sha256 } from './sha256.js';
6
7
  export const getPromos = cache(async (options) => {
7
8
  const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, PROMOS, undefined, {
@@ -44,7 +45,7 @@ export const getCashbackBonuses = cache(async (options) => {
44
45
  return res.cashbackBonuses ?? [];
45
46
  });
46
47
  export const getCashbackBonusesCount = cache(async (options) => {
47
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACK_BONUSES_IDS, undefined, options);
48
+ const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACK_BONUS_IDS, undefined, options);
48
49
  return res.cashbackBonuses?.length ?? 0;
49
50
  });
50
51
  export const claimCashbackBonus = async (id, options) => {
@@ -61,21 +62,22 @@ export const getBonus = cache(async (id, options) => {
61
62
  const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, BONUS, { id }, options);
62
63
  return res.node ?? null;
63
64
  });
64
- export const getCurrentBonus = cache(async (options) => {
65
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CURRENT_BONUS, undefined, options);
66
- return res.currentBonus ?? null;
67
- });
68
65
  export const getCashbackBonus = cache(async (id, options) => {
69
66
  const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACK_BONUS, { id }, options);
70
67
  return res.node ?? null;
71
68
  });
72
69
  export const getWallet = cache(async (options) => {
73
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, WALLET, undefined, options);
74
- if (!res.wallet)
75
- return null;
70
+ const [res0, res1] = await Promise.allSettled([
71
+ graphqlRequest(WALLET_GRAPHQL_ENDPOINT, WALLET, undefined, options),
72
+ graphqlRequest(WALLET_GRAPHQL_ENDPOINT, BONUS_BALANCES, undefined, options),
73
+ ]);
76
74
  return {
77
- balance: res.wallet.balance,
78
- bonus: res.wallet.bonus?.balance ?? null,
75
+ balance: res0.status === 'fulfilled' ? (res0.value.wallet?.balance ?? '0') : '0',
76
+ bonus: res1.status === 'fulfilled'
77
+ ? (res1.value.bonuses
78
+ ?.reduce((total, n) => total + parseDecimal(n, 0), 0)
79
+ .toString() ?? '0')
80
+ : '0',
79
81
  };
80
82
  });
81
83
  export const getDeposit = cache(async (id, options) => {
@@ -329,7 +331,7 @@ export const getBonuses = cache(async (options) => {
329
331
  return res.bonuses ?? [];
330
332
  });
331
333
  export const getBonusesCount = cache(async (options) => {
332
- const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, BONUSES_IDS, undefined, options);
334
+ const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, BONUS_IDS, undefined, options);
333
335
  return res.bonuses?.length ?? 0;
334
336
  });
335
337
  export const claimSpotBonus = async (code, options) => {