@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,128 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { providersLogos } from '../../assets/logos.js';
|
|
4
|
+
import { useOpenfortCore } from '../../openfort/useOpenfort.js';
|
|
5
|
+
import { logger } from '../../utils/logger.js';
|
|
6
|
+
import Loader from '../Common/Loading/index.js';
|
|
7
|
+
import { routes } from '../Openfort/types.js';
|
|
8
|
+
import { useOpenfort } from '../Openfort/useOpenfort.js';
|
|
9
|
+
import { PageContent } from '../PageContent/index.js';
|
|
10
|
+
|
|
11
|
+
const states = {
|
|
12
|
+
INIT: 'init',
|
|
13
|
+
REDIRECT: 'redirect',
|
|
14
|
+
CONNECTING: 'connecting',
|
|
15
|
+
ERROR: 'error',
|
|
16
|
+
};
|
|
17
|
+
const ConnectWithOAuth = () => {
|
|
18
|
+
const { connector, setRoute, triggerResize } = useOpenfort();
|
|
19
|
+
const { client, user } = useOpenfortCore();
|
|
20
|
+
const [status, setStatus] = useState(states.INIT);
|
|
21
|
+
const [description, setDescription] = useState(undefined);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
(async () => {
|
|
24
|
+
const win = typeof window !== 'undefined' ? window : null;
|
|
25
|
+
const doc = typeof document !== 'undefined' ? document : null;
|
|
26
|
+
if (!win || !doc)
|
|
27
|
+
return;
|
|
28
|
+
if (connector.type !== 'oauth')
|
|
29
|
+
throw new Error('Invalid connector type');
|
|
30
|
+
const url = new URL(win.location.href.replace('?access_token=', '&access_token=')); // handle both ? and & cases
|
|
31
|
+
const hasProvider = !!url.searchParams.get('openfortAuthProviderUI');
|
|
32
|
+
const provider = connector.id;
|
|
33
|
+
switch (status) {
|
|
34
|
+
case states.INIT:
|
|
35
|
+
if (hasProvider)
|
|
36
|
+
setStatus(states.CONNECTING);
|
|
37
|
+
else
|
|
38
|
+
setTimeout(() => setStatus(states.REDIRECT), 150); // UX: wait a bit before redirecting
|
|
39
|
+
break;
|
|
40
|
+
case states.CONNECTING: {
|
|
41
|
+
const userId = url.searchParams.get('user_id');
|
|
42
|
+
const token = url.searchParams.get('access_token');
|
|
43
|
+
const error = url.searchParams.get('error');
|
|
44
|
+
['openfortAuthProviderUI', 'access_token', 'user_id', 'error'].forEach((key) => {
|
|
45
|
+
url.searchParams.delete(key);
|
|
46
|
+
});
|
|
47
|
+
win.history.replaceState({}, doc.title, url.toString());
|
|
48
|
+
if (!userId || !token || error) {
|
|
49
|
+
logger.error(`Missing user id or access token: userId=${userId}, accessToken=${token ? `${token.substring(0, 10)}...` : token}`);
|
|
50
|
+
setStatus(states.ERROR);
|
|
51
|
+
if (error) {
|
|
52
|
+
switch (error) {
|
|
53
|
+
case "email_doesn't_match":
|
|
54
|
+
setDescription('The email associated with this OAuth provider does not match your account email.');
|
|
55
|
+
break;
|
|
56
|
+
default:
|
|
57
|
+
setDescription('There was an error during authentication. Please try again.');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
setDescription('There was an error during authentication. Please try again.');
|
|
62
|
+
}
|
|
63
|
+
triggerResize();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
await client.auth.storeCredentials({
|
|
67
|
+
token,
|
|
68
|
+
userId,
|
|
69
|
+
});
|
|
70
|
+
setRoute(routes.LOADING);
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
case states.REDIRECT: {
|
|
74
|
+
if (hasProvider)
|
|
75
|
+
return;
|
|
76
|
+
const cleanURL = win.location.origin + win.location.pathname;
|
|
77
|
+
const queryParams = Object.fromEntries([...url.searchParams.entries()].filter(([key]) => ['openfortAuthProviderUI', 'refresh_token', 'access_token', 'player_id'].includes(key)));
|
|
78
|
+
queryParams.openfortAuthProviderUI = provider;
|
|
79
|
+
try {
|
|
80
|
+
if (user) {
|
|
81
|
+
const authToken = await client.getAccessToken();
|
|
82
|
+
if (!authToken) {
|
|
83
|
+
logger.error('No auth token found');
|
|
84
|
+
setRoute(routes.LOADING);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const linkResponse = await client.auth.initLinkOAuth({
|
|
88
|
+
provider,
|
|
89
|
+
redirectTo: `${cleanURL}?${new URLSearchParams(queryParams).toString()}`,
|
|
90
|
+
});
|
|
91
|
+
logger.log(linkResponse);
|
|
92
|
+
win.location.href = linkResponse;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const r = await client.auth.initOAuth({
|
|
96
|
+
provider,
|
|
97
|
+
redirectTo: `${cleanURL}?${new URLSearchParams(queryParams).toString()}`,
|
|
98
|
+
});
|
|
99
|
+
logger.log(r);
|
|
100
|
+
win.location.href = r;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch (e) {
|
|
104
|
+
logger.error('Error during OAuth initialization:', e);
|
|
105
|
+
setStatus(states.ERROR);
|
|
106
|
+
triggerResize();
|
|
107
|
+
if (e instanceof Error) {
|
|
108
|
+
if (e.message.includes('not enabled')) {
|
|
109
|
+
setDescription(`The ${provider} provider is not enabled. Please contact support.`);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
setDescription('There was an error during authentication. Please try again.');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
})();
|
|
120
|
+
}, [status]);
|
|
121
|
+
return (jsx(PageContent, { children: jsx(Loader, { header: `Connecting with ${connector.id}`, icon: providersLogos[connector.id], isError: status === states.ERROR, description: description, onRetry: () => {
|
|
122
|
+
setStatus(states.INIT);
|
|
123
|
+
setDescription(undefined);
|
|
124
|
+
} }) }));
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export { ConnectWithOAuth as default };
|
|
128
|
+
//# sourceMappingURL=ConnectWithOAuth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectWithOAuth.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useEffect, useState, useCallback } from 'react';
|
|
3
|
+
import { useEthereumBridge } from '../../ethereum/OpenfortEthereumBridgeContext.js';
|
|
4
|
+
import { useWalletConnectModal } from '../../hooks/useWalletConnectModal.js';
|
|
5
|
+
import 'detect-browser';
|
|
6
|
+
import { truncateEthAddress } from '../../utils/format.js';
|
|
7
|
+
import { useConnectWithSiwe } from '../../wagmi/useConnectWithSiwe.js';
|
|
8
|
+
import { useExternalConnector } from '../../wallets/useExternalConnectors.js';
|
|
9
|
+
import { CopyText } from '../Common/CopyToClipboard/CopyText.js';
|
|
10
|
+
import Loader from '../Common/Loading/index.js';
|
|
11
|
+
import { ModalBody } from '../Common/Modal/styles.js';
|
|
12
|
+
import { routes } from '../Openfort/types.js';
|
|
13
|
+
import { useOpenfort } from '../Openfort/useOpenfort.js';
|
|
14
|
+
import { PageContent } from '../PageContent/index.js';
|
|
15
|
+
|
|
16
|
+
const ConnectWithSiwe = () => {
|
|
17
|
+
var _a, _b, _c, _d;
|
|
18
|
+
const bridge = useEthereumBridge();
|
|
19
|
+
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;
|
|
20
|
+
const address = (_c = bridge === null || bridge === void 0 ? void 0 : bridge.account) === null || _c === void 0 ? void 0 : _c.address;
|
|
21
|
+
const ensName = (_d = bridge === null || bridge === void 0 ? void 0 : bridge.account) === null || _d === void 0 ? void 0 : _d.ensName;
|
|
22
|
+
const { connector, setRoute } = useOpenfort();
|
|
23
|
+
const wallet = useExternalConnector(connector.id);
|
|
24
|
+
const { connectWithSiwe } = useConnectWithSiwe();
|
|
25
|
+
const [error, setError] = useState(undefined);
|
|
26
|
+
const [description, setDescription] = useState(undefined);
|
|
27
|
+
const runSiwe = useCallback(() => {
|
|
28
|
+
setDescription('Requesting signature to verify wallet...');
|
|
29
|
+
connectWithSiwe({
|
|
30
|
+
walletClientType: connector.id,
|
|
31
|
+
onConnect: () => setRoute(routes.CONNECTED),
|
|
32
|
+
onError: (err) => {
|
|
33
|
+
setError(err || 'Connection failed');
|
|
34
|
+
setDescription(undefined);
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
}, [connectWithSiwe, connector.id, setRoute]);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (isConnected)
|
|
40
|
+
runSiwe();
|
|
41
|
+
}, [isConnected, runSiwe]);
|
|
42
|
+
return (jsxs(PageContent, { children: [jsxs(ModalBody, { style: { textAlign: 'center' }, children: ["Connected with ", jsx(CopyText, { value: address || '', children: ensName !== null && ensName !== void 0 ? ensName : truncateEthAddress(address) })] }), jsx(Loader, { header: 'Sign in to your wallet', icon: wallet === null || wallet === void 0 ? void 0 : wallet.icon, isError: !!error, description: error !== null && error !== void 0 ? error : description, onRetry: runSiwe })] }));
|
|
43
|
+
};
|
|
44
|
+
const ConnectWithWalletConnect = () => {
|
|
45
|
+
const { connector } = useOpenfort();
|
|
46
|
+
const wallet = useExternalConnector(connector.id);
|
|
47
|
+
const { open: openWalletConnectModal } = useWalletConnectModal();
|
|
48
|
+
const [error, setError] = useState(undefined);
|
|
49
|
+
const openModal = useCallback(async () => {
|
|
50
|
+
setError(undefined);
|
|
51
|
+
const { error } = await openWalletConnectModal();
|
|
52
|
+
if (error)
|
|
53
|
+
setError(error);
|
|
54
|
+
}, [openWalletConnectModal]);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
openModal();
|
|
57
|
+
}, [openModal]);
|
|
58
|
+
return (jsx(PageContent, { children: jsx(Loader, { header: error ? 'Error connecting wallet.' : `Connecting...`, icon: wallet === null || wallet === void 0 ? void 0 : wallet.icon, isError: !!error, description: error, onRetry: openModal }) }));
|
|
59
|
+
};
|
|
60
|
+
const ConnectWithQRCode = () => {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const { connector, triggerResize } = useOpenfort();
|
|
63
|
+
const bridge = useEthereumBridge();
|
|
64
|
+
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;
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
triggerResize();
|
|
67
|
+
}, [isConnected]);
|
|
68
|
+
const wallet = useExternalConnector(connector.id);
|
|
69
|
+
if (!wallet)
|
|
70
|
+
return jsx(Loader, { header: `Connector not found: ${connector.id}`, isError: true });
|
|
71
|
+
if (isConnected) {
|
|
72
|
+
return jsx(ConnectWithSiwe, {});
|
|
73
|
+
}
|
|
74
|
+
return jsx(ConnectWithWalletConnect, {});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export { ConnectWithQRCode as default };
|
|
78
|
+
//# sourceMappingURL=ConnectWithQRCode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectWithQRCode.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { ChainTypeEnum, OAuthProvider } from '@openfort/openfort-js';
|
|
3
|
+
import { useMemo, useRef, useEffect } from 'react';
|
|
4
|
+
import { useConnectionStrategy } from '../../core/ConnectionStrategyContext.js';
|
|
5
|
+
import { useOpenfortCore } from '../../openfort/useOpenfort.js';
|
|
6
|
+
import { logger } from '../../utils/logger.js';
|
|
7
|
+
import SwitchNetworks from '../../wagmi/components/SwitchNetworks/index.js';
|
|
8
|
+
import Modal from '../Common/Modal/index.js';
|
|
9
|
+
import { ConnectKitThemeProvider } from '../ConnectKitThemeProvider/ConnectKitThemeProvider.js';
|
|
10
|
+
import { routes } from '../Openfort/types.js';
|
|
11
|
+
import { useOpenfort } from '../Openfort/useOpenfort.js';
|
|
12
|
+
import About from '../Pages/About/index.js';
|
|
13
|
+
import { AssetInventory } from '../Pages/AssetInventory/index.js';
|
|
14
|
+
import Buy from '../Pages/Buy/index.js';
|
|
15
|
+
import BuyComplete from '../Pages/BuyComplete/index.js';
|
|
16
|
+
import BuyProcessing from '../Pages/BuyProcessing/index.js';
|
|
17
|
+
import BuyProviderSelect from '../Pages/BuyProviderSelect/index.js';
|
|
18
|
+
import BuySelectProvider from '../Pages/BuySelectProvider/index.js';
|
|
19
|
+
import { Connected } from '../Pages/Connected/index.js';
|
|
20
|
+
import ConnectedSuccess from '../Pages/ConnectedSuccess/index.js';
|
|
21
|
+
import Connectors from '../Pages/Connectors/index.js';
|
|
22
|
+
import CreateGuestUserPage from '../Pages/CreateGuestUserPage/index.js';
|
|
23
|
+
import CreateWallet from '../Pages/CreateWallet/index.js';
|
|
24
|
+
import DownloadApp from '../Pages/DownloadApp/index.js';
|
|
25
|
+
import EmailLogin from '../Pages/EmailLogin/index.js';
|
|
26
|
+
import EmailOTP from '../Pages/EmailOTP/index.js';
|
|
27
|
+
import EmailVerification from '../Pages/EmailVerification/index.js';
|
|
28
|
+
import ExportKey from '../Pages/ExportKey/index.js';
|
|
29
|
+
import ForgotPassword from '../Pages/ForgotPassword/index.js';
|
|
30
|
+
import LinkEmail from '../Pages/LinkEmail/index.js';
|
|
31
|
+
import LinkedProvider from '../Pages/LinkedProvider/index.js';
|
|
32
|
+
import LinkedProviders from '../Pages/LinkedProviders/index.js';
|
|
33
|
+
import Loading from '../Pages/Loading/index.js';
|
|
34
|
+
import LoadWallets from '../Pages/LoadWallets/index.js';
|
|
35
|
+
import MobileConnectors from '../Pages/MobileConnectors/index.js';
|
|
36
|
+
import { NoAssetsAvailable } from '../Pages/NoAssetsAvailable/index.js';
|
|
37
|
+
import Introduction from '../Pages/Onboarding/index.js';
|
|
38
|
+
import PhoneOTP from '../Pages/PhoneOTP/index.js';
|
|
39
|
+
import Profile from '../Pages/Profile/index.js';
|
|
40
|
+
import Providers from '../Pages/Providers/index.js';
|
|
41
|
+
import Receive from '../Pages/Receive/index.js';
|
|
42
|
+
import RecoverPage from '../Pages/Recover/index.js';
|
|
43
|
+
import RemoveLinkedProvider from '../Pages/RemoveLinkedProvider/index.js';
|
|
44
|
+
import SelectToken from '../Pages/SelectToken/index.js';
|
|
45
|
+
import SelectWalletToRecover from '../Pages/SelectWalletToRecover/index.js';
|
|
46
|
+
import Send from '../Pages/Send/index.js';
|
|
47
|
+
import { SolanaSend } from '../Pages/Send/SolanaSend.js';
|
|
48
|
+
import SendConfirmation from '../Pages/SendConfirmation/index.js';
|
|
49
|
+
import SocialProviders from '../Pages/SocialProviders/index.js';
|
|
50
|
+
import SolanaSendConfirmation from '../Pages/SolanaSendConfirmation/index.js';
|
|
51
|
+
import SolanaWallets from '../Pages/SolanaWallets/index.js';
|
|
52
|
+
import ConnectUsing from './ConnectUsing.js';
|
|
53
|
+
import ConnectWithMobile from './ConnectWithMobile.js';
|
|
54
|
+
|
|
55
|
+
function buildSharedPages() {
|
|
56
|
+
return {
|
|
57
|
+
onboarding: jsx(Introduction, {}),
|
|
58
|
+
about: jsx(About, {}),
|
|
59
|
+
loading: jsx(Loading, {}),
|
|
60
|
+
loadWallets: jsx(LoadWallets, {}),
|
|
61
|
+
connectedSuccess: jsx(ConnectedSuccess, {}),
|
|
62
|
+
createGuestUser: jsx(CreateGuestUserPage, {}),
|
|
63
|
+
socialProviders: jsx(SocialProviders, {}),
|
|
64
|
+
emailLogin: jsx(EmailLogin, {}),
|
|
65
|
+
emailOtp: jsx(EmailOTP, {}),
|
|
66
|
+
phoneOtp: jsx(PhoneOTP, {}),
|
|
67
|
+
forgotPassword: jsx(ForgotPassword, {}),
|
|
68
|
+
emailVerification: jsx(EmailVerification, {}),
|
|
69
|
+
linkEmail: jsx(LinkEmail, {}),
|
|
70
|
+
createWallet: jsx(CreateWallet, {}),
|
|
71
|
+
recoverWallets: jsx(RecoverPage, {}),
|
|
72
|
+
download: jsx(DownloadApp, {}),
|
|
73
|
+
connectors: jsx(Connectors, {}),
|
|
74
|
+
mobileConnectors: jsx(MobileConnectors, {}),
|
|
75
|
+
selectWalletToRecover: jsx(SelectWalletToRecover, {}),
|
|
76
|
+
providers: jsx(Providers, {}),
|
|
77
|
+
connect: jsx(ConnectUsing, {}),
|
|
78
|
+
connected: jsx(Connected, {}),
|
|
79
|
+
profile: jsx(Profile, {}),
|
|
80
|
+
linkedProviders: jsx(LinkedProviders, {}),
|
|
81
|
+
linkedProvider: jsx(LinkedProvider, {}),
|
|
82
|
+
removeLinkedProvider: jsx(RemoveLinkedProvider, {}),
|
|
83
|
+
connectWithMobile: jsx(ConnectWithMobile, {}),
|
|
84
|
+
noAssetsAvailable: jsx(NoAssetsAvailable, {}),
|
|
85
|
+
assetInventory: jsx(AssetInventory, {}),
|
|
86
|
+
send: jsx(Send, {}),
|
|
87
|
+
sendConfirmation: jsx(SendConfirmation, {}),
|
|
88
|
+
sendTokenSelect: jsx(SelectToken, { isBuyFlow: false }),
|
|
89
|
+
buyTokenSelect: jsx(SelectToken, { isBuyFlow: true }),
|
|
90
|
+
buySelectProvider: jsx(BuySelectProvider, {}),
|
|
91
|
+
buyProcessing: jsx(BuyProcessing, {}),
|
|
92
|
+
buyComplete: jsx(BuyComplete, {}),
|
|
93
|
+
buyProviderSelect: jsx(BuyProviderSelect, {}),
|
|
94
|
+
receive: jsx(Receive, {}),
|
|
95
|
+
buy: jsx(Buy, {}),
|
|
96
|
+
exportKey: jsx(ExportKey, {}),
|
|
97
|
+
walletOverview: jsx(Connected, {}),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const CHAIN_PREFIXED_PAGES = {
|
|
101
|
+
[ChainTypeEnum.EVM]: {
|
|
102
|
+
'eth:connected': jsx(Connected, {}),
|
|
103
|
+
'eth:createWallet': jsx(CreateWallet, {}),
|
|
104
|
+
'eth:recoverWallet': jsx(RecoverPage, {}),
|
|
105
|
+
'eth:switchNetworks': jsx(SwitchNetworks, {}),
|
|
106
|
+
'eth:send': jsx(Send, {}),
|
|
107
|
+
'eth:receive': jsx(Receive, {}),
|
|
108
|
+
'eth:buy': jsx(Buy, {}),
|
|
109
|
+
'eth:connectors': jsx(Connectors, {}),
|
|
110
|
+
},
|
|
111
|
+
[ChainTypeEnum.SVM]: {
|
|
112
|
+
'sol:connected': jsx(Connected, {}),
|
|
113
|
+
'sol:createWallet': jsx(CreateWallet, {}),
|
|
114
|
+
'sol:recoverWallet': jsx(RecoverPage, {}),
|
|
115
|
+
'sol:send': jsx(SolanaSend, {}),
|
|
116
|
+
'sol:sendConfirmation': jsx(SolanaSendConfirmation, {}),
|
|
117
|
+
'sol:receive': jsx(Receive, {}),
|
|
118
|
+
'sol:wallets': jsx(SolanaWallets, {}),
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
const DEFAULT_CONNECTED_ROUTE = {
|
|
122
|
+
[ChainTypeEnum.EVM]: routes.ETH_CONNECTED,
|
|
123
|
+
[ChainTypeEnum.SVM]: routes.SOL_CONNECTED,
|
|
124
|
+
};
|
|
125
|
+
const customThemeDefault = {};
|
|
126
|
+
const ConnectModal = ({ mode = 'auto', theme = 'auto', customTheme = customThemeDefault, lang = 'en-US' }) => {
|
|
127
|
+
var _a;
|
|
128
|
+
const context = useOpenfort();
|
|
129
|
+
const core = useOpenfortCore();
|
|
130
|
+
const strategy = useConnectionStrategy();
|
|
131
|
+
const state = useMemo(() => ({
|
|
132
|
+
user: core.user,
|
|
133
|
+
embeddedAccounts: core.embeddedAccounts,
|
|
134
|
+
activeEmbeddedAddress: core.activeEmbeddedAddress,
|
|
135
|
+
chainType: context.chainType,
|
|
136
|
+
embeddedState: core.embeddedState,
|
|
137
|
+
}), [core.user, core.embeddedAccounts, core.activeEmbeddedAddress, context.chainType, core.embeddedState]);
|
|
138
|
+
const isConnected = (_a = strategy === null || strategy === void 0 ? void 0 : strategy.isConnected(state)) !== null && _a !== void 0 ? _a : false;
|
|
139
|
+
const chainId = strategy === null || strategy === void 0 ? void 0 : strategy.getChainId();
|
|
140
|
+
const chainIsSupported = chainId != null && context.chains.some((c) => c.id === chainId);
|
|
141
|
+
// Auto-close when the user goes from not-connected → connected while the modal is open.
|
|
142
|
+
// Using a ref to track the previous value so we only react to the false → true transition,
|
|
143
|
+
// not when the modal is opened while already connected (e.g. user opens profile).
|
|
144
|
+
const prevIsConnectedRef = useRef(isConnected);
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
const wasConnected = prevIsConnectedRef.current;
|
|
147
|
+
prevIsConnectedRef.current = isConnected;
|
|
148
|
+
if (!wasConnected && isConnected && context.open) {
|
|
149
|
+
context.setOpen(false);
|
|
150
|
+
}
|
|
151
|
+
}, [isConnected]);
|
|
152
|
+
//if chain is unsupported we enforce a "switch chain" prompt
|
|
153
|
+
const closeable = !(context.uiConfig.enforceSupportedChains && isConnected && !chainIsSupported);
|
|
154
|
+
const route = context.route.route;
|
|
155
|
+
const chainType = context.chainType;
|
|
156
|
+
const sharedPages = useMemo(buildSharedPages, []);
|
|
157
|
+
const pages = useMemo(() => ({ ...sharedPages, ...CHAIN_PREFIXED_PAGES[chainType] }), [sharedPages, chainType]);
|
|
158
|
+
const effectivePageId = route in pages && pages[route] != null ? route : DEFAULT_CONNECTED_ROUTE[chainType];
|
|
159
|
+
useEffect(() => {
|
|
160
|
+
if (effectivePageId !== route) {
|
|
161
|
+
context.setRoute(effectivePageId);
|
|
162
|
+
}
|
|
163
|
+
}, [effectivePageId, route, context.setRoute]);
|
|
164
|
+
function hide() {
|
|
165
|
+
context.setOpen(false);
|
|
166
|
+
}
|
|
167
|
+
// if auth redirect
|
|
168
|
+
useEffect(() => {
|
|
169
|
+
if (typeof window === 'undefined')
|
|
170
|
+
return;
|
|
171
|
+
const url = new URL(window.location.href.replace('?access_token=', '&access_token=')); // handle both ? and & cases
|
|
172
|
+
const provider = url.searchParams.get('openfortAuthProviderUI');
|
|
173
|
+
const emailVerification = url.searchParams.get('openfortEmailVerificationUI');
|
|
174
|
+
const forgotPassword = url.searchParams.get('openfortForgotPasswordUI');
|
|
175
|
+
logger.log('Checking for search parameters', { url, provider, emailVerification, forgotPassword });
|
|
176
|
+
if (emailVerification) {
|
|
177
|
+
context.setOpen(true);
|
|
178
|
+
context.setRoute(routes.EMAIL_VERIFICATION);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (forgotPassword) {
|
|
182
|
+
context.setOpen(true);
|
|
183
|
+
context.setRoute(routes.FORGOT_PASSWORD);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
function isProvider(value) {
|
|
187
|
+
if (!value)
|
|
188
|
+
return false;
|
|
189
|
+
return Object.values(OAuthProvider).includes(value);
|
|
190
|
+
}
|
|
191
|
+
if (isProvider(provider)) {
|
|
192
|
+
logger.log('Found auth provider', provider);
|
|
193
|
+
context.setOpen(true);
|
|
194
|
+
context.setConnector({ id: provider, type: 'oauth' });
|
|
195
|
+
context.setRoute({ route: routes.CONNECT, connectType: 'linkIfUserConnectIfNoUser' });
|
|
196
|
+
}
|
|
197
|
+
}, []);
|
|
198
|
+
useEffect(() => context.setMode(mode), [mode]);
|
|
199
|
+
useEffect(() => context.setTheme(theme), [theme]);
|
|
200
|
+
useEffect(() => context.setCustomTheme(customTheme), [customTheme]);
|
|
201
|
+
useEffect(() => context.setLang(lang), [lang]);
|
|
202
|
+
/* When pulling data into WalletConnect, it prioritises the og:title tag over the title tag */
|
|
203
|
+
useEffect(() => {
|
|
204
|
+
var _a;
|
|
205
|
+
const appName = (_a = context.uiConfig.appName) !== null && _a !== void 0 ? _a : 'Openfort';
|
|
206
|
+
if (!appName || !context.open)
|
|
207
|
+
return;
|
|
208
|
+
const title = document.createElement('meta');
|
|
209
|
+
title.setAttribute('property', 'og:title');
|
|
210
|
+
title.setAttribute('content', appName);
|
|
211
|
+
document.head.prepend(title);
|
|
212
|
+
/*
|
|
213
|
+
// OLD_TODO: When pulling data into WalletConnect, figure out which icon gets used and replace with appIcon if available
|
|
214
|
+
const appIcon = getAppIcon();
|
|
215
|
+
const icon = document.createElement('link');
|
|
216
|
+
if (appIcon) {
|
|
217
|
+
icon.setAttribute('rel', 'icon');
|
|
218
|
+
icon.setAttribute('href', appIcon);
|
|
219
|
+
document.head.prepend(icon);
|
|
220
|
+
}*/
|
|
221
|
+
return () => {
|
|
222
|
+
document.head.removeChild(title);
|
|
223
|
+
//if (appIcon) document.head.removeChild(icon);
|
|
224
|
+
};
|
|
225
|
+
}, [context.open]);
|
|
226
|
+
return (jsx(ConnectKitThemeProvider, { theme: theme, customTheme: customTheme, mode: mode, children: jsx(Modal, { open: context.open, pages: pages, pageId: effectivePageId, onClose: closeable ? hide : undefined }) }));
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export { ConnectModal as default };
|
|
230
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import wave from '../../assets/wave.js';
|
|
3
|
+
import { Graphic, LogoGroup, GraphicBackground, Logo, LogoPosition, LogoInner, FloatWrapper, RotateWrapper, LogoGraphic as LogoGraphic$1 } from './styles.js';
|
|
4
|
+
|
|
5
|
+
const LogoGraphic = ({ size = '100%', logo }) => {
|
|
6
|
+
return (jsx(Logo, { children: jsx(LogoPosition, { children: jsx(LogoInner, { children: jsx(FloatWrapper, { children: jsx(RotateWrapper, { children: jsx(LogoGraphic$1, { style: { transform: `scale(${size})` }, children: logo }) }) }) }) }) }));
|
|
7
|
+
};
|
|
8
|
+
const FloatingGraphic = ({ height = '130px', marginBottom, marginTop, logoCenter, logoTopRight, logoTopLeft, logoBottomRight, logoBottomLeft, }) => {
|
|
9
|
+
return (jsxs(Graphic, { "$height": height, "$marginBottom": marginBottom, "$marginTop": marginTop, children: [jsxs(LogoGroup, { children: [jsx(LogoGraphic, { ...logoCenter }), logoTopLeft ? jsx(LogoGraphic, { ...logoTopLeft }) : jsx("div", {}), logoTopRight ? jsx(LogoGraphic, { ...logoTopRight }) : jsx("div", {}), logoBottomLeft ? jsx(LogoGraphic, { ...logoBottomLeft }) : jsx("div", {}), logoBottomRight ? jsx(LogoGraphic, { ...logoBottomRight }) : jsx("div", {})] }), jsx(GraphicBackground, { children: wave })] }));
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { FloatingGraphic };
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { motion } from 'framer-motion';
|
|
2
|
+
import { keyframes } from 'styled-components';
|
|
3
|
+
import defaultTheme from '../../constants/defaultTheme.js';
|
|
4
|
+
import styled from '../../styles/styled/index.js';
|
|
5
|
+
|
|
6
|
+
const Graphic = styled(motion.div) `
|
|
7
|
+
position: relative;
|
|
8
|
+
margin-top: ${({ $marginTop }) => $marginTop !== null && $marginTop !== void 0 ? $marginTop : '16px'};
|
|
9
|
+
margin-bottom: ${({ $marginBottom }) => $marginBottom !== null && $marginBottom !== void 0 ? $marginBottom : '20px'};
|
|
10
|
+
margin-left: auto;
|
|
11
|
+
margin-right: auto;
|
|
12
|
+
height: ${({ $height }) => $height !== null && $height !== void 0 ? $height : '190px'};
|
|
13
|
+
max-width: 295px;
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
user-select: none;
|
|
16
|
+
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
|
|
17
|
+
height: 200px;
|
|
18
|
+
max-width: 100%;
|
|
19
|
+
margin-bottom: 32px;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
const LogoGroup = styled(motion.div) `
|
|
23
|
+
position: absolute;
|
|
24
|
+
inset: 0;
|
|
25
|
+
z-index: 2;
|
|
26
|
+
`;
|
|
27
|
+
const graphicIn = keyframes `
|
|
28
|
+
0%{
|
|
29
|
+
opacity:0;
|
|
30
|
+
transform:scale(0.9);
|
|
31
|
+
}
|
|
32
|
+
100%{
|
|
33
|
+
opacity:1;
|
|
34
|
+
transform:none;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
const GraphicBackground = styled(motion.div) `
|
|
38
|
+
z-index: 1;
|
|
39
|
+
position: absolute;
|
|
40
|
+
inset: 0;
|
|
41
|
+
top: -2px;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
&:before {
|
|
44
|
+
content: '';
|
|
45
|
+
position: absolute;
|
|
46
|
+
inset: 0;
|
|
47
|
+
background: var(--ck-body-background);
|
|
48
|
+
background: radial-gradient(
|
|
49
|
+
closest-side,
|
|
50
|
+
var(--ck-body-background-transparent, transparent) 18.75%,
|
|
51
|
+
var(--ck-body-background) 100%
|
|
52
|
+
);
|
|
53
|
+
background-size: 100%;
|
|
54
|
+
}
|
|
55
|
+
svg {
|
|
56
|
+
display: block;
|
|
57
|
+
width: 100%;
|
|
58
|
+
height: auto;
|
|
59
|
+
}
|
|
60
|
+
animation: ${graphicIn} 1000ms 100ms ease both;
|
|
61
|
+
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
|
|
62
|
+
animation: none;
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
const logoIn = keyframes `
|
|
66
|
+
0%{
|
|
67
|
+
opacity:0;
|
|
68
|
+
transform:scale(0) translateY(40%);
|
|
69
|
+
}
|
|
70
|
+
100%{
|
|
71
|
+
opacity:1;
|
|
72
|
+
transform:none;
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
const LogoPosition = styled(motion.div) `
|
|
76
|
+
position: absolute;
|
|
77
|
+
inset: 0;
|
|
78
|
+
animation: cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite both;
|
|
79
|
+
animation-delay: inherit;
|
|
80
|
+
`;
|
|
81
|
+
const LogoInner = styled(motion.div) `
|
|
82
|
+
position: absolute;
|
|
83
|
+
`;
|
|
84
|
+
const LogoGraphic = styled(motion.div) `
|
|
85
|
+
position: relative;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
height: 58px;
|
|
88
|
+
width: 58px;
|
|
89
|
+
border-radius: 13.84px;
|
|
90
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 2px 20px 0 rgba(0, 0, 0, 0.03);
|
|
91
|
+
|
|
92
|
+
svg {
|
|
93
|
+
display: block;
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: 100%;
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
const float = keyframes `
|
|
99
|
+
0%,100%{ transform:none; }
|
|
100
|
+
50%{ transform: translateY(-10%) }
|
|
101
|
+
`;
|
|
102
|
+
const FloatWrapper = styled(motion.div) `
|
|
103
|
+
position: relative;
|
|
104
|
+
animation: cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite both;
|
|
105
|
+
animation-name: ${float};
|
|
106
|
+
animation-duration: 3600ms;
|
|
107
|
+
`;
|
|
108
|
+
const rotate = keyframes `
|
|
109
|
+
0%,100%{ transform:rotate(-3deg); }
|
|
110
|
+
50%{ transform:rotate(3deg); }
|
|
111
|
+
`;
|
|
112
|
+
const RotateWrapper = styled(motion.div) `
|
|
113
|
+
position: relative;
|
|
114
|
+
animation: cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite both;
|
|
115
|
+
animation-name: ${rotate};
|
|
116
|
+
animation-duration: 3200ms;
|
|
117
|
+
`;
|
|
118
|
+
const Logo = styled(motion.div) `
|
|
119
|
+
position: absolute;
|
|
120
|
+
inset: 0;
|
|
121
|
+
|
|
122
|
+
animation: ${logoIn} 750ms cubic-bezier(0.19, 1, 0.22, 1) both;
|
|
123
|
+
&:nth-child(1){ z-index:2; animation-delay:0ms; }
|
|
124
|
+
&:nth-child(2){ z-index:1; animation-delay:60ms; }
|
|
125
|
+
&:nth-child(3){ z-index:1; animation-delay:30ms; }
|
|
126
|
+
&:nth-child(4){ z-index:1; animation-delay:90ms; }
|
|
127
|
+
&:nth-child(5){ z-index:1; animation-delay:120ms;}
|
|
128
|
+
|
|
129
|
+
&:nth-child(1){ ${RotateWrapper}{ animation-delay:0ms; } }
|
|
130
|
+
&:nth-child(2){ ${RotateWrapper}{ animation-delay:-600ms; } }
|
|
131
|
+
&:nth-child(3){ ${RotateWrapper}{ animation-delay:-1200ms; } }
|
|
132
|
+
&:nth-child(4){ ${RotateWrapper}{ animation-delay:-1800ms; } }
|
|
133
|
+
&:nth-child(5){ ${RotateWrapper}{ animation-delay:-2400ms; } }
|
|
134
|
+
|
|
135
|
+
&:nth-child(1){ ${FloatWrapper}{ animation-delay:-200ms; } }
|
|
136
|
+
&:nth-child(2){ ${FloatWrapper}{ animation-delay:-600ms; } }
|
|
137
|
+
&:nth-child(3){ ${FloatWrapper}{ animation-delay:-800ms; } }
|
|
138
|
+
&:nth-child(4){ ${FloatWrapper}{ animation-delay:-300ms; } }
|
|
139
|
+
&:nth-child(5){ ${FloatWrapper}{ animation-delay:-3200ms; } }
|
|
140
|
+
|
|
141
|
+
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
|
|
142
|
+
animation: none !important;
|
|
143
|
+
${RotateWrapper},${FloatWrapper} {
|
|
144
|
+
animation: none !important;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
${LogoInner} {
|
|
149
|
+
transform: translate(-50%, -50%);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&:nth-child(1) ${LogoPosition} {
|
|
153
|
+
transform: translate(50%, 50%);
|
|
154
|
+
${LogoGraphic} {
|
|
155
|
+
border-radius: 17.2px;
|
|
156
|
+
width: 72px;
|
|
157
|
+
height: 72px;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
&:nth-child(2) ${LogoPosition} {
|
|
161
|
+
transform: translate(21%, 21.5%);
|
|
162
|
+
}
|
|
163
|
+
&:nth-child(3) ${LogoPosition} {
|
|
164
|
+
transform: translate(78%, 14%);
|
|
165
|
+
}
|
|
166
|
+
&:nth-child(4) ${LogoPosition} {
|
|
167
|
+
transform: translate(22.5%, 76%);
|
|
168
|
+
}
|
|
169
|
+
&:nth-child(5) ${LogoPosition} {
|
|
170
|
+
transform: translate(76%, 80%);
|
|
171
|
+
}
|
|
172
|
+
`;
|
|
173
|
+
|
|
174
|
+
export { FloatWrapper, Graphic, GraphicBackground, Logo, LogoGraphic, LogoGroup, LogoInner, LogoPosition, RotateWrapper };
|
|
175
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|