@getpara/react-sdk 1.8.0 → 1.9.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/modal/ParaModal.js +2 -0
- package/dist/modal/components/AddFunds/AddFunds.js +1 -1
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +3 -1
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +2 -2
- package/dist/modal/components/Body/Body.js +1 -1
- package/dist/modal/components/ModalContent/ModalContent.js +2 -2
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +2 -2
- package/dist/modal/constants/constants.js +1 -0
- package/dist/modal/hooks/useCreateAccount.d.ts +3 -1
- package/dist/modal/hooks/useCreateAccount.js +7 -2
- package/package.json +5 -5
package/dist/modal/ParaModal.js
CHANGED
|
@@ -121,6 +121,7 @@ const ParaModalInner = forwardRef(
|
|
|
121
121
|
const para = useInternalClient();
|
|
122
122
|
const { selectedWallet, setSelectedWallet } = useWalletState();
|
|
123
123
|
const setIsPasskeySupported = useModalStore((state) => state.setIsPasskeySupported);
|
|
124
|
+
const setAuthStepRoute = useModalStore((state) => state.setAuthStepRoute);
|
|
124
125
|
const [isModalMounted, setIsModalMounted] = useState(false);
|
|
125
126
|
const [isInit, setIsInit] = useState(false);
|
|
126
127
|
const [ready, setIsReady] = useState(false);
|
|
@@ -157,6 +158,7 @@ const ParaModalInner = forwardRef(
|
|
|
157
158
|
setWebAuthURLForLogin();
|
|
158
159
|
setWebAuthURLForCreate();
|
|
159
160
|
setBiometricLocationHints();
|
|
161
|
+
setAuthStepRoute();
|
|
160
162
|
}
|
|
161
163
|
setSelectedWallet({ id: void 0, type: void 0 });
|
|
162
164
|
setIsFullyLoggedIn(false);
|
|
@@ -9,8 +9,8 @@ import { InnerStepContainer, StepContainer, Heading, QRContainer } from "../comm
|
|
|
9
9
|
import { useCopyToClipboard, UserIdentifier } from "@getpara/react-common";
|
|
10
10
|
import { useCreateAccount } from "../../hooks/useCreateAccount.js";
|
|
11
11
|
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
12
|
-
const BiometricCreationStep = () => {
|
|
13
|
-
const createAccount = useCreateAccount();
|
|
12
|
+
const BiometricCreationStep = ({ twoFactorAuthEnabled = false }) => {
|
|
13
|
+
const createAccount = useCreateAccount({ twoFactorAuthEnabled });
|
|
14
14
|
const para = useInternalClient();
|
|
15
15
|
const appName = useThemeStore((state) => state.appName);
|
|
16
16
|
const webAuthURLForCreate = useModalStore((state) => state.webAuthURLForCreate);
|
|
@@ -117,7 +117,7 @@ const Body = ({ oAuthMethods, twoFactorAuthEnabled, disableEmailLogin, disablePh
|
|
|
117
117
|
return /* @__PURE__ */ jsx(TwoFactorDoneStep, { onClose });
|
|
118
118
|
}
|
|
119
119
|
case ModalStep.BIOMETRIC_CREATION: {
|
|
120
|
-
return /* @__PURE__ */ jsx(BiometricCreationStep, {});
|
|
120
|
+
return /* @__PURE__ */ jsx(BiometricCreationStep, { twoFactorAuthEnabled });
|
|
121
121
|
}
|
|
122
122
|
case ModalStep.AWAITING_OAUTH: {
|
|
123
123
|
return /* @__PURE__ */ jsx(AwaitingOAuthStep, {});
|
|
@@ -77,7 +77,7 @@ const ModalContent = forwardRef(
|
|
|
77
77
|
const authStepRoute = useModalStore((state) => state.authStepRoute);
|
|
78
78
|
const isIFrameReady = useModalStore((state) => state.isIFrameReady);
|
|
79
79
|
const goBack = useGoBack();
|
|
80
|
-
const createAccount = useCreateAccount();
|
|
80
|
+
const createAccount = useCreateAccount({ twoFactorAuthEnabled });
|
|
81
81
|
const biometricLocationHints = useModalStore((state) => {
|
|
82
82
|
var _a2;
|
|
83
83
|
return (_a2 = state.biometricLocationHints) != null ? _a2 : [];
|
|
@@ -128,7 +128,7 @@ const ModalContent = forwardRef(
|
|
|
128
128
|
setPasswordUrlForLogin("");
|
|
129
129
|
setSupportedAuthMethods(/* @__PURE__ */ new Set());
|
|
130
130
|
setBiometricLocationHints();
|
|
131
|
-
if (needsWallet) {
|
|
131
|
+
if (needsWallet && !para.isNoWalletConfig) {
|
|
132
132
|
setStep(ModalStep.AWAITING_WALLET_CREATION);
|
|
133
133
|
} else {
|
|
134
134
|
yield connectEmbeddedToExternalConnectors();
|
|
@@ -23,8 +23,8 @@ const WalletCreationDoneStep = ({ twoFactorAuthEnabled, onClose }) => {
|
|
|
23
23
|
setStep(ModalStep.LOGIN_DONE);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
const
|
|
27
|
-
setStep(
|
|
26
|
+
const { isSetup: is2faComplete } = yield para.check2FAStatus();
|
|
27
|
+
setStep(is2faComplete ? ModalStep.LOGIN_DONE : ModalStep.SETUP_2FA);
|
|
28
28
|
} else {
|
|
29
29
|
if (twoFactorAuthEnabled) {
|
|
30
30
|
setStep(ModalStep.SETUP_2FA);
|
|
@@ -39,6 +39,7 @@ const NETWORKS = {
|
|
|
39
39
|
[Network.SOLANA]: { name: "Solana", icon: "solana" },
|
|
40
40
|
[Network.COSMOS]: { name: "Cosmos", icon: "cosmos" },
|
|
41
41
|
[Network.CELO]: { name: "Celo", icon: "celoBrand" },
|
|
42
|
+
[Network.SOLANA_DEVNET]: { name: "Solana Devnet", icon: "solana" },
|
|
42
43
|
[Network.NOBLE]: { name: "Noble", icon: "nobleBrand" }
|
|
43
44
|
};
|
|
44
45
|
const ON_RAMP_ASSETS = {
|
|
@@ -8,7 +8,7 @@ import { useModalStore } from "../stores/index.js";
|
|
|
8
8
|
import { openPopup } from "../utils/openPopup.js";
|
|
9
9
|
import { ModalStep } from "../utils/steps.js";
|
|
10
10
|
import { useGoBack } from "./useGoBack.js";
|
|
11
|
-
function useCreateAccount() {
|
|
11
|
+
function useCreateAccount({ twoFactorAuthEnabled = false } = {}) {
|
|
12
12
|
const para = useInternalClient();
|
|
13
13
|
const goBack = useGoBack();
|
|
14
14
|
const refs = useModalStore((state) => state.refs);
|
|
@@ -25,7 +25,12 @@ function useCreateAccount() {
|
|
|
25
25
|
if (isComplete) {
|
|
26
26
|
setWebAuthURLForCreate("");
|
|
27
27
|
setIFrameUrl("");
|
|
28
|
-
|
|
28
|
+
if (para.isNoWalletConfig) {
|
|
29
|
+
const is2faComplete = twoFactorAuthEnabled ? (yield para.check2FAStatus()).isSetup : true;
|
|
30
|
+
setStep(is2faComplete ? ModalStep.LOGIN_DONE : ModalStep.SETUP_2FA);
|
|
31
|
+
} else {
|
|
32
|
+
setStep(ModalStep.AWAITING_WALLET_CREATION);
|
|
33
|
+
}
|
|
29
34
|
} else if (refs.currentStep.current === ModalStep.AWAITING_BIOMETRIC_CREATION) {
|
|
30
35
|
goBack();
|
|
31
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"*.css"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@getpara/react-common": "1.
|
|
16
|
-
"@getpara/react-components": "1.
|
|
17
|
-
"@getpara/web-sdk": "1.
|
|
15
|
+
"@getpara/react-common": "1.9.0",
|
|
16
|
+
"@getpara/react-components": "1.9.0",
|
|
17
|
+
"@getpara/web-sdk": "1.9.0",
|
|
18
18
|
"@tanstack/react-query": "^5.0.0",
|
|
19
19
|
"date-fns": "^3.6.0",
|
|
20
20
|
"framer-motion": "11.3.28",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"resolutions": {
|
|
50
50
|
"styled-components": "^6"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "3d749844bf071e2c8de2769dd16e17c026951109"
|
|
53
53
|
}
|