@getpara/react-core 3.21.0 → 3.22.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.
|
@@ -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,
|
|
2
|
+
import type { SignUpOrLogInParams, SignUpOrLogInResponse, WaitForLoginParams, WaitForLoginResponse, WaitForSignupParams, WaitForWalletCreationParams, WaitForWalletCreationResponse, VerifyOAuthProcessParams, OAuthResponse, VerifyFarcasterParams, VerifyTelegramParams, LoginExternalWalletParams, LoginExternalWalletResponse, VerifyExternalWalletParams, VerifyExternalWalletResponse, Setup2faResponse, Enable2faParams, Verify2faParams, Verify2faResponse, TwoFactorEnrollResponse, VerifyMfaParams, EnrollMfaParams, 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, GetAuthFactorsResponse, AddAuthFactorParams, AddAuthFactorResponse, AddOAuthFactorParams, AddOAuthFactorResponse, AddExternalWalletFactorParams, AddExternalWalletFactorResponse, ContinueAuthFactorLinkParams, ContinueAuthFactorLinkResponse, UnlinkAuthFactorParams, AddCredentialParams, ExportPrivateKeyParams, ExportPrivateKeyResponse, RequestFaucetParams, RequestFaucetResponse, AuthenticateWithEmailOrPhoneParams, AuthenticateWithEmailOrPhoneResponse, AuthenticateWithOAuthParams, AuthenticateWithOAuthResponse, AuthenticateWithCustomOAuthParams, AuthenticateWithCustomOAuthResponse } from '@getpara/core-sdk';
|
|
3
3
|
export { generateCoreAction, type CoreAction } from './utils.js';
|
|
4
4
|
export { getEmbeddedAccount, type EmbeddedAccount } from './getEmbeddedAccount.js';
|
|
5
5
|
export { getWallet } from './getWallet.js';
|
|
@@ -16,7 +16,7 @@ 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<
|
|
19
|
+
export declare const enrollMfa: (para?: ParaCore, args?: EnrollMfaParams) => Promise<TwoFactorEnrollResponse>;
|
|
20
20
|
export declare const verifyMfa: (para?: ParaCore, args?: VerifyMfaParams) => Promise<VerifyMfaResult>;
|
|
21
21
|
export declare const keepSessionAlive: (para?: ParaCore) => Promise<boolean>;
|
|
22
22
|
export declare const logout: (para?: ParaCore, args?: LogoutParams) => Promise<void>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TwoFactorEnrollResponse } from '@getpara/core-sdk';
|
|
2
2
|
export declare const ENROLL_MFA_KEY = "ENROLL_MFA";
|
|
3
3
|
/**
|
|
4
4
|
* React hook for the `enrollMfa` mutation — login-time 2FA enrollment (ENG-6906).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* `uri` (render as a QR) plus one-time `backupCodes` (show the user exactly once).
|
|
8
|
-
*
|
|
6
|
+
* With no args 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). A credential
|
|
8
|
+
* second factor (passkey / password / PIN — enclave-custodied accounts only) passes its
|
|
9
|
+
* method-tagged body; a passkey is two calls (`{ method:'passkey' }` → challenge, then the
|
|
10
|
+
* registration over it). Distinct from `useSetup2fa`, which configures the recovery-gating 2FA.
|
|
9
11
|
*
|
|
10
12
|
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
11
13
|
* - `mutate` and `mutateAsync` are replaced by:
|
|
@@ -25,71 +27,71 @@ export declare const useEnrollMfa: () => {
|
|
|
25
27
|
isPending: false;
|
|
26
28
|
isSuccess: false;
|
|
27
29
|
status: "idle";
|
|
28
|
-
mutate: import("@tanstack/react-query").UseMutateFunction<
|
|
30
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
29
31
|
reset: () => void;
|
|
30
32
|
context: unknown;
|
|
31
33
|
failureCount: number;
|
|
32
34
|
failureReason: Error;
|
|
33
35
|
isPaused: boolean;
|
|
34
36
|
submittedAt: number;
|
|
35
|
-
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<
|
|
36
|
-
enrollMfa: import("@tanstack/react-query").UseMutateFunction<
|
|
37
|
-
enrollMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<
|
|
37
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
38
|
+
enrollMfa: import("@tanstack/react-query").UseMutateFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
39
|
+
enrollMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
38
40
|
} | {
|
|
39
41
|
data: undefined;
|
|
40
|
-
variables:
|
|
42
|
+
variables: import("@getpara/user-management-client").TwoFactorEnrollBody;
|
|
41
43
|
error: null;
|
|
42
44
|
isError: false;
|
|
43
45
|
isIdle: false;
|
|
44
46
|
isPending: true;
|
|
45
47
|
isSuccess: false;
|
|
46
48
|
status: "pending";
|
|
47
|
-
mutate: import("@tanstack/react-query").UseMutateFunction<
|
|
49
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
48
50
|
reset: () => void;
|
|
49
51
|
context: unknown;
|
|
50
52
|
failureCount: number;
|
|
51
53
|
failureReason: Error;
|
|
52
54
|
isPaused: boolean;
|
|
53
55
|
submittedAt: number;
|
|
54
|
-
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<
|
|
55
|
-
enrollMfa: import("@tanstack/react-query").UseMutateFunction<
|
|
56
|
-
enrollMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<
|
|
56
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
57
|
+
enrollMfa: import("@tanstack/react-query").UseMutateFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
58
|
+
enrollMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
57
59
|
} | {
|
|
58
60
|
data: undefined;
|
|
59
61
|
error: Error;
|
|
60
|
-
variables:
|
|
62
|
+
variables: import("@getpara/user-management-client").TwoFactorEnrollBody;
|
|
61
63
|
isError: true;
|
|
62
64
|
isIdle: false;
|
|
63
65
|
isPending: false;
|
|
64
66
|
isSuccess: false;
|
|
65
67
|
status: "error";
|
|
66
|
-
mutate: import("@tanstack/react-query").UseMutateFunction<
|
|
68
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
67
69
|
reset: () => void;
|
|
68
70
|
context: unknown;
|
|
69
71
|
failureCount: number;
|
|
70
72
|
failureReason: Error;
|
|
71
73
|
isPaused: boolean;
|
|
72
74
|
submittedAt: number;
|
|
73
|
-
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<
|
|
74
|
-
enrollMfa: import("@tanstack/react-query").UseMutateFunction<
|
|
75
|
-
enrollMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<
|
|
75
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
76
|
+
enrollMfa: import("@tanstack/react-query").UseMutateFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
77
|
+
enrollMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
76
78
|
} | {
|
|
77
|
-
data:
|
|
79
|
+
data: TwoFactorEnrollResponse;
|
|
78
80
|
error: null;
|
|
79
|
-
variables:
|
|
81
|
+
variables: import("@getpara/user-management-client").TwoFactorEnrollBody;
|
|
80
82
|
isError: false;
|
|
81
83
|
isIdle: false;
|
|
82
84
|
isPending: false;
|
|
83
85
|
isSuccess: true;
|
|
84
86
|
status: "success";
|
|
85
|
-
mutate: import("@tanstack/react-query").UseMutateFunction<
|
|
87
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
86
88
|
reset: () => void;
|
|
87
89
|
context: unknown;
|
|
88
90
|
failureCount: number;
|
|
89
91
|
failureReason: Error;
|
|
90
92
|
isPaused: boolean;
|
|
91
93
|
submittedAt: number;
|
|
92
|
-
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<
|
|
93
|
-
enrollMfa: import("@tanstack/react-query").UseMutateFunction<
|
|
94
|
-
enrollMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<
|
|
94
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
95
|
+
enrollMfa: import("@tanstack/react-query").UseMutateFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
96
|
+
enrollMfaAsync: import("@tanstack/react-query").UseMutateAsyncFunction<TwoFactorEnrollResponse, Error, import("@getpara/user-management-client").TwoFactorEnrollBody, unknown>;
|
|
95
97
|
};
|
|
@@ -27,11 +27,14 @@ const useEnrollMfa = () => {
|
|
|
27
27
|
const para = useClient();
|
|
28
28
|
const mutation = useMutation({
|
|
29
29
|
mutationKey: [ENROLL_MFA_KEY],
|
|
30
|
-
mutationFn: () => __async(null, null, function* () {
|
|
31
|
-
return enrollMfa(para);
|
|
30
|
+
mutationFn: (args) => __async(null, null, function* () {
|
|
31
|
+
return enrollMfa(para, args);
|
|
32
32
|
})
|
|
33
33
|
});
|
|
34
|
-
return renameMutations(
|
|
34
|
+
return renameMutations(
|
|
35
|
+
mutation,
|
|
36
|
+
"enrollMfa"
|
|
37
|
+
);
|
|
35
38
|
};
|
|
36
39
|
export {
|
|
37
40
|
ENROLL_MFA_KEY,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.22.0",
|
|
4
4
|
"description": "Platform-agnostic ParaProvider, hooks, and store for Para SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -168,29 +168,29 @@
|
|
|
168
168
|
"typecheck": "tsc --noEmit"
|
|
169
169
|
},
|
|
170
170
|
"dependencies": {
|
|
171
|
-
"@getpara/core-sdk": "3.
|
|
171
|
+
"@getpara/core-sdk": "3.22.0",
|
|
172
172
|
"zustand": "^5.0.0"
|
|
173
173
|
},
|
|
174
174
|
"devDependencies": {
|
|
175
175
|
"@cosmjs/amino": "^0.32.4",
|
|
176
176
|
"@cosmjs/proto-signing": "^0.32.4",
|
|
177
177
|
"@cosmjs/stargate": "^0.32.4",
|
|
178
|
-
"@getpara/aa-alchemy": "3.
|
|
179
|
-
"@getpara/aa-biconomy": "3.
|
|
180
|
-
"@getpara/aa-cdp": "3.
|
|
181
|
-
"@getpara/aa-gelato": "3.
|
|
182
|
-
"@getpara/aa-pimlico": "3.
|
|
183
|
-
"@getpara/aa-porto": "3.
|
|
184
|
-
"@getpara/aa-rhinestone": "3.
|
|
185
|
-
"@getpara/aa-safe": "3.
|
|
186
|
-
"@getpara/aa-thirdweb": "3.
|
|
187
|
-
"@getpara/aa-zerodev": "3.
|
|
188
|
-
"@getpara/cosmjs-v0-integration": "3.
|
|
189
|
-
"@getpara/ethers-v6-integration": "3.
|
|
190
|
-
"@getpara/solana-signers-v2-integration": "3.
|
|
191
|
-
"@getpara/stellar-sdk-v14-integration": "3.
|
|
192
|
-
"@getpara/sui-sdk-integration": "3.
|
|
193
|
-
"@getpara/viem-v2-integration": "3.
|
|
178
|
+
"@getpara/aa-alchemy": "3.22.0",
|
|
179
|
+
"@getpara/aa-biconomy": "3.22.0",
|
|
180
|
+
"@getpara/aa-cdp": "3.22.0",
|
|
181
|
+
"@getpara/aa-gelato": "3.22.0",
|
|
182
|
+
"@getpara/aa-pimlico": "3.22.0",
|
|
183
|
+
"@getpara/aa-porto": "3.22.0",
|
|
184
|
+
"@getpara/aa-rhinestone": "3.22.0",
|
|
185
|
+
"@getpara/aa-safe": "3.22.0",
|
|
186
|
+
"@getpara/aa-thirdweb": "3.22.0",
|
|
187
|
+
"@getpara/aa-zerodev": "3.22.0",
|
|
188
|
+
"@getpara/cosmjs-v0-integration": "3.22.0",
|
|
189
|
+
"@getpara/ethers-v6-integration": "3.22.0",
|
|
190
|
+
"@getpara/solana-signers-v2-integration": "3.22.0",
|
|
191
|
+
"@getpara/stellar-sdk-v14-integration": "3.22.0",
|
|
192
|
+
"@getpara/sui-sdk-integration": "3.22.0",
|
|
193
|
+
"@getpara/viem-v2-integration": "3.22.0",
|
|
194
194
|
"@mysten/sui": "^2.0.0",
|
|
195
195
|
"@solana/keys": "^2.2.1",
|
|
196
196
|
"@solana/signers": "^2.0.0",
|
|
@@ -308,5 +308,5 @@
|
|
|
308
308
|
"@getpara/aa-*"
|
|
309
309
|
]
|
|
310
310
|
},
|
|
311
|
-
"gitHead": "
|
|
311
|
+
"gitHead": "4ca50a0fc70e11370595f16daad0f1ac4da0edbc"
|
|
312
312
|
}
|