@openfort/react 0.3.2 → 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 +2 -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 -19627
- 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,118 @@
|
|
|
1
|
+
import { motion } from 'framer-motion';
|
|
2
|
+
import { css } from 'styled-components';
|
|
3
|
+
import styled from '../../../../styles/styled/index.js';
|
|
4
|
+
|
|
5
|
+
const LogoContainer = styled(motion.div) `
|
|
6
|
+
z-index: 4;
|
|
7
|
+
position: relative;
|
|
8
|
+
width: 100px;
|
|
9
|
+
height: 100px;
|
|
10
|
+
svg {
|
|
11
|
+
z-index: 3;
|
|
12
|
+
position: relative;
|
|
13
|
+
display: block;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
const Logo = styled(motion.div) `
|
|
17
|
+
z-index: 2;
|
|
18
|
+
position: absolute;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
inset: 6px;
|
|
21
|
+
border-radius: 50px;
|
|
22
|
+
background: var(--ck-body-background);
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
svg,
|
|
27
|
+
img {
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
display: block;
|
|
30
|
+
margin: 0 auto;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
${(props) => props.$small &&
|
|
34
|
+
css `
|
|
35
|
+
width: 85%;
|
|
36
|
+
height: 85%;
|
|
37
|
+
`}
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
const SpinnerContainer = styled(motion.div) `
|
|
41
|
+
position: absolute;
|
|
42
|
+
inset: -5px;
|
|
43
|
+
`;
|
|
44
|
+
const ExpiringSpinner = styled(motion.div) `
|
|
45
|
+
pointer-events: none;
|
|
46
|
+
user-select: none;
|
|
47
|
+
z-index: 1;
|
|
48
|
+
position: absolute;
|
|
49
|
+
inset: -25%;
|
|
50
|
+
background: var(--ck-body-background);
|
|
51
|
+
div:first-child {
|
|
52
|
+
position: absolute;
|
|
53
|
+
left: 50%;
|
|
54
|
+
right: 0;
|
|
55
|
+
top: 0;
|
|
56
|
+
bottom: 0;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
&:before {
|
|
59
|
+
position: absolute;
|
|
60
|
+
content: '';
|
|
61
|
+
inset: 0;
|
|
62
|
+
background: var(--ck-spinner-color);
|
|
63
|
+
transform-origin: 0% 50%;
|
|
64
|
+
animation: rotateExpiringSpinner 5000ms ease-in both;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
div:last-child {
|
|
68
|
+
position: absolute;
|
|
69
|
+
left: 0;
|
|
70
|
+
right: 50%;
|
|
71
|
+
top: 0;
|
|
72
|
+
bottom: 0;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
&:before {
|
|
75
|
+
position: absolute;
|
|
76
|
+
content: '';
|
|
77
|
+
inset: 0;
|
|
78
|
+
background: var(--ck-spinner-color);
|
|
79
|
+
transform-origin: 100% 50%;
|
|
80
|
+
animation: rotateExpiringSpinner 5000ms ease-out 5000ms both;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
@keyframes rotateExpiringSpinner {
|
|
84
|
+
0% {
|
|
85
|
+
transform: rotate(-180deg);
|
|
86
|
+
}
|
|
87
|
+
100% {
|
|
88
|
+
transform: rotate(0deg);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
`;
|
|
92
|
+
const Spinner = styled(motion.div) `
|
|
93
|
+
pointer-events: none;
|
|
94
|
+
user-select: none;
|
|
95
|
+
z-index: 1;
|
|
96
|
+
position: absolute;
|
|
97
|
+
inset: 0;
|
|
98
|
+
svg {
|
|
99
|
+
display: block;
|
|
100
|
+
position: absolute;
|
|
101
|
+
left: 0;
|
|
102
|
+
top: 0;
|
|
103
|
+
width: 100%;
|
|
104
|
+
height: 100%;
|
|
105
|
+
animation: rotateSpinner 1200ms linear infinite;
|
|
106
|
+
}
|
|
107
|
+
@keyframes rotateSpinner {
|
|
108
|
+
0% {
|
|
109
|
+
transform: rotate(0deg);
|
|
110
|
+
}
|
|
111
|
+
100% {
|
|
112
|
+
transform: rotate(360deg);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
export { ExpiringSpinner, Logo, LogoContainer, Spinner, SpinnerContainer };
|
|
118
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,12 +2,10 @@ import type React from 'react';
|
|
|
2
2
|
declare const states: {
|
|
3
3
|
CONNECTED: string;
|
|
4
4
|
CONNECTING: string;
|
|
5
|
-
EXPIRING: string;
|
|
6
5
|
FAILED: string;
|
|
7
6
|
REJECTED: string;
|
|
8
7
|
NOTCONNECTED: string;
|
|
9
8
|
UNAVAILABLE: string;
|
|
10
|
-
DUPLICATED: string;
|
|
11
9
|
SIWE: string;
|
|
12
10
|
RECOVER_ADDRESS_MISMATCH: string;
|
|
13
11
|
};
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { AnimatePresence } from 'framer-motion';
|
|
3
|
+
import { useCallback, useState, useEffect } from 'react';
|
|
4
|
+
import { RetryIconCircle, AlertIcon, TickIcon } from '../../../assets/icons.js';
|
|
5
|
+
import { useEthereumBridge } from '../../../ethereum/OpenfortEthereumBridgeContext.js';
|
|
6
|
+
import { useUser } from '../../../hooks/openfort/useUser.js';
|
|
7
|
+
import useLocales from '../../../hooks/useLocales.js';
|
|
8
|
+
import { useRouteProps } from '../../../hooks/useRouteProps.js';
|
|
9
|
+
import { detectBrowser, isWalletConnectConnector } from '../../../utils/index.js';
|
|
10
|
+
import { logger } from '../../../utils/logger.js';
|
|
11
|
+
import { useConnectWithSiwe } from '../../../wagmi/useConnectWithSiwe.js';
|
|
12
|
+
import { useExternalConnector } from '../../../wallets/useExternalConnectors.js';
|
|
13
|
+
import Alert from '../../Common/Alert/index.js';
|
|
14
|
+
import BrowserIcon from '../../Common/BrowserIcon/index.js';
|
|
15
|
+
import Button from '../../Common/Button/index.js';
|
|
16
|
+
import { ModalHeading, ModalContent, ModalContentContainer, ModalH1, ModalBody } from '../../Common/Modal/styles.js';
|
|
17
|
+
import SquircleSpinner from '../../Common/SquircleSpinner/index.js';
|
|
18
|
+
import Tooltip from '../../Common/Tooltip/index.js';
|
|
19
|
+
import { routes } from '../../Openfort/types.js';
|
|
20
|
+
import { useOpenfort } from '../../Openfort/useOpenfort.js';
|
|
21
|
+
import { PageContent } from '../../PageContent/index.js';
|
|
22
|
+
import CircleSpinner from './CircleSpinner/index.js';
|
|
23
|
+
import { Container, ConnectingContainer, ConnectingAnimation, RetryButton, RetryIconContainer, Content } from './styles.js';
|
|
24
|
+
|
|
25
|
+
const states = {
|
|
26
|
+
CONNECTED: 'connected',
|
|
27
|
+
CONNECTING: 'connecting',
|
|
28
|
+
FAILED: 'failed',
|
|
29
|
+
REJECTED: 'rejected',
|
|
30
|
+
NOTCONNECTED: 'notconnected',
|
|
31
|
+
UNAVAILABLE: 'unavailable',
|
|
32
|
+
SIWE: 'siwe',
|
|
33
|
+
RECOVER_ADDRESS_MISMATCH: 'recoverAddressMismatch',
|
|
34
|
+
};
|
|
35
|
+
const contentVariants = {
|
|
36
|
+
initial: {
|
|
37
|
+
willChange: 'transform,opacity',
|
|
38
|
+
position: 'relative',
|
|
39
|
+
opacity: 0,
|
|
40
|
+
scale: 0.95,
|
|
41
|
+
},
|
|
42
|
+
animate: {
|
|
43
|
+
position: 'relative',
|
|
44
|
+
opacity: 1,
|
|
45
|
+
scale: 1,
|
|
46
|
+
transition: {
|
|
47
|
+
ease: [0.16, 1, 0.3, 1],
|
|
48
|
+
duration: 0.4,
|
|
49
|
+
delay: 0.05,
|
|
50
|
+
position: { delay: 0 },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
exit: {
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
opacity: 0,
|
|
56
|
+
scale: 0.95,
|
|
57
|
+
transition: {
|
|
58
|
+
ease: [0.16, 1, 0.3, 1],
|
|
59
|
+
duration: 0.3,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
const ConnectWithInjector = ({ forceState }) => {
|
|
64
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
65
|
+
const { setOpen } = useOpenfort();
|
|
66
|
+
const bridge = useEthereumBridge();
|
|
67
|
+
const { connectWithSiwe } = useConnectWithSiwe();
|
|
68
|
+
const props = useRouteProps(routes.CONNECT);
|
|
69
|
+
const { linkedAccounts, user } = useUser();
|
|
70
|
+
const { triggerResize, connector: c } = useOpenfort();
|
|
71
|
+
const id = c.id;
|
|
72
|
+
const wallet = useExternalConnector(id);
|
|
73
|
+
const onConnect = useCallback(() => {
|
|
74
|
+
setStatus(states.CONNECTED);
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
triggerResize();
|
|
77
|
+
}, 250);
|
|
78
|
+
setTimeout(() => {
|
|
79
|
+
setOpen(false);
|
|
80
|
+
}, 1250);
|
|
81
|
+
}, [setOpen, triggerResize]);
|
|
82
|
+
const handleConnectSettled = useCallback(async (walletItem, connectResult) => {
|
|
83
|
+
var _a, _b, _c;
|
|
84
|
+
if (!bridge)
|
|
85
|
+
return;
|
|
86
|
+
const disconnect = bridge.disconnect;
|
|
87
|
+
const getConnectorAccounts = bridge.getConnectorAccounts;
|
|
88
|
+
if (props.connectType === 'recover' && getConnectorAccounts) {
|
|
89
|
+
const acc = await getConnectorAccounts(walletItem.connector);
|
|
90
|
+
if (acc.some((v) => { var _a; return v === ((_a = props.wallet) === null || _a === void 0 ? void 0 : _a.address); })) {
|
|
91
|
+
onConnect();
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
setStatus(states.RECOVER_ADDRESS_MISMATCH);
|
|
95
|
+
await disconnect();
|
|
96
|
+
}
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
// Only skip SIWE when user is logged in AND this wallet is already linked (reconnecting)
|
|
100
|
+
const userWallets = user
|
|
101
|
+
? linkedAccounts === null || linkedAccounts === void 0 ? void 0 : linkedAccounts.filter((acc) => {
|
|
102
|
+
var _a, _b, _c;
|
|
103
|
+
return acc.walletClientType === ((_b = (_a = walletItem.connector) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase()) ||
|
|
104
|
+
acc.walletClientType === ((_c = walletItem.connector) === null || _c === void 0 ? void 0 : _c.id);
|
|
105
|
+
})
|
|
106
|
+
: [];
|
|
107
|
+
if (userWallets && userWallets.length > 0 && getConnectorAccounts) {
|
|
108
|
+
const acc = await getConnectorAccounts(walletItem.connector);
|
|
109
|
+
if (acc.some((v) => userWallets.some((w) => w.accountId === v))) {
|
|
110
|
+
onConnect();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
setStatus(states.SIWE);
|
|
115
|
+
const addressFromResult = (_a = connectResult === null || connectResult === void 0 ? void 0 : connectResult.accounts) === null || _a === void 0 ? void 0 : _a[0];
|
|
116
|
+
connectWithSiwe({
|
|
117
|
+
address: addressFromResult,
|
|
118
|
+
connectorType: (_b = walletItem.connector) === null || _b === void 0 ? void 0 : _b.type,
|
|
119
|
+
walletClientType: (_c = walletItem.connector) === null || _c === void 0 ? void 0 : _c.id,
|
|
120
|
+
onError: (error, _errorType) => {
|
|
121
|
+
logger.error(error);
|
|
122
|
+
disconnect();
|
|
123
|
+
setStatus(states.FAILED);
|
|
124
|
+
},
|
|
125
|
+
onConnect: () => {
|
|
126
|
+
onConnect();
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
}, [
|
|
130
|
+
bridge,
|
|
131
|
+
user,
|
|
132
|
+
linkedAccounts,
|
|
133
|
+
onConnect,
|
|
134
|
+
props.connectType,
|
|
135
|
+
'wallet' in props ? (_a = props.wallet) === null || _a === void 0 ? void 0 : _a.address : undefined,
|
|
136
|
+
connectWithSiwe,
|
|
137
|
+
]);
|
|
138
|
+
const handleConnectError = useCallback((error) => {
|
|
139
|
+
setShowTryAgainTooltip(true);
|
|
140
|
+
setTimeout(() => setShowTryAgainTooltip(false), 3500);
|
|
141
|
+
if ((error === null || error === void 0 ? void 0 : error.code) !== undefined) {
|
|
142
|
+
switch (error.code) {
|
|
143
|
+
case -32002:
|
|
144
|
+
setStatus(states.NOTCONNECTED);
|
|
145
|
+
break;
|
|
146
|
+
case 4001:
|
|
147
|
+
setStatus(states.REJECTED);
|
|
148
|
+
break;
|
|
149
|
+
default:
|
|
150
|
+
setStatus(states.FAILED);
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
else if (error === null || error === void 0 ? void 0 : error.message) {
|
|
155
|
+
if (error.message === 'User rejected request') {
|
|
156
|
+
setStatus(states.REJECTED);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
setStatus(states.FAILED);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
setStatus(states.FAILED);
|
|
164
|
+
}
|
|
165
|
+
}, []);
|
|
166
|
+
const walletInfo = {
|
|
167
|
+
name: wallet === null || wallet === void 0 ? void 0 : wallet.name,
|
|
168
|
+
shortName: (_b = wallet === null || wallet === void 0 ? void 0 : wallet.shortName) !== null && _b !== void 0 ? _b : wallet === null || wallet === void 0 ? void 0 : wallet.name,
|
|
169
|
+
icon: (_c = wallet === null || wallet === void 0 ? void 0 : wallet.iconConnector) !== null && _c !== void 0 ? _c : wallet === null || wallet === void 0 ? void 0 : wallet.icon,
|
|
170
|
+
iconShape: (_d = wallet === null || wallet === void 0 ? void 0 : wallet.iconShape) !== null && _d !== void 0 ? _d : 'circle',
|
|
171
|
+
iconShouldShrink: wallet === null || wallet === void 0 ? void 0 : wallet.iconShouldShrink,
|
|
172
|
+
};
|
|
173
|
+
const [showTryAgainTooltip, setShowTryAgainTooltip] = useState(false);
|
|
174
|
+
const browser = detectBrowser();
|
|
175
|
+
const extensionUrl = (_e = wallet === null || wallet === void 0 ? void 0 : wallet.downloadUrls) === null || _e === void 0 ? void 0 : _e[browser];
|
|
176
|
+
const suggestedExtension = (wallet === null || wallet === void 0 ? void 0 : wallet.downloadUrls)
|
|
177
|
+
? {
|
|
178
|
+
name: Object.keys(wallet === null || wallet === void 0 ? void 0 : wallet.downloadUrls)[0],
|
|
179
|
+
label: ((_f = Object.keys(wallet === null || wallet === void 0 ? void 0 : wallet.downloadUrls)[0]) === null || _f === void 0 ? void 0 : _f.charAt(0).toUpperCase()) +
|
|
180
|
+
((_g = Object.keys(wallet === null || wallet === void 0 ? void 0 : wallet.downloadUrls)[0]) === null || _g === void 0 ? void 0 : _g.slice(1)), // Capitalise first letter, but this might be better suited as a lookup table
|
|
181
|
+
url: wallet === null || wallet === void 0 ? void 0 : wallet.downloadUrls[Object.keys(wallet === null || wallet === void 0 ? void 0 : wallet.downloadUrls)[0]],
|
|
182
|
+
}
|
|
183
|
+
: undefined;
|
|
184
|
+
const [status, setStatus] = useState(forceState ? forceState : !(wallet === null || wallet === void 0 ? void 0 : wallet.isInstalled) ? states.UNAVAILABLE : states.CONNECTING);
|
|
185
|
+
const locales = useLocales({
|
|
186
|
+
CONNECTORNAME: (_h = walletInfo.name) !== null && _h !== void 0 ? _h : 'UNKNOWN CONNECTOR',
|
|
187
|
+
CONNECTORSHORTNAME: (_k = (_j = walletInfo.shortName) !== null && _j !== void 0 ? _j : walletInfo.name) !== null && _k !== void 0 ? _k : 'UNKNOWN CONNECTOR',
|
|
188
|
+
SUGGESTEDEXTENSIONBROWSER: (_l = suggestedExtension === null || suggestedExtension === void 0 ? void 0 : suggestedExtension.label) !== null && _l !== void 0 ? _l : 'your browser',
|
|
189
|
+
});
|
|
190
|
+
const runConnect = useCallback(async () => {
|
|
191
|
+
if (!bridge || !(wallet === null || wallet === void 0 ? void 0 : wallet.isInstalled) || !(wallet === null || wallet === void 0 ? void 0 : wallet.connector)) {
|
|
192
|
+
setStatus(states.UNAVAILABLE);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (bridge.account.isConnected) {
|
|
196
|
+
await bridge.disconnect();
|
|
197
|
+
}
|
|
198
|
+
setStatus(states.CONNECTING);
|
|
199
|
+
try {
|
|
200
|
+
let connectResult;
|
|
201
|
+
if (bridge.connectAsync) {
|
|
202
|
+
const result = await bridge.connectAsync({ connector: wallet.connector });
|
|
203
|
+
connectResult =
|
|
204
|
+
result && typeof result === 'object' && 'accounts' in result
|
|
205
|
+
? result
|
|
206
|
+
: undefined;
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
bridge.connect({ connector: wallet.connector });
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (!wallet) {
|
|
213
|
+
setStatus(states.FAILED);
|
|
214
|
+
logger.error('No wallet found');
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
logger.log('Connect type is:', props.connectType);
|
|
218
|
+
await handleConnectSettled(wallet, connectResult);
|
|
219
|
+
}
|
|
220
|
+
catch (err) {
|
|
221
|
+
logger.error(err);
|
|
222
|
+
handleConnectError(err && typeof err === 'object' && 'code' in err
|
|
223
|
+
? err
|
|
224
|
+
: {
|
|
225
|
+
message: err instanceof Error && err.message === 'User rejected request'
|
|
226
|
+
? 'User rejected request'
|
|
227
|
+
: 'Connection failed',
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
setTimeout(triggerResize, 100);
|
|
231
|
+
}, [bridge, wallet, props.connectType, handleConnectSettled, handleConnectError, triggerResize]);
|
|
232
|
+
let connectTimeout;
|
|
233
|
+
useEffect(() => {
|
|
234
|
+
if (status === states.UNAVAILABLE)
|
|
235
|
+
return;
|
|
236
|
+
// UX: Give user time to see the UI before opening the extension
|
|
237
|
+
connectTimeout = setTimeout(runConnect, 600);
|
|
238
|
+
return () => {
|
|
239
|
+
clearTimeout(connectTimeout);
|
|
240
|
+
};
|
|
241
|
+
}, []);
|
|
242
|
+
/* Timeout functionality if necessary
|
|
243
|
+
let expiryTimeout: any;
|
|
244
|
+
useEffect(() => {
|
|
245
|
+
if (status === states.EXPIRING) {
|
|
246
|
+
expiryTimeout = setTimeout(
|
|
247
|
+
() => {
|
|
248
|
+
if (expiryTimer <= 0) {
|
|
249
|
+
setStatus(states.FAILED);
|
|
250
|
+
setExpiryTimer(expiryDefault);
|
|
251
|
+
} else {
|
|
252
|
+
setExpiryTimer(expiryTimer - 1);
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
expiryTimer === 9 ? 1500 : 1000 // Google: Chronostasis
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
return () => {
|
|
259
|
+
clearTimeout(expiryTimeout);
|
|
260
|
+
};
|
|
261
|
+
}, [status, expiryTimer]);
|
|
262
|
+
*/
|
|
263
|
+
if (!wallet) {
|
|
264
|
+
return (jsx(PageContent, { children: jsxs(Container, { children: [jsx(ModalHeading, { children: "Invalid State" }), jsx(ModalContent, { children: jsx(Alert, { children: "No connectors match the id given. This state should never happen." }) })] }) }));
|
|
265
|
+
}
|
|
266
|
+
// OLD_TODO: Make this more generic
|
|
267
|
+
if (isWalletConnectConnector(wallet === null || wallet === void 0 ? void 0 : wallet.connector.id)) {
|
|
268
|
+
return (jsx(PageContent, { children: jsxs(Container, { children: [jsx(ModalHeading, { children: "Invalid State" }), jsx(ModalContent, { children: jsx(Alert, { children: "WalletConnect does not have an injection flow. This state should never happen." }) })] }) }));
|
|
269
|
+
}
|
|
270
|
+
const hasError = status === states.FAILED || status === states.REJECTED || status === states.RECOVER_ADDRESS_MISMATCH;
|
|
271
|
+
return (jsx(PageContent, { children: jsxs(Container, { children: [jsx(ConnectingContainer, { children: jsxs(ConnectingAnimation, { "$shake": hasError, "$circle": walletInfo.iconShape === 'circle', children: [jsx(AnimatePresence, { children: hasError && (jsx(RetryButton, { "aria-label": "Retry", initial: { opacity: 0, scale: 0.8 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.8 }, whileTap: { scale: 0.9 }, transition: { duration: 0.1 }, onClick: runConnect, children: jsx(RetryIconContainer, { children: jsx(Tooltip, { open: showTryAgainTooltip && hasError, message: locales.tryAgainQuestion, xOffset: -6, children: jsx(RetryIconCircle, {}) }) }) })) }), walletInfo.iconShape === 'circle' ? (jsx(CircleSpinner, { logo: status === states.UNAVAILABLE ? (jsx("div", { style: {
|
|
272
|
+
transform: 'scale(1.14)',
|
|
273
|
+
position: 'relative',
|
|
274
|
+
width: '100%',
|
|
275
|
+
}, children: walletInfo.icon })) : (walletInfo.icon), smallLogo: walletInfo.iconShouldShrink, connecting: status === states.CONNECTING || status === states.SIWE, unavailable: status === states.UNAVAILABLE })) : (jsx(SquircleSpinner, { logo: status === states.UNAVAILABLE ? (jsx("div", { style: {
|
|
276
|
+
transform: 'scale(1.14)',
|
|
277
|
+
position: 'relative',
|
|
278
|
+
width: '100%',
|
|
279
|
+
}, children: walletInfo.icon })) : (walletInfo.icon), connecting: status === states.CONNECTING || status === states.SIWE }))] }) }), jsx(ModalContentContainer, { children: jsxs(AnimatePresence, { initial: false, children: [status === states.FAILED && (jsx(Content, { initial: 'initial', animate: 'animate', exit: 'exit', variants: contentVariants, children: jsxs(ModalContent, { children: [jsxs(ModalH1, { "$error": true, children: [jsx(AlertIcon, {}), locales.injectionScreen_failed_h1] }), jsx(ModalBody, { children: locales.injectionScreen_failed_p })] }) }, states.FAILED)), status === states.REJECTED && (jsx(Content, { initial: 'initial', animate: 'animate', exit: 'exit', variants: contentVariants, children: jsxs(ModalContent, { style: {
|
|
280
|
+
paddingBottom: 28,
|
|
281
|
+
}, children: [jsx(ModalH1, { children: locales.injectionScreen_rejected_h1 }), jsx(ModalBody, { children: locales.injectionScreen_rejected_p })] }) }, states.REJECTED)), status === states.RECOVER_ADDRESS_MISMATCH && (jsx(Content, { initial: 'initial', animate: 'animate', exit: 'exit', variants: contentVariants, children: jsxs(ModalContent, { style: {
|
|
282
|
+
paddingBottom: 28,
|
|
283
|
+
}, children: [jsx(ModalH1, { children: "Wallet mismatch" }), jsx(ModalBody, { children: "The wallet address you are trying to recover does not belong to this user." })] }) }, states.RECOVER_ADDRESS_MISMATCH)), status === states.CONNECTING && (jsx(Content, { initial: 'initial', animate: 'animate', exit: 'exit', variants: contentVariants, children: jsxs(ModalContent, { style: {
|
|
284
|
+
paddingBottom: 28,
|
|
285
|
+
}, children: [jsx(ModalH1, { children: wallet.connector.id === 'injected'
|
|
286
|
+
? locales.injectionScreen_connecting_injected_h1
|
|
287
|
+
: locales.injectionScreen_connecting_h1 }), jsx(ModalBody, { children: wallet.connector.id === 'injected'
|
|
288
|
+
? locales.injectionScreen_connecting_injected_p
|
|
289
|
+
: locales.injectionScreen_connecting_p })] }) }, states.CONNECTING)), status === states.SIWE && (jsx(Content, { initial: 'initial', animate: 'animate', exit: 'exit', variants: contentVariants, children: jsxs(ModalContent, { style: {
|
|
290
|
+
paddingBottom: 28,
|
|
291
|
+
}, children: [jsx(ModalH1, { children: "Confirm in your wallet" }), jsx(ModalBody, { children: "Sign the message in your wallet to confirm that you own this wallet and complete the connection." })] }) }, states.SIWE)), status === states.CONNECTED && (jsx(Content, { initial: 'initial', animate: 'animate', exit: 'exit', variants: contentVariants, children: jsxs(ModalContent, { children: [jsxs(ModalH1, { "$valid": true, children: [jsx(TickIcon, {}), " Connected"] }), jsxs(ModalBody, { children: ["Successfully connected with ", walletInfo.name, "."] })] }) }, states.CONNECTED)), status === states.NOTCONNECTED && (jsx(Content, { initial: 'initial', animate: 'animate', exit: 'exit', variants: contentVariants, children: jsxs(ModalContent, { children: [jsx(ModalH1, { children: locales.injectionScreen_notconnected_h1 }), jsx(ModalBody, { children: locales.injectionScreen_notconnected_p })] }) }, states.NOTCONNECTED)), status === states.UNAVAILABLE && (jsx(Content, { initial: 'initial', animate: 'animate', exit: 'exit', variants: contentVariants, children: !extensionUrl ? (jsxs(Fragment, { children: [jsxs(ModalContent, { style: { paddingBottom: 12 }, children: [jsx(ModalH1, { children: locales.injectionScreen_unavailable_h1 }), jsx(ModalBody, { children: locales.injectionScreen_unavailable_p })] }), !wallet.isInstalled && suggestedExtension && (jsxs(Button, { href: suggestedExtension === null || suggestedExtension === void 0 ? void 0 : suggestedExtension.url, icon: jsx(BrowserIcon, { browser: suggestedExtension === null || suggestedExtension === void 0 ? void 0 : suggestedExtension.name }), children: ["Install on ", suggestedExtension === null || suggestedExtension === void 0 ? void 0 : suggestedExtension.label] }))] })) : (jsxs(Fragment, { children: [jsxs(ModalContent, { style: { paddingBottom: 18 }, children: [jsx(ModalH1, { children: locales.injectionScreen_install_h1 }), jsx(ModalBody, { children: locales.injectionScreen_install_p })] }), !wallet.isInstalled && extensionUrl && (jsx(Button, { href: extensionUrl, icon: jsx(BrowserIcon, {}), children: locales.installTheExtension }))] })) }, states.UNAVAILABLE))] }) })] }) }));
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
export { ConnectWithInjector as default };
|
|
295
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { motion } from 'framer-motion';
|
|
2
|
+
import { keyframes, css } from 'styled-components';
|
|
3
|
+
import styled from '../../../styles/styled/index.js';
|
|
4
|
+
import { ModalContent } from '../../Common/Modal/styles.js';
|
|
5
|
+
|
|
6
|
+
const Content = styled(motion.div) `
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 6px;
|
|
10
|
+
position: relative;
|
|
11
|
+
left: 0;
|
|
12
|
+
right: 0;
|
|
13
|
+
${ModalContent} {
|
|
14
|
+
padding: 0 8px 32px;
|
|
15
|
+
gap: 12px;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
const dist = 2;
|
|
19
|
+
const shakeKeyframes = keyframes `
|
|
20
|
+
0%{ transform:none; }
|
|
21
|
+
25%{ transform:translateX(${dist}px); }
|
|
22
|
+
50%{ transform:translateX(-${dist}px); }
|
|
23
|
+
75%{ transform:translateX(${dist}px); }
|
|
24
|
+
100%{ transform:none; }
|
|
25
|
+
`;
|
|
26
|
+
const outlineKeyframes = keyframes `
|
|
27
|
+
0%{ opacity:1; }
|
|
28
|
+
100%{ opacity:0; }
|
|
29
|
+
`;
|
|
30
|
+
const Container = styled(motion.div) `
|
|
31
|
+
/*
|
|
32
|
+
background: var(
|
|
33
|
+
--ck-body-background
|
|
34
|
+
); // To stop the overlay issue during transition for the squircle spinner
|
|
35
|
+
*/
|
|
36
|
+
`;
|
|
37
|
+
const ConnectingContainer = styled(motion.div) `
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
margin: 10px auto 16px;
|
|
42
|
+
height: 120px;
|
|
43
|
+
//transform: scale(1.001); // fixes shifting issue between states
|
|
44
|
+
`;
|
|
45
|
+
const ConnectingAnimation = styled(motion.div) `
|
|
46
|
+
user-select: none;
|
|
47
|
+
position: relative;
|
|
48
|
+
--spinner-error-opacity: 0;
|
|
49
|
+
&:before {
|
|
50
|
+
content: '';
|
|
51
|
+
position: absolute;
|
|
52
|
+
inset: 1px;
|
|
53
|
+
opacity: 0;
|
|
54
|
+
background: var(--ck-body-color-danger);
|
|
55
|
+
${(props) => props.$circle &&
|
|
56
|
+
css `
|
|
57
|
+
inset: -5px;
|
|
58
|
+
border-radius: 50%;
|
|
59
|
+
background: none;
|
|
60
|
+
box-shadow: inset 0 0 0 3.5px var(--ck-body-color-danger);
|
|
61
|
+
`}
|
|
62
|
+
}
|
|
63
|
+
${(props) => props.$shake &&
|
|
64
|
+
css `
|
|
65
|
+
animation: ${shakeKeyframes} 220ms ease-out both;
|
|
66
|
+
&:before {
|
|
67
|
+
animation: ${outlineKeyframes} 220ms ease-out 750ms both;
|
|
68
|
+
}
|
|
69
|
+
`}
|
|
70
|
+
`;
|
|
71
|
+
const RetryButton = styled(motion.button) `
|
|
72
|
+
z-index: 5;
|
|
73
|
+
appearance: none;
|
|
74
|
+
position: absolute;
|
|
75
|
+
right: 10px;
|
|
76
|
+
bottom: 10px;
|
|
77
|
+
padding: 0;
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
width: 32px;
|
|
82
|
+
height: 32px;
|
|
83
|
+
border-radius: 16px;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
background: none;
|
|
87
|
+
|
|
88
|
+
color: var(--ck-body-background-secondary);
|
|
89
|
+
transition: color 200ms ease;
|
|
90
|
+
box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.15);
|
|
91
|
+
|
|
92
|
+
&:before {
|
|
93
|
+
z-index: 3;
|
|
94
|
+
content: '';
|
|
95
|
+
position: absolute;
|
|
96
|
+
inset: 0;
|
|
97
|
+
opacity: 0;
|
|
98
|
+
transition: opacity 200ms ease;
|
|
99
|
+
background: var(--ck-body-color);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:hover:before {
|
|
103
|
+
opacity: 0.1;
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
106
|
+
const RetryIconContainer = styled(motion.div) `
|
|
107
|
+
position: absolute;
|
|
108
|
+
inset: 0;
|
|
109
|
+
|
|
110
|
+
&:before {
|
|
111
|
+
z-index: 1;
|
|
112
|
+
content: '';
|
|
113
|
+
position: absolute;
|
|
114
|
+
inset: 3px;
|
|
115
|
+
border-radius: 16px;
|
|
116
|
+
background: conic-gradient(
|
|
117
|
+
from 90deg,
|
|
118
|
+
currentColor 10%,
|
|
119
|
+
var(--ck-body-color) 80%
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
svg {
|
|
124
|
+
z-index: 2;
|
|
125
|
+
display: block;
|
|
126
|
+
position: relative;
|
|
127
|
+
width: 100%;
|
|
128
|
+
height: 100%;
|
|
129
|
+
}
|
|
130
|
+
`;
|
|
131
|
+
|
|
132
|
+
export { ConnectingAnimation, ConnectingContainer, Container, Content, RetryButton, RetryIconContainer };
|
|
133
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { useEthereumBridge } from '../../ethereum/OpenfortEthereumBridgeContext.js';
|
|
4
|
+
import styled from '../../styles/styled/index.js';
|
|
5
|
+
import { isAndroid } from '../../utils/index.js';
|
|
6
|
+
import { useOnUserReturn } from '../../utils/useOnUserReturn.js';
|
|
7
|
+
import { useConnectWithSiwe } from '../../wagmi/useConnectWithSiwe.js';
|
|
8
|
+
import { useExternalConnector } from '../../wallets/useExternalConnectors.js';
|
|
9
|
+
import { walletConfigs } from '../../wallets/walletConfigs.js';
|
|
10
|
+
import Button from '../Common/Button/index.js';
|
|
11
|
+
import FitText from '../Common/FitText/index.js';
|
|
12
|
+
import Loader from '../Common/Loading/index.js';
|
|
13
|
+
import { routes } from '../Openfort/types.js';
|
|
14
|
+
import { useOpenfort } from '../Openfort/useOpenfort.js';
|
|
15
|
+
import { PageContent } from '../PageContent/index.js';
|
|
16
|
+
|
|
17
|
+
const states = {
|
|
18
|
+
INIT: 'init',
|
|
19
|
+
REDIRECT: 'redirect',
|
|
20
|
+
CONNECTING: 'connecting',
|
|
21
|
+
ERROR: 'error',
|
|
22
|
+
};
|
|
23
|
+
const DownloadFooter = styled.div `
|
|
24
|
+
margin-top: 30px;
|
|
25
|
+
color: var(--ck-body-color-muted);
|
|
26
|
+
`;
|
|
27
|
+
const ConnectWithMobile = () => {
|
|
28
|
+
var _a, _b, _c, _d, _e;
|
|
29
|
+
const { connector, setRoute } = useOpenfort();
|
|
30
|
+
const walletId = Object.keys(walletConfigs).find(
|
|
31
|
+
// where id is comma separated list
|
|
32
|
+
(id) => id
|
|
33
|
+
.split(',')
|
|
34
|
+
.map((i) => i.trim())
|
|
35
|
+
.indexOf(connector.id) !== -1);
|
|
36
|
+
const wallet = useExternalConnector(connector.id) || (walletId && walletConfigs[walletId]) || {};
|
|
37
|
+
const bridge = useEthereumBridge();
|
|
38
|
+
const isConnected = (_b = (_a = bridge === null || bridge === void 0 ? void 0 : bridge.account) === null || _a === void 0 ? void 0 : _a.isConnected) !== null && _b !== void 0 ? _b : false;
|
|
39
|
+
const [status, setStatus] = useState(isConnected ? states.INIT : states.CONNECTING);
|
|
40
|
+
const [description, setDescription] = useState(undefined);
|
|
41
|
+
const [hasReturned, setHasReturned] = useState(false);
|
|
42
|
+
const { connectWithSiwe } = useConnectWithSiwe();
|
|
43
|
+
const openApp = () => {
|
|
44
|
+
var _a;
|
|
45
|
+
const uri = (_a = wallet === null || wallet === void 0 ? void 0 : wallet.getWalletConnectDeeplink) === null || _a === void 0 ? void 0 : _a.call(wallet, '');
|
|
46
|
+
if (uri) {
|
|
47
|
+
window.location.href = uri.replace('?uri=', '');
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
setStatus(states.ERROR);
|
|
51
|
+
setDescription('Wallet does not support deeplink');
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
useOnUserReturn(() => {
|
|
55
|
+
setTimeout(() => {
|
|
56
|
+
setHasReturned(true);
|
|
57
|
+
}, 250);
|
|
58
|
+
});
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (hasReturned) {
|
|
61
|
+
setHasReturned(false);
|
|
62
|
+
if (isConnected) {
|
|
63
|
+
setStatus(states.CONNECTING);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
setStatus(states.ERROR);
|
|
67
|
+
setDescription('Connection failed or cancelled');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, [hasReturned, isConnected]);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
switch (status) {
|
|
73
|
+
case states.INIT:
|
|
74
|
+
break;
|
|
75
|
+
case states.CONNECTING:
|
|
76
|
+
setDescription('Requesting signature to verify wallet...');
|
|
77
|
+
connectWithSiwe({
|
|
78
|
+
walletClientType: walletId,
|
|
79
|
+
onConnect: () => setRoute(routes.CONNECTED),
|
|
80
|
+
onError: (err) => {
|
|
81
|
+
setStatus(states.ERROR);
|
|
82
|
+
setDescription(err || 'Connection failed');
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
}, [status]);
|
|
88
|
+
return (jsxs(PageContent, { children: [jsx(Loader, { header: `Connecting with ${connector.id.split(',')[0]}`, icon: wallet === null || wallet === void 0 ? void 0 : wallet.icon, isError: status === states.ERROR, description: description, onRetry: () => {
|
|
89
|
+
setStatus(isConnected ? states.CONNECTING : states.INIT);
|
|
90
|
+
setDescription('');
|
|
91
|
+
} }), isConnected ? (jsx(Button, { onClick: () => {
|
|
92
|
+
openApp();
|
|
93
|
+
}, children: "Sign in App" })) : (jsx(Button, { onClick: () => {
|
|
94
|
+
openApp();
|
|
95
|
+
}, children: "Sign in App" })), jsx(DownloadFooter, { children: jsxs(FitText, { children: ["Don't have ", (_c = wallet.name) !== null && _c !== void 0 ? _c : connector.id.split(',')[0], " installed?", ' ', jsx("a", { style: { marginLeft: 5 }, href: isAndroid() ? (_d = wallet === null || wallet === void 0 ? void 0 : wallet.downloadUrls) === null || _d === void 0 ? void 0 : _d.android : (_e = wallet === null || wallet === void 0 ? void 0 : wallet.downloadUrls) === null || _e === void 0 ? void 0 : _e.ios, target: "_blank", rel: "noreferrer", children: "GET" })] }) })] }));
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export { ConnectWithMobile as default };
|
|
99
|
+
//# sourceMappingURL=ConnectWithMobile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectWithMobile.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|