@openfort/react 0.3.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/browsers.js +13 -0
- package/build/assets/browsers.js.map +1 -0
- package/build/assets/chains.js +139 -0
- package/build/assets/chains.js.map +1 -0
- package/build/assets/icons.js +41 -0
- package/build/assets/icons.js.map +1 -0
- package/build/assets/logos.js +173 -0
- package/build/assets/logos.js.map +1 -0
- package/build/assets/wave.js +6 -0
- package/build/assets/wave.js.map +1 -0
- package/build/components/BalanceButton/index.js +89 -0
- package/build/components/BalanceButton/index.js.map +1 -0
- package/build/components/Common/Alert/index.js +10 -0
- package/build/components/Common/Alert/index.js.map +1 -0
- package/build/components/Common/Alert/styles.js +55 -0
- package/build/components/Common/Alert/styles.js.map +1 -0
- package/build/components/Common/Avatar/index.d.ts +11 -3
- package/build/components/Common/Avatar/index.js +100 -0
- package/build/components/Common/Avatar/index.js.map +1 -0
- package/build/components/Common/Avatar/styles.js +59 -0
- package/build/components/Common/Avatar/styles.js.map +1 -0
- package/build/components/Common/BrowserIcon/index.js +28 -0
- package/build/components/Common/BrowserIcon/index.js.map +1 -0
- package/build/components/Common/BrowserIcon/styles.js +20 -0
- package/build/components/Common/BrowserIcon/styles.js.map +1 -0
- package/build/components/Common/Button/index.js +36 -0
- package/build/components/Common/Button/index.js.map +1 -0
- package/build/components/Common/Button/styles.js +302 -0
- package/build/components/Common/Button/styles.js.map +1 -0
- package/build/components/Common/Button/types.d.ts +1 -0
- package/build/components/Common/Chain/index.d.ts +8 -0
- package/build/components/Common/Chain/index.js +38 -0
- package/build/components/Common/Chain/index.js.map +1 -0
- package/build/components/Common/Chain/styles.js +94 -0
- package/build/components/Common/Chain/styles.js.map +1 -0
- package/build/components/Common/ConnectorList/index.js +58 -0
- package/build/components/Common/ConnectorList/index.js.map +1 -0
- package/build/components/Common/ConnectorList/styles.js +324 -0
- package/build/components/Common/ConnectorList/styles.js.map +1 -0
- package/build/components/Common/CopyToClipboard/CopyButton.js +12 -0
- package/build/components/Common/CopyToClipboard/CopyButton.js.map +1 -0
- package/build/components/Common/CopyToClipboard/CopyIcon.js +76 -0
- package/build/components/Common/CopyToClipboard/CopyIcon.js.map +1 -0
- package/build/components/Common/CopyToClipboard/CopyIconButton.js +38 -0
- package/build/components/Common/CopyToClipboard/CopyIconButton.js.map +1 -0
- package/build/components/Common/CopyToClipboard/CopyText.js +26 -0
- package/build/components/Common/CopyToClipboard/CopyText.js.map +1 -0
- package/build/components/Common/CustomQRCode/QRCode.js +60 -0
- package/build/components/Common/CustomQRCode/QRCode.js.map +1 -0
- package/build/components/Common/CustomQRCode/index.js +22 -0
- package/build/components/Common/CustomQRCode/index.js.map +1 -0
- package/build/components/Common/CustomQRCode/styles.js +155 -0
- package/build/components/Common/CustomQRCode/styles.js.map +1 -0
- package/build/components/Common/FitText/index.js +28 -0
- package/build/components/Common/FitText/index.js.map +1 -0
- package/build/components/Common/Input/index.js +17 -0
- package/build/components/Common/Input/index.js.map +1 -0
- package/build/components/Common/Input/styles.js +53 -0
- package/build/components/Common/Input/styles.js.map +1 -0
- package/build/components/Common/LargeButton/index.js +10 -0
- package/build/components/Common/LargeButton/index.js.map +1 -0
- package/build/components/Common/LargeButton/styles.js +69 -0
- package/build/components/Common/LargeButton/styles.js.map +1 -0
- package/build/components/Common/Loading/index.js +96 -0
- package/build/components/Common/Loading/index.js.map +1 -0
- package/build/components/Common/Modal/index.js +272 -0
- package/build/components/Common/Modal/index.js.map +1 -0
- package/build/components/Common/Modal/styles.d.ts +0 -1
- package/build/components/Common/Modal/styles.js +657 -0
- package/build/components/Common/Modal/styles.js.map +1 -0
- package/build/components/Common/OTPInput/index.js +108 -0
- package/build/components/Common/OTPInput/index.js.map +1 -0
- package/build/components/Common/OTPInput/styles.js +153 -0
- package/build/components/Common/OTPInput/styles.js.map +1 -0
- package/build/components/Common/Portal/index.js +31 -0
- package/build/components/Common/Portal/index.js.map +1 -0
- package/build/components/Common/PoweredByFooter/index.js +103 -0
- package/build/components/Common/PoweredByFooter/index.js.map +1 -0
- package/build/components/Common/Providers/ProviderHeader.d.ts +2 -2
- package/build/components/Common/Providers/ProviderHeader.js +55 -0
- package/build/components/Common/Providers/ProviderHeader.js.map +1 -0
- package/build/components/Common/Providers/ProviderIcon.d.ts +2 -2
- package/build/components/Common/Providers/ProviderIcon.js +41 -0
- package/build/components/Common/Providers/ProviderIcon.js.map +1 -0
- package/build/components/Common/Providers/getProviderName.d.ts +1 -1
- package/build/components/Common/Providers/getProviderName.js +15 -0
- package/build/components/Common/Providers/getProviderName.js.map +1 -0
- package/build/components/Common/ScrollArea/index.js +58 -0
- package/build/components/Common/ScrollArea/index.js.map +1 -0
- package/build/components/Common/ScrollArea/styles.js +168 -0
- package/build/components/Common/ScrollArea/styles.js.map +1 -0
- package/build/components/Common/Spinner/index.js +24 -0
- package/build/components/Common/Spinner/index.js.map +1 -0
- package/build/components/Common/Spinner/styles.js +22 -0
- package/build/components/Common/Spinner/styles.js.map +1 -0
- package/build/components/Common/SquircleSpinner/index.js +15 -0
- package/build/components/Common/SquircleSpinner/index.js.map +1 -0
- package/build/components/Common/SquircleSpinner/styles.js +66 -0
- package/build/components/Common/SquircleSpinner/styles.js.map +1 -0
- package/build/components/Common/ThemedButton/index.js +25 -0
- package/build/components/Common/ThemedButton/index.js.map +1 -0
- package/build/components/Common/ThemedButton/styles.js +152 -0
- package/build/components/Common/ThemedButton/styles.js.map +1 -0
- package/build/components/Common/TickList/index.js +11 -0
- package/build/components/Common/TickList/index.js.map +1 -0
- package/build/components/Common/TickList/styles.js +28 -0
- package/build/components/Common/TickList/styles.js.map +1 -0
- package/build/components/Common/Tooltip/index.js +91 -0
- package/build/components/Common/Tooltip/index.js.map +1 -0
- package/build/components/Common/Tooltip/styles.js +81 -0
- package/build/components/Common/Tooltip/styles.js.map +1 -0
- package/build/components/Common/WalletRecoveryIcon/index.d.ts +4 -0
- package/build/components/Common/WalletRecoveryIcon/index.js +19 -0
- package/build/components/Common/WalletRecoveryIcon/index.js.map +1 -0
- package/build/components/ConnectButton/index.d.ts +12 -4
- package/build/components/ConnectButton/index.js +266 -0
- package/build/components/ConnectButton/index.js.map +1 -0
- package/build/components/ConnectButton/styles.js +50 -0
- package/build/components/ConnectButton/styles.js.map +1 -0
- package/build/components/ConnectKitThemeProvider/ConnectKitThemeProvider.js +20 -0
- package/build/components/ConnectKitThemeProvider/ConnectKitThemeProvider.js.map +1 -0
- package/build/components/ConnectModal/ConnectUsing.d.ts +1 -1
- package/build/components/ConnectModal/ConnectUsing.js +68 -0
- package/build/components/ConnectModal/ConnectUsing.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/index.js +17 -0
- package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/index.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/styles.js +118 -0
- package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/styles.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithInjector/index.d.ts +0 -2
- package/build/components/ConnectModal/ConnectWithInjector/index.js +295 -0
- package/build/components/ConnectModal/ConnectWithInjector/index.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithInjector/styles.js +133 -0
- package/build/components/ConnectModal/ConnectWithInjector/styles.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithMobile.js +99 -0
- package/build/components/ConnectModal/ConnectWithMobile.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithOAuth.js +128 -0
- package/build/components/ConnectModal/ConnectWithOAuth.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithQRCode.js +78 -0
- package/build/components/ConnectModal/ConnectWithQRCode.js.map +1 -0
- package/build/components/ConnectModal/index.js +230 -0
- package/build/components/ConnectModal/index.js.map +1 -0
- package/build/components/FloatingGraphic/index.js +13 -0
- package/build/components/FloatingGraphic/index.js.map +1 -0
- package/build/components/FloatingGraphic/styles.js +175 -0
- package/build/components/FloatingGraphic/styles.js.map +1 -0
- package/build/components/Openfort/OpenfortProvider.d.ts +10 -25
- package/build/components/Openfort/OpenfortProvider.js +351 -0
- package/build/components/Openfort/OpenfortProvider.js.map +1 -0
- package/build/components/Openfort/context.d.ts +48 -5
- package/build/components/Openfort/context.js +7 -0
- package/build/components/Openfort/context.js.map +1 -0
- package/build/components/Openfort/routeHelpers.d.ts +5 -0
- package/build/components/Openfort/routeHelpers.js +20 -0
- package/build/components/Openfort/routeHelpers.js.map +1 -0
- package/build/components/Openfort/types.d.ts +57 -23
- package/build/components/Openfort/types.js +119 -0
- package/build/components/Openfort/types.js.map +1 -0
- package/build/components/Openfort/useOpenfort.d.ts +2 -0
- package/build/components/Openfort/useOpenfort.js +12 -0
- package/build/components/Openfort/useOpenfort.js.map +1 -0
- package/build/components/PageContent/index.js +55 -0
- package/build/components/PageContent/index.js.map +1 -0
- package/build/components/PageContent/styles.js +11 -0
- package/build/components/PageContent/styles.js.map +1 -0
- package/build/components/Pages/About/graphics.js +193 -0
- package/build/components/Pages/About/graphics.js.map +1 -0
- package/build/components/Pages/About/index.js +142 -0
- package/build/components/Pages/About/index.js.map +1 -0
- package/build/components/Pages/About/styles.js +142 -0
- package/build/components/Pages/About/styles.js.map +1 -0
- package/build/components/Pages/AssetInventory/index.js +66 -0
- package/build/components/Pages/AssetInventory/index.js.map +1 -0
- package/build/components/Pages/Buy/coinbaseApi.js +106 -0
- package/build/components/Pages/Buy/coinbaseApi.js.map +1 -0
- package/build/components/Pages/Buy/index.js +88 -0
- package/build/components/Pages/Buy/index.js.map +1 -0
- package/build/components/Pages/Buy/onrampApi.js +57 -0
- package/build/components/Pages/Buy/onrampApi.js.map +1 -0
- package/build/components/Pages/Buy/providers.js +39 -0
- package/build/components/Pages/Buy/providers.js.map +1 -0
- package/build/components/Pages/Buy/stripeApi.js +74 -0
- package/build/components/Pages/Buy/stripeApi.js.map +1 -0
- package/build/components/Pages/Buy/styles.js +230 -0
- package/build/components/Pages/Buy/styles.js.map +1 -0
- package/build/components/Pages/Buy/utils.js +71 -0
- package/build/components/Pages/Buy/utils.js.map +1 -0
- package/build/components/Pages/BuyComplete/index.js +47 -0
- package/build/components/Pages/BuyComplete/index.js.map +1 -0
- package/build/components/Pages/BuyProcessing/index.js +231 -0
- package/build/components/Pages/BuyProcessing/index.js.map +1 -0
- package/build/components/Pages/BuyProviderSelect/index.js +55 -0
- package/build/components/Pages/BuyProviderSelect/index.js.map +1 -0
- package/build/components/Pages/BuyProviderSelect/styles.js +103 -0
- package/build/components/Pages/BuyProviderSelect/styles.js.map +1 -0
- package/build/components/Pages/BuySelectProvider/index.js +245 -0
- package/build/components/Pages/BuySelectProvider/index.js.map +1 -0
- package/build/components/Pages/Connected/ConnectedPageLayout.d.ts +22 -0
- package/build/components/Pages/Connected/ConnectedPageLayout.js +11 -0
- package/build/components/Pages/Connected/ConnectedPageLayout.js.map +1 -0
- package/build/components/Pages/Connected/EthereumConnected.d.ts +3 -0
- package/build/components/Pages/Connected/EthereumConnected.js +133 -0
- package/build/components/Pages/Connected/EthereumConnected.js.map +1 -0
- package/build/components/Pages/Connected/SolanaConnected.d.ts +3 -0
- package/build/components/Pages/Connected/SolanaConnected.js +96 -0
- package/build/components/Pages/Connected/SolanaConnected.js.map +1 -0
- package/build/components/Pages/Connected/index.d.ts +2 -2
- package/build/components/Pages/Connected/index.js +18 -0
- package/build/components/Pages/Connected/index.js.map +1 -0
- package/build/components/Pages/Connected/styles.js +122 -0
- package/build/components/Pages/Connected/styles.js.map +1 -0
- package/build/components/Pages/ConnectedSuccess/index.js +19 -0
- package/build/components/Pages/ConnectedSuccess/index.js.map +1 -0
- package/build/components/Pages/Connectors/index.js +73 -0
- package/build/components/Pages/Connectors/index.js.map +1 -0
- package/build/components/Pages/CreateGuestUserPage/index.js +28 -0
- package/build/components/Pages/CreateGuestUserPage/index.js.map +1 -0
- package/build/components/Pages/CreateWallet/SolanaCreateWallet.d.ts +6 -0
- package/build/components/Pages/CreateWallet/SolanaCreateWallet.js +241 -0
- package/build/components/Pages/CreateWallet/SolanaCreateWallet.js.map +1 -0
- package/build/components/Pages/CreateWallet/index.js +303 -0
- package/build/components/Pages/CreateWallet/index.js.map +1 -0
- package/build/components/Pages/CreateWallet/styles.js +17 -0
- package/build/components/Pages/CreateWallet/styles.js.map +1 -0
- package/build/components/Pages/DownloadApp/index.js +32 -0
- package/build/components/Pages/DownloadApp/index.js.map +1 -0
- package/build/components/Pages/EmailLogin/index.js +118 -0
- package/build/components/Pages/EmailLogin/index.js.map +1 -0
- package/build/components/Pages/EmailLogin/styles.js +24 -0
- package/build/components/Pages/EmailLogin/styles.js.map +1 -0
- package/build/components/Pages/EmailOTP/index.js +116 -0
- package/build/components/Pages/EmailOTP/index.js.map +1 -0
- package/build/components/Pages/EmailOTP/styles.js +38 -0
- package/build/components/Pages/EmailOTP/styles.js.map +1 -0
- package/build/components/Pages/EmailVerification/index.js +86 -0
- package/build/components/Pages/EmailVerification/index.js.map +1 -0
- package/build/components/Pages/ExportKey/index.js +44 -0
- package/build/components/Pages/ExportKey/index.js.map +1 -0
- package/build/components/Pages/ForgotPassword/index.js +129 -0
- package/build/components/Pages/ForgotPassword/index.js.map +1 -0
- package/build/components/Pages/LinkEmail/index.js +63 -0
- package/build/components/Pages/LinkEmail/index.js.map +1 -0
- package/build/components/Pages/LinkedProvider/index.d.ts +3 -0
- package/build/components/Pages/LinkedProvider/index.js +90 -0
- package/build/components/Pages/LinkedProvider/index.js.map +1 -0
- package/build/components/Pages/LinkedProviders/index.js +45 -0
- package/build/components/Pages/LinkedProviders/index.js.map +1 -0
- package/build/components/Pages/LinkedProviders/styles.js +51 -0
- package/build/components/Pages/LinkedProviders/styles.js.map +1 -0
- package/build/components/Pages/LoadWallets/index.js +91 -0
- package/build/components/Pages/LoadWallets/index.js.map +1 -0
- package/build/components/Pages/Loading/index.js +61 -0
- package/build/components/Pages/Loading/index.js.map +1 -0
- package/build/components/Pages/MobileConnectors/index.js +71 -0
- package/build/components/Pages/MobileConnectors/index.js.map +1 -0
- package/build/components/Pages/MobileConnectors/styles.js +65 -0
- package/build/components/Pages/MobileConnectors/styles.js.map +1 -0
- package/build/components/Pages/NoAssetsAvailable/index.js +45 -0
- package/build/components/Pages/NoAssetsAvailable/index.js.map +1 -0
- package/build/components/Pages/NoAssetsAvailable/styles.js +10 -0
- package/build/components/Pages/NoAssetsAvailable/styles.js.map +1 -0
- package/build/components/Pages/Onboarding/index.js +20 -0
- package/build/components/Pages/Onboarding/index.js.map +1 -0
- package/build/components/Pages/PhoneOTP/index.js +128 -0
- package/build/components/Pages/PhoneOTP/index.js.map +1 -0
- package/build/components/Pages/PhoneOTP/styles.js +38 -0
- package/build/components/Pages/PhoneOTP/styles.js.map +1 -0
- package/build/components/Pages/Profile/index.js +35 -0
- package/build/components/Pages/Profile/index.js.map +1 -0
- package/build/components/Pages/Providers/index.js +157 -0
- package/build/components/Pages/Providers/index.js.map +1 -0
- package/build/components/Pages/Providers/styles.js +156 -0
- package/build/components/Pages/Providers/styles.js.map +1 -0
- package/build/components/Pages/Receive/index.js +61 -0
- package/build/components/Pages/Receive/index.js.map +1 -0
- package/build/components/Pages/Receive/styles.d.ts +1 -0
- package/build/components/Pages/Receive/styles.js +52 -0
- package/build/components/Pages/Receive/styles.js.map +1 -0
- package/build/components/Pages/Recover/index.js +252 -0
- package/build/components/Pages/Recover/index.js.map +1 -0
- package/build/components/Pages/Recover/recoveryRegistry.d.ts +32 -0
- package/build/components/Pages/Recover/recoveryRegistry.js +61 -0
- package/build/components/Pages/Recover/recoveryRegistry.js.map +1 -0
- package/build/components/Pages/RemoveLinkedProvider/index.js +104 -0
- package/build/components/Pages/RemoveLinkedProvider/index.js.map +1 -0
- package/build/components/Pages/SelectToken/index.js +102 -0
- package/build/components/Pages/SelectToken/index.js.map +1 -0
- package/build/components/Pages/SelectToken/styles.js +78 -0
- package/build/components/Pages/SelectToken/styles.js.map +1 -0
- package/build/components/Pages/SelectWalletToRecover/index.d.ts +1 -2
- package/build/components/Pages/SelectWalletToRecover/index.js +70 -0
- package/build/components/Pages/SelectWalletToRecover/index.js.map +1 -0
- package/build/components/Pages/Send/EthereumSend.d.ts +1 -0
- package/build/components/Pages/Send/EthereumSend.js +88 -0
- package/build/components/Pages/Send/EthereumSend.js.map +1 -0
- package/build/components/Pages/Send/SolanaSend.d.ts +1 -0
- package/build/components/Pages/Send/SolanaSend.js +93 -0
- package/build/components/Pages/Send/SolanaSend.js.map +1 -0
- package/build/components/Pages/Send/index.d.ts +7 -1
- package/build/components/Pages/Send/index.js +18 -0
- package/build/components/Pages/Send/index.js.map +1 -0
- package/build/components/Pages/Send/styles.js +112 -0
- package/build/components/Pages/Send/styles.js.map +1 -0
- package/build/components/Pages/Send/utils.d.ts +1 -1
- package/build/components/Pages/Send/utils.js +63 -0
- package/build/components/Pages/Send/utils.js.map +1 -0
- package/build/components/Pages/SendConfirmation/EstimatedFees.js +66 -0
- package/build/components/Pages/SendConfirmation/EstimatedFees.js.map +1 -0
- package/build/components/Pages/SendConfirmation/index.js +331 -0
- package/build/components/Pages/SendConfirmation/index.js.map +1 -0
- package/build/components/Pages/SendConfirmation/styles.js +129 -0
- package/build/components/Pages/SendConfirmation/styles.js.map +1 -0
- package/build/components/Pages/SocialProviders/index.js +15 -0
- package/build/components/Pages/SocialProviders/index.js.map +1 -0
- package/build/components/Pages/SolanaSendConfirmation/index.d.ts +1 -0
- package/build/components/Pages/SolanaSendConfirmation/index.js +152 -0
- package/build/components/Pages/SolanaSendConfirmation/index.js.map +1 -0
- package/build/components/Pages/SolanaWallets/index.d.ts +1 -0
- package/build/components/Pages/SolanaWallets/index.js +36 -0
- package/build/components/Pages/SolanaWallets/index.js.map +1 -0
- package/build/components/PasswordStrength/PasswordStrengthIndicator.js +62 -0
- package/build/components/PasswordStrength/PasswordStrengthIndicator.js.map +1 -0
- package/build/components/PasswordStrength/password-utility.js +128 -0
- package/build/components/PasswordStrength/password-utility.js.map +1 -0
- package/build/constants/chainConfigs.js +316 -0
- package/build/constants/chainConfigs.js.map +1 -0
- package/build/constants/defaultTheme.js +6 -0
- package/build/constants/defaultTheme.js.map +1 -0
- package/build/constants/openfort.d.ts +4 -0
- package/build/constants/openfort.js +8 -0
- package/build/constants/openfort.js.map +1 -0
- package/build/core/ConnectionStrategy.d.ts +31 -0
- package/build/core/ConnectionStrategy.js +9 -0
- package/build/core/ConnectionStrategy.js.map +1 -0
- package/build/core/ConnectionStrategyContext.d.ts +16 -0
- package/build/core/ConnectionStrategyContext.js +22 -0
- package/build/core/ConnectionStrategyContext.js.map +1 -0
- package/build/core/errors.d.ts +1 -0
- package/build/core/strategies/EthereumBridgeStrategy.d.ts +11 -0
- package/build/core/strategies/EthereumBridgeStrategy.js +83 -0
- package/build/core/strategies/EthereumBridgeStrategy.js.map +1 -0
- package/build/core/strategies/EthereumEmbeddedStrategy.d.ts +8 -0
- package/build/core/strategies/EthereumEmbeddedStrategy.js +85 -0
- package/build/core/strategies/EthereumEmbeddedStrategy.js.map +1 -0
- package/build/core/strategies/SolanaEmbeddedStrategy.d.ts +9 -0
- package/build/core/strategies/SolanaEmbeddedStrategy.js +53 -0
- package/build/core/strategies/SolanaEmbeddedStrategy.js.map +1 -0
- package/build/core/strategyUtils.d.ts +6 -0
- package/build/core/strategyUtils.js +31 -0
- package/build/core/strategyUtils.js.map +1 -0
- package/build/ethereum/OpenfortEthereumBridgeContext.d.ts +87 -0
- package/build/ethereum/OpenfortEthereumBridgeContext.js +18 -0
- package/build/ethereum/OpenfortEthereumBridgeContext.js.map +1 -0
- package/build/ethereum/hooks/getEmbeddedWalletClient.d.ts +14 -0
- package/build/ethereum/hooks/getEmbeddedWalletClient.js +24 -0
- package/build/ethereum/hooks/getEmbeddedWalletClient.js.map +1 -0
- package/build/ethereum/hooks/useEthereumEmbeddedWallet.d.ts +17 -0
- package/build/ethereum/hooks/useEthereumEmbeddedWallet.js +425 -0
- package/build/ethereum/hooks/useEthereumEmbeddedWallet.js.map +1 -0
- package/build/ethereum/hooks/useEthereumWalletAssets.d.ts +29 -0
- package/build/ethereum/hooks/useEthereumWalletAssets.js +204 -0
- package/build/ethereum/hooks/useEthereumWalletAssets.js.map +1 -0
- package/build/ethereum/index.d.ts +11 -0
- package/build/ethereum/index.js +3 -0
- package/build/ethereum/index.js.map +1 -0
- package/build/ethereum/types.d.ts +140 -0
- package/build/hooks/openfort/auth/requestEmailVerification.js +21 -0
- package/build/hooks/openfort/auth/requestEmailVerification.js.map +1 -0
- package/build/hooks/openfort/auth/status.js +11 -0
- package/build/hooks/openfort/auth/status.js.map +1 -0
- package/build/hooks/openfort/auth/useAuthCallback.d.ts +2 -1
- package/build/hooks/openfort/auth/useAuthCallback.js +197 -0
- package/build/hooks/openfort/auth/useAuthCallback.js.map +1 -0
- package/build/hooks/openfort/auth/useConnectToWalletPostAuth.d.ts +3 -2
- package/build/hooks/openfort/auth/useConnectToWalletPostAuth.js +161 -0
- package/build/hooks/openfort/auth/useConnectToWalletPostAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useEmailAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useEmailAuth.js +496 -0
- package/build/hooks/openfort/auth/useEmailAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useEmailOtpAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useEmailOtpAuth.js +151 -0
- package/build/hooks/openfort/auth/useEmailOtpAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useGuestAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useGuestAuth.js +142 -0
- package/build/hooks/openfort/auth/useGuestAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useOAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useOAuth.js +217 -0
- package/build/hooks/openfort/auth/useOAuth.js.map +1 -0
- package/build/hooks/openfort/auth/usePhoneOtpAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/usePhoneOtpAuth.js +174 -0
- package/build/hooks/openfort/auth/usePhoneOtpAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useSignOut.d.ts +2 -1
- package/build/hooks/openfort/auth/useSignOut.js +104 -0
- package/build/hooks/openfort/auth/useSignOut.js.map +1 -0
- package/build/hooks/openfort/hookConsistency.js +17 -0
- package/build/hooks/openfort/hookConsistency.js.map +1 -0
- package/build/hooks/openfort/use7702Authorization.js +73 -0
- package/build/hooks/openfort/use7702Authorization.js.map +1 -0
- package/build/hooks/openfort/useGrantPermissions.d.ts +7 -76
- package/build/hooks/openfort/useGrantPermissions.js +221 -0
- package/build/hooks/openfort/useGrantPermissions.js.map +1 -0
- package/build/hooks/openfort/useProviders.js +75 -0
- package/build/hooks/openfort/useProviders.js.map +1 -0
- package/build/hooks/openfort/useRevokePermissions.d.ts +2 -1
- package/build/hooks/openfort/useRevokePermissions.js +126 -0
- package/build/hooks/openfort/useRevokePermissions.js.map +1 -0
- package/build/hooks/openfort/useUI.d.ts +4 -45
- package/build/hooks/openfort/useUI.js +122 -0
- package/build/hooks/openfort/useUI.js.map +1 -0
- package/build/hooks/openfort/useUser.d.ts +12 -35
- package/build/hooks/openfort/useUser.js +61 -0
- package/build/hooks/openfort/useUser.js.map +1 -0
- package/build/hooks/openfort/walletTypes.d.ts +32 -0
- package/build/hooks/openfort/walletTypes.js +53 -0
- package/build/hooks/openfort/walletTypes.js.map +1 -0
- package/build/hooks/useBalance.d.ts +50 -0
- package/build/hooks/useBalance.js +80 -0
- package/build/hooks/useBalance.js.map +1 -0
- package/build/hooks/useConnectLifecycle.d.ts +7 -0
- package/build/hooks/useConnectLifecycle.js +43 -0
- package/build/hooks/useConnectLifecycle.js.map +1 -0
- package/build/hooks/useConnectors.d.ts +3 -5
- package/build/hooks/useConnectors.js +26 -0
- package/build/hooks/useConnectors.js.map +1 -0
- package/build/hooks/useCopyToClipboard.js +29 -0
- package/build/hooks/useCopyToClipboard.js.map +1 -0
- package/build/hooks/useFitText.js +125 -0
- package/build/hooks/useFitText.js.map +1 -0
- package/build/hooks/useFocusTrap.d.ts +4 -1
- package/build/hooks/useFocusTrap.js +60 -0
- package/build/hooks/useFocusTrap.js.map +1 -0
- package/build/hooks/useGoogleFont.js +43 -0
- package/build/hooks/useGoogleFont.js.map +1 -0
- package/build/hooks/useIsMobile.js +17 -0
- package/build/hooks/useIsMobile.js.map +1 -0
- package/build/hooks/useIsMounted.js +10 -0
- package/build/hooks/useIsMounted.js.map +1 -0
- package/build/hooks/useLastConnector.js +39 -0
- package/build/hooks/useLastConnector.js.map +1 -0
- package/build/hooks/useLocales.d.ts +1 -1
- package/build/hooks/useLocales.js +68 -0
- package/build/hooks/useLocales.js.map +1 -0
- package/build/hooks/useLockBodyScroll.js +53 -0
- package/build/hooks/useLockBodyScroll.js.map +1 -0
- package/build/hooks/usePrevious.js +14 -0
- package/build/hooks/usePrevious.js.map +1 -0
- package/build/hooks/useResolvedIdentity.d.ts +70 -0
- package/build/hooks/useResolvedIdentity.js +90 -0
- package/build/hooks/useResolvedIdentity.js.map +1 -0
- package/build/hooks/useRouteProps.d.ts +10 -5
- package/build/hooks/useRouteProps.js +27 -0
- package/build/hooks/useRouteProps.js.map +1 -0
- package/build/hooks/useWalletConnectModal.js +59 -0
- package/build/hooks/useWalletConnectModal.js.map +1 -0
- package/build/hooks/useWindowSize.js +23 -0
- package/build/hooks/useWindowSize.js.map +1 -0
- package/build/index.d.ts +61 -16
- package/build/index.js +31 -0
- package/build/index.js.map +1 -0
- package/build/localizations/index.js +57 -0
- package/build/localizations/index.js.map +1 -0
- package/build/localizations/locales/ar-AE.js +100 -0
- package/build/localizations/locales/ar-AE.js.map +1 -0
- package/build/localizations/locales/ca-AD.js +98 -0
- package/build/localizations/locales/ca-AD.js.map +1 -0
- package/build/localizations/locales/ee-EE.js +98 -0
- package/build/localizations/locales/ee-EE.js.map +1 -0
- package/build/localizations/locales/en-US.js +115 -0
- package/build/localizations/locales/en-US.js.map +1 -0
- package/build/localizations/locales/es-ES.js +98 -0
- package/build/localizations/locales/es-ES.js.map +1 -0
- package/build/localizations/locales/fa-IR.js +98 -0
- package/build/localizations/locales/fa-IR.js.map +1 -0
- package/build/localizations/locales/fr-FR.js +98 -0
- package/build/localizations/locales/fr-FR.js.map +1 -0
- package/build/localizations/locales/ja-JP.js +98 -0
- package/build/localizations/locales/ja-JP.js.map +1 -0
- package/build/localizations/locales/pt-BR.js +98 -0
- package/build/localizations/locales/pt-BR.js.map +1 -0
- package/build/localizations/locales/ru-RU.js +98 -0
- package/build/localizations/locales/ru-RU.js.map +1 -0
- package/build/localizations/locales/tr-TR.js +98 -0
- package/build/localizations/locales/tr-TR.js.map +1 -0
- package/build/localizations/locales/vi-VN.js +98 -0
- package/build/localizations/locales/vi-VN.js.map +1 -0
- package/build/localizations/locales/zh-CN.js +98 -0
- package/build/localizations/locales/zh-CN.js.map +1 -0
- package/build/openfort/CoreOpenfortProvider.d.ts +9 -22
- package/build/openfort/CoreOpenfortProvider.js +389 -0
- package/build/openfort/CoreOpenfortProvider.js.map +1 -0
- package/build/{hooks/useConnectCallback.d.ts → openfort/connectCallbackTypes.d.ts} +2 -2
- package/build/openfort/context.d.ts +3 -2
- package/build/openfort/context.js +6 -0
- package/build/openfort/context.js.map +1 -0
- package/build/openfort/core/client.d.ts +2 -1
- package/build/openfort/core/client.js +23 -0
- package/build/openfort/core/client.js.map +1 -0
- package/build/openfort/hooks/useActiveAddressSync.d.ts +20 -0
- package/build/openfort/hooks/useActiveAddressSync.js +76 -0
- package/build/openfort/hooks/useActiveAddressSync.js.map +1 -0
- package/build/openfort/hooks/useAutoRecovery.d.ts +26 -0
- package/build/openfort/hooks/useAutoRecovery.js +102 -0
- package/build/openfort/hooks/useAutoRecovery.js.map +1 -0
- package/build/openfort/hooks/useEmbeddedStateMachine.d.ts +31 -0
- package/build/openfort/hooks/useEmbeddedStateMachine.js +77 -0
- package/build/openfort/hooks/useEmbeddedStateMachine.js.map +1 -0
- package/build/openfort/selectors.d.ts +9 -0
- package/build/openfort/selectors.js +15 -0
- package/build/openfort/selectors.js.map +1 -0
- package/build/openfort/store.d.ts +46 -0
- package/build/openfort/store.js +116 -0
- package/build/openfort/store.js.map +1 -0
- package/build/openfort/useOpenfort.d.ts +9 -3
- package/build/openfort/useOpenfort.js +15 -0
- package/build/openfort/useOpenfort.js.map +1 -0
- package/build/openfort/useOpenfortStore.d.ts +2 -0
- package/build/openfort/useOpenfortStore.js +13 -0
- package/build/openfort/useOpenfortStore.js.map +1 -0
- package/build/query/index.d.ts +2 -0
- package/build/query/queryKeys.d.ts +12 -0
- package/build/query/queryKeys.js +15 -0
- package/build/query/queryKeys.js.map +1 -0
- package/build/query/queryOptions.d.ts +23 -0
- package/build/query/queryOptions.js +31 -0
- package/build/query/queryOptions.js.map +1 -0
- package/build/shared/hooks/useAsyncData.d.ts +19 -0
- package/build/shared/hooks/useAsyncData.js +69 -0
- package/build/shared/hooks/useAsyncData.js.map +1 -0
- package/build/shared/hooks/useRecoveryOTP.d.ts +11 -0
- package/build/shared/hooks/useRecoveryOTP.js +64 -0
- package/build/shared/hooks/useRecoveryOTP.js.map +1 -0
- package/build/shared/types.d.ts +65 -0
- package/build/shared/utils/embeddedWalletStatusMapper.d.ts +15 -0
- package/build/shared/utils/embeddedWalletStatusMapper.js +22 -0
- package/build/shared/utils/embeddedWalletStatusMapper.js.map +1 -0
- package/build/shared/utils/explorer.d.ts +24 -0
- package/build/shared/utils/explorer.js +71 -0
- package/build/shared/utils/explorer.js.map +1 -0
- package/build/shared/utils/otpError.d.ts +8 -0
- package/build/shared/utils/otpError.js +17 -0
- package/build/shared/utils/otpError.js.map +1 -0
- package/build/shared/utils/recovery.d.ts +15 -0
- package/build/shared/utils/recovery.js +96 -0
- package/build/shared/utils/recovery.js.map +1 -0
- package/build/shared/utils/validation.d.ts +15 -0
- package/build/shared/utils/validation.js +27 -0
- package/build/shared/utils/validation.js.map +1 -0
- package/build/shared/utils/walletStatusProps.d.ts +18 -0
- package/build/shared/utils/walletStatusProps.js +45 -0
- package/build/shared/utils/walletStatusProps.js.map +1 -0
- package/build/siwe/create-siwe-message.d.ts +15 -1
- package/build/siwe/create-siwe-message.js +32 -0
- package/build/siwe/create-siwe-message.js.map +1 -0
- package/build/solana/SolanaContext.d.ts +43 -0
- package/build/solana/SolanaContext.js +87 -0
- package/build/solana/SolanaContext.js.map +1 -0
- package/build/solana/constants.d.ts +21 -0
- package/build/solana/constants.js +24 -0
- package/build/solana/constants.js.map +1 -0
- package/build/solana/hooks/recoveryResolver.d.ts +16 -0
- package/build/solana/hooks/recoveryResolver.js +39 -0
- package/build/solana/hooks/recoveryResolver.js.map +1 -0
- package/build/solana/hooks/useSolanaEmbeddedWallet.d.ts +17 -0
- package/build/solana/hooks/useSolanaEmbeddedWallet.js +389 -0
- package/build/solana/hooks/useSolanaEmbeddedWallet.js.map +1 -0
- package/build/solana/hooks/utils.d.ts +2 -0
- package/build/solana/hooks/utils.js +18 -0
- package/build/solana/hooks/utils.js.map +1 -0
- package/build/solana/index.d.ts +12 -0
- package/build/solana/index.js +2 -0
- package/build/solana/index.js.map +1 -0
- package/build/solana/operations.d.ts +22 -0
- package/build/solana/operations.js +40 -0
- package/build/solana/operations.js.map +1 -0
- package/build/solana/provider.d.ts +131 -0
- package/build/solana/provider.js +126 -0
- package/build/solana/provider.js.map +1 -0
- package/build/solana/types.d.ts +253 -0
- package/build/solana/utils/transfer.d.ts +9 -0
- package/build/solana/utils/transfer.js +20 -0
- package/build/solana/utils/transfer.js.map +1 -0
- package/build/styles/index.js +334 -0
- package/build/styles/index.js.map +1 -0
- package/build/styles/styled/index.js +14 -0
- package/build/styles/styled/index.js.map +1 -0
- package/build/styles/themes/base.js +147 -0
- package/build/styles/themes/base.js.map +1 -0
- package/build/styles/themes/index.js +13 -0
- package/build/styles/themes/index.js.map +1 -0
- package/build/styles/themes/midnight.js +78 -0
- package/build/styles/themes/midnight.js.map +1 -0
- package/build/styles/themes/minimal.js +100 -0
- package/build/styles/themes/minimal.js.map +1 -0
- package/build/styles/themes/nouns.js +83 -0
- package/build/styles/themes/nouns.js.map +1 -0
- package/build/styles/themes/retro.js +110 -0
- package/build/styles/themes/retro.js.map +1 -0
- package/build/styles/themes/rounded.js +110 -0
- package/build/styles/themes/rounded.js.map +1 -0
- package/build/styles/themes/soft.js +73 -0
- package/build/styles/themes/soft.js.map +1 -0
- package/build/styles/themes/web95.js +136 -0
- package/build/styles/themes/web95.js.map +1 -0
- package/build/types.d.ts +5 -6
- package/build/types.js +33 -0
- package/build/types.js.map +1 -0
- package/build/utils/banner.d.ts +1 -0
- package/build/utils/banner.js +14 -0
- package/build/utils/banner.js.map +1 -0
- package/build/utils/errorHandling.js +331 -0
- package/build/utils/errorHandling.js.map +1 -0
- package/build/utils/format.d.ts +18 -0
- package/build/utils/format.js +59 -0
- package/build/utils/format.js.map +1 -0
- package/build/utils/index.d.ts +2 -3
- package/build/utils/index.js +67 -0
- package/build/utils/index.js.map +1 -0
- package/build/utils/logger.js +13 -0
- package/build/utils/logger.js.map +1 -0
- package/build/utils/oauthErrorHandler.d.ts +1 -1
- package/build/utils/oauthErrorHandler.js +42 -0
- package/build/utils/oauthErrorHandler.js.map +1 -0
- package/build/utils/p3.js +14 -0
- package/build/utils/p3.js.map +1 -0
- package/build/utils/rpc.d.ts +34 -0
- package/build/utils/rpc.js +93 -0
- package/build/utils/rpc.js.map +1 -0
- package/build/utils/useOnUserReturn.js +25 -0
- package/build/utils/useOnUserReturn.js.map +1 -0
- package/build/utils/validation.js +7 -0
- package/build/utils/validation.js.map +1 -0
- package/build/utils/wallets.d.ts +6 -0
- package/build/utils/wallets.js +14 -0
- package/build/utils/wallets.js.map +1 -0
- package/build/version.d.ts +1 -1
- package/build/version.js +4 -0
- package/build/version.js.map +1 -0
- package/build/wagmi/OpenfortWagmiBridge.d.ts +3 -0
- package/build/wagmi/OpenfortWagmiBridge.js +166 -0
- package/build/wagmi/OpenfortWagmiBridge.js.map +1 -0
- package/build/wagmi/components/ChainSelect/index.js +140 -0
- package/build/wagmi/components/ChainSelect/index.js.map +1 -0
- package/build/wagmi/components/ChainSelectDropdown/index.js +144 -0
- package/build/wagmi/components/ChainSelectDropdown/index.js.map +1 -0
- package/build/wagmi/components/ChainSelectDropdown/styles.js +47 -0
- package/build/wagmi/components/ChainSelectDropdown/styles.js.map +1 -0
- package/build/wagmi/components/ChainSelectList/index.js +109 -0
- package/build/wagmi/components/ChainSelectList/index.js.map +1 -0
- package/build/wagmi/components/ChainSelectList/styles.js +225 -0
- package/build/wagmi/components/ChainSelectList/styles.js.map +1 -0
- package/build/wagmi/components/SwitchNetworks/index.js +22 -0
- package/build/wagmi/components/SwitchNetworks/index.js.map +1 -0
- package/build/wagmi/connectorFilter.d.ts +6 -0
- package/build/wagmi/connectorFilter.js +16 -0
- package/build/wagmi/connectorFilter.js.map +1 -0
- package/build/{defaultConfig.d.ts → wagmi/defaultConfig.d.ts} +1 -2
- package/build/wagmi/defaultConfig.js +27 -0
- package/build/wagmi/defaultConfig.js.map +1 -0
- package/build/wagmi/defaultConnectors.js +36 -0
- package/build/wagmi/defaultConnectors.js.map +1 -0
- package/build/wagmi/embeddedConnector.d.ts +4 -0
- package/build/wagmi/embeddedConnector.js +80 -0
- package/build/wagmi/embeddedConnector.js.map +1 -0
- package/build/wagmi/index.d.ts +10 -0
- package/build/wagmi/index.js +10 -0
- package/build/wagmi/index.js.map +1 -0
- package/build/wagmi/useChainIsSupported.d.ts +20 -0
- package/build/wagmi/useChainIsSupported.js +30 -0
- package/build/wagmi/useChainIsSupported.js.map +1 -0
- package/build/wagmi/useChains.d.ts +29 -0
- package/build/wagmi/useChains.js +38 -0
- package/build/wagmi/useChains.js.map +1 -0
- package/build/wagmi/useConnectWithSiwe.d.ts +22 -0
- package/build/wagmi/useConnectWithSiwe.js +115 -0
- package/build/wagmi/useConnectWithSiwe.js.map +1 -0
- package/build/wagmi/useEmbeddedWalletWagmiSync.d.ts +2 -0
- package/build/wagmi/useEmbeddedWalletWagmiSync.js +55 -0
- package/build/wagmi/useEmbeddedWalletWagmiSync.js.map +1 -0
- package/build/wagmi/useWalletAuth.d.ts +24 -0
- package/build/wagmi/useWalletAuth.js +180 -0
- package/build/wagmi/useWalletAuth.js.map +1 -0
- package/build/wallets/useExternalConnectors.d.ts +17 -0
- package/build/wallets/useExternalConnectors.js +98 -0
- package/build/wallets/useExternalConnectors.js.map +1 -0
- package/build/wallets/walletConfigs.js +344 -0
- package/build/wallets/walletConfigs.js.map +1 -0
- package/package.json +62 -11
- package/build/components/PageLayout/index.d.ts +0 -6
- package/build/components/contexts/web3/index.d.ts +0 -13
- package/build/constants/erc20.d.ts +0 -42
- package/build/hooks/openfort/auth/useWalletAuth.d.ts +0 -20
- package/build/hooks/openfort/useConnectWithSiwe.d.ts +0 -8
- package/build/hooks/openfort/useWalletAssets.d.ts +0 -16
- package/build/hooks/openfort/useWallets.d.ts +0 -134
- package/build/hooks/useChainIsSupported.d.ts +0 -24
- package/build/hooks/useChains.d.ts +0 -41
- package/build/hooks/useConnect.d.ts +0 -24
- package/build/hooks/useEnsFallbackConfig.d.ts +0 -1
- package/build/index.es.js +0 -19620
- package/build/index.es.js.map +0 -1
- package/build/openfortCustomTypes.d.ts +0 -10
- package/build/wallets/index.d.ts +0 -7
- package/build/wallets/useWagmiWallets.d.ts +0 -9
- /package/build/components/Pages/{SoicalProviders → SocialProviders}/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelect/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectDropdown/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectDropdown/styles.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectList/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectList/styles.d.ts +0 -0
- /package/build/{components/Pages → wagmi/components}/SwitchNetworks/index.d.ts +0 -0
- /package/build/{defaultConnectors.d.ts → wagmi/defaultConnectors.d.ts} +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { ChainTypeEnum } from '@openfort/openfort-js';
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
import { useEthereumEmbeddedWallet } from '../../../ethereum/hooks/useEthereumEmbeddedWallet.js';
|
|
5
|
+
import { toSolanaUserWallet } from '../../../hooks/openfort/walletTypes.js';
|
|
6
|
+
import { useOpenfortCore } from '../../../openfort/useOpenfort.js';
|
|
7
|
+
import { useSolanaEmbeddedWallet } from '../../../solana/hooks/useSolanaEmbeddedWallet.js';
|
|
8
|
+
import { logger } from '../../../utils/logger.js';
|
|
9
|
+
import Loader from '../../Common/Loading/index.js';
|
|
10
|
+
import { recoverRoute, createRoute } from '../../Openfort/routeHelpers.js';
|
|
11
|
+
import { routes } from '../../Openfort/types.js';
|
|
12
|
+
import { useOpenfort } from '../../Openfort/useOpenfort.js';
|
|
13
|
+
import { PageContent } from '../../PageContent/index.js';
|
|
14
|
+
|
|
15
|
+
const handleSingleWalletRegistry = {
|
|
16
|
+
[ChainTypeEnum.SVM]: (w, chainType, setRoute) => {
|
|
17
|
+
const walletForRoute = toSolanaUserWallet(w);
|
|
18
|
+
setRoute(recoverRoute(chainType, walletForRoute));
|
|
19
|
+
},
|
|
20
|
+
[ChainTypeEnum.EVM]: (w, chainType, setRoute) => {
|
|
21
|
+
setRoute(recoverRoute(chainType, w));
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
const errorForChainRegistry = {
|
|
25
|
+
[ChainTypeEnum.SVM]: () => ({ isError: false, message: undefined }),
|
|
26
|
+
[ChainTypeEnum.EVM]: (errorWallets) => ({
|
|
27
|
+
isError: !!errorWallets,
|
|
28
|
+
message: (errorWallets === null || errorWallets === void 0 ? void 0 : errorWallets.message) || 'There was an error loading wallets',
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
const LoadWallets = () => {
|
|
32
|
+
const { chainType } = useOpenfortCore();
|
|
33
|
+
const { user } = useOpenfortCore();
|
|
34
|
+
const { triggerResize, setRoute, setConnector } = useOpenfort();
|
|
35
|
+
const ethereumWallet = useEthereumEmbeddedWallet();
|
|
36
|
+
const solanaWallet = useSolanaEmbeddedWallet();
|
|
37
|
+
const embeddedWallet = chainType === ChainTypeEnum.EVM ? ethereumWallet : solanaWallet;
|
|
38
|
+
const [loadingUX, setLoadingUX] = useState(true);
|
|
39
|
+
const wallets = embeddedWallet.wallets;
|
|
40
|
+
const isLoadingWallets = embeddedWallet.status === 'fetching-wallets' ||
|
|
41
|
+
embeddedWallet.status === 'connecting' ||
|
|
42
|
+
embeddedWallet.status === 'creating';
|
|
43
|
+
const errorWallets = embeddedWallet.status === 'error' ? new Error(embeddedWallet.error) : undefined;
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
let timeout;
|
|
46
|
+
if (!isLoadingWallets) {
|
|
47
|
+
timeout = setTimeout(() => {
|
|
48
|
+
setLoadingUX(false);
|
|
49
|
+
triggerResize();
|
|
50
|
+
}, 500);
|
|
51
|
+
}
|
|
52
|
+
return () => clearTimeout(timeout);
|
|
53
|
+
}, [isLoadingWallets, triggerResize]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (loadingUX)
|
|
56
|
+
return;
|
|
57
|
+
if (isLoadingWallets)
|
|
58
|
+
return;
|
|
59
|
+
if (!wallets) {
|
|
60
|
+
logger.error('Could not load wallets for user:', user);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
logger.log('User wallets loaded:', wallets.length);
|
|
64
|
+
if (wallets.length === 0) {
|
|
65
|
+
setRoute(createRoute(chainType));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (wallets.length === 1) {
|
|
69
|
+
const single = wallets[0];
|
|
70
|
+
const alreadyActive = embeddedWallet.status === 'connected' &&
|
|
71
|
+
embeddedWallet.address &&
|
|
72
|
+
(chainType === ChainTypeEnum.SVM
|
|
73
|
+
? embeddedWallet.address === single.address
|
|
74
|
+
: embeddedWallet.address.toLowerCase() === single.address.toLowerCase());
|
|
75
|
+
if (alreadyActive) {
|
|
76
|
+
setRoute(chainType === ChainTypeEnum.SVM ? routes.SOL_CONNECTED : routes.ETH_CONNECTED);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
handleSingleWalletRegistry[chainType](single, chainType, setRoute, setConnector);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
setRoute(routes.SELECT_WALLET_TO_RECOVER);
|
|
83
|
+
}, [loadingUX, isLoadingWallets, wallets, user, chainType, setRoute, setConnector]);
|
|
84
|
+
const { isError: isErrorFromChain, message: errorMessageFromChain } = errorForChainRegistry[chainType](errorWallets);
|
|
85
|
+
const isError = !user || isErrorFromChain;
|
|
86
|
+
const errorMessage = !user ? undefined : errorMessageFromChain;
|
|
87
|
+
return (jsx(PageContent, { onBack: !user ? 'back' : null, children: jsx(Loader, { header: "Setting up wallet", isError: isError, description: isError ? errorMessage : 'Setting up wallets' }) }));
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export { LoadWallets as default };
|
|
91
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { ChainTypeEnum } from '@openfort/openfort-js';
|
|
3
|
+
import React, { useEffect } from 'react';
|
|
4
|
+
import { useEthereumEmbeddedWallet } from '../../../ethereum/hooks/useEthereumEmbeddedWallet.js';
|
|
5
|
+
import { useOpenfortCore } from '../../../openfort/useOpenfort.js';
|
|
6
|
+
import { useSolanaEmbeddedWallet } from '../../../solana/hooks/useSolanaEmbeddedWallet.js';
|
|
7
|
+
import Loader from '../../Common/Loading/index.js';
|
|
8
|
+
import { routes } from '../../Openfort/types.js';
|
|
9
|
+
import { useOpenfort } from '../../Openfort/useOpenfort.js';
|
|
10
|
+
import { PageContent } from '../../PageContent/index.js';
|
|
11
|
+
|
|
12
|
+
const Loading = () => {
|
|
13
|
+
const { setRoute, walletConfig } = useOpenfort();
|
|
14
|
+
const { user, isLoadingAccounts, needsRecovery } = useOpenfortCore();
|
|
15
|
+
const { chainType } = useOpenfortCore();
|
|
16
|
+
// Use chain-specific hooks
|
|
17
|
+
const ethereumWallet = useEthereumEmbeddedWallet();
|
|
18
|
+
const solanaWallet = useSolanaEmbeddedWallet();
|
|
19
|
+
const wallet = chainType === ChainTypeEnum.EVM ? ethereumWallet : solanaWallet;
|
|
20
|
+
const isConnected = wallet.status === 'connected';
|
|
21
|
+
const address = isConnected ? wallet.address : undefined;
|
|
22
|
+
const [isFirstFrame, setIsFirstFrame] = React.useState(true);
|
|
23
|
+
const [retryCount, setRetryCount] = React.useState(0);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (isFirstFrame)
|
|
26
|
+
return;
|
|
27
|
+
if (isLoadingAccounts)
|
|
28
|
+
return;
|
|
29
|
+
else if (!user)
|
|
30
|
+
setRoute(routes.PROVIDERS);
|
|
31
|
+
else if (!address) {
|
|
32
|
+
if (!walletConfig)
|
|
33
|
+
setRoute({ route: routes.CONNECTORS, connectType: 'connect' });
|
|
34
|
+
else
|
|
35
|
+
setRoute(routes.LOAD_WALLETS);
|
|
36
|
+
}
|
|
37
|
+
else if (needsRecovery) {
|
|
38
|
+
if (!walletConfig)
|
|
39
|
+
setRoute({ route: routes.CONNECTORS, connectType: 'connect' });
|
|
40
|
+
else
|
|
41
|
+
setRoute(routes.LOAD_WALLETS);
|
|
42
|
+
}
|
|
43
|
+
else
|
|
44
|
+
setRoute(routes.CONNECTED);
|
|
45
|
+
}, [isLoadingAccounts, user, address, needsRecovery, isFirstFrame, retryCount]);
|
|
46
|
+
// Retry every 250ms
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
const interval = setInterval(() => {
|
|
49
|
+
setRetryCount((r) => r + 1);
|
|
50
|
+
}, 250);
|
|
51
|
+
return () => clearInterval(interval);
|
|
52
|
+
}, []);
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
// UX: Wait a bit before showing the next page
|
|
55
|
+
setTimeout(() => setIsFirstFrame(false), 400);
|
|
56
|
+
}, []);
|
|
57
|
+
return (jsx(PageContent, { children: jsx(Loader, { header: "Redirecting" }) }));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { Loading as default };
|
|
61
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import useLocales from '../../../hooks/useLocales.js';
|
|
3
|
+
import { useWalletConnectModal } from '../../../hooks/useWalletConnectModal.js';
|
|
4
|
+
import { useExternalConnectors } from '../../../wallets/useExternalConnectors.js';
|
|
5
|
+
import { walletConfigs } from '../../../wallets/walletConfigs.js';
|
|
6
|
+
import { CopyButton } from '../../Common/CopyToClipboard/CopyButton.js';
|
|
7
|
+
import { ModalContent } from '../../Common/Modal/styles.js';
|
|
8
|
+
import { ScrollArea } from '../../Common/ScrollArea/index.js';
|
|
9
|
+
import { Spinner } from '../../Common/Spinner/index.js';
|
|
10
|
+
import { routes } from '../../Openfort/types.js';
|
|
11
|
+
import { useOpenfort } from '../../Openfort/useOpenfort.js';
|
|
12
|
+
import { PageContent } from '../../PageContent/index.js';
|
|
13
|
+
import { Container, WalletList, WalletItem, WalletIcon, WalletLabel } from './styles.js';
|
|
14
|
+
|
|
15
|
+
const MoreIcon = (jsxs("svg", { width: "60", height: "60", viewBox: "0 0 60 60", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("title", { children: "More wallets icon" }), jsx("path", { d: "M30 42V19M19 30.5H42", stroke: "var(--ck-body-color-muted)", strokeWidth: "3", strokeLinecap: "round" })] }));
|
|
16
|
+
const MobileConnectors = () => {
|
|
17
|
+
var _a;
|
|
18
|
+
const context = useOpenfort();
|
|
19
|
+
const locales = useLocales();
|
|
20
|
+
const { open: openW3M, isOpen: isOpenW3M } = useWalletConnectModal();
|
|
21
|
+
const wallets = useExternalConnectors();
|
|
22
|
+
// filter out installed wallets
|
|
23
|
+
const walletsIdsToDisplay = (_a = Object.keys(walletConfigs).filter((walletId) => {
|
|
24
|
+
const wallet = walletConfigs[walletId];
|
|
25
|
+
if (wallets.find((w) => w.connector.id === walletId))
|
|
26
|
+
return false;
|
|
27
|
+
if (!wallet.getWalletConnectDeeplink)
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
})) !== null && _a !== void 0 ? _a : [];
|
|
31
|
+
const connectWallet = (walletId) => {
|
|
32
|
+
context.setRoute(routes.CONNECT_WITH_MOBILE);
|
|
33
|
+
context.setConnector({ id: walletId });
|
|
34
|
+
};
|
|
35
|
+
return (jsx(PageContent, { width: 312, onBack: routes.PROVIDERS, children: jsxs(Container, { children: [jsx(ModalContent, { style: { paddingBottom: 0 }, children: jsx(ScrollArea, { height: 340, children: jsxs(WalletList, { children: [walletsIdsToDisplay
|
|
36
|
+
.sort(
|
|
37
|
+
// sort by name
|
|
38
|
+
(a, b) => {
|
|
39
|
+
var _a, _b, _c, _d;
|
|
40
|
+
const walletA = walletConfigs[a];
|
|
41
|
+
const walletB = walletConfigs[b];
|
|
42
|
+
const nameA = (_b = (_a = walletA.name) !== null && _a !== void 0 ? _a : walletA.shortName) !== null && _b !== void 0 ? _b : a;
|
|
43
|
+
const nameB = (_d = (_c = walletB.name) !== null && _c !== void 0 ? _c : walletB.shortName) !== null && _d !== void 0 ? _d : b;
|
|
44
|
+
return nameA.localeCompare(nameB);
|
|
45
|
+
})
|
|
46
|
+
.filter((walletId) => !(walletId === 'coinbaseWallet' || walletId === 'com.coinbase.wallet'))
|
|
47
|
+
.map((walletId, i) => {
|
|
48
|
+
const wallet = walletConfigs[walletId];
|
|
49
|
+
const { name, shortName, iconConnector, icon } = wallet;
|
|
50
|
+
return (jsxs(WalletItem, { onClick: () => connectWallet(walletId), style: {
|
|
51
|
+
animationDelay: `${i * 50}ms`,
|
|
52
|
+
}, children: [jsx(WalletIcon, { "$outline": true, children: iconConnector !== null && iconConnector !== void 0 ? iconConnector : icon }), jsx(WalletLabel, { children: shortName !== null && shortName !== void 0 ? shortName : name })] }, walletId));
|
|
53
|
+
}), jsxs(WalletItem, { onClick: openW3M, "$waiting": isOpenW3M, children: [jsx(WalletIcon, { style: { background: 'var(--ck-body-background-secondary)' }, children: isOpenW3M ? (jsx("div", { style: {
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
inset: 0,
|
|
56
|
+
display: 'flex',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
justifyContent: 'center',
|
|
59
|
+
}, children: jsx("div", { style: {
|
|
60
|
+
width: '50%',
|
|
61
|
+
}, children: jsx(Spinner, {}) }) })) : (MoreIcon) }), jsx(WalletLabel, { children: locales.more })] })] }) }) }), context.uiConfig.walletConnectCTA !== 'modal' && (jsx("div", { style: {
|
|
62
|
+
display: 'flex',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
justifyContent: 'center',
|
|
65
|
+
gap: 14,
|
|
66
|
+
paddingTop: 8,
|
|
67
|
+
}, children: jsx(CopyButton, { value: "", children: locales.copyToClipboard }) }))] }) }));
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export { MobileConnectors as default };
|
|
71
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { keyframes, css } from 'styled-components';
|
|
2
|
+
import styled from '../../../styles/styled/index.js';
|
|
3
|
+
|
|
4
|
+
const WalletItem = styled.div `
|
|
5
|
+
text-align: center;
|
|
6
|
+
transition: opacity 100ms ease;
|
|
7
|
+
opacity: ${(props) => (props.$waiting ? 0.4 : 1)};
|
|
8
|
+
`;
|
|
9
|
+
const WalletIcon = styled.div `
|
|
10
|
+
z-index: 9;
|
|
11
|
+
position: relative;
|
|
12
|
+
margin: 0 auto 10px;
|
|
13
|
+
border-radius: 16px;
|
|
14
|
+
width: 60px;
|
|
15
|
+
height: 60px;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
background: rgba(0, 0, 0, 0.04);
|
|
18
|
+
${(props) => props.$outline &&
|
|
19
|
+
`
|
|
20
|
+
&:before {
|
|
21
|
+
content: '';
|
|
22
|
+
z-index: 2;
|
|
23
|
+
position: absolute;
|
|
24
|
+
inset: 0;
|
|
25
|
+
border-radius: inherit;
|
|
26
|
+
box-shadow: inset 0 0 0 1px var(--ck-body-background-tertiary);
|
|
27
|
+
}`}
|
|
28
|
+
svg {
|
|
29
|
+
display: block;
|
|
30
|
+
position: relative;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: auto;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
const WalletLabel = styled.div `
|
|
36
|
+
color: var(--ck-body-color);
|
|
37
|
+
font-size: 13px;
|
|
38
|
+
line-height: 15px;
|
|
39
|
+
font-weight: 500;
|
|
40
|
+
opacity: 0.75;
|
|
41
|
+
`;
|
|
42
|
+
const PulseKeyframes = keyframes `
|
|
43
|
+
0%,100% { opacity:1; }
|
|
44
|
+
50% { opacity:0.5; }
|
|
45
|
+
`;
|
|
46
|
+
const WalletList = styled.div `
|
|
47
|
+
display: grid;
|
|
48
|
+
grid-template-columns: repeat(4, 1fr);
|
|
49
|
+
gap: 22px 8px;
|
|
50
|
+
margin: 0 -10px;
|
|
51
|
+
padding: 4px 0 0;
|
|
52
|
+
transition: opacity 300ms ease;
|
|
53
|
+
${(props) => props.$disabled &&
|
|
54
|
+
css `
|
|
55
|
+
pointer-events: none;
|
|
56
|
+
opacity: 0.4;
|
|
57
|
+
${WalletItem} {
|
|
58
|
+
animation: ${PulseKeyframes} 1s infinite ease-in-out;
|
|
59
|
+
}
|
|
60
|
+
`}
|
|
61
|
+
`;
|
|
62
|
+
const Container = styled.div ``;
|
|
63
|
+
|
|
64
|
+
export { Container, WalletIcon, WalletItem, WalletLabel, WalletList };
|
|
65
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { ChainTypeEnum } from '@openfort/openfort-js';
|
|
3
|
+
import { BuyIcon, DollarIcon, ReceiveIcon } from '../../../assets/icons.js';
|
|
4
|
+
import { useEthereumEmbeddedWallet } from '../../../ethereum/hooks/useEthereumEmbeddedWallet.js';
|
|
5
|
+
import { useOpenfortCore } from '../../../openfort/useOpenfort.js';
|
|
6
|
+
import { useSolanaEmbeddedWallet } from '../../../solana/hooks/useSolanaEmbeddedWallet.js';
|
|
7
|
+
import Button from '../../Common/Button/index.js';
|
|
8
|
+
import { ModalContent, ModalH1, ModalBody } from '../../Common/Modal/styles.js';
|
|
9
|
+
import { FloatingGraphic } from '../../FloatingGraphic/index.js';
|
|
10
|
+
import { routes } from '../../Openfort/types.js';
|
|
11
|
+
import { useOpenfort } from '../../Openfort/useOpenfort.js';
|
|
12
|
+
import { PageContent } from '../../PageContent/index.js';
|
|
13
|
+
import { ButtonsContainer } from './styles.js';
|
|
14
|
+
|
|
15
|
+
const NoAssetsAvailable = () => {
|
|
16
|
+
const { setRoute, chains } = useOpenfort();
|
|
17
|
+
const { chainType } = useOpenfortCore();
|
|
18
|
+
// Use chain-specific hooks
|
|
19
|
+
const ethereumWallet = useEthereumEmbeddedWallet();
|
|
20
|
+
const solanaWallet = useSolanaEmbeddedWallet();
|
|
21
|
+
const wallet = chainType === ChainTypeEnum.EVM ? ethereumWallet : solanaWallet;
|
|
22
|
+
const chainId = wallet.status === 'connected' && chainType === ChainTypeEnum.EVM
|
|
23
|
+
? wallet.chainId
|
|
24
|
+
: undefined;
|
|
25
|
+
const chain = chains.find((c) => c.id === chainId);
|
|
26
|
+
const showBuyOption = chain && !chain.testnet;
|
|
27
|
+
return (jsxs(PageContent, { children: [jsx(FloatingGraphic, { height: "190px", logoCenter: {
|
|
28
|
+
logo: jsx(BuyIcon, {}),
|
|
29
|
+
}, logoTopLeft: {
|
|
30
|
+
logo: jsx(BuyIcon, {}),
|
|
31
|
+
}, logoBottomRight: {
|
|
32
|
+
logo: jsx(BuyIcon, {}),
|
|
33
|
+
}, logoTopRight: {
|
|
34
|
+
logo: jsx(DollarIcon, {}),
|
|
35
|
+
}, logoBottomLeft: {
|
|
36
|
+
logo: jsx(DollarIcon, {}),
|
|
37
|
+
} }), jsxs(ModalContent, { style: { paddingBottom: 0 }, children: [jsx(ModalH1, { "$small": true, children: "No assets available" }), jsxs(ModalBody, { children: [jsx("div", { style: { paddingRight: 12, paddingLeft: 12 }, children: "You currently have no assets available in your wallet." }), jsxs(ButtonsContainer, { children: [jsx(Button, { onClick: () => {
|
|
38
|
+
setRoute(routes.RECEIVE);
|
|
39
|
+
}, icon: jsx(ReceiveIcon, {}), children: "Get assets" }), showBuyOption && (jsx(Button, { onClick: () => {
|
|
40
|
+
setRoute(routes.BUY);
|
|
41
|
+
}, icon: jsx(BuyIcon, {}), children: "Buy assets" }))] })] })] })] }));
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export { NoAssetsAvailable };
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import Logos from '../../../assets/logos.js';
|
|
3
|
+
import wave from '../../../assets/wave.js';
|
|
4
|
+
import useLocales from '../../../hooks/useLocales.js';
|
|
5
|
+
import Button from '../../Common/Button/index.js';
|
|
6
|
+
import { ModalContent, ModalH1, ModalBody } from '../../Common/Modal/styles.js';
|
|
7
|
+
import { Graphic, LogoGroup, Logo, LogoPosition, LogoInner, FloatWrapper, RotateWrapper, LogoGraphic, GraphicBackground } from '../../FloatingGraphic/styles.js';
|
|
8
|
+
import { useOpenfort } from '../../Openfort/useOpenfort.js';
|
|
9
|
+
import { PageContent } from '../../PageContent/index.js';
|
|
10
|
+
|
|
11
|
+
const Introduction = () => {
|
|
12
|
+
var _a;
|
|
13
|
+
const context = useOpenfort();
|
|
14
|
+
const locales = useLocales({});
|
|
15
|
+
const ctaUrl = (_a = context.uiConfig.walletOnboardingUrl) !== null && _a !== void 0 ? _a : locales.onboardingScreen_ctaUrl;
|
|
16
|
+
return (jsxs(PageContent, { children: [jsxs(Graphic, { children: [jsxs(LogoGroup, { children: [jsx(Logo, { children: jsx(LogoPosition, { children: jsx(LogoInner, { children: jsx(FloatWrapper, { children: jsx(RotateWrapper, { children: jsx(LogoGraphic, { children: jsx(Logos.Coinbase, { background: true }) }) }) }) }) }) }), jsx(Logo, { children: jsx(LogoPosition, { children: jsx(LogoInner, { children: jsx(FloatWrapper, { children: jsx(RotateWrapper, { children: jsx(LogoGraphic, { children: jsx(Logos.MetaMask, { background: true }) }) }) }) }) }) }), jsx(Logo, { children: jsx(LogoPosition, { children: jsx(LogoInner, { children: jsx(FloatWrapper, { children: jsx(RotateWrapper, { children: jsx(LogoGraphic, { children: jsx(Logos.Trust, {}) }) }) }) }) }) }), jsx(Logo, { children: jsx(LogoPosition, { children: jsx(LogoInner, { children: jsx(FloatWrapper, { children: jsx(RotateWrapper, { children: jsx(LogoGraphic, { children: jsx(Logos.Argent, {}) }) }) }) }) }) }), jsx(Logo, { children: jsx(LogoPosition, { children: jsx(LogoInner, { children: jsx(FloatWrapper, { children: jsx(RotateWrapper, { children: jsx(LogoGraphic, { children: jsx(Logos.ImToken, {}) }) }) }) }) }) })] }), jsx(GraphicBackground, { children: wave })] }), jsxs(ModalContent, { style: { paddingBottom: 18 }, children: [jsx(ModalH1, { "$small": true, children: locales.onboardingScreen_h1 }), jsx(ModalBody, { children: locales.onboardingScreen_p })] }), jsx(Button, { href: ctaUrl, arrow: true, children: locales.onboardingScreen_ctaText })] }));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { Introduction as default };
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef, useCallback, useEffect, useMemo } from 'react';
|
|
3
|
+
import { PhoneIcon } from '../../../assets/icons.js';
|
|
4
|
+
import { usePhoneOtpAuth } from '../../../hooks/openfort/auth/usePhoneOtpAuth.js';
|
|
5
|
+
import { useUser } from '../../../hooks/openfort/useUser.js';
|
|
6
|
+
import { logger } from '../../../utils/logger.js';
|
|
7
|
+
import { ModalHeading, ModalBody } from '../../Common/Modal/styles.js';
|
|
8
|
+
import { OtpInputStandalone } from '../../Common/OTPInput/index.js';
|
|
9
|
+
import PoweredByFooter from '../../Common/PoweredByFooter/index.js';
|
|
10
|
+
import { FloatingGraphic } from '../../FloatingGraphic/index.js';
|
|
11
|
+
import { routes } from '../../Openfort/types.js';
|
|
12
|
+
import { useOpenfort } from '../../Openfort/useOpenfort.js';
|
|
13
|
+
import { PageContent } from '../../PageContent/index.js';
|
|
14
|
+
import { Body, ResultContainer, FooterTextButton, FooterButtonText } from './styles.js';
|
|
15
|
+
|
|
16
|
+
const RESEND_COOLDOWN_MS = 10000;
|
|
17
|
+
const SUCCESS_REDIRECT_DELAY_MS = 2000;
|
|
18
|
+
const ERROR_DISPLAY_DURATION_MS = 2000;
|
|
19
|
+
const PhoneOTP = () => {
|
|
20
|
+
const { phoneInput: phone, setPhoneInput, setRoute } = useOpenfort();
|
|
21
|
+
const { isLoading, requestPhoneOtp, logInWithPhoneOtp, linkPhoneOtp } = usePhoneOtpAuth({
|
|
22
|
+
recoverWalletAutomatically: false,
|
|
23
|
+
});
|
|
24
|
+
const { user } = useUser();
|
|
25
|
+
const [canSendOtp, setCanSendOtp] = useState(true);
|
|
26
|
+
const [status, setStatus] = useState('idle');
|
|
27
|
+
const [errorMessage, setErrorMessage] = useState(null);
|
|
28
|
+
// Single ref to track if initial OTP request has been made
|
|
29
|
+
const hasRequestedInitialOtpRef = useRef(false);
|
|
30
|
+
// Memoize the OTP request function to prevent unnecessary recreations
|
|
31
|
+
const sendOtpRequest = useCallback(async () => {
|
|
32
|
+
const { error } = await requestPhoneOtp({ phoneNumber: phone });
|
|
33
|
+
if (error) {
|
|
34
|
+
logger.error('Error requesting phone OTP:', error);
|
|
35
|
+
setStatus('error');
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
setStatus('idle');
|
|
39
|
+
}
|
|
40
|
+
}, [phone, requestPhoneOtp]);
|
|
41
|
+
// Initial OTP request on mount
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (hasRequestedInitialOtpRef.current)
|
|
44
|
+
return;
|
|
45
|
+
hasRequestedInitialOtpRef.current = true;
|
|
46
|
+
sendOtpRequest();
|
|
47
|
+
}, [sendOtpRequest]);
|
|
48
|
+
// Handle OTP completion
|
|
49
|
+
const handleComplete = useCallback(async (otp) => {
|
|
50
|
+
logger.log('OTP entered:', otp);
|
|
51
|
+
setStatus('loading');
|
|
52
|
+
let error = null;
|
|
53
|
+
if (user) {
|
|
54
|
+
const { error: linkError } = await linkPhoneOtp({ phoneNumber: phone, otp });
|
|
55
|
+
error = linkError;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const { error: loginError } = await logInWithPhoneOtp({ phoneNumber: phone, otp });
|
|
59
|
+
error = loginError;
|
|
60
|
+
}
|
|
61
|
+
if (error) {
|
|
62
|
+
logger.error('Error verifying phone OTP:', error);
|
|
63
|
+
setStatus('error');
|
|
64
|
+
if (error.message === 'Invalid OTP') {
|
|
65
|
+
setErrorMessage('Invalid code. Please try again.');
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
setErrorMessage('Verification failed. Please try again.');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
setStatus('success');
|
|
73
|
+
}
|
|
74
|
+
}, [phone, logInWithPhoneOtp]);
|
|
75
|
+
// Handle status changes and side effects
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
let timeoutId;
|
|
78
|
+
switch (status) {
|
|
79
|
+
case 'send-otp':
|
|
80
|
+
setStatus('sending-otp');
|
|
81
|
+
sendOtpRequest();
|
|
82
|
+
break;
|
|
83
|
+
case 'success':
|
|
84
|
+
timeoutId = setTimeout(() => {
|
|
85
|
+
setPhoneInput('');
|
|
86
|
+
setRoute(routes.LOAD_WALLETS);
|
|
87
|
+
}, SUCCESS_REDIRECT_DELAY_MS);
|
|
88
|
+
break;
|
|
89
|
+
case 'error':
|
|
90
|
+
timeoutId = setTimeout(() => {
|
|
91
|
+
setStatus('idle');
|
|
92
|
+
}, ERROR_DISPLAY_DURATION_MS);
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
return () => {
|
|
96
|
+
if (timeoutId)
|
|
97
|
+
clearTimeout(timeoutId);
|
|
98
|
+
};
|
|
99
|
+
}, [status, sendOtpRequest, setPhoneInput, setRoute]);
|
|
100
|
+
// Handle resend cooldown
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
if (canSendOtp)
|
|
103
|
+
return;
|
|
104
|
+
const timerId = setTimeout(() => {
|
|
105
|
+
setCanSendOtp(true);
|
|
106
|
+
}, RESEND_COOLDOWN_MS);
|
|
107
|
+
return () => clearTimeout(timerId);
|
|
108
|
+
}, [canSendOtp]);
|
|
109
|
+
// Memoize button text to avoid recalculation
|
|
110
|
+
const sendButtonText = useMemo(() => {
|
|
111
|
+
if (!canSendOtp)
|
|
112
|
+
return 'Code Sent!';
|
|
113
|
+
if (status === 'sending-otp')
|
|
114
|
+
return 'Sending...';
|
|
115
|
+
return 'Resend Code';
|
|
116
|
+
}, [canSendOtp, status]);
|
|
117
|
+
const handleResendClick = useCallback(() => {
|
|
118
|
+
setStatus('send-otp');
|
|
119
|
+
setCanSendOtp(false);
|
|
120
|
+
}, []);
|
|
121
|
+
const isResendDisabled = !canSendOtp || status === 'sending-otp' || status === 'send-otp';
|
|
122
|
+
return (jsxs(PageContent, { children: [jsx(ModalHeading, { children: "Enter your code" }), jsx(FloatingGraphic, { height: "100px", marginTop: "8px", marginBottom: "10px", logoCenter: {
|
|
123
|
+
logo: jsx(PhoneIcon, {}),
|
|
124
|
+
} }), jsxs(ModalBody, { children: [jsxs(Body, { children: ["Please check ", jsx("b", { children: phone }), " for an SMS and enter your code below."] }), jsx(OtpInputStandalone, { onComplete: handleComplete, isLoading: status === 'loading' || isLoading, isError: status === 'error', isSuccess: status === 'success' }), jsxs(ResultContainer, { children: [status === 'success' && jsx(ModalBody, { "$valid": true, children: "Code verified successfully!" }), status === 'error' && jsx(ModalBody, { "$error": true, children: errorMessage || 'Invalid code. Please try again.' })] }), jsxs(FooterTextButton, { children: ["Didn't receive the code?", ' ', jsx(FooterButtonText, { type: "button", onClick: handleResendClick, disabled: isResendDisabled, children: sendButtonText })] })] }), jsx(PoweredByFooter, {})] }));
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export { PhoneOTP as default };
|
|
128
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import styled from '../../../styles/styled/index.js';
|
|
2
|
+
|
|
3
|
+
const Body = styled.p `
|
|
4
|
+
color: var(--ck-body-color);
|
|
5
|
+
text-align: center;
|
|
6
|
+
margin-bottom: 16px;
|
|
7
|
+
`;
|
|
8
|
+
const ResultContainer = styled.div `
|
|
9
|
+
margin-top: 16px;
|
|
10
|
+
height: 24px;
|
|
11
|
+
text-align: center;
|
|
12
|
+
`;
|
|
13
|
+
const FooterButtonText = styled.button `
|
|
14
|
+
background: none;
|
|
15
|
+
border: none;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
padding: 0;
|
|
18
|
+
color: var(--ck-body-color-muted);
|
|
19
|
+
transition: color 0.3s;
|
|
20
|
+
|
|
21
|
+
&:disabled {
|
|
22
|
+
color: var(--ck-body-color-muted) !important;
|
|
23
|
+
cursor: not-allowed;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
const FooterTextButton = styled.p `
|
|
27
|
+
color: var(--ck-body-color-muted);
|
|
28
|
+
text-align: center;
|
|
29
|
+
margin-top: 16px;
|
|
30
|
+
&:hover {
|
|
31
|
+
${FooterButtonText} {
|
|
32
|
+
color: var(--ck-body-color);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
export { Body, FooterButtonText, FooterTextButton, ResultContainer };
|
|
38
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { GuestIcon, KeyIcon, DisconnectIcon } from '../../../assets/icons.js';
|
|
4
|
+
import useLocales from '../../../hooks/useLocales.js';
|
|
5
|
+
import { useOpenfortCore } from '../../../openfort/useOpenfort.js';
|
|
6
|
+
import { LargeButton } from '../../Common/LargeButton/index.js';
|
|
7
|
+
import { ModalContent, ModalHeading } from '../../Common/Modal/styles.js';
|
|
8
|
+
import { routes } from '../../Openfort/types.js';
|
|
9
|
+
import { useOpenfort } from '../../Openfort/useOpenfort.js';
|
|
10
|
+
import { PageContent } from '../../PageContent/index.js';
|
|
11
|
+
import { DisconnectButton } from '../Connected/styles.js';
|
|
12
|
+
|
|
13
|
+
const Profile = () => {
|
|
14
|
+
const { setOpen, setRoute } = useOpenfort();
|
|
15
|
+
const { logout } = useOpenfortCore();
|
|
16
|
+
const locales = useLocales();
|
|
17
|
+
const [shouldDisconnect, setShouldDisconnect] = useState(false);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!shouldDisconnect)
|
|
20
|
+
return;
|
|
21
|
+
// Close before disconnecting to avoid layout shifting while modal is still open
|
|
22
|
+
setOpen(false);
|
|
23
|
+
return () => {
|
|
24
|
+
logout();
|
|
25
|
+
};
|
|
26
|
+
}, [shouldDisconnect, setOpen, logout]);
|
|
27
|
+
return (jsxs(PageContent, { onBack: routes.CONNECTED, children: [jsxs(ModalContent, { children: [jsx(ModalHeading, { children: "Profile" }), jsxs("div", { children: [jsx(LargeButton, { onClick: () => {
|
|
28
|
+
setRoute(routes.LINKED_PROVIDERS);
|
|
29
|
+
}, icon: jsx(GuestIcon, {}), children: "Authentication methods" }), jsx(LargeButton, { onClick: () => {
|
|
30
|
+
setRoute(routes.EXPORT_KEY);
|
|
31
|
+
}, icon: jsx(KeyIcon, {}), children: "Export key" })] })] }), jsx(DisconnectButton, { onClick: () => setShouldDisconnect(true), icon: jsx(DisconnectIcon, {}), children: locales.disconnect })] }));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { Profile as default };
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|