@opexa/portal-components 0.1.34 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/hooks/useGlobalStore.d.ts +8 -0
- package/dist/client/hooks/useGlobalStore.js +42 -0
- package/dist/client/hooks/useMemberWalletAccount.d.ts +3 -0
- package/dist/client/hooks/useMemberWalletAccount.js +31 -0
- package/dist/client/hooks/useUpdateDailyBetLimit.d.ts +3 -0
- package/dist/client/hooks/useUpdateDailyBetLimit.js +20 -0
- package/dist/client/hooks/useUpdateDailyDepositLimit.d.ts +3 -0
- package/dist/client/hooks/useUpdateDailyDepositLimit.js +20 -0
- package/dist/client/hooks/useUpdateMonthlyBetLimit.d.ts +3 -0
- package/dist/client/hooks/useUpdateMonthlyBetLimit.js +20 -0
- package/dist/client/hooks/useUpdateMonthlyDepositLimit.d.ts +3 -0
- package/dist/client/hooks/useUpdateMonthlyDepositLimit.js +20 -0
- package/dist/components/BetDepositLimit/BetDepositLimitModal.d.ts +3 -2
- package/dist/components/BetDepositLimit/BetDepositLimitModal.js +57 -9
- package/dist/components/BetDepositLimit/BetDepositLimitReachedModal.d.ts +5 -0
- package/dist/components/BetDepositLimit/BetDepositLimitReachedModal.js +24 -0
- package/dist/components/BetDepositLimit/DepositLimitReached.js +2 -2
- package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +22 -5
- package/dist/components/GameLaunch/GameLaunchTrigger.js +23 -0
- package/dist/components/ResponsibleGamingLimits/ResponsibleGamingLimitsForm.lazy.js +92 -73
- package/dist/schemas/forgotPasswordSchema.d.ts +4 -4
- package/dist/services/account.d.ts +40 -0
- package/dist/services/account.js +41 -1
- package/dist/services/queries.d.ts +6 -1
- package/dist/services/queries.js +40 -0
- package/dist/services/wallet.d.ts +16 -0
- package/dist/services/wallet.js +5 -1
- package/dist/types/index.d.ts +8 -0
- package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +45 -45
- package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +33 -33
- package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +90 -90
- package/dist/ui/Menu/menu.recipe.d.ts +5 -5
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +88 -88
- package/dist/ui/Popover/popover.recipe.d.ts +8 -8
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.anatomy.d.ts +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/utils/mutationKeys.d.ts +4 -0
- package/dist/utils/mutationKeys.js +16 -0
- package/dist/utils/queryKeys.d.ts +1 -0
- package/dist/utils/queryKeys.js +1 -0
- package/package.json +1 -1
|
@@ -1,56 +1,22 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Tabs } from '../../ui/Tabs/index.js';
|
|
4
3
|
import Link from 'next/link';
|
|
5
|
-
import { useCallback, useState } from 'react';
|
|
4
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
6
5
|
import { useForm } from 'react-hook-form';
|
|
7
6
|
import { twMerge } from 'tailwind-merge';
|
|
8
7
|
import { useShallow } from 'zustand/shallow';
|
|
9
|
-
import {
|
|
10
|
-
import { RefreshCcw01Icon } from '../../icons/RefreshCcw01Icon.js';
|
|
11
|
-
import { InfoCircleIcon } from '../../icons/InfoCircleIcon.js';
|
|
8
|
+
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
12
9
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
10
|
+
import { useMemberWalletQuery } from '../../client/hooks/useMemberWalletAccount.js';
|
|
11
|
+
import { InfoCircleIcon } from '../../icons/InfoCircleIcon.js';
|
|
12
|
+
import { RefreshCcw01Icon } from '../../icons/RefreshCcw01Icon.js';
|
|
13
|
+
import { Button } from '../../ui/Button/index.js';
|
|
14
|
+
import { Field } from '../../ui/Field/index.js';
|
|
13
15
|
import { Progress } from '../../ui/Progress/index.js';
|
|
16
|
+
import { Tabs } from '../../ui/Tabs/index.js';
|
|
14
17
|
import { Tooltip } from '../../ui/Tooltip/index.js';
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
const INITIAL_BET_LIMITS = [
|
|
18
|
-
{
|
|
19
|
-
period: 'daily',
|
|
20
|
-
label: 'Daily Bet Limit',
|
|
21
|
-
limit: 5000,
|
|
22
|
-
used: 3000,
|
|
23
|
-
resetsLabel: 'Resets daily',
|
|
24
|
-
active: true,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
period: 'monthly',
|
|
28
|
-
label: 'Monthly Bet Limit',
|
|
29
|
-
limit: 50000,
|
|
30
|
-
used: 0,
|
|
31
|
-
resetsLabel: 'Resets May 30, 2026',
|
|
32
|
-
active: false,
|
|
33
|
-
},
|
|
34
|
-
];
|
|
35
|
-
const INITIAL_DEPOSIT_LIMITS = [
|
|
36
|
-
{
|
|
37
|
-
period: 'daily',
|
|
38
|
-
label: 'Daily Deposit Limit',
|
|
39
|
-
limit: 10000,
|
|
40
|
-
used: 0,
|
|
41
|
-
resetsLabel: 'Resets daily',
|
|
42
|
-
active: false,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
period: 'monthly',
|
|
46
|
-
label: 'Monthly Deposit Limit',
|
|
47
|
-
limit: 100000,
|
|
48
|
-
used: 0,
|
|
49
|
-
resetsLabel: 'Resets May 30, 2026',
|
|
50
|
-
active: false,
|
|
51
|
-
},
|
|
52
|
-
];
|
|
53
|
-
function getNewLimitKey(tab, period) {
|
|
18
|
+
import { BetDepositLimitModal, } from '../BetDepositLimit/index.js';
|
|
19
|
+
function getLimitKey(tab, period) {
|
|
54
20
|
return `${tab}-${period}`;
|
|
55
21
|
}
|
|
56
22
|
function formatPeso(amount) {
|
|
@@ -73,45 +39,98 @@ function tabToLimitType(tab) {
|
|
|
73
39
|
}
|
|
74
40
|
export function ResponsibleGamingLimitsForm() {
|
|
75
41
|
const openModal = useGlobalStore(useShallow((state) => state.betDepositLimit.openModal));
|
|
76
|
-
const form = useForm({
|
|
77
|
-
|
|
78
|
-
|
|
42
|
+
const form = useForm({ defaultValues: {} });
|
|
43
|
+
const accountQuery = useAccountQuery();
|
|
44
|
+
const memberWalletQuery = useMemberWalletQuery();
|
|
79
45
|
const [activeTab, setActiveTab] = useState('Deposit');
|
|
80
|
-
const [
|
|
81
|
-
const
|
|
46
|
+
const [optimisticOverrides, setOptimisticOverrides] = useState({});
|
|
47
|
+
const account = accountQuery.data;
|
|
48
|
+
const wallet = memberWalletQuery.data;
|
|
49
|
+
const betLimits = [
|
|
50
|
+
{
|
|
51
|
+
period: 'daily',
|
|
52
|
+
label: 'Daily Bet Limit',
|
|
53
|
+
limit: optimisticOverrides['Bet-daily'] ?? Number(account?.dailyBetLimit ?? 0),
|
|
54
|
+
pendingLimit: account?.newDailyBetLimit != null
|
|
55
|
+
? Number(account.newDailyBetLimit)
|
|
56
|
+
: null,
|
|
57
|
+
used: wallet?.dailyTotalBet ?? 0,
|
|
58
|
+
resetsLabel: 'Resets daily',
|
|
59
|
+
active: (optimisticOverrides['Bet-daily'] ?? Number(account?.dailyBetLimit ?? 0)) > 0,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
period: 'monthly',
|
|
63
|
+
label: 'Monthly Bet Limit',
|
|
64
|
+
limit: optimisticOverrides['Bet-monthly'] ??
|
|
65
|
+
Number(account?.monthlyBetLimit ?? 0),
|
|
66
|
+
pendingLimit: account?.newMonthlyBetLimit != null
|
|
67
|
+
? Number(account.newMonthlyBetLimit)
|
|
68
|
+
: null,
|
|
69
|
+
used: wallet?.monthlyTotalBet ?? 0,
|
|
70
|
+
resetsLabel: 'Resets on the 1st of every month',
|
|
71
|
+
active: (optimisticOverrides['Bet-monthly'] ?? Number(account?.monthlyBetLimit ?? 0)) > 0,
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
const depositLimits = [
|
|
75
|
+
{
|
|
76
|
+
period: 'daily',
|
|
77
|
+
label: 'Daily Deposit Limit',
|
|
78
|
+
limit: optimisticOverrides['Deposit-daily'] ??
|
|
79
|
+
Number(account?.dailyDepositLimit ?? 0),
|
|
80
|
+
pendingLimit: account?.newDailyDepositLimit != null
|
|
81
|
+
? Number(account.newDailyDepositLimit)
|
|
82
|
+
: null,
|
|
83
|
+
used: wallet?.dailyTotalDeposit ?? 0,
|
|
84
|
+
resetsLabel: 'Resets daily',
|
|
85
|
+
active: (optimisticOverrides['Deposit-daily'] ?? Number(account?.dailyDepositLimit ?? 0)) > 0,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
period: 'monthly',
|
|
89
|
+
label: 'Monthly Deposit Limit',
|
|
90
|
+
limit: optimisticOverrides['Deposit-monthly'] ??
|
|
91
|
+
Number(account?.monthlyDepositLimit ?? 0),
|
|
92
|
+
pendingLimit: account?.newMonthlyDepositLimit != null
|
|
93
|
+
? Number(account.newMonthlyDepositLimit)
|
|
94
|
+
: null,
|
|
95
|
+
used: wallet?.monthlyTotalDeposit ?? 0,
|
|
96
|
+
resetsLabel: 'Resets on the 1st of every month',
|
|
97
|
+
active: (optimisticOverrides['Deposit-monthly'] ?? Number(account?.monthlyDepositLimit ?? 0)) > 0,
|
|
98
|
+
},
|
|
99
|
+
];
|
|
82
100
|
const limits = activeTab === 'Bet' ? betLimits : depositLimits;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
setDepositLimits(updateLimits);
|
|
101
|
+
// Clear all optimistic overrides once the account query finishes refetching
|
|
102
|
+
// so the fresh server values take over.
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
if (!accountQuery.isFetching) {
|
|
105
|
+
setOptimisticOverrides({});
|
|
91
106
|
}
|
|
107
|
+
}, [accountQuery.isFetching]);
|
|
108
|
+
const handleLimitSuccess = useCallback((type, period, requestedLimit) => {
|
|
109
|
+
const tab = type === 'bet' ? 'Bet' : 'Deposit';
|
|
110
|
+
setOptimisticOverrides((prev) => ({
|
|
111
|
+
...prev,
|
|
112
|
+
[getLimitKey(tab, period)]: requestedLimit,
|
|
113
|
+
}));
|
|
92
114
|
}, []);
|
|
115
|
+
// -------------------------------------------------------------------------
|
|
116
|
+
// Opens the confirmation modal. The actual mutation fires inside BetDepositLimitModal.
|
|
117
|
+
// -------------------------------------------------------------------------
|
|
93
118
|
const saveLimit = useCallback((card, inputValue) => {
|
|
94
|
-
const key =
|
|
119
|
+
const key = getLimitKey(activeTab, card.period);
|
|
95
120
|
const parsed = parseFloat(String(inputValue).replace(/[^0-9.]/g, ''));
|
|
96
|
-
if (Number.isNaN(parsed) || parsed <= 0)
|
|
121
|
+
if (Number.isNaN(parsed) || parsed <= 0)
|
|
97
122
|
return;
|
|
98
|
-
}
|
|
99
123
|
openModal(tabToLimitType(activeTab), card.period, card.limit, parsed);
|
|
100
124
|
form.setValue(key, '');
|
|
101
125
|
}, [activeTab, form, openModal]);
|
|
102
|
-
|
|
126
|
+
// -------------------------------------------------------------------------
|
|
127
|
+
// Render
|
|
128
|
+
// -------------------------------------------------------------------------
|
|
129
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "m-5 mx-auto my-10 rounded-xl bg-bg-secondary px-4 py-6 lg:px-8 lg:py-10", children: [_jsxs("div", { className: "mb-6", children: [_jsx("h1", { className: "font-bold text-3xl text-text-primary-brand lg:block", children: "Responsible Gaming" }), _jsxs("p", { className: "mt-1 text-sm text-text-disabled", children: ["Set limits for your gaming activity, including how much you can bet or deposit.", _jsx("br", { className: "hidden sm:inline" }), "These limits help you stay within the boundaries you choose."] })] }), _jsxs("div", { className: "mb-6 flex flex-col items-start justify-between gap-3 rounded-xl border border-border-dark bg-bg-primary px-4 py-4 shadow-xs sm:flex-row sm:items-center", children: [_jsxs("div", { children: [_jsx("p", { className: "font-semibold text-sm text-text-primary-brand", children: "Learn More About Responsible Gaming" }), _jsx("p", { className: "mt-0.5 text-sm text-text-disabled", children: "Find helpful tips, safety reminders, and support resources to help you stay informed and in control while playing." })] }), _jsx(Link, { href: "/responsible-gaming", className: twMerge('inline-flex shrink-0 items-center justify-center gap-1.5 rounded-lg border border-border-dark px-4 py-2.5 font-semibold text-sm text-text-primary-brand shadow-xs transition-colors'), children: "Visit Responsible Gaming" })] }), _jsx(Tabs.Root, { value: activeTab, onValueChange: (details) => setActiveTab(details.value), className: "mb-6 w-fit", children: _jsxs(Tabs.List, { children: [_jsx(Tabs.Trigger, { value: "Deposit", children: "Deposit" }), _jsx(Tabs.Trigger, { value: "Bet", children: "Bet" }), _jsx(Tabs.Indicator, {})] }) }), _jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: limits.map((card) => {
|
|
103
130
|
const pct = getUsedPercent(card.used, card.limit);
|
|
104
|
-
const key =
|
|
105
|
-
return (_jsxs("div", { className: "
|
|
131
|
+
const key = getLimitKey(activeTab, card.period);
|
|
132
|
+
return (_jsxs("div", { className: "flex flex-col gap-4 rounded-xl border border-border-dark bg-bg-primary p-5 shadow-xs", children: [_jsxs("div", { className: "flex items-center justify-between gap-2", children: [_jsxs("span", { className: twMerge('inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 font-medium text-xs', card.active
|
|
106
133
|
? 'border border-[#085D3A] bg-[#053321] text-[#75E0A7]'
|
|
107
|
-
: 'border border-[#912018] bg-[#55160c] text-[#FDA29B]'), children: [_jsx("span", { className: twMerge('size-1.5 rounded-full', card.active ? 'bg-[#17B26A]' : 'bg-[#F04438]') }), card.active ? 'Active' : 'Inactive'] }), _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full border border-[#b0841f] bg-[#191304] px-2.5 py-1
|
|
108
|
-
|
|
109
|
-
component: 'ResponsibleGamingLimits',
|
|
110
|
-
activeTab,
|
|
111
|
-
card,
|
|
112
|
-
values,
|
|
113
|
-
});
|
|
114
|
-
saveLimit(card, values[key] ?? '');
|
|
115
|
-
}), children: [_jsxs(Field.Root, { className: "relative w-full", children: [_jsx("span", { className: "text-text-disabled absolute top-1/2 left-2 shrink-0 -translate-y-1/2 text-sm", children: "\u20B1" }), _jsx(Field.Input, { className: "pl-6", type: "number", min: 0, placeholder: "0", ...form.register(key) })] }), _jsx(Button, { size: "md", variant: "solid", colorScheme: "primary", type: "submit", className: "w-fit shrink-0", children: "Save" })] })] })] }, card.period));
|
|
116
|
-
}) })] }), _jsx(BetDepositLimitModal, { onConfirm: applyConfirmedLimit })] }));
|
|
134
|
+
: 'border border-[#912018] bg-[#55160c] text-[#FDA29B]'), children: [_jsx("span", { className: twMerge('size-1.5 rounded-full', card.active ? 'bg-[#17B26A]' : 'bg-[#F04438]') }), card.active ? 'Active' : 'Inactive'] }), _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full border border-[#b0841f] bg-[#191304] px-2.5 py-1 font-medium text-[#e2aa28] text-xs", children: [_jsx(RefreshCcw01Icon, { className: "size-3" }), card.resetsLabel] })] }), _jsxs("div", { children: [_jsx("p", { className: "font-semibold text-sm text-text-primary-brand", children: card.label }), _jsx("p", { className: "mt-1 font-bold text-2xl text-button-primary-bg", children: formatPeso(card.limit) }), _jsx("div", { className: "mt-1.5 h-[1.625rem]", children: card.pendingLimit != null && (_jsxs("div", { className: "py-1 font-medium text-button-primary-bg text-xs", children: ["Pending Limit: ", formatPeso(card.pendingLimit)] })) })] }), _jsxs("div", { children: [_jsxs("div", { className: "flex items-center justify-between text-text-disabled text-xs", children: [_jsxs("span", { children: [formatPeso(card.used), " used"] }), _jsxs("span", { children: [pct, "%"] })] }), _jsx(Progress.Root, { value: pct, max: 100, variant: "unstyled", className: "relative mt-1.5 h-2 w-full", children: _jsx(Progress.Track, { className: "h-2 w-full rounded-full bg-bg-dark", children: _jsx(Progress.Range, { className: twMerge('h-full rounded-full transition-all duration-700 ease-in-out', getProgressColor(pct)) }) }) }), _jsxs("p", { className: "mt-1.5 text-text-disabled text-xs", children: ["Remaining: ", formatPeso(card.limit - card.used)] })] }), _jsxs("div", { children: [_jsxs("div", { className: "mb-2 flex items-center gap-1 font-medium text-sm text-text-primary-brand", children: [_jsx("span", { children: "Set new limit" }), _jsxs(Tooltip.Root, { openDelay: 0, closeDelay: 100, children: [_jsx(Tooltip.Trigger, { type: "button", className: "inline-flex", "aria-label": "Limit change information", children: _jsx(InfoCircleIcon, { className: "size-4 text-text-disabled" }) }), _jsx(Tooltip.Positioner, { children: _jsxs(Tooltip.Content, { className: "max-w-64 rounded-lg bg-[#0C111D] px-2.5 py-2 font-medium text-text-primary-brand text-xs", children: [_jsx(Tooltip.Arrow, {}), "Enter a new limit amount. Limits can only be lowered immediately. Limit increases take 24 hours to apply."] }) })] })] }), _jsxs("form", { className: "flex w-full items-center gap-2", onSubmit: form.handleSubmit((values) => saveLimit(card, values[key] ?? '')), children: [_jsxs(Field.Root, { className: "relative w-full", children: [_jsx("span", { className: "-translate-y-1/2 absolute top-1/2 left-2 shrink-0 text-sm text-text-disabled", children: "\u20B1" }), _jsx(Field.Input, { className: "pl-6", type: "number", min: 0, placeholder: "0", ...form.register(key) })] }), _jsx(Button, { size: "md", variant: "solid", colorScheme: "primary", type: "submit", className: "w-fit shrink-0", children: "Save" })] })] })] }, card.period));
|
|
135
|
+
}) })] }), _jsx(BetDepositLimitModal, { onSuccess: handleLimitSuccess })] }));
|
|
117
136
|
}
|
|
@@ -8,23 +8,23 @@ export declare const createForgotPasswordSchema: (mobileNumberParser: MobileNumb
|
|
|
8
8
|
mobileNumber: z.ZodEffects<z.ZodString, string, string>;
|
|
9
9
|
verificationCode: z.ZodEffects<z.ZodString, string, string>;
|
|
10
10
|
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
password: string;
|
|
12
11
|
verificationCode: string;
|
|
12
|
+
password: string;
|
|
13
13
|
mobileNumber: string;
|
|
14
14
|
confirmPassword: string;
|
|
15
15
|
}, {
|
|
16
|
-
password: string;
|
|
17
16
|
verificationCode: string;
|
|
17
|
+
password: string;
|
|
18
18
|
mobileNumber: string;
|
|
19
19
|
confirmPassword: string;
|
|
20
20
|
}>, {
|
|
21
|
-
password: string;
|
|
22
21
|
verificationCode: string;
|
|
22
|
+
password: string;
|
|
23
23
|
mobileNumber: string;
|
|
24
24
|
confirmPassword: string;
|
|
25
25
|
}, {
|
|
26
|
-
password: string;
|
|
27
26
|
verificationCode: string;
|
|
27
|
+
password: string;
|
|
28
28
|
mobileNumber: string;
|
|
29
29
|
confirmPassword: string;
|
|
30
30
|
}>;
|
|
@@ -473,4 +473,44 @@ export interface GenerateSumsubVerificationTokenMutation {
|
|
|
473
473
|
generateSumsubVerificationToken: string;
|
|
474
474
|
}
|
|
475
475
|
export declare const generateSumsubVerificationToken: (options?: GraphQLRequestOptions) => Promise<string>;
|
|
476
|
+
export interface UpdateDailyBetLimitMutation {
|
|
477
|
+
updateDailyBetLimit?: boolean;
|
|
478
|
+
}
|
|
479
|
+
export interface UpdateDailyBetLimitInput {
|
|
480
|
+
dailyBetLimit: number;
|
|
481
|
+
}
|
|
482
|
+
export interface UpdateDailyBetLimitMutationVariables {
|
|
483
|
+
input: UpdateDailyBetLimitInput;
|
|
484
|
+
}
|
|
485
|
+
export declare const updateDailyBetLimit: (dailyBetLimit: number, options?: GraphQLRequestOptions) => Promise<void>;
|
|
486
|
+
export interface UpdateMonthlyBetLimitMutation {
|
|
487
|
+
updateMonthlyBetLimit?: boolean;
|
|
488
|
+
}
|
|
489
|
+
export interface UpdateMonthlyBetLimitInput {
|
|
490
|
+
monthlyBetLimit: number;
|
|
491
|
+
}
|
|
492
|
+
export interface UpdateMonthlyBetLimitMutationVariables {
|
|
493
|
+
input: UpdateMonthlyBetLimitInput;
|
|
494
|
+
}
|
|
495
|
+
export declare const updateMonthlyBetLimit: (monthlyBetLimit: number, options?: GraphQLRequestOptions) => Promise<void>;
|
|
496
|
+
export interface UpdateDailyDepositLimitMutation {
|
|
497
|
+
updateDailyDepositLimit?: boolean;
|
|
498
|
+
}
|
|
499
|
+
export interface UpdateDailyDepositLimitInput {
|
|
500
|
+
dailyDepositLimit: number;
|
|
501
|
+
}
|
|
502
|
+
export interface UpdateDailyDepositLimitMutationVariables {
|
|
503
|
+
input: UpdateDailyDepositLimitInput;
|
|
504
|
+
}
|
|
505
|
+
export declare const updateDailyDepositLimit: (dailyDepositLimit: number, options?: GraphQLRequestOptions) => Promise<void>;
|
|
506
|
+
export interface UpdateMonthlyDepositLimitMutation {
|
|
507
|
+
updateMonthlyDepositLimit?: boolean;
|
|
508
|
+
}
|
|
509
|
+
export interface UpdateMonthlyDepositLimitInput {
|
|
510
|
+
monthlyDepositLimit: number;
|
|
511
|
+
}
|
|
512
|
+
export interface UpdateMonthlyDepositLimitMutationVariables {
|
|
513
|
+
input: UpdateMonthlyDepositLimitInput;
|
|
514
|
+
}
|
|
515
|
+
export declare const updateMonthlyDepositLimit: (monthlyDepositLimit: number, options?: GraphQLRequestOptions) => Promise<void>;
|
|
476
516
|
export {};
|
package/dist/services/account.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cache } from 'react';
|
|
2
2
|
import { ACCOUNT_GRAPHQL_ENDPOINT } from '../constants/index.js';
|
|
3
3
|
import { graphqlRequest } from './graphqlRequest.js';
|
|
4
|
-
import { ANNOUNCEMENTS, APPROVE_MEMBER_VERIFICATION__NEXT, CREATE_MEMBER_VERIFICATION, CREATE_MEMBER_VERIFICATION__NEXT, DELETE_MEMBER_ACCOUNT, FACEBOOK_CLIENT_ID, GENERATE_SUMSUB_VERIFICATION_TOKEN, GOOGLE_CLIENT_ID, MEMBER_ACCOUNT, MEMBER_VERIFICATION, PAYMENT_SETTINGS, POINTS_CLUB_SETTINGS, PROFILE_COMPLETION, REFERRAL_CODE, REGISTER_AGENT_ACCOUNT, REGISTER_MAYA_MEMBER_ACCOUNT, REGISTER_MEMBER_ACCOUNT, REGISTER_MEMBER_ACCOUNT__NEXT, REGISTER_MEMBER_ACCOUNT_BY_MOBILE_NUMBER, REGISTER_MEMBER_ACCOUNT_BY_NAME, REGISTER_MEMBER_ACCOUNT_VIA_MOBILE, REQUIRE_FIRST_DEPOSIT, RESET_PASSWORD, RESTRICT_WITHDRAWALS_TO_VERIFIED_MEMBERS, UNLINK_FACEBOOK, UNLINK_GOOGLE, UPDATE_MEMBER_ACCOUNT, UPDATE_MEMBER_VERIFICATION, UPDATE_MEMBER_VERIFICATION__NEXT, UPDATE_MOBILE_NUMBER, UPDATE_REFERRAL_CODE, VERIFY_MOBILE_NUMBER, } from './queries.js';
|
|
4
|
+
import { ANNOUNCEMENTS, APPROVE_MEMBER_VERIFICATION__NEXT, CREATE_MEMBER_VERIFICATION, CREATE_MEMBER_VERIFICATION__NEXT, DELETE_MEMBER_ACCOUNT, FACEBOOK_CLIENT_ID, GENERATE_SUMSUB_VERIFICATION_TOKEN, GOOGLE_CLIENT_ID, MEMBER_ACCOUNT, MEMBER_VERIFICATION, PAYMENT_SETTINGS, POINTS_CLUB_SETTINGS, PROFILE_COMPLETION, REFERRAL_CODE, REGISTER_AGENT_ACCOUNT, REGISTER_MAYA_MEMBER_ACCOUNT, REGISTER_MEMBER_ACCOUNT, REGISTER_MEMBER_ACCOUNT__NEXT, REGISTER_MEMBER_ACCOUNT_BY_MOBILE_NUMBER, REGISTER_MEMBER_ACCOUNT_BY_NAME, REGISTER_MEMBER_ACCOUNT_VIA_MOBILE, REQUIRE_FIRST_DEPOSIT, RESET_PASSWORD, RESTRICT_WITHDRAWALS_TO_VERIFIED_MEMBERS, UNLINK_FACEBOOK, UNLINK_GOOGLE, UPDATE_DAILY_BET_LIMIT_MUTATION, UPDATE_DAILY_DEPOSIT_LIMIT_MUTATION, UPDATE_MEMBER_ACCOUNT, UPDATE_MEMBER_VERIFICATION, UPDATE_MEMBER_VERIFICATION__NEXT, UPDATE_MOBILE_NUMBER, UPDATE_MONTHLY_BET_LIMIT_MUTATION, UPDATE_MONTHLY_DEPOSIT_LIMIT_MUTATION, UPDATE_REFERRAL_CODE, VERIFY_MOBILE_NUMBER, } from './queries.js';
|
|
5
5
|
import { sha256 } from './sha256.js';
|
|
6
6
|
export const getMemberAccount = cache(async (options) => {
|
|
7
7
|
const res = await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, MEMBER_ACCOUNT, undefined, options);
|
|
@@ -312,6 +312,46 @@ export const generateSumsubVerificationToken = async (options) => {
|
|
|
312
312
|
const res = await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, GENERATE_SUMSUB_VERIFICATION_TOKEN, undefined, options);
|
|
313
313
|
return res.generateSumsubVerificationToken;
|
|
314
314
|
};
|
|
315
|
+
export const updateDailyBetLimit = async (dailyBetLimit, options) => {
|
|
316
|
+
const res = await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, UPDATE_DAILY_BET_LIMIT_MUTATION, { input: { dailyBetLimit } }, options);
|
|
317
|
+
if (!res.updateDailyBetLimit) {
|
|
318
|
+
const error = new Error();
|
|
319
|
+
error.name = 'UnknownError';
|
|
320
|
+
error.message = 'Something went wrong. Please try again.';
|
|
321
|
+
Error.captureStackTrace?.(error, updateDailyBetLimit);
|
|
322
|
+
throw error;
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
export const updateMonthlyBetLimit = async (monthlyBetLimit, options) => {
|
|
326
|
+
const res = await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, UPDATE_MONTHLY_BET_LIMIT_MUTATION, { input: { monthlyBetLimit } }, options);
|
|
327
|
+
if (!res.updateMonthlyBetLimit) {
|
|
328
|
+
const error = new Error();
|
|
329
|
+
error.name = 'UnknownError';
|
|
330
|
+
error.message = 'Something went wrong. Please try again.';
|
|
331
|
+
Error.captureStackTrace?.(error, updateMonthlyBetLimit);
|
|
332
|
+
throw error;
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
export const updateDailyDepositLimit = async (dailyDepositLimit, options) => {
|
|
336
|
+
const res = await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, UPDATE_DAILY_DEPOSIT_LIMIT_MUTATION, { input: { dailyDepositLimit } }, options);
|
|
337
|
+
if (!res.updateDailyDepositLimit) {
|
|
338
|
+
const error = new Error();
|
|
339
|
+
error.name = 'UnknownError';
|
|
340
|
+
error.message = 'Something went wrong. Please try again.';
|
|
341
|
+
Error.captureStackTrace?.(error, updateDailyDepositLimit);
|
|
342
|
+
throw error;
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
export const updateMonthlyDepositLimit = async (monthlyDepositLimit, options) => {
|
|
346
|
+
const res = await graphqlRequest(ACCOUNT_GRAPHQL_ENDPOINT, UPDATE_MONTHLY_DEPOSIT_LIMIT_MUTATION, { input: { monthlyDepositLimit } }, options);
|
|
347
|
+
if (!res.updateMonthlyDepositLimit) {
|
|
348
|
+
const error = new Error();
|
|
349
|
+
error.name = 'UnknownError';
|
|
350
|
+
error.message = 'Something went wrong. Please try again.';
|
|
351
|
+
Error.captureStackTrace?.(error, updateMonthlyDepositLimit);
|
|
352
|
+
throw error;
|
|
353
|
+
}
|
|
354
|
+
};
|
|
315
355
|
const ERROR_CODES_MESSAGE_MAP = {
|
|
316
356
|
AccountNameNotAvailableError: 'Username is no longer available',
|
|
317
357
|
AccountNotFoundError: 'Account does not exist',
|
|
@@ -78,7 +78,7 @@ export declare const MEMBER = "\n query Member {\n member {\n dateTimeL
|
|
|
78
78
|
/**
|
|
79
79
|
* _aka_ `Query.self`
|
|
80
80
|
*/
|
|
81
|
-
export declare const MEMBER_ACCOUNT = "\n query MemberAccount {\n memberAccount: self {\n ... on MemberAccount {\n id\n name\n status\n realName\n emailAddress\n mobileNumber\n birthDay\n verified\n verificationStatus\n verification {\n status\n }\n nickName\n validId\n mobileNumberVerified\n mobileNumberVerificationRequired\n transactionPassword\n secretAnswerSubmitted\n dateTimeCreated\n dateTimeLastUpdated\n googleId\n facebookId\n branchCode\n }\n }\n }\n";
|
|
81
|
+
export declare const MEMBER_ACCOUNT = "\n query MemberAccount {\n memberAccount: self {\n ... on MemberAccount {\n id\n name\n status\n realName\n emailAddress\n mobileNumber\n birthDay\n verified\n verificationStatus\n verification {\n status\n }\n nickName\n validId\n mobileNumberVerified\n mobileNumberVerificationRequired\n transactionPassword\n secretAnswerSubmitted\n dateTimeCreated\n dateTimeLastUpdated\n googleId\n facebookId\n branchCode\n dailyBetLimit\n monthlyBetLimit\n dailyDepositLimit\n monthlyDepositLimit\n newDailyBetLimit\n newMonthlyBetLimit\n newDailyDepositLimit\n newMonthlyDepositLimit\n\n }\n }\n }\n";
|
|
82
82
|
export declare const MEMBER_VERIFICATION = "\n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n query MemberVerification {\n memberAccount: self {\n ... on MemberAccount {\n verification {\n id\n status\n address\n permanentAddress\n sourceOfIncome\n natureOfWork\n nationality\n placeOfBirth\n idFrontImage {\n ...FileFragment\n }\n selfieImage {\n ...FileFragment\n }\n sumsubVerified\n }\n }\n }\n }\n";
|
|
83
83
|
export declare const REGISTER_MEMBER_ACCOUNT = "\n mutation RegisterMemberAccount(\n $input: RegisterMemberAccountInput!\n $referralCode: String\n $verificationCode: String\n $reCAPTCHAResponse: String\n ) {\n registerMemberAccount(\n input: $input\n referralCode: $referralCode\n verificationCode: $verificationCode\n reCAPTCHAResponse: $reCAPTCHAResponse\n ) {\n ... on AccountNameNotAvailableError {\n name: __typename\n message\n }\n ... on InvalidPlatformError {\n name: __typename\n message\n }\n ... on InvalidPlatformError {\n name: __typename\n message\n }\n ... on InvalidReCAPTCHAResponseError {\n name: __typename\n message\n }\n ... on InvalidSMSVerificationCodeError {\n name: __typename\n message\n }\n ... on MinimumAgeRequirementError {\n name: __typename\n message\n }\n ... on MobileNumberNotAvailableError {\n name: __typename\n message\n }\n ... on ReCAPTCHAVerificationFailedError {\n name: __typename\n message\n }\n }\n }\n";
|
|
84
84
|
export declare const REGISTER_MEMBER_ACCOUNT_BY_NAME = "\n mutation RegisterMemberAccountByName(\n $input: RegisterMemberAccountByNameInput!\n $reCAPTCHAResponse: String!\n ) {\n registerMemberAccountByName(\n input: $input\n reCAPTCHAResponse: $reCAPTCHAResponse\n ) {\n ... on AccountNameNotAvailableError {\n name: __typename\n message\n }\n ... on InvalidPlatformError {\n name: __typename\n message\n }\n ... on InvalidReCAPTCHAResponseError {\n name: __typename\n message\n }\n }\n }\n";
|
|
@@ -149,3 +149,8 @@ export declare const UNLINK_FACEBOOK = "\n mutation UnlinkFacebook($input: Unli
|
|
|
149
149
|
export declare const TOURNAMENTS = "\n query Tournaments(\n $first: Int\n $after: Cursor\n $filter: TournamentFilterInput\n ) {\n tournaments(first: $first, after: $after, filter: $filter) {\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n node {\n ... on MultiplierTournament {\n id\n type\n name\n winnersCount\n status\n description\n activationStartDateTime\n activationEndDateTime\n topPayouts {\n id\n multiplier\n amount\n member {\n id\n name\n }\n }\n currentLeaderboard {\n totalCount\n edges {\n node {\n ... on TournamentLeaderboard {\n id\n username\n multiplier\n dateTimeCreated\n prize\n }\n }\n }\n }\n previousLeaderboard {\n totalCount\n edges {\n node {\n ... on TournamentLeaderboard {\n id\n username\n multiplier\n dateTimeCreated\n prize\n }\n }\n }\n }\n enabledGameProviders\n frequency\n mode\n mobileBanner {\n id\n url\n mimeType\n }\n webBanner {\n id\n url\n mimeType\n }\n rewardSettings\n }\n }\n }\n }\n }\n";
|
|
150
150
|
export declare const TOURNAMENTS_COUNT = "\n query TournamentsCount($filter: TournamentFilterInput) {\n tournaments(filter: $filter) {\n totalCount\n }\n }\n";
|
|
151
151
|
export declare const GENERATE_SUMSUB_VERIFICATION_TOKEN = "\n mutation GenerateSumsubVerificationToken {\n generateSumsubVerificationToken\n }\n";
|
|
152
|
+
export declare const MEMBER_WALLET_ACCOUNT_QUERY = "\n query Self {\n self {\n id\n dailyTotalBet\n monthlyTotalBet\n dailyTotalDeposit\n monthlyTotalDeposit\n }\n }\n";
|
|
153
|
+
export declare const UPDATE_DAILY_BET_LIMIT_MUTATION = "\n mutation UpdateDailyBetLimit($input: UpdateDailyBetLimitInput!) {\n updateDailyBetLimit(input: $input)\n }\n";
|
|
154
|
+
export declare const UPDATE_MONTHLY_BET_LIMIT_MUTATION = "\n mutation UpdateMonthlyBetLimit($input: UpdateMonthlyBetLimitInput!) {\n updateMonthlyBetLimit(input: $input)\n }\n";
|
|
155
|
+
export declare const UPDATE_DAILY_DEPOSIT_LIMIT_MUTATION = "\n mutation UpdateDailyDepositLimit($input: UpdateDailyDepositLimitInput!) {\n updateDailyDepositLimit(input: $input)\n }\n";
|
|
156
|
+
export declare const UPDATE_MONTHLY_DEPOSIT_LIMIT_MUTATION = "\n mutation UpdateMonthlyDepositLimit($input: UpdateMonthlyDepositLimitInput!) {\n updateMonthlyDepositLimit(input: $input)\n }\n";
|
package/dist/services/queries.js
CHANGED
|
@@ -2141,6 +2141,15 @@ export const MEMBER_ACCOUNT = /* GraphQL */ `
|
|
|
2141
2141
|
googleId
|
|
2142
2142
|
facebookId
|
|
2143
2143
|
branchCode
|
|
2144
|
+
dailyBetLimit
|
|
2145
|
+
monthlyBetLimit
|
|
2146
|
+
dailyDepositLimit
|
|
2147
|
+
monthlyDepositLimit
|
|
2148
|
+
newDailyBetLimit
|
|
2149
|
+
newMonthlyBetLimit
|
|
2150
|
+
newDailyDepositLimit
|
|
2151
|
+
newMonthlyDepositLimit
|
|
2152
|
+
|
|
2144
2153
|
}
|
|
2145
2154
|
}
|
|
2146
2155
|
}
|
|
@@ -3438,3 +3447,34 @@ export const GENERATE_SUMSUB_VERIFICATION_TOKEN = /* GraphQL */ `
|
|
|
3438
3447
|
generateSumsubVerificationToken
|
|
3439
3448
|
}
|
|
3440
3449
|
`;
|
|
3450
|
+
export const MEMBER_WALLET_ACCOUNT_QUERY = /* GraphQL */ `
|
|
3451
|
+
query Self {
|
|
3452
|
+
self {
|
|
3453
|
+
id
|
|
3454
|
+
dailyTotalBet
|
|
3455
|
+
monthlyTotalBet
|
|
3456
|
+
dailyTotalDeposit
|
|
3457
|
+
monthlyTotalDeposit
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
`;
|
|
3461
|
+
export const UPDATE_DAILY_BET_LIMIT_MUTATION = /* GraphQL */ `
|
|
3462
|
+
mutation UpdateDailyBetLimit($input: UpdateDailyBetLimitInput!) {
|
|
3463
|
+
updateDailyBetLimit(input: $input)
|
|
3464
|
+
}
|
|
3465
|
+
`;
|
|
3466
|
+
export const UPDATE_MONTHLY_BET_LIMIT_MUTATION = /* GraphQL */ `
|
|
3467
|
+
mutation UpdateMonthlyBetLimit($input: UpdateMonthlyBetLimitInput!) {
|
|
3468
|
+
updateMonthlyBetLimit(input: $input)
|
|
3469
|
+
}
|
|
3470
|
+
`;
|
|
3471
|
+
export const UPDATE_DAILY_DEPOSIT_LIMIT_MUTATION = /* GraphQL */ `
|
|
3472
|
+
mutation UpdateDailyDepositLimit($input: UpdateDailyDepositLimitInput!) {
|
|
3473
|
+
updateDailyDepositLimit(input: $input)
|
|
3474
|
+
}
|
|
3475
|
+
`;
|
|
3476
|
+
export const UPDATE_MONTHLY_DEPOSIT_LIMIT_MUTATION = /* GraphQL */ `
|
|
3477
|
+
mutation UpdateMonthlyDepositLimit($input: UpdateMonthlyDepositLimitInput!) {
|
|
3478
|
+
updateMonthlyDepositLimit(input: $input)
|
|
3479
|
+
}
|
|
3480
|
+
`;
|
|
@@ -743,4 +743,20 @@ export interface RedeemVoucherMutationVariables {
|
|
|
743
743
|
}
|
|
744
744
|
export type RedeemVoucherInput = Simplify<RedeemVoucherMutationVariables['input']>;
|
|
745
745
|
export declare const redeemVoucher: (input: RedeemVoucherInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
746
|
+
export interface MemberWalletAccount {
|
|
747
|
+
self: {
|
|
748
|
+
id: string;
|
|
749
|
+
dailyTotalBet: number;
|
|
750
|
+
monthlyTotalBet: number;
|
|
751
|
+
dailyTotalDeposit: number;
|
|
752
|
+
monthlyTotalDeposit: number;
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
export declare const getMemberWalletAccount: (options?: GraphQLRequestOptions) => Promise<{
|
|
756
|
+
id: string;
|
|
757
|
+
dailyTotalBet: number;
|
|
758
|
+
monthlyTotalBet: number;
|
|
759
|
+
dailyTotalDeposit: number;
|
|
760
|
+
monthlyTotalDeposit: number;
|
|
761
|
+
}>;
|
|
746
762
|
export {};
|
package/dist/services/wallet.js
CHANGED
|
@@ -2,7 +2,7 @@ import { cache } from 'react';
|
|
|
2
2
|
import { WALLET_GRAPHQL_ENDPOINT } from '../constants/index.js';
|
|
3
3
|
import { parseDecimal } from '../utils/parseDecimal.js';
|
|
4
4
|
import { graphqlRequest } from './graphqlRequest.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_GCASH_DEPOSIT, CREATE_AIO_GRAB_PAY_DEPOSIT, CREATE_AIO_INSTAPAY_WITHDRAWAL, CREATE_AIO_INSTAPAY_WITHDRAWAL_NEXT, CREATE_AIO_ONLINE_BANK_DEPOSIT, CREATE_AIO_PALAWAN_PAY_DEPOSIT, CREATE_AIO_PAY_MAYA_DEPOSIT, CREATE_AIO_QRPH_DEPOSIT, CREATE_AURIX_PAY_GCASH_DEPOSIT, CREATE_AURIX_PAY_GRAB_PAY_DEPOSIT, CREATE_AURIX_PAY_PAY_MAYA_DEPOSIT, CREATE_AURIX_PAY_QR_PH_DEPOSIT, CREATE_BANK_WITHDRAWAL, CREATE_GAME_SESSION, CREATE_GCASH_DEPOSIT, CREATE_GCASH_STANDARD_CASH_IN_WITHDRAWAL, CREATE_GCASH_WEBPAY_DEPOSIT, CREATE_GCASH_WITHDRAWAL, CREATE_LIBANGAN_DEPOSIT, 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_WEBPAY_DEPOSIT, CREATE_MAYA_WITHDRAWAL, CREATE_PISO_PAY_DEPOSIT, CREATE_PISO_PAY_WITHDRAWAL, CREATE_VENTAJA_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, REDEEM_VOUCHER, 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_GCASH_DEPOSIT, CREATE_AIO_GRAB_PAY_DEPOSIT, CREATE_AIO_INSTAPAY_WITHDRAWAL, CREATE_AIO_INSTAPAY_WITHDRAWAL_NEXT, CREATE_AIO_ONLINE_BANK_DEPOSIT, CREATE_AIO_PALAWAN_PAY_DEPOSIT, CREATE_AIO_PAY_MAYA_DEPOSIT, CREATE_AIO_QRPH_DEPOSIT, CREATE_AURIX_PAY_GCASH_DEPOSIT, CREATE_AURIX_PAY_GRAB_PAY_DEPOSIT, CREATE_AURIX_PAY_PAY_MAYA_DEPOSIT, CREATE_AURIX_PAY_QR_PH_DEPOSIT, CREATE_BANK_WITHDRAWAL, CREATE_GAME_SESSION, CREATE_GCASH_DEPOSIT, CREATE_GCASH_STANDARD_CASH_IN_WITHDRAWAL, CREATE_GCASH_WEBPAY_DEPOSIT, CREATE_GCASH_WITHDRAWAL, CREATE_LIBANGAN_DEPOSIT, 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_WEBPAY_DEPOSIT, CREATE_MAYA_WITHDRAWAL, CREATE_PISO_PAY_DEPOSIT, CREATE_PISO_PAY_WITHDRAWAL, CREATE_VENTAJA_WITHDRAWAL, DEPOSIT, END_GAME_SESSION, FAVORITE_GAMES, GAME_SESSION, INSTAPAY_BANK_LIST, MARK_GAME_AS_FAVORITE, MAYA_SESSION, MEMBER_WALLET_ACCOUNT_QUERY, POINTS_WALLET, PROMO, PROMOS, REDEEM_POINTS_TO_CASH, REDEEM_VOUCHER, REMAINING_DAILY_WITHDRAWALS_COUNT, TOUCH_GCASH_DEPOSIT, TOUCH_QRPH_DEPOSIT, UNMARK_GAME_AS_FAVORITE, VALIDATE_MAYA_SESSION, WALLET, } from './queries.js';
|
|
6
6
|
import { sha256 } from './sha256.js';
|
|
7
7
|
export const getPromos = cache(async (options) => {
|
|
8
8
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, PROMOS, undefined, {
|
|
@@ -597,6 +597,10 @@ export const redeemVoucher = async (input, options) => {
|
|
|
597
597
|
throw error;
|
|
598
598
|
}
|
|
599
599
|
};
|
|
600
|
+
export const getMemberWalletAccount = cache(async (options) => {
|
|
601
|
+
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, MEMBER_WALLET_ACCOUNT_QUERY, undefined, options);
|
|
602
|
+
return res.self;
|
|
603
|
+
});
|
|
600
604
|
const ERROR_CODES_MESSAGE_MAP = {
|
|
601
605
|
PointsNotDivisibleBy100Error: 'Please input points that are multiples of 100.',
|
|
602
606
|
MaximumBonusesCountLimitExceededError: 'Maximum bonuses reached',
|
package/dist/types/index.d.ts
CHANGED
|
@@ -485,6 +485,14 @@ export interface MemberAccount {
|
|
|
485
485
|
cxd: string;
|
|
486
486
|
dateTimeLastUpdated: string;
|
|
487
487
|
};
|
|
488
|
+
dailyBetLimit: string;
|
|
489
|
+
monthlyBetLimit: string;
|
|
490
|
+
dailyDepositLimit: string;
|
|
491
|
+
monthlyDepositLimit: string;
|
|
492
|
+
newDailyBetLimit: string | null;
|
|
493
|
+
newMonthlyBetLimit: string | null;
|
|
494
|
+
newDailyDepositLimit: string | null;
|
|
495
|
+
newMonthlyDepositLimit: string | null;
|
|
488
496
|
}
|
|
489
497
|
export interface MemberVerification {
|
|
490
498
|
id: string;
|