@getpara/react-core 3.3.0 → 3.5.0
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/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/mutations.d.ts +2 -0
- package/dist/mutations.js +4 -0
- package/dist/provider/actions/index.d.ts +3 -1
- package/dist/provider/actions/index.js +4 -0
- package/dist/provider/hooks/mutations/index.d.ts +2 -0
- package/dist/provider/hooks/mutations/index.js +6 -0
- package/dist/provider/hooks/mutations/useEnrollMfa.d.ts +95 -0
- package/dist/provider/hooks/mutations/useEnrollMfa.js +39 -0
- package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +93 -0
- package/dist/provider/hooks/mutations/useVerifyMfa.d.ts +98 -0
- package/dist/provider/hooks/mutations/useVerifyMfa.js +39 -0
- package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +93 -0
- package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +93 -0
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export { useVerifyNewAccount } from './provider/hooks/mutations/useVerifyNewAcco
|
|
|
23
23
|
export { useSetup2fa } from './provider/hooks/mutations/useSetup2fa.js';
|
|
24
24
|
export { useEnable2fa } from './provider/hooks/mutations/useEnable2fa.js';
|
|
25
25
|
export { useVerify2fa } from './provider/hooks/mutations/useVerify2fa.js';
|
|
26
|
+
export { useEnrollMfa } from './provider/hooks/mutations/useEnrollMfa.js';
|
|
27
|
+
export { useVerifyMfa } from './provider/hooks/mutations/useVerifyMfa.js';
|
|
26
28
|
export { useIssueJwt } from './provider/hooks/mutations/useIssueJwt.js';
|
|
27
29
|
export { useResendVerificationCode } from './provider/hooks/mutations/useResendVerificationCode.js';
|
|
28
30
|
export { useExportPrivateKey, EXPORT_PRIVATE_KEY_KEY } from './provider/hooks/mutations/useExportPrivateKey.js';
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,8 @@ import { useVerifyNewAccount } from "./provider/hooks/mutations/useVerifyNewAcco
|
|
|
21
21
|
import { useSetup2fa } from "./provider/hooks/mutations/useSetup2fa.js";
|
|
22
22
|
import { useEnable2fa } from "./provider/hooks/mutations/useEnable2fa.js";
|
|
23
23
|
import { useVerify2fa } from "./provider/hooks/mutations/useVerify2fa.js";
|
|
24
|
+
import { useEnrollMfa } from "./provider/hooks/mutations/useEnrollMfa.js";
|
|
25
|
+
import { useVerifyMfa } from "./provider/hooks/mutations/useVerifyMfa.js";
|
|
24
26
|
import { useIssueJwt } from "./provider/hooks/mutations/useIssueJwt.js";
|
|
25
27
|
import { useResendVerificationCode } from "./provider/hooks/mutations/useResendVerificationCode.js";
|
|
26
28
|
import { useExportPrivateKey, EXPORT_PRIVATE_KEY_KEY } from "./provider/hooks/mutations/useExportPrivateKey.js";
|
|
@@ -50,6 +52,7 @@ export {
|
|
|
50
52
|
useCreateWallet,
|
|
51
53
|
useCreateWalletPerType,
|
|
52
54
|
useEnable2fa,
|
|
55
|
+
useEnrollMfa,
|
|
53
56
|
useExportPrivateKey,
|
|
54
57
|
useHasPregenWallet,
|
|
55
58
|
useIsFullyLoggedIn,
|
|
@@ -68,6 +71,7 @@ export {
|
|
|
68
71
|
useVerify2fa,
|
|
69
72
|
useVerifyExternalWallet,
|
|
70
73
|
useVerifyFarcaster,
|
|
74
|
+
useVerifyMfa,
|
|
71
75
|
useVerifyNewAccount,
|
|
72
76
|
useVerifyOAuth,
|
|
73
77
|
useVerifyTelegram,
|
package/dist/mutations.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export { useSignUpOrLogIn } from './provider/hooks/mutations/useSignUpOrLogIn.js
|
|
|
14
14
|
export { useSetup2fa } from './provider/hooks/mutations/useSetup2fa.js';
|
|
15
15
|
export { useEnable2fa } from './provider/hooks/mutations/useEnable2fa.js';
|
|
16
16
|
export { useVerify2fa } from './provider/hooks/mutations/useVerify2fa.js';
|
|
17
|
+
export { useEnrollMfa } from './provider/hooks/mutations/useEnrollMfa.js';
|
|
18
|
+
export { useVerifyMfa } from './provider/hooks/mutations/useVerifyMfa.js';
|
|
17
19
|
export { useIssueJwt } from './provider/hooks/mutations/useIssueJwt.js';
|
|
18
20
|
export { useResendVerificationCode } from './provider/hooks/mutations/useResendVerificationCode.js';
|
|
19
21
|
export { useAuthenticateWithEmailOrPhone } from './provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js';
|
package/dist/mutations.js
CHANGED
|
@@ -14,6 +14,8 @@ import { useSignUpOrLogIn } from "./provider/hooks/mutations/useSignUpOrLogIn.js
|
|
|
14
14
|
import { useSetup2fa } from "./provider/hooks/mutations/useSetup2fa.js";
|
|
15
15
|
import { useEnable2fa } from "./provider/hooks/mutations/useEnable2fa.js";
|
|
16
16
|
import { useVerify2fa } from "./provider/hooks/mutations/useVerify2fa.js";
|
|
17
|
+
import { useEnrollMfa } from "./provider/hooks/mutations/useEnrollMfa.js";
|
|
18
|
+
import { useVerifyMfa } from "./provider/hooks/mutations/useVerifyMfa.js";
|
|
17
19
|
import { useIssueJwt } from "./provider/hooks/mutations/useIssueJwt.js";
|
|
18
20
|
import { useResendVerificationCode } from "./provider/hooks/mutations/useResendVerificationCode.js";
|
|
19
21
|
import { useAuthenticateWithEmailOrPhone } from "./provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js";
|
|
@@ -38,6 +40,7 @@ export {
|
|
|
38
40
|
useCreateWallet,
|
|
39
41
|
useCreateWalletPerType,
|
|
40
42
|
useEnable2fa,
|
|
43
|
+
useEnrollMfa,
|
|
41
44
|
useExportPrivateKey,
|
|
42
45
|
useHasPregenWallet,
|
|
43
46
|
useIssueJwt,
|
|
@@ -54,6 +57,7 @@ export {
|
|
|
54
57
|
useVerify2fa,
|
|
55
58
|
useVerifyExternalWallet,
|
|
56
59
|
useVerifyFarcaster,
|
|
60
|
+
useVerifyMfa,
|
|
57
61
|
useVerifyOAuth,
|
|
58
62
|
useVerifyTelegram,
|
|
59
63
|
useWaitForLogin,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type ParaCore from '@getpara/core-sdk';
|
|
2
|
-
import type { SignUpOrLogInParams, SignUpOrLogInResponse, WaitForLoginParams, WaitForLoginResponse, WaitForSignupParams, WaitForWalletCreationParams, WaitForWalletCreationResponse, VerifyOAuthProcessParams, OAuthResponse, VerifyFarcasterParams, VerifyTelegramParams, LoginExternalWalletParams, LoginExternalWalletResponse, VerifyExternalWalletParams, VerifyExternalWalletResponse, Setup2faResponse, Enable2faParams, Verify2faParams, Verify2faResponse, LogoutParams, ResendVerificationCodeParams, ResendVerificationCodeResponse, CreateWalletParams, CreateWalletResponse, CreateWalletPerTypeParams, CreateWalletPerTypeResponse, CreatePregenWalletParams, CreatePregenWalletResponse, CreatePregenWalletPerTypeParams, CreatePregenWalletPerTypeResponse, ClaimPregenWalletsParams, ClaimPregenWalletsResponse, HasPregenWalletParams, UpdatePregenWalletIdentifierParams, CreateGuestWalletsResponse, SignMessageParams, SignTransactionParams, FullSignatureRes, GetWalletBalanceParams, IssueJwtParams, IssueJwtResponse, GetLinkedAccountsParams, GetLinkedAccountsResponse, AddCredentialParams, ExportPrivateKeyParams, ExportPrivateKeyResponse, RequestFaucetParams, RequestFaucetResponse, AuthenticateWithEmailOrPhoneParams, AuthenticateWithEmailOrPhoneResponse, AuthenticateWithOAuthParams, AuthenticateWithOAuthResponse } from '@getpara/core-sdk';
|
|
2
|
+
import type { SignUpOrLogInParams, SignUpOrLogInResponse, WaitForLoginParams, WaitForLoginResponse, WaitForSignupParams, WaitForWalletCreationParams, WaitForWalletCreationResponse, VerifyOAuthProcessParams, OAuthResponse, VerifyFarcasterParams, VerifyTelegramParams, LoginExternalWalletParams, LoginExternalWalletResponse, VerifyExternalWalletParams, VerifyExternalWalletResponse, Setup2faResponse, Enable2faParams, Verify2faParams, Verify2faResponse, EnrollMfaResponse, VerifyMfaParams, VerifyMfaResult, LogoutParams, ResendVerificationCodeParams, ResendVerificationCodeResponse, CreateWalletParams, CreateWalletResponse, CreateWalletPerTypeParams, CreateWalletPerTypeResponse, CreatePregenWalletParams, CreatePregenWalletResponse, CreatePregenWalletPerTypeParams, CreatePregenWalletPerTypeResponse, ClaimPregenWalletsParams, ClaimPregenWalletsResponse, HasPregenWalletParams, UpdatePregenWalletIdentifierParams, CreateGuestWalletsResponse, SignMessageParams, SignTransactionParams, FullSignatureRes, GetWalletBalanceParams, IssueJwtParams, IssueJwtResponse, GetLinkedAccountsParams, GetLinkedAccountsResponse, AddCredentialParams, ExportPrivateKeyParams, ExportPrivateKeyResponse, RequestFaucetParams, RequestFaucetResponse, AuthenticateWithEmailOrPhoneParams, AuthenticateWithEmailOrPhoneResponse, AuthenticateWithOAuthParams, AuthenticateWithOAuthResponse } from '@getpara/core-sdk';
|
|
3
3
|
export { generateCoreAction, type CoreAction } from './utils.js';
|
|
4
4
|
export { getEmbeddedAccount, type Account } from './getEmbeddedAccount.js';
|
|
5
5
|
export { getWallet } from './getWallet.js';
|
|
@@ -16,6 +16,8 @@ export declare const verifyExternalWallet: (para?: ParaCore, args?: VerifyExtern
|
|
|
16
16
|
export declare const setup2fa: (para?: ParaCore) => Promise<Setup2faResponse>;
|
|
17
17
|
export declare const enable2fa: (para?: ParaCore, args?: Enable2faParams) => Promise<void>;
|
|
18
18
|
export declare const verify2fa: (para?: ParaCore, args?: Verify2faParams) => Promise<Verify2faResponse>;
|
|
19
|
+
export declare const enrollMfa: (para?: ParaCore) => Promise<EnrollMfaResponse>;
|
|
20
|
+
export declare const verifyMfa: (para?: ParaCore, args?: VerifyMfaParams) => Promise<VerifyMfaResult>;
|
|
19
21
|
export declare const keepSessionAlive: (para?: ParaCore) => Promise<boolean>;
|
|
20
22
|
export declare const logout: (para?: ParaCore, args?: LogoutParams) => Promise<void>;
|
|
21
23
|
export declare const resendVerificationCode: (para?: ParaCore, args?: ResendVerificationCodeParams) => Promise<ResendVerificationCodeResponse>;
|
|
@@ -15,6 +15,8 @@ const verifyExternalWallet = generateCoreAction("verifyExternalWallet");
|
|
|
15
15
|
const setup2fa = generateCoreAction("setup2fa");
|
|
16
16
|
const enable2fa = generateCoreAction("enable2fa");
|
|
17
17
|
const verify2fa = generateCoreAction("verify2fa");
|
|
18
|
+
const enrollMfa = generateCoreAction("enrollMfa");
|
|
19
|
+
const verifyMfa = generateCoreAction("verifyMfa");
|
|
18
20
|
const keepSessionAlive = generateCoreAction("keepSessionAlive");
|
|
19
21
|
const logout = generateCoreAction("logout");
|
|
20
22
|
const resendVerificationCode = generateCoreAction("resendVerificationCode");
|
|
@@ -47,6 +49,7 @@ export {
|
|
|
47
49
|
createWallet,
|
|
48
50
|
createWalletPerType,
|
|
49
51
|
enable2fa,
|
|
52
|
+
enrollMfa,
|
|
50
53
|
exportPrivateKey,
|
|
51
54
|
generateCoreAction2 as generateCoreAction,
|
|
52
55
|
getEmbeddedAccount,
|
|
@@ -68,6 +71,7 @@ export {
|
|
|
68
71
|
verify2fa,
|
|
69
72
|
verifyExternalWallet,
|
|
70
73
|
verifyFarcaster,
|
|
74
|
+
verifyMfa,
|
|
71
75
|
verifyNewAccount,
|
|
72
76
|
verifyOAuth,
|
|
73
77
|
verifyTelegram,
|
|
@@ -15,6 +15,8 @@ export { useVerifyNewAccount, VERIFY_NEW_ACCOUNT_KEY } from './useVerifyNewAccou
|
|
|
15
15
|
export { useSetup2fa, SETUP_2FA_KEY } from './useSetup2fa.js';
|
|
16
16
|
export { useEnable2fa, ENABLE_2FA_KEY } from './useEnable2fa.js';
|
|
17
17
|
export { useVerify2fa, VERIFY_2FA_KEY } from './useVerify2fa.js';
|
|
18
|
+
export { useEnrollMfa, ENROLL_MFA_KEY } from './useEnrollMfa.js';
|
|
19
|
+
export { useVerifyMfa, VERIFY_MFA_KEY } from './useVerifyMfa.js';
|
|
18
20
|
export { useIssueJwt, ISSUE_JWT_KEY } from './useIssueJwt.js';
|
|
19
21
|
export { useResendVerificationCode, RESEND_VERIFICATION_CODE_KEY } from './useResendVerificationCode.js';
|
|
20
22
|
export { useExportPrivateKey, EXPORT_PRIVATE_KEY_KEY } from './useExportPrivateKey.js';
|
|
@@ -15,6 +15,8 @@ import { useVerifyNewAccount, VERIFY_NEW_ACCOUNT_KEY } from "./useVerifyNewAccou
|
|
|
15
15
|
import { useSetup2fa, SETUP_2FA_KEY } from "./useSetup2fa.js";
|
|
16
16
|
import { useEnable2fa, ENABLE_2FA_KEY } from "./useEnable2fa.js";
|
|
17
17
|
import { useVerify2fa, VERIFY_2FA_KEY } from "./useVerify2fa.js";
|
|
18
|
+
import { useEnrollMfa, ENROLL_MFA_KEY } from "./useEnrollMfa.js";
|
|
19
|
+
import { useVerifyMfa, VERIFY_MFA_KEY } from "./useVerifyMfa.js";
|
|
18
20
|
import { useIssueJwt, ISSUE_JWT_KEY } from "./useIssueJwt.js";
|
|
19
21
|
import { useResendVerificationCode, RESEND_VERIFICATION_CODE_KEY } from "./useResendVerificationCode.js";
|
|
20
22
|
import { useExportPrivateKey, EXPORT_PRIVATE_KEY_KEY } from "./useExportPrivateKey.js";
|
|
@@ -39,6 +41,7 @@ export {
|
|
|
39
41
|
CREATE_WALLET_KEY,
|
|
40
42
|
CREATE_WALLET_PER_TYPE_KEY,
|
|
41
43
|
ENABLE_2FA_KEY,
|
|
44
|
+
ENROLL_MFA_KEY,
|
|
42
45
|
EXPORT_PRIVATE_KEY_KEY,
|
|
43
46
|
HAS_PREGEN_WALLET_KEY,
|
|
44
47
|
ISSUE_JWT_KEY,
|
|
@@ -55,6 +58,7 @@ export {
|
|
|
55
58
|
VERIFY_2FA_KEY,
|
|
56
59
|
VERIFY_EXTERNAL_WALLET_KEY,
|
|
57
60
|
VERIFY_FARCASTER_KEY,
|
|
61
|
+
VERIFY_MFA_KEY,
|
|
58
62
|
VERIFY_NEW_ACCOUNT_KEY,
|
|
59
63
|
VERIFY_OAUTH_KEY,
|
|
60
64
|
VERIFY_TELEGRAM_KEY,
|
|
@@ -70,6 +74,7 @@ export {
|
|
|
70
74
|
useCreateWallet,
|
|
71
75
|
useCreateWalletPerType,
|
|
72
76
|
useEnable2fa,
|
|
77
|
+
useEnrollMfa,
|
|
73
78
|
useExportPrivateKey,
|
|
74
79
|
useHasPregenWallet,
|
|
75
80
|
useIssueJwt,
|
|
@@ -86,6 +91,7 @@ export {
|
|
|
86
91
|
useVerify2fa,
|
|
87
92
|
useVerifyExternalWallet,
|
|
88
93
|
useVerifyFarcaster,
|
|
94
|
+
useVerifyMfa,
|
|
89
95
|
useVerifyNewAccount,
|
|
90
96
|
useVerifyOAuth,
|
|
91
97
|
useVerifyTelegram,
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { EnrollMfaResponse } from '@getpara/core-sdk';
|
|
2
|
+
export declare const ENROLL_MFA_KEY = "ENROLL_MFA";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `enrollMfa` mutation — login-time 2FA enrollment (ENG-6906).
|
|
5
|
+
*
|
|
6
|
+
* Enrolls a TOTP second factor for the current session and returns the otpauth
|
|
7
|
+
* `uri` (render as a QR) plus one-time `backupCodes` (show the user exactly once).
|
|
8
|
+
* Distinct from `useSetup2fa`, which configures the recovery-gating 2FA.
|
|
9
|
+
*
|
|
10
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
11
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
12
|
+
* - `enrollMfa`: function to trigger the mutation (same as `mutate`)
|
|
13
|
+
* - `enrollMfaAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* const { enrollMfaAsync } = useEnrollMfa();
|
|
17
|
+
* const { uri, backupCodes } = await enrollMfaAsync();
|
|
18
|
+
*/
|
|
19
|
+
export declare const useEnrollMfa: () => {
|
|
20
|
+
data: undefined;
|
|
21
|
+
variables: undefined;
|
|
22
|
+
error: null;
|
|
23
|
+
isError: false;
|
|
24
|
+
isIdle: true;
|
|
25
|
+
isPending: false;
|
|
26
|
+
isSuccess: false;
|
|
27
|
+
status: "idle";
|
|
28
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
29
|
+
reset: () => void;
|
|
30
|
+
context: unknown;
|
|
31
|
+
failureCount: number;
|
|
32
|
+
failureReason: Error;
|
|
33
|
+
isPaused: boolean;
|
|
34
|
+
submittedAt: number;
|
|
35
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
36
|
+
enrollMfa: import("@tanstack/react-query").UseMutateFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
37
|
+
enrollMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
38
|
+
} | {
|
|
39
|
+
data: undefined;
|
|
40
|
+
variables: void;
|
|
41
|
+
error: null;
|
|
42
|
+
isError: false;
|
|
43
|
+
isIdle: false;
|
|
44
|
+
isPending: true;
|
|
45
|
+
isSuccess: false;
|
|
46
|
+
status: "pending";
|
|
47
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
48
|
+
reset: () => void;
|
|
49
|
+
context: unknown;
|
|
50
|
+
failureCount: number;
|
|
51
|
+
failureReason: Error;
|
|
52
|
+
isPaused: boolean;
|
|
53
|
+
submittedAt: number;
|
|
54
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
55
|
+
enrollMfa: import("@tanstack/react-query").UseMutateFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
56
|
+
enrollMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
57
|
+
} | {
|
|
58
|
+
data: undefined;
|
|
59
|
+
error: Error;
|
|
60
|
+
variables: void;
|
|
61
|
+
isError: true;
|
|
62
|
+
isIdle: false;
|
|
63
|
+
isPending: false;
|
|
64
|
+
isSuccess: false;
|
|
65
|
+
status: "error";
|
|
66
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
67
|
+
reset: () => void;
|
|
68
|
+
context: unknown;
|
|
69
|
+
failureCount: number;
|
|
70
|
+
failureReason: Error;
|
|
71
|
+
isPaused: boolean;
|
|
72
|
+
submittedAt: number;
|
|
73
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
74
|
+
enrollMfa: import("@tanstack/react-query").UseMutateFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
75
|
+
enrollMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
76
|
+
} | {
|
|
77
|
+
data: EnrollMfaResponse;
|
|
78
|
+
error: null;
|
|
79
|
+
variables: void;
|
|
80
|
+
isError: false;
|
|
81
|
+
isIdle: false;
|
|
82
|
+
isPending: false;
|
|
83
|
+
isSuccess: true;
|
|
84
|
+
status: "success";
|
|
85
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
86
|
+
reset: () => void;
|
|
87
|
+
context: unknown;
|
|
88
|
+
failureCount: number;
|
|
89
|
+
failureReason: Error;
|
|
90
|
+
isPaused: boolean;
|
|
91
|
+
submittedAt: number;
|
|
92
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
93
|
+
enrollMfa: import("@tanstack/react-query").UseMutateFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
94
|
+
enrollMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<EnrollMfaResponse, Error, void, unknown>;
|
|
95
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { useMutation } from "@tanstack/react-query";
|
|
22
|
+
import { useClient } from "../utils/index.js";
|
|
23
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
24
|
+
import { enrollMfa } from "../../actions/index.js";
|
|
25
|
+
const ENROLL_MFA_KEY = "ENROLL_MFA";
|
|
26
|
+
const useEnrollMfa = () => {
|
|
27
|
+
const para = useClient();
|
|
28
|
+
const mutation = useMutation({
|
|
29
|
+
mutationKey: [ENROLL_MFA_KEY],
|
|
30
|
+
mutationFn: () => __async(void 0, null, function* () {
|
|
31
|
+
return enrollMfa(para);
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
return renameMutations(mutation, "enrollMfa");
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
ENROLL_MFA_KEY,
|
|
38
|
+
useEnrollMfa
|
|
39
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { VerifyFarcasterParams, OAuthResponse } from '@getpara/core-sdk';
|
|
2
|
+
export declare const VERIFY_FARCASTER_KEY = "VERIFY_FARCASTER";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `verifyFarcaster` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `verifyFarcaster`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `verifyFarcasterAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { verifyFarcaster, verifyFarcasterAsync } = useVerifyFarcaster();
|
|
13
|
+
* verifyFarcaster({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await verifyFarcasterAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useVerifyFarcaster: () => {
|
|
18
|
+
data: undefined;
|
|
19
|
+
variables: undefined;
|
|
20
|
+
error: null;
|
|
21
|
+
isError: false;
|
|
22
|
+
isIdle: true;
|
|
23
|
+
isPending: false;
|
|
24
|
+
isSuccess: false;
|
|
25
|
+
status: "idle";
|
|
26
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
27
|
+
reset: () => void;
|
|
28
|
+
context: unknown;
|
|
29
|
+
failureCount: number;
|
|
30
|
+
failureReason: Error;
|
|
31
|
+
isPaused: boolean;
|
|
32
|
+
submittedAt: number;
|
|
33
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
34
|
+
verifyFarcaster: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
35
|
+
verifyFarcasterAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
36
|
+
} | {
|
|
37
|
+
data: undefined;
|
|
38
|
+
variables: void | VerifyFarcasterParams;
|
|
39
|
+
error: null;
|
|
40
|
+
isError: false;
|
|
41
|
+
isIdle: false;
|
|
42
|
+
isPending: true;
|
|
43
|
+
isSuccess: false;
|
|
44
|
+
status: "pending";
|
|
45
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
46
|
+
reset: () => void;
|
|
47
|
+
context: unknown;
|
|
48
|
+
failureCount: number;
|
|
49
|
+
failureReason: Error;
|
|
50
|
+
isPaused: boolean;
|
|
51
|
+
submittedAt: number;
|
|
52
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
53
|
+
verifyFarcaster: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
54
|
+
verifyFarcasterAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
55
|
+
} | {
|
|
56
|
+
data: undefined;
|
|
57
|
+
error: Error;
|
|
58
|
+
variables: void | VerifyFarcasterParams;
|
|
59
|
+
isError: true;
|
|
60
|
+
isIdle: false;
|
|
61
|
+
isPending: false;
|
|
62
|
+
isSuccess: false;
|
|
63
|
+
status: "error";
|
|
64
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
65
|
+
reset: () => void;
|
|
66
|
+
context: unknown;
|
|
67
|
+
failureCount: number;
|
|
68
|
+
failureReason: Error;
|
|
69
|
+
isPaused: boolean;
|
|
70
|
+
submittedAt: number;
|
|
71
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
72
|
+
verifyFarcaster: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
73
|
+
verifyFarcasterAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
74
|
+
} | {
|
|
75
|
+
data: OAuthResponse;
|
|
76
|
+
error: null;
|
|
77
|
+
variables: void | VerifyFarcasterParams;
|
|
78
|
+
isError: false;
|
|
79
|
+
isIdle: false;
|
|
80
|
+
isPending: false;
|
|
81
|
+
isSuccess: true;
|
|
82
|
+
status: "success";
|
|
83
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
84
|
+
reset: () => void;
|
|
85
|
+
context: unknown;
|
|
86
|
+
failureCount: number;
|
|
87
|
+
failureReason: Error;
|
|
88
|
+
isPaused: boolean;
|
|
89
|
+
submittedAt: number;
|
|
90
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
91
|
+
verifyFarcaster: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
92
|
+
verifyFarcasterAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, void | VerifyFarcasterParams, unknown>;
|
|
93
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { VerifyMfaParams, VerifyMfaResult } from '@getpara/core-sdk';
|
|
2
|
+
export declare const VERIFY_MFA_KEY = "VERIFY_MFA";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `verifyMfa` mutation — login-time 2FA verification (ENG-6906).
|
|
5
|
+
*
|
|
6
|
+
* Submits the user's TOTP (or one-time backup) `code`. On `{ ok: true }` the SDK
|
|
7
|
+
* has already advanced the login flow (re-polled the status), so the auth state
|
|
8
|
+
* moves on toward `authenticated`. On `{ ok: false }` the result carries
|
|
9
|
+
* `attemptsRemaining` so the UI can re-prompt without treating it as a hard error.
|
|
10
|
+
* Distinct from `useVerify2fa`, which is the recovery-gating 2FA verify.
|
|
11
|
+
*
|
|
12
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
13
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
14
|
+
* - `verifyMfa`: function to trigger the mutation (same as `mutate`)
|
|
15
|
+
* - `verifyMfaAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const { verifyMfaAsync } = useVerifyMfa();
|
|
19
|
+
* const result = await verifyMfaAsync({ code: '123456' });
|
|
20
|
+
* if (!result.ok) setRemaining(result.attemptsRemaining);
|
|
21
|
+
*/
|
|
22
|
+
export declare const useVerifyMfa: () => {
|
|
23
|
+
data: undefined;
|
|
24
|
+
variables: undefined;
|
|
25
|
+
error: null;
|
|
26
|
+
isError: false;
|
|
27
|
+
isIdle: true;
|
|
28
|
+
isPending: false;
|
|
29
|
+
isSuccess: false;
|
|
30
|
+
status: "idle";
|
|
31
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
32
|
+
reset: () => void;
|
|
33
|
+
context: unknown;
|
|
34
|
+
failureCount: number;
|
|
35
|
+
failureReason: Error;
|
|
36
|
+
isPaused: boolean;
|
|
37
|
+
submittedAt: number;
|
|
38
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
39
|
+
verifyMfa: import("@tanstack/react-query").UseMutateFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
40
|
+
verifyMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
41
|
+
} | {
|
|
42
|
+
data: undefined;
|
|
43
|
+
variables: VerifyMfaParams;
|
|
44
|
+
error: null;
|
|
45
|
+
isError: false;
|
|
46
|
+
isIdle: false;
|
|
47
|
+
isPending: true;
|
|
48
|
+
isSuccess: false;
|
|
49
|
+
status: "pending";
|
|
50
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
51
|
+
reset: () => void;
|
|
52
|
+
context: unknown;
|
|
53
|
+
failureCount: number;
|
|
54
|
+
failureReason: Error;
|
|
55
|
+
isPaused: boolean;
|
|
56
|
+
submittedAt: number;
|
|
57
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
58
|
+
verifyMfa: import("@tanstack/react-query").UseMutateFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
59
|
+
verifyMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
60
|
+
} | {
|
|
61
|
+
data: undefined;
|
|
62
|
+
error: Error;
|
|
63
|
+
variables: VerifyMfaParams;
|
|
64
|
+
isError: true;
|
|
65
|
+
isIdle: false;
|
|
66
|
+
isPending: false;
|
|
67
|
+
isSuccess: false;
|
|
68
|
+
status: "error";
|
|
69
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
70
|
+
reset: () => void;
|
|
71
|
+
context: unknown;
|
|
72
|
+
failureCount: number;
|
|
73
|
+
failureReason: Error;
|
|
74
|
+
isPaused: boolean;
|
|
75
|
+
submittedAt: number;
|
|
76
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
77
|
+
verifyMfa: import("@tanstack/react-query").UseMutateFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
78
|
+
verifyMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
79
|
+
} | {
|
|
80
|
+
data: VerifyMfaResult;
|
|
81
|
+
error: null;
|
|
82
|
+
variables: VerifyMfaParams;
|
|
83
|
+
isError: false;
|
|
84
|
+
isIdle: false;
|
|
85
|
+
isPending: false;
|
|
86
|
+
isSuccess: true;
|
|
87
|
+
status: "success";
|
|
88
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
89
|
+
reset: () => void;
|
|
90
|
+
context: unknown;
|
|
91
|
+
failureCount: number;
|
|
92
|
+
failureReason: Error;
|
|
93
|
+
isPaused: boolean;
|
|
94
|
+
submittedAt: number;
|
|
95
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
96
|
+
verifyMfa: import("@tanstack/react-query").UseMutateFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
97
|
+
verifyMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyMfaResult, Error, VerifyMfaParams, unknown>;
|
|
98
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { useMutation } from "@tanstack/react-query";
|
|
22
|
+
import { useClient } from "../utils/index.js";
|
|
23
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
24
|
+
import { verifyMfa } from "../../actions/index.js";
|
|
25
|
+
const VERIFY_MFA_KEY = "VERIFY_MFA";
|
|
26
|
+
const useVerifyMfa = () => {
|
|
27
|
+
const para = useClient();
|
|
28
|
+
const mutation = useMutation({
|
|
29
|
+
mutationKey: [VERIFY_MFA_KEY],
|
|
30
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
31
|
+
return verifyMfa(para, args);
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
return renameMutations(mutation, "verifyMfa");
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
VERIFY_MFA_KEY,
|
|
38
|
+
useVerifyMfa
|
|
39
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { VerifyOAuthProcessParams, OAuthResponse } from '@getpara/core-sdk';
|
|
2
|
+
export declare const VERIFY_OAUTH_KEY = "VERIFY_OAUTH";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `verifyOAuth` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `verifyOAuth`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `verifyOAuthAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { verifyOAuth, verifyOAuthAsync } = useVerifyOAuth();
|
|
13
|
+
* verifyOAuth({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await verifyOAuthAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useVerifyOAuth: () => {
|
|
18
|
+
data: undefined;
|
|
19
|
+
variables: undefined;
|
|
20
|
+
error: null;
|
|
21
|
+
isError: false;
|
|
22
|
+
isIdle: true;
|
|
23
|
+
isPending: false;
|
|
24
|
+
isSuccess: false;
|
|
25
|
+
status: "idle";
|
|
26
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
27
|
+
reset: () => void;
|
|
28
|
+
context: unknown;
|
|
29
|
+
failureCount: number;
|
|
30
|
+
failureReason: Error;
|
|
31
|
+
isPaused: boolean;
|
|
32
|
+
submittedAt: number;
|
|
33
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
34
|
+
verifyOAuth: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
35
|
+
verifyOAuthAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
36
|
+
} | {
|
|
37
|
+
data: undefined;
|
|
38
|
+
variables: VerifyOAuthProcessParams;
|
|
39
|
+
error: null;
|
|
40
|
+
isError: false;
|
|
41
|
+
isIdle: false;
|
|
42
|
+
isPending: true;
|
|
43
|
+
isSuccess: false;
|
|
44
|
+
status: "pending";
|
|
45
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
46
|
+
reset: () => void;
|
|
47
|
+
context: unknown;
|
|
48
|
+
failureCount: number;
|
|
49
|
+
failureReason: Error;
|
|
50
|
+
isPaused: boolean;
|
|
51
|
+
submittedAt: number;
|
|
52
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
53
|
+
verifyOAuth: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
54
|
+
verifyOAuthAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
55
|
+
} | {
|
|
56
|
+
data: undefined;
|
|
57
|
+
error: Error;
|
|
58
|
+
variables: VerifyOAuthProcessParams;
|
|
59
|
+
isError: true;
|
|
60
|
+
isIdle: false;
|
|
61
|
+
isPending: false;
|
|
62
|
+
isSuccess: false;
|
|
63
|
+
status: "error";
|
|
64
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
65
|
+
reset: () => void;
|
|
66
|
+
context: unknown;
|
|
67
|
+
failureCount: number;
|
|
68
|
+
failureReason: Error;
|
|
69
|
+
isPaused: boolean;
|
|
70
|
+
submittedAt: number;
|
|
71
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
72
|
+
verifyOAuth: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
73
|
+
verifyOAuthAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
74
|
+
} | {
|
|
75
|
+
data: OAuthResponse;
|
|
76
|
+
error: null;
|
|
77
|
+
variables: VerifyOAuthProcessParams;
|
|
78
|
+
isError: false;
|
|
79
|
+
isIdle: false;
|
|
80
|
+
isPending: false;
|
|
81
|
+
isSuccess: true;
|
|
82
|
+
status: "success";
|
|
83
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
84
|
+
reset: () => void;
|
|
85
|
+
context: unknown;
|
|
86
|
+
failureCount: number;
|
|
87
|
+
failureReason: Error;
|
|
88
|
+
isPaused: boolean;
|
|
89
|
+
submittedAt: number;
|
|
90
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
91
|
+
verifyOAuth: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
92
|
+
verifyOAuthAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyOAuthProcessParams, unknown>;
|
|
93
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { VerifyTelegramParams, OAuthResponse } from '@getpara/core-sdk';
|
|
2
|
+
export declare const VERIFY_TELEGRAM_KEY = "VERIFY_TELEGRAM";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `verifyTelegram` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `verifyTelegram`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `verifyTelegramAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { verifyTelegram, verifyTelegramAsync } = useVerifyTelegram();
|
|
13
|
+
* verifyTelegram({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await verifyTelegramAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useVerifyTelegram: () => {
|
|
18
|
+
data: undefined;
|
|
19
|
+
variables: undefined;
|
|
20
|
+
error: null;
|
|
21
|
+
isError: false;
|
|
22
|
+
isIdle: true;
|
|
23
|
+
isPending: false;
|
|
24
|
+
isSuccess: false;
|
|
25
|
+
status: "idle";
|
|
26
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
27
|
+
reset: () => void;
|
|
28
|
+
context: unknown;
|
|
29
|
+
failureCount: number;
|
|
30
|
+
failureReason: Error;
|
|
31
|
+
isPaused: boolean;
|
|
32
|
+
submittedAt: number;
|
|
33
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
34
|
+
verifyTelegram: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
35
|
+
verifyTelegramAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
36
|
+
} | {
|
|
37
|
+
data: undefined;
|
|
38
|
+
variables: VerifyTelegramParams;
|
|
39
|
+
error: null;
|
|
40
|
+
isError: false;
|
|
41
|
+
isIdle: false;
|
|
42
|
+
isPending: true;
|
|
43
|
+
isSuccess: false;
|
|
44
|
+
status: "pending";
|
|
45
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
46
|
+
reset: () => void;
|
|
47
|
+
context: unknown;
|
|
48
|
+
failureCount: number;
|
|
49
|
+
failureReason: Error;
|
|
50
|
+
isPaused: boolean;
|
|
51
|
+
submittedAt: number;
|
|
52
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
53
|
+
verifyTelegram: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
54
|
+
verifyTelegramAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
55
|
+
} | {
|
|
56
|
+
data: undefined;
|
|
57
|
+
error: Error;
|
|
58
|
+
variables: VerifyTelegramParams;
|
|
59
|
+
isError: true;
|
|
60
|
+
isIdle: false;
|
|
61
|
+
isPending: false;
|
|
62
|
+
isSuccess: false;
|
|
63
|
+
status: "error";
|
|
64
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
65
|
+
reset: () => void;
|
|
66
|
+
context: unknown;
|
|
67
|
+
failureCount: number;
|
|
68
|
+
failureReason: Error;
|
|
69
|
+
isPaused: boolean;
|
|
70
|
+
submittedAt: number;
|
|
71
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
72
|
+
verifyTelegram: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
73
|
+
verifyTelegramAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
74
|
+
} | {
|
|
75
|
+
data: OAuthResponse;
|
|
76
|
+
error: null;
|
|
77
|
+
variables: VerifyTelegramParams;
|
|
78
|
+
isError: false;
|
|
79
|
+
isIdle: false;
|
|
80
|
+
isPending: false;
|
|
81
|
+
isSuccess: true;
|
|
82
|
+
status: "success";
|
|
83
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
84
|
+
reset: () => void;
|
|
85
|
+
context: unknown;
|
|
86
|
+
failureCount: number;
|
|
87
|
+
failureReason: Error;
|
|
88
|
+
isPaused: boolean;
|
|
89
|
+
submittedAt: number;
|
|
90
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
91
|
+
verifyTelegram: import("@tanstack/react-query").UseMutateFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
92
|
+
verifyTelegramAsync: import("@tanstack/react-query").UseMutateAsyncFunction<OAuthResponse, Error, VerifyTelegramParams, unknown>;
|
|
93
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Platform-agnostic ParaProvider, hooks, and store for Para SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -82,17 +82,17 @@
|
|
|
82
82
|
"test": "vitest run"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@getpara/core-sdk": "3.
|
|
85
|
+
"@getpara/core-sdk": "3.5.0",
|
|
86
86
|
"zustand": "^5.0.0"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@cosmjs/amino": "^0.32.0",
|
|
90
90
|
"@cosmjs/proto-signing": "^0.32.0",
|
|
91
|
-
"@getpara/cosmjs-v0-integration": "3.
|
|
92
|
-
"@getpara/ethers-v6-integration": "3.
|
|
93
|
-
"@getpara/solana-signers-v2-integration": "3.
|
|
94
|
-
"@getpara/stellar-sdk-v14-integration": "3.
|
|
95
|
-
"@getpara/viem-v2-integration": "3.
|
|
91
|
+
"@getpara/cosmjs-v0-integration": "3.5.0",
|
|
92
|
+
"@getpara/ethers-v6-integration": "3.5.0",
|
|
93
|
+
"@getpara/solana-signers-v2-integration": "3.5.0",
|
|
94
|
+
"@getpara/stellar-sdk-v14-integration": "3.5.0",
|
|
95
|
+
"@getpara/viem-v2-integration": "3.5.0",
|
|
96
96
|
"@solana/signers": "^2.0.0",
|
|
97
97
|
"@tanstack/react-query": "^5.74.0",
|
|
98
98
|
"@testing-library/dom": "^10.4.0",
|
|
@@ -134,5 +134,5 @@
|
|
|
134
134
|
"optional": true
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
|
-
"gitHead": "
|
|
137
|
+
"gitHead": "2e70485f8f206ff50f58b339ebf0922fd259858f"
|
|
138
138
|
}
|