@getpara/react-sdk-lite 2.0.0-alpha.33
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/chunk-MMUBH76A.js +59 -0
- package/dist/cli/cli.mjs +51 -0
- package/dist/css/modal.css +13 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +10 -0
- package/dist/modal/ParaModal.d.ts +2 -0
- package/dist/modal/ParaModal.js +308 -0
- package/dist/modal/components/Account/Account.d.ts +5 -0
- package/dist/modal/components/Account/Account.js +148 -0
- package/dist/modal/components/Account/AccountProfile.d.ts +1 -0
- package/dist/modal/components/Account/AccountProfile.js +168 -0
- package/dist/modal/components/Account/AccountProfileLink.d.ts +1 -0
- package/dist/modal/components/Account/AccountProfileLink.js +206 -0
- package/dist/modal/components/Account/AccountProfileLinkOptions.d.ts +1 -0
- package/dist/modal/components/Account/AccountProfileLinkOptions.js +111 -0
- package/dist/modal/components/Account/AccountProfileUnlink.d.ts +1 -0
- package/dist/modal/components/Account/AccountProfileUnlink.js +47 -0
- package/dist/modal/components/AddFunds/AddFunds.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFunds.js +69 -0
- package/dist/modal/components/AddFunds/AddFundsAsset.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsAsset.js +125 -0
- package/dist/modal/components/AddFunds/AddFundsAwaiting.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +78 -0
- package/dist/modal/components/AddFunds/AddFundsContext.d.ts +31 -0
- package/dist/modal/components/AddFunds/AddFundsContext.js +160 -0
- package/dist/modal/components/AddFunds/AddFundsDone.d.ts +6 -0
- package/dist/modal/components/AddFunds/AddFundsDone.js +49 -0
- package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsProvider.js +109 -0
- package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsReceive.js +83 -0
- package/dist/modal/components/AddFunds/AddFundsSettings.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsSettings.js +237 -0
- package/dist/modal/components/AddFunds/MoonPayEmbed.d.ts +2 -0
- package/dist/modal/components/AddFunds/MoonPayEmbed.js +7 -0
- package/dist/modal/components/AddFunds/common.d.ts +19 -0
- package/dist/modal/components/AddFunds/common.js +24 -0
- package/dist/modal/components/AddFunds/index.d.ts +3 -0
- package/dist/modal/components/AddFunds/index.js +4 -0
- package/dist/modal/components/AuthInput/AuthInput.d.ts +20 -0
- package/dist/modal/components/AuthInput/AuthInput.js +277 -0
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +7 -0
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +33 -0
- package/dist/modal/components/AuthInput/phoneMasks.d.ts +247 -0
- package/dist/modal/components/AuthInput/phoneMasks.js +253 -0
- package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +9 -0
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +50 -0
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +9 -0
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +179 -0
- package/dist/modal/components/AuthOptions/AuthOptions.d.ts +9 -0
- package/dist/modal/components/AuthOptions/AuthOptions.js +85 -0
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +1 -0
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +18 -0
- package/dist/modal/components/AwaitingIFrameStep/AwaitingIFrameStep.d.ts +1 -0
- package/dist/modal/components/AwaitingIFrameStep/AwaitingIFrameStep.js +12 -0
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +1 -0
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +10 -0
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +1 -0
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +18 -0
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +5 -0
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +49 -0
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +1 -0
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +62 -0
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +1 -0
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +48 -0
- package/dist/modal/components/Body/AnimatedHeightWrapper.d.ts +6 -0
- package/dist/modal/components/Body/AnimatedHeightWrapper.js +29 -0
- package/dist/modal/components/Body/Body.d.ts +11 -0
- package/dist/modal/components/Body/Body.js +354 -0
- package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +1 -0
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +95 -0
- package/dist/modal/components/ChainSwitch/config.d.ts +7 -0
- package/dist/modal/components/ChainSwitch/config.js +17 -0
- package/dist/modal/components/Controls/Controls.d.ts +5 -0
- package/dist/modal/components/Controls/Controls.js +78 -0
- package/dist/modal/components/Controls/Selects.d.ts +2 -0
- package/dist/modal/components/Controls/Selects.js +173 -0
- package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.d.ts +1 -0
- package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js +75 -0
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +8 -0
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +175 -0
- package/dist/modal/components/ExternalWalletStep/config.d.ts +7 -0
- package/dist/modal/components/ExternalWalletStep/config.js +17 -0
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +1 -0
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +39 -0
- package/dist/modal/components/ExternalWallets/ExternalWallets.d.ts +1 -0
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +182 -0
- package/dist/modal/components/Footer/Footer.d.ts +1 -0
- package/dist/modal/components/Footer/Footer.js +95 -0
- package/dist/modal/components/Header/Header.d.ts +1 -0
- package/dist/modal/components/Header/Header.js +43 -0
- package/dist/modal/components/Header/hooks/useStepTitle.d.ts +3 -0
- package/dist/modal/components/Header/hooks/useStepTitle.js +62 -0
- package/dist/modal/components/Hero/Hero.d.ts +1 -0
- package/dist/modal/components/Hero/Hero.js +116 -0
- package/dist/modal/components/IFrameStep/IFrameStep.d.ts +1 -0
- package/dist/modal/components/IFrameStep/IFrameStep.js +70 -0
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +5 -0
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +44 -0
- package/dist/modal/components/ModalContent/ModalContent.d.ts +10 -0
- package/dist/modal/components/ModalContent/ModalContent.js +88 -0
- package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +3 -0
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +31 -0
- package/dist/modal/components/OAuth/OAuth.d.ts +6 -0
- package/dist/modal/components/OAuth/OAuth.js +81 -0
- package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +8 -0
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +74 -0
- package/dist/modal/components/OnRampComponents/AddingFunds.d.ts +1 -0
- package/dist/modal/components/OnRampComponents/AddingFunds.js +23 -0
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.d.ts +9 -0
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +77 -0
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.d.ts +6 -0
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +107 -0
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +5 -0
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +132 -0
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +5 -0
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +27 -0
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.d.ts +12 -0
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +160 -0
- package/dist/modal/components/Waiting/Waiting.d.ts +6 -0
- package/dist/modal/components/Waiting/Waiting.js +17 -0
- package/dist/modal/components/WalletCard/PartnerIcon.d.ts +6 -0
- package/dist/modal/components/WalletCard/PartnerIcon.js +34 -0
- package/dist/modal/components/WalletCard/WalletCard.d.ts +18 -0
- package/dist/modal/components/WalletCard/WalletCard.js +128 -0
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +6 -0
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +83 -0
- package/dist/modal/components/common.d.ts +59 -0
- package/dist/modal/components/common.js +261 -0
- package/dist/modal/components/index.d.ts +1 -0
- package/dist/modal/components/index.js +2 -0
- package/dist/modal/constants/constants.d.ts +40 -0
- package/dist/modal/constants/constants.js +142 -0
- package/dist/modal/constants/defaults.d.ts +5 -0
- package/dist/modal/constants/defaults.js +10 -0
- package/dist/modal/constants/oAuthLogos.d.ts +17 -0
- package/dist/modal/constants/oAuthLogos.js +158 -0
- package/dist/modal/constants/walletTypeConfig.d.ts +6 -0
- package/dist/modal/constants/walletTypeConfig.js +13 -0
- package/dist/modal/hooks/useGoBack.d.ts +1 -0
- package/dist/modal/hooks/useGoBack.js +43 -0
- package/dist/modal/hooks/useTelegramLogin.d.ts +12 -0
- package/dist/modal/hooks/useTelegramLogin.js +65 -0
- package/dist/modal/index.d.ts +8 -0
- package/dist/modal/index.js +29 -0
- package/dist/modal/stores/index.d.ts +1 -0
- package/dist/modal/stores/index.js +2 -0
- package/dist/modal/stores/modal/actions.d.ts +3 -0
- package/dist/modal/stores/modal/actions.js +139 -0
- package/dist/modal/stores/modal/useModalStore.d.ts +105 -0
- package/dist/modal/stores/modal/useModalStore.js +75 -0
- package/dist/modal/types/commonTypes.d.ts +6 -0
- package/dist/modal/types/commonTypes.js +1 -0
- package/dist/modal/types/modalProps.d.ts +129 -0
- package/dist/modal/types/modalProps.js +12 -0
- package/dist/modal/utils/authInputHelpers.d.ts +5 -0
- package/dist/modal/utils/authInputHelpers.js +41 -0
- package/dist/modal/utils/authLayoutHelpers.d.ts +3 -0
- package/dist/modal/utils/authLayoutHelpers.js +8 -0
- package/dist/modal/utils/countryCodes.d.ts +8 -0
- package/dist/modal/utils/countryCodes.js +45 -0
- package/dist/modal/utils/getMailtoLink.d.ts +1 -0
- package/dist/modal/utils/getMailtoLink.js +10 -0
- package/dist/modal/utils/getTileButtonFlex.d.ts +1 -0
- package/dist/modal/utils/getTileButtonFlex.js +20 -0
- package/dist/modal/utils/getWalletDisplayName.d.ts +5 -0
- package/dist/modal/utils/getWalletDisplayName.js +22 -0
- package/dist/modal/utils/isPasskeySupported.d.ts +1 -0
- package/dist/modal/utils/isPasskeySupported.js +15 -0
- package/dist/modal/utils/openPopup.d.ts +6 -0
- package/dist/modal/utils/openPopup.js +60 -0
- package/dist/modal/utils/routeMobileExternalWallet.d.ts +1 -0
- package/dist/modal/utils/routeMobileExternalWallet.js +31 -0
- package/dist/modal/utils/steps.d.ts +136 -0
- package/dist/modal/utils/steps.js +279 -0
- package/dist/modal/utils/stringFormatters.d.ts +5 -0
- package/dist/modal/utils/stringFormatters.js +19 -0
- package/dist/modal/utils/validateOnRampConfig.d.ts +5 -0
- package/dist/modal/utils/validateOnRampConfig.js +32 -0
- package/dist/package.json +6 -0
- package/dist/provider/ParaProvider.d.ts +4 -0
- package/dist/provider/ParaProvider.js +140 -0
- package/dist/provider/actions/getEmbeddedAccount.d.ts +26 -0
- package/dist/provider/actions/getEmbeddedAccount.js +57 -0
- package/dist/provider/actions/getWallet.d.ts +5 -0
- package/dist/provider/actions/getWallet.js +18 -0
- package/dist/provider/actions/index.d.ts +47 -0
- package/dist/provider/actions/index.js +79 -0
- package/dist/provider/actions/utils.d.ts +4 -0
- package/dist/provider/actions/utils.js +34 -0
- package/dist/provider/components/CosmosWalletWrapper.d.ts +11 -0
- package/dist/provider/components/CosmosWalletWrapper.js +43 -0
- package/dist/provider/components/EvmWalletWrapper.d.ts +12 -0
- package/dist/provider/components/EvmWalletWrapper.js +43 -0
- package/dist/provider/components/ExternalWalletWrapper.d.ts +8 -0
- package/dist/provider/components/ExternalWalletWrapper.js +140 -0
- package/dist/provider/components/SolanaWalletWrapper.d.ts +9 -0
- package/dist/provider/components/SolanaWalletWrapper.js +44 -0
- package/dist/provider/external/getParaCosmosConnector.d.ts +7 -0
- package/dist/provider/external/getParaCosmosConnector.js +19 -0
- package/dist/provider/external/getParaCosmosLib.d.ts +4 -0
- package/dist/provider/external/getParaCosmosLib.js +16 -0
- package/dist/provider/external/getParaEvmConnector.d.ts +7 -0
- package/dist/provider/external/getParaEvmConnector.js +19 -0
- package/dist/provider/external/getParaEvmLib.d.ts +4 -0
- package/dist/provider/external/getParaEvmLib.js +16 -0
- package/dist/provider/external/getParaSolanaConnector.d.ts +7 -0
- package/dist/provider/external/getParaSolanaConnector.js +19 -0
- package/dist/provider/external/getParaSolanaLib.d.ts +4 -0
- package/dist/provider/external/getParaSolanaLib.js +16 -0
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +2 -0
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.js +8 -0
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +2 -0
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.js +8 -0
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +2 -0
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.js +8 -0
- package/dist/provider/hooks/index.d.ts +3 -0
- package/dist/provider/hooks/index.js +4 -0
- package/dist/provider/hooks/mutations/core.d.ts +27 -0
- package/dist/provider/hooks/mutations/core.js +66 -0
- package/dist/provider/hooks/mutations/index.d.ts +3 -0
- package/dist/provider/hooks/mutations/index.js +9 -0
- package/dist/provider/hooks/mutations/useLinkAccount.d.ts +9 -0
- package/dist/provider/hooks/mutations/useLinkAccount.js +18 -0
- package/dist/provider/hooks/mutations/utils.d.ts +12 -0
- package/dist/provider/hooks/mutations/utils.js +90 -0
- package/dist/provider/hooks/queries/core.d.ts +4 -0
- package/dist/provider/hooks/queries/core.js +16 -0
- package/dist/provider/hooks/queries/index.d.ts +5 -0
- package/dist/provider/hooks/queries/index.js +13 -0
- package/dist/provider/hooks/queries/useAccount.d.ts +90 -0
- package/dist/provider/hooks/queries/useAccount.js +141 -0
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +5 -0
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +24 -0
- package/dist/provider/hooks/queries/useParaStatus.d.ts +22 -0
- package/dist/provider/hooks/queries/useParaStatus.js +25 -0
- package/dist/provider/hooks/queries/useWallet.d.ts +5 -0
- package/dist/provider/hooks/queries/useWallet.js +26 -0
- package/dist/provider/hooks/queries/useWalletBalance.d.ts +6 -0
- package/dist/provider/hooks/queries/useWalletBalance.js +55 -0
- package/dist/provider/hooks/queries/utils.d.ts +7 -0
- package/dist/provider/hooks/queries/utils.js +25 -0
- package/dist/provider/hooks/utils/index.d.ts +3 -0
- package/dist/provider/hooks/utils/index.js +10 -0
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.d.ts +3 -0
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +74 -0
- package/dist/provider/hooks/utils/useClient.d.ts +5 -0
- package/dist/provider/hooks/utils/useClient.js +10 -0
- package/dist/provider/hooks/utils/useEventListeners.d.ts +2 -0
- package/dist/provider/hooks/utils/useEventListeners.js +157 -0
- package/dist/provider/hooks/utils/useFormattedBiometricHints.d.ts +4 -0
- package/dist/provider/hooks/utils/useFormattedBiometricHints.js +27 -0
- package/dist/provider/hooks/utils/useInternalClient.d.ts +5 -0
- package/dist/provider/hooks/utils/useInternalClient.js +10 -0
- package/dist/provider/hooks/utils/useModal.d.ts +11 -0
- package/dist/provider/hooks/utils/useModal.js +27 -0
- package/dist/provider/hooks/utils/useWalletState.d.ts +15 -0
- package/dist/provider/hooks/utils/useWalletState.js +48 -0
- package/dist/provider/index.d.ts +6 -0
- package/dist/provider/index.js +11 -0
- package/dist/provider/providers/AccountLinkProvider.d.ts +47 -0
- package/dist/provider/providers/AccountLinkProvider.js +452 -0
- package/dist/provider/providers/AuthProvider.d.ts +38 -0
- package/dist/provider/providers/AuthProvider.js +575 -0
- package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/CosmosExternalWalletProvider.js +66 -0
- package/dist/provider/providers/EvmExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/EvmExternalWalletProvider.js +74 -0
- package/dist/provider/providers/ExternalWalletProvider.d.ts +61 -0
- package/dist/provider/providers/ExternalWalletProvider.js +626 -0
- package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/SolanaExternalWalletProvider.js +66 -0
- package/dist/provider/stores/getters.d.ts +4 -0
- package/dist/provider/stores/getters.js +13 -0
- package/dist/provider/stores/setters.d.ts +1 -0
- package/dist/provider/stores/setters.js +7 -0
- package/dist/provider/stores/slices/analytics.d.ts +3 -0
- package/dist/provider/stores/slices/analytics.js +9 -0
- package/dist/provider/stores/slices/client.d.ts +3 -0
- package/dist/provider/stores/slices/client.js +9 -0
- package/dist/provider/stores/slices/config.d.ts +3 -0
- package/dist/provider/stores/slices/config.js +11 -0
- package/dist/provider/stores/slices/externalWallets.d.ts +3 -0
- package/dist/provider/stores/slices/externalWallets.js +46 -0
- package/dist/provider/stores/slices/index.d.ts +5 -0
- package/dist/provider/stores/slices/index.js +6 -0
- package/dist/provider/stores/slices/modal.d.ts +3 -0
- package/dist/provider/stores/slices/modal.js +18 -0
- package/dist/provider/stores/slices/wallet.d.ts +3 -0
- package/dist/provider/stores/slices/wallet.js +13 -0
- package/dist/provider/stores/types.d.ts +86 -0
- package/dist/provider/stores/types.js +1 -0
- package/dist/provider/stores/useStore.d.ts +17 -0
- package/dist/provider/stores/useStore.js +34 -0
- package/dist/provider/types/externalWalletProviders.d.ts +12 -0
- package/dist/provider/types/externalWalletProviders.js +1 -0
- package/dist/provider/types/provider.d.ts +166 -0
- package/dist/provider/types/provider.js +1 -0
- package/dist/provider/types/query.d.ts +3 -0
- package/dist/provider/types/query.js +1 -0
- package/dist/provider/types/utils.d.ts +45 -0
- package/dist/provider/types/utils.js +1 -0
- package/dist/provider/utils/constants.d.ts +5 -0
- package/dist/provider/utils/constants.js +10 -0
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +7 -0
- package/dist/provider/utils/paraConfigTypeGuards.js +13 -0
- package/dist/provider/utils/renameMutations.d.ts +5 -0
- package/dist/provider/utils/renameMutations.js +18 -0
- package/dist/public/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/package.json +63 -0
- package/styles.css/package.json +3 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { CpslButton, CpslText } from "@getpara/react-components";
|
|
5
|
+
import { Heading, StepContainer, InnerStepContainer, HeroIcon } from "../common.js";
|
|
6
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
7
|
+
const TwoFactorDoneStep = ({ onClose }) => {
|
|
8
|
+
const hideWallets = useStore((state) => {
|
|
9
|
+
var _a;
|
|
10
|
+
return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
|
|
11
|
+
});
|
|
12
|
+
return /* @__PURE__ */ jsxs(StepContainer, { children: [
|
|
13
|
+
/* @__PURE__ */ jsx(HeroIcon, { icon: "checkCircleFilled" }),
|
|
14
|
+
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
15
|
+
/* @__PURE__ */ jsx(Heading, { variant: "headingXS", weight: "semiBold", children: "Success" }),
|
|
16
|
+
/* @__PURE__ */ jsxs(CpslText, { variant: "bodyS", color: "secondary", weight: "medium", children: [
|
|
17
|
+
"Your ",
|
|
18
|
+
hideWallets ? "account" : "wallet",
|
|
19
|
+
" is now protected by 2FA"
|
|
20
|
+
] })
|
|
21
|
+
] }),
|
|
22
|
+
/* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: onClose, children: "Done" })
|
|
23
|
+
] });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
TwoFactorDoneStep
|
|
27
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AuthInfo } from '@getpara/user-management-client';
|
|
2
|
+
import { MutationStatus } from '@tanstack/react-query';
|
|
3
|
+
type Props = {
|
|
4
|
+
authInfo: AuthInfo<'email' | 'phone'>;
|
|
5
|
+
onSubmit: (_: string) => void;
|
|
6
|
+
onResend: () => void;
|
|
7
|
+
status: MutationStatus;
|
|
8
|
+
error?: Error | string | null;
|
|
9
|
+
};
|
|
10
|
+
export declare const VerificationCode: ({ authInfo, onResend, onSubmit, status, error }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const VerificationCodeStep: () => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { CpslCodeInput, CpslSpinner, CpslText } from "@getpara/react-components";
|
|
7
|
+
import { useEffect, useRef, useState } from "react";
|
|
8
|
+
import { safeStyled } from "@getpara/react-common";
|
|
9
|
+
import { Heading, InnerStepContainer, StepContainer } from "../common.js";
|
|
10
|
+
import { displayPhoneNumber } from "@getpara/core-sdk";
|
|
11
|
+
import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
|
|
12
|
+
import { useResendVerificationCode } from "../../../provider/index.js";
|
|
13
|
+
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
14
|
+
const VerificationCode = ({ authInfo, onResend, onSubmit, status, error }) => {
|
|
15
|
+
const inputRef = useRef(null);
|
|
16
|
+
const [code, setCode] = useState("");
|
|
17
|
+
const [isPending, setIsPending] = useState(status === "pending");
|
|
18
|
+
const [codeError, setCodeError] = useState(null);
|
|
19
|
+
const [resendDisabled, setResendDisabled] = useState(false);
|
|
20
|
+
const isEmail = (authInfo == null ? void 0 : authInfo.authType) === "email";
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
var _a, _b, _c, _d;
|
|
24
|
+
(_d = (_c = (_b = (_a = inputRef.current) == null ? void 0 : _a.shadowRoot) == null ? void 0 : _b.querySelectorAll("input")) == null ? void 0 : _c[0]) == null ? void 0 : _d.focus();
|
|
25
|
+
}, 10);
|
|
26
|
+
}, []);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
setCodeError(null);
|
|
29
|
+
if (code.length === 6) {
|
|
30
|
+
handleSubmitCode();
|
|
31
|
+
}
|
|
32
|
+
}, [code]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (status === "pending") {
|
|
35
|
+
setIsPending(true);
|
|
36
|
+
}
|
|
37
|
+
}, [status]);
|
|
38
|
+
const handleResendClick = () => __async(void 0, null, function* () {
|
|
39
|
+
if (!resendDisabled) {
|
|
40
|
+
setResendDisabled(true);
|
|
41
|
+
try {
|
|
42
|
+
onResend();
|
|
43
|
+
} finally {
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
setResendDisabled(false);
|
|
46
|
+
}, 3e3);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const handleCodeInput = (e) => {
|
|
51
|
+
setCode(e.detail.value.trim());
|
|
52
|
+
};
|
|
53
|
+
const handleSubmitCode = () => __async(void 0, null, function* () {
|
|
54
|
+
if (code.length === 6 && /^\d+$/.test(code)) {
|
|
55
|
+
onSubmit(code);
|
|
56
|
+
} else {
|
|
57
|
+
setCodeError("Incorrect code.");
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!!error) {
|
|
62
|
+
setIsPending(false);
|
|
63
|
+
const status2 = error.status;
|
|
64
|
+
switch (status2) {
|
|
65
|
+
case 429:
|
|
66
|
+
setCodeError("Too many incorrect attempts. Please try again in 10 minutes.");
|
|
67
|
+
break;
|
|
68
|
+
default:
|
|
69
|
+
setCodeError("Incorrect code.");
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}, [error]);
|
|
74
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75
|
+
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
76
|
+
/* @__PURE__ */ jsxs(Heading, { variant: "headingS", weight: "bold", children: [
|
|
77
|
+
"Verify ",
|
|
78
|
+
isEmail ? "Email" : "Phone Number"
|
|
79
|
+
] }),
|
|
80
|
+
/* @__PURE__ */ jsxs(InlineText, { variant: "bodyS", color: "secondary", children: [
|
|
81
|
+
"Please enter the code we sent to",
|
|
82
|
+
" ",
|
|
83
|
+
/* @__PURE__ */ jsx(InlineText, { variant: "bodyS", children: (authInfo == null ? void 0 : authInfo.authType) === "phone" ? displayPhoneNumber(authInfo.identifier) : authInfo.identifier })
|
|
84
|
+
] })
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ jsx(InnerStepContainer, { children: isPending ? /* @__PURE__ */ jsx(CpslSpinner, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
"form",
|
|
89
|
+
{
|
|
90
|
+
onSubmit: (e) => __async(void 0, null, function* () {
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
yield handleSubmitCode();
|
|
93
|
+
}),
|
|
94
|
+
children: /* @__PURE__ */ jsx(
|
|
95
|
+
StyledCodeInput,
|
|
96
|
+
{
|
|
97
|
+
ref: inputRef,
|
|
98
|
+
length: 6,
|
|
99
|
+
type: "number",
|
|
100
|
+
code,
|
|
101
|
+
onCpslInput: handleCodeInput,
|
|
102
|
+
errorText: codeError || "",
|
|
103
|
+
onKeyDown: (e) => __async(void 0, null, function* () {
|
|
104
|
+
return e.key === "Enter" && (yield handleSubmitCode());
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ jsxs(InlineText, { variant: "bodyS", color: "secondary", children: [
|
|
111
|
+
"Didn\u2019t receive a code?",
|
|
112
|
+
" ",
|
|
113
|
+
/* @__PURE__ */ jsx(
|
|
114
|
+
ClickableText,
|
|
115
|
+
{
|
|
116
|
+
variant: "bodyS",
|
|
117
|
+
style: { cursor: resendDisabled ? "default" : "pointer" },
|
|
118
|
+
onClick: handleResendClick,
|
|
119
|
+
children: resendDisabled ? "Resent!" : "Resend."
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
] })
|
|
123
|
+
] }) })
|
|
124
|
+
] });
|
|
125
|
+
};
|
|
126
|
+
const VerificationCodeStep = () => {
|
|
127
|
+
const { verifyNewAccount, verifyNewAccountStatus, verifyNewAccountError } = useAuthActions();
|
|
128
|
+
const { mutateAsync: resendVerificationCode } = useResendVerificationCode();
|
|
129
|
+
const para = useInternalClient();
|
|
130
|
+
if (!para.authInfo) {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
return /* @__PURE__ */ jsx(StepContainer, { $wide: true, children: /* @__PURE__ */ jsx(
|
|
134
|
+
VerificationCode,
|
|
135
|
+
{
|
|
136
|
+
authInfo: para.authInfo,
|
|
137
|
+
onSubmit: verifyNewAccount,
|
|
138
|
+
onResend: () => {
|
|
139
|
+
resendVerificationCode({ type: "SIGNUP" });
|
|
140
|
+
},
|
|
141
|
+
status: verifyNewAccountStatus,
|
|
142
|
+
error: verifyNewAccountError
|
|
143
|
+
}
|
|
144
|
+
) });
|
|
145
|
+
};
|
|
146
|
+
const StyledCodeInput = safeStyled(CpslCodeInput)`
|
|
147
|
+
align-self: center;
|
|
148
|
+
`;
|
|
149
|
+
const InlineText = safeStyled(CpslText)`
|
|
150
|
+
text-align: center;
|
|
151
|
+
display: inline-block;
|
|
152
|
+
`;
|
|
153
|
+
const ClickableText = safeStyled(InlineText)`
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
display: inline-block;
|
|
156
|
+
`;
|
|
157
|
+
export {
|
|
158
|
+
VerificationCode,
|
|
159
|
+
VerificationCodeStep
|
|
160
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { CpslSpinner, CpslText } from "@getpara/react-components";
|
|
5
|
+
import { Heading, SpinnerContainer, StepContainer, InnerStepContainer } from "../common.js";
|
|
6
|
+
const Waiting = ({ heading, subheading }) => {
|
|
7
|
+
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
8
|
+
/* @__PURE__ */ jsx(SpinnerContainer, { children: /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) }),
|
|
9
|
+
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
10
|
+
/* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: heading }),
|
|
11
|
+
subheading && /* @__PURE__ */ jsx(CpslText, { variant: "bodyS", color: "secondary", weight: "medium", children: subheading })
|
|
12
|
+
] })
|
|
13
|
+
] });
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
Waiting
|
|
17
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { safeStyled } from "@getpara/react-common";
|
|
5
|
+
import { CpslIcon, CpslText } from "@getpara/react-components";
|
|
6
|
+
const PartnerIcon = ({ partner }) => {
|
|
7
|
+
const { logoUrl, displayName, backgroundColor, foregroundColor } = partner;
|
|
8
|
+
if (logoUrl) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Icon, { src: logoUrl });
|
|
10
|
+
}
|
|
11
|
+
return /* @__PURE__ */ jsx(Container, { $backgroundColor: backgroundColor, children: /* @__PURE__ */ jsx(Text, { variant: "bodyXS", $color: foregroundColor, children: displayName[0] }) });
|
|
12
|
+
};
|
|
13
|
+
const Container = safeStyled.div`
|
|
14
|
+
width: 14px;
|
|
15
|
+
height: 14px;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
background-color: ${({ $backgroundColor }) => `${$backgroundColor != null ? $backgroundColor : "var(--cpsl-color-contrast)"}`};
|
|
20
|
+
border-radius: 100%;
|
|
21
|
+
`;
|
|
22
|
+
const Text = safeStyled(CpslText)`
|
|
23
|
+
&::part(text-element) {
|
|
24
|
+
line-height: 100%;
|
|
25
|
+
color: ${({ $color }) => `${$color != null ? $color : "var(--cpsl-color-foreground-0)"}`};
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
const Icon = safeStyled(CpslIcon)`
|
|
29
|
+
--height: 14px;
|
|
30
|
+
--width: 14px;
|
|
31
|
+
`;
|
|
32
|
+
export {
|
|
33
|
+
PartnerIcon
|
|
34
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TWalletType } from '@getpara/web-sdk';
|
|
2
|
+
export declare const ExternalWalletCard: ({ address, showAddFunds }: Pick<SharedWalletCardProps, "address" | "showAddFunds">) => import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
interface WalletCardProps {
|
|
4
|
+
id: string;
|
|
5
|
+
type: TWalletType;
|
|
6
|
+
showAddFunds?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const WalletCard: ({ id, type, showAddFunds }: WalletCardProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
interface SharedWalletCardProps {
|
|
10
|
+
address: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
type?: TWalletType;
|
|
13
|
+
name?: string;
|
|
14
|
+
identiconHash: string;
|
|
15
|
+
showAddFunds?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const WalletCards: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { safeStyled } from "@getpara/react-common";
|
|
5
|
+
import { useModalStore } from "../../stores/index.js";
|
|
6
|
+
import { CpslButton, CpslIdenticon, CpslText } from "@getpara/react-components";
|
|
7
|
+
import { truncateAddress } from "@getpara/web-sdk";
|
|
8
|
+
import { ModalStep } from "../../utils/steps.js";
|
|
9
|
+
import { useWalletState } from "../../../provider/index.js";
|
|
10
|
+
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
11
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
12
|
+
const ExternalWalletCard = ({ address, showAddFunds }) => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const para = useInternalClient();
|
|
15
|
+
const wallet = para.externalWallets[address];
|
|
16
|
+
if (!(wallet == null ? void 0 : wallet.address) || !(wallet == null ? void 0 : wallet.type)) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
SharedWalletCard,
|
|
21
|
+
{
|
|
22
|
+
address: (_a = wallet.ensName) != null ? _a : truncateAddress(wallet.address, wallet.type),
|
|
23
|
+
identiconHash: (_b = para.getIdenticonHash(wallet.id, wallet.type)) != null ? _b : "",
|
|
24
|
+
showAddFunds
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
const WalletCard = ({ id, type, showAddFunds }) => {
|
|
29
|
+
var _a, _b, _c;
|
|
30
|
+
const para = useInternalClient();
|
|
31
|
+
const appName = useStore((state) => state.appName);
|
|
32
|
+
const wallet = para.findWallet(id, type);
|
|
33
|
+
if (!wallet) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
const address = para.getDisplayAddress(wallet.id, { addressType: type });
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
SharedWalletCard,
|
|
39
|
+
{
|
|
40
|
+
id: wallet.id,
|
|
41
|
+
type: wallet.type,
|
|
42
|
+
address: (_a = wallet.ensName) != null ? _a : truncateAddress(address, type, { prefix: para.cosmosPrefix }),
|
|
43
|
+
name: (_b = wallet.name) != null ? _b : `${appName ? `${appName} ` : ""}Wallet`,
|
|
44
|
+
identiconHash: (_c = para.getIdenticonHash(wallet.id, type)) != null ? _c : "",
|
|
45
|
+
showAddFunds
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
const SharedWalletCard = ({ address, name, identiconHash, showAddFunds, id, type }) => {
|
|
50
|
+
const onRampConfig = useModalStore((state) => state.onRampConfig);
|
|
51
|
+
const { setSelectedWallet } = useWalletState();
|
|
52
|
+
const setStep = useModalStore((state) => state.setStep);
|
|
53
|
+
const isAddFundsEnabled = (onRampConfig == null ? void 0 : onRampConfig.isBuyEnabled) || (onRampConfig == null ? void 0 : onRampConfig.isReceiveEnabled);
|
|
54
|
+
const handleAddFundsClick = () => {
|
|
55
|
+
if (id && type) {
|
|
56
|
+
setSelectedWallet({ id, type });
|
|
57
|
+
isAddFundsEnabled && setStep(onRampConfig.isBuyEnabled ? ModalStep.ADD_FUNDS_BUY : ModalStep.ADD_FUNDS_RECEIVE);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return /* @__PURE__ */ jsxs(Container, { children: [
|
|
61
|
+
/* @__PURE__ */ jsxs(InnerContainer, { children: [
|
|
62
|
+
/* @__PURE__ */ jsx(CpslIdenticon, { size: "48px", hash: identiconHash }),
|
|
63
|
+
/* @__PURE__ */ jsxs(WalletNameContainer, { children: [
|
|
64
|
+
!!name && /* @__PURE__ */ jsx(Name, { color: "contrast", variant: "bodyL", weight: "semiBold", children: name }),
|
|
65
|
+
/* @__PURE__ */ jsx(Name, { color: "secondary", variant: "bodyS", weight: "medium", children: address })
|
|
66
|
+
] })
|
|
67
|
+
] }),
|
|
68
|
+
showAddFunds && isAddFundsEnabled && /* @__PURE__ */ jsx(AddFundsButton, { onClick: handleAddFundsClick, children: /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "contrast", weight: "medium", children: "Add Funds" }) })
|
|
69
|
+
] });
|
|
70
|
+
};
|
|
71
|
+
const WalletCards = safeStyled.div`
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
gap: 8px;
|
|
75
|
+
width: 100%;
|
|
76
|
+
`;
|
|
77
|
+
const Container = safeStyled.div`
|
|
78
|
+
width: 100%;
|
|
79
|
+
padding: 24px;
|
|
80
|
+
display: flex;
|
|
81
|
+
justify-content: space-between;
|
|
82
|
+
align-items: center;
|
|
83
|
+
gap: 16px;
|
|
84
|
+
background-color: var(--cpsl-color-background-8);
|
|
85
|
+
border-radius: 16px;
|
|
86
|
+
`;
|
|
87
|
+
const InnerContainer = safeStyled.div`
|
|
88
|
+
display: flex;
|
|
89
|
+
justify-content: flex-start;
|
|
90
|
+
gap: 8px;
|
|
91
|
+
align-items: center;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
`;
|
|
94
|
+
const WalletNameContainer = safeStyled.div`
|
|
95
|
+
flex: 1;
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
gap: 4px;
|
|
99
|
+
align-items: flex-start;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
overflow: hidden;
|
|
102
|
+
`;
|
|
103
|
+
const Name = safeStyled(CpslText)`
|
|
104
|
+
width: 100%;
|
|
105
|
+
&::part(text-element) {
|
|
106
|
+
line-height: 100%;
|
|
107
|
+
text-overflow: ellipsis;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
white-space: nowrap;
|
|
110
|
+
}
|
|
111
|
+
`;
|
|
112
|
+
const AddFundsButton = safeStyled(CpslButton)`
|
|
113
|
+
--button-primary-background-color: var(--cpsl-color-card-surface);
|
|
114
|
+
--button-primary-hover-background-color: var(--cpsl-color-background-4);
|
|
115
|
+
--button-primary-color: var(--cpsl-color-text-contrast);
|
|
116
|
+
--button-primary-hover-color: var(--cpsl-color-text-contrast);
|
|
117
|
+
--button-primary-active-color: var(--cpsl-color-text-contrast);
|
|
118
|
+
--button-padding-start: 8px;
|
|
119
|
+
--button-padding-end: 8px;
|
|
120
|
+
--button-padding-top: 8px;
|
|
121
|
+
--button-padding-bottom: 8px;
|
|
122
|
+
--button-border-radius: 8px;
|
|
123
|
+
`;
|
|
124
|
+
export {
|
|
125
|
+
ExternalWalletCard,
|
|
126
|
+
WalletCard,
|
|
127
|
+
WalletCards
|
|
128
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { CpslButton, CpslText } from "@getpara/react-components";
|
|
7
|
+
import { StepContainer, InnerStepContainer, HeroIcon } from "../common.js";
|
|
8
|
+
import { useModalStore } from "../../stores/index.js";
|
|
9
|
+
import { ModalStep } from "../../utils/steps.js";
|
|
10
|
+
import { WalletCard, WalletCards } from "../WalletCard/WalletCard.js";
|
|
11
|
+
import { safeStyled } from "@getpara/react-common";
|
|
12
|
+
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
13
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
14
|
+
import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
|
|
15
|
+
import { useEffect, useState } from "react";
|
|
16
|
+
const WalletCreationDoneStep = ({ twoFactorAuthEnabled, onClose }) => {
|
|
17
|
+
const { isSetup2faPending } = useAuthActions();
|
|
18
|
+
const hideWallets = useStore((state) => {
|
|
19
|
+
var _a;
|
|
20
|
+
return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
|
|
21
|
+
});
|
|
22
|
+
const bareModal = useStore((state) => {
|
|
23
|
+
var _a;
|
|
24
|
+
return (_a = state.modalConfig) == null ? void 0 : _a.bareModal;
|
|
25
|
+
});
|
|
26
|
+
const setStep = useModalStore((state) => state.setStep);
|
|
27
|
+
const setFlow = useModalStore((state) => state.setFlow);
|
|
28
|
+
const isLogin = useModalStore((state) => state.isLogin());
|
|
29
|
+
const twoFactorStatus = useModalStore((state) => state.twoFactorStatus);
|
|
30
|
+
const onRampConfig = useModalStore((state) => state.onRampConfig);
|
|
31
|
+
const para = useInternalClient();
|
|
32
|
+
const [isWaiting, setIsWaiting] = useState(false);
|
|
33
|
+
const isOnRampConfigured = (onRampConfig == null ? void 0 : onRampConfig.isBuyEnabled) || (onRampConfig == null ? void 0 : onRampConfig.isReceiveEnabled) || (onRampConfig == null ? void 0 : onRampConfig.isWithdrawEnabled);
|
|
34
|
+
const onBypass2fa = () => {
|
|
35
|
+
if (isLogin) {
|
|
36
|
+
setStep(ModalStep.LOGIN_DONE);
|
|
37
|
+
} else {
|
|
38
|
+
if (bareModal) {
|
|
39
|
+
setFlow("account");
|
|
40
|
+
setStep(ModalStep.ACCOUNT_MAIN);
|
|
41
|
+
} else {
|
|
42
|
+
onClose();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const handleNext = () => __async(void 0, null, function* () {
|
|
47
|
+
if (!twoFactorAuthEnabled) {
|
|
48
|
+
onBypass2fa();
|
|
49
|
+
}
|
|
50
|
+
if (!twoFactorStatus) {
|
|
51
|
+
if (isSetup2faPending) {
|
|
52
|
+
setIsWaiting(true);
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
if (twoFactorStatus.isSetup) {
|
|
56
|
+
onBypass2fa();
|
|
57
|
+
} else {
|
|
58
|
+
setStep(ModalStep.SETUP_2FA);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (isWaiting && !!twoFactorStatus) {
|
|
64
|
+
setStep(ModalStep.SETUP_2FA);
|
|
65
|
+
}
|
|
66
|
+
}, [isWaiting, twoFactorStatus]);
|
|
67
|
+
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
68
|
+
/* @__PURE__ */ jsx(CardContainer, { children: hideWallets ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx(HeroIcon, { icon: "checkCircleFilled" }),
|
|
70
|
+
/* @__PURE__ */ jsx(CpslText, { variant: "bodyM", color: "secondary", weight: "medium", style: { marginTop: "16px" }, children: "Your account has been created." })
|
|
71
|
+
] }) : /* @__PURE__ */ jsx(WalletCards, { children: para.currentWalletIdsArray.map(([id, type]) => {
|
|
72
|
+
return /* @__PURE__ */ jsx(WalletCard, { id, type, showAddFunds: isOnRampConfigured }, id);
|
|
73
|
+
}) }) }),
|
|
74
|
+
/* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: handleNext, disabled: isWaiting, children: twoFactorAuthEnabled ? "Continue" : "Done" }) })
|
|
75
|
+
] });
|
|
76
|
+
};
|
|
77
|
+
const CardContainer = safeStyled(InnerStepContainer)`
|
|
78
|
+
min-height: 196px;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
`;
|
|
81
|
+
export {
|
|
82
|
+
WalletCreationDoneStep
|
|
83
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CpslInput, CpslText, CpslTileButton } from '@getpara/react-components';
|
|
2
|
+
import { Network, OnRampAsset, TExternalWallet, TLinkedAccountType } from '@getpara/web-sdk';
|
|
3
|
+
import { PropsWithChildren } from 'react';
|
|
4
|
+
export declare const SpinnerContainer: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
|
+
export declare const QRContainer: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
6
|
+
export declare const InfoBoxContent: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
+
export declare const InfoBoxHeader: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
8
|
+
export declare const FilledDisabledInput: typeof CpslInput;
|
|
9
|
+
export declare const FullWidthFilledDisabledInput: typeof CpslInput;
|
|
10
|
+
export declare const CenteredText: typeof CpslText;
|
|
11
|
+
export declare const InnerStepContainer: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
12
|
+
export declare const StepContainer: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Substitute<Omit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, "ref"> & {
|
|
13
|
+
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
$wide?: boolean;
|
|
16
|
+
}>> & string;
|
|
17
|
+
export declare const Heading: typeof CpslText;
|
|
18
|
+
export declare const StyledCpslTileButton: typeof CpslTileButton;
|
|
19
|
+
export declare const HeroIcon: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<any, "ref"> & import("react").RefAttributes<any>, "ref"> & {
|
|
20
|
+
ref?: ((instance: any) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<any> | null | undefined;
|
|
21
|
+
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<any>>, keyof import("react").Component<any, {}, any>>;
|
|
22
|
+
export declare const HeaderSelect: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Substitute<Omit<Omit<any, "ref"> & import("react").RefAttributes<any>, "ref"> & {
|
|
23
|
+
ref?: ((instance: any) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<any> | null | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
$width: number;
|
|
26
|
+
$top?: number;
|
|
27
|
+
}>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<any>>, keyof import("react").Component<any, {}, any>>;
|
|
28
|
+
export declare const HeaderSelectItem: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<any, "ref"> & import("react").RefAttributes<any>, "ref"> & {
|
|
29
|
+
ref?: ((instance: any) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<any> | null | undefined;
|
|
30
|
+
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<any>>, keyof import("react").Component<any, {}, any>>;
|
|
31
|
+
export declare const HeaderSelectContainer: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
32
|
+
export declare function AssetIcon({ asset, size }: {
|
|
33
|
+
asset: OnRampAsset;
|
|
34
|
+
size?: string;
|
|
35
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare function NetworkIcon({ network, size }: {
|
|
37
|
+
network: Network;
|
|
38
|
+
size?: string;
|
|
39
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare const ErrorContainer: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
41
|
+
export declare const ErrorIcon: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<any, "ref"> & import("react").RefAttributes<any>, "ref"> & {
|
|
42
|
+
ref?: ((instance: any) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<any> | null | undefined;
|
|
43
|
+
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<any>>, keyof import("react").Component<any, {}, any>>;
|
|
44
|
+
export declare function AccountTypeIcon({ accountType, size, inset, }: {
|
|
45
|
+
accountType?: TLinkedAccountType | TExternalWallet;
|
|
46
|
+
size?: string;
|
|
47
|
+
inset?: string;
|
|
48
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
49
|
+
export declare function HeroAccountTypeIcon({ accountType }: {
|
|
50
|
+
accountType: TLinkedAccountType | TExternalWallet;
|
|
51
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare function HeroSuccessIcon(): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export declare function GradientScroll({ height, gap, children }: PropsWithChildren<{
|
|
54
|
+
gap?: string;
|
|
55
|
+
height?: string;
|
|
56
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export declare const HeroGenericIcon: ({ accountType }: {
|
|
58
|
+
accountType: "EMAIL" | "PHONE";
|
|
59
|
+
}) => import("react/jsx-runtime").JSX.Element;
|