@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
package/build/types.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type All = {
|
|
|
11
11
|
lang?: Languages;
|
|
12
12
|
};
|
|
13
13
|
export type { CustomAvatarProps } from './components/Common/Avatar';
|
|
14
|
-
export type { ConnectUIOptions as OpenfortOptions,
|
|
14
|
+
export type { ConnectUIOptions as OpenfortOptions, OpenfortWalletConfig, PhoneConfig, } from './components/Openfort/types';
|
|
15
15
|
export declare enum OpenfortReactErrorType {
|
|
16
16
|
AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR",
|
|
17
17
|
WALLET_ERROR = "WALLET_ERROR",
|
|
@@ -19,20 +19,19 @@ export declare enum OpenfortReactErrorType {
|
|
|
19
19
|
VALIDATION_ERROR = "VALIDATION_ERROR",
|
|
20
20
|
UNEXPECTED_ERROR = "UNEXPECTED_ERROR"
|
|
21
21
|
}
|
|
22
|
-
interface
|
|
23
|
-
[key: string]:
|
|
22
|
+
interface OpenfortErrorData {
|
|
23
|
+
[key: string]: unknown;
|
|
24
24
|
}
|
|
25
25
|
export declare class OpenfortError extends Error {
|
|
26
26
|
type: OpenfortReactErrorType;
|
|
27
|
-
data:
|
|
28
|
-
constructor(message: string, type: OpenfortReactErrorType, data?:
|
|
27
|
+
data: OpenfortErrorData;
|
|
28
|
+
constructor(message: string, type: OpenfortReactErrorType, data?: OpenfortErrorData);
|
|
29
29
|
}
|
|
30
30
|
export type OpenfortHookOptions<T = {
|
|
31
31
|
error?: OpenfortError;
|
|
32
32
|
}> = {
|
|
33
33
|
onSuccess?: (data: T) => void;
|
|
34
34
|
onError?: (error: OpenfortError) => void;
|
|
35
|
-
onSettled?: (data: T | undefined | null, error: OpenfortError | null) => void;
|
|
36
35
|
throwOnError?: boolean;
|
|
37
36
|
};
|
|
38
37
|
export { OAuthProvider, SDKOverrides, ThirdPartyOAuthProvider, } from '@openfort/openfort-js';
|
package/build/types.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export { OAuthProvider, ThirdPartyOAuthProvider } from '@openfort/openfort-js';
|
|
2
|
+
|
|
3
|
+
var OpenfortReactErrorType;
|
|
4
|
+
(function (OpenfortReactErrorType) {
|
|
5
|
+
OpenfortReactErrorType["AUTHENTICATION_ERROR"] = "AUTHENTICATION_ERROR";
|
|
6
|
+
OpenfortReactErrorType["WALLET_ERROR"] = "WALLET_ERROR";
|
|
7
|
+
OpenfortReactErrorType["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
|
|
8
|
+
OpenfortReactErrorType["VALIDATION_ERROR"] = "VALIDATION_ERROR";
|
|
9
|
+
OpenfortReactErrorType["UNEXPECTED_ERROR"] = "UNEXPECTED_ERROR";
|
|
10
|
+
})(OpenfortReactErrorType || (OpenfortReactErrorType = {}));
|
|
11
|
+
class OpenfortError extends Error {
|
|
12
|
+
constructor(message, type, data) {
|
|
13
|
+
if ((data === null || data === void 0 ? void 0 : data.error) instanceof OpenfortError) {
|
|
14
|
+
super(data.error.message);
|
|
15
|
+
this.data = Object.freeze(data.error.data);
|
|
16
|
+
this.type = data.error.type;
|
|
17
|
+
this.name = data.error.name;
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if ((data === null || data === void 0 ? void 0 : data.error) instanceof Error) {
|
|
21
|
+
super(data.error.message);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
super(message);
|
|
25
|
+
}
|
|
26
|
+
this.type = type;
|
|
27
|
+
this.data = Object.freeze(data !== null && data !== void 0 ? data : {});
|
|
28
|
+
this.name = 'OpenfortError';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { OpenfortError, OpenfortReactErrorType };
|
|
33
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function showInitBanner(): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OPENFORT_VERSION } from '../version.js';
|
|
2
|
+
|
|
3
|
+
// SVG logo via background-image data URI is supported in Chrome/Firefox if desired later.
|
|
4
|
+
let _shown = false;
|
|
5
|
+
function showInitBanner() {
|
|
6
|
+
if (_shown || process.env.NODE_ENV === 'production')
|
|
7
|
+
return;
|
|
8
|
+
_shown = true;
|
|
9
|
+
// biome-ignore lint/suspicious/noConsole: intentional SDK init banner
|
|
10
|
+
console.log(`%c \uD83D\uDCE6 Openfort React SDK %c v${OPENFORT_VERSION} %c \u2197 openfort.io/docs`, 'background:#0f0f0f;color:#fff;padding:2px 6px;border-radius:4px 0 0 4px;font-weight:600', 'background:#333;color:#aaa;padding:2px 6px;border-radius:0 4px 4px 0', 'color:#888;padding:2px 4px');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { showInitBanner };
|
|
14
|
+
//# sourceMappingURL=banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses common Web3/RPC errors and returns user-friendly error messages
|
|
3
|
+
* Covers errors from viem, wagmi, and blockchain interactions
|
|
4
|
+
* Based on viem error types: https://v1.viem.sh/docs/glossary/errors.html
|
|
5
|
+
*/
|
|
6
|
+
function parseTransactionError(error) {
|
|
7
|
+
if (!error) {
|
|
8
|
+
return {
|
|
9
|
+
title: 'Transaction failed',
|
|
10
|
+
message: 'An unknown error occurred.',
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
14
|
+
const errorString = errorMessage.toLowerCase();
|
|
15
|
+
const errorName = error instanceof Error ? error.name : '';
|
|
16
|
+
// UserRejectedRequestError - User explicitly denied/rejected the request
|
|
17
|
+
// https://v1.viem.sh/docs/glossary/errors.html#userrejectedrequesterror
|
|
18
|
+
if (errorName === 'UserRejectedRequestError' ||
|
|
19
|
+
errorString.includes('user rejected') ||
|
|
20
|
+
errorString.includes('user denied') ||
|
|
21
|
+
errorString.includes('user cancelled') ||
|
|
22
|
+
errorString.includes('user canceled') ||
|
|
23
|
+
errorString.includes('rejected the request') ||
|
|
24
|
+
errorString.includes('transaction was rejected')) {
|
|
25
|
+
return {
|
|
26
|
+
title: 'Transaction cancelled',
|
|
27
|
+
message: 'You cancelled the transaction.',
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
// AccountNotFoundError - No account provided to action that requires one
|
|
31
|
+
// https://v1.viem.sh/docs/glossary/errors.html#accountnotfounderror
|
|
32
|
+
if (errorName === 'AccountNotFoundError' || errorString.includes('account not found')) {
|
|
33
|
+
return {
|
|
34
|
+
title: 'Account not found',
|
|
35
|
+
message: 'No account is connected.',
|
|
36
|
+
action: 'Please connect your wallet and try again.',
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// InsufficientFundsError - Not enough funds for gas
|
|
40
|
+
// https://v1.viem.sh/docs/glossary/errors.html#insufficientfundserror
|
|
41
|
+
if (errorName === 'InsufficientFundsError' ||
|
|
42
|
+
errorString.includes('insufficient funds') ||
|
|
43
|
+
errorString.includes('insufficient balance') ||
|
|
44
|
+
errorString.includes('exceeds balance') ||
|
|
45
|
+
errorString.includes('insufficient eth') ||
|
|
46
|
+
errorString.includes("sender doesn't have enough funds")) {
|
|
47
|
+
return {
|
|
48
|
+
title: 'Insufficient funds',
|
|
49
|
+
message: "You don't have enough ETH to pay for the gas fee.",
|
|
50
|
+
action: 'Add more ETH to your wallet to cover the transaction fee.',
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
// EstimateGasExecutionError - Gas estimation failed
|
|
54
|
+
// https://v1.viem.sh/docs/glossary/errors.html#estimategasexecutionerror
|
|
55
|
+
if (errorName === 'EstimateGasExecutionError' ||
|
|
56
|
+
errorString.includes('gas estimation failed') ||
|
|
57
|
+
errorString.includes('cannot estimate gas') ||
|
|
58
|
+
errorString.includes('gas required exceeds allowance') ||
|
|
59
|
+
errorString.includes('out of gas')) {
|
|
60
|
+
// Check for specific reasons
|
|
61
|
+
if (errorString.includes('insufficient funds')) {
|
|
62
|
+
return {
|
|
63
|
+
title: 'Insufficient funds',
|
|
64
|
+
message: "You don't have enough ETH to pay for this transaction.",
|
|
65
|
+
action: 'Add more ETH to your wallet.',
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
title: 'Transaction would fail',
|
|
70
|
+
message: 'This transaction is likely to fail.',
|
|
71
|
+
action: 'Please check the recipient address and amount, then try again.',
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
// IntrinsicGasTooHighError / IntrinsicGasTooLowError - Gas limit issues
|
|
75
|
+
// https://v1.viem.sh/docs/glossary/errors.html#intrinsicgastoohigherror
|
|
76
|
+
if (errorName === 'IntrinsicGasTooHighError' ||
|
|
77
|
+
errorName === 'IntrinsicGasTooLowError' ||
|
|
78
|
+
errorString.includes('intrinsic gas too high') ||
|
|
79
|
+
errorString.includes('intrinsic gas too low') ||
|
|
80
|
+
errorString.includes('gas limit')) {
|
|
81
|
+
return {
|
|
82
|
+
title: 'Gas limit error',
|
|
83
|
+
message: 'The gas limit for this transaction is incorrect.',
|
|
84
|
+
action: 'Please try again or contact support.',
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
// NonceTooLowError / NonceTooHighError - Nonce issues
|
|
88
|
+
// https://v1.viem.sh/docs/glossary/errors.html#noncetoolowerror
|
|
89
|
+
if (errorName === 'NonceTooLowError' || errorString.includes('nonce too low')) {
|
|
90
|
+
return {
|
|
91
|
+
title: 'Transaction pending',
|
|
92
|
+
message: 'A transaction is already pending.',
|
|
93
|
+
action: 'Please wait for your pending transaction to complete.',
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (errorName === 'NonceTooHighError' ||
|
|
97
|
+
errorName === 'NonceMaxValueError' ||
|
|
98
|
+
errorString.includes('nonce too high')) {
|
|
99
|
+
return {
|
|
100
|
+
title: 'Transaction error',
|
|
101
|
+
message: 'Transaction nonce is invalid.',
|
|
102
|
+
action: 'Please refresh the page and try again.',
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
// FeeCapTooHighError / FeeCapTooLowError / TipAboveFeeCapError
|
|
106
|
+
// https://v1.viem.sh/docs/glossary/errors.html#feecaptoohigherror
|
|
107
|
+
if (errorName === 'FeeCapTooLowError' ||
|
|
108
|
+
errorName === 'TipAboveFeeCapError' ||
|
|
109
|
+
errorString.includes('transaction underpriced') ||
|
|
110
|
+
errorString.includes('replacement transaction underpriced') ||
|
|
111
|
+
errorString.includes('fee cap too low')) {
|
|
112
|
+
return {
|
|
113
|
+
title: 'Gas fee too low',
|
|
114
|
+
message: 'The gas fee is too low for this transaction.',
|
|
115
|
+
action: 'Try again with a higher gas fee.',
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (errorName === 'FeeCapTooHighError' || errorString.includes('fee cap too high')) {
|
|
119
|
+
return {
|
|
120
|
+
title: 'Gas fee too high',
|
|
121
|
+
message: 'The gas fee is unusually high.',
|
|
122
|
+
action: 'Please check the fee and try again.',
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
// TransactionTypeNotSupportedError
|
|
126
|
+
// https://v1.viem.sh/docs/glossary/errors.html#transactiontypenotsupportederror
|
|
127
|
+
if (errorName === 'TransactionTypeNotSupportedError' || errorString.includes('transaction type not supported')) {
|
|
128
|
+
return {
|
|
129
|
+
title: 'Transaction not supported',
|
|
130
|
+
message: 'This transaction type is not supported on this network.',
|
|
131
|
+
action: 'Please try a different transaction method.',
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
// TransactionExecutionError - General transaction execution failure
|
|
135
|
+
// https://v1.viem.sh/docs/glossary/errors.html#transactionexecutionerror
|
|
136
|
+
if (errorName === 'TransactionExecutionError') {
|
|
137
|
+
return {
|
|
138
|
+
title: 'Transaction failed',
|
|
139
|
+
message: 'The transaction failed to execute.',
|
|
140
|
+
action: 'Please check the transaction details and try again.',
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
// WaitForTransactionReceiptTimeoutError
|
|
144
|
+
// https://v1.viem.sh/docs/glossary/errors.html#waitfortransactionreceipttimeouterror
|
|
145
|
+
if (errorName === 'WaitForTransactionReceiptTimeoutError' || errorString.includes('timeout')) {
|
|
146
|
+
return {
|
|
147
|
+
title: 'Transaction timeout',
|
|
148
|
+
message: 'The transaction is taking longer than expected.',
|
|
149
|
+
action: 'It may still be processing. Check your wallet or block explorer.',
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
// ExecutionRevertedError - Contract execution reverted
|
|
153
|
+
// https://v1.viem.sh/docs/glossary/errors.html#executionrevertederror
|
|
154
|
+
if (errorName === 'ExecutionRevertedError' || errorString.includes('execution reverted')) {
|
|
155
|
+
return {
|
|
156
|
+
title: 'Transaction failed',
|
|
157
|
+
message: 'The transaction was rejected by the contract.',
|
|
158
|
+
action: 'Please check the transaction details and try again.',
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
// ContractFunctionExecutionError / ContractFunctionRevertedError / CallExecutionError
|
|
162
|
+
// https://v1.viem.sh/docs/glossary/errors.html#contractfunctionexecutionerror
|
|
163
|
+
if (errorName === 'ContractFunctionExecutionError' ||
|
|
164
|
+
errorName === 'ContractFunctionRevertedError' ||
|
|
165
|
+
errorName === 'CallExecutionError' ||
|
|
166
|
+
errorName === 'RawContractError') {
|
|
167
|
+
return {
|
|
168
|
+
title: 'Contract error',
|
|
169
|
+
message: 'The contract rejected this transaction.',
|
|
170
|
+
action: 'Please verify the transaction parameters and try again.',
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
// ContractFunctionZeroDataError - No data returned when expected
|
|
174
|
+
// https://v1.viem.sh/docs/glossary/errors.html#contractfunctionzerodataerror
|
|
175
|
+
if (errorName === 'ContractFunctionZeroDataError') {
|
|
176
|
+
return {
|
|
177
|
+
title: 'Contract error',
|
|
178
|
+
message: 'The contract returned no data.',
|
|
179
|
+
action: 'This contract may not exist on this network.',
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
// ABI-related errors
|
|
183
|
+
// https://v1.viem.sh/docs/glossary/errors.html#abi
|
|
184
|
+
if (errorName.includes('Abi') || errorString.includes('abi encoding') || errorString.includes('abi decoding')) {
|
|
185
|
+
return {
|
|
186
|
+
title: 'Contract error',
|
|
187
|
+
message: 'Unable to encode or decode the contract data.',
|
|
188
|
+
action: 'Please contact support if this issue persists.',
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
// ChainMismatchError / ChainNotFoundError / InvalidChainIdError
|
|
192
|
+
// https://v1.viem.sh/docs/glossary/errors.html#chainmismatcherror
|
|
193
|
+
if (errorName === 'ChainMismatchError' ||
|
|
194
|
+
errorName === 'ChainNotFoundError' ||
|
|
195
|
+
errorName === 'InvalidChainIdError' ||
|
|
196
|
+
(errorString.includes('chain') && (errorString.includes('mismatch') || errorString.includes('wrong')))) {
|
|
197
|
+
return {
|
|
198
|
+
title: 'Wrong network',
|
|
199
|
+
message: 'Your wallet is connected to a different network.',
|
|
200
|
+
action: 'Please switch to the correct network in your wallet.',
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
// SwitchChainError
|
|
204
|
+
// https://v1.viem.sh/docs/glossary/errors.html#switchchainerror
|
|
205
|
+
if (errorName === 'SwitchChainError' || errorString.includes('switch chain')) {
|
|
206
|
+
return {
|
|
207
|
+
title: 'Network switch failed',
|
|
208
|
+
message: 'Unable to switch to the requested network.',
|
|
209
|
+
action: 'Please manually switch networks in your wallet.',
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
// ChainDisconnectedError / ProviderDisconnectedError
|
|
213
|
+
// https://v1.viem.sh/docs/glossary/errors.html#chaindisconnectederror
|
|
214
|
+
if (errorName === 'ChainDisconnectedError' ||
|
|
215
|
+
errorName === 'ProviderDisconnectedError' ||
|
|
216
|
+
errorString.includes('disconnected')) {
|
|
217
|
+
return {
|
|
218
|
+
title: 'Connection lost',
|
|
219
|
+
message: 'Lost connection to the network.',
|
|
220
|
+
action: 'Please check your internet connection and try again.',
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
// HttpRequestError / WebSocketRequestError / RpcRequestError / TimeoutError
|
|
224
|
+
// https://v1.viem.sh/docs/glossary/errors.html#httprequesterror
|
|
225
|
+
if (errorName === 'HttpRequestError' ||
|
|
226
|
+
errorName === 'WebSocketRequestError' ||
|
|
227
|
+
errorName === 'RpcRequestError' ||
|
|
228
|
+
errorName === 'TimeoutError' ||
|
|
229
|
+
errorString.includes('network') ||
|
|
230
|
+
errorString.includes('timed out') ||
|
|
231
|
+
errorString.includes('connection') ||
|
|
232
|
+
errorString.includes('failed to fetch') ||
|
|
233
|
+
errorString.includes('request failed') ||
|
|
234
|
+
errorString.includes('could not detect network') ||
|
|
235
|
+
errorString.includes('bad gateway') ||
|
|
236
|
+
errorString.includes('service unavailable')) {
|
|
237
|
+
return {
|
|
238
|
+
title: 'Network error',
|
|
239
|
+
message: 'Unable to connect to the network.',
|
|
240
|
+
action: 'Check your internet connection and try again.',
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
// InternalRpcError / UnknownRpcError
|
|
244
|
+
// https://v1.viem.sh/docs/glossary/errors.html#internalrpcerror
|
|
245
|
+
if (errorName === 'InternalRpcError' ||
|
|
246
|
+
errorName === 'UnknownRpcError' ||
|
|
247
|
+
errorString.includes('internal json-rpc error') ||
|
|
248
|
+
errorString.includes('internal error')) {
|
|
249
|
+
return {
|
|
250
|
+
title: 'Network error',
|
|
251
|
+
message: 'The network encountered an internal error.',
|
|
252
|
+
action: 'Please try again in a moment.',
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
// MethodNotFoundRpcError / MethodNotSupportedRpcError
|
|
256
|
+
// https://v1.viem.sh/docs/glossary/errors.html#methodnotfoundrpcerror
|
|
257
|
+
if (errorName === 'MethodNotFoundRpcError' ||
|
|
258
|
+
errorName === 'MethodNotSupportedRpcError' ||
|
|
259
|
+
errorName === 'UnsupportedProviderMethodError' ||
|
|
260
|
+
(errorString.includes('method') && (errorString.includes('not found') || errorString.includes('not supported')))) {
|
|
261
|
+
return {
|
|
262
|
+
title: 'Method not supported',
|
|
263
|
+
message: 'This operation is not supported by the current network.',
|
|
264
|
+
action: 'Try switching to a different RPC provider.',
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
// InvalidInputRpcError / InvalidParamsRpcError / InvalidRequestRpcError
|
|
268
|
+
// https://v1.viem.sh/docs/glossary/errors.html#invalidinputrpcerror
|
|
269
|
+
if (errorName === 'InvalidInputRpcError' ||
|
|
270
|
+
errorName === 'InvalidParamsRpcError' ||
|
|
271
|
+
errorName === 'InvalidRequestRpcError') {
|
|
272
|
+
return {
|
|
273
|
+
title: 'Invalid request',
|
|
274
|
+
message: 'The request contains invalid parameters.',
|
|
275
|
+
action: 'Please check the transaction details and try again.',
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
// TransactionRejectedRpcError
|
|
279
|
+
// https://v1.viem.sh/docs/glossary/errors.html#transactionrejectedrpcerror
|
|
280
|
+
if (errorName === 'TransactionRejectedRpcError' || errorString.includes('transaction rejected')) {
|
|
281
|
+
return {
|
|
282
|
+
title: 'Transaction rejected',
|
|
283
|
+
message: 'The network rejected this transaction.',
|
|
284
|
+
action: 'Please check the transaction details and try again.',
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
// LimitExceededRpcError / ResourceNotFoundRpcError / ResourceUnavailableRpcError
|
|
288
|
+
// https://v1.viem.sh/docs/glossary/errors.html#limitexceededrpcerror
|
|
289
|
+
if (errorName === 'LimitExceededRpcError' ||
|
|
290
|
+
errorName === 'ResourceNotFoundRpcError' ||
|
|
291
|
+
errorName === 'ResourceUnavailableRpcError') {
|
|
292
|
+
return {
|
|
293
|
+
title: 'Network busy',
|
|
294
|
+
message: 'The network is currently busy or unavailable.',
|
|
295
|
+
action: 'Please wait a moment and try again.',
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
// UnauthorizedProviderError
|
|
299
|
+
// https://v1.viem.sh/docs/glossary/errors.html#unauthorizedprovidererror
|
|
300
|
+
if (errorName === 'UnauthorizedProviderError' || errorString.includes('unauthorized')) {
|
|
301
|
+
return {
|
|
302
|
+
title: 'Unauthorized',
|
|
303
|
+
message: 'This action requires authorization.',
|
|
304
|
+
action: 'Please connect your wallet and try again.',
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
// Wallet/Provider not found
|
|
308
|
+
if (errorString.includes('wallet') && (errorString.includes('not connected') || errorString.includes('not found'))) {
|
|
309
|
+
return {
|
|
310
|
+
title: 'Wallet not connected',
|
|
311
|
+
message: 'Your wallet is not connected.',
|
|
312
|
+
action: 'Please connect your wallet and try again.',
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
if (errorString.includes('provider') && errorString.includes('not found')) {
|
|
316
|
+
return {
|
|
317
|
+
title: 'Wallet not found',
|
|
318
|
+
message: 'No wallet extension detected.',
|
|
319
|
+
action: 'Please install a wallet extension and try again.',
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
// Generic fallback (never expose raw error messages to users)
|
|
323
|
+
return {
|
|
324
|
+
title: 'Transaction failed',
|
|
325
|
+
message: 'An error occurred while processing your transaction.',
|
|
326
|
+
action: 'Please try again.',
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export { parseTransactionError };
|
|
331
|
+
//# sourceMappingURL=errorHandling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorHandling.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format Utilities
|
|
3
|
+
*
|
|
4
|
+
* Address formatting utilities for different chain types.
|
|
5
|
+
*/
|
|
6
|
+
import { ChainTypeEnum } from '@openfort/openfort-js';
|
|
7
|
+
/**
|
|
8
|
+
* Truncate EVM address with configurable separator (regex-based for 0x format).
|
|
9
|
+
*/
|
|
10
|
+
export declare function truncateEthAddress(address?: string, separator?: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Truncate Solana address with configurable separator.
|
|
13
|
+
*/
|
|
14
|
+
export declare function truncateSolanaAddress(address?: string, separator?: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Format address based on chain type
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatAddress(address: string, chainType: ChainTypeEnum): string;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ChainTypeEnum } from '@openfort/openfort-js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Format Utilities
|
|
5
|
+
*
|
|
6
|
+
* Address formatting utilities for different chain types.
|
|
7
|
+
*/
|
|
8
|
+
const EVM_TRUNCATE_REGEX = /^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/;
|
|
9
|
+
/**
|
|
10
|
+
* Format EVM address: 0x1234...abcd
|
|
11
|
+
*/
|
|
12
|
+
function formatEVMAddress(address) {
|
|
13
|
+
if (!address || address.length < 10)
|
|
14
|
+
return address;
|
|
15
|
+
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Format Solana address: ABC1...XYZ9
|
|
19
|
+
*/
|
|
20
|
+
function formatSolanaAddress(address) {
|
|
21
|
+
if (!address || address.length < 8)
|
|
22
|
+
return address;
|
|
23
|
+
return `${address.slice(0, 4)}...${address.slice(-4)}`;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Truncate EVM address with configurable separator (regex-based for 0x format).
|
|
27
|
+
*/
|
|
28
|
+
function truncateEthAddress(address, separator = '••••') {
|
|
29
|
+
if (!address)
|
|
30
|
+
return '';
|
|
31
|
+
const match = address.match(EVM_TRUNCATE_REGEX);
|
|
32
|
+
if (!match)
|
|
33
|
+
return address;
|
|
34
|
+
return `${match[1]}${separator}${match[2]}`;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Truncate Solana address with configurable separator.
|
|
38
|
+
*/
|
|
39
|
+
function truncateSolanaAddress(address, separator = '••••') {
|
|
40
|
+
if (!address)
|
|
41
|
+
return '';
|
|
42
|
+
if (address.length <= 14)
|
|
43
|
+
return address;
|
|
44
|
+
return `${address.slice(0, 6)}${separator}${address.slice(-4)}`;
|
|
45
|
+
}
|
|
46
|
+
const addressFormatters = {
|
|
47
|
+
[ChainTypeEnum.EVM]: formatEVMAddress,
|
|
48
|
+
[ChainTypeEnum.SVM]: formatSolanaAddress,
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Format address based on chain type
|
|
52
|
+
*/
|
|
53
|
+
function formatAddress(address, chainType) {
|
|
54
|
+
const formatter = addressFormatters[chainType];
|
|
55
|
+
return formatter(address);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { formatAddress, truncateEthAddress, truncateSolanaAddress };
|
|
59
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { truncateEthAddress, truncateSolanaAddress } from './format';
|
|
3
3
|
declare const nFormatter: (num: number, digits?: number) => string;
|
|
4
4
|
declare const detectBrowser: () => "" | import("detect-browser").Browser | "bot" | "node" | "react-native";
|
|
5
5
|
declare const isAndroid: () => boolean;
|
|
@@ -8,6 +8,5 @@ type ReactChildArray = ReturnType<typeof React.Children.toArray>;
|
|
|
8
8
|
declare function flattenChildren(children: React.ReactNode): ReactChildArray;
|
|
9
9
|
export declare const isWalletConnectConnector: (connectorId?: string) => connectorId is "walletConnect";
|
|
10
10
|
export declare const isCoinbaseWalletConnector: (connectorId?: string) => connectorId is "coinbaseWalletSDK";
|
|
11
|
-
export declare const isSafeConnector: (connectorId?: string) => connectorId is "safe";
|
|
12
11
|
export declare const isInjectedConnector: (connectorId?: string) => connectorId is "injected";
|
|
13
|
-
export { nFormatter, truncateEthAddress, isMobile, isAndroid, detectBrowser, flattenChildren };
|
|
12
|
+
export { nFormatter, truncateEthAddress, truncateSolanaAddress, isMobile, isAndroid, detectBrowser, flattenChildren };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { detect } from 'detect-browser';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { formatWithDynamicDecimals } from '../components/Pages/Buy/utils.js';
|
|
4
|
+
export { truncateEthAddress, truncateSolanaAddress } from './format.js';
|
|
5
|
+
|
|
6
|
+
const nFormatter = (num, digits = 2) => {
|
|
7
|
+
// Handle zero case
|
|
8
|
+
if (num === 0)
|
|
9
|
+
return '0.00';
|
|
10
|
+
// Handle very small amounts
|
|
11
|
+
if (num > 0 && num < 0.000001)
|
|
12
|
+
return '<0.000001';
|
|
13
|
+
if (num < 10000)
|
|
14
|
+
return formatWithDynamicDecimals(num);
|
|
15
|
+
const lookup = [
|
|
16
|
+
{ value: 1, symbol: '' },
|
|
17
|
+
{ value: 1e3, symbol: 'k' },
|
|
18
|
+
{ value: 1e6, symbol: 'm' },
|
|
19
|
+
{ value: 1e9, symbol: 'b' },
|
|
20
|
+
{ value: 1e12, symbol: 't' },
|
|
21
|
+
{ value: 1e15, symbol: 'p' },
|
|
22
|
+
{ value: 1e18, symbol: 'e' },
|
|
23
|
+
];
|
|
24
|
+
const rx = /\.0+$|(\.[0-9]*[1-9])0+$/;
|
|
25
|
+
var item = lookup
|
|
26
|
+
.slice()
|
|
27
|
+
.reverse()
|
|
28
|
+
.find((item) => num >= item.value);
|
|
29
|
+
return item ? (num / item.value).toFixed(digits).replace(rx, '$1') + item.symbol : '0';
|
|
30
|
+
};
|
|
31
|
+
const detectBrowser = () => {
|
|
32
|
+
var _a;
|
|
33
|
+
const browser = detect();
|
|
34
|
+
return (_a = browser === null || browser === void 0 ? void 0 : browser.name) !== null && _a !== void 0 ? _a : '';
|
|
35
|
+
};
|
|
36
|
+
const detectOS = () => {
|
|
37
|
+
var _a;
|
|
38
|
+
const browser = detect();
|
|
39
|
+
return (_a = browser === null || browser === void 0 ? void 0 : browser.os) !== null && _a !== void 0 ? _a : '';
|
|
40
|
+
};
|
|
41
|
+
const isIOS = () => {
|
|
42
|
+
const os = detectOS();
|
|
43
|
+
return os.toLowerCase().includes('ios');
|
|
44
|
+
};
|
|
45
|
+
const isAndroid = () => {
|
|
46
|
+
const os = detectOS();
|
|
47
|
+
return os.toLowerCase().includes('android');
|
|
48
|
+
};
|
|
49
|
+
const isMobile = () => {
|
|
50
|
+
return isAndroid() || isIOS();
|
|
51
|
+
};
|
|
52
|
+
function flattenChildren(children) {
|
|
53
|
+
const childrenArray = React.Children.toArray(children);
|
|
54
|
+
return childrenArray.reduce((flatChildren, child) => {
|
|
55
|
+
if (child.type === React.Fragment) {
|
|
56
|
+
return flatChildren.concat(flattenChildren(child.props.children));
|
|
57
|
+
}
|
|
58
|
+
flatChildren.push(child);
|
|
59
|
+
return flatChildren;
|
|
60
|
+
}, []);
|
|
61
|
+
}
|
|
62
|
+
const isWalletConnectConnector = (connectorId) => connectorId === 'walletConnect';
|
|
63
|
+
const isCoinbaseWalletConnector = (connectorId) => connectorId === 'coinbaseWalletSDK';
|
|
64
|
+
const isInjectedConnector = (connectorId) => connectorId === 'injected';
|
|
65
|
+
|
|
66
|
+
export { detectBrowser, flattenChildren, isAndroid, isCoinbaseWalletConnector, isInjectedConnector, isMobile, isWalletConnectConnector, nFormatter };
|
|
67
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const PREFIX = '[Openfort-React]';
|
|
2
|
+
const logger = {
|
|
3
|
+
enabled: false,
|
|
4
|
+
// biome-ignore lint/suspicious/noConsole: allowed for debugging
|
|
5
|
+
log: (...args) => (logger.enabled ? console.log(PREFIX, ...args) : null),
|
|
6
|
+
// biome-ignore lint/suspicious/noConsole: allowed for debugging
|
|
7
|
+
error: (...args) => (logger.enabled ? console.error(PREFIX, ...args) : null),
|
|
8
|
+
// biome-ignore lint/suspicious/noConsole: allowed for debugging
|
|
9
|
+
warn: (...args) => (logger.enabled ? console.warn(PREFIX, ...args) : null),
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { logger };
|
|
13
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|