@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,42 @@
|
|
|
1
|
+
import { logger } from './logger.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Utility to handle and provide better error messages for OAuth configuration errors
|
|
5
|
+
*/
|
|
6
|
+
function handleOAuthConfigError(error) {
|
|
7
|
+
const message = error instanceof Error
|
|
8
|
+
? error.message
|
|
9
|
+
: typeof error === 'object' && error && 'message' in error
|
|
10
|
+
? String(error.message)
|
|
11
|
+
: '';
|
|
12
|
+
if (message.includes('OAuth Config with provider') && message.includes('not found')) {
|
|
13
|
+
const providerMatch = message.match(/provider\s+(\w+)\s+not found/i);
|
|
14
|
+
const provider = providerMatch ? providerMatch[1] : 'unknown';
|
|
15
|
+
const providerLower = provider.toLowerCase();
|
|
16
|
+
// Provider-specific configuration hints
|
|
17
|
+
const configHints = {
|
|
18
|
+
playfab: '- PlayFab title ID: Your PlayFab title ID',
|
|
19
|
+
firebase: '- Firebase project ID: Your Firebase project ID (e.g., test-d3dd3)',
|
|
20
|
+
'better-auth': '- Better Auth backend url: Your Better Auth service URL (e.g., https://your-domain.com/api/auth)',
|
|
21
|
+
supabase: '- Supabase url: Your Supabase project URL (e.g., https://xxxxx.supabase.co)\n - Supabase key: Your Supabase anon/public key',
|
|
22
|
+
lootlocker: '- Enable LootLocker authentication in your Openfort dashboard',
|
|
23
|
+
oidc: '- JWKS URL: URL to JSON Web Key Set for OIDC provider\n - Verifiable Public Key: PEM encoded public key to verify JWT tokens (if JWKS URL not provided)\n - Audience: Expected audience value in the ID token',
|
|
24
|
+
custom: '- Authentication URL: Your custom authentication endpoint (e.g., https://your-domain.com/api/openfort/verify)\n' +
|
|
25
|
+
' - Headers: Comma-separated list of headers to include (e.g., X-Openfort-Secret: your-shared-secret)',
|
|
26
|
+
};
|
|
27
|
+
const hint = configHints[providerLower] || configHints.custom;
|
|
28
|
+
logger.error(`❌ Openfort OAuth Configuration Error:\n\n` +
|
|
29
|
+
`The OAuth provider "${provider}" is not configured in your Openfort account.\n\n` +
|
|
30
|
+
`To fix this:\n` +
|
|
31
|
+
`1. Go to https://dashboard.openfort.io\n` +
|
|
32
|
+
`2. Navigate to Configuration → Providers\n` +
|
|
33
|
+
`3. Enable "${provider}" in the Third Party Authentication section\n` +
|
|
34
|
+
`4. Configure the required fields:\n` +
|
|
35
|
+
` ${hint}\n` +
|
|
36
|
+
`5. Click "Save"\n\n` +
|
|
37
|
+
`See: https://www.openfort.io/docs/configuration/external-auth`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { handleOAuthConfigError };
|
|
42
|
+
//# sourceMappingURL=oauthErrorHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauthErrorHandler.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const hexToP3 = (hex) => {
|
|
2
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
3
|
+
if (result == null)
|
|
4
|
+
return hex;
|
|
5
|
+
const values = {
|
|
6
|
+
r: parseInt(result[1], 16),
|
|
7
|
+
g: parseInt(result[2], 16),
|
|
8
|
+
b: parseInt(result[3], 16),
|
|
9
|
+
};
|
|
10
|
+
return `color(display-p3 ${values.r / 255} ${values.g / 255} ${values.b / 255})`;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { hexToP3 };
|
|
14
|
+
//# sourceMappingURL=p3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"p3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RPC Utilities
|
|
3
|
+
*
|
|
4
|
+
* Default RPC URLs and chain metadata — sourced from viem/chains where possible.
|
|
5
|
+
* Production apps must provide their own RPCs via walletConfig.ethereum.rpcUrls.
|
|
6
|
+
*/
|
|
7
|
+
import type { Chain } from 'viem';
|
|
8
|
+
import type { SolanaCluster } from '../solana/types';
|
|
9
|
+
/**
|
|
10
|
+
* Get default Ethereum RPC URL for a chain ID.
|
|
11
|
+
* Returns the viem/chains default RPC when known, falls back to Sepolia.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getDefaultEthereumRpcUrl(chainId: number): string;
|
|
14
|
+
/**
|
|
15
|
+
* Get default Solana RPC URL for a cluster.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getDefaultSolanaRpcUrl(cluster: SolanaCluster): string;
|
|
18
|
+
/**
|
|
19
|
+
* Get chain name by chain ID.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getChainName(chainId: number): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get native currency configuration for a chain.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getNativeCurrency(chainId: number): {
|
|
26
|
+
name: string;
|
|
27
|
+
symbol: string;
|
|
28
|
+
decimals: number;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Build a viem Chain from chainId and optional rpcUrls (e.g. from walletConfig.ethereum.rpcUrls).
|
|
32
|
+
* Returns the viem/chains object directly when the chain is known and no custom RPC is provided.
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildChainFromConfig(chainId: number, rpcUrls?: Record<number, string>): Chain;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { defineChain } from 'viem';
|
|
2
|
+
import { polygonAmoy, baseSepolia, beamTestnet, sepolia, optimismSepolia, arbitrumSepolia } from 'viem/chains';
|
|
3
|
+
import { logger } from './logger.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* RPC Utilities
|
|
7
|
+
*
|
|
8
|
+
* Default RPC URLs and chain metadata — sourced from viem/chains where possible.
|
|
9
|
+
* Production apps must provide their own RPCs via walletConfig.ethereum.rpcUrls.
|
|
10
|
+
*/
|
|
11
|
+
/** Known chains sourced from viem/chains — authoritative metadata (name, nativeCurrency, rpcUrls, blockExplorers). */
|
|
12
|
+
const KNOWN_CHAINS = {
|
|
13
|
+
[polygonAmoy.id]: polygonAmoy,
|
|
14
|
+
[baseSepolia.id]: baseSepolia,
|
|
15
|
+
[beamTestnet.id]: beamTestnet,
|
|
16
|
+
[sepolia.id]: sepolia,
|
|
17
|
+
[optimismSepolia.id]: optimismSepolia,
|
|
18
|
+
[arbitrumSepolia.id]: arbitrumSepolia,
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Default Solana RPC URLs by cluster.
|
|
22
|
+
* Production apps should provide their own RPCs via walletConfig.solana.rpcUrls.
|
|
23
|
+
*/
|
|
24
|
+
const DEFAULT_SOLANA_RPC_URLS = {
|
|
25
|
+
'mainnet-beta': 'https://api.mainnet-beta.solana.com',
|
|
26
|
+
devnet: 'https://api.devnet.solana.com',
|
|
27
|
+
testnet: 'https://api.testnet.solana.com',
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Get default Ethereum RPC URL for a chain ID.
|
|
31
|
+
* Returns the viem/chains default RPC when known, falls back to Sepolia.
|
|
32
|
+
*/
|
|
33
|
+
function getDefaultEthereumRpcUrl(chainId) {
|
|
34
|
+
const chain = KNOWN_CHAINS[chainId];
|
|
35
|
+
const rpcUrl = chain === null || chain === void 0 ? void 0 : chain.rpcUrls.default.http[0];
|
|
36
|
+
if (!rpcUrl) {
|
|
37
|
+
logger.warn(`No default Ethereum RPC URL found for chain ${chainId}. Configure rpcUrls in OpenfortProvider for better reliability and rate limits.`);
|
|
38
|
+
return sepolia.rpcUrls.default.http[0];
|
|
39
|
+
}
|
|
40
|
+
return rpcUrl;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get default Solana RPC URL for a cluster.
|
|
44
|
+
*/
|
|
45
|
+
function getDefaultSolanaRpcUrl(cluster) {
|
|
46
|
+
if (!DEFAULT_SOLANA_RPC_URLS[cluster]) {
|
|
47
|
+
logger.warn(`No default Solana RPC URL found for cluster ${cluster}. Configure rpcUrls in OpenfortProvider for better reliability and rate limits.`);
|
|
48
|
+
return 'https://api.devnet.solana.com';
|
|
49
|
+
}
|
|
50
|
+
return DEFAULT_SOLANA_RPC_URLS[cluster];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get chain name by chain ID.
|
|
54
|
+
*/
|
|
55
|
+
function getChainName(chainId) {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
return (_b = (_a = KNOWN_CHAINS[chainId]) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : `Chain ${chainId}`;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get native currency configuration for a chain.
|
|
61
|
+
*/
|
|
62
|
+
function getNativeCurrency(chainId) {
|
|
63
|
+
var _a, _b;
|
|
64
|
+
return (_b = (_a = KNOWN_CHAINS[chainId]) === null || _a === void 0 ? void 0 : _a.nativeCurrency) !== null && _b !== void 0 ? _b : { name: 'Ether', symbol: 'ETH', decimals: 18 };
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Build a viem Chain from chainId and optional rpcUrls (e.g. from walletConfig.ethereum.rpcUrls).
|
|
68
|
+
* Returns the viem/chains object directly when the chain is known and no custom RPC is provided.
|
|
69
|
+
*/
|
|
70
|
+
function buildChainFromConfig(chainId, rpcUrls) {
|
|
71
|
+
var _a, _b, _c;
|
|
72
|
+
const customRpcUrl = rpcUrls === null || rpcUrls === void 0 ? void 0 : rpcUrls[chainId];
|
|
73
|
+
const knownChain = KNOWN_CHAINS[chainId];
|
|
74
|
+
if (knownChain && !customRpcUrl) {
|
|
75
|
+
return knownChain;
|
|
76
|
+
}
|
|
77
|
+
const rpcUrl = customRpcUrl !== null && customRpcUrl !== void 0 ? customRpcUrl : knownChain === null || knownChain === void 0 ? void 0 : knownChain.rpcUrls.default.http[0];
|
|
78
|
+
if (!rpcUrl) {
|
|
79
|
+
throw new Error(`No RPC URL configured for chain ${chainId}. Provide walletConfig.ethereum.rpcUrls[${chainId}].`);
|
|
80
|
+
}
|
|
81
|
+
const native = (_a = knownChain === null || knownChain === void 0 ? void 0 : knownChain.nativeCurrency) !== null && _a !== void 0 ? _a : { name: 'Ether', symbol: 'ETH', decimals: 18 };
|
|
82
|
+
const explorerUrl = (_b = knownChain === null || knownChain === void 0 ? void 0 : knownChain.blockExplorers) === null || _b === void 0 ? void 0 : _b.default.url;
|
|
83
|
+
return defineChain({
|
|
84
|
+
id: chainId,
|
|
85
|
+
name: (_c = knownChain === null || knownChain === void 0 ? void 0 : knownChain.name) !== null && _c !== void 0 ? _c : `Chain ${chainId}`,
|
|
86
|
+
nativeCurrency: native,
|
|
87
|
+
rpcUrls: { default: { http: [rpcUrl] } },
|
|
88
|
+
...(explorerUrl && { blockExplorers: { default: { name: 'Explorer', url: explorerUrl } } }),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { buildChainFromConfig, getChainName, getDefaultEthereumRpcUrl, getDefaultSolanaRpcUrl, getNativeCurrency };
|
|
93
|
+
//# sourceMappingURL=rpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
function useOnUserReturn(callback) {
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
if (typeof window === 'undefined')
|
|
6
|
+
return;
|
|
7
|
+
const handleVisibilityChange = () => {
|
|
8
|
+
if (document.visibilityState === 'visible') {
|
|
9
|
+
callback();
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const handleFocus = () => {
|
|
13
|
+
callback();
|
|
14
|
+
};
|
|
15
|
+
document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
16
|
+
window.addEventListener('focus', handleFocus);
|
|
17
|
+
return () => {
|
|
18
|
+
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
19
|
+
window.removeEventListener('focus', handleFocus);
|
|
20
|
+
};
|
|
21
|
+
}, [callback]);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { useOnUserReturn };
|
|
25
|
+
//# sourceMappingURL=useOnUserReturn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOnUserReturn.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/build/utils/wallets.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
/** EIP-1193 provider injected by wallets (MetaMask, etc.); may have providers array when multiple injected */
|
|
2
|
+
type EthereumWindowProvider = Record<string, unknown> & {
|
|
3
|
+
providers?: Record<string, unknown>[];
|
|
4
|
+
};
|
|
1
5
|
declare global {
|
|
2
6
|
interface Window {
|
|
3
7
|
trustWallet: any;
|
|
4
8
|
trustwallet: any;
|
|
9
|
+
ethereum?: EthereumWindowProvider;
|
|
5
10
|
}
|
|
6
11
|
}
|
|
7
12
|
export declare const isFamily: () => boolean;
|
|
8
13
|
export declare const isPhantom: () => boolean;
|
|
9
14
|
export declare const isArgent: () => boolean;
|
|
10
15
|
export declare const isSafe: () => boolean;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const isWalletInstalled = (name) => {
|
|
2
|
+
var _a;
|
|
3
|
+
if (typeof window === 'undefined')
|
|
4
|
+
return false;
|
|
5
|
+
const { ethereum } = window;
|
|
6
|
+
return !!((ethereum === null || ethereum === void 0 ? void 0 : ethereum[`is${name}`]) || ((_a = ethereum === null || ethereum === void 0 ? void 0 : ethereum.providers) === null || _a === void 0 ? void 0 : _a.find((provider) => provider === null || provider === void 0 ? void 0 : provider[`is${name}`])));
|
|
7
|
+
};
|
|
8
|
+
const isFamily = () => isWalletInstalled('Family');
|
|
9
|
+
const isPhantom = () => isWalletInstalled('Phantom');
|
|
10
|
+
const isArgent = () => isWalletInstalled('Argent');
|
|
11
|
+
const isSafe = () => isWalletInstalled('Safe');
|
|
12
|
+
|
|
13
|
+
export { isArgent, isFamily, isPhantom, isSafe };
|
|
14
|
+
//# sourceMappingURL=wallets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallets.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
package/build/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const OPENFORT_VERSION = "0.
|
|
1
|
+
export declare const OPENFORT_VERSION = "1.0.0";
|
package/build/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { getEnsAddress, getEnsName, getEnsAvatar } from '@wagmi/core';
|
|
2
|
+
import { useRef, useMemo, useCallback, createElement } from 'react';
|
|
3
|
+
import { normalize } from 'viem/ens';
|
|
4
|
+
import { useAccount, useChainId, useConfig, useDisconnect, useConnect, useSwitchChain, useSignMessage, useWalletClient, useEnsName, useEnsAvatar } from 'wagmi';
|
|
5
|
+
import { OpenfortEthereumBridgeContext } from '../ethereum/OpenfortEthereumBridgeContext.js';
|
|
6
|
+
import { shouldExcludeConnector } from './connectorFilter.js';
|
|
7
|
+
|
|
8
|
+
function mapConnector(c) {
|
|
9
|
+
return { id: c.id, name: c.name, icon: c.icon, type: c.type, getProvider: c.getProvider };
|
|
10
|
+
}
|
|
11
|
+
const OpenfortWagmiBridge = ({ children }) => {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const { address, chain, isConnected, isConnecting, isReconnecting, connector } = useAccount();
|
|
14
|
+
const chainId = useChainId();
|
|
15
|
+
const config = useConfig();
|
|
16
|
+
const { disconnectAsync } = useDisconnect();
|
|
17
|
+
const { connect, connectAsync: wagmiConnectAsync, connectors, reset } = useConnect();
|
|
18
|
+
const { chains, switchChain, switchChainAsync, isPending: isSwitchChainPending, error: switchChainError, } = useSwitchChain();
|
|
19
|
+
const { signMessageAsync } = useSignMessage();
|
|
20
|
+
const { data: walletClient } = useWalletClient();
|
|
21
|
+
const accountAddress = (_b = (_a = walletClient === null || walletClient === void 0 ? void 0 : walletClient.account) === null || _a === void 0 ? void 0 : _a.address) !== null && _b !== void 0 ? _b : address;
|
|
22
|
+
const { data: ensName } = useEnsName({ address: accountAddress, chainId: 1 });
|
|
23
|
+
const { data: ensAvatar } = useEnsAvatar({ name: ensName ? normalize(ensName) : undefined, chainId: 1 });
|
|
24
|
+
const connectorKey = connectors.map((c) => c.id).join(',');
|
|
25
|
+
const connectorsRef = useRef(connectors);
|
|
26
|
+
if (connectorsRef.current.map((c) => c.id).join(',') !== connectorKey) {
|
|
27
|
+
connectorsRef.current = connectors;
|
|
28
|
+
}
|
|
29
|
+
const stableConnectors = connectorsRef.current;
|
|
30
|
+
const bridgeConnectors = useMemo(() => {
|
|
31
|
+
const mapped = stableConnectors.map((c) => mapConnector(c));
|
|
32
|
+
return mapped
|
|
33
|
+
.filter((w, i, self) => self.findIndex((x) => x.id === w.id) === i)
|
|
34
|
+
.filter((w) => !shouldExcludeConnector(w, mapped));
|
|
35
|
+
}, [stableConnectors]);
|
|
36
|
+
const connectBridge = useCallback((params) => {
|
|
37
|
+
const c = stableConnectors.find((x) => x.id === params.connector.id);
|
|
38
|
+
if (c)
|
|
39
|
+
connect({ connector: c });
|
|
40
|
+
}, [stableConnectors, connect]);
|
|
41
|
+
const connectAsyncBridge = useCallback(async (params) => {
|
|
42
|
+
const c = stableConnectors.find((x) => x.id === params.connector.id);
|
|
43
|
+
if (!c)
|
|
44
|
+
throw new Error('Connector not found');
|
|
45
|
+
return wagmiConnectAsync({ connector: c });
|
|
46
|
+
}, [stableConnectors, wagmiConnectAsync]);
|
|
47
|
+
const getEnsAddress$1 = useCallback(async (name) => {
|
|
48
|
+
var _a;
|
|
49
|
+
try {
|
|
50
|
+
return (_a = (await getEnsAddress(config, { name: normalize(name), chainId: 1 }))) !== null && _a !== void 0 ? _a : undefined;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
}, [config]);
|
|
56
|
+
const getEnsName$1 = useCallback(async (params) => {
|
|
57
|
+
var _a;
|
|
58
|
+
try {
|
|
59
|
+
return (_a = (await getEnsName(config, { address: params.address, chainId: 1 }))) !== null && _a !== void 0 ? _a : undefined;
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
}, [config]);
|
|
65
|
+
const getEnsAvatar$1 = useCallback(async (name) => {
|
|
66
|
+
var _a;
|
|
67
|
+
try {
|
|
68
|
+
return (_a = (await getEnsAvatar(config, { name: normalize(name), chainId: 1 }))) !== null && _a !== void 0 ? _a : undefined;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
}, [config]);
|
|
74
|
+
const getConnectorAccounts = useCallback(async (connectorBridge) => {
|
|
75
|
+
const c = stableConnectors.find((x) => x.id === connectorBridge.id);
|
|
76
|
+
if (!(c === null || c === void 0 ? void 0 : c.getAccounts))
|
|
77
|
+
return [];
|
|
78
|
+
const accounts = await c.getAccounts();
|
|
79
|
+
return accounts;
|
|
80
|
+
}, [stableConnectors]);
|
|
81
|
+
const signMessage = useCallback(async (params) => {
|
|
82
|
+
if (!signMessageAsync)
|
|
83
|
+
throw new Error('signMessage not available');
|
|
84
|
+
return signMessageAsync({ message: params.message });
|
|
85
|
+
}, [signMessageAsync]);
|
|
86
|
+
const getWalletClient = useCallback(async () => walletClient !== null && walletClient !== void 0 ? walletClient : undefined, [walletClient]);
|
|
87
|
+
const value = useMemo(() => ({
|
|
88
|
+
account: {
|
|
89
|
+
address: accountAddress,
|
|
90
|
+
chain: chain ? { id: chain.id, name: chain.name } : undefined,
|
|
91
|
+
isConnected: (isConnected !== null && isConnected !== void 0 ? isConnected : false) && !isConnecting && !isReconnecting,
|
|
92
|
+
isConnecting: isConnecting !== null && isConnecting !== void 0 ? isConnecting : false,
|
|
93
|
+
isReconnecting: isReconnecting !== null && isReconnecting !== void 0 ? isReconnecting : false,
|
|
94
|
+
connector: connector ? mapConnector(connector) : undefined,
|
|
95
|
+
ensName: ensName !== null && ensName !== void 0 ? ensName : undefined,
|
|
96
|
+
ensAvatar: ensAvatar !== null && ensAvatar !== void 0 ? ensAvatar : undefined,
|
|
97
|
+
},
|
|
98
|
+
chainId,
|
|
99
|
+
config: {
|
|
100
|
+
chains: config.chains.map((ch) => ({ id: ch.id })),
|
|
101
|
+
getClient: (opts) => {
|
|
102
|
+
var _a, _b;
|
|
103
|
+
const client = config.getClient({ chainId: opts.chainId });
|
|
104
|
+
return {
|
|
105
|
+
transport: {
|
|
106
|
+
url: (_b = (_a = client === null || client === void 0 ? void 0 : client.transport) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : '',
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
},
|
|
110
|
+
storage: config.storage
|
|
111
|
+
? {
|
|
112
|
+
getItem: (key) => { var _a, _b; return Promise.resolve((_b = (_a = config.storage) === null || _a === void 0 ? void 0 : _a.getItem(key)) !== null && _b !== void 0 ? _b : null); },
|
|
113
|
+
setItem: (key, value) => { var _a; return (_a = config.storage) === null || _a === void 0 ? void 0 : _a.setItem(key, value); },
|
|
114
|
+
}
|
|
115
|
+
: undefined,
|
|
116
|
+
},
|
|
117
|
+
disconnect: disconnectAsync,
|
|
118
|
+
connect: connectBridge,
|
|
119
|
+
connectAsync: connectAsyncBridge,
|
|
120
|
+
reset,
|
|
121
|
+
connectors: bridgeConnectors,
|
|
122
|
+
switchChain: {
|
|
123
|
+
chains: chains.map((ch) => ({ id: ch.id, name: ch.name })),
|
|
124
|
+
switchChain: switchChain !== null && switchChain !== void 0 ? switchChain : undefined,
|
|
125
|
+
switchChainAsync,
|
|
126
|
+
isPending: isSwitchChainPending,
|
|
127
|
+
error: switchChainError !== null && switchChainError !== void 0 ? switchChainError : null,
|
|
128
|
+
},
|
|
129
|
+
getEnsAddress: getEnsAddress$1,
|
|
130
|
+
getEnsName: getEnsName$1,
|
|
131
|
+
getEnsAvatar: getEnsAvatar$1,
|
|
132
|
+
getConnectorAccounts,
|
|
133
|
+
signMessage,
|
|
134
|
+
getWalletClient,
|
|
135
|
+
}), [
|
|
136
|
+
accountAddress,
|
|
137
|
+
chain,
|
|
138
|
+
isConnected,
|
|
139
|
+
isConnecting,
|
|
140
|
+
isReconnecting,
|
|
141
|
+
connector,
|
|
142
|
+
chainId,
|
|
143
|
+
config,
|
|
144
|
+
disconnectAsync,
|
|
145
|
+
connectBridge,
|
|
146
|
+
connectAsyncBridge,
|
|
147
|
+
reset,
|
|
148
|
+
bridgeConnectors,
|
|
149
|
+
chains,
|
|
150
|
+
switchChain,
|
|
151
|
+
isSwitchChainPending,
|
|
152
|
+
switchChainError,
|
|
153
|
+
ensName,
|
|
154
|
+
ensAvatar,
|
|
155
|
+
getEnsAddress$1,
|
|
156
|
+
getEnsName$1,
|
|
157
|
+
getEnsAvatar$1,
|
|
158
|
+
getConnectorAccounts,
|
|
159
|
+
signMessage,
|
|
160
|
+
getWalletClient,
|
|
161
|
+
]);
|
|
162
|
+
return createElement(OpenfortEthereumBridgeContext.Provider, { value }, children);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export { OpenfortWagmiBridge };
|
|
166
|
+
//# sourceMappingURL=OpenfortWagmiBridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenfortWagmiBridge.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { motion } from 'framer-motion';
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
import { css } from 'styled-components';
|
|
5
|
+
import { useChainId, useSwitchChain } from 'wagmi';
|
|
6
|
+
import Chain from '../../../components/Common/Chain/index.js';
|
|
7
|
+
import Tooltip from '../../../components/Common/Tooltip/index.js';
|
|
8
|
+
import { routes } from '../../../components/Openfort/types.js';
|
|
9
|
+
import { useOpenfort } from '../../../components/Openfort/useOpenfort.js';
|
|
10
|
+
import defaultTheme from '../../../constants/defaultTheme.js';
|
|
11
|
+
import useLocales from '../../../hooks/useLocales.js';
|
|
12
|
+
import styled from '../../../styles/styled/index.js';
|
|
13
|
+
import { isMobile, flattenChildren } from '../../../utils/index.js';
|
|
14
|
+
import ChainSelectDropdown from '../ChainSelectDropdown/index.js';
|
|
15
|
+
|
|
16
|
+
const Container = styled(motion.div) ``;
|
|
17
|
+
const SwitchChainButton = styled(motion.button) `
|
|
18
|
+
--color: var(
|
|
19
|
+
--ck-dropdown-button-color,
|
|
20
|
+
var(--ck-button-primary-color, var(--ck-body-color))
|
|
21
|
+
);
|
|
22
|
+
--background: var(
|
|
23
|
+
--ck-dropdown-button-background,
|
|
24
|
+
var(--ck-secondary-button-background, var(--ck-body-background-secondary))
|
|
25
|
+
);
|
|
26
|
+
--box-shadow: var(
|
|
27
|
+
--ck-dropdown-button-box-shadow,
|
|
28
|
+
var(
|
|
29
|
+
--ck-secondary-button-box-shadow,
|
|
30
|
+
var(--ck-button-primary-box-shadow),
|
|
31
|
+
none
|
|
32
|
+
)
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
--hover-color: var(--ck-dropdown-button-hover-color, var(--color));
|
|
36
|
+
--hover-background: var(
|
|
37
|
+
--ck-dropdown-button-hover-background,
|
|
38
|
+
var(--background)
|
|
39
|
+
);
|
|
40
|
+
--hover-box-shadow: var(
|
|
41
|
+
--ck-dropdown-button-hover-box-shadow,
|
|
42
|
+
var(--box-shadow)
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
--active-color: var(--ck-dropdown-button-active-color, var(--hover-color));
|
|
46
|
+
--active-background: var(
|
|
47
|
+
--ck-dropdown-button-active-background,
|
|
48
|
+
var(--hover-background)
|
|
49
|
+
);
|
|
50
|
+
--active-box-shadow: var(
|
|
51
|
+
--ck-dropdown-button-active-box-shadow,
|
|
52
|
+
var(--hover-box-shadow)
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
appearance: none;
|
|
56
|
+
user-select: none;
|
|
57
|
+
position: relative;
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
border-radius: 15px;
|
|
62
|
+
width: 52px;
|
|
63
|
+
height: 30px;
|
|
64
|
+
padding: 2px 6px 2px 3px;
|
|
65
|
+
font-size: 16px;
|
|
66
|
+
line-height: 19px;
|
|
67
|
+
font-weight: 500;
|
|
68
|
+
text-decoration: none;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
transform: translateZ(0px);
|
|
71
|
+
|
|
72
|
+
transition: 100ms ease;
|
|
73
|
+
transition-property: transform, background-color, box-shadow, color;
|
|
74
|
+
|
|
75
|
+
color: var(--color);
|
|
76
|
+
background: var(--background);
|
|
77
|
+
box-shadow: var(--box-shadow);
|
|
78
|
+
|
|
79
|
+
svg {
|
|
80
|
+
position: relative;
|
|
81
|
+
display: block;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
${(props) => props.disabled
|
|
85
|
+
? css `
|
|
86
|
+
width: auto;
|
|
87
|
+
padding: 3px;
|
|
88
|
+
position: relative;
|
|
89
|
+
left: -22px;
|
|
90
|
+
`
|
|
91
|
+
: css `
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
|
|
94
|
+
@media only screen and (min-width: ${defaultTheme.mobileWidth + 1}px) {
|
|
95
|
+
&:hover,
|
|
96
|
+
&:focus-visible {
|
|
97
|
+
color: var(--hover-color);
|
|
98
|
+
background: var(--hover-background);
|
|
99
|
+
box-shadow: var(--hover-box-shadow);
|
|
100
|
+
}
|
|
101
|
+
&:active {
|
|
102
|
+
color: var(--active-color);
|
|
103
|
+
background: var(--active-background);
|
|
104
|
+
box-shadow: var(--active-box-shadow);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`}
|
|
108
|
+
`;
|
|
109
|
+
const ChevronDown = ({ ...props }) => (jsx("svg", { "aria-hidden": "true", width: "11", height: "6", viewBox: "0 0 11 6", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M1.5 1L5.5 5L9.5 1", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
110
|
+
const ChainSelector = () => {
|
|
111
|
+
var _a;
|
|
112
|
+
const { open, triggerResize, setRoute } = useOpenfort();
|
|
113
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
114
|
+
const chainId = useChainId();
|
|
115
|
+
const { chains } = useSwitchChain();
|
|
116
|
+
const chain = chains.find((c) => c.id === chainId);
|
|
117
|
+
const locales = useLocales({
|
|
118
|
+
CHAIN: (_a = chain === null || chain === void 0 ? void 0 : chain.name) !== null && _a !== void 0 ? _a : 'UNKNOWN',
|
|
119
|
+
});
|
|
120
|
+
const mobile = isMobile() || (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.innerWidth) < defaultTheme.mobileWidth);
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
if (!open)
|
|
123
|
+
setIsOpen(false);
|
|
124
|
+
}, [open]);
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
triggerResize();
|
|
127
|
+
}, [chainId, triggerResize]);
|
|
128
|
+
const disabled = chains.length <= 1;
|
|
129
|
+
return (jsx(Container, { children: jsx(ChainSelectDropdown, { offsetX: -12, open: !mobile && isOpen, onClose: () => setIsOpen(false), children: chain && (jsxs(SwitchChainButton, { "aria-label": flattenChildren(locales.switchNetworks).toString(), disabled: disabled, onClick: () => {
|
|
130
|
+
if (mobile) {
|
|
131
|
+
setRoute(routes.ETH_SWITCH_NETWORK);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
setIsOpen(!isOpen);
|
|
135
|
+
}
|
|
136
|
+
}, children: [disabled ? (jsx(Tooltip, { message: locales.chainNetwork, xOffset: -6, delay: 0.01, children: jsx(Chain, { id: chain === null || chain === void 0 ? void 0 : chain.id }) })) : (jsx(Chain, { id: chain === null || chain === void 0 ? void 0 : chain.id })), !disabled && jsx(ChevronDown, { style: { top: 1, left: -3 } })] })) }) }));
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export { ChainSelector as default };
|
|
140
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|