@getpara/react-core 3.27.0 → 3.29.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 CHANGED
@@ -27,6 +27,8 @@ export { useVerify2fa } from './provider/hooks/mutations/useVerify2fa.js';
27
27
  export { useEnrollMfa } from './provider/hooks/mutations/useEnrollMfa.js';
28
28
  export { useVerifyMfa } from './provider/hooks/mutations/useVerifyMfa.js';
29
29
  export { useIssueJwt } from './provider/hooks/mutations/useIssueJwt.js';
30
+ export { useCreateKycSession } from './provider/hooks/mutations/useCreateKycSession.js';
31
+ export { useShareKyc } from './provider/hooks/mutations/useShareKyc.js';
30
32
  export { useResendVerificationCode } from './provider/hooks/mutations/useResendVerificationCode.js';
31
33
  export { useExportPrivateKey, EXPORT_PRIVATE_KEY_KEY } from './provider/hooks/mutations/useExportPrivateKey.js';
32
34
  export { useRequestFaucet, REQUEST_FAUCET_KEY } from './provider/hooks/mutations/useRequestFaucet.js';
package/dist/index.js CHANGED
@@ -25,6 +25,8 @@ import { useVerify2fa } from "./provider/hooks/mutations/useVerify2fa.js";
25
25
  import { useEnrollMfa } from "./provider/hooks/mutations/useEnrollMfa.js";
26
26
  import { useVerifyMfa } from "./provider/hooks/mutations/useVerifyMfa.js";
27
27
  import { useIssueJwt } from "./provider/hooks/mutations/useIssueJwt.js";
28
+ import { useCreateKycSession } from "./provider/hooks/mutations/useCreateKycSession.js";
29
+ import { useShareKyc } from "./provider/hooks/mutations/useShareKyc.js";
28
30
  import { useResendVerificationCode } from "./provider/hooks/mutations/useResendVerificationCode.js";
29
31
  import { useExportPrivateKey, EXPORT_PRIVATE_KEY_KEY } from "./provider/hooks/mutations/useExportPrivateKey.js";
30
32
  import { useRequestFaucet, REQUEST_FAUCET_KEY } from "./provider/hooks/mutations/useRequestFaucet.js";
