@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 @@
|
|
|
1
|
+
{"version":3,"file":"useAsyncData.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OpenfortError } from '../../core/errors';
|
|
2
|
+
export type OTPResponse = {
|
|
3
|
+
error?: OpenfortError;
|
|
4
|
+
sentTo?: 'email' | 'phone';
|
|
5
|
+
email?: string;
|
|
6
|
+
phone?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function useRecoveryOTP(): {
|
|
9
|
+
isEnabled: boolean;
|
|
10
|
+
requestOTP: () => Promise<OTPResponse>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useMemo, useCallback } from 'react';
|
|
2
|
+
import { useOpenfort } from '../../components/Openfort/useOpenfort.js';
|
|
3
|
+
import { OpenfortError, OpenfortReactErrorType } from '../../types.js';
|
|
4
|
+
import { useOpenfortCore } from '../../openfort/useOpenfort.js';
|
|
5
|
+
import { logger } from '../../utils/logger.js';
|
|
6
|
+
|
|
7
|
+
function useRecoveryOTP() {
|
|
8
|
+
const { client, user } = useOpenfortCore();
|
|
9
|
+
const { walletConfig } = useOpenfort();
|
|
10
|
+
const isEnabled = useMemo(() => {
|
|
11
|
+
return !!walletConfig && (!!walletConfig.requestWalletRecoverOTP || !!walletConfig.requestWalletRecoverOTPEndpoint);
|
|
12
|
+
}, [walletConfig]);
|
|
13
|
+
const requestOTP = useCallback(async () => {
|
|
14
|
+
try {
|
|
15
|
+
logger.log('Requesting wallet recover OTP for user', { userId: user === null || user === void 0 ? void 0 : user.id });
|
|
16
|
+
if (!walletConfig) {
|
|
17
|
+
throw new Error('No walletConfig found');
|
|
18
|
+
}
|
|
19
|
+
const accessToken = await client.getAccessToken();
|
|
20
|
+
if (!accessToken) {
|
|
21
|
+
throw new OpenfortError('Openfort access token not found', OpenfortReactErrorType.AUTHENTICATION_ERROR);
|
|
22
|
+
}
|
|
23
|
+
if (!(user === null || user === void 0 ? void 0 : user.id)) {
|
|
24
|
+
throw new OpenfortError('User not found', OpenfortReactErrorType.AUTHENTICATION_ERROR);
|
|
25
|
+
}
|
|
26
|
+
const userId = user.id;
|
|
27
|
+
const email = user.email;
|
|
28
|
+
const phone = user.email ? undefined : user.phoneNumber;
|
|
29
|
+
if (!email && !phone) {
|
|
30
|
+
throw new OpenfortError('No email or phone number found for user', OpenfortReactErrorType.AUTHENTICATION_ERROR);
|
|
31
|
+
}
|
|
32
|
+
logger.log('Requesting wallet recover OTP for user', { userId, email, phone });
|
|
33
|
+
if (walletConfig.requestWalletRecoverOTP) {
|
|
34
|
+
await walletConfig.requestWalletRecoverOTP({ userId, accessToken, email, phone });
|
|
35
|
+
return { sentTo: email ? 'email' : 'phone', email, phone };
|
|
36
|
+
}
|
|
37
|
+
if (!walletConfig.requestWalletRecoverOTPEndpoint) {
|
|
38
|
+
throw new Error('No requestWalletRecoverOTPEndpoint set in walletConfig');
|
|
39
|
+
}
|
|
40
|
+
const resp = await fetch(walletConfig.requestWalletRecoverOTPEndpoint, {
|
|
41
|
+
method: 'POST',
|
|
42
|
+
headers: {
|
|
43
|
+
'Content-Type': 'application/json',
|
|
44
|
+
},
|
|
45
|
+
body: JSON.stringify({ user_id: userId, email, phone }),
|
|
46
|
+
});
|
|
47
|
+
if (!resp.ok) {
|
|
48
|
+
throw new Error('Failed to request wallet recover OTP');
|
|
49
|
+
}
|
|
50
|
+
return { sentTo: email ? 'email' : 'phone', email, phone };
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
logger.log('Error requesting wallet recover OTP:', err);
|
|
54
|
+
const error = err instanceof OpenfortError
|
|
55
|
+
? err
|
|
56
|
+
: new OpenfortError('Failed to request wallet recover OTP', OpenfortReactErrorType.WALLET_ERROR);
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
}, [walletConfig, client, user]);
|
|
60
|
+
return { isEnabled, requestOTP };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { useRecoveryOTP };
|
|
64
|
+
//# sourceMappingURL=useRecoveryOTP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRecoveryOTP.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { AccountTypeEnum, EmbeddedAccount, RecoveryMethod, RecoveryParams } from '@openfort/openfort-js';
|
|
2
|
+
import type { OpenfortHookOptions } from '../types';
|
|
3
|
+
export type RecoverableWallet = {
|
|
4
|
+
address: string;
|
|
5
|
+
id: string;
|
|
6
|
+
recoveryMethod?: RecoveryMethod;
|
|
7
|
+
accounts: {
|
|
8
|
+
id: string;
|
|
9
|
+
}[];
|
|
10
|
+
};
|
|
11
|
+
export type SetRecoveryOptions = {
|
|
12
|
+
previousRecovery: RecoveryParams;
|
|
13
|
+
newRecovery: RecoveryParams;
|
|
14
|
+
};
|
|
15
|
+
export type WalletStatus = 'disconnected' | 'fetching-wallets' | 'connecting' | 'reconnecting' | 'creating' | 'needs-recovery' | 'connected' | 'error';
|
|
16
|
+
/** Shared connected wallet state (EVM and Solana embedded hooks). */
|
|
17
|
+
export type ConnectedWalletState = {
|
|
18
|
+
/** embeddedWalletId when connected (embedded-only hooks). */
|
|
19
|
+
embeddedWalletId?: string;
|
|
20
|
+
isConnected: boolean;
|
|
21
|
+
isConnecting: boolean;
|
|
22
|
+
isDisconnected: boolean;
|
|
23
|
+
isReconnecting: boolean;
|
|
24
|
+
};
|
|
25
|
+
/** Derived booleans for consistent hook shape (EVM and Solana). */
|
|
26
|
+
export type WalletDerived = {
|
|
27
|
+
isLoading: boolean;
|
|
28
|
+
isError: boolean;
|
|
29
|
+
isSuccess: boolean;
|
|
30
|
+
};
|
|
31
|
+
/** Result of creating an embedded wallet (EVM or Solana). */
|
|
32
|
+
export type CreateEmbeddedWalletResult = {
|
|
33
|
+
account: EmbeddedAccount;
|
|
34
|
+
error?: string;
|
|
35
|
+
};
|
|
36
|
+
/** Common options for setting active embedded wallet (recovery only; each chain adds address). */
|
|
37
|
+
export type SetActiveEmbeddedWalletOptionsBase = {
|
|
38
|
+
/** Recovery params for wallet access (escape hatch; prefer named options) */
|
|
39
|
+
recoveryParams?: RecoveryParams;
|
|
40
|
+
/** Recovery method when recoveryParams not provided */
|
|
41
|
+
recoveryMethod?: RecoveryMethod;
|
|
42
|
+
/** Passkey ID for PASSKEY recovery */
|
|
43
|
+
passkeyId?: string;
|
|
44
|
+
/** Password for PASSWORD recovery */
|
|
45
|
+
password?: string;
|
|
46
|
+
/** OTP code for AUTOMATIC recovery */
|
|
47
|
+
otpCode?: string;
|
|
48
|
+
};
|
|
49
|
+
/** Options for creating an embedded wallet (EVM and Solana; EOA and gas sponsorship). */
|
|
50
|
+
export type CreateEmbeddedWalletOptions = {
|
|
51
|
+
/** Target chain ID for deployment (EVM) */
|
|
52
|
+
chainId?: number;
|
|
53
|
+
/** Recovery method for key encryption */
|
|
54
|
+
recoveryMethod?: RecoveryMethod;
|
|
55
|
+
/** Passkey ID for PASSKEY recovery */
|
|
56
|
+
passkeyId?: string;
|
|
57
|
+
/** Password for PASSWORD recovery */
|
|
58
|
+
password?: string;
|
|
59
|
+
/** OTP code for verification */
|
|
60
|
+
otpCode?: string;
|
|
61
|
+
/** Account type (EOA, Smart Account, or Delegated Account) */
|
|
62
|
+
accountType?: AccountTypeEnum;
|
|
63
|
+
/** Fee sponsorship ID for gas sponsorship */
|
|
64
|
+
feeSponsorshipId?: string;
|
|
65
|
+
} & OpenfortHookOptions<CreateEmbeddedWalletResult>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WalletStatus } from '../types';
|
|
2
|
+
type InternalState<TWallet, TProvider> = {
|
|
3
|
+
status: WalletStatus;
|
|
4
|
+
activeWallet: TWallet | null;
|
|
5
|
+
provider: TProvider | null;
|
|
6
|
+
error: string | null;
|
|
7
|
+
};
|
|
8
|
+
type StatusResult<TWallet, TProvider, TActions> = TActions & {
|
|
9
|
+
status: WalletStatus;
|
|
10
|
+
activeWallet: TWallet | null;
|
|
11
|
+
provider?: TProvider;
|
|
12
|
+
error?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function buildEmbeddedWalletStatusResult<TWallet, TProvider, TActions extends object>(state: InternalState<TWallet, TProvider>, actions: TActions): StatusResult<TWallet, TProvider, TActions>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function buildStatusResult(state, actions, overrides) {
|
|
2
|
+
var _a;
|
|
3
|
+
return { ...actions, status: state.status, activeWallet: (_a = state.activeWallet) !== null && _a !== void 0 ? _a : null, ...overrides };
|
|
4
|
+
}
|
|
5
|
+
const STATUS_RESULT_BUILDERS = {
|
|
6
|
+
disconnected: (s, a) => buildStatusResult(s, a, { activeWallet: null }),
|
|
7
|
+
'fetching-wallets': (s, a) => buildStatusResult(s, a, { activeWallet: null }),
|
|
8
|
+
connecting: (s, a) => buildStatusResult(s, a, { activeWallet: s.activeWallet }),
|
|
9
|
+
reconnecting: (s, a) => buildStatusResult(s, a, { activeWallet: s.activeWallet }),
|
|
10
|
+
creating: (s, a) => buildStatusResult(s, a, { activeWallet: null }),
|
|
11
|
+
'needs-recovery': (s, a) => buildStatusResult(s, a, { activeWallet: s.activeWallet }),
|
|
12
|
+
connected: (s, a) => buildStatusResult(s, a, { activeWallet: s.activeWallet, provider: s.provider }),
|
|
13
|
+
error: (s, a) => buildStatusResult(s, a, { activeWallet: s.activeWallet, error: s.error }),
|
|
14
|
+
};
|
|
15
|
+
function buildEmbeddedWalletStatusResult(state, actions) {
|
|
16
|
+
var _a;
|
|
17
|
+
const builder = (_a = STATUS_RESULT_BUILDERS[state.status]) !== null && _a !== void 0 ? _a : STATUS_RESULT_BUILDERS.disconnected;
|
|
18
|
+
return builder(state, actions);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { buildEmbeddedWalletStatusResult };
|
|
22
|
+
//# sourceMappingURL=embeddedWalletStatusMapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embeddedWalletStatusMapper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ChainTypeEnum } from '@openfort/openfort-js';
|
|
2
|
+
import type { SolanaCluster } from '../../solana/types';
|
|
3
|
+
/** Options for building a block explorer URL. */
|
|
4
|
+
type ExplorerUrlOptions = {
|
|
5
|
+
address?: string;
|
|
6
|
+
txHash?: string;
|
|
7
|
+
chainId?: number;
|
|
8
|
+
cluster?: SolanaCluster;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Builds a block explorer URL for an address or transaction on the given chain.
|
|
12
|
+
*
|
|
13
|
+
* @param chainType - EVM or SVM
|
|
14
|
+
* @param options - address, txHash, chainId (EVM), or cluster (Solana)
|
|
15
|
+
* @returns Full explorer URL
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const url = getExplorerUrl(ChainTypeEnum.EVM, { address: '0x...', chainId: 1 })
|
|
20
|
+
* const txUrl = getExplorerUrl(ChainTypeEnum.EVM, { txHash: '0x...', chainId: 1 })
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function getExplorerUrl(chainType: ChainTypeEnum, options: ExplorerUrlOptions): string;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ChainTypeEnum } from '@openfort/openfort-js';
|
|
2
|
+
import { mainnet, optimism, polygon, base, arbitrum, bsc, polygonAmoy, baseSepolia, beamTestnet, sepolia, optimismSepolia, arbitrumSepolia } from 'viem/chains';
|
|
3
|
+
import { logger } from '../../utils/logger.js';
|
|
4
|
+
|
|
5
|
+
const SOLANA_EXPLORER_BASE = 'https://explorer.solana.com';
|
|
6
|
+
/** Known EVM chains with block explorers — sourced from viem/chains. */
|
|
7
|
+
const EVM_CHAINS_BY_ID = {
|
|
8
|
+
[mainnet.id]: mainnet,
|
|
9
|
+
[optimism.id]: optimism,
|
|
10
|
+
[polygon.id]: polygon,
|
|
11
|
+
[base.id]: base,
|
|
12
|
+
[arbitrum.id]: arbitrum,
|
|
13
|
+
[bsc.id]: bsc,
|
|
14
|
+
[polygonAmoy.id]: polygonAmoy,
|
|
15
|
+
[baseSepolia.id]: baseSepolia,
|
|
16
|
+
[beamTestnet.id]: beamTestnet,
|
|
17
|
+
[sepolia.id]: sepolia,
|
|
18
|
+
[optimismSepolia.id]: optimismSepolia,
|
|
19
|
+
[arbitrumSepolia.id]: arbitrumSepolia,
|
|
20
|
+
};
|
|
21
|
+
function appendPath(base, options, queryParams) {
|
|
22
|
+
let path = base;
|
|
23
|
+
if (options.address)
|
|
24
|
+
path = `${base}/address/${options.address}`;
|
|
25
|
+
else if (options.txHash)
|
|
26
|
+
path = `${base}/tx/${options.txHash}`;
|
|
27
|
+
return queryParams ? `${path}?${queryParams}` : path;
|
|
28
|
+
}
|
|
29
|
+
const explorerRegistry = {
|
|
30
|
+
[ChainTypeEnum.EVM]: (options) => {
|
|
31
|
+
var _a;
|
|
32
|
+
if (!options.chainId) {
|
|
33
|
+
logger.warn('No chain ID provided. Configure explorerUrls in OpenfortProvider for better reliability and rate limits.');
|
|
34
|
+
return polygonAmoy.blockExplorers.default.url;
|
|
35
|
+
}
|
|
36
|
+
const chain = EVM_CHAINS_BY_ID[options.chainId];
|
|
37
|
+
const explorerUrl = (_a = chain === null || chain === void 0 ? void 0 : chain.blockExplorers) === null || _a === void 0 ? void 0 : _a.default.url;
|
|
38
|
+
if (!explorerUrl) {
|
|
39
|
+
logger.warn(`No explorer URL found for chain ${options.chainId}. Configure explorerUrls in OpenfortProvider for better reliability and rate limits.`);
|
|
40
|
+
return polygonAmoy.blockExplorers.default.url;
|
|
41
|
+
}
|
|
42
|
+
return appendPath(explorerUrl, options);
|
|
43
|
+
},
|
|
44
|
+
[ChainTypeEnum.SVM]: (options) => {
|
|
45
|
+
if (!options.cluster) {
|
|
46
|
+
logger.warn('No cluster provided. Configure explorerUrls in OpenfortProvider for better reliability and rate limits.');
|
|
47
|
+
return appendPath(SOLANA_EXPLORER_BASE, options);
|
|
48
|
+
}
|
|
49
|
+
const clusterParam = options.cluster === 'mainnet-beta' ? undefined : `cluster=${encodeURIComponent(options.cluster)}`;
|
|
50
|
+
return appendPath(SOLANA_EXPLORER_BASE, options, clusterParam);
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Builds a block explorer URL for an address or transaction on the given chain.
|
|
55
|
+
*
|
|
56
|
+
* @param chainType - EVM or SVM
|
|
57
|
+
* @param options - address, txHash, chainId (EVM), or cluster (Solana)
|
|
58
|
+
* @returns Full explorer URL
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* const url = getExplorerUrl(ChainTypeEnum.EVM, { address: '0x...', chainId: 1 })
|
|
63
|
+
* const txUrl = getExplorerUrl(ChainTypeEnum.EVM, { txHash: '0x...', chainId: 1 })
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
function getExplorerUrl(chainType, options) {
|
|
67
|
+
return explorerRegistry[chainType](options);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { getExplorerUrl };
|
|
71
|
+
//# sourceMappingURL=explorer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explorer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OpenfortError } from '../../core/errors';
|
|
2
|
+
type HandleOtpErrorResult = {
|
|
3
|
+
error: OpenfortError;
|
|
4
|
+
isOTPRequired: boolean;
|
|
5
|
+
};
|
|
6
|
+
/** Normalizes OTP_REQUIRED errors and returns user-friendly messages. */
|
|
7
|
+
export declare function handleOtpRecoveryError(error: Error | unknown, hasWalletRecoveryOTP: boolean): HandleOtpErrorResult;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OpenfortError, OpenfortReactErrorType } from '../../types.js';
|
|
2
|
+
|
|
3
|
+
/** Normalizes OTP_REQUIRED errors and returns user-friendly messages. */
|
|
4
|
+
function handleOtpRecoveryError(error, hasWalletRecoveryOTP) {
|
|
5
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
6
|
+
if (msg !== 'OTP_REQUIRED') {
|
|
7
|
+
const normalized = error instanceof OpenfortError ? error : new OpenfortError(msg, OpenfortReactErrorType.UNEXPECTED_ERROR);
|
|
8
|
+
return { error: normalized, isOTPRequired: false };
|
|
9
|
+
}
|
|
10
|
+
const newError = hasWalletRecoveryOTP
|
|
11
|
+
? new OpenfortError('OTP code is required to recover the wallet.', OpenfortReactErrorType.WALLET_ERROR)
|
|
12
|
+
: new OpenfortError('OTP code is required to recover the wallet.\nPlease set requestWalletRecoveryOTP or requestWalletRecoveryOTPEndpoint in OpenfortProvider.', OpenfortReactErrorType.WALLET_ERROR);
|
|
13
|
+
return { error: newError, isOTPRequired: true };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { handleOtpRecoveryError };
|
|
17
|
+
//# sourceMappingURL=otpError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otpError.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RecoveryMethod, type RecoveryParams } from '@openfort/openfort-js';
|
|
2
|
+
import type { OpenfortWalletConfig } from '../../components/Openfort/types';
|
|
3
|
+
type RecoveryOptions = {
|
|
4
|
+
recoveryMethod?: RecoveryMethod;
|
|
5
|
+
passkeyId?: string;
|
|
6
|
+
password?: string;
|
|
7
|
+
otpCode?: string;
|
|
8
|
+
};
|
|
9
|
+
export type BuildRecoveryParamsConfig = {
|
|
10
|
+
walletConfig: OpenfortWalletConfig | undefined;
|
|
11
|
+
getAccessToken: () => Promise<string | null>;
|
|
12
|
+
getUserId: () => Promise<string | undefined>;
|
|
13
|
+
};
|
|
14
|
+
export declare function buildRecoveryParams(options: RecoveryOptions | undefined, config: BuildRecoveryParamsConfig): Promise<RecoveryParams>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { RecoveryMethod } from '@openfort/openfort-js';
|
|
2
|
+
import { OpenfortError, OpenfortReactErrorType } from '../../types.js';
|
|
3
|
+
|
|
4
|
+
async function buildRecoveryParams(options, config) {
|
|
5
|
+
var _a;
|
|
6
|
+
const { walletConfig, getAccessToken, getUserId } = config;
|
|
7
|
+
const recoveryMethod = (_a = options === null || options === void 0 ? void 0 : options.recoveryMethod) !== null && _a !== void 0 ? _a : RecoveryMethod.AUTOMATIC;
|
|
8
|
+
switch (recoveryMethod) {
|
|
9
|
+
case RecoveryMethod.AUTOMATIC: {
|
|
10
|
+
const accessToken = await getAccessToken();
|
|
11
|
+
if (!accessToken) {
|
|
12
|
+
throw new OpenfortError('Access token not found', OpenfortReactErrorType.AUTHENTICATION_ERROR);
|
|
13
|
+
}
|
|
14
|
+
const userId = await getUserId();
|
|
15
|
+
if (!userId) {
|
|
16
|
+
throw new OpenfortError('User not found', OpenfortReactErrorType.AUTHENTICATION_ERROR);
|
|
17
|
+
}
|
|
18
|
+
const encryptionSession = await getEncryptionSession({
|
|
19
|
+
accessToken,
|
|
20
|
+
userId,
|
|
21
|
+
otpCode: options === null || options === void 0 ? void 0 : options.otpCode,
|
|
22
|
+
walletConfig,
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
recoveryMethod: RecoveryMethod.AUTOMATIC,
|
|
26
|
+
encryptionSession,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
case RecoveryMethod.PASSWORD: {
|
|
30
|
+
if (!(options === null || options === void 0 ? void 0 : options.password)) {
|
|
31
|
+
throw new OpenfortError('Password is required', OpenfortReactErrorType.CONFIGURATION_ERROR);
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
recoveryMethod: RecoveryMethod.PASSWORD,
|
|
35
|
+
password: options.password,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
case RecoveryMethod.PASSKEY:
|
|
39
|
+
return {
|
|
40
|
+
recoveryMethod: RecoveryMethod.PASSKEY,
|
|
41
|
+
...((options === null || options === void 0 ? void 0 : options.passkeyId) && { passkeyInfo: { passkeyId: options.passkeyId } }),
|
|
42
|
+
};
|
|
43
|
+
default:
|
|
44
|
+
throw new OpenfortError('Unsupported recovery method', OpenfortReactErrorType.UNEXPECTED_ERROR, {
|
|
45
|
+
recoveryMethod,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async function getEncryptionSession(params) {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
const { accessToken, userId, otpCode, walletConfig } = params;
|
|
52
|
+
if (!walletConfig) {
|
|
53
|
+
throw new OpenfortError('Wallet config not found', OpenfortReactErrorType.CONFIGURATION_ERROR);
|
|
54
|
+
}
|
|
55
|
+
if (walletConfig.getEncryptionSession) {
|
|
56
|
+
const session = await walletConfig.getEncryptionSession({ accessToken, userId, otpCode });
|
|
57
|
+
if (typeof session !== 'string' || session.length === 0) {
|
|
58
|
+
throw new OpenfortError('getEncryptionSession returned invalid session', OpenfortReactErrorType.WALLET_ERROR);
|
|
59
|
+
}
|
|
60
|
+
return session;
|
|
61
|
+
}
|
|
62
|
+
if (walletConfig.createEncryptedSessionEndpoint) {
|
|
63
|
+
const response = await fetch(walletConfig.createEncryptedSessionEndpoint, {
|
|
64
|
+
method: 'POST',
|
|
65
|
+
headers: { 'Content-Type': 'application/json' },
|
|
66
|
+
body: JSON.stringify({ user_id: userId, otp_code: otpCode }),
|
|
67
|
+
});
|
|
68
|
+
let data;
|
|
69
|
+
try {
|
|
70
|
+
data = (await response.json());
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
data = {};
|
|
74
|
+
}
|
|
75
|
+
if (!response.ok) {
|
|
76
|
+
if (data.error === 'OTP_REQUIRED') {
|
|
77
|
+
throw new OpenfortError('OTP verification required', OpenfortReactErrorType.AUTHENTICATION_ERROR);
|
|
78
|
+
}
|
|
79
|
+
const errMsg = typeof ((_a = data.error) !== null && _a !== void 0 ? _a : data.message) === 'string'
|
|
80
|
+
? `Failed to create encryption session: ${(_b = data.error) !== null && _b !== void 0 ? _b : data.message}`
|
|
81
|
+
: 'Failed to create encryption session';
|
|
82
|
+
throw new OpenfortError(errMsg, OpenfortReactErrorType.WALLET_ERROR, {
|
|
83
|
+
error: data.error != null ? new Error(String(data.error)) : undefined,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const session = data.session;
|
|
87
|
+
if (typeof session !== 'string' || session.length === 0) {
|
|
88
|
+
throw new OpenfortError('Invalid encryption session response', OpenfortReactErrorType.WALLET_ERROR);
|
|
89
|
+
}
|
|
90
|
+
return session;
|
|
91
|
+
}
|
|
92
|
+
throw new OpenfortError('No encryption session method configured. Provide getEncryptionSession or createEncryptedSessionEndpoint in walletConfig.', OpenfortReactErrorType.CONFIGURATION_ERROR);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export { buildRecoveryParams };
|
|
96
|
+
//# sourceMappingURL=recovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Address validation utilities (dependency-free).
|
|
3
|
+
*
|
|
4
|
+
* openfort-js does not export address validation. The solana-sample example
|
|
5
|
+
* (openfort-js/examples/apps/solana-sample) uses @solana/kit's address() in a
|
|
6
|
+
* try/catch for Solana. We keep this shared util dependency-free so that
|
|
7
|
+
* consumers that don't use @solana/kit (e.g. EVM-only apps) don't pull it in.
|
|
8
|
+
* For stricter Solana validation when @solana/kit is available, use
|
|
9
|
+
* address(addr) from '@solana/kit' in a try/catch. React-native package has no
|
|
10
|
+
* shared address validation (no Send UI with recipient field in the repo).
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Validates a Solana address (Base58, 32–44 characters).
|
|
14
|
+
*/
|
|
15
|
+
export declare function isValidSolanaAddress(address: string): boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Address validation utilities (dependency-free).
|
|
3
|
+
*
|
|
4
|
+
* openfort-js does not export address validation. The solana-sample example
|
|
5
|
+
* (openfort-js/examples/apps/solana-sample) uses @solana/kit's address() in a
|
|
6
|
+
* try/catch for Solana. We keep this shared util dependency-free so that
|
|
7
|
+
* consumers that don't use @solana/kit (e.g. EVM-only apps) don't pull it in.
|
|
8
|
+
* For stricter Solana validation when @solana/kit is available, use
|
|
9
|
+
* address(addr) from '@solana/kit' in a try/catch. React-native package has no
|
|
10
|
+
* shared address validation (no Send UI with recipient field in the repo).
|
|
11
|
+
*/
|
|
12
|
+
const BASE58_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
13
|
+
function isValidBase58Character(c) {
|
|
14
|
+
return BASE58_ALPHABET.includes(c);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Validates a Solana address (Base58, 32–44 characters).
|
|
18
|
+
*/
|
|
19
|
+
function isValidSolanaAddress(address) {
|
|
20
|
+
if (typeof address !== 'string' || address.length < 32 || address.length > 44) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
return address.split('').every(isValidBase58Character);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { isValidSolanaAddress };
|
|
27
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { WalletStatus } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Maps wallet status + activeWallet presence to the derived boolean/id props
|
|
4
|
+
* shared by both Ethereum and Solana embedded wallet hooks.
|
|
5
|
+
*/
|
|
6
|
+
export declare function toConnectedStateProperties(status: WalletStatus, activeWallet: object | null): {
|
|
7
|
+
embeddedWalletId: undefined;
|
|
8
|
+
isConnected: boolean;
|
|
9
|
+
isConnecting: boolean;
|
|
10
|
+
isDisconnected: boolean;
|
|
11
|
+
isReconnecting: boolean;
|
|
12
|
+
} | {
|
|
13
|
+
embeddedWalletId: string;
|
|
14
|
+
isConnected: boolean;
|
|
15
|
+
isConnecting: boolean;
|
|
16
|
+
isDisconnected: boolean;
|
|
17
|
+
isReconnecting: boolean;
|
|
18
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { embeddedWalletId } from '../../constants/openfort.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Maps wallet status + activeWallet presence to the derived boolean/id props
|
|
5
|
+
* shared by both Ethereum and Solana embedded wallet hooks.
|
|
6
|
+
*/
|
|
7
|
+
function toConnectedStateProperties(status, activeWallet) {
|
|
8
|
+
if (status === 'creating' || status === 'fetching-wallets') {
|
|
9
|
+
return {
|
|
10
|
+
embeddedWalletId: undefined,
|
|
11
|
+
isConnected: false,
|
|
12
|
+
isConnecting: true,
|
|
13
|
+
isDisconnected: false,
|
|
14
|
+
isReconnecting: false,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
if (status === 'connecting' || status === 'reconnecting') {
|
|
18
|
+
return {
|
|
19
|
+
embeddedWalletId,
|
|
20
|
+
isConnected: false,
|
|
21
|
+
isConnecting: true,
|
|
22
|
+
isDisconnected: false,
|
|
23
|
+
isReconnecting: status === 'reconnecting',
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if ((status === 'connected' || status === 'needs-recovery') && activeWallet) {
|
|
27
|
+
return {
|
|
28
|
+
embeddedWalletId,
|
|
29
|
+
isConnected: status === 'connected',
|
|
30
|
+
isConnecting: false,
|
|
31
|
+
isDisconnected: false,
|
|
32
|
+
isReconnecting: false,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
embeddedWalletId: undefined,
|
|
37
|
+
isConnected: false,
|
|
38
|
+
isConnecting: false,
|
|
39
|
+
isDisconnected: true,
|
|
40
|
+
isReconnecting: false,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { toConnectedStateProperties };
|
|
45
|
+
//# sourceMappingURL=walletStatusProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walletStatusProps.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Creates a SIWE message for wallet auth. Uses current domain and origin.
|
|
3
|
+
* Safe for SSR: returns undefined when window is not available.
|
|
4
|
+
*
|
|
5
|
+
* @param address - Wallet address to sign
|
|
6
|
+
* @param nonce - Server-provided nonce
|
|
7
|
+
* @param chainId - Chain ID for the message
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const message = createSIWEMessage(address, nonce, chainId)
|
|
12
|
+
* const signature = await signMessage({ message })
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const createSIWEMessage: (address: `0x${string}`, nonce: string, chainId: number) => string | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createSiweMessage } from 'viem/siwe';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creates a SIWE message for wallet auth. Uses current domain and origin.
|
|
5
|
+
* Safe for SSR: returns undefined when window is not available.
|
|
6
|
+
*
|
|
7
|
+
* @param address - Wallet address to sign
|
|
8
|
+
* @param nonce - Server-provided nonce
|
|
9
|
+
* @param chainId - Chain ID for the message
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const message = createSIWEMessage(address, nonce, chainId)
|
|
14
|
+
* const signature = await signMessage({ message })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
const createSIWEMessage = (address, nonce, chainId) => {
|
|
18
|
+
if (typeof window === 'undefined')
|
|
19
|
+
return undefined;
|
|
20
|
+
return createSiweMessage({
|
|
21
|
+
domain: window.location.host,
|
|
22
|
+
address,
|
|
23
|
+
statement: 'By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.',
|
|
24
|
+
uri: window.location.origin,
|
|
25
|
+
version: '1',
|
|
26
|
+
chainId: chainId,
|
|
27
|
+
nonce,
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { createSIWEMessage };
|
|
32
|
+
//# sourceMappingURL=create-siwe-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-siwe-message.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Solana Context Provider
|
|
3
|
+
*
|
|
4
|
+
* Provides Solana configuration (cluster, RPC URL, commitment) to descendant components.
|
|
5
|
+
* Cluster is fixed at config time and cannot be changed at runtime.
|
|
6
|
+
*/
|
|
7
|
+
import { type ReactNode } from 'react';
|
|
8
|
+
import type { SolanaCluster, SolanaCommitment, SolanaConfig } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* Solana context value with resolved configuration
|
|
11
|
+
*/
|
|
12
|
+
interface SolanaContextValue {
|
|
13
|
+
/** Active Solana cluster */
|
|
14
|
+
cluster: SolanaCluster;
|
|
15
|
+
/** RPC URL (resolved from config or default) */
|
|
16
|
+
rpcUrl: string;
|
|
17
|
+
/** Transaction commitment level */
|
|
18
|
+
commitment: SolanaCommitment;
|
|
19
|
+
}
|
|
20
|
+
interface SolanaContextProviderProps {
|
|
21
|
+
/** Solana configuration from OpenfortWalletConfig */
|
|
22
|
+
config: SolanaConfig;
|
|
23
|
+
/** Child components */
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export declare const SolanaContext: import("react").Context<SolanaContextValue | null>;
|
|
27
|
+
export declare function SolanaContextProvider({ config, children }: SolanaContextProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* Access the Solana context configuration.
|
|
30
|
+
*
|
|
31
|
+
* @throws Error if called outside of a SolanaContextProvider
|
|
32
|
+
* (i.e., when `walletConfig.solana` is not configured in OpenfortProvider)
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* function MyComponent() {
|
|
37
|
+
* const { cluster, rpcUrl, commitment } = useSolanaContext();
|
|
38
|
+
* // Use Solana configuration...
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function useSolanaContext(): SolanaContextValue;
|
|
43
|
+
export {};
|