@getpara/react-sdk-lite 2.0.0-alpha.33 → 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/AccountProfile.js +22 -4
- package/dist/modal/components/Account/AccountProfileLink.js +10 -5
- package/dist/modal/components/Account/AccountProfileLinkOptions.js +21 -13
- package/dist/modal/components/Account/AccountProfileUnlink.js +6 -4
- package/dist/modal/components/AddFunds/AddFundsAwaiting.d.ts +1 -1
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +3 -54
- package/dist/modal/components/AddFunds/AddFundsProvider.js +2 -6
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +2 -2
- package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js +6 -6
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +5 -5
- package/dist/modal/components/OAuth/OAuth.js +3 -5
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +2 -2
- package/dist/modal/components/common.d.ts +7 -5
- package/dist/modal/components/common.js +5 -4
- package/dist/modal/constants/constants.js +1 -1
- package/dist/modal/constants/oAuthLogos.d.ts +2 -3
- package/dist/modal/constants/oAuthLogos.js +28 -28
- package/dist/modal/stores/modal/actions.js +2 -2
- package/dist/modal/stores/modal/useModalStore.d.ts +8 -2
- package/dist/modal/stores/modal/useModalStore.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/useLinkAccount.d.ts +30 -1
- package/dist/provider/hooks/mutations/useLinkAccount.js +3 -1
- 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.d.ts +4 -4
- package/dist/provider/providers/AccountLinkProvider.js +17 -13
- package/dist/provider/providers/AuthProvider.d.ts +0 -1
- package/dist/provider/providers/AuthProvider.js +18 -45
- package/dist/provider/providers/ExternalWalletProvider.d.ts +6 -5
- package/dist/provider/providers/ExternalWalletProvider.js +21 -26
- 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,42 @@
|
|
|
1
|
+
export declare const CREATE_PREGEN_WALLET_PER_TYPE_KEY = "CREATE_PREGEN_WALLET_PER_TYPE";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `createPregenWalletPerType` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `createPregenWalletPerType`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `createPregenWalletPerTypeAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { createPregenWalletPerType, createPregenWalletPerTypeAsync } = useCreatePregenWalletPerType();
|
|
12
|
+
* createPregenWalletPerType({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await createPregenWalletPerTypeAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useCreatePregenWalletPerType: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: import("@getpara/web-sdk").Wallet[] | undefined;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
variables: {
|
|
21
|
+
types?: import("@getpara/web-sdk").TWalletType[] | undefined;
|
|
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
|
+
createPregenWalletPerType: import("@tanstack/react-query").UseMutateFunction<import("@getpara/web-sdk").Wallet[], Error, {
|
|
35
|
+
types?: import("@getpara/web-sdk").TWalletType[] | undefined;
|
|
36
|
+
pregenId: import("@getpara/web-sdk").PregenAuth;
|
|
37
|
+
}, unknown>;
|
|
38
|
+
createPregenWalletPerTypeAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/web-sdk").Wallet[], Error, {
|
|
39
|
+
types?: import("@getpara/web-sdk").TWalletType[] | undefined;
|
|
40
|
+
pregenId: import("@getpara/web-sdk").PregenAuth;
|
|
41
|
+
}, unknown>;
|
|
42
|
+
};
|
|
@@ -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 { createPregenWalletPerType } from "../../actions/index.js";
|
|
9
|
+
const CREATE_PREGEN_WALLET_PER_TYPE_KEY = "CREATE_PREGEN_WALLET_PER_TYPE";
|
|
10
|
+
const useCreatePregenWalletPerType = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [CREATE_PREGEN_WALLET_PER_TYPE_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield createPregenWalletPerType(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "createPregenWalletPerType");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
CREATE_PREGEN_WALLET_PER_TYPE_KEY,
|
|
27
|
+
useCreatePregenWalletPerType
|
|
28
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const CREATE_WALLET_KEY = "CREATE_WALLET";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `createWallet` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `createWallet`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `createWalletAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { createWallet, createWalletAsync } = useCreateWallet();
|
|
12
|
+
* createWallet({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await createWalletAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useCreateWallet: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: [import("@getpara/web-sdk").Wallet, string | undefined] | undefined;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
variables: {
|
|
21
|
+
type?: Uppercase<import("@getpara/web-sdk").TWalletType> | undefined;
|
|
22
|
+
skipDistribute?: boolean | undefined;
|
|
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
|
+
createWallet: import("@tanstack/react-query").UseMutateFunction<[import("@getpara/web-sdk").Wallet, string | undefined], Error, {
|
|
35
|
+
type?: Uppercase<import("@getpara/web-sdk").TWalletType> | undefined;
|
|
36
|
+
skipDistribute?: boolean | undefined;
|
|
37
|
+
}, unknown>;
|
|
38
|
+
createWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<[import("@getpara/web-sdk").Wallet, string | undefined], Error, {
|
|
39
|
+
type?: Uppercase<import("@getpara/web-sdk").TWalletType> | undefined;
|
|
40
|
+
skipDistribute?: boolean | undefined;
|
|
41
|
+
}, unknown>;
|
|
42
|
+
};
|
|
@@ -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 { createWallet } from "../../actions/index.js";
|
|
9
|
+
const CREATE_WALLET_KEY = "CREATE_WALLET";
|
|
10
|
+
const useCreateWallet = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [CREATE_WALLET_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield createWallet(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "createWallet");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
CREATE_WALLET_KEY,
|
|
27
|
+
useCreateWallet
|
|
28
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -1,5 +1,34 @@
|
|
|
1
|
+
import { TExternalWallet, TWalletType } from '@getpara/web-sdk';
|
|
2
|
+
import { ModalLinkAccountArgs } from '../../providers/AccountLinkProvider.js';
|
|
3
|
+
/**
|
|
4
|
+
* Arguments for linking accounts via modal
|
|
5
|
+
* @example
|
|
6
|
+
* // Open modal for user to select link type
|
|
7
|
+
* linkAccount()
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Link with email
|
|
11
|
+
* linkAccount({ auth: { email: "user@example.com" } })
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Link specific account type
|
|
15
|
+
* linkAccount({ type: "TWITTER" })
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // Link external wallet and allow user to select type
|
|
19
|
+
* linkAccount({ externalWallet: { provider: "METAMASK" } })
|
|
20
|
+
* OR
|
|
21
|
+
* // Link external wallet with specific type
|
|
22
|
+
* linkAccount({ externalWallet: { provider: "METAMASK", type: "EVM" } })
|
|
23
|
+
*/
|
|
24
|
+
export type LinkAccountArgs = Omit<ModalLinkAccountArgs, 'externalWallet'> | {
|
|
25
|
+
externalWallet: {
|
|
26
|
+
provider: TExternalWallet;
|
|
27
|
+
type?: TWalletType;
|
|
28
|
+
};
|
|
29
|
+
} | undefined;
|
|
1
30
|
export declare const useLinkAccount: () => {
|
|
2
|
-
linkAccount: (
|
|
31
|
+
linkAccount: (args: LinkAccountArgs) => Promise<void>;
|
|
3
32
|
error: string | null;
|
|
4
33
|
status: import("@tanstack/query-core").MutationStatus;
|
|
5
34
|
isPending: boolean;
|
|
@@ -4,7 +4,9 @@ import { useAccountLinking } from "../../providers/AccountLinkProvider.js";
|
|
|
4
4
|
const useLinkAccount = () => {
|
|
5
5
|
const { linkAccount, linkAccountError, linkAccountStatus } = useAccountLinking();
|
|
6
6
|
return {
|
|
7
|
-
linkAccount
|
|
7
|
+
linkAccount: (args) => {
|
|
8
|
+
return linkAccount(args);
|
|
9
|
+
},
|
|
8
10
|
error: linkAccountError,
|
|
9
11
|
status: linkAccountStatus,
|
|
10
12
|
isPending: linkAccountStatus === "pending",
|
|
@@ -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
|
+
};
|