@getpara/react-sdk-lite 2.0.0-alpha.34 → 2.0.0-alpha.35
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/modal/components/Account/AccountProfileLink.js +1 -1
- package/dist/modal/components/OAuth/OAuth.js +3 -5
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +2 -2
- package/dist/modal/constants/constants.js +1 -1
- package/dist/provider/components/ExternalWalletWrapper.js +3 -26
- package/dist/provider/hooks/mutations/index.d.ts +28 -2
- package/dist/provider/hooks/mutations/index.js +57 -3
- package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +40 -0
- package/dist/provider/hooks/mutations/useClaimPregenWallets.js +28 -0
- package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +33 -0
- package/dist/provider/hooks/mutations/useCreateGuestWallets.js +28 -0
- package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +120 -0
- package/dist/provider/hooks/mutations/useCreatePregenWallet.js +28 -0
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +42 -0
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.js +28 -0
- package/dist/provider/hooks/mutations/useCreateWallet.d.ts +42 -0
- package/dist/provider/hooks/mutations/useCreateWallet.js +28 -0
- package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +54 -0
- package/dist/provider/hooks/mutations/useCreateWalletPerType.js +28 -0
- package/dist/provider/hooks/mutations/useEnable2fa.d.ts +39 -0
- package/dist/provider/hooks/mutations/useEnable2fa.js +28 -0
- package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +40 -0
- package/dist/provider/hooks/mutations/useHasPregenWallet.js +28 -0
- package/dist/provider/hooks/mutations/useIssueJwt.d.ts +48 -0
- package/dist/provider/hooks/mutations/useIssueJwt.js +28 -0
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +34 -0
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +28 -0
- package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +46 -0
- package/dist/provider/hooks/mutations/useLoginExternalWallet.js +28 -0
- package/dist/provider/hooks/mutations/useLogout.d.ts +39 -0
- package/dist/provider/hooks/mutations/useLogout.js +28 -0
- package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +40 -0
- package/dist/provider/hooks/mutations/useResendVerificationCode.js +28 -0
- package/dist/provider/hooks/mutations/useSetup2fa.d.ts +34 -0
- package/dist/provider/hooks/mutations/useSetup2fa.js +28 -0
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +58 -0
- package/dist/provider/hooks/mutations/useSignMessage.js +28 -0
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +58 -0
- package/dist/provider/hooks/mutations/useSignTransaction.js +28 -0
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +46 -0
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +28 -0
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +42 -0
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +28 -0
- package/dist/provider/hooks/mutations/useVerify2fa.d.ts +57 -0
- package/dist/provider/hooks/mutations/useVerify2fa.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +93 -0
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +55 -0
- package/dist/provider/hooks/mutations/useVerifyFarcaster.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +84 -0
- package/dist/provider/hooks/mutations/useVerifyNewAccount.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +64 -0
- package/dist/provider/hooks/mutations/useVerifyOAuth.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +46 -0
- package/dist/provider/hooks/mutations/useVerifyTelegram.js +28 -0
- package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +57 -0
- package/dist/provider/hooks/mutations/useWaitForLogin.js +28 -0
- package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +45 -0
- package/dist/provider/hooks/mutations/useWaitForSignup.js +28 -0
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +54 -0
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.js +28 -0
- package/dist/provider/hooks/mutations/utils.d.ts +2 -7
- package/dist/provider/hooks/mutations/utils.js +0 -24
- package/dist/provider/hooks/queries/index.d.ts +2 -1
- package/dist/provider/hooks/queries/index.js +4 -1
- package/dist/provider/hooks/queries/useAccountLinkInProgress.d.ts +6 -0
- package/dist/provider/hooks/queries/useAccountLinkInProgress.js +24 -0
- package/dist/provider/hooks/queries/useLinkedAccounts.d.ts +11 -0
- package/dist/provider/hooks/queries/useLinkedAccounts.js +24 -0
- package/dist/provider/providers/AccountLinkProvider.js +3 -8
- package/dist/provider/providers/AuthProvider.d.ts +0 -1
- package/dist/provider/providers/AuthProvider.js +18 -45
- package/dist/provider/providers/ExternalWalletProvider.js +2 -2
- package/dist/provider/utils/externalWalletDefaults.d.ts +6 -0
- package/dist/provider/utils/externalWalletDefaults.js +33 -0
- package/dist/provider/utils/renameMutations.d.ts +9 -5
- package/dist/provider/utils/renameMutations.js +3 -5
- package/package.json +8 -8
- package/dist/provider/hooks/mutations/core.d.ts +0 -27
- package/dist/provider/hooks/mutations/core.js +0 -66
- package/dist/provider/hooks/queries/core.d.ts +0 -4
- package/dist/provider/hooks/queries/core.js +0 -16
- package/dist/provider/hooks/queries/utils.d.ts +0 -7
- package/dist/provider/hooks/queries/utils.js +0 -25
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const CREATE_WALLET_PER_TYPE_KEY = "CREATE_WALLET_PER_TYPE";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `createWalletPerType` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `createWalletPerType`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `createWalletPerTypeAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { createWalletPerType, createWalletPerTypeAsync } = useCreateWalletPerType();
|
|
12
|
+
* createWalletPerType({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await createWalletPerTypeAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useCreateWalletPerType: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: {
|
|
19
|
+
wallets: import("@getpara/web-sdk").Wallet[];
|
|
20
|
+
walletIds: import("@getpara/web-sdk").CurrentWalletIds;
|
|
21
|
+
recoverySecret?: string | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
isSuccess: boolean;
|
|
24
|
+
variables: {
|
|
25
|
+
types?: Uppercase<import("@getpara/web-sdk").TWalletType>[] | undefined;
|
|
26
|
+
skipDistribute?: boolean | undefined;
|
|
27
|
+
} | undefined;
|
|
28
|
+
error: Error | null;
|
|
29
|
+
isError: boolean;
|
|
30
|
+
isIdle: boolean;
|
|
31
|
+
isPending: boolean;
|
|
32
|
+
reset: () => void;
|
|
33
|
+
context: unknown;
|
|
34
|
+
failureCount: number;
|
|
35
|
+
failureReason: Error | null;
|
|
36
|
+
isPaused: boolean;
|
|
37
|
+
submittedAt: number;
|
|
38
|
+
createWalletPerType: import("@tanstack/react-query").UseMutateFunction<{
|
|
39
|
+
wallets: import("@getpara/web-sdk").Wallet[];
|
|
40
|
+
walletIds: import("@getpara/web-sdk").CurrentWalletIds;
|
|
41
|
+
recoverySecret?: string | undefined;
|
|
42
|
+
}, Error, {
|
|
43
|
+
types?: Uppercase<import("@getpara/web-sdk").TWalletType>[] | undefined;
|
|
44
|
+
skipDistribute?: boolean | undefined;
|
|
45
|
+
}, unknown>;
|
|
46
|
+
createWalletPerTypeAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
47
|
+
wallets: import("@getpara/web-sdk").Wallet[];
|
|
48
|
+
walletIds: import("@getpara/web-sdk").CurrentWalletIds;
|
|
49
|
+
recoverySecret?: string | undefined;
|
|
50
|
+
}, Error, {
|
|
51
|
+
types?: Uppercase<import("@getpara/web-sdk").TWalletType>[] | undefined;
|
|
52
|
+
skipDistribute?: boolean | undefined;
|
|
53
|
+
}, unknown>;
|
|
54
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { createWalletPerType } from "../../actions/index.js";
|
|
9
|
+
const CREATE_WALLET_PER_TYPE_KEY = "CREATE_WALLET_PER_TYPE";
|
|
10
|
+
const useCreateWalletPerType = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [CREATE_WALLET_PER_TYPE_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield createWalletPerType(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "createWalletPerType");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
CREATE_WALLET_PER_TYPE_KEY,
|
|
27
|
+
useCreateWalletPerType
|
|
28
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const ENABLE_2FA_KEY = "ENABLE_2FA";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `enable2fa` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `enable2fa`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `enable2faAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { enable2fa, enable2faAsync } = useEnable2fa();
|
|
12
|
+
* enable2fa({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await enable2faAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useEnable2fa: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: void | undefined;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
variables: {
|
|
21
|
+
verificationCode: string;
|
|
22
|
+
} | undefined;
|
|
23
|
+
error: Error | null;
|
|
24
|
+
isError: boolean;
|
|
25
|
+
isIdle: boolean;
|
|
26
|
+
isPending: boolean;
|
|
27
|
+
reset: () => void;
|
|
28
|
+
context: unknown;
|
|
29
|
+
failureCount: number;
|
|
30
|
+
failureReason: Error | null;
|
|
31
|
+
isPaused: boolean;
|
|
32
|
+
submittedAt: number;
|
|
33
|
+
enable2fa: import("@tanstack/react-query").UseMutateFunction<void, Error, {
|
|
34
|
+
verificationCode: string;
|
|
35
|
+
}, unknown>;
|
|
36
|
+
enable2faAsync: import("@tanstack/react-query").UseMutateAsyncFunction<void, Error, {
|
|
37
|
+
verificationCode: string;
|
|
38
|
+
}, unknown>;
|
|
39
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { enable2fa } from "../../actions/index.js";
|
|
9
|
+
const ENABLE_2FA_KEY = "ENABLE_2FA";
|
|
10
|
+
const useEnable2fa = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [ENABLE_2FA_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield enable2fa(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "enable2fa");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
ENABLE_2FA_KEY,
|
|
27
|
+
useEnable2fa
|
|
28
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Compute } from '../../types/utils.js';
|
|
2
|
+
export declare const HAS_PREGEN_WALLET_KEY = "HAS_PREGEN_WALLET";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `hasPregenWallet` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `hasPregenWallet`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `hasPregenWalletAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { hasPregenWallet, hasPregenWalletAsync } = useHasPregenWallet();
|
|
13
|
+
* hasPregenWallet({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await hasPregenWalletAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useHasPregenWallet: () => {
|
|
18
|
+
status: "error" | "idle" | "pending" | "success";
|
|
19
|
+
data: Compute<boolean> | undefined;
|
|
20
|
+
isSuccess: boolean;
|
|
21
|
+
variables: {
|
|
22
|
+
pregenId: import("@getpara/web-sdk").PregenAuth;
|
|
23
|
+
} | undefined;
|
|
24
|
+
error: Error | null;
|
|
25
|
+
isError: boolean;
|
|
26
|
+
isIdle: boolean;
|
|
27
|
+
isPending: boolean;
|
|
28
|
+
reset: () => void;
|
|
29
|
+
context: unknown;
|
|
30
|
+
failureCount: number;
|
|
31
|
+
failureReason: Error | null;
|
|
32
|
+
isPaused: boolean;
|
|
33
|
+
submittedAt: number;
|
|
34
|
+
hasPregenWallet: import("@tanstack/react-query").UseMutateFunction<Compute<boolean>, Error, {
|
|
35
|
+
pregenId: import("@getpara/web-sdk").PregenAuth;
|
|
36
|
+
}, unknown>;
|
|
37
|
+
hasPregenWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Compute<boolean>, Error, {
|
|
38
|
+
pregenId: import("@getpara/web-sdk").PregenAuth;
|
|
39
|
+
}, unknown>;
|
|
40
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { hasPregenWallet } from "../../actions/index.js";
|
|
9
|
+
const HAS_PREGEN_WALLET_KEY = "HAS_PREGEN_WALLET";
|
|
10
|
+
const useHasPregenWallet = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [HAS_PREGEN_WALLET_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield hasPregenWallet(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "hasPregenWallet");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
HAS_PREGEN_WALLET_KEY,
|
|
27
|
+
useHasPregenWallet
|
|
28
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare const ISSUE_JWT_KEY = "ISSUE_JWT";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `issueJwt` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `issueJwt`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `issueJwtAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { issueJwt, issueJwtAsync } = useIssueJwt();
|
|
12
|
+
* issueJwt({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await issueJwtAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useIssueJwt: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: {
|
|
19
|
+
token: string;
|
|
20
|
+
keyId: string;
|
|
21
|
+
} | undefined;
|
|
22
|
+
isSuccess: boolean;
|
|
23
|
+
variables: {
|
|
24
|
+
keyIndex?: number | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
error: Error | null;
|
|
27
|
+
isError: boolean;
|
|
28
|
+
isIdle: boolean;
|
|
29
|
+
isPending: boolean;
|
|
30
|
+
reset: () => void;
|
|
31
|
+
context: unknown;
|
|
32
|
+
failureCount: number;
|
|
33
|
+
failureReason: Error | null;
|
|
34
|
+
isPaused: boolean;
|
|
35
|
+
submittedAt: number;
|
|
36
|
+
issueJwt: import("@tanstack/react-query").UseMutateFunction<{
|
|
37
|
+
token: string;
|
|
38
|
+
keyId: string;
|
|
39
|
+
}, Error, {
|
|
40
|
+
keyIndex?: number | undefined;
|
|
41
|
+
}, unknown>;
|
|
42
|
+
issueJwtAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
43
|
+
token: string;
|
|
44
|
+
keyId: string;
|
|
45
|
+
}, Error, {
|
|
46
|
+
keyIndex?: number | undefined;
|
|
47
|
+
}, unknown>;
|
|
48
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { issueJwt } from "../../actions/index.js";
|
|
9
|
+
const ISSUE_JWT_KEY = "ISSUE_JWT";
|
|
10
|
+
const useIssueJwt = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [ISSUE_JWT_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield issueJwt(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "issueJwt");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
ISSUE_JWT_KEY,
|
|
27
|
+
useIssueJwt
|
|
28
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Compute } from '../../types/utils.js';
|
|
2
|
+
export declare const KEEP_SESSION_ALIVE_KEY = "KEEP_SESSION_ALIVE";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `keepSessionAlive` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `keepSessionAlive`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `keepSessionAliveAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { keepSessionAlive, keepSessionAliveAsync } = useKeepSessionAlive();
|
|
13
|
+
* keepSessionAlive({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await keepSessionAliveAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useKeepSessionAlive: () => {
|
|
18
|
+
status: "error" | "idle" | "pending" | "success";
|
|
19
|
+
data: Compute<boolean> | undefined;
|
|
20
|
+
isSuccess: boolean;
|
|
21
|
+
variables: void | undefined;
|
|
22
|
+
error: Error | null;
|
|
23
|
+
isError: boolean;
|
|
24
|
+
isIdle: boolean;
|
|
25
|
+
isPending: boolean;
|
|
26
|
+
reset: () => void;
|
|
27
|
+
context: unknown;
|
|
28
|
+
failureCount: number;
|
|
29
|
+
failureReason: Error | null;
|
|
30
|
+
isPaused: boolean;
|
|
31
|
+
submittedAt: number;
|
|
32
|
+
keepSessionAlive: import("@tanstack/react-query").UseMutateFunction<Compute<boolean>, Error, void, unknown>;
|
|
33
|
+
keepSessionAliveAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Compute<boolean>, Error, void, unknown>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { keepSessionAlive } from "../../actions/index.js";
|
|
9
|
+
const KEEP_SESSION_ALIVE_KEY = "KEEP_SESSION_ALIVE";
|
|
10
|
+
const useKeepSessionAlive = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [KEEP_SESSION_ALIVE_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield keepSessionAlive(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "keepSessionAlive");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
KEEP_SESSION_ALIVE_KEY,
|
|
27
|
+
useKeepSessionAlive
|
|
28
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Compute } from '../../types/utils.js';
|
|
2
|
+
export declare const LOGIN_EXTERNAL_WALLET_KEY = "LOGIN_EXTERNAL_WALLET";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `loginExternalWallet` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `loginExternalWallet`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `loginExternalWalletAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { loginExternalWallet, loginExternalWalletAsync } = useLoginExternalWallet();
|
|
13
|
+
* loginExternalWallet({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await loginExternalWalletAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useLoginExternalWallet: () => {
|
|
18
|
+
status: "error" | "idle" | "pending" | "success";
|
|
19
|
+
data: Compute<import("@getpara/core-sdk/dist/types/types/methods.js").AuthStateVerifyOrLogin> | undefined;
|
|
20
|
+
isSuccess: boolean;
|
|
21
|
+
variables: {
|
|
22
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
23
|
+
useShortUrls?: boolean | undefined;
|
|
24
|
+
externalWallet: import("@getpara/web-sdk").ExternalWalletInfo | import("@getpara/web-sdk").ExternalWalletInfo[];
|
|
25
|
+
} | undefined;
|
|
26
|
+
error: Error | null;
|
|
27
|
+
isError: boolean;
|
|
28
|
+
isIdle: boolean;
|
|
29
|
+
isPending: boolean;
|
|
30
|
+
reset: () => void;
|
|
31
|
+
context: unknown;
|
|
32
|
+
failureCount: number;
|
|
33
|
+
failureReason: Error | null;
|
|
34
|
+
isPaused: boolean;
|
|
35
|
+
submittedAt: number;
|
|
36
|
+
loginExternalWallet: import("@tanstack/react-query").UseMutateFunction<Compute<import("@getpara/core-sdk/dist/types/types/methods.js").AuthStateVerifyOrLogin>, Error, {
|
|
37
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
38
|
+
useShortUrls?: boolean | undefined;
|
|
39
|
+
externalWallet: import("@getpara/web-sdk").ExternalWalletInfo | import("@getpara/web-sdk").ExternalWalletInfo[];
|
|
40
|
+
}, unknown>;
|
|
41
|
+
loginExternalWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Compute<import("@getpara/core-sdk/dist/types/types/methods.js").AuthStateVerifyOrLogin>, Error, {
|
|
42
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
43
|
+
useShortUrls?: boolean | undefined;
|
|
44
|
+
externalWallet: import("@getpara/web-sdk").ExternalWalletInfo | import("@getpara/web-sdk").ExternalWalletInfo[];
|
|
45
|
+
}, unknown>;
|
|
46
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { loginExternalWallet } from "../../actions/index.js";
|
|
9
|
+
const LOGIN_EXTERNAL_WALLET_KEY = "LOGIN_EXTERNAL_WALLET";
|
|
10
|
+
const useLoginExternalWallet = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [LOGIN_EXTERNAL_WALLET_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield loginExternalWallet(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "loginExternalWallet");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
LOGIN_EXTERNAL_WALLET_KEY,
|
|
27
|
+
useLoginExternalWallet
|
|
28
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const LOGOUT_KEY = "LOGOUT";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `logout` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `logout`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `logoutAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { logout, logoutAsync } = useLogout();
|
|
12
|
+
* logout({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await logoutAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useLogout: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: void | undefined;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
variables: void | {
|
|
21
|
+
clearPregenWallets?: boolean | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
error: Error | null;
|
|
24
|
+
isError: boolean;
|
|
25
|
+
isIdle: boolean;
|
|
26
|
+
isPending: boolean;
|
|
27
|
+
reset: () => void;
|
|
28
|
+
context: unknown;
|
|
29
|
+
failureCount: number;
|
|
30
|
+
failureReason: Error | null;
|
|
31
|
+
isPaused: boolean;
|
|
32
|
+
submittedAt: number;
|
|
33
|
+
logout: import("@tanstack/react-query").UseMutateFunction<void, Error, void | {
|
|
34
|
+
clearPregenWallets?: boolean | undefined;
|
|
35
|
+
}, unknown>;
|
|
36
|
+
logoutAsync: import("@tanstack/react-query").UseMutateAsyncFunction<void, Error, void | {
|
|
37
|
+
clearPregenWallets?: boolean | undefined;
|
|
38
|
+
}, unknown>;
|
|
39
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { logout } from "../../actions/index.js";
|
|
9
|
+
const LOGOUT_KEY = "LOGOUT";
|
|
10
|
+
const useLogout = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [LOGOUT_KEY],
|
|
14
|
+
mutationFn: (..._0) => __async(void 0, [..._0], function* (args = {}) {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield logout(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "logout");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
LOGOUT_KEY,
|
|
27
|
+
useLogout
|
|
28
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Compute } from '../../types/utils.js';
|
|
2
|
+
export declare const RESEND_VERIFICATION_CODE_KEY = "RESEND_VERIFICATION_CODE";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `resendVerificationCode` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `resendVerificationCode`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `resendVerificationCodeAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { resendVerificationCode, resendVerificationCodeAsync } = useResendVerificationCode();
|
|
13
|
+
* resendVerificationCode({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await resendVerificationCodeAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useResendVerificationCode: () => {
|
|
18
|
+
status: "error" | "idle" | "pending" | "success";
|
|
19
|
+
data: void | undefined;
|
|
20
|
+
isSuccess: boolean;
|
|
21
|
+
variables: Compute<{
|
|
22
|
+
type?: "SIGNUP" | "LINK_ACCOUNT";
|
|
23
|
+
} | undefined>;
|
|
24
|
+
error: Error | null;
|
|
25
|
+
isError: boolean;
|
|
26
|
+
isIdle: boolean;
|
|
27
|
+
isPending: boolean;
|
|
28
|
+
reset: () => void;
|
|
29
|
+
context: unknown;
|
|
30
|
+
failureCount: number;
|
|
31
|
+
failureReason: Error | null;
|
|
32
|
+
isPaused: boolean;
|
|
33
|
+
submittedAt: number;
|
|
34
|
+
resendVerificationCode: import("@tanstack/react-query").UseMutateFunction<void, Error, Compute<{
|
|
35
|
+
type?: "SIGNUP" | "LINK_ACCOUNT";
|
|
36
|
+
} | undefined>, unknown>;
|
|
37
|
+
resendVerificationCodeAsync: import("@tanstack/react-query").UseMutateAsyncFunction<void, Error, Compute<{
|
|
38
|
+
type?: "SIGNUP" | "LINK_ACCOUNT";
|
|
39
|
+
} | undefined>, unknown>;
|
|
40
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { resendVerificationCode } from "../../actions/index.js";
|
|
9
|
+
const RESEND_VERIFICATION_CODE_KEY = "RESEND_VERIFICATION_CODE";
|
|
10
|
+
const useResendVerificationCode = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [RESEND_VERIFICATION_CODE_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield resendVerificationCode(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "resendVerificationCode");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
RESEND_VERIFICATION_CODE_KEY,
|
|
27
|
+
useResendVerificationCode
|
|
28
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Compute } from '../../types/utils.js';
|
|
2
|
+
export declare const SETUP_2FA_KEY = "SETUP_2FA";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `setup2fa` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `setup2fa`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `setup2faAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { setup2fa, setup2faAsync } = useSetup2fa();
|
|
13
|
+
* setup2fa({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await setup2faAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useSetup2fa: () => {
|
|
18
|
+
status: "error" | "idle" | "pending" | "success";
|
|
19
|
+
data: Compute<import("@getpara/web-sdk").Setup2faResponse> | undefined;
|
|
20
|
+
isSuccess: boolean;
|
|
21
|
+
variables: void | undefined;
|
|
22
|
+
error: Error | null;
|
|
23
|
+
isError: boolean;
|
|
24
|
+
isIdle: boolean;
|
|
25
|
+
isPending: boolean;
|
|
26
|
+
reset: () => void;
|
|
27
|
+
context: unknown;
|
|
28
|
+
failureCount: number;
|
|
29
|
+
failureReason: Error | null;
|
|
30
|
+
isPaused: boolean;
|
|
31
|
+
submittedAt: number;
|
|
32
|
+
setup2fa: import("@tanstack/react-query").UseMutateFunction<Compute<import("@getpara/web-sdk").Setup2faResponse>, Error, void, unknown>;
|
|
33
|
+
setup2faAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Compute<import("@getpara/web-sdk").Setup2faResponse>, Error, void, unknown>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { setup2fa } from "../../actions/index.js";
|
|
9
|
+
const SETUP_2FA_KEY = "SETUP_2FA";
|
|
10
|
+
const useSetup2fa = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [SETUP_2FA_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield setup2fa(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "setup2fa");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
SETUP_2FA_KEY,
|
|
27
|
+
useSetup2fa
|
|
28
|
+
};
|