@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,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
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Compute } from '../../types/utils.js';
|
|
2
|
+
export declare const SIGN_MESSAGE_KEY = "SIGN_MESSAGE";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `signMessage` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `signMessage`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `signMessageAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { signMessage, signMessageAsync } = useSignMessage();
|
|
13
|
+
* signMessage({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await signMessageAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useSignMessage: () => {
|
|
18
|
+
status: "error" | "idle" | "pending" | "success";
|
|
19
|
+
data: Compute<import("@getpara/web-sdk").FullSignatureRes> | undefined;
|
|
20
|
+
isSuccess: boolean;
|
|
21
|
+
variables: {
|
|
22
|
+
onPoll?: (() => void) | undefined;
|
|
23
|
+
onCancel?: (() => void) | undefined;
|
|
24
|
+
walletId: string;
|
|
25
|
+
messageBase64: string;
|
|
26
|
+
timeoutMs?: number | undefined;
|
|
27
|
+
cosmosSignDocBase64?: string | undefined;
|
|
28
|
+
isCanceled?: (() => boolean) | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
error: Error | null;
|
|
31
|
+
isError: boolean;
|
|
32
|
+
isIdle: boolean;
|
|
33
|
+
isPending: boolean;
|
|
34
|
+
reset: () => void;
|
|
35
|
+
context: unknown;
|
|
36
|
+
failureCount: number;
|
|
37
|
+
failureReason: Error | null;
|
|
38
|
+
isPaused: boolean;
|
|
39
|
+
submittedAt: number;
|
|
40
|
+
signMessage: import("@tanstack/react-query").UseMutateFunction<Compute<import("@getpara/web-sdk").FullSignatureRes>, Error, {
|
|
41
|
+
onPoll?: (() => void) | undefined;
|
|
42
|
+
onCancel?: (() => void) | undefined;
|
|
43
|
+
walletId: string;
|
|
44
|
+
messageBase64: string;
|
|
45
|
+
timeoutMs?: number | undefined;
|
|
46
|
+
cosmosSignDocBase64?: string | undefined;
|
|
47
|
+
isCanceled?: (() => boolean) | undefined;
|
|
48
|
+
}, unknown>;
|
|
49
|
+
signMessageAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Compute<import("@getpara/web-sdk").FullSignatureRes>, Error, {
|
|
50
|
+
onPoll?: (() => void) | undefined;
|
|
51
|
+
onCancel?: (() => void) | undefined;
|
|
52
|
+
walletId: string;
|
|
53
|
+
messageBase64: string;
|
|
54
|
+
timeoutMs?: number | undefined;
|
|
55
|
+
cosmosSignDocBase64?: string | undefined;
|
|
56
|
+
isCanceled?: (() => boolean) | undefined;
|
|
57
|
+
}, unknown>;
|
|
58
|
+
};
|
|
@@ -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 { signMessage } from "../../actions/index.js";
|
|
9
|
+
const SIGN_MESSAGE_KEY = "SIGN_MESSAGE";
|
|
10
|
+
const useSignMessage = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [SIGN_MESSAGE_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield signMessage(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "signMessage");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
SIGN_MESSAGE_KEY,
|
|
27
|
+
useSignMessage
|
|
28
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Compute } from '../../types/utils.js';
|
|
2
|
+
export declare const SIGN_TRANSACTION_KEY = "SIGN_TRANSACTION";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `signTransaction` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `signTransaction`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `signTransactionAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { signTransaction, signTransactionAsync } = useSignTransaction();
|
|
13
|
+
* signTransaction({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await signTransactionAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useSignTransaction: () => {
|
|
18
|
+
status: "error" | "idle" | "pending" | "success";
|
|
19
|
+
data: Compute<import("@getpara/web-sdk").FullSignatureRes> | undefined;
|
|
20
|
+
isSuccess: boolean;
|
|
21
|
+
variables: {
|
|
22
|
+
onPoll?: (() => void) | undefined;
|
|
23
|
+
onCancel?: (() => void) | undefined;
|
|
24
|
+
walletId: string;
|
|
25
|
+
rlpEncodedTxBase64: string;
|
|
26
|
+
chainId: string;
|
|
27
|
+
timeoutMs?: number | undefined;
|
|
28
|
+
isCanceled?: (() => boolean) | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
error: Error | null;
|
|
31
|
+
isError: boolean;
|
|
32
|
+
isIdle: boolean;
|
|
33
|
+
isPending: boolean;
|
|
34
|
+
reset: () => void;
|
|
35
|
+
context: unknown;
|
|
36
|
+
failureCount: number;
|
|
37
|
+
failureReason: Error | null;
|
|
38
|
+
isPaused: boolean;
|
|
39
|
+
submittedAt: number;
|
|
40
|
+
signTransaction: import("@tanstack/react-query").UseMutateFunction<Compute<import("@getpara/web-sdk").FullSignatureRes>, Error, {
|
|
41
|
+
onPoll?: (() => void) | undefined;
|
|
42
|
+
onCancel?: (() => void) | undefined;
|
|
43
|
+
walletId: string;
|
|
44
|
+
rlpEncodedTxBase64: string;
|
|
45
|
+
chainId: string;
|
|
46
|
+
timeoutMs?: number | undefined;
|
|
47
|
+
isCanceled?: (() => boolean) | undefined;
|
|
48
|
+
}, unknown>;
|
|
49
|
+
signTransactionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Compute<import("@getpara/web-sdk").FullSignatureRes>, Error, {
|
|
50
|
+
onPoll?: (() => void) | undefined;
|
|
51
|
+
onCancel?: (() => void) | undefined;
|
|
52
|
+
walletId: string;
|
|
53
|
+
rlpEncodedTxBase64: string;
|
|
54
|
+
chainId: string;
|
|
55
|
+
timeoutMs?: number | undefined;
|
|
56
|
+
isCanceled?: (() => boolean) | undefined;
|
|
57
|
+
}, unknown>;
|
|
58
|
+
};
|
|
@@ -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 { signTransaction } from "../../actions/index.js";
|
|
9
|
+
const SIGN_TRANSACTION_KEY = "SIGN_TRANSACTION";
|
|
10
|
+
const useSignTransaction = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [SIGN_TRANSACTION_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield signTransaction(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "signTransaction");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
SIGN_TRANSACTION_KEY,
|
|
27
|
+
useSignTransaction
|
|
28
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Compute } from '../../types/utils.js';
|
|
2
|
+
export declare const SIGN_UP_LOG_IN_KEY = "SIGN_UP_LOG_IN";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `signUpOrLogIn` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `signUpOrLogIn`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `signUpOrLogInAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { signUpOrLogIn, signUpOrLogInAsync } = useSignUpOrLogIn();
|
|
13
|
+
* signUpOrLogIn({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await signUpOrLogInAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useSignUpOrLogIn: () => {
|
|
18
|
+
status: "error" | "idle" | "pending" | "success";
|
|
19
|
+
data: Compute<import("@getpara/web-sdk").AuthStateLogin | import("@getpara/user-management-client").ServerAuthStateVerify> | undefined;
|
|
20
|
+
isSuccess: boolean;
|
|
21
|
+
variables: {
|
|
22
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
23
|
+
useShortUrls?: boolean | undefined;
|
|
24
|
+
auth: import("@getpara/web-sdk").VerifiedAuth;
|
|
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
|
+
signUpOrLogIn: import("@tanstack/react-query").UseMutateFunction<Compute<import("@getpara/web-sdk").AuthStateLogin | import("@getpara/user-management-client").ServerAuthStateVerify>, Error, {
|
|
37
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
38
|
+
useShortUrls?: boolean | undefined;
|
|
39
|
+
auth: import("@getpara/web-sdk").VerifiedAuth;
|
|
40
|
+
}, unknown>;
|
|
41
|
+
signUpOrLogInAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Compute<import("@getpara/web-sdk").AuthStateLogin | import("@getpara/user-management-client").ServerAuthStateVerify>, Error, {
|
|
42
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
43
|
+
useShortUrls?: boolean | undefined;
|
|
44
|
+
auth: import("@getpara/web-sdk").VerifiedAuth;
|
|
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 { signUpOrLogIn } from "../../actions/index.js";
|
|
9
|
+
const SIGN_UP_LOG_IN_KEY = "SIGN_UP_LOG_IN";
|
|
10
|
+
const useSignUpOrLogIn = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [SIGN_UP_LOG_IN_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield signUpOrLogIn(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "signUpOrLogIn");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
SIGN_UP_LOG_IN_KEY,
|
|
27
|
+
useSignUpOrLogIn
|
|
28
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const UPDATE_PREGEN_WALLET_IDENTIFIER_KEY = "UPDATE_PREGEN_WALLET_IDENTIFIER";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `updatePregenWalletIdentifier` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `updatePregenWalletIdentifier`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `updatePregenWalletIdentifierAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { updatePregenWalletIdentifier, updatePregenWalletIdentifierAsync } = useUpdatePregenWalletIdentifier();
|
|
12
|
+
* updatePregenWalletIdentifier({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await updatePregenWalletIdentifierAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useUpdatePregenWalletIdentifier: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: void | undefined;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
variables: {
|
|
21
|
+
walletId: string;
|
|
22
|
+
newPregenId: 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
|
+
updatePregenWalletIdentifier: import("@tanstack/react-query").UseMutateFunction<void, Error, {
|
|
35
|
+
walletId: string;
|
|
36
|
+
newPregenId: import("@getpara/web-sdk").PregenAuth;
|
|
37
|
+
}, unknown>;
|
|
38
|
+
updatePregenWalletIdentifierAsync: import("@tanstack/react-query").UseMutateAsyncFunction<void, Error, {
|
|
39
|
+
walletId: string;
|
|
40
|
+
newPregenId: 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 { updatePregenWalletIdentifier } from "../../actions/index.js";
|
|
9
|
+
const UPDATE_PREGEN_WALLET_IDENTIFIER_KEY = "UPDATE_PREGEN_WALLET_IDENTIFIER";
|
|
10
|
+
const useUpdatePregenWalletIdentifier = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [UPDATE_PREGEN_WALLET_IDENTIFIER_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield updatePregenWalletIdentifier(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "updatePregenWalletIdentifier");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
UPDATE_PREGEN_WALLET_IDENTIFIER_KEY,
|
|
27
|
+
useUpdatePregenWalletIdentifier
|
|
28
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const VERIFY_2FA_KEY = "VERIFY_2FA";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `verify2fa` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `verify2fa`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `verify2faAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { verify2fa, verify2faAsync } = useVerify2fa();
|
|
12
|
+
* verify2fa({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await verify2faAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useVerify2fa: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: {
|
|
19
|
+
initiatedAt?: Date | undefined;
|
|
20
|
+
status?: import("@getpara/web-sdk").RecoveryStatus | undefined;
|
|
21
|
+
userId: string;
|
|
22
|
+
wallets: Pick<import("@getpara/web-sdk").Wallet, "address" | "id">[];
|
|
23
|
+
} | undefined;
|
|
24
|
+
isSuccess: boolean;
|
|
25
|
+
variables: {
|
|
26
|
+
auth: import("@getpara/web-sdk").VerifiedAuth;
|
|
27
|
+
verificationCode: string;
|
|
28
|
+
} | undefined;
|
|
29
|
+
error: Error | null;
|
|
30
|
+
isError: boolean;
|
|
31
|
+
isIdle: boolean;
|
|
32
|
+
isPending: boolean;
|
|
33
|
+
reset: () => void;
|
|
34
|
+
context: unknown;
|
|
35
|
+
failureCount: number;
|
|
36
|
+
failureReason: Error | null;
|
|
37
|
+
isPaused: boolean;
|
|
38
|
+
submittedAt: number;
|
|
39
|
+
verify2fa: import("@tanstack/react-query").UseMutateFunction<{
|
|
40
|
+
initiatedAt?: Date | undefined;
|
|
41
|
+
status?: import("@getpara/web-sdk").RecoveryStatus | undefined;
|
|
42
|
+
userId: string;
|
|
43
|
+
wallets: Pick<import("@getpara/web-sdk").Wallet, "address" | "id">[];
|
|
44
|
+
}, Error, {
|
|
45
|
+
auth: import("@getpara/web-sdk").VerifiedAuth;
|
|
46
|
+
verificationCode: string;
|
|
47
|
+
}, unknown>;
|
|
48
|
+
verify2faAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
49
|
+
initiatedAt?: Date | undefined;
|
|
50
|
+
status?: import("@getpara/web-sdk").RecoveryStatus | undefined;
|
|
51
|
+
userId: string;
|
|
52
|
+
wallets: Pick<import("@getpara/web-sdk").Wallet, "address" | "id">[];
|
|
53
|
+
}, Error, {
|
|
54
|
+
auth: import("@getpara/web-sdk").VerifiedAuth;
|
|
55
|
+
verificationCode: string;
|
|
56
|
+
}, unknown>;
|
|
57
|
+
};
|
|
@@ -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 { verify2fa } from "../../actions/index.js";
|
|
9
|
+
const VERIFY_2FA_KEY = "VERIFY_2FA";
|
|
10
|
+
const useVerify2fa = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [VERIFY_2FA_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield verify2fa(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "verify2fa");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
VERIFY_2FA_KEY,
|
|
27
|
+
useVerify2fa
|
|
28
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export declare const VERIFY_EXTERNAL_WALLET_KEY = "VERIFY_EXTERNAL_WALLET";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `verifyExternalWallet` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `verifyExternalWallet`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `verifyExternalWalletAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { verifyExternalWallet, verifyExternalWalletAsync } = useVerifyExternalWallet();
|
|
12
|
+
* verifyExternalWallet({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await verifyExternalWalletAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useVerifyExternalWallet: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: {
|
|
19
|
+
username?: string | undefined;
|
|
20
|
+
displayName?: string | undefined;
|
|
21
|
+
pfpUrl?: string | undefined;
|
|
22
|
+
externalWallet?: import("@getpara/web-sdk").ExternalWalletInfo | undefined;
|
|
23
|
+
auth: import("@getpara/user-management-client").PrimaryAuth;
|
|
24
|
+
userId: string;
|
|
25
|
+
stage: "signup";
|
|
26
|
+
isPasskeySupported: boolean;
|
|
27
|
+
passkeyUrl?: string | undefined;
|
|
28
|
+
passwordUrl?: string | undefined;
|
|
29
|
+
passkeyId?: string | undefined;
|
|
30
|
+
passwordId?: string | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
isSuccess: boolean;
|
|
33
|
+
variables: {
|
|
34
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
35
|
+
useShortUrls?: boolean | undefined;
|
|
36
|
+
externalWallet: import("@getpara/web-sdk").ExternalWalletInfo;
|
|
37
|
+
signedMessage: string;
|
|
38
|
+
cosmosPublicKeyHex?: string | undefined;
|
|
39
|
+
cosmosSigner?: string | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
error: Error | null;
|
|
42
|
+
isError: boolean;
|
|
43
|
+
isIdle: boolean;
|
|
44
|
+
isPending: boolean;
|
|
45
|
+
reset: () => void;
|
|
46
|
+
context: unknown;
|
|
47
|
+
failureCount: number;
|
|
48
|
+
failureReason: Error | null;
|
|
49
|
+
isPaused: boolean;
|
|
50
|
+
submittedAt: number;
|
|
51
|
+
verifyExternalWallet: import("@tanstack/react-query").UseMutateFunction<{
|
|
52
|
+
username?: string | undefined;
|
|
53
|
+
displayName?: string | undefined;
|
|
54
|
+
pfpUrl?: string | undefined;
|
|
55
|
+
externalWallet?: import("@getpara/web-sdk").ExternalWalletInfo | undefined;
|
|
56
|
+
auth: import("@getpara/user-management-client").PrimaryAuth;
|
|
57
|
+
userId: string;
|
|
58
|
+
stage: "signup";
|
|
59
|
+
isPasskeySupported: boolean;
|
|
60
|
+
passkeyUrl?: string | undefined;
|
|
61
|
+
passwordUrl?: string | undefined;
|
|
62
|
+
passkeyId?: string | undefined;
|
|
63
|
+
passwordId?: string | undefined;
|
|
64
|
+
}, Error, {
|
|
65
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
66
|
+
useShortUrls?: boolean | undefined;
|
|
67
|
+
externalWallet: import("@getpara/web-sdk").ExternalWalletInfo;
|
|
68
|
+
signedMessage: string;
|
|
69
|
+
cosmosPublicKeyHex?: string | undefined;
|
|
70
|
+
cosmosSigner?: string | undefined;
|
|
71
|
+
}, unknown>;
|
|
72
|
+
verifyExternalWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
73
|
+
username?: string | undefined;
|
|
74
|
+
displayName?: string | undefined;
|
|
75
|
+
pfpUrl?: string | undefined;
|
|
76
|
+
externalWallet?: import("@getpara/web-sdk").ExternalWalletInfo | undefined;
|
|
77
|
+
auth: import("@getpara/user-management-client").PrimaryAuth;
|
|
78
|
+
userId: string;
|
|
79
|
+
stage: "signup";
|
|
80
|
+
isPasskeySupported: boolean;
|
|
81
|
+
passkeyUrl?: string | undefined;
|
|
82
|
+
passwordUrl?: string | undefined;
|
|
83
|
+
passkeyId?: string | undefined;
|
|
84
|
+
passwordId?: string | undefined;
|
|
85
|
+
}, Error, {
|
|
86
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
87
|
+
useShortUrls?: boolean | undefined;
|
|
88
|
+
externalWallet: import("@getpara/web-sdk").ExternalWalletInfo;
|
|
89
|
+
signedMessage: string;
|
|
90
|
+
cosmosPublicKeyHex?: string | undefined;
|
|
91
|
+
cosmosSigner?: string | undefined;
|
|
92
|
+
}, unknown>;
|
|
93
|
+
};
|