@@ -56,6 +58,7 @@ export {
56
58
  useClient,
57
59
  useCoreWalletState,
58
60
  useCreateGuestWallets,
61
+ useCreateKycSession,
59
62
  useCreatePregenWallet,
60
63
  useCreatePregenWalletPerType,
61
64
  useCreateWallet,
@@ -73,6 +76,7 @@ export {
73
76
  useRequestFaucet,
74
77
  useResendVerificationCode,
75
78
  useSetup2fa,
79
+ useShareKyc,
76
80
  useSignMessage,
77
81
  useSignTransaction,
78
82
  useSignUpOrLogIn,
@@ -17,6 +17,8 @@ export { useVerify2fa } from './provider/hooks/mutations/useVerify2fa.js';
17
17
  export { useEnrollMfa } from './provider/hooks/mutations/useEnrollMfa.js';
18
18
  export { useVerifyMfa } from './provider/hooks/mutations/useVerifyMfa.js';
19
19
  export { useIssueJwt } from './provider/hooks/mutations/useIssueJwt.js';
20
+ export { useCreateKycSession } from './provider/hooks/mutations/useCreateKycSession.js';
21
+ export { useShareKyc } from './provider/hooks/mutations/useShareKyc.js';
20
22
  export { useResendVerificationCode } from './provider/hooks/mutations/useResendVerificationCode.js';
21
23
  export { useAuthenticateWithEmailOrPhone } from './provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js';
22
24
  export { useAuthenticateWithOAuth } from './provider/hooks/mutations/useAuthenticateWithOAuth.js';
package/dist/mutations.js CHANGED
@@ -17,6 +17,8 @@ import { useVerify2fa } from "./provider/hooks/mutations/useVerify2fa.js";
17
17
  import { useEnrollMfa } from "./provider/hooks/mutations/useEnrollMfa.js";
18
18
  import { useVerifyMfa } from "./provider/hooks/mutations/useVerifyMfa.js";
19
19
  import { useIssueJwt } from "./provider/hooks/mutations/useIssueJwt.js";
20
+ import { useCreateKycSession } from "./provider/hooks/mutations/useCreateKycSession.js";
21
+ import { useShareKyc } from "./provider/hooks/mutations/useShareKyc.js";
20
22
  import { useResendVerificationCode } from "./provider/hooks/mutations/useResendVerificationCode.js";
21
23
  import { useAuthenticateWithEmailOrPhone } from "./provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js";
22
24
  import { useAuthenticateWithOAuth } from "./provider/hooks/mutations/useAuthenticateWithOAuth.js";
@@ -39,6 +41,7 @@ export {
39
41
  useAuthenticateWithOAuth,
40
42
  useClaimPregenWallets,
41
43
  useCreateGuestWallets,
44
+ useCreateKycSession,
42
45
  useCreatePregenWallet,
43
46
  useCreatePregenWalletPerType,
44
47
  useCreateWallet,
@@ -54,6 +57,7 @@ export {
54
57
  useRequestFaucet,
55
58
  useResendVerificationCode,
56
59
  useSetup2fa,
60
+ useShareKyc,
57
61
  useSignMessage,
58
62
  useSignTransaction,
59
63
  useSignUpOrLogIn,
@@ -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, 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, RequestSigningDelegationParams, SigningDelegationConsentOutcome } 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, 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, KycSessionResponse, KycShareProvider, KycShareResponse, KycStatusResponse, AddAuthFactorParams, AddAuthFactorResponse, AddOAuthFactorParams, AddOAuthFactorResponse, AddExternalWalletFactorParams, AddExternalWalletFactorResponse, ContinueAuthFactorLinkParams, ContinueAuthFactorLinkResponse, UnlinkAuthFactorParams, AddCredentialParams, ExportPrivateKeyParams, ExportPrivateKeyResponse, RequestFaucetParams, RequestFaucetResponse, AuthenticateWithEmailOrPhoneParams, AuthenticateWithEmailOrPhoneResponse, AuthenticateWithOAuthParams, AuthenticateWithOAuthResponse, AuthenticateWithCustomOAuthParams, AuthenticateWithCustomOAuthResponse, RequestSigningDelegationParams, SigningDelegationConsentOutcome } 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';
@@ -34,6 +34,11 @@ export declare const signTransaction: (para?: ParaCore, args?: SignTransactionPa
34
34
  export declare const getWalletBalance: (para?: ParaCore, args?: GetWalletBalanceParams) => Promise<string>;
35
35
  export declare const issueJwt: (para?: ParaCore, args?: IssueJwtParams) => Promise<IssueJwtResponse>;
36
36
  export declare const getLinkedAccounts: (para?: ParaCore, args?: GetLinkedAccountsParams) => Promise<GetLinkedAccountsResponse>;
37
+ export declare const getKycStatus: (para?: ParaCore) => Promise<KycStatusResponse>;
38
+ export declare const createKycSession: (para?: ParaCore) => Promise<KycSessionResponse>;
39
+ export declare const shareKyc: (para?: ParaCore, args?: {
40
+ provider: KycShareProvider;
41
+ }) => Promise<KycShareResponse>;
37
42
  export declare const getAuthFactors: (para?: ParaCore) => Promise<GetAuthFactorsResponse>;
38
43
  export declare const addAuthFactor: (para?: ParaCore, args?: AddAuthFactorParams) => Promise<AddAuthFactorResponse>;
39
44
  export declare const addOAuthFactor: (para?: ParaCore, args?: AddOAuthFactorParams) => Promise<AddOAuthFactorResponse>;
@@ -33,6 +33,9 @@ const signTransaction = generateCoreAction("signTransaction");
33
33
  const getWalletBalance = generateCoreAction("getWalletBalance");
34
34
  const issueJwt = generateCoreAction("issueJwt");
35
35
  const getLinkedAccounts = generateCoreAction("getLinkedAccounts");
36
+ const getKycStatus = generateCoreAction("getKycStatus");
37
+ const createKycSession = generateCoreAction("createKycSession");
38
+ const shareKyc = generateCoreAction("shareKyc");
36
39
  const getAuthFactors = generateCoreAction("getAuthFactors");
37
40
  const addAuthFactor = generateCoreAction("addAuthFactor");
38
41
  const addOAuthFactor = generateCoreAction("addOAuthFactor");
@@ -58,6 +61,7 @@ export {
58
61
  claimPregenWallets,
59
62
  continueAuthFactorLink,
60
63
  createGuestWallets,
64
+ createKycSession,
61
65
  createPregenWallet,
62
66
  createPregenWalletPerType,
63
67
  createWallet,
@@ -68,6 +72,7 @@ export {
68
72
  generateCoreAction2 as generateCoreAction,
69
73
  getAuthFactors,
70
74
  getEmbeddedAccount,
75
+ getKycStatus,
71
76
  getLinkedAccounts,
72
77
  getWallet,
73
78
  getWalletBalance,
@@ -80,6 +85,7 @@ export {
80
85
  requestSigningDelegation,
81
86
  resendVerificationCode,
82
87
  setup2fa,
88
+ shareKyc,
83
89
  signMessage,
84
90
  signTransaction,
85
91
  signUpOrLogIn,
@@ -0,0 +1,87 @@
1
+ import type { KycSessionResponse } from '@getpara/core-sdk';
2
+ export declare const CREATE_KYC_SESSION_KEY = "CREATE_KYC_SESSION";
3
+ /**
4
+ * React hook for the `createKycSession` mutation: starts or resumes the user's identity verification and returns the
5
+ * access token for the provider's verification widget.
6
+ *
7
+ * @example
8
+ * const { createKycSessionAsync } = useCreateKycSession();
9
+ * const { provider, accessToken } = await createKycSessionAsync();
10
+ */
11
+ export declare const useCreateKycSession: () => {
12
+ data: undefined;
13
+ variables: undefined;
14
+ error: null;
15
+ isError: false;
16
+ isIdle: true;
17
+ isPending: false;
18
+ isSuccess: false;
19
+ status: "idle";
20
+ mutate: import("@tanstack/react-query").UseMutateFunction<KycSessionResponse, Error, void, unknown>;
21
+ reset: () => void;
22
+ context: unknown;
23
+ failureCount: number;
24
+ failureReason: Error;
25
+ isPaused: boolean;
26
+ submittedAt: number;
27
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycSessionResponse, Error, void, unknown>;
28
+ createKycSession: import("@tanstack/react-query").UseMutateFunction<KycSessionResponse, Error, void, unknown>;
29
+ createKycSessionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycSessionResponse, Error, void, unknown>;
30
+ } | {
31
+ data: undefined;
32
+ variables: void;
33
+ error: null;
34
+ isError: false;
35
+ isIdle: false;
36
+ isPending: true;
37
+ isSuccess: false;
38
+ status: "pending";
39
+ mutate: import("@tanstack/react-query").UseMutateFunction<KycSessionResponse, Error, void, unknown>;
40
+ reset: () => void;
41
+ context: unknown;
42
+ failureCount: number;
43
+ failureReason: Error;
44
+ isPaused: boolean;
45
+ submittedAt: number;
46
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycSessionResponse, Error, void, unknown>;
47
+ createKycSession: import("@tanstack/react-query").UseMutateFunction<KycSessionResponse, Error, void, unknown>;
48
+ createKycSessionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycSessionResponse, Error, void, unknown>;
49
+ } | {
50
+ data: undefined;
51
+ error: Error;
52
+ variables: void;
53
+ isError: true;
54
+ isIdle: false;
55
+ isPending: false;
56
+ isSuccess: false;
57
+ status: "error";
58
+ mutate: import("@tanstack/react-query").UseMutateFunction<KycSessionResponse, Error, void, unknown>;
59
+ reset: () => void;
60
+ context: unknown;
61
+ failureCount: number;
62
+ failureReason: Error;
63
+ isPaused: boolean;
64
+ submittedAt: number;
65
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycSessionResponse, Error, void, unknown>;
66
+ createKycSession: import("@tanstack/react-query").UseMutateFunction<KycSessionResponse, Error, void, unknown>;
67
+ createKycSessionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycSessionResponse, Error, void, unknown>;
68
+ } | {
69
+ data: KycSessionResponse;
70
+ error: null;
71
+ variables: void;
72
+ isError: false;
73
+ isIdle: false;
74
+ isPending: false;
75
+ isSuccess: true;
76
+ status: "success";
77
+ mutate: import("@tanstack/react-query").UseMutateFunction<KycSessionResponse, Error, void, unknown>;
78
+ reset: () => void;
79
+ context: unknown;
80
+ failureCount: number;
81
+ failureReason: Error;
82
+ isPaused: boolean;
83
+ submittedAt: number;
84
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycSessionResponse, Error, void, unknown>;
85
+ createKycSession: import("@tanstack/react-query").UseMutateFunction<KycSessionResponse, Error, void, unknown>;
86
+ createKycSessionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycSessionResponse, Error, void, unknown>;
87
+ };
@@ -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 { createKycSession } from "../../actions/index.js";
25
+ const CREATE_KYC_SESSION_KEY = "CREATE_KYC_SESSION";
26
+ const useCreateKycSession = () => {
27
+ const para = useClient();
28
+ const mutation = useMutation({
29
+ mutationKey: [CREATE_KYC_SESSION_KEY],
30
+ mutationFn: () => __async(null, null, function* () {
31
+ return createKycSession(para);
32
+ })
33
+ });
34
+ return renameMutations(mutation, "createKycSession");
35
+ };
36
+ export {
37
+ CREATE_KYC_SESSION_KEY,
38
+ useCreateKycSession
39
+ };
@@ -0,0 +1,125 @@
1
+ import type { KycShareProvider, KycShareResponse } from '@getpara/core-sdk';
2
+ export declare const SHARE_KYC_KEY = "SHARE_KYC";
3
+ /**
4
+ * React hook for the `shareKyc` mutation: shares the user's approved verification with a ramp so it skips its own
5
+ * identity check. Resolves `{ status: 'failed' }` rather than throwing when the ramp didn't receive it.
6
+ *
7
+ * @example
8
+ * const { shareKycAsync } = useShareKyc();
9
+ * const { status } = await shareKycAsync({ provider: 'MOONPAY' });
10
+ */
11
+ export declare const useShareKyc: () => {
12
+ data: undefined;
13
+ variables: undefined;
14
+ error: null;
15
+ isError: false;
16
+ isIdle: true;
17
+ isPending: false;
18
+ isSuccess: false;
19
+ status: "idle";
20
+ mutate: import("@tanstack/react-query").UseMutateFunction<KycShareResponse, Error, {
21
+ provider: KycShareProvider;
22
+ }, unknown>;
23
+ reset: () => void;
24
+ context: unknown;
25
+ failureCount: number;
26
+ failureReason: Error;
27
+ isPaused: boolean;
28
+ submittedAt: number;
29
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycShareResponse, Error, {
30
+ provider: KycShareProvider;
31
+ }, unknown>;
32
+ shareKyc: import("@tanstack/react-query").UseMutateFunction<KycShareResponse, Error, {
33
+ provider: KycShareProvider;
34
+ }, unknown>;
35
+ shareKycAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycShareResponse, Error, {
36
+ provider: KycShareProvider;
37
+ }, unknown>;
38
+ } | {
39
+ data: undefined;
40
+ variables: {
41
+ provider: KycShareProvider;
42
+ };
43
+ error: null;
44
+ isError: false;
45
+ isIdle: false;
46
+ isPending: true;
47
+ isSuccess: false;
48
+ status: "pending";
49
+ mutate: import("@tanstack/react-query").UseMutateFunction<KycShareResponse, Error, {
50
+ provider: KycShareProvider;
51
+ }, unknown>;
52
+ reset: () => void;
53
+ context: unknown;
54
+ failureCount: number;
55
+ failureReason: Error;
56
+ isPaused: boolean;
57
+ submittedAt: number;
58
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycShareResponse, Error, {
59
+ provider: KycShareProvider;
60
+ }, unknown>;
61
+ shareKyc: import("@tanstack/react-query").UseMutateFunction<KycShareResponse, Error, {
62
+ provider: KycShareProvider;
63
+ }, unknown>;
64
+ shareKycAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycShareResponse, Error, {
65
+ provider: KycShareProvider;
66
+ }, unknown>;
67
+ } | {
68
+ data: undefined;
69
+ error: Error;
70
+ variables: {
71
+ provider: KycShareProvider;
72
+ };
73
+ isError: true;
74
+ isIdle: false;
75
+ isPending: false;
76
+ isSuccess: false;
77
+ status: "error";
78
+ mutate: import("@tanstack/react-query").UseMutateFunction<KycShareResponse, Error, {
79
+ provider: KycShareProvider;
80
+ }, unknown>;
81
+ reset: () => void;
82
+ context: unknown;
83
+ failureCount: number;
84
+ failureReason: Error;
85
+ isPaused: boolean;
86
+ submittedAt: number;
87
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycShareResponse, Error, {
88
+ provider: KycShareProvider;
89
+ }, unknown>;
90
+ shareKyc: import("@tanstack/react-query").UseMutateFunction<KycShareResponse, Error, {
91
+ provider: KycShareProvider;
92
+ }, unknown>;
93
+ shareKycAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycShareResponse, Error, {
94
+ provider: KycShareProvider;
95
+ }, unknown>;
96
+ } | {
97
+ data: KycShareResponse;
98
+ error: null;
99
+ variables: {
100
+ provider: KycShareProvider;
101
+ };
102
+ isError: false;
103
+ isIdle: false;
104
+ isPending: false;
105
+ isSuccess: true;
106
+ status: "success";
107
+ mutate: import("@tanstack/react-query").UseMutateFunction<KycShareResponse, Error, {
108
+ provider: KycShareProvider;
109
+ }, unknown>;
110
+ reset: () => void;
111
+ context: unknown;
112
+ failureCount: number;
113
+ failureReason: Error;
114
+ isPaused: boolean;
115
+ submittedAt: number;
116
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycShareResponse, Error, {
117
+ provider: KycShareProvider;
118
+ }, unknown>;
119
+ shareKyc: import("@tanstack/react-query").UseMutateFunction<KycShareResponse, Error, {
120
+ provider: KycShareProvider;
121
+ }, unknown>;
122
+ shareKycAsync: import("@tanstack/react-query").UseMutateAsyncFunction<KycShareResponse, Error, {
123
+ provider: KycShareProvider;
124
+ }, unknown>;
125
+ };
@@ -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 { shareKyc } from "../../actions/index.js";
25
+ const SHARE_KYC_KEY = "SHARE_KYC";
26
+ const useShareKyc = () => {
27
+ const para = useClient();
28
+ const mutation = useMutation({
29
+ mutationKey: [SHARE_KYC_KEY],
30
+ mutationFn: (args) => __async(null, null, function* () {
31
+ return shareKyc(para, args);
32
+ })
33
+ });
34
+ return renameMutations(mutation, "shareKyc");
35
+ };
36
+ export {
37
+ SHARE_KYC_KEY,
38
+ useShareKyc
39
+ };
@@ -1,4 +1,4 @@
1
- import type { VerifyNewAccountParams } from '@getpara/core-sdk';
1
+ import type { VerifyNewAccountParams, VerifyNewAccountResponse } from '@getpara/core-sdk';
2
2
  export declare const VERIFY_NEW_ACCOUNT_KEY = "VERIFY_NEW_ACCOUNT";
3
3
  /**
4
4
  * React hook for the `verifyNewAccount` mutation.
@@ -23,16 +23,16 @@ export declare const useVerifyNewAccount: () => {
23
23
  isPending: false;
24
24
  isSuccess: false;
25
25
  status: "idle";
26
- mutate: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
26
+ mutate: import("@tanstack/react-query").UseMutateFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
27
27
  reset: () => void;
28
28
  context: unknown;
29
29
  failureCount: number;
30
30
  failureReason: Error;
31
31
  isPaused: boolean;
32
32
  submittedAt: number;
33
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
34
- verifyNewAccount: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
35
- verifyNewAccountAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
33
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
34
+ verifyNewAccount: import("@tanstack/react-query").UseMutateFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
35
+ verifyNewAccountAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
36
36
  } | {
37
37
  data: undefined;
38
38
  variables: VerifyNewAccountParams;
@@ -42,16 +42,16 @@ export declare const useVerifyNewAccount: () => {
42
42
  isPending: true;
43
43
  isSuccess: false;
44
44
  status: "pending";
45
- mutate: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
45
+ mutate: import("@tanstack/react-query").UseMutateFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
46
46
  reset: () => void;
47
47
  context: unknown;
48
48
  failureCount: number;
49
49
  failureReason: Error;
50
50
  isPaused: boolean;
51
51
  submittedAt: number;
52
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
53
- verifyNewAccount: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
54
- verifyNewAccountAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
52
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
53
+ verifyNewAccount: import("@tanstack/react-query").UseMutateFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
54
+ verifyNewAccountAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
55
55
  } | {
56
56
  data: undefined;
57
57
  error: Error;
@@ -61,18 +61,18 @@ export declare const useVerifyNewAccount: () => {
61
61
  isPending: false;
62
62
  isSuccess: false;
63
63
  status: "error";
64
- mutate: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
64
+ mutate: import("@tanstack/react-query").UseMutateFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
65
65
  reset: () => void;
66
66
  context: unknown;
67
67
  failureCount: number;
68
68
  failureReason: Error;
69
69
  isPaused: boolean;
70
70
  submittedAt: number;
71
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
72
- verifyNewAccount: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
73
- verifyNewAccountAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
71
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
72
+ verifyNewAccount: import("@tanstack/react-query").UseMutateFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
73
+ verifyNewAccountAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
74
74
  } | {
75
- data: import("@getpara/core-sdk").AuthStateSignup;
75
+ data: VerifyNewAccountResponse;
76
76
  error: null;
77
77
  variables: VerifyNewAccountParams;
78
78
  isError: false;
@@ -80,14 +80,14 @@ export declare const useVerifyNewAccount: () => {
80
80
  isPending: false;
81
81
  isSuccess: true;
82
82
  status: "success";
83
- mutate: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
83
+ mutate: import("@tanstack/react-query").UseMutateFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
84
84
  reset: () => void;
85
85
  context: unknown;
86
86
  failureCount: number;
87
87
  failureReason: Error;
88
88
  isPaused: boolean;
89
89
  submittedAt: number;
90
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
91
- verifyNewAccount: import("@tanstack/react-query").UseMutateFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
92
- verifyNewAccountAsync: import("@tanstack/react-query").UseMutateAsyncFunction<import("@getpara/core-sdk").AuthStateSignup, Error, VerifyNewAccountParams, unknown>;
90
+ mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
91
+ verifyNewAccount: import("@tanstack/react-query").UseMutateFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
92
+ verifyNewAccountAsync: import("@tanstack/react-query").UseMutateAsyncFunction<VerifyNewAccountResponse, Error, VerifyNewAccountParams, unknown>;
93
93
  };
@@ -45,10 +45,14 @@ import { useCoreStore } from "../../stores/CoreStoreContext.js";
45
45
  import { getEmbeddedAccount } from "../../actions/getEmbeddedAccount.js";
46
46
  const ACCOUNT_BASE_KEY = "PARA_ACCOUNT";
47
47
  const ACCOUNT_IDENTITY_KEY_LENGTH = 3;
48
+ const USER_ID_KEY_INDEX = 2;
49
+ const EMBEDDED_READY_KEY_INDEX = 1;
48
50
  function isSameAccountIdentity(previousKey, nextKey) {
49
51
  if (!previousKey) return false;
50
52
  for (let index = 0; index < ACCOUNT_IDENTITY_KEY_LENGTH; index += 1) {
51
- if (previousKey[index] !== nextKey[index]) return false;
53
+ if (previousKey[index] === nextKey[index]) continue;
54
+ const isUserIdStampedMidLogin = index === USER_ID_KEY_INDEX && previousKey[USER_ID_KEY_INDEX] === null && nextKey[EMBEDDED_READY_KEY_INDEX] !== true;
55
+ if (!isUserIdStampedMidLogin) return false;
52
56
  }
53
57
  return true;
54
58
  }
@@ -52,6 +52,12 @@ const useIsFullyLoggedIn = () => {
52
52
  return useQuery({
53
53
  enabled: isReady && !!client,
54
54
  queryKey: [IS_FULLY_LOGGED_IN_BASE_KEY, phaseKey, (_a = client == null ? void 0 : client.userId) != null ? _a : null],
55
+ // Mid-login the key changes while the answer is still "not logged in" (the SDK stamps userId as soon as the
56
+ // session goes live, before wallets are ready). Without a placeholder each such change reports isLoading, and a
57
+ // host that renders a loader instead of its ParaModal while loading unmounts the modal mid-sign-in, tearing down
58
+ // the portal frame before it sends the wallet shares (ENG-7462). Carry only a previous `false`: a previous `true`
59
+ // must not survive a logout or user switch.
60
+ placeholderData: (previousData) => previousData === false ? false : void 0,
55
61
  queryFn: (_0) => __async(null, [_0], function* ({ signal }) {
56
62
  var _a2, _b;
57
63
  let isFullyLoggedIn = (_a2 = yield client == null ? void 0 : client.isFullyLoggedIn()) != null ? _a2 : false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpara/react-core",
3
- "version": "3.27.0",
3
+ "version": "3.29.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.27.0",
171
+ "@getpara/core-sdk": "3.29.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.27.0",
179
- "@getpara/aa-biconomy": "3.27.0",
180
- "@getpara/aa-cdp": "3.27.0",
181
- "@getpara/aa-gelato": "3.27.0",
182
- "@getpara/aa-pimlico": "3.27.0",
183
- "@getpara/aa-porto": "3.27.0",
184
- "@getpara/aa-rhinestone": "3.27.0",
185
- "@getpara/aa-safe": "3.27.0",
186
- "@getpara/aa-thirdweb": "3.27.0",
187
- "@getpara/aa-zerodev": "3.27.0",
188
- "@getpara/cosmjs-v0-integration": "3.27.0",
189
- "@getpara/ethers-v6-integration": "3.27.0",
190
- "@getpara/solana-signers-v2-integration": "3.27.0",
191
- "@getpara/stellar-sdk-v14-integration": "3.27.0",
192
- "@getpara/sui-sdk-integration": "3.27.0",
193
- "@getpara/viem-v2-integration": "3.27.0",
178
+ "@getpara/aa-alchemy": "3.29.0",
179
+ "@getpara/aa-biconomy": "3.29.0",
180
+ "@getpara/aa-cdp": "3.29.0",
181
+ "@getpara/aa-gelato": "3.29.0",
182
+ "@getpara/aa-pimlico": "3.29.0",
183
+ "@getpara/aa-porto": "3.29.0",
184
+ "@getpara/aa-rhinestone": "3.29.0",
185
+ "@getpara/aa-safe": "3.29.0",
186
+ "@getpara/aa-thirdweb": "3.29.0",
187
+ "@getpara/aa-zerodev": "3.29.0",
188
+ "@getpara/cosmjs-v0-integration": "3.29.0",
189
+ "@getpara/ethers-v6-integration": "3.29.0",
190
+ "@getpara/solana-signers-v2-integration": "3.29.0",
191
+ "@getpara/stellar-sdk-v14-integration": "3.29.0",
192
+ "@getpara/sui-sdk-integration": "3.29.0",
193
+ "@getpara/viem-v2-integration": "3.29.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": "6f1dd93f4508c6da9256b76bcc306ec995002754"
311
+ "gitHead": "26c8ba7c6ae909929e7d5ed6dee04be65f6abcfa"
312
312
  }