@openfort/react 0.3.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/browsers.js +13 -0
- package/build/assets/browsers.js.map +1 -0
- package/build/assets/chains.js +139 -0
- package/build/assets/chains.js.map +1 -0
- package/build/assets/icons.js +41 -0
- package/build/assets/icons.js.map +1 -0
- package/build/assets/logos.js +173 -0
- package/build/assets/logos.js.map +1 -0
- package/build/assets/wave.js +6 -0
- package/build/assets/wave.js.map +1 -0
- package/build/components/BalanceButton/index.js +89 -0
- package/build/components/BalanceButton/index.js.map +1 -0
- package/build/components/Common/Alert/index.js +10 -0
- package/build/components/Common/Alert/index.js.map +1 -0
- package/build/components/Common/Alert/styles.js +55 -0
- package/build/components/Common/Alert/styles.js.map +1 -0
- package/build/components/Common/Avatar/index.d.ts +11 -3
- package/build/components/Common/Avatar/index.js +100 -0
- package/build/components/Common/Avatar/index.js.map +1 -0
- package/build/components/Common/Avatar/styles.js +59 -0
- package/build/components/Common/Avatar/styles.js.map +1 -0
- package/build/components/Common/BrowserIcon/index.js +28 -0
- package/build/components/Common/BrowserIcon/index.js.map +1 -0
- package/build/components/Common/BrowserIcon/styles.js +20 -0
- package/build/components/Common/BrowserIcon/styles.js.map +1 -0
- package/build/components/Common/Button/index.js +36 -0
- package/build/components/Common/Button/index.js.map +1 -0
- package/build/components/Common/Button/styles.js +302 -0
- package/build/components/Common/Button/styles.js.map +1 -0
- package/build/components/Common/Button/types.d.ts +1 -0
- package/build/components/Common/Chain/index.d.ts +8 -0
- package/build/components/Common/Chain/index.js +38 -0
- package/build/components/Common/Chain/index.js.map +1 -0
- package/build/components/Common/Chain/styles.js +94 -0
- package/build/components/Common/Chain/styles.js.map +1 -0
- package/build/components/Common/ConnectorList/index.js +58 -0
- package/build/components/Common/ConnectorList/index.js.map +1 -0
- package/build/components/Common/ConnectorList/styles.js +324 -0
- package/build/components/Common/ConnectorList/styles.js.map +1 -0
- package/build/components/Common/CopyToClipboard/CopyButton.js +12 -0
- package/build/components/Common/CopyToClipboard/CopyButton.js.map +1 -0
- package/build/components/Common/CopyToClipboard/CopyIcon.js +76 -0
- package/build/components/Common/CopyToClipboard/CopyIcon.js.map +1 -0
- package/build/components/Common/CopyToClipboard/CopyIconButton.js +38 -0
- package/build/components/Common/CopyToClipboard/CopyIconButton.js.map +1 -0
- package/build/components/Common/CopyToClipboard/CopyText.js +26 -0
- package/build/components/Common/CopyToClipboard/CopyText.js.map +1 -0
- package/build/components/Common/CustomQRCode/QRCode.js +60 -0
- package/build/components/Common/CustomQRCode/QRCode.js.map +1 -0
- package/build/components/Common/CustomQRCode/index.js +22 -0
- package/build/components/Common/CustomQRCode/index.js.map +1 -0
- package/build/components/Common/CustomQRCode/styles.js +155 -0
- package/build/components/Common/CustomQRCode/styles.js.map +1 -0
- package/build/components/Common/FitText/index.js +28 -0
- package/build/components/Common/FitText/index.js.map +1 -0
- package/build/components/Common/Input/index.js +17 -0
- package/build/components/Common/Input/index.js.map +1 -0
- package/build/components/Common/Input/styles.js +53 -0
- package/build/components/Common/Input/styles.js.map +1 -0
- package/build/components/Common/LargeButton/index.js +10 -0
- package/build/components/Common/LargeButton/index.js.map +1 -0
- package/build/components/Common/LargeButton/styles.js +69 -0
- package/build/components/Common/LargeButton/styles.js.map +1 -0
- package/build/components/Common/Loading/index.js +96 -0
- package/build/components/Common/Loading/index.js.map +1 -0
- package/build/components/Common/Modal/index.js +272 -0
- package/build/components/Common/Modal/index.js.map +1 -0
- package/build/components/Common/Modal/styles.d.ts +0 -1
- package/build/components/Common/Modal/styles.js +657 -0
- package/build/components/Common/Modal/styles.js.map +1 -0
- package/build/components/Common/OTPInput/index.js +108 -0
- package/build/components/Common/OTPInput/index.js.map +1 -0
- package/build/components/Common/OTPInput/styles.js +153 -0
- package/build/components/Common/OTPInput/styles.js.map +1 -0
- package/build/components/Common/Portal/index.js +31 -0
- package/build/components/Common/Portal/index.js.map +1 -0
- package/build/components/Common/PoweredByFooter/index.js +103 -0
- package/build/components/Common/PoweredByFooter/index.js.map +1 -0
- package/build/components/Common/Providers/ProviderHeader.d.ts +2 -2
- package/build/components/Common/Providers/ProviderHeader.js +55 -0
- package/build/components/Common/Providers/ProviderHeader.js.map +1 -0
- package/build/components/Common/Providers/ProviderIcon.d.ts +2 -2
- package/build/components/Common/Providers/ProviderIcon.js +41 -0
- package/build/components/Common/Providers/ProviderIcon.js.map +1 -0
- package/build/components/Common/Providers/getProviderName.d.ts +1 -1
- package/build/components/Common/Providers/getProviderName.js +15 -0
- package/build/components/Common/Providers/getProviderName.js.map +1 -0
- package/build/components/Common/ScrollArea/index.js +58 -0
- package/build/components/Common/ScrollArea/index.js.map +1 -0
- package/build/components/Common/ScrollArea/styles.js +168 -0
- package/build/components/Common/ScrollArea/styles.js.map +1 -0
- package/build/components/Common/Spinner/index.js +24 -0
- package/build/components/Common/Spinner/index.js.map +1 -0
- package/build/components/Common/Spinner/styles.js +22 -0
- package/build/components/Common/Spinner/styles.js.map +1 -0
- package/build/components/Common/SquircleSpinner/index.js +15 -0
- package/build/components/Common/SquircleSpinner/index.js.map +1 -0
- package/build/components/Common/SquircleSpinner/styles.js +66 -0
- package/build/components/Common/SquircleSpinner/styles.js.map +1 -0
- package/build/components/Common/ThemedButton/index.js +25 -0
- package/build/components/Common/ThemedButton/index.js.map +1 -0
- package/build/components/Common/ThemedButton/styles.js +152 -0
- package/build/components/Common/ThemedButton/styles.js.map +1 -0
- package/build/components/Common/TickList/index.js +11 -0
- package/build/components/Common/TickList/index.js.map +1 -0
- package/build/components/Common/TickList/styles.js +28 -0
- package/build/components/Common/TickList/styles.js.map +1 -0
- package/build/components/Common/Tooltip/index.js +91 -0
- package/build/components/Common/Tooltip/index.js.map +1 -0
- package/build/components/Common/Tooltip/styles.js +81 -0
- package/build/components/Common/Tooltip/styles.js.map +1 -0
- package/build/components/Common/WalletRecoveryIcon/index.d.ts +4 -0
- package/build/components/Common/WalletRecoveryIcon/index.js +19 -0
- package/build/components/Common/WalletRecoveryIcon/index.js.map +1 -0
- package/build/components/ConnectButton/index.d.ts +12 -4
- package/build/components/ConnectButton/index.js +266 -0
- package/build/components/ConnectButton/index.js.map +1 -0
- package/build/components/ConnectButton/styles.js +50 -0
- package/build/components/ConnectButton/styles.js.map +1 -0
- package/build/components/ConnectKitThemeProvider/ConnectKitThemeProvider.js +20 -0
- package/build/components/ConnectKitThemeProvider/ConnectKitThemeProvider.js.map +1 -0
- package/build/components/ConnectModal/ConnectUsing.d.ts +1 -1
- package/build/components/ConnectModal/ConnectUsing.js +68 -0
- package/build/components/ConnectModal/ConnectUsing.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/index.js +17 -0
- package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/index.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/styles.js +118 -0
- package/build/components/ConnectModal/ConnectWithInjector/CircleSpinner/styles.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithInjector/index.d.ts +0 -2
- package/build/components/ConnectModal/ConnectWithInjector/index.js +295 -0
- package/build/components/ConnectModal/ConnectWithInjector/index.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithInjector/styles.js +133 -0
- package/build/components/ConnectModal/ConnectWithInjector/styles.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithMobile.js +99 -0
- package/build/components/ConnectModal/ConnectWithMobile.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithOAuth.js +128 -0
- package/build/components/ConnectModal/ConnectWithOAuth.js.map +1 -0
- package/build/components/ConnectModal/ConnectWithQRCode.js +78 -0
- package/build/components/ConnectModal/ConnectWithQRCode.js.map +1 -0
- package/build/components/ConnectModal/index.js +230 -0
- package/build/components/ConnectModal/index.js.map +1 -0
- package/build/components/FloatingGraphic/index.js +13 -0
- package/build/components/FloatingGraphic/index.js.map +1 -0
- package/build/components/FloatingGraphic/styles.js +175 -0
- package/build/components/FloatingGraphic/styles.js.map +1 -0
- package/build/components/Openfort/OpenfortProvider.d.ts +10 -25
- package/build/components/Openfort/OpenfortProvider.js +351 -0
- package/build/components/Openfort/OpenfortProvider.js.map +1 -0
- package/build/components/Openfort/context.d.ts +48 -5
- package/build/components/Openfort/context.js +7 -0
- package/build/components/Openfort/context.js.map +1 -0
- package/build/components/Openfort/routeHelpers.d.ts +5 -0
- package/build/components/Openfort/routeHelpers.js +20 -0
- package/build/components/Openfort/routeHelpers.js.map +1 -0
- package/build/components/Openfort/types.d.ts +57 -23
- package/build/components/Openfort/types.js +119 -0
- package/build/components/Openfort/types.js.map +1 -0
- package/build/components/Openfort/useOpenfort.d.ts +2 -0
- package/build/components/Openfort/useOpenfort.js +12 -0
- package/build/components/Openfort/useOpenfort.js.map +1 -0
- package/build/components/PageContent/index.js +55 -0
- package/build/components/PageContent/index.js.map +1 -0
- package/build/components/PageContent/styles.js +11 -0
- package/build/components/PageContent/styles.js.map +1 -0
- package/build/components/Pages/About/graphics.js +193 -0
- package/build/components/Pages/About/graphics.js.map +1 -0
- package/build/components/Pages/About/index.js +142 -0
- package/build/components/Pages/About/index.js.map +1 -0
- package/build/components/Pages/About/styles.js +142 -0
- package/build/components/Pages/About/styles.js.map +1 -0
- package/build/components/Pages/AssetInventory/index.js +66 -0
- package/build/components/Pages/AssetInventory/index.js.map +1 -0
- package/build/components/Pages/Buy/coinbaseApi.js +106 -0
- package/build/components/Pages/Buy/coinbaseApi.js.map +1 -0
- package/build/components/Pages/Buy/index.js +88 -0
- package/build/components/Pages/Buy/index.js.map +1 -0
- package/build/components/Pages/Buy/onrampApi.js +57 -0
- package/build/components/Pages/Buy/onrampApi.js.map +1 -0
- package/build/components/Pages/Buy/providers.js +39 -0
- package/build/components/Pages/Buy/providers.js.map +1 -0
- package/build/components/Pages/Buy/stripeApi.js +74 -0
- package/build/components/Pages/Buy/stripeApi.js.map +1 -0
- package/build/components/Pages/Buy/styles.js +230 -0
- package/build/components/Pages/Buy/styles.js.map +1 -0
- package/build/components/Pages/Buy/utils.js +71 -0
- package/build/components/Pages/Buy/utils.js.map +1 -0
- package/build/components/Pages/BuyComplete/index.js +47 -0
- package/build/components/Pages/BuyComplete/index.js.map +1 -0
- package/build/components/Pages/BuyProcessing/index.js +231 -0
- package/build/components/Pages/BuyProcessing/index.js.map +1 -0
- package/build/components/Pages/BuyProviderSelect/index.js +55 -0
- package/build/components/Pages/BuyProviderSelect/index.js.map +1 -0
- package/build/components/Pages/BuyProviderSelect/styles.js +103 -0
- package/build/components/Pages/BuyProviderSelect/styles.js.map +1 -0
- package/build/components/Pages/BuySelectProvider/index.js +245 -0
- package/build/components/Pages/BuySelectProvider/index.js.map +1 -0
- package/build/components/Pages/Connected/ConnectedPageLayout.d.ts +22 -0
- package/build/components/Pages/Connected/ConnectedPageLayout.js +11 -0
- package/build/components/Pages/Connected/ConnectedPageLayout.js.map +1 -0
- package/build/components/Pages/Connected/EthereumConnected.d.ts +3 -0
- package/build/components/Pages/Connected/EthereumConnected.js +133 -0
- package/build/components/Pages/Connected/EthereumConnected.js.map +1 -0
- package/build/components/Pages/Connected/SolanaConnected.d.ts +3 -0
- package/build/components/Pages/Connected/SolanaConnected.js +96 -0
- package/build/components/Pages/Connected/SolanaConnected.js.map +1 -0
- package/build/components/Pages/Connected/index.d.ts +2 -2
- package/build/components/Pages/Connected/index.js +18 -0
- package/build/components/Pages/Connected/index.js.map +1 -0
- package/build/components/Pages/Connected/styles.js +122 -0
- package/build/components/Pages/Connected/styles.js.map +1 -0
- package/build/components/Pages/ConnectedSuccess/index.js +19 -0
- package/build/components/Pages/ConnectedSuccess/index.js.map +1 -0
- package/build/components/Pages/Connectors/index.js +73 -0
- package/build/components/Pages/Connectors/index.js.map +1 -0
- package/build/components/Pages/CreateGuestUserPage/index.js +28 -0
- package/build/components/Pages/CreateGuestUserPage/index.js.map +1 -0
- package/build/components/Pages/CreateWallet/SolanaCreateWallet.d.ts +6 -0
- package/build/components/Pages/CreateWallet/SolanaCreateWallet.js +241 -0
- package/build/components/Pages/CreateWallet/SolanaCreateWallet.js.map +1 -0
- package/build/components/Pages/CreateWallet/index.js +303 -0
- package/build/components/Pages/CreateWallet/index.js.map +1 -0
- package/build/components/Pages/CreateWallet/styles.js +17 -0
- package/build/components/Pages/CreateWallet/styles.js.map +1 -0
- package/build/components/Pages/DownloadApp/index.js +32 -0
- package/build/components/Pages/DownloadApp/index.js.map +1 -0
- package/build/components/Pages/EmailLogin/index.js +118 -0
- package/build/components/Pages/EmailLogin/index.js.map +1 -0
- package/build/components/Pages/EmailLogin/styles.js +24 -0
- package/build/components/Pages/EmailLogin/styles.js.map +1 -0
- package/build/components/Pages/EmailOTP/index.js +116 -0
- package/build/components/Pages/EmailOTP/index.js.map +1 -0
- package/build/components/Pages/EmailOTP/styles.js +38 -0
- package/build/components/Pages/EmailOTP/styles.js.map +1 -0
- package/build/components/Pages/EmailVerification/index.js +86 -0
- package/build/components/Pages/EmailVerification/index.js.map +1 -0
- package/build/components/Pages/ExportKey/index.js +44 -0
- package/build/components/Pages/ExportKey/index.js.map +1 -0
- package/build/components/Pages/ForgotPassword/index.js +129 -0
- package/build/components/Pages/ForgotPassword/index.js.map +1 -0
- package/build/components/Pages/LinkEmail/index.js +63 -0
- package/build/components/Pages/LinkEmail/index.js.map +1 -0
- package/build/components/Pages/LinkedProvider/index.d.ts +3 -0
- package/build/components/Pages/LinkedProvider/index.js +90 -0
- package/build/components/Pages/LinkedProvider/index.js.map +1 -0
- package/build/components/Pages/LinkedProviders/index.js +45 -0
- package/build/components/Pages/LinkedProviders/index.js.map +1 -0
- package/build/components/Pages/LinkedProviders/styles.js +51 -0
- package/build/components/Pages/LinkedProviders/styles.js.map +1 -0
- package/build/components/Pages/LoadWallets/index.js +91 -0
- package/build/components/Pages/LoadWallets/index.js.map +1 -0
- package/build/components/Pages/Loading/index.js +61 -0
- package/build/components/Pages/Loading/index.js.map +1 -0
- package/build/components/Pages/MobileConnectors/index.js +71 -0
- package/build/components/Pages/MobileConnectors/index.js.map +1 -0
- package/build/components/Pages/MobileConnectors/styles.js +65 -0
- package/build/components/Pages/MobileConnectors/styles.js.map +1 -0
- package/build/components/Pages/NoAssetsAvailable/index.js +45 -0
- package/build/components/Pages/NoAssetsAvailable/index.js.map +1 -0
- package/build/components/Pages/NoAssetsAvailable/styles.js +10 -0
- package/build/components/Pages/NoAssetsAvailable/styles.js.map +1 -0
- package/build/components/Pages/Onboarding/index.js +20 -0
- package/build/components/Pages/Onboarding/index.js.map +1 -0
- package/build/components/Pages/PhoneOTP/index.js +128 -0
- package/build/components/Pages/PhoneOTP/index.js.map +1 -0
- package/build/components/Pages/PhoneOTP/styles.js +38 -0
- package/build/components/Pages/PhoneOTP/styles.js.map +1 -0
- package/build/components/Pages/Profile/index.js +35 -0
- package/build/components/Pages/Profile/index.js.map +1 -0
- package/build/components/Pages/Providers/index.js +157 -0
- package/build/components/Pages/Providers/index.js.map +1 -0
- package/build/components/Pages/Providers/styles.js +156 -0
- package/build/components/Pages/Providers/styles.js.map +1 -0
- package/build/components/Pages/Receive/index.js +61 -0
- package/build/components/Pages/Receive/index.js.map +1 -0
- package/build/components/Pages/Receive/styles.d.ts +1 -0
- package/build/components/Pages/Receive/styles.js +52 -0
- package/build/components/Pages/Receive/styles.js.map +1 -0
- package/build/components/Pages/Recover/index.js +252 -0
- package/build/components/Pages/Recover/index.js.map +1 -0
- package/build/components/Pages/Recover/recoveryRegistry.d.ts +32 -0
- package/build/components/Pages/Recover/recoveryRegistry.js +61 -0
- package/build/components/Pages/Recover/recoveryRegistry.js.map +1 -0
- package/build/components/Pages/RemoveLinkedProvider/index.js +104 -0
- package/build/components/Pages/RemoveLinkedProvider/index.js.map +1 -0
- package/build/components/Pages/SelectToken/index.js +102 -0
- package/build/components/Pages/SelectToken/index.js.map +1 -0
- package/build/components/Pages/SelectToken/styles.js +78 -0
- package/build/components/Pages/SelectToken/styles.js.map +1 -0
- package/build/components/Pages/SelectWalletToRecover/index.d.ts +1 -2
- package/build/components/Pages/SelectWalletToRecover/index.js +70 -0
- package/build/components/Pages/SelectWalletToRecover/index.js.map +1 -0
- package/build/components/Pages/Send/EthereumSend.d.ts +1 -0
- package/build/components/Pages/Send/EthereumSend.js +88 -0
- package/build/components/Pages/Send/EthereumSend.js.map +1 -0
- package/build/components/Pages/Send/SolanaSend.d.ts +1 -0
- package/build/components/Pages/Send/SolanaSend.js +93 -0
- package/build/components/Pages/Send/SolanaSend.js.map +1 -0
- package/build/components/Pages/Send/index.d.ts +7 -1
- package/build/components/Pages/Send/index.js +18 -0
- package/build/components/Pages/Send/index.js.map +1 -0
- package/build/components/Pages/Send/styles.js +112 -0
- package/build/components/Pages/Send/styles.js.map +1 -0
- package/build/components/Pages/Send/utils.d.ts +1 -1
- package/build/components/Pages/Send/utils.js +63 -0
- package/build/components/Pages/Send/utils.js.map +1 -0
- package/build/components/Pages/SendConfirmation/EstimatedFees.js +66 -0
- package/build/components/Pages/SendConfirmation/EstimatedFees.js.map +1 -0
- package/build/components/Pages/SendConfirmation/index.js +331 -0
- package/build/components/Pages/SendConfirmation/index.js.map +1 -0
- package/build/components/Pages/SendConfirmation/styles.js +129 -0
- package/build/components/Pages/SendConfirmation/styles.js.map +1 -0
- package/build/components/Pages/SocialProviders/index.js +15 -0
- package/build/components/Pages/SocialProviders/index.js.map +1 -0
- package/build/components/Pages/SolanaSendConfirmation/index.d.ts +1 -0
- package/build/components/Pages/SolanaSendConfirmation/index.js +152 -0
- package/build/components/Pages/SolanaSendConfirmation/index.js.map +1 -0
- package/build/components/Pages/SolanaWallets/index.d.ts +1 -0
- package/build/components/Pages/SolanaWallets/index.js +36 -0
- package/build/components/Pages/SolanaWallets/index.js.map +1 -0
- package/build/components/PasswordStrength/PasswordStrengthIndicator.js +62 -0
- package/build/components/PasswordStrength/PasswordStrengthIndicator.js.map +1 -0
- package/build/components/PasswordStrength/password-utility.js +128 -0
- package/build/components/PasswordStrength/password-utility.js.map +1 -0
- package/build/constants/chainConfigs.js +316 -0
- package/build/constants/chainConfigs.js.map +1 -0
- package/build/constants/defaultTheme.js +6 -0
- package/build/constants/defaultTheme.js.map +1 -0
- package/build/constants/openfort.d.ts +4 -0
- package/build/constants/openfort.js +8 -0
- package/build/constants/openfort.js.map +1 -0
- package/build/core/ConnectionStrategy.d.ts +31 -0
- package/build/core/ConnectionStrategy.js +9 -0
- package/build/core/ConnectionStrategy.js.map +1 -0
- package/build/core/ConnectionStrategyContext.d.ts +16 -0
- package/build/core/ConnectionStrategyContext.js +22 -0
- package/build/core/ConnectionStrategyContext.js.map +1 -0
- package/build/core/errors.d.ts +1 -0
- package/build/core/strategies/EthereumBridgeStrategy.d.ts +11 -0
- package/build/core/strategies/EthereumBridgeStrategy.js +83 -0
- package/build/core/strategies/EthereumBridgeStrategy.js.map +1 -0
- package/build/core/strategies/EthereumEmbeddedStrategy.d.ts +8 -0
- package/build/core/strategies/EthereumEmbeddedStrategy.js +85 -0
- package/build/core/strategies/EthereumEmbeddedStrategy.js.map +1 -0
- package/build/core/strategies/SolanaEmbeddedStrategy.d.ts +9 -0
- package/build/core/strategies/SolanaEmbeddedStrategy.js +53 -0
- package/build/core/strategies/SolanaEmbeddedStrategy.js.map +1 -0
- package/build/core/strategyUtils.d.ts +6 -0
- package/build/core/strategyUtils.js +31 -0
- package/build/core/strategyUtils.js.map +1 -0
- package/build/ethereum/OpenfortEthereumBridgeContext.d.ts +87 -0
- package/build/ethereum/OpenfortEthereumBridgeContext.js +18 -0
- package/build/ethereum/OpenfortEthereumBridgeContext.js.map +1 -0
- package/build/ethereum/hooks/getEmbeddedWalletClient.d.ts +14 -0
- package/build/ethereum/hooks/getEmbeddedWalletClient.js +24 -0
- package/build/ethereum/hooks/getEmbeddedWalletClient.js.map +1 -0
- package/build/ethereum/hooks/useEthereumEmbeddedWallet.d.ts +17 -0
- package/build/ethereum/hooks/useEthereumEmbeddedWallet.js +425 -0
- package/build/ethereum/hooks/useEthereumEmbeddedWallet.js.map +1 -0
- package/build/ethereum/hooks/useEthereumWalletAssets.d.ts +29 -0
- package/build/ethereum/hooks/useEthereumWalletAssets.js +204 -0
- package/build/ethereum/hooks/useEthereumWalletAssets.js.map +1 -0
- package/build/ethereum/index.d.ts +11 -0
- package/build/ethereum/index.js +3 -0
- package/build/ethereum/index.js.map +1 -0
- package/build/ethereum/types.d.ts +140 -0
- package/build/hooks/openfort/auth/requestEmailVerification.js +21 -0
- package/build/hooks/openfort/auth/requestEmailVerification.js.map +1 -0
- package/build/hooks/openfort/auth/status.js +11 -0
- package/build/hooks/openfort/auth/status.js.map +1 -0
- package/build/hooks/openfort/auth/useAuthCallback.d.ts +2 -1
- package/build/hooks/openfort/auth/useAuthCallback.js +197 -0
- package/build/hooks/openfort/auth/useAuthCallback.js.map +1 -0
- package/build/hooks/openfort/auth/useConnectToWalletPostAuth.d.ts +2 -2
- package/build/hooks/openfort/auth/useConnectToWalletPostAuth.js +161 -0
- package/build/hooks/openfort/auth/useConnectToWalletPostAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useEmailAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useEmailAuth.js +496 -0
- package/build/hooks/openfort/auth/useEmailAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useEmailOtpAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useEmailOtpAuth.js +151 -0
- package/build/hooks/openfort/auth/useEmailOtpAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useGuestAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useGuestAuth.js +142 -0
- package/build/hooks/openfort/auth/useGuestAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useOAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useOAuth.js +217 -0
- package/build/hooks/openfort/auth/useOAuth.js.map +1 -0
- package/build/hooks/openfort/auth/usePhoneOtpAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/usePhoneOtpAuth.js +174 -0
- package/build/hooks/openfort/auth/usePhoneOtpAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useSignOut.d.ts +2 -1
- package/build/hooks/openfort/auth/useSignOut.js +104 -0
- package/build/hooks/openfort/auth/useSignOut.js.map +1 -0
- package/build/hooks/openfort/hookConsistency.js +17 -0
- package/build/hooks/openfort/hookConsistency.js.map +1 -0
- package/build/hooks/openfort/use7702Authorization.js +73 -0
- package/build/hooks/openfort/use7702Authorization.js.map +1 -0
- package/build/hooks/openfort/useGrantPermissions.d.ts +7 -76
- package/build/hooks/openfort/useGrantPermissions.js +221 -0
- package/build/hooks/openfort/useGrantPermissions.js.map +1 -0
- package/build/hooks/openfort/useProviders.js +75 -0
- package/build/hooks/openfort/useProviders.js.map +1 -0
- package/build/hooks/openfort/useRevokePermissions.d.ts +2 -1
- package/build/hooks/openfort/useRevokePermissions.js +126 -0
- package/build/hooks/openfort/useRevokePermissions.js.map +1 -0
- package/build/hooks/openfort/useUI.d.ts +4 -45
- package/build/hooks/openfort/useUI.js +122 -0
- package/build/hooks/openfort/useUI.js.map +1 -0
- package/build/hooks/openfort/useUser.d.ts +12 -35
- package/build/hooks/openfort/useUser.js +61 -0
- package/build/hooks/openfort/useUser.js.map +1 -0
- package/build/hooks/openfort/walletTypes.d.ts +32 -0
- package/build/hooks/openfort/walletTypes.js +53 -0
- package/build/hooks/openfort/walletTypes.js.map +1 -0
- package/build/hooks/useBalance.d.ts +50 -0
- package/build/hooks/useBalance.js +80 -0
- package/build/hooks/useBalance.js.map +1 -0
- package/build/hooks/useConnectLifecycle.d.ts +7 -0
- package/build/hooks/useConnectLifecycle.js +43 -0
- package/build/hooks/useConnectLifecycle.js.map +1 -0
- package/build/hooks/useConnectors.d.ts +3 -5
- package/build/hooks/useConnectors.js +26 -0
- package/build/hooks/useConnectors.js.map +1 -0
- package/build/hooks/useCopyToClipboard.js +29 -0
- package/build/hooks/useCopyToClipboard.js.map +1 -0
- package/build/hooks/useFitText.js +125 -0
- package/build/hooks/useFitText.js.map +1 -0
- package/build/hooks/useFocusTrap.d.ts +4 -1
- package/build/hooks/useFocusTrap.js +60 -0
- package/build/hooks/useFocusTrap.js.map +1 -0
- package/build/hooks/useGoogleFont.js +43 -0
- package/build/hooks/useGoogleFont.js.map +1 -0
- package/build/hooks/useIsMobile.js +17 -0
- package/build/hooks/useIsMobile.js.map +1 -0
- package/build/hooks/useIsMounted.js +10 -0
- package/build/hooks/useIsMounted.js.map +1 -0
- package/build/hooks/useLastConnector.js +39 -0
- package/build/hooks/useLastConnector.js.map +1 -0
- package/build/hooks/useLocales.d.ts +1 -1
- package/build/hooks/useLocales.js +68 -0
- package/build/hooks/useLocales.js.map +1 -0
- package/build/hooks/useLockBodyScroll.js +53 -0
- package/build/hooks/useLockBodyScroll.js.map +1 -0
- package/build/hooks/usePrevious.js +14 -0
- package/build/hooks/usePrevious.js.map +1 -0
- package/build/hooks/useResolvedIdentity.d.ts +70 -0
- package/build/hooks/useResolvedIdentity.js +90 -0
- package/build/hooks/useResolvedIdentity.js.map +1 -0
- package/build/hooks/useRouteProps.d.ts +10 -5
- package/build/hooks/useRouteProps.js +27 -0
- package/build/hooks/useRouteProps.js.map +1 -0
- package/build/hooks/useWalletConnectModal.js +59 -0
- package/build/hooks/useWalletConnectModal.js.map +1 -0
- package/build/hooks/useWindowSize.js +23 -0
- package/build/hooks/useWindowSize.js.map +1 -0
- package/build/index.d.ts +61 -16
- package/build/index.js +31 -0
- package/build/index.js.map +1 -0
- package/build/localizations/index.js +57 -0
- package/build/localizations/index.js.map +1 -0
- package/build/localizations/locales/ar-AE.js +100 -0
- package/build/localizations/locales/ar-AE.js.map +1 -0
- package/build/localizations/locales/ca-AD.js +98 -0
- package/build/localizations/locales/ca-AD.js.map +1 -0
- package/build/localizations/locales/ee-EE.js +98 -0
- package/build/localizations/locales/ee-EE.js.map +1 -0
- package/build/localizations/locales/en-US.js +115 -0
- package/build/localizations/locales/en-US.js.map +1 -0
- package/build/localizations/locales/es-ES.js +98 -0
- package/build/localizations/locales/es-ES.js.map +1 -0
- package/build/localizations/locales/fa-IR.js +98 -0
- package/build/localizations/locales/fa-IR.js.map +1 -0
- package/build/localizations/locales/fr-FR.js +98 -0
- package/build/localizations/locales/fr-FR.js.map +1 -0
- package/build/localizations/locales/ja-JP.js +98 -0
- package/build/localizations/locales/ja-JP.js.map +1 -0
- package/build/localizations/locales/pt-BR.js +98 -0
- package/build/localizations/locales/pt-BR.js.map +1 -0
- package/build/localizations/locales/ru-RU.js +98 -0
- package/build/localizations/locales/ru-RU.js.map +1 -0
- package/build/localizations/locales/tr-TR.js +98 -0
- package/build/localizations/locales/tr-TR.js.map +1 -0
- package/build/localizations/locales/vi-VN.js +98 -0
- package/build/localizations/locales/vi-VN.js.map +1 -0
- package/build/localizations/locales/zh-CN.js +98 -0
- package/build/localizations/locales/zh-CN.js.map +1 -0
- package/build/openfort/CoreOpenfortProvider.d.ts +9 -22
- package/build/openfort/CoreOpenfortProvider.js +389 -0
- package/build/openfort/CoreOpenfortProvider.js.map +1 -0
- package/build/{hooks/useConnectCallback.d.ts → openfort/connectCallbackTypes.d.ts} +2 -2
- package/build/openfort/context.d.ts +3 -2
- package/build/openfort/context.js +6 -0
- package/build/openfort/context.js.map +1 -0
- package/build/openfort/core/client.d.ts +2 -1
- package/build/openfort/core/client.js +23 -0
- package/build/openfort/core/client.js.map +1 -0
- package/build/openfort/hooks/useActiveAddressSync.d.ts +20 -0
- package/build/openfort/hooks/useActiveAddressSync.js +76 -0
- package/build/openfort/hooks/useActiveAddressSync.js.map +1 -0
- package/build/openfort/hooks/useAutoRecovery.d.ts +26 -0
- package/build/openfort/hooks/useAutoRecovery.js +102 -0
- package/build/openfort/hooks/useAutoRecovery.js.map +1 -0
- package/build/openfort/hooks/useEmbeddedStateMachine.d.ts +31 -0
- package/build/openfort/hooks/useEmbeddedStateMachine.js +77 -0
- package/build/openfort/hooks/useEmbeddedStateMachine.js.map +1 -0
- package/build/openfort/selectors.d.ts +9 -0
- package/build/openfort/selectors.js +15 -0
- package/build/openfort/selectors.js.map +1 -0
- package/build/openfort/store.d.ts +46 -0
- package/build/openfort/store.js +116 -0
- package/build/openfort/store.js.map +1 -0
- package/build/openfort/useOpenfort.d.ts +9 -3
- package/build/openfort/useOpenfort.js +15 -0
- package/build/openfort/useOpenfort.js.map +1 -0
- package/build/openfort/useOpenfortStore.d.ts +2 -0
- package/build/openfort/useOpenfortStore.js +13 -0
- package/build/openfort/useOpenfortStore.js.map +1 -0
- package/build/query/index.d.ts +2 -0
- package/build/query/queryKeys.d.ts +12 -0
- package/build/query/queryKeys.js +15 -0
- package/build/query/queryKeys.js.map +1 -0
- package/build/query/queryOptions.d.ts +23 -0
- package/build/query/queryOptions.js +31 -0
- package/build/query/queryOptions.js.map +1 -0
- package/build/shared/hooks/useAsyncData.d.ts +19 -0
- package/build/shared/hooks/useAsyncData.js +69 -0
- package/build/shared/hooks/useAsyncData.js.map +1 -0
- package/build/shared/hooks/useRecoveryOTP.d.ts +11 -0
- package/build/shared/hooks/useRecoveryOTP.js +64 -0
- package/build/shared/hooks/useRecoveryOTP.js.map +1 -0
- package/build/shared/types.d.ts +65 -0
- package/build/shared/utils/embeddedWalletStatusMapper.d.ts +15 -0
- package/build/shared/utils/embeddedWalletStatusMapper.js +22 -0
- package/build/shared/utils/embeddedWalletStatusMapper.js.map +1 -0
- package/build/shared/utils/explorer.d.ts +24 -0
- package/build/shared/utils/explorer.js +71 -0
- package/build/shared/utils/explorer.js.map +1 -0
- package/build/shared/utils/otpError.d.ts +8 -0
- package/build/shared/utils/otpError.js +17 -0
- package/build/shared/utils/otpError.js.map +1 -0
- package/build/shared/utils/recovery.d.ts +15 -0
- package/build/shared/utils/recovery.js +96 -0
- package/build/shared/utils/recovery.js.map +1 -0
- package/build/shared/utils/validation.d.ts +15 -0
- package/build/shared/utils/validation.js +27 -0
- package/build/shared/utils/validation.js.map +1 -0
- package/build/shared/utils/walletStatusProps.d.ts +18 -0
- package/build/shared/utils/walletStatusProps.js +45 -0
- package/build/shared/utils/walletStatusProps.js.map +1 -0
- package/build/siwe/create-siwe-message.d.ts +15 -1
- package/build/siwe/create-siwe-message.js +32 -0
- package/build/siwe/create-siwe-message.js.map +1 -0
- package/build/solana/SolanaContext.d.ts +43 -0
- package/build/solana/SolanaContext.js +87 -0
- package/build/solana/SolanaContext.js.map +1 -0
- package/build/solana/constants.d.ts +21 -0
- package/build/solana/constants.js +24 -0
- package/build/solana/constants.js.map +1 -0
- package/build/solana/hooks/recoveryResolver.d.ts +16 -0
- package/build/solana/hooks/recoveryResolver.js +39 -0
- package/build/solana/hooks/recoveryResolver.js.map +1 -0
- package/build/solana/hooks/useSolanaEmbeddedWallet.d.ts +17 -0
- package/build/solana/hooks/useSolanaEmbeddedWallet.js +389 -0
- package/build/solana/hooks/useSolanaEmbeddedWallet.js.map +1 -0
- package/build/solana/hooks/utils.d.ts +2 -0
- package/build/solana/hooks/utils.js +18 -0
- package/build/solana/hooks/utils.js.map +1 -0
- package/build/solana/index.d.ts +12 -0
- package/build/solana/index.js +2 -0
- package/build/solana/index.js.map +1 -0
- package/build/solana/operations.d.ts +22 -0
- package/build/solana/operations.js +40 -0
- package/build/solana/operations.js.map +1 -0
- package/build/solana/provider.d.ts +131 -0
- package/build/solana/provider.js +126 -0
- package/build/solana/provider.js.map +1 -0
- package/build/solana/types.d.ts +253 -0
- package/build/solana/utils/transfer.d.ts +9 -0
- package/build/solana/utils/transfer.js +20 -0
- package/build/solana/utils/transfer.js.map +1 -0
- package/build/styles/index.js +334 -0
- package/build/styles/index.js.map +1 -0
- package/build/styles/styled/index.js +14 -0
- package/build/styles/styled/index.js.map +1 -0
- package/build/styles/themes/base.js +147 -0
- package/build/styles/themes/base.js.map +1 -0
- package/build/styles/themes/index.js +13 -0
- package/build/styles/themes/index.js.map +1 -0
- package/build/styles/themes/midnight.js +78 -0
- package/build/styles/themes/midnight.js.map +1 -0
- package/build/styles/themes/minimal.js +100 -0
- package/build/styles/themes/minimal.js.map +1 -0
- package/build/styles/themes/nouns.js +83 -0
- package/build/styles/themes/nouns.js.map +1 -0
- package/build/styles/themes/retro.js +110 -0
- package/build/styles/themes/retro.js.map +1 -0
- package/build/styles/themes/rounded.js +110 -0
- package/build/styles/themes/rounded.js.map +1 -0
- package/build/styles/themes/soft.js +73 -0
- package/build/styles/themes/soft.js.map +1 -0
- package/build/styles/themes/web95.js +136 -0
- package/build/styles/themes/web95.js.map +1 -0
- package/build/types.d.ts +5 -6
- package/build/types.js +33 -0
- package/build/types.js.map +1 -0
- package/build/utils/banner.d.ts +1 -0
- package/build/utils/banner.js +14 -0
- package/build/utils/banner.js.map +1 -0
- package/build/utils/errorHandling.js +331 -0
- package/build/utils/errorHandling.js.map +1 -0
- package/build/utils/format.d.ts +18 -0
- package/build/utils/format.js +59 -0
- package/build/utils/format.js.map +1 -0
- package/build/utils/index.d.ts +2 -3
- package/build/utils/index.js +67 -0
- package/build/utils/index.js.map +1 -0
- package/build/utils/logger.js +13 -0
- package/build/utils/logger.js.map +1 -0
- package/build/utils/oauthErrorHandler.d.ts +1 -1
- package/build/utils/oauthErrorHandler.js +42 -0
- package/build/utils/oauthErrorHandler.js.map +1 -0
- package/build/utils/p3.js +14 -0
- package/build/utils/p3.js.map +1 -0
- package/build/utils/rpc.d.ts +34 -0
- package/build/utils/rpc.js +93 -0
- package/build/utils/rpc.js.map +1 -0
- package/build/utils/useOnUserReturn.js +25 -0
- package/build/utils/useOnUserReturn.js.map +1 -0
- package/build/utils/validation.js +7 -0
- package/build/utils/validation.js.map +1 -0
- package/build/utils/wallets.d.ts +6 -0
- package/build/utils/wallets.js +14 -0
- package/build/utils/wallets.js.map +1 -0
- package/build/version.d.ts +1 -1
- package/build/version.js +4 -0
- package/build/version.js.map +1 -0
- package/build/wagmi/OpenfortWagmiBridge.d.ts +3 -0
- package/build/wagmi/OpenfortWagmiBridge.js +166 -0
- package/build/wagmi/OpenfortWagmiBridge.js.map +1 -0
- package/build/wagmi/components/ChainSelect/index.js +140 -0
- package/build/wagmi/components/ChainSelect/index.js.map +1 -0
- package/build/wagmi/components/ChainSelectDropdown/index.js +144 -0
- package/build/wagmi/components/ChainSelectDropdown/index.js.map +1 -0
- package/build/wagmi/components/ChainSelectDropdown/styles.js +47 -0
- package/build/wagmi/components/ChainSelectDropdown/styles.js.map +1 -0
- package/build/wagmi/components/ChainSelectList/index.js +109 -0
- package/build/wagmi/components/ChainSelectList/index.js.map +1 -0
- package/build/wagmi/components/ChainSelectList/styles.js +225 -0
- package/build/wagmi/components/ChainSelectList/styles.js.map +1 -0
- package/build/wagmi/components/SwitchNetworks/index.js +22 -0
- package/build/wagmi/components/SwitchNetworks/index.js.map +1 -0
- package/build/wagmi/connectorFilter.d.ts +6 -0
- package/build/wagmi/connectorFilter.js +16 -0
- package/build/wagmi/connectorFilter.js.map +1 -0
- package/build/{defaultConfig.d.ts → wagmi/defaultConfig.d.ts} +1 -2
- package/build/wagmi/defaultConfig.js +27 -0
- package/build/wagmi/defaultConfig.js.map +1 -0
- package/build/wagmi/defaultConnectors.js +36 -0
- package/build/wagmi/defaultConnectors.js.map +1 -0
- package/build/wagmi/embeddedConnector.d.ts +4 -0
- package/build/wagmi/embeddedConnector.js +80 -0
- package/build/wagmi/embeddedConnector.js.map +1 -0
- package/build/wagmi/index.d.ts +10 -0
- package/build/wagmi/index.js +10 -0
- package/build/wagmi/index.js.map +1 -0
- package/build/wagmi/useChainIsSupported.d.ts +20 -0
- package/build/wagmi/useChainIsSupported.js +30 -0
- package/build/wagmi/useChainIsSupported.js.map +1 -0
- package/build/wagmi/useChains.d.ts +29 -0
- package/build/wagmi/useChains.js +38 -0
- package/build/wagmi/useChains.js.map +1 -0
- package/build/wagmi/useConnectWithSiwe.d.ts +22 -0
- package/build/wagmi/useConnectWithSiwe.js +115 -0
- package/build/wagmi/useConnectWithSiwe.js.map +1 -0
- package/build/wagmi/useEmbeddedWalletWagmiSync.d.ts +2 -0
- package/build/wagmi/useEmbeddedWalletWagmiSync.js +55 -0
- package/build/wagmi/useEmbeddedWalletWagmiSync.js.map +1 -0
- package/build/wagmi/useWalletAuth.d.ts +24 -0
- package/build/wagmi/useWalletAuth.js +180 -0
- package/build/wagmi/useWalletAuth.js.map +1 -0
- package/build/wallets/useExternalConnectors.d.ts +17 -0
- package/build/wallets/useExternalConnectors.js +98 -0
- package/build/wallets/useExternalConnectors.js.map +1 -0
- package/build/wallets/walletConfigs.js +344 -0
- package/build/wallets/walletConfigs.js.map +1 -0
- package/package.json +62 -11
- package/build/components/PageLayout/index.d.ts +0 -6
- package/build/components/contexts/web3/index.d.ts +0 -13
- package/build/constants/erc20.d.ts +0 -42
- package/build/hooks/openfort/auth/useWalletAuth.d.ts +0 -20
- package/build/hooks/openfort/useConnectWithSiwe.d.ts +0 -8
- package/build/hooks/openfort/useWalletAssets.d.ts +0 -16
- package/build/hooks/openfort/useWallets.d.ts +0 -134
- package/build/hooks/useChainIsSupported.d.ts +0 -24
- package/build/hooks/useChains.d.ts +0 -41
- package/build/hooks/useConnect.d.ts +0 -24
- package/build/hooks/useEnsFallbackConfig.d.ts +0 -1
- package/build/index.es.js +0 -19627
- package/build/index.es.js.map +0 -1
- package/build/openfortCustomTypes.d.ts +0 -10
- package/build/wallets/index.d.ts +0 -7
- package/build/wallets/useWagmiWallets.d.ts +0 -9
- /package/build/components/Pages/{SoicalProviders → SocialProviders}/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelect/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectDropdown/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectDropdown/styles.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectList/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectList/styles.d.ts +0 -0
- /package/build/{components/Pages → wagmi/components}/SwitchNetworks/index.d.ts +0 -0
- /package/build/{defaultConnectors.d.ts → wagmi/defaultConnectors.d.ts} +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { safe, coinbaseWallet, walletConnect } from '@wagmi/connectors';
|
|
2
|
+
import { embeddedWalletConnector } from './embeddedConnector.js';
|
|
3
|
+
|
|
4
|
+
const defaultConnectors = ({ app, walletConnectProjectId, coinbaseWalletPreference, }) => {
|
|
5
|
+
const hasAllAppData = app.name && app.icon && app.description && app.url;
|
|
6
|
+
const shouldUseSafeConnector = !(typeof window === 'undefined') && (window === null || window === void 0 ? void 0 : window.parent) !== window;
|
|
7
|
+
const connectors = [embeddedWalletConnector()];
|
|
8
|
+
if (shouldUseSafeConnector) {
|
|
9
|
+
connectors.push(safe({
|
|
10
|
+
allowedDomains: [/gnosis-safe.io$/, /app.safe.global$/],
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
connectors.push(coinbaseWallet({
|
|
14
|
+
appName: app.name,
|
|
15
|
+
appLogoUrl: app.icon,
|
|
16
|
+
overrideIsMetaMask: false,
|
|
17
|
+
preference: coinbaseWalletPreference,
|
|
18
|
+
}));
|
|
19
|
+
if (walletConnectProjectId) {
|
|
20
|
+
connectors.push(walletConnect({
|
|
21
|
+
projectId: walletConnectProjectId,
|
|
22
|
+
metadata: hasAllAppData
|
|
23
|
+
? {
|
|
24
|
+
name: app.name,
|
|
25
|
+
description: app.description,
|
|
26
|
+
url: app.url,
|
|
27
|
+
icons: [app.icon],
|
|
28
|
+
}
|
|
29
|
+
: undefined,
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
return connectors;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { defaultConnectors as default };
|
|
36
|
+
//# sourceMappingURL=defaultConnectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultConnectors.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type CreateConnectorFn } from 'wagmi';
|
|
2
|
+
import type { OpenfortEmbeddedEthereumWalletProvider } from '../ethereum/types';
|
|
3
|
+
export declare function setEmbeddedWalletProvider(p: OpenfortEmbeddedEthereumWalletProvider | null): void;
|
|
4
|
+
export declare function embeddedWalletConnector(): CreateConnectorFn<OpenfortEmbeddedEthereumWalletProvider | undefined>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { createConnector } from 'wagmi';
|
|
2
|
+
import { embeddedWalletId } from '../constants/openfort.js';
|
|
3
|
+
|
|
4
|
+
// Module-level provider store — injected when embedded wallet becomes active
|
|
5
|
+
let _provider = null;
|
|
6
|
+
function setEmbeddedWalletProvider(p) {
|
|
7
|
+
_provider = p;
|
|
8
|
+
}
|
|
9
|
+
function embeddedWalletConnector() {
|
|
10
|
+
return createConnector((config) => {
|
|
11
|
+
const accountsChangedHandler = (accs) => {
|
|
12
|
+
config.emitter.emit('change', { accounts: accs });
|
|
13
|
+
};
|
|
14
|
+
const chainChangedHandler = (chain) => {
|
|
15
|
+
config.emitter.emit('change', { chainId: Number(chain) });
|
|
16
|
+
};
|
|
17
|
+
const disconnectHandler = () => {
|
|
18
|
+
config.emitter.emit('disconnect');
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
id: embeddedWalletId,
|
|
22
|
+
name: 'Openfort Embedded Wallet',
|
|
23
|
+
type: 'openfort-embedded',
|
|
24
|
+
async connect({ chainId, } = {}) {
|
|
25
|
+
const provider = _provider;
|
|
26
|
+
if (!provider)
|
|
27
|
+
throw new Error('Embedded wallet provider not ready');
|
|
28
|
+
const accounts = (await provider.request({ method: 'eth_requestAccounts' }));
|
|
29
|
+
const currentChainId = await this.getChainId();
|
|
30
|
+
provider.on('accountsChanged', accountsChangedHandler);
|
|
31
|
+
provider.on('chainChanged', chainChangedHandler);
|
|
32
|
+
provider.on('disconnect', disconnectHandler);
|
|
33
|
+
return {
|
|
34
|
+
accounts: accounts,
|
|
35
|
+
chainId: chainId !== null && chainId !== void 0 ? chainId : currentChainId,
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
async disconnect() {
|
|
39
|
+
var _a, _b, _c;
|
|
40
|
+
// Auth lifecycle owned by Openfort, not wagmi — no-op
|
|
41
|
+
(_a = _provider === null || _provider === void 0 ? void 0 : _provider.removeListener) === null || _a === void 0 ? void 0 : _a.call(_provider, 'accountsChanged', accountsChangedHandler);
|
|
42
|
+
(_b = _provider === null || _provider === void 0 ? void 0 : _provider.removeListener) === null || _b === void 0 ? void 0 : _b.call(_provider, 'chainChanged', chainChangedHandler);
|
|
43
|
+
(_c = _provider === null || _provider === void 0 ? void 0 : _provider.removeListener) === null || _c === void 0 ? void 0 : _c.call(_provider, 'disconnect', disconnectHandler);
|
|
44
|
+
},
|
|
45
|
+
async getAccounts() {
|
|
46
|
+
if (!_provider)
|
|
47
|
+
return [];
|
|
48
|
+
return (await _provider.request({ method: 'eth_accounts' }));
|
|
49
|
+
},
|
|
50
|
+
async getChainId() {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
if (!_provider)
|
|
53
|
+
return (_b = (_a = config.chains[0]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : 1;
|
|
54
|
+
const hex = await _provider.request({ method: 'eth_chainId' });
|
|
55
|
+
return Number(hex);
|
|
56
|
+
},
|
|
57
|
+
async getProvider() {
|
|
58
|
+
return _provider !== null && _provider !== void 0 ? _provider : undefined;
|
|
59
|
+
},
|
|
60
|
+
async isAuthorized() {
|
|
61
|
+
if (!_provider)
|
|
62
|
+
return false;
|
|
63
|
+
const accounts = (await _provider.request({ method: 'eth_accounts' }));
|
|
64
|
+
return accounts.length > 0;
|
|
65
|
+
},
|
|
66
|
+
onAccountsChanged(accounts) {
|
|
67
|
+
config.emitter.emit('change', { accounts: accounts });
|
|
68
|
+
},
|
|
69
|
+
onChainChanged(chain) {
|
|
70
|
+
config.emitter.emit('change', { chainId: Number(chain) });
|
|
71
|
+
},
|
|
72
|
+
onDisconnect() {
|
|
73
|
+
config.emitter.emit('disconnect');
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { embeddedWalletConnector, setEmbeddedWalletProvider };
|
|
80
|
+
//# sourceMappingURL=embeddedConnector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embeddedConnector.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as getDefaultConfig } from './defaultConfig';
|
|
2
|
+
export { default as getDefaultConnectors, default as wallets, } from './defaultConnectors';
|
|
3
|
+
export { embeddedWalletConnector, setEmbeddedWalletProvider } from './embeddedConnector';
|
|
4
|
+
export { OpenfortWagmiBridge } from './OpenfortWagmiBridge';
|
|
5
|
+
export { useChainIsSupported } from './useChainIsSupported';
|
|
6
|
+
export { useChains } from './useChains';
|
|
7
|
+
export { useConnectWithSiwe } from './useConnectWithSiwe';
|
|
8
|
+
export { EmbeddedWalletWagmiSync } from './useEmbeddedWalletWagmiSync';
|
|
9
|
+
export type { AvailableWallet } from './useWalletAuth';
|
|
10
|
+
export { useWalletAuth } from './useWalletAuth';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as getDefaultConfig } from './defaultConfig.js';
|
|
2
|
+
export { default as getDefaultConnectors, default as wallets } from './defaultConnectors.js';
|
|
3
|
+
export { embeddedWalletConnector, setEmbeddedWalletProvider } from './embeddedConnector.js';
|
|
4
|
+
export { OpenfortWagmiBridge } from './OpenfortWagmiBridge.js';
|
|
5
|
+
export { useChainIsSupported } from './useChainIsSupported.js';
|
|
6
|
+
export { useChains } from './useChains.js';
|
|
7
|
+
export { useConnectWithSiwe } from './useConnectWithSiwe.js';
|
|
8
|
+
export { EmbeddedWalletWagmiSync } from './useEmbeddedWalletWagmiSync.js';
|
|
9
|
+
export { useWalletAuth } from './useWalletAuth.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if a chain ID is supported in the current Wagmi configuration.
|
|
3
|
+
*
|
|
4
|
+
* Use this hook from `@openfort/react/wagmi` when your app uses WagmiProvider.
|
|
5
|
+
*
|
|
6
|
+
* @param chainId - The blockchain chain ID to check.
|
|
7
|
+
* @returns `true` when the chain is configured, `false` otherwise.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { useChainIsSupported } from '@openfort/react/wagmi'
|
|
12
|
+
*
|
|
13
|
+
* function ChainStatus({ chainId }: { chainId?: number }) {
|
|
14
|
+
* const isSupported = useChainIsSupported(chainId)
|
|
15
|
+
*
|
|
16
|
+
* return <span>{isSupported ? 'Supported' : 'Unsupported'}</span>
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function useChainIsSupported(chainId?: number): boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useConfig } from 'wagmi';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if a chain ID is supported in the current Wagmi configuration.
|
|
5
|
+
*
|
|
6
|
+
* Use this hook from `@openfort/react/wagmi` when your app uses WagmiProvider.
|
|
7
|
+
*
|
|
8
|
+
* @param chainId - The blockchain chain ID to check.
|
|
9
|
+
* @returns `true` when the chain is configured, `false` otherwise.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { useChainIsSupported } from '@openfort/react/wagmi'
|
|
14
|
+
*
|
|
15
|
+
* function ChainStatus({ chainId }: { chainId?: number }) {
|
|
16
|
+
* const isSupported = useChainIsSupported(chainId)
|
|
17
|
+
*
|
|
18
|
+
* return <span>{isSupported ? 'Supported' : 'Unsupported'}</span>
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
function useChainIsSupported(chainId) {
|
|
23
|
+
const { chains } = useConfig();
|
|
24
|
+
if (chainId === undefined || chainId === null)
|
|
25
|
+
return false;
|
|
26
|
+
return chains.some((x) => x.id === chainId);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { useChainIsSupported };
|
|
30
|
+
//# sourceMappingURL=useChainIsSupported.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChainIsSupported.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Chain } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Access all blockchain chains configured in the Wagmi config.
|
|
4
|
+
*
|
|
5
|
+
* Use this hook from `@openfort/react/wagmi` when your app uses WagmiProvider.
|
|
6
|
+
* Returns an array of chain objects (id, name, nativeCurrency, etc.).
|
|
7
|
+
*
|
|
8
|
+
* @returns Array of configured blockchain chains
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { useChains } from '@openfort/react/wagmi'
|
|
13
|
+
*
|
|
14
|
+
* function ChainSelector() {
|
|
15
|
+
* const chains = useChains()
|
|
16
|
+
*
|
|
17
|
+
* return (
|
|
18
|
+
* <select>
|
|
19
|
+
* {chains.map((chain) => (
|
|
20
|
+
* <option key={chain.id} value={chain.id}>
|
|
21
|
+
* {chain.name}
|
|
22
|
+
* </option>
|
|
23
|
+
* ))}
|
|
24
|
+
* </select>
|
|
25
|
+
* )
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function useChains(): Chain[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useConfig } from 'wagmi';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Access all blockchain chains configured in the Wagmi config.
|
|
5
|
+
*
|
|
6
|
+
* Use this hook from `@openfort/react/wagmi` when your app uses WagmiProvider.
|
|
7
|
+
* Returns an array of chain objects (id, name, nativeCurrency, etc.).
|
|
8
|
+
*
|
|
9
|
+
* @returns Array of configured blockchain chains
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { useChains } from '@openfort/react/wagmi'
|
|
14
|
+
*
|
|
15
|
+
* function ChainSelector() {
|
|
16
|
+
* const chains = useChains()
|
|
17
|
+
*
|
|
18
|
+
* return (
|
|
19
|
+
* <select>
|
|
20
|
+
* {chains.map((chain) => (
|
|
21
|
+
* <option key={chain.id} value={chain.id}>
|
|
22
|
+
* {chain.name}
|
|
23
|
+
* </option>
|
|
24
|
+
* ))}
|
|
25
|
+
* </select>
|
|
26
|
+
* )
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
function useChains() {
|
|
31
|
+
var _a;
|
|
32
|
+
const wagmi = useConfig();
|
|
33
|
+
const chains = (_a = wagmi === null || wagmi === void 0 ? void 0 : wagmi.chains) !== null && _a !== void 0 ? _a : [];
|
|
34
|
+
return chains.map((c) => c);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { useChains };
|
|
38
|
+
//# sourceMappingURL=useChains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChains.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OpenfortError } from '@openfort/openfort-js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns connectWithSiwe for linking external wallets via SIWE.
|
|
4
|
+
*
|
|
5
|
+
* @returns { connectWithSiwe }
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* const { connectWithSiwe } = useConnectWithSiwe()
|
|
10
|
+
* await connectWithSiwe({ onConnect: () => router.replace('/dashboard') })
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare function useConnectWithSiwe(): {
|
|
14
|
+
connectWithSiwe: ({ onError, onConnect, address: propsAddress, connectorType: propsConnectorType, walletClientType: propsWalletClientType, link, }?: {
|
|
15
|
+
address?: `0x${string}`;
|
|
16
|
+
connectorType?: string;
|
|
17
|
+
walletClientType?: string;
|
|
18
|
+
onError?: (error: string, openfortError?: OpenfortError) => void;
|
|
19
|
+
onConnect?: () => void;
|
|
20
|
+
link?: boolean;
|
|
21
|
+
}) => Promise<void>;
|
|
22
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { OpenfortError } from '@openfort/openfort-js';
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { useEthereumBridge } from '../ethereum/OpenfortEthereumBridgeContext.js';
|
|
4
|
+
import { useOpenfortCore } from '../openfort/useOpenfort.js';
|
|
5
|
+
import { createSIWEMessage } from '../siwe/create-siwe-message.js';
|
|
6
|
+
import { logger } from '../utils/logger.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Returns connectWithSiwe for linking external wallets via SIWE.
|
|
10
|
+
*
|
|
11
|
+
* @returns { connectWithSiwe }
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const { connectWithSiwe } = useConnectWithSiwe()
|
|
16
|
+
* await connectWithSiwe({ onConnect: () => router.replace('/dashboard') })
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
function useConnectWithSiwe() {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
21
|
+
const { client, user, updateUser } = useOpenfortCore();
|
|
22
|
+
const bridge = useEthereumBridge();
|
|
23
|
+
const address = (_a = bridge === null || bridge === void 0 ? void 0 : bridge.account) === null || _a === void 0 ? void 0 : _a.address;
|
|
24
|
+
const connector = (_b = bridge === null || bridge === void 0 ? void 0 : bridge.account) === null || _b === void 0 ? void 0 : _b.connector;
|
|
25
|
+
const chainId = (_c = bridge === null || bridge === void 0 ? void 0 : bridge.chainId) !== null && _c !== void 0 ? _c : 0;
|
|
26
|
+
const accountChainId = (_f = (_e = (_d = bridge === null || bridge === void 0 ? void 0 : bridge.account) === null || _d === void 0 ? void 0 : _d.chain) === null || _e === void 0 ? void 0 : _e.id) !== null && _f !== void 0 ? _f : bridge === null || bridge === void 0 ? void 0 : bridge.chainId;
|
|
27
|
+
const chainName = (_h = (_g = bridge === null || bridge === void 0 ? void 0 : bridge.account) === null || _g === void 0 ? void 0 : _g.chain) === null || _h === void 0 ? void 0 : _h.name;
|
|
28
|
+
const switchChainAsync = (_j = bridge === null || bridge === void 0 ? void 0 : bridge.switchChain) === null || _j === void 0 ? void 0 : _j.switchChainAsync;
|
|
29
|
+
const signMessage = bridge === null || bridge === void 0 ? void 0 : bridge.signMessage;
|
|
30
|
+
const connectWithSiwe = useCallback(async ({ onError, onConnect, address: propsAddress, connectorType: propsConnectorType, walletClientType: propsWalletClientType, link = !!user, } = {}) => {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
const addressToUse = propsAddress !== null && propsAddress !== void 0 ? propsAddress : address;
|
|
33
|
+
const connectorType = propsConnectorType !== null && propsConnectorType !== void 0 ? propsConnectorType : connector === null || connector === void 0 ? void 0 : connector.type;
|
|
34
|
+
const walletClientType = propsWalletClientType !== null && propsWalletClientType !== void 0 ? propsWalletClientType : connector === null || connector === void 0 ? void 0 : connector.id;
|
|
35
|
+
if (!addressToUse || !connectorType || !walletClientType) {
|
|
36
|
+
logger.log('No address found', { address: addressToUse, connectorType, walletClientType });
|
|
37
|
+
onError === null || onError === void 0 ? void 0 : onError('No address found');
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (!signMessage) {
|
|
41
|
+
onError === null || onError === void 0 ? void 0 : onError('EVM bridge not available (signMessage)');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
if (accountChainId !== chainId && switchChainAsync) {
|
|
46
|
+
await switchChainAsync({ chainId });
|
|
47
|
+
}
|
|
48
|
+
let nonce;
|
|
49
|
+
if (link) {
|
|
50
|
+
const resp = await client.auth.initLinkSiwe({ address: addressToUse });
|
|
51
|
+
nonce = resp.nonce;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
const resp = await client.auth.initSiwe({ address: addressToUse });
|
|
55
|
+
nonce = resp.nonce;
|
|
56
|
+
}
|
|
57
|
+
const SIWEMessage = createSIWEMessage(addressToUse, nonce, chainId);
|
|
58
|
+
if (!SIWEMessage)
|
|
59
|
+
throw new Error('SIWE message creation failed (window not available)');
|
|
60
|
+
const signature = await signMessage({ message: SIWEMessage });
|
|
61
|
+
if (link) {
|
|
62
|
+
logger.log('Linking wallet to user');
|
|
63
|
+
await client.auth.linkWithSiwe({
|
|
64
|
+
signature,
|
|
65
|
+
message: SIWEMessage,
|
|
66
|
+
connectorType,
|
|
67
|
+
walletClientType,
|
|
68
|
+
address: addressToUse,
|
|
69
|
+
chainId,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
logger.log('Authenticating with SIWE');
|
|
74
|
+
await client.auth.loginWithSiwe({
|
|
75
|
+
signature,
|
|
76
|
+
message: SIWEMessage,
|
|
77
|
+
connectorType,
|
|
78
|
+
walletClientType,
|
|
79
|
+
address: addressToUse,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
await updateUser();
|
|
83
|
+
await Promise.resolve(onConnect === null || onConnect === void 0 ? void 0 : onConnect());
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
logger.log('Failed to connect with SIWE', {
|
|
87
|
+
error: err,
|
|
88
|
+
status: (_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.status) !== null && _b !== void 0 ? _b : 'unknown',
|
|
89
|
+
});
|
|
90
|
+
if (!onError)
|
|
91
|
+
return;
|
|
92
|
+
let message = err instanceof Error ? err.message : String(err);
|
|
93
|
+
if (message.includes('User rejected the request.')) {
|
|
94
|
+
message = 'User rejected the request.';
|
|
95
|
+
}
|
|
96
|
+
else if (message.includes('Invalid signature')) {
|
|
97
|
+
message = 'Invalid signature. Please try again.';
|
|
98
|
+
}
|
|
99
|
+
else if (message.includes('An error occurred when attempting to switch chain')) {
|
|
100
|
+
message = `Failed to switch chain. Please switch your wallet to ${chainName !== null && chainName !== void 0 ? chainName : 'the correct network'} and try again.`;
|
|
101
|
+
}
|
|
102
|
+
else if (message.includes('already linked')) {
|
|
103
|
+
message = 'This wallet is already linked to another account. Log out and connect with this wallet instead.';
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
message = 'Failed to connect with SIWE.';
|
|
107
|
+
}
|
|
108
|
+
onError(message, err instanceof OpenfortError ? err : undefined);
|
|
109
|
+
}
|
|
110
|
+
}, [client, user, updateUser, address, chainId, connector, accountChainId, chainName, switchChainAsync, signMessage]);
|
|
111
|
+
return { connectWithSiwe };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { useConnectWithSiwe };
|
|
115
|
+
//# sourceMappingURL=useConnectWithSiwe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConnectWithSiwe.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useAccount, useConnect, useDisconnect } from 'wagmi';
|
|
3
|
+
import { embeddedWalletId } from '../constants/openfort.js';
|
|
4
|
+
import { useEthereumEmbeddedWallet } from '../ethereum/hooks/useEthereumEmbeddedWallet.js';
|
|
5
|
+
import { setEmbeddedWalletProvider } from './embeddedConnector.js';
|
|
6
|
+
|
|
7
|
+
/** Null component — rendered inside CoreOpenfortProvider + WagmiProvider to sync embedded wallet into wagmi. */
|
|
8
|
+
function EmbeddedWalletWagmiSync() {
|
|
9
|
+
useEmbeddedWalletWagmiSync();
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
function useEmbeddedWalletWagmiSync() {
|
|
13
|
+
const wallet = useEthereumEmbeddedWallet();
|
|
14
|
+
const { connector: activeConnector, status: wagmiStatus } = useAccount();
|
|
15
|
+
const { connectAsync, connectors } = useConnect();
|
|
16
|
+
const { disconnectAsync } = useDisconnect();
|
|
17
|
+
const status = wallet.status;
|
|
18
|
+
const provider = status === 'connected' ? wallet.provider : null;
|
|
19
|
+
// Keep the module-level provider slot in sync — clear on disconnect
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (status === 'connected' && provider) {
|
|
22
|
+
setEmbeddedWalletProvider(provider);
|
|
23
|
+
return () => {
|
|
24
|
+
setEmbeddedWalletProvider(null);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}, [status, provider]);
|
|
28
|
+
// Connect wagmi once the embedded wallet is ready AND wagmi has settled (not mid-reconnect)
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (status !== 'connected' || !provider)
|
|
31
|
+
return;
|
|
32
|
+
if (wagmiStatus === 'connecting' || wagmiStatus === 'reconnecting')
|
|
33
|
+
return;
|
|
34
|
+
if ((activeConnector === null || activeConnector === void 0 ? void 0 : activeConnector.id) === embeddedWalletId)
|
|
35
|
+
return;
|
|
36
|
+
const embeddedConnector = connectors.find((c) => c.id === embeddedWalletId);
|
|
37
|
+
if (!embeddedConnector)
|
|
38
|
+
return;
|
|
39
|
+
connectAsync({ connector: embeddedConnector }).catch(() => { });
|
|
40
|
+
}, [status, provider, wagmiStatus, activeConnector, connectors, connectAsync]);
|
|
41
|
+
// Disconnect embedded connector from wagmi when the embedded wallet logs out
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (status !== 'disconnected')
|
|
44
|
+
return;
|
|
45
|
+
if ((activeConnector === null || activeConnector === void 0 ? void 0 : activeConnector.id) !== embeddedWalletId)
|
|
46
|
+
return;
|
|
47
|
+
const embeddedConnector = connectors.find((c) => c.id === embeddedWalletId);
|
|
48
|
+
if (embeddedConnector) {
|
|
49
|
+
disconnectAsync({ connector: embeddedConnector }).catch(() => { });
|
|
50
|
+
}
|
|
51
|
+
}, [status, activeConnector, connectors, disconnectAsync]);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { EmbeddedWalletWagmiSync };
|
|
55
|
+
//# sourceMappingURL=useEmbeddedWalletWagmiSync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEmbeddedWalletWagmiSync.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { OpenfortError } from '../core/errors';
|
|
2
|
+
import { type OpenfortEthereumBridgeConnector } from '../ethereum/OpenfortEthereumBridgeContext';
|
|
3
|
+
import type { OpenfortHookOptions } from '../types';
|
|
4
|
+
export interface AvailableWallet {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
connector: OpenfortEthereumBridgeConnector;
|
|
9
|
+
}
|
|
10
|
+
interface WalletAuthCallbacks {
|
|
11
|
+
onConnect?: () => void;
|
|
12
|
+
onError?: (error: string, openfortError?: OpenfortError) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function useWalletAuth(hookOptions?: OpenfortHookOptions): {
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
isError: boolean;
|
|
17
|
+
isSuccess: boolean;
|
|
18
|
+
error: OpenfortError | null | undefined;
|
|
19
|
+
availableWallets: AvailableWallet[];
|
|
20
|
+
connectWallet: (connectorId: string, callbacks?: WalletAuthCallbacks) => Promise<void>;
|
|
21
|
+
linkWallet: (connectorId: string, callbacks?: WalletAuthCallbacks) => Promise<void>;
|
|
22
|
+
walletConnectingTo: string | null;
|
|
23
|
+
};
|
|
24
|
+
export {};
|