@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,354 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { safeStyled } from "@getpara/react-common";
|
|
5
|
+
import { IFrameSteps, ModalStep } from "../../utils/steps.js";
|
|
6
|
+
import { CpslAlert, CpslIcon } from "@getpara/react-components";
|
|
7
|
+
import { VerificationCodeStep } from "../VerificationCodeStep/VerificationCodeStep.js";
|
|
8
|
+
import { useModalStore } from "../../stores/index.js";
|
|
9
|
+
import { BiometricLoginStep } from "../BiometricLoginStep/BiometricLoginStep.js";
|
|
10
|
+
import { Setup2FAStep } from "../Setup2FAStep/Setup2FAStep.js";
|
|
11
|
+
import { LoginDoneStep } from "../LoginDoneStep/LoginDoneStep.js";
|
|
12
|
+
import { EnabledFlow } from "@getpara/web-sdk";
|
|
13
|
+
import { AwaitingBiometricsStep } from "../AwaitingBiometricsStep/AwaitingBiometricsStep.js";
|
|
14
|
+
import { AwaitingWalletCreationStep } from "../AwaitingWalletCreationStep/AwaitingWalletCreationStep.js";
|
|
15
|
+
import { WalletCreationDoneStep } from "../WalletCreationDoneStep/WalletCreationDoneStep.js";
|
|
16
|
+
import { RecoverySecretStep } from "../RecoverySecretStep/RecoverySecretStep.js";
|
|
17
|
+
import { TwoFactorDoneStep } from "../TwoFactorDoneStep/TwoFactorDoneStep.js";
|
|
18
|
+
import { BiometricCreationStep } from "../BiometricCreationStep/BiometricCreationStep.js";
|
|
19
|
+
import { AwaitingOAuthStep } from "../AwaitingOAuthStep/AwaitingOAuthStep.js";
|
|
20
|
+
import { AddFundsAwaiting, AddFundsDone, AddFunds } from "../AddFunds/index.js";
|
|
21
|
+
import FarcasterOAuthStep from "../OAuth/FarcasterOAuthStep.js";
|
|
22
|
+
import { Header } from "../Header/Header.js";
|
|
23
|
+
import { AuthMainStep } from "../AuthMainStep/AuthMainStep.js";
|
|
24
|
+
import { BODY_MOTION_VARIANTS, BODY_TRANSITION, MOBILE_SIZE } from "../../constants/constants.js";
|
|
25
|
+
import { Account } from "../Account/Account.js";
|
|
26
|
+
import { AuthOptions } from "../AuthOptions/AuthOptions.js";
|
|
27
|
+
import { ExternalWallets } from "../ExternalWallets/ExternalWallets.js";
|
|
28
|
+
import { ExternalWalletStep } from "../ExternalWalletStep/ExternalWalletStep.js";
|
|
29
|
+
import { Hero } from "../Hero/Hero.js";
|
|
30
|
+
import { AnimatedHeightWrapper } from "./AnimatedHeightWrapper.js";
|
|
31
|
+
import { ChainSwitch } from "../ChainSwitch/ChainSwitch.js";
|
|
32
|
+
import { motion, AnimatePresence } from "framer-motion";
|
|
33
|
+
import { Controls } from "../Controls/Controls.js";
|
|
34
|
+
import { useEffect, useState } from "react";
|
|
35
|
+
import { TelegramOAuthStep } from "../OAuth/TelegramOAuthStep.js";
|
|
36
|
+
import { AwaitingPasswordStep } from "../AwaitingPasswordStep/AwaitingPasswordStep.js";
|
|
37
|
+
import { IFrameStep } from "../IFrameStep/IFrameStep.js";
|
|
38
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
39
|
+
import { ExternalWalletVerificationStep } from "../ExternalWalletVerificationStep/ExternalWalletVerificationStep.js";
|
|
40
|
+
import { NetworkSpeedBanner } from "@getpara/react-common";
|
|
41
|
+
import { AccountProfile } from "../Account/AccountProfile.js";
|
|
42
|
+
import { AccountProfileLinkOptions } from "../Account/AccountProfileLinkOptions.js";
|
|
43
|
+
import { AccountProfileLink } from "../Account/AccountProfileLink.js";
|
|
44
|
+
import { AccountProfileUnlink } from "../Account/AccountProfileUnlink.js";
|
|
45
|
+
import { ExternalWalletNetworkSelectStep } from "../ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js";
|
|
46
|
+
import { AwaitingIFrameStep } from "../AwaitingIFrameStep/AwaitingIFrameStep.js";
|
|
47
|
+
const MIN_HEIGHT = {
|
|
48
|
+
[ModalStep.ADD_FUNDS_AWAITING]: "680px"
|
|
49
|
+
};
|
|
50
|
+
const PADDING_TOP = {
|
|
51
|
+
[ModalStep.TELEGRAM_OAUTH]: "36px"
|
|
52
|
+
};
|
|
53
|
+
const PADDING_BOTTOM = {
|
|
54
|
+
[ModalStep.TELEGRAM_OAUTH]: "16px"
|
|
55
|
+
};
|
|
56
|
+
const PADDING_X = {
|
|
57
|
+
[ModalStep.ACCOUNT_PROFILE]: "32px"
|
|
58
|
+
};
|
|
59
|
+
const Body = ({
|
|
60
|
+
oAuthMethods,
|
|
61
|
+
twoFactorAuthEnabled,
|
|
62
|
+
disableEmailLogin,
|
|
63
|
+
disablePhoneLogin,
|
|
64
|
+
isGuestModeEnabled = false,
|
|
65
|
+
onClose
|
|
66
|
+
}) => {
|
|
67
|
+
const currentStep = useModalStore((state) => state.step);
|
|
68
|
+
const onRampConfig = useModalStore((state) => state.onRampConfig);
|
|
69
|
+
const stepDirection = useModalStore((state) => state.stepDirection);
|
|
70
|
+
const setStepDirection = useModalStore((state) => state.setStepDirection);
|
|
71
|
+
const accountAddFundTab = useModalStore((state) => state.accountAddFundTab);
|
|
72
|
+
const setAccountAddFundTab = useModalStore((state) => state.setAccountAddFundTab);
|
|
73
|
+
const embeddedModal = useStore((state) => {
|
|
74
|
+
var _a;
|
|
75
|
+
return (_a = state.modalConfig) == null ? void 0 : _a.embeddedModal;
|
|
76
|
+
});
|
|
77
|
+
const appName = useStore((state) => state.appName);
|
|
78
|
+
const [isTestModeAlert, setIsTestModeAlert] = useState(onRampConfig == null ? void 0 : onRampConfig.testMode);
|
|
79
|
+
const Content = () => {
|
|
80
|
+
switch (currentStep) {
|
|
81
|
+
case ModalStep.AUTH_MAIN: {
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
AuthMainStep,
|
|
84
|
+
{
|
|
85
|
+
oAuthMethods,
|
|
86
|
+
disableEmailLogin,
|
|
87
|
+
disablePhoneLogin,
|
|
88
|
+
isGuestModeEnabled
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
case ModalStep.EX_WALLET_MORE: {
|
|
93
|
+
return /* @__PURE__ */ jsx(ExternalWallets, {});
|
|
94
|
+
}
|
|
95
|
+
case ModalStep.AWAITING_GUEST_WALLET_CREATION: {
|
|
96
|
+
return /* @__PURE__ */ jsx(AwaitingWalletCreationStep, { isGuestMode: true });
|
|
97
|
+
}
|
|
98
|
+
case ModalStep.AUTH_MORE:
|
|
99
|
+
case ModalStep.AUTH_GUEST_SIGNUP: {
|
|
100
|
+
return /* @__PURE__ */ jsx(
|
|
101
|
+
AuthOptions,
|
|
102
|
+
{
|
|
103
|
+
oAuthMethods,
|
|
104
|
+
disableEmailLogin,
|
|
105
|
+
disablePhoneLogin,
|
|
106
|
+
isGuestModeEnabled
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
case ModalStep.VERIFICATIONS: {
|
|
111
|
+
return /* @__PURE__ */ jsx(VerificationCodeStep, {});
|
|
112
|
+
}
|
|
113
|
+
case ModalStep.EXTERNAL_WALLET_VERIFICATION: {
|
|
114
|
+
return /* @__PURE__ */ jsx(ExternalWalletVerificationStep, {});
|
|
115
|
+
}
|
|
116
|
+
case ModalStep.BIOMETRIC_LOGIN: {
|
|
117
|
+
return /* @__PURE__ */ jsx(BiometricLoginStep, {});
|
|
118
|
+
}
|
|
119
|
+
case ModalStep.SETUP_2FA:
|
|
120
|
+
case ModalStep.VERIFY_2FA: {
|
|
121
|
+
return /* @__PURE__ */ jsx(Setup2FAStep, { onClose });
|
|
122
|
+
}
|
|
123
|
+
case ModalStep.LOGIN_DONE: {
|
|
124
|
+
return /* @__PURE__ */ jsx(LoginDoneStep, { onClose });
|
|
125
|
+
}
|
|
126
|
+
case ModalStep.AWAITING_BIOMETRIC_LOGIN:
|
|
127
|
+
case ModalStep.AWAITING_BIOMETRIC_CREATION: {
|
|
128
|
+
return /* @__PURE__ */ jsx(AwaitingBiometricsStep, {});
|
|
129
|
+
}
|
|
130
|
+
case ModalStep.AWAITING_PASSWORD_LOGIN:
|
|
131
|
+
case ModalStep.AWAITING_PASSWORD_CREATION: {
|
|
132
|
+
return /* @__PURE__ */ jsx(AwaitingPasswordStep, {});
|
|
133
|
+
}
|
|
134
|
+
case ModalStep.AWAITING_WALLET_CREATION: {
|
|
135
|
+
return /* @__PURE__ */ jsx(AwaitingWalletCreationStep, {});
|
|
136
|
+
}
|
|
137
|
+
case ModalStep.WALLET_CREATION_DONE: {
|
|
138
|
+
return /* @__PURE__ */ jsx(WalletCreationDoneStep, { twoFactorAuthEnabled, onClose });
|
|
139
|
+
}
|
|
140
|
+
case ModalStep.SECRET: {
|
|
141
|
+
return /* @__PURE__ */ jsx(RecoverySecretStep, {});
|
|
142
|
+
}
|
|
143
|
+
case ModalStep.TWO_FACTOR_DONE: {
|
|
144
|
+
return /* @__PURE__ */ jsx(TwoFactorDoneStep, { onClose });
|
|
145
|
+
}
|
|
146
|
+
case ModalStep.BIOMETRIC_CREATION: {
|
|
147
|
+
return /* @__PURE__ */ jsx(BiometricCreationStep, {});
|
|
148
|
+
}
|
|
149
|
+
case ModalStep.AWAITING_OAUTH: {
|
|
150
|
+
return /* @__PURE__ */ jsx(AwaitingOAuthStep, {});
|
|
151
|
+
}
|
|
152
|
+
case ModalStep.FARCASTER_OAUTH: {
|
|
153
|
+
return /* @__PURE__ */ jsx(FarcasterOAuthStep, {});
|
|
154
|
+
}
|
|
155
|
+
case ModalStep.TELEGRAM_OAUTH: {
|
|
156
|
+
return /* @__PURE__ */ jsx(TelegramOAuthStep, {});
|
|
157
|
+
}
|
|
158
|
+
case ModalStep.ADD_FUNDS_BUY:
|
|
159
|
+
case ModalStep.ADD_FUNDS_RECEIVE:
|
|
160
|
+
case ModalStep.ADD_FUNDS_WITHDRAW: {
|
|
161
|
+
return /* @__PURE__ */ jsx(AddFunds, { "data-testid": "add-funds" });
|
|
162
|
+
}
|
|
163
|
+
case ModalStep.ADD_FUNDS_AWAITING: {
|
|
164
|
+
return /* @__PURE__ */ jsx(AddFundsAwaiting, {});
|
|
165
|
+
}
|
|
166
|
+
case ModalStep.ADD_FUNDS_SUCCESS: {
|
|
167
|
+
return /* @__PURE__ */ jsx(AddFundsDone, { isSuccess: true, onClose });
|
|
168
|
+
}
|
|
169
|
+
case ModalStep.ADD_FUNDS_FAILURE: {
|
|
170
|
+
return /* @__PURE__ */ jsx(AddFundsDone, { onClose });
|
|
171
|
+
}
|
|
172
|
+
case ModalStep.ACCOUNT_MAIN: {
|
|
173
|
+
return /* @__PURE__ */ jsx(Account, { onClose });
|
|
174
|
+
}
|
|
175
|
+
case ModalStep.ACCOUNT_PROFILE: {
|
|
176
|
+
return /* @__PURE__ */ jsx(AccountProfile, {});
|
|
177
|
+
}
|
|
178
|
+
case ModalStep.ACCOUNT_PROFILE_LIST: {
|
|
179
|
+
return /* @__PURE__ */ jsx(AccountProfileLinkOptions, {});
|
|
180
|
+
}
|
|
181
|
+
case ModalStep.ACCOUNT_PROFILE_ADD: {
|
|
182
|
+
return /* @__PURE__ */ jsx(AccountProfileLink, {});
|
|
183
|
+
}
|
|
184
|
+
case ModalStep.ACCOUNT_PROFILE_REMOVE: {
|
|
185
|
+
return /* @__PURE__ */ jsx(AccountProfileUnlink, {});
|
|
186
|
+
}
|
|
187
|
+
case ModalStep.EX_WALLET_SELECTED: {
|
|
188
|
+
return /* @__PURE__ */ jsx(ExternalWalletStep, {});
|
|
189
|
+
}
|
|
190
|
+
case ModalStep.CHAIN_SWITCH: {
|
|
191
|
+
return /* @__PURE__ */ jsx(ChainSwitch, {});
|
|
192
|
+
}
|
|
193
|
+
case ModalStep.EX_WALLET_NETWORK_SELECT: {
|
|
194
|
+
return /* @__PURE__ */ jsx(ExternalWalletNetworkSelectStep, {});
|
|
195
|
+
}
|
|
196
|
+
case ModalStep.AWAITING_IFRAME: {
|
|
197
|
+
return /* @__PURE__ */ jsx(AwaitingIFrameStep, {});
|
|
198
|
+
}
|
|
199
|
+
default: {
|
|
200
|
+
if (IFrameSteps.includes(currentStep)) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
if (!isTestModeAlert && (onRampConfig == null ? void 0 : onRampConfig.testMode)) {
|
|
208
|
+
setIsTestModeAlert(true);
|
|
209
|
+
}
|
|
210
|
+
}, [onRampConfig == null ? void 0 : onRampConfig.testMode]);
|
|
211
|
+
useEffect(() => {
|
|
212
|
+
switch (currentStep) {
|
|
213
|
+
case ModalStep.ADD_FUNDS_BUY:
|
|
214
|
+
setAccountAddFundTab(EnabledFlow.BUY);
|
|
215
|
+
break;
|
|
216
|
+
case ModalStep.ADD_FUNDS_RECEIVE:
|
|
217
|
+
setAccountAddFundTab(EnabledFlow.RECEIVE);
|
|
218
|
+
break;
|
|
219
|
+
case ModalStep.ADD_FUNDS_WITHDRAW:
|
|
220
|
+
setAccountAddFundTab(EnabledFlow.WITHDRAW);
|
|
221
|
+
break;
|
|
222
|
+
default:
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
}, [currentStep]);
|
|
226
|
+
return /* @__PURE__ */ jsxs(Container, { slot: "body", "data-testid": "modal-content", children: [
|
|
227
|
+
!embeddedModal && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
228
|
+
/* @__PURE__ */ jsx(Controls, { onClose }),
|
|
229
|
+
/* @__PURE__ */ jsx(Header, {})
|
|
230
|
+
] }),
|
|
231
|
+
/* @__PURE__ */ jsxs(AnimatedWrapper, { children: [
|
|
232
|
+
/* @__PURE__ */ jsx(
|
|
233
|
+
AnimatePresence,
|
|
234
|
+
{
|
|
235
|
+
mode: "popLayout",
|
|
236
|
+
initial: false,
|
|
237
|
+
onExitComplete: () => {
|
|
238
|
+
setStepDirection(1);
|
|
239
|
+
},
|
|
240
|
+
custom: stepDirection,
|
|
241
|
+
children: /* @__PURE__ */ jsxs(
|
|
242
|
+
BodyContainer,
|
|
243
|
+
{
|
|
244
|
+
custom: stepDirection,
|
|
245
|
+
variants: BODY_MOTION_VARIANTS,
|
|
246
|
+
initial: "enter",
|
|
247
|
+
animate: "center",
|
|
248
|
+
exit: "exit",
|
|
249
|
+
transition: BODY_TRANSITION,
|
|
250
|
+
children: [
|
|
251
|
+
/* @__PURE__ */ jsx(Hero, {}),
|
|
252
|
+
/* @__PURE__ */ jsxs(
|
|
253
|
+
InnerContainer,
|
|
254
|
+
{
|
|
255
|
+
$embeddedModal: !!embeddedModal,
|
|
256
|
+
$step: currentStep,
|
|
257
|
+
$isIFrameStep: IFrameSteps.includes(currentStep),
|
|
258
|
+
children: [
|
|
259
|
+
/* @__PURE__ */ jsx(NetworkSpeedBanner, { fontSize: "12px", iconSize: "16px" }),
|
|
260
|
+
Content(),
|
|
261
|
+
(onRampConfig == null ? void 0 : onRampConfig.testMode) && [
|
|
262
|
+
ModalStep.ADD_FUNDS_BUY,
|
|
263
|
+
ModalStep.ADD_FUNDS_WITHDRAW,
|
|
264
|
+
ModalStep.ADD_FUNDS_AWAITING,
|
|
265
|
+
ModalStep.ADD_FUNDS_FAILURE,
|
|
266
|
+
ModalStep.ADD_FUNDS_SUCCESS
|
|
267
|
+
].includes(currentStep) && isTestModeAlert && accountAddFundTab !== EnabledFlow.RECEIVE && /* @__PURE__ */ jsx(TestModeAlert, { children: /* @__PURE__ */ jsxs("div", { style: { fontSize: "14px" }, children: [
|
|
268
|
+
"This Para Modal is configured to run on-ramp services in ",
|
|
269
|
+
/* @__PURE__ */ jsx("b", { children: "test mode" }),
|
|
270
|
+
" only, for development purposes. If you are a user of ",
|
|
271
|
+
appName,
|
|
272
|
+
", please contact support.",
|
|
273
|
+
/* @__PURE__ */ jsx(CloseButton, { onClick: () => setIsTestModeAlert(false), children: /* @__PURE__ */ jsx(CloseX, { icon: "x" }) })
|
|
274
|
+
] }) })
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
)
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
["ADD_FUNDS_BUY", "ADD_FUNDS_RECEIVE", "ADD_FUNDS_WITHDRAW"].includes(currentStep) ? "ADD_FUNDS" : currentStep
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
),
|
|
284
|
+
/* @__PURE__ */ jsx(IFrameStep, {})
|
|
285
|
+
] })
|
|
286
|
+
] });
|
|
287
|
+
};
|
|
288
|
+
const Container = safeStyled.div`
|
|
289
|
+
position: relative;
|
|
290
|
+
`;
|
|
291
|
+
const AnimatedWrapper = safeStyled(AnimatedHeightWrapper)`
|
|
292
|
+
margin-top: -16px;
|
|
293
|
+
`;
|
|
294
|
+
const BodyContainer = safeStyled(motion.div)`
|
|
295
|
+
position: relative;
|
|
296
|
+
display: flex;
|
|
297
|
+
flex-direction: column;
|
|
298
|
+
gap: 24px;
|
|
299
|
+
will-change: auto !important;
|
|
300
|
+
`;
|
|
301
|
+
const InnerContainer = safeStyled.div`
|
|
302
|
+
z-index: 1;
|
|
303
|
+
flex: 1;
|
|
304
|
+
display: flex;
|
|
305
|
+
flex-direction: column;
|
|
306
|
+
justify-content: flex-start;
|
|
307
|
+
gap: 24px;
|
|
308
|
+
padding: ${({ $embeddedModal, $step, $isIFrameStep }) => {
|
|
309
|
+
var _a, _b, _c;
|
|
310
|
+
return $isIFrameStep ? "0px" : $embeddedModal ? "12px 0px 0px" : `${(_a = PADDING_TOP[$step]) != null ? _a : "72px"} ${(_b = PADDING_X[$step]) != null ? _b : "72px"} ${(_c = PADDING_BOTTOM[$step]) != null ? _c : "32px"}`;
|
|
311
|
+
}};
|
|
312
|
+
min-height: ${({ $step }) => {
|
|
313
|
+
var _a;
|
|
314
|
+
return (_a = MIN_HEIGHT[$step]) != null ? _a : "auto";
|
|
315
|
+
}};
|
|
316
|
+
height: ${({ $step }) => {
|
|
317
|
+
var _a;
|
|
318
|
+
return (_a = MIN_HEIGHT[$step]) != null ? _a : "auto";
|
|
319
|
+
}};
|
|
320
|
+
|
|
321
|
+
@media (max-width: ${MOBILE_SIZE}px) {
|
|
322
|
+
padding: ${({ $embeddedModal, $step, $isIFrameStep }) => {
|
|
323
|
+
var _a;
|
|
324
|
+
return $isIFrameStep ? "0px" : $embeddedModal ? "12px 0px 0px" : `${(_a = PADDING_TOP[$step]) != null ? _a : "72px"} 16px 0px`;
|
|
325
|
+
}};
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
cpsl-auth-modal.force-mobile-media & {
|
|
329
|
+
padding: 72px 16px 0px;
|
|
330
|
+
}
|
|
331
|
+
`;
|
|
332
|
+
const TestModeAlert = safeStyled(CpslAlert)`
|
|
333
|
+
--container-padding-end: 40px;
|
|
334
|
+
position: absolute;
|
|
335
|
+
bottom: 16px;
|
|
336
|
+
left: 16px;
|
|
337
|
+
right: 16px;
|
|
338
|
+
z-index: 1000;
|
|
339
|
+
`;
|
|
340
|
+
const CloseButton = safeStyled.button`
|
|
341
|
+
background-color: transparent;
|
|
342
|
+
border: none;
|
|
343
|
+
padding: 4px;
|
|
344
|
+
cursor: pointer;
|
|
345
|
+
position: absolute;
|
|
346
|
+
top: 0;
|
|
347
|
+
right: 0;
|
|
348
|
+
`;
|
|
349
|
+
const CloseX = safeStyled(CpslIcon)`
|
|
350
|
+
--icon-color: var(--cpsl-color-foreground-0);
|
|
351
|
+
`;
|
|
352
|
+
export {
|
|
353
|
+
Body
|
|
354
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ChainSwitch: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { CpslButton, CpslIcon, CpslQrCode, CpslSpinner, CpslText } from "@getpara/react-components";
|
|
7
|
+
import { CenteredText, InnerStepContainer, QRContainer, StepContainer } from "../common.js";
|
|
8
|
+
import { useEffect, useMemo } from "react";
|
|
9
|
+
import { useModalStore } from "../../stores/index.js";
|
|
10
|
+
import { safeStyled } from "@getpara/react-common";
|
|
11
|
+
import { useCopyToClipboard } from "@getpara/react-common";
|
|
12
|
+
import { ModalStep } from "../../utils/steps.js";
|
|
13
|
+
import { routeMobileExternalWallet } from "../../utils/routeMobileExternalWallet.js";
|
|
14
|
+
import { NETWORK_NOT_SUPPORTED_ERROR } from "../../constants/constants.js";
|
|
15
|
+
import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
|
|
16
|
+
const ChainSwitch = () => {
|
|
17
|
+
const [isCopied, copy] = useCopyToClipboard();
|
|
18
|
+
const externalWalletError = useModalStore((state) => state.externalWalletError);
|
|
19
|
+
const setStep = useModalStore((state) => state.setStep);
|
|
20
|
+
const setStepDirection = useModalStore((state) => state.setStepDirection);
|
|
21
|
+
const { switchChain, wallet, qrUri, chainIdSwitchingTo, walletDisplayHelpers } = useExternalWallets();
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if ((wallet == null ? void 0 : wallet.type) === "COSMOS") {
|
|
24
|
+
routeMobileExternalWallet(qrUri);
|
|
25
|
+
}
|
|
26
|
+
}, [qrUri, wallet]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!wallet) {
|
|
29
|
+
setStepDirection(-1);
|
|
30
|
+
setStep(ModalStep.ACCOUNT_MAIN);
|
|
31
|
+
}
|
|
32
|
+
}, [wallet]);
|
|
33
|
+
const handleTryAgainClick = () => __async(void 0, null, function* () {
|
|
34
|
+
if (chainIdSwitchingTo) {
|
|
35
|
+
yield switchChain(chainIdSwitchingTo);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const handleCopy = () => {
|
|
39
|
+
if (qrUri) {
|
|
40
|
+
copy(qrUri);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const Content = useMemo(() => {
|
|
44
|
+
var _a;
|
|
45
|
+
if (!wallet) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const { isCosmosMobileWallet } = walletDisplayHelpers;
|
|
49
|
+
if (isCosmosMobileWallet) {
|
|
50
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
51
|
+
/* @__PURE__ */ jsx(CpslText, { weight: "semiBold", children: "Scan with your mobile device to switch networks" }),
|
|
52
|
+
/* @__PURE__ */ jsx(QRContainer, { children: !qrUri ? /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) : /* @__PURE__ */ jsx(CpslQrCode, { url: qrUri, imageSrc: wallet.iconUrl }) }),
|
|
53
|
+
/* @__PURE__ */ jsxs(CpslButton, { size: "small", variant: "ghost", onClick: handleCopy, children: [
|
|
54
|
+
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: isCopied ? "check" : "copy" }),
|
|
55
|
+
isCopied ? "Copied" : "Copy Link"
|
|
56
|
+
] })
|
|
57
|
+
] }) });
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
60
|
+
!(externalWalletError == null ? void 0 : externalWalletError.length) ? /* @__PURE__ */ jsx(CenteredText, { color: "contrast", weight: "semiBold", children: `Confirm the request to change networks in your ${wallet.name} wallet.` }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61
|
+
/* @__PURE__ */ jsxs(ErrorContainer, { children: [
|
|
62
|
+
/* @__PURE__ */ jsx(ErrorIcon, { icon: "alertCircle" }),
|
|
63
|
+
/* @__PURE__ */ jsx(CenteredText, { weight: "semiBold", color: "error", children: externalWalletError[0] })
|
|
64
|
+
] }),
|
|
65
|
+
externalWalletError[1] && /* @__PURE__ */ jsx(CenteredText, { color: "secondary", weight: "medium", children: externalWalletError[1] })
|
|
66
|
+
] }),
|
|
67
|
+
((_a = externalWalletError == null ? void 0 : externalWalletError[0]) == null ? void 0 : _a.toLowerCase()) !== NETWORK_NOT_SUPPORTED_ERROR && /* @__PURE__ */ jsxs(CpslButton, { variant: "secondary", onClick: handleTryAgainClick, children: [
|
|
68
|
+
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "refresh" }),
|
|
69
|
+
"Try Again"
|
|
70
|
+
] })
|
|
71
|
+
] });
|
|
72
|
+
}, [wallet, walletDisplayHelpers, externalWalletError, qrUri]);
|
|
73
|
+
if (!wallet) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return /* @__PURE__ */ jsx(Container, { children: Content });
|
|
77
|
+
};
|
|
78
|
+
const Container = safeStyled(StepContainer)`
|
|
79
|
+
flex: 1;
|
|
80
|
+
justify-content: space-between;
|
|
81
|
+
`;
|
|
82
|
+
const ErrorContainer = safeStyled.div`
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
gap: 4px;
|
|
87
|
+
`;
|
|
88
|
+
const ErrorIcon = safeStyled(CpslIcon)`
|
|
89
|
+
--height: 16px;
|
|
90
|
+
--width: 16px;
|
|
91
|
+
--icon-color: var(--cpsl-color-text-error);
|
|
92
|
+
`;
|
|
93
|
+
export {
|
|
94
|
+
ChainSwitch
|
|
95
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
var TabValue = /* @__PURE__ */ ((TabValue2) => {
|
|
4
|
+
TabValue2["extension"] = "extension";
|
|
5
|
+
TabValue2["mobile"] = "mobile";
|
|
6
|
+
TabValue2["web"] = "web";
|
|
7
|
+
return TabValue2;
|
|
8
|
+
})(TabValue || {});
|
|
9
|
+
const TABS = {
|
|
10
|
+
extension: { label: "Extension", value: "extension" /* extension */, icon: "puzzlePiece" },
|
|
11
|
+
mobile: { label: "Mobile", value: "mobile" /* mobile */, icon: "phone" },
|
|
12
|
+
web: { label: "Web", value: "web" /* web */, icon: "globe" }
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
TABS,
|
|
16
|
+
TabValue
|
|
17
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { CpslIcon } from "@getpara/react-components";
|
|
5
|
+
import { safeStyled } from "@getpara/react-common";
|
|
6
|
+
import { useModalStore } from "../../stores/index.js";
|
|
7
|
+
import { useGoBack } from "../../hooks/useGoBack.js";
|
|
8
|
+
import { AccountSelect, ChainSelect } from "./Selects.js";
|
|
9
|
+
import { ModalStep } from "../../utils/steps.js";
|
|
10
|
+
import { HeaderButton } from "@getpara/react-common";
|
|
11
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
12
|
+
import { useAccount } from "../../../provider/index.js";
|
|
13
|
+
const Controls = ({ onClose }) => {
|
|
14
|
+
const bareModal = useStore((state) => {
|
|
15
|
+
var _a;
|
|
16
|
+
return (_a = state.modalConfig) == null ? void 0 : _a.bareModal;
|
|
17
|
+
});
|
|
18
|
+
const hasPreviousStep = useModalStore((state) => state.hasPreviousStep());
|
|
19
|
+
const step = useModalStore((state) => state.step);
|
|
20
|
+
const goBack = useGoBack();
|
|
21
|
+
const { isConnected } = useAccount();
|
|
22
|
+
const shouldShowSelects = [
|
|
23
|
+
ModalStep.ACCOUNT_MAIN,
|
|
24
|
+
ModalStep.CHAIN_SWITCH,
|
|
25
|
+
ModalStep.ADD_FUNDS_BUY,
|
|
26
|
+
ModalStep.ADD_FUNDS_RECEIVE,
|
|
27
|
+
ModalStep.ADD_FUNDS_WITHDRAW
|
|
28
|
+
].includes(step);
|
|
29
|
+
const handleBackClick = () => {
|
|
30
|
+
goBack();
|
|
31
|
+
};
|
|
32
|
+
return /* @__PURE__ */ jsxs(Container, { children: [
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
BackButton,
|
|
35
|
+
{
|
|
36
|
+
variant: "ghost",
|
|
37
|
+
style: {
|
|
38
|
+
visibility: hasPreviousStep ? "visible" : "hidden"
|
|
39
|
+
},
|
|
40
|
+
onClick: handleBackClick,
|
|
41
|
+
children: /* @__PURE__ */ jsx(CpslIcon, { icon: "arrow" })
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ jsx(MiddleContainer, { children: shouldShowSelects && isConnected && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
45
|
+
/* @__PURE__ */ jsx(ChainSelect, {}),
|
|
46
|
+
/* @__PURE__ */ jsx(AccountSelect, {})
|
|
47
|
+
] }) }),
|
|
48
|
+
/* @__PURE__ */ jsx(CloseButton, { bareModal, variant: "ghost", onClick: onClose, children: /* @__PURE__ */ jsx(CpslIcon, { icon: "close" }) })
|
|
49
|
+
] });
|
|
50
|
+
};
|
|
51
|
+
const Container = safeStyled.div`
|
|
52
|
+
position: absolute;
|
|
53
|
+
width: 100%;
|
|
54
|
+
top: 16px;
|
|
55
|
+
|
|
56
|
+
z-index: 3;
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: space-between;
|
|
60
|
+
gap: 8px;
|
|
61
|
+
`;
|
|
62
|
+
const MiddleContainer = safeStyled.div`
|
|
63
|
+
flex: 1;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
gap: 4px;
|
|
68
|
+
`;
|
|
69
|
+
const CloseButton = safeStyled(HeaderButton)`
|
|
70
|
+
transform: rotate(180deg);
|
|
71
|
+
visibility: ${({ bareModal }) => bareModal ? "hidden" : "visible"};
|
|
72
|
+
`;
|
|
73
|
+
const BackButton = safeStyled(HeaderButton)`
|
|
74
|
+
transform: rotate(180deg);
|
|
75
|
+
`;
|
|
76
|
+
export {
|
|
77
|
+
Controls
|
|
78
|
+
};
|