@opexa/portal-components 0.0.449 → 0.0.451
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/useCreateGCashStandardCashInWithdrawal.d.ts +4 -0
- package/dist/client/hooks/useCreateGCashStandardCashInWithdrawal.js +28 -0
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.d.ts +4 -4
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.js +8 -8
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +79 -63
- package/dist/services/queries.d.ts +2 -1
- package/dist/services/queries.js +45 -1
- package/dist/services/wallet.d.ts +64 -51
- package/dist/services/wallet.js +72 -56
- package/dist/utils/mutationKeys.d.ts +2 -1
- package/dist/utils/mutationKeys.js +44 -43
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SetOptional } from "type-fest";
|
|
2
|
+
import { type CreateGCashStandardCashInWithdrawalInput } from "../../services/wallet";
|
|
3
|
+
import type { Mutation } from "../../types";
|
|
4
|
+
export declare const useCreateGCashStandardCashInWithdrawalMutation: Mutation<string, SetOptional<CreateGCashStandardCashInWithdrawalInput, "id">>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ObjectId } from "@opexa/object-id";
|
|
2
|
+
import { useMutation } from "@tanstack/react-query";
|
|
3
|
+
import invariant from "tiny-invariant";
|
|
4
|
+
import { ObjectType } from "../../services/ObjectType.js";
|
|
5
|
+
import { createGCashStandardCashInWithdrawal, } from "../../services/wallet.js";
|
|
6
|
+
import { getCreateGCashStandardCashInWithdrawalMutationKey } from "../../utils/mutationKeys.js";
|
|
7
|
+
import { getSession } from "../services/getSession.js";
|
|
8
|
+
export const useCreateGCashStandardCashInWithdrawalMutation = (config) => {
|
|
9
|
+
const mutation = useMutation({
|
|
10
|
+
...config,
|
|
11
|
+
mutationKey: getCreateGCashStandardCashInWithdrawalMutationKey(),
|
|
12
|
+
mutationFn: async (input) => {
|
|
13
|
+
const id = input.id ?? ObjectId.generate(ObjectType.Withdrawal).toString();
|
|
14
|
+
const session = await getSession();
|
|
15
|
+
invariant(session.status === "authenticated");
|
|
16
|
+
await createGCashStandardCashInWithdrawal({ ...input, id }, {
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${session.token}`,
|
|
19
|
+
...(session.domain && {
|
|
20
|
+
Domain: session.domain,
|
|
21
|
+
}),
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
return id;
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
return mutation;
|
|
28
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SetOptional } from
|
|
2
|
-
import { type CreateGCashWithdrawalInput } from
|
|
3
|
-
import type { Mutation } from
|
|
4
|
-
export declare const useCreateGCashWithdrawalMutation: Mutation<string, SetOptional<CreateGCashWithdrawalInput,
|
|
1
|
+
import type { SetOptional } from "type-fest";
|
|
2
|
+
import { type CreateGCashWithdrawalInput } from "../../services/wallet";
|
|
3
|
+
import type { Mutation } from "../../types";
|
|
4
|
+
export declare const useCreateGCashWithdrawalMutation: Mutation<string, SetOptional<CreateGCashWithdrawalInput, "id">>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ObjectId } from
|
|
2
|
-
import { useMutation } from
|
|
3
|
-
import invariant from
|
|
4
|
-
import { ObjectType } from
|
|
5
|
-
import { createGCashWithdrawal, } from
|
|
6
|
-
import { getCreateGCashWithdrawalMutationKey } from
|
|
7
|
-
import { getSession } from
|
|
1
|
+
import { ObjectId } from "@opexa/object-id";
|
|
2
|
+
import { useMutation } from "@tanstack/react-query";
|
|
3
|
+
import invariant from "tiny-invariant";
|
|
4
|
+
import { ObjectType } from "../../services/ObjectType.js";
|
|
5
|
+
import { createGCashWithdrawal, } from "../../services/wallet.js";
|
|
6
|
+
import { getCreateGCashWithdrawalMutationKey } from "../../utils/mutationKeys.js";
|
|
7
|
+
import { getSession } from "../services/getSession.js";
|
|
8
8
|
export const useCreateGCashWithdrawalMutation = (config) => {
|
|
9
9
|
const mutation = useMutation({
|
|
10
10
|
...config,
|
|
@@ -12,7 +12,7 @@ export const useCreateGCashWithdrawalMutation = (config) => {
|
|
|
12
12
|
mutationFn: async (input) => {
|
|
13
13
|
const id = input.id ?? ObjectId.generate(ObjectType.Withdrawal).toString();
|
|
14
14
|
const session = await getSession();
|
|
15
|
-
invariant(session.status ===
|
|
15
|
+
invariant(session.status === "authenticated");
|
|
16
16
|
await createGCashWithdrawal({ ...input, id }, {
|
|
17
17
|
headers: {
|
|
18
18
|
Authorization: `Bearer ${session.token}`,
|
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const OnlineBankDepositContext: (props: {
|
|
2
2
|
value: {
|
|
3
|
-
view: "
|
|
3
|
+
view: "vca" | "form";
|
|
4
4
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
5
5
|
verify: () => void;
|
|
6
6
|
reset: () => void;
|
|
@@ -13,7 +13,7 @@ export declare const OnlineBankDepositContext: (props: {
|
|
|
13
13
|
} & {
|
|
14
14
|
children?: import("react").ReactNode | undefined;
|
|
15
15
|
}) => React.ReactNode, useOnlineBankDepositContext: () => {
|
|
16
|
-
view: "
|
|
16
|
+
view: "vca" | "form";
|
|
17
17
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
18
18
|
verify: () => void;
|
|
19
19
|
reset: () => void;
|
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Deposit } from '../../../../types';
|
|
2
2
|
export type UseOnlineBankDepositReturn = ReturnType<typeof useOnlineBankDeposit>;
|
|
3
3
|
export declare function useOnlineBankDeposit(): {
|
|
4
|
-
view: "
|
|
4
|
+
view: "vca" | "form";
|
|
5
5
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
6
6
|
verify: () => void;
|
|
7
7
|
reset: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const QRPHDepositContext: (props: {
|
|
2
2
|
value: {
|
|
3
|
-
view: "
|
|
3
|
+
view: "qrCode" | "form";
|
|
4
4
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
5
5
|
verify: () => void;
|
|
6
6
|
reset: () => void;
|
|
@@ -13,7 +13,7 @@ export declare const QRPHDepositContext: (props: {
|
|
|
13
13
|
} & {
|
|
14
14
|
children?: import("react").ReactNode | undefined;
|
|
15
15
|
}) => React.ReactNode, useQRPHDepositContext: () => {
|
|
16
|
-
view: "
|
|
16
|
+
view: "qrCode" | "form";
|
|
17
17
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
18
18
|
verify: () => void;
|
|
19
19
|
reset: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Deposit } from '../../../../types';
|
|
2
2
|
export type UseQRPHDepositReturn = ReturnType<typeof useQRPHDeposit>;
|
|
3
3
|
export declare function useQRPHDeposit(): {
|
|
4
|
-
view: "
|
|
4
|
+
view: "qrCode" | "form";
|
|
5
5
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
6
6
|
verify: () => void;
|
|
7
7
|
reset: () => void;
|
|
@@ -1,54 +1,70 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { zodResolver } from
|
|
3
|
-
import Link from
|
|
4
|
-
import { useEffect, useState } from
|
|
5
|
-
import { Controller, useForm } from
|
|
6
|
-
import { z } from
|
|
7
|
-
import { useShallow } from
|
|
8
|
-
import { useCreateGCashWithdrawalMutation } from
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
2
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
3
|
+
import Link from "next/link";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { Controller, useForm } from "react-hook-form";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { useShallow } from "zustand/shallow";
|
|
8
|
+
import { useCreateGCashWithdrawalMutation } from "../../../../client/hooks/useCreateGCashWithdrawalMutation.js";
|
|
9
|
+
import { useCreateGCashStandardCashInWithdrawalMutation } from "../../../../client/hooks/useCreateGCashStandardCashInWithdrawal.js";
|
|
10
|
+
import { useGlobalStore } from "../../../../client/hooks/useGlobalStore.js";
|
|
11
|
+
import { useLocaleInfo } from "../../../../client/hooks/useLocaleInfo.js";
|
|
12
|
+
import { useMobileNumberParser } from "../../../../client/hooks/useMobileNumberParser.js";
|
|
13
|
+
import { usePaymentSettingsQuery } from "../../../../client/hooks/usePaymentSettingsQuery.js";
|
|
14
|
+
import { AlertCircleIcon } from "../../../../icons/AlertCircleIcon.js";
|
|
15
|
+
import { ChevronDownIcon } from "../../../../icons/ChevronDownIcon.js";
|
|
16
|
+
import { ChevronUpIcon } from "../../../../icons/ChevronUpIcon.js";
|
|
17
|
+
import { EyeIcon } from "../../../../icons/EyeIcon.js";
|
|
18
|
+
import { EyeOffIcon } from "../../../../icons/EyeOffIcon.js";
|
|
19
|
+
import { SpinnerIcon } from "../../../../icons/SpinnerIcon.js";
|
|
20
|
+
import { XIcon } from "../../../../icons/XIcon.js";
|
|
21
|
+
import { AlertDialog } from "../../../../ui/AlertDialog/index.js";
|
|
22
|
+
import { Button } from "../../../../ui/Button/index.js";
|
|
23
|
+
import { Field } from "../../../../ui/Field/index.js";
|
|
24
|
+
import { NumberInput } from "../../../../ui/NumberInput/index.js";
|
|
25
|
+
import { PasswordInput } from "../../../../ui/PasswordInput/index.js";
|
|
26
|
+
import { Portal } from "../../../../ui/Portal/index.js";
|
|
27
|
+
import { parseDecimal } from "../../../../utils/parseDecimal.js";
|
|
28
|
+
import { AmountChoices } from "../../AmountChoices.js";
|
|
29
|
+
import { useDepositWithdrawalPropsContext } from "../../DepositWithdrawalContext.js";
|
|
30
|
+
import { explainError } from "../../utils.js";
|
|
31
|
+
import { TransactionPasswordNotSet } from "../TransactionPasswordNotSet.js";
|
|
32
|
+
import { useFeatureFlag } from "../../../../client/hooks/useFeatureFlag.js";
|
|
31
33
|
export function GCashWithdrawal() {
|
|
32
34
|
const depositWithdrawalProps = useDepositWithdrawalPropsContext();
|
|
35
|
+
const featureFlag = useFeatureFlag();
|
|
33
36
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
34
37
|
depositWithdrawal: ctx.depositWithdrawal,
|
|
35
38
|
hasPendingBonus: ctx.pendingBonus,
|
|
36
39
|
})));
|
|
37
|
-
const [status, setStatus] = useState(
|
|
40
|
+
const [status, setStatus] = useState("waiting");
|
|
38
41
|
const localeInfo = useLocaleInfo();
|
|
39
42
|
const mobileNumberParser = useMobileNumberParser();
|
|
40
|
-
const createWithdrawalMutation =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
const createWithdrawalMutation = featureFlag.enabled
|
|
44
|
+
? useCreateGCashStandardCashInWithdrawalMutation({
|
|
45
|
+
onMutate() {
|
|
46
|
+
setStatus("processing");
|
|
47
|
+
},
|
|
48
|
+
onSuccess() {
|
|
49
|
+
setStatus("success");
|
|
50
|
+
form.reset();
|
|
51
|
+
},
|
|
52
|
+
onError() {
|
|
53
|
+
setStatus("failed");
|
|
54
|
+
},
|
|
55
|
+
})
|
|
56
|
+
: useCreateGCashWithdrawalMutation({
|
|
57
|
+
onMutate() {
|
|
58
|
+
setStatus("processing");
|
|
59
|
+
},
|
|
60
|
+
onSuccess() {
|
|
61
|
+
setStatus("success");
|
|
62
|
+
form.reset();
|
|
63
|
+
},
|
|
64
|
+
onError() {
|
|
65
|
+
setStatus("failed");
|
|
66
|
+
},
|
|
67
|
+
});
|
|
52
68
|
const paymentSettingsQuery = usePaymentSettingsQuery();
|
|
53
69
|
const paymentSettings = paymentSettingsQuery.data;
|
|
54
70
|
const gatewaySettings = paymentSettings?.gcashWithdrawalGatewaySettings;
|
|
@@ -59,7 +75,7 @@ export function GCashWithdrawal() {
|
|
|
59
75
|
const n = parseDecimal(val, 0);
|
|
60
76
|
if (n < minimumAmount) {
|
|
61
77
|
ctx.addIssue({
|
|
62
|
-
type:
|
|
78
|
+
type: "number",
|
|
63
79
|
code: z.ZodIssueCode.too_small,
|
|
64
80
|
inclusive: true,
|
|
65
81
|
minimum: minimumAmount,
|
|
@@ -68,7 +84,7 @@ export function GCashWithdrawal() {
|
|
|
68
84
|
}
|
|
69
85
|
if (n > maximumAmount) {
|
|
70
86
|
ctx.addIssue({
|
|
71
|
-
type:
|
|
87
|
+
type: "number",
|
|
72
88
|
code: z.ZodIssueCode.too_big,
|
|
73
89
|
inclusive: true,
|
|
74
90
|
maximum: maximumAmount,
|
|
@@ -78,27 +94,27 @@ export function GCashWithdrawal() {
|
|
|
78
94
|
}),
|
|
79
95
|
password: z
|
|
80
96
|
.string()
|
|
81
|
-
.min(8,
|
|
82
|
-
.max(64,
|
|
97
|
+
.min(8, "Password must be 8 or more characters")
|
|
98
|
+
.max(64, "Password must be not be more than 64 characters"),
|
|
83
99
|
mobileNumber: z
|
|
84
100
|
.string()
|
|
85
|
-
.regex(localeInfo.mobileNumber.pattern,
|
|
101
|
+
.regex(localeInfo.mobileNumber.pattern, "Invalid mobile number"),
|
|
86
102
|
});
|
|
87
103
|
const form = useForm({
|
|
88
|
-
mode:
|
|
104
|
+
mode: "all",
|
|
89
105
|
resolver: zodResolver(definition),
|
|
90
106
|
defaultValues: {
|
|
91
|
-
amount:
|
|
92
|
-
password:
|
|
93
|
-
mobileNumber:
|
|
107
|
+
amount: "0",
|
|
108
|
+
password: "",
|
|
109
|
+
mobileNumber: "",
|
|
94
110
|
},
|
|
95
111
|
});
|
|
96
112
|
useEffect(() => {
|
|
97
113
|
if (minimumAmount) {
|
|
98
114
|
form.reset({
|
|
99
115
|
amount: minimumAmount.toString(),
|
|
100
|
-
password:
|
|
101
|
-
mobileNumber:
|
|
116
|
+
password: "",
|
|
117
|
+
mobileNumber: "",
|
|
102
118
|
});
|
|
103
119
|
}
|
|
104
120
|
}, [form, minimumAmount]);
|
|
@@ -113,25 +129,25 @@ export function GCashWithdrawal() {
|
|
|
113
129
|
transactionPassword: data.password,
|
|
114
130
|
});
|
|
115
131
|
});
|
|
116
|
-
return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, autoComplete: "off", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "-translate-y-1/2 pointer-events-none absolute top-1/2 left-3.5 size-5" }), _jsx(Field.Input, { className: "pl-10.5", ...form.register(
|
|
132
|
+
return (_jsxs("form", { onSubmit: handleSubmit, noValidate: true, autoComplete: "off", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.mobileNumber, children: [_jsx(Field.Label, { children: "Mobile Number" }), _jsxs("div", { className: "relative", children: [_jsx(localeInfo.country.flag, { className: "-translate-y-1/2 pointer-events-none absolute top-1/2 left-3.5 size-5" }), _jsx(Field.Input, { className: "pl-10.5", ...form.register("mobileNumber") })] }), _jsx(Field.ErrorText, { children: form.formState.errors.mobileNumber?.message })] }), _jsx(Controller, { control: form.control, name: "amount", render: (o) => (_jsxs(Field.Root, { invalid: !!form.formState.errors.amount, className: "mt-3xl", children: [_jsxs(NumberInput.Root, { min: 0, step: 1, value: o.field.value, onValueChange: (details) => {
|
|
117
133
|
o.field.onChange(details.value);
|
|
118
134
|
}, formatOptions: {
|
|
119
135
|
maximumFractionDigits: 2,
|
|
120
136
|
minimumFractionDigits: 0,
|
|
121
|
-
}, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to withdraw" }), _jsxs(NumberInput.Control, { children: [_jsx(NumberInput.Input, {}), _jsx(NumberInput.IncrementTrigger, { children: _jsx(ChevronUpIcon, {}) }), _jsx(NumberInput.DecrementTrigger, { children: _jsx(ChevronDownIcon, {}) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] })) }), _jsx(AmountChoices, { value: parseDecimal(form.watch(
|
|
122
|
-
form.setValue(
|
|
137
|
+
}, allowMouseWheel: true, children: [_jsx(NumberInput.Label, { children: "Enter amount you want to withdraw" }), _jsxs(NumberInput.Control, { children: [_jsx(NumberInput.Input, {}), _jsx(NumberInput.IncrementTrigger, { children: _jsx(ChevronUpIcon, {}) }), _jsx(NumberInput.DecrementTrigger, { children: _jsx(ChevronDownIcon, {}) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.amount?.message })] })) }), _jsx(AmountChoices, { value: parseDecimal(form.watch("amount"), 0), onChange: (value) => {
|
|
138
|
+
form.setValue("amount", value.toString(), {
|
|
123
139
|
shouldTouch: true,
|
|
124
140
|
shouldDirty: true,
|
|
125
141
|
shouldValidate: true,
|
|
126
142
|
});
|
|
127
|
-
}, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register(
|
|
143
|
+
}, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register("password") }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", " ", _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? "/terms-of-use", onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), " ", "and", " ", _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? "/privacy-policy", onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== "waiting", onOpenChange: (details) => {
|
|
128
144
|
if (!details.open) {
|
|
129
|
-
setStatus(
|
|
145
|
+
setStatus("waiting");
|
|
130
146
|
}
|
|
131
|
-
}, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { disabled: status ===
|
|
132
|
-
"We're verifying your account and amount. Please hold a moment.", status ===
|
|
133
|
-
|
|
134
|
-
explainError(createWithdrawalMutation.error?.name)] })] }), (status ===
|
|
147
|
+
}, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+2)]" }), _jsx(AlertDialog.Positioner, { className: "!z-[calc(var(--z-dialog)+3)]", children: _jsxs(AlertDialog.Content, { children: [_jsx(AlertDialog.CloseTrigger, { disabled: status === "processing", children: _jsx(XIcon, {}) }), _jsxs(AlertDialog.Header, { children: [status === "processing" && (_jsx(SpinnerIcon, { className: "size-12 text-text-brand-primary-600" })), status === "success" && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-success-secondary text-text-featured-icon-light-success", children: _jsx(AlertCircleIcon, {}) })), status === "failed" && (_jsx("div", { className: "flex size-12 items-center justify-center rounded-full bg-bg-error-secondary text-text-featured-icon-light-error", children: _jsx(AlertCircleIcon, {}) }))] }), _jsxs(AlertDialog.Body, { children: [_jsxs(AlertDialog.Title, { children: [status === "processing" && "Processing Withdraw", status === "success" && "Withdrawal Submitted", status === "failed" && "Withdraw Failed"] }), _jsxs(AlertDialog.Description, { children: [status === "processing" &&
|
|
148
|
+
"We're verifying your account and amount. Please hold a moment.", status === "success" &&
|
|
149
|
+
"Your withdrawal request has been submitted successfully and is awaiting confirmation. You won’t have to wait long — once approved, the funds will be credited to your account.", status === "failed" &&
|
|
150
|
+
explainError(createWithdrawalMutation.error?.name)] })] }), (status === "failed" || status === "success") && (_jsx(AlertDialog.Footer, { children: _jsx(AlertDialog.Context, { children: (api) => (_jsx(Button, { onClick: () => {
|
|
135
151
|
api.setOpen(false);
|
|
136
|
-
}, children: status ===
|
|
152
|
+
}, children: status === "failed" ? "Try Again" : "Ok" })) }) }))] }) })] }) })] }));
|
|
137
153
|
}
|
|
@@ -16,6 +16,7 @@ export declare const RECOMMENDED_GAMES = "\n query RecommendedGames {\n reco
|
|
|
16
16
|
export declare const ANNOUNCEMENTS = "\n query Announcements(\n $first: Int\n $after: Cursor\n $filter: AnnouncementFilterInput\n ) {\n announcements(first: $first, after: $after, filter: $filter) {\n edges {\n cursor\n node {\n ... on Announcement {\n id\n type\n title\n status\n message\n activationStartDateTime\n activationEndDateTime\n dateTimeCreated\n dateTimeLastUpdated\n }\n }\n }\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n";
|
|
17
17
|
export declare const WITHDRAWAL_RECORDS = "\n query WithdrawalRecords(\n $first: Int\n $after: Cursor\n $filter: WithdrawalRecordFilterInput\n ) {\n member {\n withdrawalRecords(first: $first, after: $after, filter: $filter) {\n edges {\n cursor\n node {\n ... on BankWithdrawalRecord {\n id\n type\n bank\n fee\n netAmount\n reference\n amount\n status\n error\n withdrawalNumber\n dateTimeCreated\n dateTimeLastUpdated\n }\n ... on GCashWithdrawalRecord {\n id\n type\n fee\n netAmount\n reference\n amount\n status\n error\n withdrawalNumber\n recipientMobileNumber\n dateTimeCreated\n dateTimeLastUpdated\n }\n ... on ManualWithdrawalRecord {\n id\n type\n fee\n netAmount\n reference\n amount\n status\n error\n withdrawalNumber\n dateTimeCreated\n dateTimeLastUpdated\n }\n ... on MayaAppWithdrawalRecord {\n id\n type\n fee\n netAmount\n reference\n amount\n status\n error\n withdrawalNumber\n dateTimeCreated\n dateTimeLastUpdated\n }\n ... on InstapayWithdrawalRecord {\n id\n type\n fee\n netAmount\n bankName\n reference\n accountName\n amount\n status\n error\n withdrawalNumber\n dateTimeCreated\n dateTimeLastUpdated\n }\n ... on ManualUPIWithdrawalRecord {\n id\n type\n fee\n netAmount\n reference\n amount\n status\n error\n withdrawalNumber\n dateTimeCreated\n dateTimeLastUpdated\n }\n ... on ManualBankWithdrawalRecord {\n id\n type\n fee\n netAmount\n reference\n amount\n status\n error\n withdrawalNumber\n dateTimeCreated\n dateTimeLastUpdated\n }\n ... on VentajaDisbursementWithdrawalRecord {\n id\n type\n fee\n netAmount\n reference\n amount\n status\n error\n withdrawalNumber\n dateTimeCreated\n dateTimeLastUpdated\n }\n ... on PisoPayRemittanceWithdrawalRecord {\n id\n type\n fee\n accountName\n accountNumber\n netAmount\n reference\n amount\n status\n error\n withdrawalNumber\n dateTimeCreated\n dateTimeLastUpdated\n }\n }\n }\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n";
|
|
18
18
|
export declare const CREATE_GCASH_WITHDRAWAL = "\n mutation CreateGCashWithdrawal($input: CreateGCashWithdrawalInput!) {\n createGCashWithdrawal(input: $input) {\n ... on AccountNotVerifiedError {\n name: __typename\n message\n }\n ... on InvalidTransactionPasswordError {\n name: __typename\n message\n }\n ... on InvalidWithdrawalAmountError {\n name: __typename\n message\n }\n ... on MobileNumberNotVerifiedError {\n name: __typename\n message\n }\n ... on NotEnoughBalanceError {\n name: __typename\n message\n }\n ... on WithdrawalDailyLimitExceededError {\n name: __typename\n message\n }\n ... on ReCAPTCHAVerificationFailedError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n ... on TransactionPasswordNotSetError {\n name: __typename\n message\n }\n }\n }\n";
|
|
19
|
+
export declare const CREATE_GCASH_STANDARD_CASH_IN_WITHDRAWAL = "\n mutation CreateGCashStandardCashInWithdrawal(\n $input: CreateGCashStandardCashInWithdrawalInput!\n ) {\n createGCashStandardCashInWithdrawal(input: $input) {\n ... on AccountNotVerifiedError {\n name: __typename\n message\n }\n ... on InvalidTransactionPasswordError {\n name: __typename\n message\n }\n ... on InvalidWithdrawalAmountError {\n name: __typename\n message\n }\n ... on MobileNumberNotVerifiedError {\n name: __typename\n message\n }\n ... on NotEnoughBalanceError {\n name: __typename\n message\n }\n ... on WithdrawalDailyLimitExceededError {\n name: __typename\n message\n }\n ... on ReCAPTCHAVerificationFailedError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n ... on TransactionPasswordNotSetError {\n name: __typename\n message\n }\n }\n }\n";
|
|
19
20
|
export declare const CREATE_MAYA_WITHDRAWAL = "\n mutation CreateMayaWithdrawal($input: CreateMayaWithdrawalInput!) {\n createMayaWithdrawal(input: $input) {\n ... on AccountNotVerifiedError {\n name: __typename\n message\n }\n ... on InvalidTransactionPasswordError {\n name: __typename\n message\n }\n ... on InvalidWithdrawalAmountError {\n name: __typename\n message\n }\n ... on MobileNumberNotVerifiedError {\n name: __typename\n message\n }\n ... on NotEnoughBalanceError {\n name: __typename\n message\n }\n ... on WithdrawalDailyLimitExceededError {\n name: __typename\n message\n }\n }\n }\n";
|
|
20
21
|
export declare const CREATE_MAYA_APP_WITHDRAWAL = "\n mutation CreateMayaAppWithdrawal($input: CreateMayaAppWithdrawalInput!) {\n createMayaAppWithdrawal(input: $input) {\n ... on AccountNotVerifiedError {\n name: __typename\n message\n }\n ... on InvalidTransactionPasswordError {\n name: __typename\n message\n }\n ... on InvalidWithdrawalAmountError {\n name: __typename\n message\n }\n ... on NotEnoughBalanceError {\n name: __typename\n message\n }\n ... on WithdrawalDailyLimitExceededError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n ... on TransactionPasswordNotSetError {\n name: __typename\n message\n }\n }\n }\n";
|
|
21
22
|
export declare const CREATE_BANK_WITHDRAWAL = "\n mutation CreateBankWithdrawal($input: CreateBankWithdrawalInput!) {\n createBankWithdrawal(input: $input) {\n ... on MobileNumberNotVerifiedError {\n name: __typename\n message\n }\n }\n }\n";
|
|
@@ -67,7 +68,7 @@ export declare const MEMBER = "\n query Member {\n member {\n dateTimeL
|
|
|
67
68
|
/**
|
|
68
69
|
* _aka_ `Query.self`
|
|
69
70
|
*/
|
|
70
|
-
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 nickName\n validId\n mobileNumberVerified\n mobileNumberVerificationRequired\n transactionPassword\n secretAnswerSubmitted\n dateTimeCreated\n dateTimeLastUpdated\n googleId\n facebookId\n cellxpertDetails {\n cxd\n dateTimeLastUpdated
|
|
71
|
+
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 nickName\n validId\n mobileNumberVerified\n mobileNumberVerificationRequired\n transactionPassword\n secretAnswerSubmitted\n dateTimeCreated\n dateTimeLastUpdated\n googleId\n facebookId\n cellxpertDetails {\n cxd\n dateTimeLastUpdated\n }\n }\n }\n }\n";
|
|
71
72
|
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 }\n }\n }\n }\n";
|
|
72
73
|
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";
|
|
73
74
|
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";
|
package/dist/services/queries.js
CHANGED
|
@@ -420,6 +420,50 @@ export const CREATE_GCASH_WITHDRAWAL = /* GraphQL */ `
|
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
`;
|
|
423
|
+
export const CREATE_GCASH_STANDARD_CASH_IN_WITHDRAWAL = /* GraphQL */ `
|
|
424
|
+
mutation CreateGCashStandardCashInWithdrawal(
|
|
425
|
+
$input: CreateGCashStandardCashInWithdrawalInput!
|
|
426
|
+
) {
|
|
427
|
+
createGCashStandardCashInWithdrawal(input: $input) {
|
|
428
|
+
... on AccountNotVerifiedError {
|
|
429
|
+
name: __typename
|
|
430
|
+
message
|
|
431
|
+
}
|
|
432
|
+
... on InvalidTransactionPasswordError {
|
|
433
|
+
name: __typename
|
|
434
|
+
message
|
|
435
|
+
}
|
|
436
|
+
... on InvalidWithdrawalAmountError {
|
|
437
|
+
name: __typename
|
|
438
|
+
message
|
|
439
|
+
}
|
|
440
|
+
... on MobileNumberNotVerifiedError {
|
|
441
|
+
name: __typename
|
|
442
|
+
message
|
|
443
|
+
}
|
|
444
|
+
... on NotEnoughBalanceError {
|
|
445
|
+
name: __typename
|
|
446
|
+
message
|
|
447
|
+
}
|
|
448
|
+
... on WithdrawalDailyLimitExceededError {
|
|
449
|
+
name: __typename
|
|
450
|
+
message
|
|
451
|
+
}
|
|
452
|
+
... on ReCAPTCHAVerificationFailedError {
|
|
453
|
+
name: __typename
|
|
454
|
+
message
|
|
455
|
+
}
|
|
456
|
+
... on WalletDoesNotExistError {
|
|
457
|
+
name: __typename
|
|
458
|
+
message
|
|
459
|
+
}
|
|
460
|
+
... on TransactionPasswordNotSetError {
|
|
461
|
+
name: __typename
|
|
462
|
+
message
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
`;
|
|
423
467
|
export const CREATE_MAYA_WITHDRAWAL = /* GraphQL */ `
|
|
424
468
|
mutation CreateMayaWithdrawal($input: CreateMayaWithdrawalInput!) {
|
|
425
469
|
createMayaWithdrawal(input: $input) {
|
|
@@ -1570,7 +1614,7 @@ export const MEMBER_ACCOUNT = /* GraphQL */ `
|
|
|
1570
1614
|
facebookId
|
|
1571
1615
|
cellxpertDetails {
|
|
1572
1616
|
cxd
|
|
1573
|
-
dateTimeLastUpdated
|
|
1617
|
+
dateTimeLastUpdated
|
|
1574
1618
|
}
|
|
1575
1619
|
}
|
|
1576
1620
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Simplify, SimplifyDeep } from
|
|
2
|
-
import type { Bonus, Cashback, CashbackBonus, DateFilterField, Deposit, EnumFilterField, FavoriteGame, GameSession, InstapayBank, MayaSession, ObjectIdFilterField, PointsWallet, Promo, PromoType, Wallet } from
|
|
3
|
-
import { type GraphQLRequestOptions } from
|
|
1
|
+
import type { Simplify, SimplifyDeep } from "type-fest";
|
|
2
|
+
import type { Bonus, Cashback, CashbackBonus, DateFilterField, Deposit, EnumFilterField, FavoriteGame, GameSession, InstapayBank, MayaSession, ObjectIdFilterField, PointsWallet, Promo, PromoType, Wallet } from "../types";
|
|
3
|
+
import { type GraphQLRequestOptions } from "./graphqlRequest";
|
|
4
4
|
export interface PromosQuery {
|
|
5
5
|
promos: Promo[];
|
|
6
6
|
}
|
|
@@ -23,7 +23,7 @@ export interface CashbackQueryVariables {
|
|
|
23
23
|
id: string;
|
|
24
24
|
}
|
|
25
25
|
export declare const getCashback: (id: string, options?: GraphQLRequestOptions) => Promise<Cashback | null>;
|
|
26
|
-
export type AvailablePromosInput = SimplifyDeep<AvailablePromosQueryVariables[
|
|
26
|
+
export type AvailablePromosInput = SimplifyDeep<AvailablePromosQueryVariables["filter"]>;
|
|
27
27
|
export interface AvailablePromosQuery {
|
|
28
28
|
availablePromos: Promo[];
|
|
29
29
|
}
|
|
@@ -44,7 +44,7 @@ export interface CashbackBonusIdsQuery {
|
|
|
44
44
|
}
|
|
45
45
|
export declare const getCashbackBonusesCount: (options?: GraphQLRequestOptions) => Promise<number>;
|
|
46
46
|
export type ClaimCashbackBonusError = {
|
|
47
|
-
name:
|
|
47
|
+
name: "CashbackBonusDoesNotExistError";
|
|
48
48
|
message: string;
|
|
49
49
|
};
|
|
50
50
|
export interface ClaimCashbackBonusMutation {
|
|
@@ -92,34 +92,34 @@ export interface DepositQueryVariables {
|
|
|
92
92
|
}
|
|
93
93
|
export declare const getDeposit: (id: string, options?: GraphQLRequestOptions) => Promise<Deposit | null>;
|
|
94
94
|
export type CreateDepositError = {
|
|
95
|
-
name:
|
|
95
|
+
name: "DepositPromoMaximumAmountExceededError";
|
|
96
96
|
message: string;
|
|
97
97
|
} | {
|
|
98
|
-
name:
|
|
98
|
+
name: "DepositPromoMinimumAmountNotMetError";
|
|
99
99
|
message: string;
|
|
100
100
|
} | {
|
|
101
|
-
name:
|
|
101
|
+
name: "MaximumDepositAmountExceededError";
|
|
102
102
|
message: string;
|
|
103
103
|
} | {
|
|
104
|
-
name:
|
|
104
|
+
name: "MinimumDepositAmountNotMetError";
|
|
105
105
|
message: string;
|
|
106
106
|
} | {
|
|
107
|
-
name:
|
|
107
|
+
name: "MinimumFirstDepositAmountNotMetError";
|
|
108
108
|
message: string;
|
|
109
109
|
} | {
|
|
110
|
-
name:
|
|
110
|
+
name: "PromoNotEnabledError";
|
|
111
111
|
message: string;
|
|
112
112
|
} | {
|
|
113
|
-
name:
|
|
113
|
+
name: "WalletDoesNotExistError";
|
|
114
114
|
message: string;
|
|
115
115
|
} | {
|
|
116
|
-
name:
|
|
116
|
+
name: "ReCAPTCHAVerificationFailedError";
|
|
117
117
|
message: string;
|
|
118
118
|
} | {
|
|
119
|
-
name:
|
|
119
|
+
name: "UPIReferenceNotAvailableError";
|
|
120
120
|
message: string;
|
|
121
121
|
} | {
|
|
122
|
-
name:
|
|
122
|
+
name: "GCashDirectApiRequestError";
|
|
123
123
|
message: string;
|
|
124
124
|
};
|
|
125
125
|
export interface CreateGCashDepositMutation {
|
|
@@ -132,7 +132,7 @@ export interface CreateGCashDepositMutationVariables {
|
|
|
132
132
|
promo?: string;
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
export type CreateGCashDepositInput = Simplify<CreateGCashDepositMutationVariables[
|
|
135
|
+
export type CreateGCashDepositInput = Simplify<CreateGCashDepositMutationVariables["input"]>;
|
|
136
136
|
export declare const createGCashDeposit: (input: CreateGCashDepositInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
137
137
|
export interface CreateLibanganDepositMutationVariables {
|
|
138
138
|
input: {
|
|
@@ -142,7 +142,7 @@ export interface CreateLibanganDepositMutationVariables {
|
|
|
142
142
|
redirectUrl?: string;
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
export type CreateLibanganDepositInput = Simplify<CreateLibanganDepositMutationVariables[
|
|
145
|
+
export type CreateLibanganDepositInput = Simplify<CreateLibanganDepositMutationVariables["input"]>;
|
|
146
146
|
export interface CreateLibanganDepositMutation {
|
|
147
147
|
createLibanganPayInDeposit?: null | CreateDepositError;
|
|
148
148
|
}
|
|
@@ -155,7 +155,7 @@ export interface CreateLibanganDepositMutationVariables {
|
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
157
|
export declare const createLibanganDeposit: (input: CreateLibanganDepositInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
158
|
-
export type CreatePisoPayDepositInput = Simplify<CreatePisoPayDepositMutationVariables[
|
|
158
|
+
export type CreatePisoPayDepositInput = Simplify<CreatePisoPayDepositMutationVariables["input"]>;
|
|
159
159
|
export interface CreatePisoPayDepositMutation {
|
|
160
160
|
createPisoPayDeposit?: null | CreateDepositError;
|
|
161
161
|
}
|
|
@@ -178,7 +178,7 @@ export interface CreateGCashDirectWebpayDepositMutationVariables {
|
|
|
178
178
|
promo?: string;
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
-
export type CreateGCashDirectWebpayDepositInput = Simplify<CreateGCashDirectWebpayDepositMutationVariables[
|
|
181
|
+
export type CreateGCashDirectWebpayDepositInput = Simplify<CreateGCashDirectWebpayDepositMutationVariables["input"]>;
|
|
182
182
|
export declare const createGCashDirectWebpayDeposit: (input: CreateGCashDirectWebpayDepositInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
183
183
|
export interface CreateMayaDepositMutation {
|
|
184
184
|
createMayaDeposit?: null | CreateDepositError;
|
|
@@ -190,7 +190,7 @@ export interface CreateMayaDepositMutationVariables {
|
|
|
190
190
|
promo?: string;
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
export type CreateMayaDepositInput = Simplify<CreateMayaDepositMutationVariables[
|
|
193
|
+
export type CreateMayaDepositInput = Simplify<CreateMayaDepositMutationVariables["input"]>;
|
|
194
194
|
export declare const createMayaDeposit: (input: CreateMayaDepositInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
195
195
|
export interface CreateAIOQRPHDepositMutation {
|
|
196
196
|
createAIOQRPHDeposit?: null | CreateDepositError;
|
|
@@ -202,7 +202,7 @@ export interface CreateAIOQRPHDepositMutationVariables {
|
|
|
202
202
|
promo?: string;
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
|
-
export type CreateAIOQRPHDepositInput = Simplify<CreateMayaAppDepositMutationVariables[
|
|
205
|
+
export type CreateAIOQRPHDepositInput = Simplify<CreateMayaAppDepositMutationVariables["input"]>;
|
|
206
206
|
export declare const createAIOQRPHDeposit: (input: CreateAIOQRPHDepositInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
207
207
|
export interface CreateAIOOnlineBankDepositMutation {
|
|
208
208
|
createAIOOnlineBankDeposit?: null | CreateDepositError;
|
|
@@ -214,7 +214,7 @@ export interface CreateAIOOnlineBankDepositMutationVariables {
|
|
|
214
214
|
promo?: string;
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
|
-
export type CreateAIOOnlineBankDepositInput = Simplify<CreateAIOOnlineBankDepositMutationVariables[
|
|
217
|
+
export type CreateAIOOnlineBankDepositInput = Simplify<CreateAIOOnlineBankDepositMutationVariables["input"]>;
|
|
218
218
|
export declare const createAIOOnlineBankDeposit: (input: CreateAIOOnlineBankDepositInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
219
219
|
export interface CreateManualBankDepositMutation {
|
|
220
220
|
createManualBankDeposit?: null | CreateDepositError;
|
|
@@ -227,7 +227,7 @@ export interface CreateManualBankDeposiMutationVariables {
|
|
|
227
227
|
promo?: string;
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
|
-
export type CreateManualBankDepositInput = Simplify<CreateManualBankDeposiMutationVariables[
|
|
230
|
+
export type CreateManualBankDepositInput = Simplify<CreateManualBankDeposiMutationVariables["input"]>;
|
|
231
231
|
export declare const createManualBankDeposit: (input: CreateManualBankDepositInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
232
232
|
export interface CreateManualUPIDepositMutation {
|
|
233
233
|
createManualUPIDeposit?: null | CreateDepositError;
|
|
@@ -241,7 +241,7 @@ export interface CreateManualUPIDepositMutationVariables {
|
|
|
241
241
|
promo?: string;
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
export type CreateManualUPIDepositInput = Simplify<CreateManualUPIDepositMutationVariables[
|
|
244
|
+
export type CreateManualUPIDepositInput = Simplify<CreateManualUPIDepositMutationVariables["input"]>;
|
|
245
245
|
export declare const createManualUPIDeposit: (input: CreateManualUPIDepositInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
246
246
|
export interface CreateMayaAppDepositMutation {
|
|
247
247
|
createMayaAppDeposit?: null | CreateDepositError;
|
|
@@ -253,36 +253,39 @@ export interface CreateMayaAppDepositMutationVariables {
|
|
|
253
253
|
promo?: string;
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
|
-
export type CreateMayaAppDepositInput = Simplify<CreateMayaAppDepositMutationVariables[
|
|
256
|
+
export type CreateMayaAppDepositInput = Simplify<CreateMayaAppDepositMutationVariables["input"]>;
|
|
257
257
|
export declare const createMayaAppDeposit: (input: CreateMayaAppDepositInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
258
258
|
export type CreateWithdrawalError = {
|
|
259
|
-
name:
|
|
259
|
+
name: "AccountNotVerifiedError";
|
|
260
260
|
message: string;
|
|
261
261
|
} | {
|
|
262
|
-
name:
|
|
262
|
+
name: "InvalidTransactionPasswordError";
|
|
263
263
|
message: string;
|
|
264
264
|
} | {
|
|
265
|
-
name:
|
|
265
|
+
name: "InvalidWithdrawalAmountError";
|
|
266
266
|
message: string;
|
|
267
267
|
} | {
|
|
268
|
-
name:
|
|
268
|
+
name: "MobileNumberNotVerifiedError";
|
|
269
269
|
message: string;
|
|
270
270
|
} | {
|
|
271
|
-
name:
|
|
271
|
+
name: "NotEnoughBalanceError";
|
|
272
272
|
message: string;
|
|
273
273
|
} | {
|
|
274
|
-
name:
|
|
274
|
+
name: "WithdrawalDailyLimitExceededError";
|
|
275
275
|
message: string;
|
|
276
276
|
} | {
|
|
277
|
-
name:
|
|
277
|
+
name: "ReCAPTCHAVerificationFailedError";
|
|
278
278
|
message: string;
|
|
279
279
|
} | {
|
|
280
|
-
name:
|
|
280
|
+
name: "WalletDoesNotExistError";
|
|
281
281
|
message: string;
|
|
282
282
|
};
|
|
283
283
|
export interface CreateGCashWithdrawalMutation {
|
|
284
284
|
createGCashWithdrawal?: null | CreateWithdrawalError;
|
|
285
285
|
}
|
|
286
|
+
export interface CreateGCashStandardCashInWithdrawalMutation {
|
|
287
|
+
createGCashStandardCashInWithdrawal?: null | CreateWithdrawalError;
|
|
288
|
+
}
|
|
286
289
|
export interface CreateGCashWithdrawalMutationVariables {
|
|
287
290
|
input: {
|
|
288
291
|
id: string;
|
|
@@ -291,8 +294,18 @@ export interface CreateGCashWithdrawalMutationVariables {
|
|
|
291
294
|
recipientMobileNumber: string;
|
|
292
295
|
};
|
|
293
296
|
}
|
|
294
|
-
export
|
|
297
|
+
export interface CreateGCashStandardCashInWithdrawalMutationVariables {
|
|
298
|
+
input: {
|
|
299
|
+
id: string;
|
|
300
|
+
amount: string;
|
|
301
|
+
transactionPassword: string;
|
|
302
|
+
recipientMobileNumber: string;
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
export type CreateGCashWithdrawalInput = Simplify<CreateGCashWithdrawalMutationVariables["input"]>;
|
|
306
|
+
export type CreateGCashStandardCashInWithdrawalInput = Simplify<CreateGCashStandardCashInWithdrawalMutationVariables["input"]>;
|
|
295
307
|
export declare const createGCashWithdrawal: (input: CreateGCashWithdrawalInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
308
|
+
export declare const createGCashStandardCashInWithdrawal: (input: CreateGCashStandardCashInWithdrawalInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
296
309
|
export interface CreatePisoPayWithdrawalMutation {
|
|
297
310
|
createPisopayWithdrawal?: null | CreateWithdrawalError;
|
|
298
311
|
}
|
|
@@ -305,7 +318,7 @@ export interface CreatePisoPayWithdrawalMutationVariables {
|
|
|
305
318
|
};
|
|
306
319
|
transactionPassword: string;
|
|
307
320
|
}
|
|
308
|
-
export type CreatePisoPayWithdrawalInput = Simplify<CreatePisoPayWithdrawalMutationVariables[
|
|
321
|
+
export type CreatePisoPayWithdrawalInput = Simplify<CreatePisoPayWithdrawalMutationVariables["input"] & {
|
|
309
322
|
transactionPassword: string;
|
|
310
323
|
}>;
|
|
311
324
|
export declare const createPisoPayWithdrawal: (input: CreatePisoPayWithdrawalInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
@@ -320,7 +333,7 @@ export interface CreateMayaWithdrawalMutationVariables {
|
|
|
320
333
|
recipientMobileNumber: string;
|
|
321
334
|
};
|
|
322
335
|
}
|
|
323
|
-
export type CreateMayaWithdrawalInput = Simplify<CreateMayaWithdrawalMutationVariables[
|
|
336
|
+
export type CreateMayaWithdrawalInput = Simplify<CreateMayaWithdrawalMutationVariables["input"]>;
|
|
324
337
|
export declare const createMayaWithdrawal: (input: CreateMayaWithdrawalInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
325
338
|
export interface CreateMayaAppWithdrawalMutation {
|
|
326
339
|
createMayaAppWithdrawal?: null | CreateWithdrawalError;
|
|
@@ -332,7 +345,7 @@ export interface CreateMayaAppWithdrawalMutationVariables {
|
|
|
332
345
|
transactionPassword: string;
|
|
333
346
|
};
|
|
334
347
|
}
|
|
335
|
-
export type CreateMayaAppWithdrawalInput = Simplify<CreateMayaAppWithdrawalMutationVariables[
|
|
348
|
+
export type CreateMayaAppWithdrawalInput = Simplify<CreateMayaAppWithdrawalMutationVariables["input"]>;
|
|
336
349
|
export declare const createMayaAppWithdrawal: (input: CreateMayaAppWithdrawalInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
337
350
|
export interface CreateBankWithdrawalMutation {
|
|
338
351
|
createBankWithdrawal?: null | CreateWithdrawalError;
|
|
@@ -344,7 +357,7 @@ export interface CreateBankWithdrawalMutationVariables {
|
|
|
344
357
|
transactionPassword: string;
|
|
345
358
|
};
|
|
346
359
|
}
|
|
347
|
-
export type CreateBankWithdrawalInput = Simplify<CreateBankWithdrawalMutationVariables[
|
|
360
|
+
export type CreateBankWithdrawalInput = Simplify<CreateBankWithdrawalMutationVariables["input"]>;
|
|
348
361
|
export declare const createBankWithdrawal: (input: CreateBankWithdrawalInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
349
362
|
export interface CreateAIOInstapayWithdrawalMutationVariables {
|
|
350
363
|
input: {
|
|
@@ -372,8 +385,8 @@ export interface CreateAIOInstapayWithdrawalMutation {
|
|
|
372
385
|
export interface CreateAIOInstapayWithdrawalNextMutation {
|
|
373
386
|
createAIOInstapayWithdrawal_next?: null | CreateWithdrawalError;
|
|
374
387
|
}
|
|
375
|
-
export type CreateAIOInstapayWithdrawalInput = Simplify<CreateAIOInstapayWithdrawalMutationVariables[
|
|
376
|
-
export type CreateAIOInstapayWithdrawalNextInput = Simplify<CreateAIOInstapayWithdrawalNextMutationVariables[
|
|
388
|
+
export type CreateAIOInstapayWithdrawalInput = Simplify<CreateAIOInstapayWithdrawalMutationVariables["input"]>;
|
|
389
|
+
export type CreateAIOInstapayWithdrawalNextInput = Simplify<CreateAIOInstapayWithdrawalNextMutationVariables["input"]>;
|
|
377
390
|
export declare const createAIOInstapayWithdrawal: (input: CreateAIOInstapayWithdrawalInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
378
391
|
export declare const createAIOInstapayWithdrawalNext: (input: CreateAIOInstapayWithdrawalNextInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
379
392
|
export interface CreateVentajaDisbursementWithdrawalVariables {
|
|
@@ -388,8 +401,8 @@ export interface CreateVentajaDisbursementWithdrawalVariables {
|
|
|
388
401
|
export interface CreateVentajaDisbursementWithdrawalMutation {
|
|
389
402
|
createVentajaDisbursementWithdrawal?: null | CreateWithdrawalError;
|
|
390
403
|
}
|
|
391
|
-
export type CreateVentajaDisbursementWithdrawalInput = Simplify<CreateVentajaDisbursementWithdrawalVariables[
|
|
392
|
-
export type CreateVentajaDisbursmentTransactionPasswordInput = Simplify<CreateVentajaDisbursementWithdrawalVariables[
|
|
404
|
+
export type CreateVentajaDisbursementWithdrawalInput = Simplify<CreateVentajaDisbursementWithdrawalVariables["input"]>;
|
|
405
|
+
export type CreateVentajaDisbursmentTransactionPasswordInput = Simplify<CreateVentajaDisbursementWithdrawalVariables["transactionPassword"]>;
|
|
393
406
|
export declare const createVentajaDisbursementWithdrawal: (input: CreateVentajaDisbursementWithdrawalInput, transactionPassword: CreateVentajaDisbursmentTransactionPasswordInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
394
407
|
export interface CreateManualUpiWithdrawalMutation {
|
|
395
408
|
createManualUpiWithdrawal?: null | CreateWithdrawalError;
|
|
@@ -401,7 +414,7 @@ export interface CreateManualUpiWithdrawalMutationVariables {
|
|
|
401
414
|
upiId: string;
|
|
402
415
|
};
|
|
403
416
|
}
|
|
404
|
-
export type CreateManualUpiWithdrawalInput = Simplify<CreateManualUpiWithdrawalMutationVariables[
|
|
417
|
+
export type CreateManualUpiWithdrawalInput = Simplify<CreateManualUpiWithdrawalMutationVariables["input"]>;
|
|
405
418
|
export declare const createManualUpiWithdrawal: (input: CreateManualUpiWithdrawalInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
406
419
|
export interface CreateManualBankWithdrawalMutation {
|
|
407
420
|
createManualBankWithdrawal?: null | CreateWithdrawalError;
|
|
@@ -416,7 +429,7 @@ export interface CreateManualBankWithdrawalMutationVariables {
|
|
|
416
429
|
promo?: string;
|
|
417
430
|
};
|
|
418
431
|
}
|
|
419
|
-
export type CreateManualBankWithdrawalInput = Simplify<CreateManualBankWithdrawalMutationVariables[
|
|
432
|
+
export type CreateManualBankWithdrawalInput = Simplify<CreateManualBankWithdrawalMutationVariables["input"]>;
|
|
420
433
|
export declare const createManualBankWithdrawal: (input: CreateManualBankWithdrawalInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
421
434
|
export interface InstapayBankListQuery {
|
|
422
435
|
instapayBankList: InstapayBank[];
|
|
@@ -436,10 +449,10 @@ export interface RedeemPointsToCashMutationVariables {
|
|
|
436
449
|
};
|
|
437
450
|
}
|
|
438
451
|
export type RedeemPointsToCashError = {
|
|
439
|
-
name:
|
|
452
|
+
name: "InsufficientPointsError";
|
|
440
453
|
message: string;
|
|
441
454
|
} | {
|
|
442
|
-
name:
|
|
455
|
+
name: "PointsNotDivisibleBy100Error";
|
|
443
456
|
message: string;
|
|
444
457
|
};
|
|
445
458
|
export interface RedeemPointsToCashMutation {
|
|
@@ -461,7 +474,7 @@ export interface GameSessionQueryVariables {
|
|
|
461
474
|
}
|
|
462
475
|
export declare const getGameSession: (id: string, options?: GraphQLRequestOptions) => Promise<GameSession | null>;
|
|
463
476
|
export type CreateGameSessionError = {
|
|
464
|
-
name:
|
|
477
|
+
name: "GameDoesNotExistError";
|
|
465
478
|
message: string;
|
|
466
479
|
};
|
|
467
480
|
export interface CreateGameSessionMutation {
|
|
@@ -473,7 +486,7 @@ export interface CreateGameSessionMutationVariables {
|
|
|
473
486
|
game: string;
|
|
474
487
|
};
|
|
475
488
|
}
|
|
476
|
-
export type CreateGameSessionInput = Simplify<CreateGameSessionMutationVariables[
|
|
489
|
+
export type CreateGameSessionInput = Simplify<CreateGameSessionMutationVariables["input"]>;
|
|
477
490
|
export declare const createGameSession: (input: CreateGameSessionInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
478
491
|
export interface EndGameSessionMutation {
|
|
479
492
|
endGameSession: boolean;
|
|
@@ -507,13 +520,13 @@ export interface BonusIdsQuery {
|
|
|
507
520
|
}
|
|
508
521
|
export declare const getBonusesCount: (options?: GraphQLRequestOptions) => Promise<number>;
|
|
509
522
|
export type ClaimSpotBonusError = {
|
|
510
|
-
name:
|
|
523
|
+
name: "InvalidPromoCodeError";
|
|
511
524
|
message: string;
|
|
512
525
|
} | {
|
|
513
|
-
name:
|
|
526
|
+
name: "MaximumBonusesCountLimitExceededError";
|
|
514
527
|
message: string;
|
|
515
528
|
} | {
|
|
516
|
-
name:
|
|
529
|
+
name: "SpotBonusAlreadyClaimedError";
|
|
517
530
|
message: string;
|
|
518
531
|
};
|
|
519
532
|
export interface ClaimSpotBonusMutationVariables {
|
package/dist/services/wallet.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { cache } from
|
|
2
|
-
import { WALLET_GRAPHQL_ENDPOINT } from
|
|
3
|
-
import { parseDecimal } from
|
|
4
|
-
import { graphqlRequest } from
|
|
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_INSTAPAY_WITHDRAWAL_NEXT, 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_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_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, REMAINING_DAILY_WITHDRAWALS_COUNT, TOUCH_GCASH_DEPOSIT, TOUCH_QRPH_DEPOSIT, UNMARK_GAME_AS_FAVORITE, VALIDATE_MAYA_SESSION, WALLET, } from
|
|
6
|
-
import { sha256 } from
|
|
1
|
+
import { cache } from "react";
|
|
2
|
+
import { WALLET_GRAPHQL_ENDPOINT } from "../constants/index.js";
|
|
3
|
+
import { parseDecimal } from "../utils/parseDecimal.js";
|
|
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_INSTAPAY_WITHDRAWAL, CREATE_AIO_INSTAPAY_WITHDRAWAL_NEXT, 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_GCASH_STANDARD_CASH_IN_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_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, REMAINING_DAILY_WITHDRAWALS_COUNT, TOUCH_GCASH_DEPOSIT, TOUCH_QRPH_DEPOSIT, UNMARK_GAME_AS_FAVORITE, VALIDATE_MAYA_SESSION, WALLET, } from "./queries.js";
|
|
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, {
|
|
9
|
-
cache:
|
|
9
|
+
cache: "force-cache",
|
|
10
10
|
...options,
|
|
11
11
|
next: {
|
|
12
|
-
tags: [
|
|
12
|
+
tags: ["promos"],
|
|
13
13
|
revalidate: 60,
|
|
14
14
|
...options?.next,
|
|
15
15
|
},
|
|
@@ -18,10 +18,10 @@ export const getPromos = cache(async (options) => {
|
|
|
18
18
|
});
|
|
19
19
|
export const getCashbacks = cache(async (options) => {
|
|
20
20
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACKS, undefined, {
|
|
21
|
-
cache:
|
|
21
|
+
cache: "force-cache",
|
|
22
22
|
...options,
|
|
23
23
|
next: {
|
|
24
|
-
tags: [
|
|
24
|
+
tags: ["cashbacks"],
|
|
25
25
|
revalidate: 60,
|
|
26
26
|
...options?.next,
|
|
27
27
|
},
|
|
@@ -30,10 +30,10 @@ export const getCashbacks = cache(async (options) => {
|
|
|
30
30
|
});
|
|
31
31
|
export const getPromo = cache(async (id, options) => {
|
|
32
32
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, PROMO, { id }, {
|
|
33
|
-
cache:
|
|
33
|
+
cache: "force-cache",
|
|
34
34
|
...options,
|
|
35
35
|
next: {
|
|
36
|
-
tags: [
|
|
36
|
+
tags: ["promo", id],
|
|
37
37
|
revalidate: 60,
|
|
38
38
|
...options?.next,
|
|
39
39
|
},
|
|
@@ -42,10 +42,10 @@ export const getPromo = cache(async (id, options) => {
|
|
|
42
42
|
});
|
|
43
43
|
export const getCashback = cache(async (id, options) => {
|
|
44
44
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CASHBACK, { id }, {
|
|
45
|
-
cache:
|
|
45
|
+
cache: "force-cache",
|
|
46
46
|
...options,
|
|
47
47
|
next: {
|
|
48
|
-
tags: [
|
|
48
|
+
tags: ["cashback", id],
|
|
49
49
|
revalidate: 60,
|
|
50
50
|
...options?.next,
|
|
51
51
|
},
|
|
@@ -88,12 +88,12 @@ export const getWallet = cache(async (options) => {
|
|
|
88
88
|
graphqlRequest(WALLET_GRAPHQL_ENDPOINT, BONUS_BALANCES, undefined, options),
|
|
89
89
|
]);
|
|
90
90
|
return {
|
|
91
|
-
balance: res0.status ===
|
|
92
|
-
bonus: res1.status ===
|
|
93
|
-
?
|
|
91
|
+
balance: res0.status === "fulfilled" ? res0.value.wallet?.balance ?? "0" : "0",
|
|
92
|
+
bonus: res1.status === "fulfilled"
|
|
93
|
+
? res1.value.bonuses
|
|
94
94
|
?.reduce((total, n) => total + parseDecimal(n.balance, 0), 0)
|
|
95
|
-
.toString() ??
|
|
96
|
-
:
|
|
95
|
+
.toString() ?? "0"
|
|
96
|
+
: "0",
|
|
97
97
|
};
|
|
98
98
|
});
|
|
99
99
|
export const getDeposit = cache(async (id, options) => {
|
|
@@ -218,6 +218,22 @@ export const createGCashWithdrawal = async (input, options) => {
|
|
|
218
218
|
throw error;
|
|
219
219
|
}
|
|
220
220
|
};
|
|
221
|
+
export const createGCashStandardCashInWithdrawal = async (input, options) => {
|
|
222
|
+
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_GCASH_STANDARD_CASH_IN_WITHDRAWAL, {
|
|
223
|
+
input: {
|
|
224
|
+
...input,
|
|
225
|
+
transactionPassword: await sha256(input.transactionPassword),
|
|
226
|
+
},
|
|
227
|
+
}, options);
|
|
228
|
+
if (res.createGCashStandardCashInWithdrawal) {
|
|
229
|
+
const error = new Error();
|
|
230
|
+
error.name = res.createGCashStandardCashInWithdrawal.name;
|
|
231
|
+
error.message =
|
|
232
|
+
ERROR_CODES_MESSAGE_MAP[res.createGCashStandardCashInWithdrawal.name];
|
|
233
|
+
Error.captureStackTrace?.(error, createGCashStandardCashInWithdrawal);
|
|
234
|
+
throw error;
|
|
235
|
+
}
|
|
236
|
+
};
|
|
221
237
|
export const createPisoPayWithdrawal = async (input, options) => {
|
|
222
238
|
const { transactionPassword, ...others } = input;
|
|
223
239
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, CREATE_PISO_PAY_WITHDRAWAL, {
|
|
@@ -343,11 +359,11 @@ export const createManualBankWithdrawal = async (input, options) => {
|
|
|
343
359
|
};
|
|
344
360
|
export const getInstapayBankList = cache(async (options) => {
|
|
345
361
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, INSTAPAY_BANK_LIST, undefined, {
|
|
346
|
-
cache:
|
|
362
|
+
cache: "force-cache",
|
|
347
363
|
...options,
|
|
348
364
|
next: {
|
|
349
365
|
revalidate: 60 * 60 * 4,
|
|
350
|
-
tags: [
|
|
366
|
+
tags: ["instapayBankList"],
|
|
351
367
|
},
|
|
352
368
|
});
|
|
353
369
|
return res.instapayBankList;
|
|
@@ -392,8 +408,8 @@ export const endGameSession = async (id, options) => {
|
|
|
392
408
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, END_GAME_SESSION, { input: { id } }, options);
|
|
393
409
|
if (!res.endGameSession) {
|
|
394
410
|
const error = new Error();
|
|
395
|
-
error.name =
|
|
396
|
-
error.message =
|
|
411
|
+
error.name = "UnknownError";
|
|
412
|
+
error.message = "Something went wrong";
|
|
397
413
|
Error.captureStackTrace?.(error, endGameSession);
|
|
398
414
|
throw error;
|
|
399
415
|
}
|
|
@@ -402,8 +418,8 @@ export const validateMayaSession = async (options) => {
|
|
|
402
418
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, VALIDATE_MAYA_SESSION, undefined, options);
|
|
403
419
|
if (!res.validateMayaSession) {
|
|
404
420
|
const error = new Error();
|
|
405
|
-
error.name =
|
|
406
|
-
error.message =
|
|
421
|
+
error.name = "UnknownError";
|
|
422
|
+
error.message = "Something went wrong";
|
|
407
423
|
Error.captureStackTrace?.(error, validateMayaSession);
|
|
408
424
|
throw error;
|
|
409
425
|
}
|
|
@@ -430,8 +446,8 @@ export const touchGCashDeposit = async (id, options) => {
|
|
|
430
446
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, TOUCH_GCASH_DEPOSIT, { input: { id } }, options);
|
|
431
447
|
if (!res.touchGCashDeposit) {
|
|
432
448
|
const error = new Error();
|
|
433
|
-
error.name =
|
|
434
|
-
error.message =
|
|
449
|
+
error.name = "UnknownError";
|
|
450
|
+
error.message = "Something went wrong";
|
|
435
451
|
Error.captureStackTrace?.(error, touchGCashDeposit);
|
|
436
452
|
throw error;
|
|
437
453
|
}
|
|
@@ -440,8 +456,8 @@ export const touchQRPHDeposit = async (id, options) => {
|
|
|
440
456
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, TOUCH_QRPH_DEPOSIT, { input: { id } }, options);
|
|
441
457
|
if (!res.touchQRPHDeposit) {
|
|
442
458
|
const error = new Error();
|
|
443
|
-
error.name =
|
|
444
|
-
error.message =
|
|
459
|
+
error.name = "UnknownError";
|
|
460
|
+
error.message = "Something went wrong";
|
|
445
461
|
Error.captureStackTrace?.(error, touchQRPHDeposit);
|
|
446
462
|
throw error;
|
|
447
463
|
}
|
|
@@ -450,8 +466,8 @@ export const markGameAsFavorite = async (id, options) => {
|
|
|
450
466
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, MARK_GAME_AS_FAVORITE, { input: { id } }, options);
|
|
451
467
|
if (!res.markGameAsFavorite) {
|
|
452
468
|
const error = new Error();
|
|
453
|
-
error.name =
|
|
454
|
-
error.message =
|
|
469
|
+
error.name = "UnknownError";
|
|
470
|
+
error.message = "Something went wrong";
|
|
455
471
|
Error.captureStackTrace?.(error, markGameAsFavorite);
|
|
456
472
|
throw error;
|
|
457
473
|
}
|
|
@@ -460,8 +476,8 @@ export const unmarkGameAsFavorite = async (id, options) => {
|
|
|
460
476
|
const res = await graphqlRequest(WALLET_GRAPHQL_ENDPOINT, UNMARK_GAME_AS_FAVORITE, { input: { id } }, options);
|
|
461
477
|
if (!res.unmarkGameAsFavorite) {
|
|
462
478
|
const error = new Error();
|
|
463
|
-
error.name =
|
|
464
|
-
error.message =
|
|
479
|
+
error.name = "UnknownError";
|
|
480
|
+
error.message = "Something went wrong";
|
|
465
481
|
Error.captureStackTrace?.(error, unmarkGameAsFavorite);
|
|
466
482
|
throw error;
|
|
467
483
|
}
|
|
@@ -471,27 +487,27 @@ export const getFavoriteGames = cache(async (options) => {
|
|
|
471
487
|
return res.favoriteGames;
|
|
472
488
|
});
|
|
473
489
|
const ERROR_CODES_MESSAGE_MAP = {
|
|
474
|
-
PointsNotDivisibleBy100Error:
|
|
475
|
-
MaximumBonusesCountLimitExceededError:
|
|
476
|
-
InvalidPromoCodeError:
|
|
477
|
-
SpotBonusAlreadyClaimedError:
|
|
478
|
-
AccountNotVerifiedError:
|
|
479
|
-
CashbackBonusDoesNotExistError:
|
|
480
|
-
DepositPromoMaximumAmountExceededError:
|
|
481
|
-
DepositPromoMinimumAmountNotMetError:
|
|
482
|
-
GameDoesNotExistError:
|
|
483
|
-
InsufficientPointsError:
|
|
484
|
-
InvalidTransactionPasswordError:
|
|
485
|
-
InvalidWithdrawalAmountError:
|
|
486
|
-
MaximumDepositAmountExceededError:
|
|
487
|
-
MinimumDepositAmountNotMetError:
|
|
488
|
-
MinimumFirstDepositAmountNotMetError:
|
|
489
|
-
MobileNumberNotVerifiedError:
|
|
490
|
-
NotEnoughBalanceError:
|
|
491
|
-
PromoNotEnabledError:
|
|
492
|
-
WalletDoesNotExistError:
|
|
493
|
-
WithdrawalDailyLimitExceededError:
|
|
494
|
-
ReCAPTCHAVerificationFailedError:
|
|
495
|
-
UPIReferenceNotAvailableError:
|
|
496
|
-
GCashDirectApiRequestError:
|
|
490
|
+
PointsNotDivisibleBy100Error: "Please input points that are multiples of 100.",
|
|
491
|
+
MaximumBonusesCountLimitExceededError: "Maximum bonuses reached",
|
|
492
|
+
InvalidPromoCodeError: "Invalid Promo Code",
|
|
493
|
+
SpotBonusAlreadyClaimedError: "This promo code has already been redeemed and cannot be used again",
|
|
494
|
+
AccountNotVerifiedError: "Account is not verified",
|
|
495
|
+
CashbackBonusDoesNotExistError: "Cashback bonus does not exists",
|
|
496
|
+
DepositPromoMaximumAmountExceededError: "Deposit amount exceeds maximum amount for selected promo",
|
|
497
|
+
DepositPromoMinimumAmountNotMetError: "Deposit amount does not meet minimum amount for selected promo",
|
|
498
|
+
GameDoesNotExistError: "Game does not exist",
|
|
499
|
+
InsufficientPointsError: "Insufficient points",
|
|
500
|
+
InvalidTransactionPasswordError: "Invalid transaction password",
|
|
501
|
+
InvalidWithdrawalAmountError: "Invalid withdrawal amount",
|
|
502
|
+
MaximumDepositAmountExceededError: "Maximum deposit amount exceeded",
|
|
503
|
+
MinimumDepositAmountNotMetError: "Minimum deposit amount not met",
|
|
504
|
+
MinimumFirstDepositAmountNotMetError: "Minimum first deposit amount not met",
|
|
505
|
+
MobileNumberNotVerifiedError: "Mobile number is not verified",
|
|
506
|
+
NotEnoughBalanceError: "Insufficient balance",
|
|
507
|
+
PromoNotEnabledError: "Promo is not enabled",
|
|
508
|
+
WalletDoesNotExistError: "Wallet does not exist",
|
|
509
|
+
WithdrawalDailyLimitExceededError: "Daily withdrawal limit exceeded",
|
|
510
|
+
ReCAPTCHAVerificationFailedError: "Invalid reCAPTCHA",
|
|
511
|
+
UPIReferenceNotAvailableError: "UPI reference is no longer available",
|
|
512
|
+
GCashDirectApiRequestError: "GCash direct API request error",
|
|
497
513
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MutationKey } from
|
|
1
|
+
import type { MutationKey } from "@tanstack/react-query";
|
|
2
2
|
export declare const getAuthenticateMutationKey: () => MutationKey;
|
|
3
3
|
export declare const getCheckInDailyQuestMutationKey: () => MutationKey;
|
|
4
4
|
export declare const getClaimCashbackBonusMutationKey: () => MutationKey;
|
|
@@ -13,6 +13,7 @@ export declare const getCreateQRPHDepositMutationKey: () => MutationKey;
|
|
|
13
13
|
export declare const getCreateLibanganDepositMutationKey: () => MutationKey;
|
|
14
14
|
export declare const getCreatePisoPayDepositMutationKey: () => MutationKey;
|
|
15
15
|
export declare const getCreateGCashWithdrawalMutationKey: () => MutationKey;
|
|
16
|
+
export declare const getCreateGCashStandardCashInWithdrawalMutationKey: () => MutationKey;
|
|
16
17
|
export declare const getCreateMayaWithdrawalMutationKey: () => MutationKey;
|
|
17
18
|
export declare const getCreateMayaAppWithdrawalMutationKey: () => MutationKey;
|
|
18
19
|
export declare const getCreateInstapayWithdrawalMutationKey: () => MutationKey;
|
|
@@ -1,154 +1,155 @@
|
|
|
1
|
-
const PARENT_KEY =
|
|
1
|
+
const PARENT_KEY = "mutations";
|
|
2
2
|
export const getAuthenticateMutationKey = () => [
|
|
3
3
|
PARENT_KEY,
|
|
4
|
-
|
|
4
|
+
"authenticate",
|
|
5
5
|
];
|
|
6
6
|
export const getCheckInDailyQuestMutationKey = () => [
|
|
7
7
|
PARENT_KEY,
|
|
8
|
-
|
|
8
|
+
"checkInDailyQuest",
|
|
9
9
|
];
|
|
10
10
|
export const getClaimCashbackBonusMutationKey = () => [
|
|
11
11
|
PARENT_KEY,
|
|
12
|
-
|
|
12
|
+
"claimCashbackBonus",
|
|
13
13
|
];
|
|
14
14
|
export const getClaimSpotBonusMutationKey = () => [
|
|
15
15
|
PARENT_KEY,
|
|
16
|
-
|
|
16
|
+
"claimSpotBonus",
|
|
17
17
|
];
|
|
18
18
|
export const getCreateDigitainGameSessionMutationKey = () => [
|
|
19
19
|
PARENT_KEY,
|
|
20
|
-
|
|
20
|
+
"createDigitainGameSession",
|
|
21
21
|
];
|
|
22
22
|
export const getCreateGameSessionMutationKey = () => [
|
|
23
23
|
PARENT_KEY,
|
|
24
|
-
|
|
24
|
+
"createGameSession",
|
|
25
25
|
];
|
|
26
26
|
export const getCreateGCashDepositMutationKey = () => [
|
|
27
27
|
PARENT_KEY,
|
|
28
|
-
|
|
28
|
+
"createGCashDeposit",
|
|
29
29
|
];
|
|
30
30
|
export const getCreateMayaAppDepositMutationKey = () => [
|
|
31
31
|
PARENT_KEY,
|
|
32
|
-
|
|
32
|
+
"createMayaAppDeposit",
|
|
33
33
|
];
|
|
34
34
|
export const getCreateMayaDepositMutationKey = () => [
|
|
35
35
|
PARENT_KEY,
|
|
36
|
-
|
|
36
|
+
"createMayaDeposit",
|
|
37
37
|
];
|
|
38
38
|
export const getCreateOnlineBankDepositMutationKey = () => [
|
|
39
39
|
PARENT_KEY,
|
|
40
|
-
|
|
40
|
+
"createOnlineBankDeposit",
|
|
41
41
|
];
|
|
42
42
|
export const getCreateQRPHDepositMutationKey = () => [
|
|
43
43
|
PARENT_KEY,
|
|
44
|
-
|
|
44
|
+
"createQRPHDeposit",
|
|
45
45
|
];
|
|
46
46
|
export const getCreateLibanganDepositMutationKey = () => [
|
|
47
47
|
PARENT_KEY,
|
|
48
|
-
|
|
48
|
+
"createLibanganDeposit",
|
|
49
49
|
];
|
|
50
50
|
export const getCreatePisoPayDepositMutationKey = () => [
|
|
51
51
|
PARENT_KEY,
|
|
52
|
-
|
|
52
|
+
"createPisoPayDeposit",
|
|
53
53
|
];
|
|
54
54
|
export const getCreateGCashWithdrawalMutationKey = () => [
|
|
55
55
|
PARENT_KEY,
|
|
56
|
-
|
|
56
|
+
"createGCashWithdrawal",
|
|
57
57
|
];
|
|
58
|
+
export const getCreateGCashStandardCashInWithdrawalMutationKey = () => [PARENT_KEY, "createGCashStandardCashInWithdrawal"];
|
|
58
59
|
export const getCreateMayaWithdrawalMutationKey = () => [
|
|
59
60
|
PARENT_KEY,
|
|
60
|
-
|
|
61
|
+
"createMayaWithdrawal",
|
|
61
62
|
];
|
|
62
63
|
export const getCreateMayaAppWithdrawalMutationKey = () => [
|
|
63
64
|
PARENT_KEY,
|
|
64
|
-
|
|
65
|
+
"createMayaAppWithdrawal",
|
|
65
66
|
];
|
|
66
67
|
export const getCreateInstapayWithdrawalMutationKey = () => [
|
|
67
68
|
PARENT_KEY,
|
|
68
|
-
|
|
69
|
+
"createInstapayWithdrawal",
|
|
69
70
|
];
|
|
70
71
|
export const getCreateInstapayWithdrawalNextMutationKey = () => [
|
|
71
72
|
PARENT_KEY,
|
|
72
|
-
|
|
73
|
+
"createInstapayWithdrawalNext",
|
|
73
74
|
];
|
|
74
|
-
export const getCreateVentajaDisbursementWithdrawalMutationKey = () => [PARENT_KEY,
|
|
75
|
+
export const getCreateVentajaDisbursementWithdrawalMutationKey = () => [PARENT_KEY, "createVentajaDisbursementWithdrawal"];
|
|
75
76
|
export const getCreatePisoPayWithdrawalMutationKey = () => [
|
|
76
77
|
PARENT_KEY,
|
|
77
|
-
|
|
78
|
+
"createPisopayWithdrawal",
|
|
78
79
|
];
|
|
79
80
|
export const getMarkMessageAsReadMutationKey = () => [
|
|
80
81
|
PARENT_KEY,
|
|
81
|
-
|
|
82
|
+
"markMessageAsRead",
|
|
82
83
|
];
|
|
83
84
|
export const getCreateMemberVerificationQueryKey = () => [
|
|
84
85
|
PARENT_KEY,
|
|
85
|
-
|
|
86
|
+
"createMemberVerification",
|
|
86
87
|
];
|
|
87
88
|
export const getApproveMemberVerificationQueryKey = () => [
|
|
88
89
|
PARENT_KEY,
|
|
89
|
-
|
|
90
|
+
"approveMemberVerification",
|
|
90
91
|
];
|
|
91
92
|
export const getEndGameSessionMutationKey = () => [
|
|
92
93
|
PARENT_KEY,
|
|
93
|
-
|
|
94
|
+
"endGameSession",
|
|
94
95
|
];
|
|
95
96
|
export const getMarkGameAsFavoriteMutationKey = () => [
|
|
96
97
|
PARENT_KEY,
|
|
97
|
-
|
|
98
|
+
"markGameAsFavorite",
|
|
98
99
|
];
|
|
99
100
|
export const getUnmarkGameAsFavoriteMutationKey = () => [
|
|
100
101
|
PARENT_KEY,
|
|
101
|
-
|
|
102
|
+
"unmarkGameAsFavorite",
|
|
102
103
|
];
|
|
103
104
|
export const getUpdateAccountMutationKey = () => [
|
|
104
105
|
PARENT_KEY,
|
|
105
|
-
|
|
106
|
+
"updateAccount",
|
|
106
107
|
];
|
|
107
108
|
export const getUpdateMemberVerificationQueryKey = () => [
|
|
108
109
|
PARENT_KEY,
|
|
109
|
-
|
|
110
|
+
"updateMemberVerification",
|
|
110
111
|
];
|
|
111
112
|
export const getSendVerificationCodeMutationKey = () => [
|
|
112
113
|
PARENT_KEY,
|
|
113
|
-
|
|
114
|
+
"sendVerificationCode",
|
|
114
115
|
];
|
|
115
|
-
export const getSignInMutationKey = () => [PARENT_KEY,
|
|
116
|
-
export const getSignOutMutationKey = () => [PARENT_KEY,
|
|
117
|
-
export const getSignUpMutationKey = () => [PARENT_KEY,
|
|
116
|
+
export const getSignInMutationKey = () => [PARENT_KEY, "signIn"];
|
|
117
|
+
export const getSignOutMutationKey = () => [PARENT_KEY, "signOut"];
|
|
118
|
+
export const getSignUpMutationKey = () => [PARENT_KEY, "signUp"];
|
|
118
119
|
export const getCompleteOnboardingMutationKey = () => [
|
|
119
120
|
PARENT_KEY,
|
|
120
|
-
|
|
121
|
+
"completeOnboarding",
|
|
121
122
|
];
|
|
122
123
|
export const getSkipOnboardingMutationKey = () => [
|
|
123
124
|
PARENT_KEY,
|
|
124
|
-
|
|
125
|
+
"skipOnboarding",
|
|
125
126
|
];
|
|
126
127
|
export const getUploadFileMutationKey = () => [
|
|
127
128
|
PARENT_KEY,
|
|
128
|
-
|
|
129
|
+
"uploadFile",
|
|
129
130
|
];
|
|
130
131
|
export const getUploadImageFileMutationKey = () => [
|
|
131
132
|
PARENT_KEY,
|
|
132
|
-
|
|
133
|
+
"uploadImageFile",
|
|
133
134
|
];
|
|
134
135
|
export const getUploadPrivateImageFileMutationKey = () => [
|
|
135
136
|
PARENT_KEY,
|
|
136
|
-
|
|
137
|
+
"uploadPrivateImageFile",
|
|
137
138
|
];
|
|
138
139
|
export const getResetPasswordMutationKey = () => [
|
|
139
140
|
PARENT_KEY,
|
|
140
|
-
|
|
141
|
+
"resetPassword",
|
|
141
142
|
];
|
|
142
143
|
export const getUpdateSessionMutationKey = () => [
|
|
143
144
|
PARENT_KEY,
|
|
144
|
-
|
|
145
|
+
"updateSession",
|
|
145
146
|
];
|
|
146
147
|
export const getUnlinkGoogleMutationKey = () => [
|
|
147
148
|
PARENT_KEY,
|
|
148
|
-
|
|
149
|
+
"unlinkGoogle",
|
|
149
150
|
];
|
|
150
|
-
export const getGenerateSumsubVerificationTokenMutationKey = () => [PARENT_KEY,
|
|
151
|
+
export const getGenerateSumsubVerificationTokenMutationKey = () => [PARENT_KEY, "generateSumsubVerificationToken"];
|
|
151
152
|
export const getUnlinkFacebookMutationKey = () => [
|
|
152
153
|
PARENT_KEY,
|
|
153
|
-
|
|
154
|
+
"unlinkFacebook",
|
|
154
155
|
];
|