@openfort/react 0.3.2 → 1.0.1
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 +227 -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/index.d.ts +7 -1
- package/build/components/Pages/Send/index.js +17 -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/PasswordStrength/PasswordStrengthIndicator.js +62 -0
- package/build/components/PasswordStrength/PasswordStrengthIndicator.js.map +1 -0
- package/build/components/PasswordStrength/password-utility.js +128 -0
- package/build/components/PasswordStrength/password-utility.js.map +1 -0
- package/build/constants/chainConfigs.js +316 -0
- package/build/constants/chainConfigs.js.map +1 -0
- package/build/constants/defaultTheme.js +6 -0
- package/build/constants/defaultTheme.js.map +1 -0
- package/build/constants/openfort.d.ts +4 -0
- package/build/constants/openfort.js +8 -0
- package/build/constants/openfort.js.map +1 -0
- package/build/core/ConnectionStrategy.d.ts +31 -0
- package/build/core/ConnectionStrategy.js +9 -0
- package/build/core/ConnectionStrategy.js.map +1 -0
- package/build/core/ConnectionStrategyContext.d.ts +16 -0
- package/build/core/ConnectionStrategyContext.js +22 -0
- package/build/core/ConnectionStrategyContext.js.map +1 -0
- package/build/core/errors.d.ts +1 -0
- package/build/core/strategies/EthereumBridgeStrategy.d.ts +11 -0
- package/build/core/strategies/EthereumBridgeStrategy.js +83 -0
- package/build/core/strategies/EthereumBridgeStrategy.js.map +1 -0
- package/build/core/strategies/EthereumEmbeddedStrategy.d.ts +8 -0
- package/build/core/strategies/EthereumEmbeddedStrategy.js +85 -0
- package/build/core/strategies/EthereumEmbeddedStrategy.js.map +1 -0
- package/build/core/strategies/SolanaEmbeddedStrategy.d.ts +9 -0
- package/build/core/strategies/SolanaEmbeddedStrategy.js +53 -0
- package/build/core/strategies/SolanaEmbeddedStrategy.js.map +1 -0
- package/build/core/strategyUtils.d.ts +6 -0
- package/build/core/strategyUtils.js +31 -0
- package/build/core/strategyUtils.js.map +1 -0
- package/build/ethereum/OpenfortEthereumBridgeContext.d.ts +87 -0
- package/build/ethereum/OpenfortEthereumBridgeContext.js +18 -0
- package/build/ethereum/OpenfortEthereumBridgeContext.js.map +1 -0
- package/build/ethereum/hooks/getEmbeddedWalletClient.d.ts +14 -0
- package/build/ethereum/hooks/getEmbeddedWalletClient.js +24 -0
- package/build/ethereum/hooks/getEmbeddedWalletClient.js.map +1 -0
- package/build/ethereum/hooks/useEthereumEmbeddedWallet.d.ts +17 -0
- package/build/ethereum/hooks/useEthereumEmbeddedWallet.js +425 -0
- package/build/ethereum/hooks/useEthereumEmbeddedWallet.js.map +1 -0
- package/build/ethereum/hooks/useEthereumWalletAssets.d.ts +29 -0
- package/build/ethereum/hooks/useEthereumWalletAssets.js +204 -0
- package/build/ethereum/hooks/useEthereumWalletAssets.js.map +1 -0
- package/build/ethereum/index.d.ts +11 -0
- package/build/ethereum/index.js +3 -0
- package/build/ethereum/index.js.map +1 -0
- package/build/ethereum/types.d.ts +140 -0
- package/build/hooks/openfort/auth/requestEmailVerification.js +21 -0
- package/build/hooks/openfort/auth/requestEmailVerification.js.map +1 -0
- package/build/hooks/openfort/auth/status.js +11 -0
- package/build/hooks/openfort/auth/status.js.map +1 -0
- package/build/hooks/openfort/auth/useAuthCallback.d.ts +2 -1
- package/build/hooks/openfort/auth/useAuthCallback.js +197 -0
- package/build/hooks/openfort/auth/useAuthCallback.js.map +1 -0
- package/build/hooks/openfort/auth/useConnectToWalletPostAuth.d.ts +2 -2
- package/build/hooks/openfort/auth/useConnectToWalletPostAuth.js +161 -0
- package/build/hooks/openfort/auth/useConnectToWalletPostAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useEmailAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useEmailAuth.js +496 -0
- package/build/hooks/openfort/auth/useEmailAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useEmailOtpAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useEmailOtpAuth.js +151 -0
- package/build/hooks/openfort/auth/useEmailOtpAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useGuestAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useGuestAuth.js +142 -0
- package/build/hooks/openfort/auth/useGuestAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useOAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/useOAuth.js +217 -0
- package/build/hooks/openfort/auth/useOAuth.js.map +1 -0
- package/build/hooks/openfort/auth/usePhoneOtpAuth.d.ts +4 -3
- package/build/hooks/openfort/auth/usePhoneOtpAuth.js +174 -0
- package/build/hooks/openfort/auth/usePhoneOtpAuth.js.map +1 -0
- package/build/hooks/openfort/auth/useSignOut.d.ts +2 -1
- package/build/hooks/openfort/auth/useSignOut.js +104 -0
- package/build/hooks/openfort/auth/useSignOut.js.map +1 -0
- package/build/hooks/openfort/hookConsistency.js +17 -0
- package/build/hooks/openfort/hookConsistency.js.map +1 -0
- package/build/hooks/openfort/use7702Authorization.js +73 -0
- package/build/hooks/openfort/use7702Authorization.js.map +1 -0
- package/build/hooks/openfort/useGrantPermissions.d.ts +7 -76
- package/build/hooks/openfort/useGrantPermissions.js +221 -0
- package/build/hooks/openfort/useGrantPermissions.js.map +1 -0
- package/build/hooks/openfort/useProviders.js +75 -0
- package/build/hooks/openfort/useProviders.js.map +1 -0
- package/build/hooks/openfort/useRevokePermissions.d.ts +2 -1
- package/build/hooks/openfort/useRevokePermissions.js +126 -0
- package/build/hooks/openfort/useRevokePermissions.js.map +1 -0
- package/build/hooks/openfort/useUI.d.ts +4 -45
- package/build/hooks/openfort/useUI.js +122 -0
- package/build/hooks/openfort/useUI.js.map +1 -0
- package/build/hooks/openfort/useUser.d.ts +12 -35
- package/build/hooks/openfort/useUser.js +61 -0
- package/build/hooks/openfort/useUser.js.map +1 -0
- package/build/hooks/openfort/walletTypes.d.ts +32 -0
- package/build/hooks/openfort/walletTypes.js +53 -0
- package/build/hooks/openfort/walletTypes.js.map +1 -0
- package/build/hooks/useBalance.d.ts +50 -0
- package/build/hooks/useBalance.js +80 -0
- package/build/hooks/useBalance.js.map +1 -0
- package/build/hooks/useConnectLifecycle.d.ts +7 -0
- package/build/hooks/useConnectLifecycle.js +43 -0
- package/build/hooks/useConnectLifecycle.js.map +1 -0
- package/build/hooks/useConnectors.d.ts +3 -5
- package/build/hooks/useConnectors.js +26 -0
- package/build/hooks/useConnectors.js.map +1 -0
- package/build/hooks/useCopyToClipboard.js +29 -0
- package/build/hooks/useCopyToClipboard.js.map +1 -0
- package/build/hooks/useFitText.js +125 -0
- package/build/hooks/useFitText.js.map +1 -0
- package/build/hooks/useFocusTrap.d.ts +4 -1
- package/build/hooks/useFocusTrap.js +60 -0
- package/build/hooks/useFocusTrap.js.map +1 -0
- package/build/hooks/useGoogleFont.js +43 -0
- package/build/hooks/useGoogleFont.js.map +1 -0
- package/build/hooks/useIsMobile.js +17 -0
- package/build/hooks/useIsMobile.js.map +1 -0
- package/build/hooks/useIsMounted.js +10 -0
- package/build/hooks/useIsMounted.js.map +1 -0
- package/build/hooks/useLastConnector.js +39 -0
- package/build/hooks/useLastConnector.js.map +1 -0
- package/build/hooks/useLocales.d.ts +1 -1
- package/build/hooks/useLocales.js +68 -0
- package/build/hooks/useLocales.js.map +1 -0
- package/build/hooks/useLockBodyScroll.js +53 -0
- package/build/hooks/useLockBodyScroll.js.map +1 -0
- package/build/hooks/usePrevious.js +14 -0
- package/build/hooks/usePrevious.js.map +1 -0
- package/build/hooks/useResolvedIdentity.d.ts +70 -0
- package/build/hooks/useResolvedIdentity.js +90 -0
- package/build/hooks/useResolvedIdentity.js.map +1 -0
- package/build/hooks/useRouteProps.d.ts +10 -5
- package/build/hooks/useRouteProps.js +27 -0
- package/build/hooks/useRouteProps.js.map +1 -0
- package/build/hooks/useWalletConnectModal.js +59 -0
- package/build/hooks/useWalletConnectModal.js.map +1 -0
- package/build/hooks/useWindowSize.js +23 -0
- package/build/hooks/useWindowSize.js.map +1 -0
- package/build/index.d.ts +61 -16
- package/build/index.js +31 -0
- package/build/index.js.map +1 -0
- package/build/localizations/index.js +57 -0
- package/build/localizations/index.js.map +1 -0
- package/build/localizations/locales/ar-AE.js +100 -0
- package/build/localizations/locales/ar-AE.js.map +1 -0
- package/build/localizations/locales/ca-AD.js +98 -0
- package/build/localizations/locales/ca-AD.js.map +1 -0
- package/build/localizations/locales/ee-EE.js +98 -0
- package/build/localizations/locales/ee-EE.js.map +1 -0
- package/build/localizations/locales/en-US.js +115 -0
- package/build/localizations/locales/en-US.js.map +1 -0
- package/build/localizations/locales/es-ES.js +98 -0
- package/build/localizations/locales/es-ES.js.map +1 -0
- package/build/localizations/locales/fa-IR.js +98 -0
- package/build/localizations/locales/fa-IR.js.map +1 -0
- package/build/localizations/locales/fr-FR.js +98 -0
- package/build/localizations/locales/fr-FR.js.map +1 -0
- package/build/localizations/locales/ja-JP.js +98 -0
- package/build/localizations/locales/ja-JP.js.map +1 -0
- package/build/localizations/locales/pt-BR.js +98 -0
- package/build/localizations/locales/pt-BR.js.map +1 -0
- package/build/localizations/locales/ru-RU.js +98 -0
- package/build/localizations/locales/ru-RU.js.map +1 -0
- package/build/localizations/locales/tr-TR.js +98 -0
- package/build/localizations/locales/tr-TR.js.map +1 -0
- package/build/localizations/locales/vi-VN.js +98 -0
- package/build/localizations/locales/vi-VN.js.map +1 -0
- package/build/localizations/locales/zh-CN.js +98 -0
- package/build/localizations/locales/zh-CN.js.map +1 -0
- package/build/openfort/CoreOpenfortProvider.d.ts +9 -22
- package/build/openfort/CoreOpenfortProvider.js +389 -0
- package/build/openfort/CoreOpenfortProvider.js.map +1 -0
- package/build/{hooks/useConnectCallback.d.ts → openfort/connectCallbackTypes.d.ts} +2 -2
- package/build/openfort/context.d.ts +3 -2
- package/build/openfort/context.js +6 -0
- package/build/openfort/context.js.map +1 -0
- package/build/openfort/core/client.d.ts +2 -1
- package/build/openfort/core/client.js +23 -0
- package/build/openfort/core/client.js.map +1 -0
- package/build/openfort/hooks/useActiveAddressSync.d.ts +20 -0
- package/build/openfort/hooks/useActiveAddressSync.js +76 -0
- package/build/openfort/hooks/useActiveAddressSync.js.map +1 -0
- package/build/openfort/hooks/useAutoRecovery.d.ts +26 -0
- package/build/openfort/hooks/useAutoRecovery.js +102 -0
- package/build/openfort/hooks/useAutoRecovery.js.map +1 -0
- package/build/openfort/hooks/useEmbeddedStateMachine.d.ts +31 -0
- package/build/openfort/hooks/useEmbeddedStateMachine.js +77 -0
- package/build/openfort/hooks/useEmbeddedStateMachine.js.map +1 -0
- package/build/openfort/selectors.d.ts +9 -0
- package/build/openfort/selectors.js +15 -0
- package/build/openfort/selectors.js.map +1 -0
- package/build/openfort/store.d.ts +46 -0
- package/build/openfort/store.js +116 -0
- package/build/openfort/store.js.map +1 -0
- package/build/openfort/useOpenfort.d.ts +9 -3
- package/build/openfort/useOpenfort.js +15 -0
- package/build/openfort/useOpenfort.js.map +1 -0
- package/build/openfort/useOpenfortStore.d.ts +2 -0
- package/build/openfort/useOpenfortStore.js +13 -0
- package/build/openfort/useOpenfortStore.js.map +1 -0
- package/build/query/index.d.ts +2 -0
- package/build/query/queryKeys.d.ts +12 -0
- package/build/query/queryKeys.js +15 -0
- package/build/query/queryKeys.js.map +1 -0
- package/build/query/queryOptions.d.ts +23 -0
- package/build/query/queryOptions.js +31 -0
- package/build/query/queryOptions.js.map +1 -0
- package/build/shared/hooks/useAsyncData.d.ts +19 -0
- package/build/shared/hooks/useAsyncData.js +69 -0
- package/build/shared/hooks/useAsyncData.js.map +1 -0
- package/build/shared/hooks/useRecoveryOTP.d.ts +11 -0
- package/build/shared/hooks/useRecoveryOTP.js +64 -0
- package/build/shared/hooks/useRecoveryOTP.js.map +1 -0
- package/build/shared/types.d.ts +65 -0
- package/build/shared/utils/embeddedWalletStatusMapper.d.ts +15 -0
- package/build/shared/utils/embeddedWalletStatusMapper.js +22 -0
- package/build/shared/utils/embeddedWalletStatusMapper.js.map +1 -0
- package/build/shared/utils/explorer.d.ts +24 -0
- package/build/shared/utils/explorer.js +71 -0
- package/build/shared/utils/explorer.js.map +1 -0
- package/build/shared/utils/otpError.d.ts +8 -0
- package/build/shared/utils/otpError.js +17 -0
- package/build/shared/utils/otpError.js.map +1 -0
- package/build/shared/utils/recovery.d.ts +15 -0
- package/build/shared/utils/recovery.js +96 -0
- package/build/shared/utils/recovery.js.map +1 -0
- package/build/shared/utils/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/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 +1 -0
- package/build/solana/hooks/utils.js +10 -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/styles/index.js +334 -0
- package/build/styles/index.js.map +1 -0
- package/build/styles/styled/index.js +14 -0
- package/build/styles/styled/index.js.map +1 -0
- package/build/styles/themes/base.js +147 -0
- package/build/styles/themes/base.js.map +1 -0
- package/build/styles/themes/index.js +13 -0
- package/build/styles/themes/index.js.map +1 -0
- package/build/styles/themes/midnight.js +78 -0
- package/build/styles/themes/midnight.js.map +1 -0
- package/build/styles/themes/minimal.js +100 -0
- package/build/styles/themes/minimal.js.map +1 -0
- package/build/styles/themes/nouns.js +83 -0
- package/build/styles/themes/nouns.js.map +1 -0
- package/build/styles/themes/retro.js +110 -0
- package/build/styles/themes/retro.js.map +1 -0
- package/build/styles/themes/rounded.js +110 -0
- package/build/styles/themes/rounded.js.map +1 -0
- package/build/styles/themes/soft.js +73 -0
- package/build/styles/themes/soft.js.map +1 -0
- package/build/styles/themes/web95.js +136 -0
- package/build/styles/themes/web95.js.map +1 -0
- package/build/types.d.ts +5 -6
- package/build/types.js +33 -0
- package/build/types.js.map +1 -0
- package/build/utils/banner.d.ts +1 -0
- package/build/utils/banner.js +14 -0
- package/build/utils/banner.js.map +1 -0
- package/build/utils/errorHandling.js +331 -0
- package/build/utils/errorHandling.js.map +1 -0
- package/build/utils/format.d.ts +18 -0
- package/build/utils/format.js +59 -0
- package/build/utils/format.js.map +1 -0
- package/build/utils/index.d.ts +2 -3
- package/build/utils/index.js +67 -0
- package/build/utils/index.js.map +1 -0
- package/build/utils/logger.js +13 -0
- package/build/utils/logger.js.map +1 -0
- package/build/utils/oauthErrorHandler.d.ts +1 -1
- package/build/utils/oauthErrorHandler.js +42 -0
- package/build/utils/oauthErrorHandler.js.map +1 -0
- package/build/utils/p3.js +14 -0
- package/build/utils/p3.js.map +1 -0
- package/build/utils/rpc.d.ts +34 -0
- package/build/utils/rpc.js +93 -0
- package/build/utils/rpc.js.map +1 -0
- package/build/utils/useOnUserReturn.js +25 -0
- package/build/utils/useOnUserReturn.js.map +1 -0
- package/build/utils/validation.js +7 -0
- package/build/utils/validation.js.map +1 -0
- package/build/utils/wallets.d.ts +6 -0
- package/build/utils/wallets.js +14 -0
- package/build/utils/wallets.js.map +1 -0
- package/build/version.d.ts +1 -1
- package/build/version.js +4 -0
- package/build/version.js.map +1 -0
- package/build/wagmi/OpenfortWagmiBridge.d.ts +3 -0
- package/build/wagmi/OpenfortWagmiBridge.js +166 -0
- package/build/wagmi/OpenfortWagmiBridge.js.map +1 -0
- package/build/wagmi/components/ChainSelect/index.js +140 -0
- package/build/wagmi/components/ChainSelect/index.js.map +1 -0
- package/build/wagmi/components/ChainSelectDropdown/index.js +144 -0
- package/build/wagmi/components/ChainSelectDropdown/index.js.map +1 -0
- package/build/wagmi/components/ChainSelectDropdown/styles.js +47 -0
- package/build/wagmi/components/ChainSelectDropdown/styles.js.map +1 -0
- package/build/wagmi/components/ChainSelectList/index.js +109 -0
- package/build/wagmi/components/ChainSelectList/index.js.map +1 -0
- package/build/wagmi/components/ChainSelectList/styles.js +225 -0
- package/build/wagmi/components/ChainSelectList/styles.js.map +1 -0
- package/build/wagmi/components/SwitchNetworks/index.js +22 -0
- package/build/wagmi/components/SwitchNetworks/index.js.map +1 -0
- package/build/wagmi/connectorFilter.d.ts +6 -0
- package/build/wagmi/connectorFilter.js +16 -0
- package/build/wagmi/connectorFilter.js.map +1 -0
- package/build/{defaultConfig.d.ts → wagmi/defaultConfig.d.ts} +1 -2
- package/build/wagmi/defaultConfig.js +27 -0
- package/build/wagmi/defaultConfig.js.map +1 -0
- package/build/wagmi/defaultConnectors.js +36 -0
- package/build/wagmi/defaultConnectors.js.map +1 -0
- package/build/wagmi/embeddedConnector.d.ts +4 -0
- package/build/wagmi/embeddedConnector.js +80 -0
- package/build/wagmi/embeddedConnector.js.map +1 -0
- package/build/wagmi/index.d.ts +10 -0
- package/build/wagmi/index.js +10 -0
- package/build/wagmi/index.js.map +1 -0
- package/build/wagmi/useChainIsSupported.d.ts +20 -0
- package/build/wagmi/useChainIsSupported.js +30 -0
- package/build/wagmi/useChainIsSupported.js.map +1 -0
- package/build/wagmi/useChains.d.ts +29 -0
- package/build/wagmi/useChains.js +38 -0
- package/build/wagmi/useChains.js.map +1 -0
- package/build/wagmi/useConnectWithSiwe.d.ts +22 -0
- package/build/wagmi/useConnectWithSiwe.js +115 -0
- package/build/wagmi/useConnectWithSiwe.js.map +1 -0
- package/build/wagmi/useEmbeddedWalletWagmiSync.d.ts +2 -0
- package/build/wagmi/useEmbeddedWalletWagmiSync.js +55 -0
- package/build/wagmi/useEmbeddedWalletWagmiSync.js.map +1 -0
- package/build/wagmi/useWalletAuth.d.ts +24 -0
- package/build/wagmi/useWalletAuth.js +180 -0
- package/build/wagmi/useWalletAuth.js.map +1 -0
- package/build/wallets/useExternalConnectors.d.ts +17 -0
- package/build/wallets/useExternalConnectors.js +98 -0
- package/build/wallets/useExternalConnectors.js.map +1 -0
- package/build/wallets/walletConfigs.js +344 -0
- package/build/wallets/walletConfigs.js.map +1 -0
- package/package.json +62 -11
- package/build/components/PageLayout/index.d.ts +0 -6
- package/build/components/contexts/web3/index.d.ts +0 -13
- package/build/constants/erc20.d.ts +0 -42
- package/build/hooks/openfort/auth/useWalletAuth.d.ts +0 -20
- package/build/hooks/openfort/useConnectWithSiwe.d.ts +0 -8
- package/build/hooks/openfort/useWalletAssets.d.ts +0 -16
- package/build/hooks/openfort/useWallets.d.ts +0 -134
- package/build/hooks/useChainIsSupported.d.ts +0 -24
- package/build/hooks/useChains.d.ts +0 -41
- package/build/hooks/useConnect.d.ts +0 -24
- package/build/hooks/useEnsFallbackConfig.d.ts +0 -1
- package/build/index.es.js +0 -19627
- package/build/index.es.js.map +0 -1
- package/build/openfortCustomTypes.d.ts +0 -10
- package/build/wallets/index.d.ts +0 -7
- package/build/wallets/useWagmiWallets.d.ts +0 -9
- /package/build/components/Pages/{SoicalProviders → SocialProviders}/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelect/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectDropdown/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectDropdown/styles.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectList/index.d.ts +0 -0
- /package/build/{components/Common → wagmi/components}/ChainSelectList/styles.d.ts +0 -0
- /package/build/{components/Pages → wagmi/components}/SwitchNetworks/index.d.ts +0 -0
- /package/build/{defaultConnectors.d.ts → wagmi/defaultConnectors.d.ts} +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { MotionConfig, AnimatePresence } from 'framer-motion';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import useLocales from '../../../hooks/useLocales.js';
|
|
5
|
+
import Button from '../../Common/Button/index.js';
|
|
6
|
+
import FitText from '../../Common/FitText/index.js';
|
|
7
|
+
import { OrDivider } from '../../Common/Modal/index.js';
|
|
8
|
+
import { ModalH1, ModalBody, ModalContent } from '../../Common/Modal/styles.js';
|
|
9
|
+
import { useOpenfort } from '../../Openfort/useOpenfort.js';
|
|
10
|
+
import { PageContent } from '../../PageContent/index.js';
|
|
11
|
+
import { SlideOne, SlideTwo, SlideThree } from './graphics.js';
|
|
12
|
+
import { Slider, ImageContainer, ImageContainerInner, Slides, Slide, MobileImageContainer, Dots, Dot } from './styles.js';
|
|
13
|
+
|
|
14
|
+
const About = () => {
|
|
15
|
+
var _a;
|
|
16
|
+
const locales = useLocales({
|
|
17
|
+
//CONNECTORNAME: connector.name,
|
|
18
|
+
});
|
|
19
|
+
const context = useOpenfort();
|
|
20
|
+
const ctaUrl = (_a = context.uiConfig.ethereumOnboardingUrl) !== null && _a !== void 0 ? _a : locales.aboutScreen_ctaUrl;
|
|
21
|
+
const [_ready, setReady] = useState(true);
|
|
22
|
+
const [slider, setSlider] = useState(0);
|
|
23
|
+
const interacted = useRef(false);
|
|
24
|
+
const scrollPos = useRef(0);
|
|
25
|
+
const animationEase = [0.16, 1, 0.3, 1];
|
|
26
|
+
const animationDuration = 600;
|
|
27
|
+
let interval;
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
//interval = setTimeout(nextSlide, autoplayDelay);
|
|
30
|
+
return () => clearInterval(interval);
|
|
31
|
+
}, []);
|
|
32
|
+
const isSwipe = () => {
|
|
33
|
+
if (sliderRef.current) {
|
|
34
|
+
const { overflow } = getComputedStyle(sliderRef.current);
|
|
35
|
+
return overflow !== 'visible';
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
};
|
|
39
|
+
const gotoSlide = (index) => {
|
|
40
|
+
setReady(false);
|
|
41
|
+
if (isSwipe()) {
|
|
42
|
+
scrollToSlide(index);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
setSlider(index);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const scrollToSlide = (index) => {
|
|
49
|
+
if (sliderRef.current) {
|
|
50
|
+
const { offsetWidth: width } = sliderRef.current;
|
|
51
|
+
sliderRef.current.scrollLeft = width * index;
|
|
52
|
+
setTimeout(() => setSlider(index), 100);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
// This event should not fire on mobile
|
|
56
|
+
const onScroll = () => {
|
|
57
|
+
if (!sliderRef.current)
|
|
58
|
+
return;
|
|
59
|
+
const { offsetWidth: width, scrollLeft: x } = sliderRef.current;
|
|
60
|
+
const prevScroll = scrollPos.current;
|
|
61
|
+
scrollPos.current = x;
|
|
62
|
+
// Limit when the slider should be set after swipe
|
|
63
|
+
const threshold = 4;
|
|
64
|
+
if (prevScroll - x > -threshold && prevScroll - x < threshold) {
|
|
65
|
+
const currentSlide = Math.round(x / width);
|
|
66
|
+
setSlider(currentSlide);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const onTouchMove = () => {
|
|
70
|
+
didInteract();
|
|
71
|
+
};
|
|
72
|
+
const onTouchEnd = () => {
|
|
73
|
+
const { offsetWidth: width, scrollLeft: x } = sliderRef.current;
|
|
74
|
+
const currentSlide = Math.round(x / width);
|
|
75
|
+
setSlider(currentSlide);
|
|
76
|
+
};
|
|
77
|
+
const didInteract = () => {
|
|
78
|
+
interacted.current = true;
|
|
79
|
+
clearTimeout(interval);
|
|
80
|
+
};
|
|
81
|
+
const sliderRef = useRef(null);
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (!sliderRef.current)
|
|
84
|
+
return;
|
|
85
|
+
sliderRef.current.addEventListener('scroll', onScroll);
|
|
86
|
+
sliderRef.current.addEventListener('touchmove', onTouchMove);
|
|
87
|
+
sliderRef.current.addEventListener('touchend', onTouchEnd);
|
|
88
|
+
return () => {
|
|
89
|
+
if (!sliderRef.current)
|
|
90
|
+
return;
|
|
91
|
+
sliderRef.current.removeEventListener('scroll', onScroll);
|
|
92
|
+
sliderRef.current.removeEventListener('touchmove', onTouchMove);
|
|
93
|
+
sliderRef.current.removeEventListener('touchend', onTouchEnd);
|
|
94
|
+
};
|
|
95
|
+
}, [sliderRef]);
|
|
96
|
+
const graphics = [
|
|
97
|
+
jsx(SlideOne, { layoutId: 'graphicCircle', duration: animationDuration, ease: animationEase }, "slide-one"),
|
|
98
|
+
jsx(SlideTwo, { layoutId: 'graphicCircle', duration: animationDuration, ease: animationEase }, "slide-two"),
|
|
99
|
+
jsx(SlideThree, { layoutId: 'graphicCircle', duration: animationDuration, ease: animationEase }, "slide-three"),
|
|
100
|
+
];
|
|
101
|
+
const mobileGraphics = [
|
|
102
|
+
jsx(SlideOne, { duration: animationDuration, ease: animationEase }, "mobile-slide-one"),
|
|
103
|
+
jsx(SlideTwo, { duration: animationDuration, ease: animationEase }, "mobile-slide-two"),
|
|
104
|
+
jsx(SlideThree, { duration: animationDuration, ease: animationEase }, "mobile-slide-three"),
|
|
105
|
+
];
|
|
106
|
+
// Adjust height of ModalBody to fit content based on language
|
|
107
|
+
const slideHeight = (() => {
|
|
108
|
+
switch (context.uiConfig.language) {
|
|
109
|
+
case 'en-US':
|
|
110
|
+
case 'zh-CN':
|
|
111
|
+
return 64;
|
|
112
|
+
default:
|
|
113
|
+
return 84;
|
|
114
|
+
}
|
|
115
|
+
})();
|
|
116
|
+
const slides = [
|
|
117
|
+
{
|
|
118
|
+
key: 'slide-a',
|
|
119
|
+
content: (jsxs(Fragment, { children: [jsx(ModalH1, { style: { height: 24 }, "$small": true, children: jsx(FitText, { children: locales.aboutScreen_a_h1 }) }), jsx(ModalBody, { style: { height: slideHeight }, children: jsx(FitText, { children: locales.aboutScreen_a_p }) })] })),
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
key: 'slide-b',
|
|
123
|
+
content: (jsxs(Fragment, { children: [jsx(ModalH1, { style: { height: 24 }, "$small": true, children: jsx(FitText, { children: locales.aboutScreen_b_h1 }) }), jsx(ModalBody, { style: { height: slideHeight }, children: jsx(FitText, { children: locales.aboutScreen_b_p }) })] })),
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
key: 'slide-c',
|
|
127
|
+
content: (jsxs(Fragment, { children: [jsx(ModalH1, { style: { height: 24 }, "$small": true, children: jsx(FitText, { children: locales.aboutScreen_c_h1 }) }), jsx(ModalBody, { style: { height: slideHeight }, children: jsx(FitText, { children: locales.aboutScreen_c_p }) })] })),
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
return (jsxs(PageContent, { children: [jsxs(Slider, { children: [jsx(ImageContainer, { children: jsx(MotionConfig, { transition: {
|
|
131
|
+
duration: animationDuration / 1000,
|
|
132
|
+
ease: animationEase,
|
|
133
|
+
}, children: jsxs(AnimatePresence, { initial: false, onExitComplete: () => setReady(true), children: [slider === 0 && (jsx(ImageContainerInner, { style: { position: 'absolute' }, children: graphics[0] }, "graphic-0")), slider === 1 && (jsx(ImageContainerInner, { style: { position: 'absolute' }, children: graphics[1] }, "graphic-1")), slider === 2 && (jsx(ImageContainerInner, { style: { position: 'absolute' }, children: graphics[2] }, "graphic-2"))] }) }) }), jsx(Slides, { ref: sliderRef, children: jsx(AnimatePresence, { children: slides.map((s, i) => (jsxs(Slide, { "$active": slider === i, children: [jsx(MobileImageContainer, { children: jsx(MotionConfig, { transition: {
|
|
134
|
+
duration: 0,
|
|
135
|
+
}, children: jsx(ImageContainerInner, { children: mobileGraphics[i] }) }) }), jsx(ModalContent, { style: { gap: 8, paddingBottom: 0 }, children: s.content })] }, s.key))) }) })] }), jsx(OrDivider, { children: jsx(Dots, { children: slides.map((s, i) => (jsx(Dot, { "$active": slider === i, onClick: () => {
|
|
136
|
+
didInteract();
|
|
137
|
+
gotoSlide(i);
|
|
138
|
+
} }, s.key))) }) }), jsx(Button, { href: ctaUrl, arrow: true, children: locales.aboutScreen_ctaText })] }));
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export { About as default };
|
|
142
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { motion } from 'framer-motion';
|
|
2
|
+
import { css } from 'styled-components';
|
|
3
|
+
import defaultTheme from '../../../constants/defaultTheme.js';
|
|
4
|
+
import styled from '../../../styles/styled/index.js';
|
|
5
|
+
|
|
6
|
+
const imageHeight = 208;
|
|
7
|
+
const ImageContainer = styled.div `
|
|
8
|
+
pointer-events: none;
|
|
9
|
+
user-select: none;
|
|
10
|
+
height: ${imageHeight}px;
|
|
11
|
+
padding: 0 0 12px;
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
svg {
|
|
16
|
+
display: block;
|
|
17
|
+
}
|
|
18
|
+
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
const ImageContainerInner = styled(motion.div) ``;
|
|
23
|
+
const MobileImageContainer = styled.div `
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
user-select: none;
|
|
26
|
+
height: ${imageHeight}px;
|
|
27
|
+
padding: 0 0 12px;
|
|
28
|
+
display: none;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
svg {
|
|
32
|
+
display: block;
|
|
33
|
+
}
|
|
34
|
+
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
|
|
35
|
+
display: flex;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
const Slides = styled.div `
|
|
39
|
+
position: relative;
|
|
40
|
+
`;
|
|
41
|
+
const Slide = styled(motion.div) `
|
|
42
|
+
scroll-snap-type: x mandatory;
|
|
43
|
+
position: relative;
|
|
44
|
+
bottom: 0;
|
|
45
|
+
left: 0;
|
|
46
|
+
right: 0;
|
|
47
|
+
width: 100%;
|
|
48
|
+
padding: 0 4px 8px;
|
|
49
|
+
/* will-change: transform, opacity; */
|
|
50
|
+
transition: 400ms 50ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
51
|
+
transition-property: transform, opacity;
|
|
52
|
+
${(props) => !props.$active &&
|
|
53
|
+
css `
|
|
54
|
+
pointer-events: none;
|
|
55
|
+
position: absolute;
|
|
56
|
+
opacity: 0;
|
|
57
|
+
transform: scale(0.95);
|
|
58
|
+
transition-duration: 300ms;
|
|
59
|
+
transition-delay: 0ms;
|
|
60
|
+
`}
|
|
61
|
+
`;
|
|
62
|
+
const Slider = styled.div `
|
|
63
|
+
--background: var(--ck-body-background-secondary);
|
|
64
|
+
--background-transparent: var(--ck-body-background-transparent, transparent);
|
|
65
|
+
position: relative;
|
|
66
|
+
padding: 0 0 4px;
|
|
67
|
+
border-radius: 16px;
|
|
68
|
+
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
|
|
69
|
+
margin: 0 -24px;
|
|
70
|
+
${Slides} {
|
|
71
|
+
position: relative;
|
|
72
|
+
z-index: 3;
|
|
73
|
+
display: flex;
|
|
74
|
+
overflow: auto;
|
|
75
|
+
scroll-behavior: smooth;
|
|
76
|
+
scroll-snap-type: x mandatory;
|
|
77
|
+
margin-top: -${imageHeight}px;
|
|
78
|
+
padding-top: ${imageHeight}px;
|
|
79
|
+
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
|
80
|
+
scrollbar-width: none; /* Firefox */
|
|
81
|
+
&::-webkit-scrollbar {
|
|
82
|
+
display: none; /* Safari and Chrome */
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
${Slide} {
|
|
86
|
+
position: relative;
|
|
87
|
+
opacity: 1;
|
|
88
|
+
transform: none;
|
|
89
|
+
flex-shrink: 0;
|
|
90
|
+
scroll-snap-align: start;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
const Dots = styled.div `
|
|
95
|
+
position: relative;
|
|
96
|
+
top: -1px;
|
|
97
|
+
display: flex;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
pointer-events: auto;
|
|
100
|
+
`;
|
|
101
|
+
const Dot = styled.button `
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
height: 28px;
|
|
105
|
+
padding: 2px;
|
|
106
|
+
background: none;
|
|
107
|
+
@media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
|
|
108
|
+
padding: 4px;
|
|
109
|
+
&:before {
|
|
110
|
+
transform: none !important;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
&:before {
|
|
114
|
+
content: '';
|
|
115
|
+
display: block;
|
|
116
|
+
width: 16px;
|
|
117
|
+
height: 3px;
|
|
118
|
+
opacity: 0.12;
|
|
119
|
+
border-radius: 4px;
|
|
120
|
+
background: var(--ck-accent-color, var(--ck-body-color));
|
|
121
|
+
transition: transform 200ms ease, opacity 180ms ease;
|
|
122
|
+
}
|
|
123
|
+
${(props) => props.$active
|
|
124
|
+
? css `
|
|
125
|
+
cursor: default;
|
|
126
|
+
&:before {
|
|
127
|
+
opacity: 1;
|
|
128
|
+
}
|
|
129
|
+
`
|
|
130
|
+
: !props.disabled &&
|
|
131
|
+
css `
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
&:hover:before {
|
|
134
|
+
transform: scaleY(3.5);
|
|
135
|
+
}
|
|
136
|
+
&:active:before {
|
|
137
|
+
}
|
|
138
|
+
`}
|
|
139
|
+
`;
|
|
140
|
+
|
|
141
|
+
export { Dot, Dots, ImageContainer, ImageContainerInner, MobileImageContainer, Slide, Slider, Slides };
|
|
142
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { formatUnits } from 'viem';
|
|
3
|
+
import { useEthereumWalletAssets } from '../../../ethereum/hooks/useEthereumWalletAssets.js';
|
|
4
|
+
import { ModalHeading } from '../../Common/Modal/styles.js';
|
|
5
|
+
import { EmptyState } from '../BuyProviderSelect/styles.js';
|
|
6
|
+
import { SelectTokenContent, TokenList, TokenContainer, TokenInfo, TokenSymbol, TokenBalance, TokenName } from '../SelectToken/styles.js';
|
|
7
|
+
import { getAssetSymbol, getAssetDecimals, formatBalanceWithSymbol } from '../Send/utils.js';
|
|
8
|
+
|
|
9
|
+
const ZERO = BigInt(0);
|
|
10
|
+
const usdFormatter = new Intl.NumberFormat('en-US', {
|
|
11
|
+
style: 'currency',
|
|
12
|
+
currency: 'USD',
|
|
13
|
+
minimumFractionDigits: 2,
|
|
14
|
+
maximumFractionDigits: 2,
|
|
15
|
+
});
|
|
16
|
+
const AssetInventory = () => {
|
|
17
|
+
const { data: walletAssets, isLoading: isBalancesLoading } = useEthereumWalletAssets();
|
|
18
|
+
// Show all tokens for both buy and send flows
|
|
19
|
+
const selectableTokens = walletAssets || [];
|
|
20
|
+
const renderContent = () => {
|
|
21
|
+
if (!selectableTokens.length) {
|
|
22
|
+
if (isBalancesLoading) {
|
|
23
|
+
return jsx(EmptyState, { children: "Loading balances\u2026" });
|
|
24
|
+
}
|
|
25
|
+
return jsx(EmptyState, { children: "No supported tokens found for this network yet." });
|
|
26
|
+
}
|
|
27
|
+
return (jsx(TokenList, { children: selectableTokens.map((token) => {
|
|
28
|
+
var _a, _b, _c, _d, _e;
|
|
29
|
+
const key = token.type === 'erc20' ? token.address : 'native';
|
|
30
|
+
const displaySymbol = getAssetSymbol(token);
|
|
31
|
+
const displayName = ((_a = token.metadata) === null || _a === void 0 ? void 0 : _a.name) || displaySymbol || 'Unknown Token';
|
|
32
|
+
const decimals = getAssetDecimals(token);
|
|
33
|
+
const pricePerToken = (_c = (_b = token.metadata) === null || _b === void 0 ? void 0 : _b.fiat) === null || _c === void 0 ? void 0 : _c.value;
|
|
34
|
+
let usdValue = null;
|
|
35
|
+
// Show loading state for balances
|
|
36
|
+
const isBalanceLoaded = token.balance !== undefined;
|
|
37
|
+
const balanceDisplay = isBalanceLoaded
|
|
38
|
+
? formatBalanceWithSymbol(token.balance, decimals, ((_d = token.metadata) === null || _d === void 0 ? void 0 : _d.symbol) || '')
|
|
39
|
+
: 'Loading...';
|
|
40
|
+
// Check if token has zero balance (for send flow opacity)
|
|
41
|
+
const hasZeroBalance = isBalanceLoaded && ((_e = token.balance) !== null && _e !== void 0 ? _e : ZERO) <= ZERO;
|
|
42
|
+
if (hasZeroBalance)
|
|
43
|
+
return null;
|
|
44
|
+
if (isBalanceLoaded && pricePerToken !== undefined && token.balance !== undefined) {
|
|
45
|
+
const amount = parseFloat(formatUnits(token.balance, decimals));
|
|
46
|
+
if (Number.isFinite(amount)) {
|
|
47
|
+
const totalUsd = amount * pricePerToken;
|
|
48
|
+
if (totalUsd >= 0.01) {
|
|
49
|
+
usdValue = usdFormatter.format(totalUsd);
|
|
50
|
+
}
|
|
51
|
+
else if (totalUsd > 0) {
|
|
52
|
+
usdValue = '<$0.01';
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
usdValue = usdFormatter.format(0);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return (jsxs(TokenContainer, { children: [jsx(TokenInfo, { children: jsx(TokenSymbol, { children: displayName }) }), jsxs(TokenInfo, { children: [jsx(TokenBalance, { children: balanceDisplay }), usdValue ? jsx(TokenName, { style: { textAlign: 'end' }, children: usdValue }) : null] })] }, key));
|
|
60
|
+
}) }));
|
|
61
|
+
};
|
|
62
|
+
return (jsxs(SelectTokenContent, { children: [jsx(ModalHeading, { children: "Your assets" }), renderContent()] }));
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export { AssetInventory };
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { SDKConfiguration } from '@openfort/openfort-js';
|
|
2
|
+
import { getAssetSymbol } from '../Send/utils.js';
|
|
3
|
+
|
|
4
|
+
const getBackendUrl = () => {
|
|
5
|
+
const sdkConfig = SDKConfiguration.getInstance();
|
|
6
|
+
return (sdkConfig === null || sdkConfig === void 0 ? void 0 : sdkConfig.backendUrl) || 'https://api.openfort.io';
|
|
7
|
+
};
|
|
8
|
+
// Map chain IDs to Coinbase network names
|
|
9
|
+
const getNetworkName = (chainId) => {
|
|
10
|
+
const networkMap = {
|
|
11
|
+
1: 'ethereum',
|
|
12
|
+
8453: 'base',
|
|
13
|
+
137: 'polygon',
|
|
14
|
+
42161: 'arbitrum',
|
|
15
|
+
10: 'optimism',
|
|
16
|
+
};
|
|
17
|
+
return networkMap[chainId] || 'base';
|
|
18
|
+
};
|
|
19
|
+
// Coinbase supported currencies (more extensive than Stripe)
|
|
20
|
+
const COINBASE_SUPPORTED_CURRENCIES = [
|
|
21
|
+
'btc',
|
|
22
|
+
'eth',
|
|
23
|
+
'usdc',
|
|
24
|
+
'usdt',
|
|
25
|
+
'matic',
|
|
26
|
+
'pol', // Polygon native token (rebranded from MATIC)
|
|
27
|
+
'sol',
|
|
28
|
+
'avax',
|
|
29
|
+
'atom',
|
|
30
|
+
'dot',
|
|
31
|
+
'link',
|
|
32
|
+
'uni',
|
|
33
|
+
'aave',
|
|
34
|
+
'comp',
|
|
35
|
+
'snx',
|
|
36
|
+
'mkr',
|
|
37
|
+
'dai',
|
|
38
|
+
'wld',
|
|
39
|
+
'xlm',
|
|
40
|
+
];
|
|
41
|
+
// Check if a token is supported by Coinbase
|
|
42
|
+
const isCoinbaseSupported = (token) => {
|
|
43
|
+
const symbol = getAssetSymbol(token);
|
|
44
|
+
return COINBASE_SUPPORTED_CURRENCIES.includes(symbol.toLowerCase());
|
|
45
|
+
};
|
|
46
|
+
// Map token symbol to Coinbase currency code
|
|
47
|
+
const getCurrencyCode = (token) => {
|
|
48
|
+
const symbol = getAssetSymbol(token);
|
|
49
|
+
const lowercaseSymbol = symbol.toLowerCase();
|
|
50
|
+
// Validate that the currency is supported by Coinbase
|
|
51
|
+
if (!COINBASE_SUPPORTED_CURRENCIES.includes(lowercaseSymbol)) {
|
|
52
|
+
throw new Error(`Unsupported currency for Coinbase: ${symbol}. Supported currencies are: ${COINBASE_SUPPORTED_CURRENCIES.join(', ')}`);
|
|
53
|
+
}
|
|
54
|
+
return symbol;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Create a Coinbase onramp session
|
|
58
|
+
* Supports three use cases based on provided parameters:
|
|
59
|
+
* 1. Basic session: Only required params (destinationAddress, destinationCurrency, destinationNetwork)
|
|
60
|
+
* 2. One-click URL: Required + sourceAmount + sourceCurrency
|
|
61
|
+
* 3. One-click with quote: One-click + paymentMethod + country (+ subdivision for US)
|
|
62
|
+
*/
|
|
63
|
+
const createCoinbaseSession = async (params) => {
|
|
64
|
+
const { token, chainId, publishableKey, ...rest } = params;
|
|
65
|
+
if (!publishableKey) {
|
|
66
|
+
throw new Error('Publishable key is required for authentication');
|
|
67
|
+
}
|
|
68
|
+
// Build request body with only provided parameters
|
|
69
|
+
const requestBody = {
|
|
70
|
+
provider: 'coinbase',
|
|
71
|
+
destinationCurrency: getCurrencyCode(token),
|
|
72
|
+
destinationNetwork: getNetworkName(chainId),
|
|
73
|
+
destinationAddress: rest.destinationAddress,
|
|
74
|
+
};
|
|
75
|
+
// Add optional parameters only if provided
|
|
76
|
+
if (rest.sourceAmount)
|
|
77
|
+
requestBody.sourceAmount = rest.sourceAmount;
|
|
78
|
+
if (rest.sourceCurrency)
|
|
79
|
+
requestBody.sourceCurrency = rest.sourceCurrency;
|
|
80
|
+
if (rest.paymentMethod)
|
|
81
|
+
requestBody.paymentMethod = rest.paymentMethod;
|
|
82
|
+
if (rest.country)
|
|
83
|
+
requestBody.country = rest.country;
|
|
84
|
+
if (rest.subdivision)
|
|
85
|
+
requestBody.subdivision = rest.subdivision;
|
|
86
|
+
if (rest.redirectUrl)
|
|
87
|
+
requestBody.redirectUrl = rest.redirectUrl;
|
|
88
|
+
if (rest.clientIp)
|
|
89
|
+
requestBody.clientIp = rest.clientIp;
|
|
90
|
+
const response = await fetch(`${getBackendUrl()}/v1/onramp/sessions`, {
|
|
91
|
+
method: 'POST',
|
|
92
|
+
headers: {
|
|
93
|
+
'Content-Type': 'application/json',
|
|
94
|
+
Authorization: `Bearer ${publishableKey}`,
|
|
95
|
+
},
|
|
96
|
+
body: JSON.stringify(requestBody),
|
|
97
|
+
});
|
|
98
|
+
if (!response.ok) {
|
|
99
|
+
const errorData = await response.json().catch(() => ({}));
|
|
100
|
+
throw new Error(errorData.error || errorData.errorMessage || 'Failed to create Coinbase session');
|
|
101
|
+
}
|
|
102
|
+
return response.json();
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export { createCoinbaseSession, isCoinbaseSupported };
|
|
106
|
+
//# sourceMappingURL=coinbaseApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coinbaseApi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useMemo, useEffect } from 'react';
|
|
3
|
+
import { useEthereumWalletAssets } from '../../../ethereum/hooks/useEthereumWalletAssets.js';
|
|
4
|
+
import useLocales from '../../../hooks/useLocales.js';
|
|
5
|
+
import Button from '../../Common/Button/index.js';
|
|
6
|
+
import { Arrow, ArrowChevron } from '../../Common/Button/styles.js';
|
|
7
|
+
import { ModalHeading, ModalBody } from '../../Common/Modal/styles.js';
|
|
8
|
+
import { routes } from '../../Openfort/types.js';
|
|
9
|
+
import { useOpenfort } from '../../Openfort/useOpenfort.js';
|
|
10
|
+
import { PageContent } from '../../PageContent/index.js';
|
|
11
|
+
import { sanitizeForParsing, sanitizeAmountInput, isSameToken, getAssetSymbol } from '../Send/utils.js';
|
|
12
|
+
import { Section, SectionLabel, AmountCard, CurrencySymbol, AmountInput, PresetList, PresetButton, SelectorButton, SelectorContent, SelectorTitle, SelectorSubtitle, SelectorRight, ContinueButtonWrapper } from './styles.js';
|
|
13
|
+
import { createCurrencyFormatter, getCurrencySymbol } from './utils.js';
|
|
14
|
+
|
|
15
|
+
const amountPresets = [10, 20, 50];
|
|
16
|
+
const Buy = () => {
|
|
17
|
+
var _a;
|
|
18
|
+
const { buyForm, setBuyForm, setRoute, triggerResize } = useOpenfort();
|
|
19
|
+
const locales = useLocales();
|
|
20
|
+
const { data: assets } = useEthereumWalletAssets();
|
|
21
|
+
const [pressedPreset, setPressedPreset] = useState(null);
|
|
22
|
+
const fiatAmount = useMemo(() => {
|
|
23
|
+
const normalizedAmount = sanitizeForParsing(sanitizeAmountInput(buyForm.amount));
|
|
24
|
+
if (!normalizedAmount)
|
|
25
|
+
return null;
|
|
26
|
+
const numeric = Number(normalizedAmount);
|
|
27
|
+
if (!Number.isFinite(numeric))
|
|
28
|
+
return null;
|
|
29
|
+
return numeric;
|
|
30
|
+
}, [buyForm.amount]);
|
|
31
|
+
// Trigger resize on mount
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
triggerResize();
|
|
34
|
+
}, [triggerResize]);
|
|
35
|
+
const matchedToken = useMemo(() => assets === null || assets === void 0 ? void 0 : assets.find((asset) => isSameToken(asset, buyForm.asset)), [assets, buyForm.asset]);
|
|
36
|
+
const selectedTokenOption = matchedToken !== null && matchedToken !== void 0 ? matchedToken : assets === null || assets === void 0 ? void 0 : assets[0];
|
|
37
|
+
const selectedToken = selectedTokenOption !== null && selectedTokenOption !== void 0 ? selectedTokenOption : buyForm.asset;
|
|
38
|
+
const tokenSymbol = getAssetSymbol(selectedToken);
|
|
39
|
+
const tokenName = ((_a = selectedToken.metadata) === null || _a === void 0 ? void 0 : _a.name) || tokenSymbol;
|
|
40
|
+
const currencyFormatter = useMemo(() => createCurrencyFormatter(buyForm.currency), [buyForm.currency]);
|
|
41
|
+
const currencySymbol = useMemo(() => getCurrencySymbol(buyForm.currency), [buyForm.currency]);
|
|
42
|
+
const handleAmountChange = (event) => {
|
|
43
|
+
const raw = sanitizeAmountInput(event.target.value);
|
|
44
|
+
if (raw === '' || /^[0-9]*\.?[0-9]*$/.test(raw)) {
|
|
45
|
+
setPressedPreset(null);
|
|
46
|
+
setBuyForm((prev) => ({
|
|
47
|
+
...prev,
|
|
48
|
+
amount: raw,
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const handleAmountBlur = () => {
|
|
53
|
+
const normalized = sanitizeForParsing(sanitizeAmountInput(buyForm.amount));
|
|
54
|
+
if (normalized) {
|
|
55
|
+
const numeric = Number(normalized);
|
|
56
|
+
if (Number.isFinite(numeric) && numeric > 0) {
|
|
57
|
+
setBuyForm((prev) => ({
|
|
58
|
+
...prev,
|
|
59
|
+
amount: numeric.toFixed(2),
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const handlePresetClick = (value) => {
|
|
65
|
+
setPressedPreset(value);
|
|
66
|
+
setBuyForm((prev) => ({
|
|
67
|
+
...prev,
|
|
68
|
+
amount: value.toFixed(2),
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
71
|
+
const handleOpenTokenSelector = () => {
|
|
72
|
+
setRoute(routes.BUY_TOKEN_SELECT);
|
|
73
|
+
};
|
|
74
|
+
const handleContinue = () => {
|
|
75
|
+
if (fiatAmount === null || fiatAmount <= 0)
|
|
76
|
+
return;
|
|
77
|
+
setRoute(routes.BUY_SELECT_PROVIDER);
|
|
78
|
+
};
|
|
79
|
+
const handleBack = () => {
|
|
80
|
+
setRoute(routes.CONNECTED);
|
|
81
|
+
};
|
|
82
|
+
const isPresetSelected = (value) => pressedPreset === value;
|
|
83
|
+
const step1Disabled = fiatAmount === null || fiatAmount <= 0;
|
|
84
|
+
return (jsxs(PageContent, { onBack: handleBack, children: [jsx(ModalHeading, { children: locales.buyScreen_heading }), jsx(ModalBody, { children: locales.buyScreen_subheading }), jsxs(Section, { children: [jsx(SectionLabel, { children: "Amount" }), jsxs(AmountCard, { children: [jsx(CurrencySymbol, { children: currencySymbol }), jsx(AmountInput, { value: buyForm.amount, onChange: handleAmountChange, onBlur: handleAmountBlur, placeholder: "0.00", inputMode: "decimal", autoComplete: "off" })] }), jsx(PresetList, { children: amountPresets.map((preset) => (jsx(PresetButton, { type: "button", onClick: () => handlePresetClick(preset), "$active": isPresetSelected(preset), children: currencyFormatter.format(preset) }, preset))) })] }), jsxs(Section, { children: [jsx(SectionLabel, { children: "Asset" }), jsxs(SelectorButton, { type: "button", onClick: handleOpenTokenSelector, children: [jsxs(SelectorContent, { children: [jsx(SelectorTitle, { children: tokenSymbol || 'Select asset' }), jsx(SelectorSubtitle, { children: tokenName })] }), jsx(SelectorRight, { children: jsx(Arrow, { width: "13", height: "12", viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx(ArrowChevron, { stroke: "currentColor", d: "M7.51431 1.5L11.757 5.74264M7.5 10.4858L11.7426 6.24314", strokeWidth: "2", strokeLinecap: "round" }) }) })] })] }), jsx(ContinueButtonWrapper, { children: jsx(Button, { variant: "primary", onClick: handleContinue, disabled: step1Disabled, children: "Continue" }) })] }));
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export { Buy as default };
|
|
88
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { SDKConfiguration } from '@openfort/openfort-js';
|
|
2
|
+
import { getAssetSymbol } from '../Send/utils.js';
|
|
3
|
+
|
|
4
|
+
const getBackendUrl = () => {
|
|
5
|
+
const sdkConfig = SDKConfiguration.getInstance();
|
|
6
|
+
return (sdkConfig === null || sdkConfig === void 0 ? void 0 : sdkConfig.backendUrl) || 'https://api.openfort.io';
|
|
7
|
+
};
|
|
8
|
+
// Map chain IDs to network names
|
|
9
|
+
const getNetworkName = (chainId) => {
|
|
10
|
+
const networkMap = {
|
|
11
|
+
1: 'ethereum',
|
|
12
|
+
8453: 'base',
|
|
13
|
+
137: 'polygon',
|
|
14
|
+
42161: 'arbitrum',
|
|
15
|
+
10: 'optimism',
|
|
16
|
+
};
|
|
17
|
+
return networkMap[chainId] || 'base';
|
|
18
|
+
};
|
|
19
|
+
// Map token symbol to currency code
|
|
20
|
+
const getCurrencyCode = (token) => {
|
|
21
|
+
return getAssetSymbol(token).toLowerCase();
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Get quotes from all available providers
|
|
25
|
+
* Calls the backend without specifying a provider to get quotes from all providers
|
|
26
|
+
*/
|
|
27
|
+
const getAllQuotes = async (params) => {
|
|
28
|
+
const { token, chainId, publishableKey, sourceCurrency, sourceAmount } = params;
|
|
29
|
+
if (!publishableKey) {
|
|
30
|
+
throw new Error('Publishable key is required for authentication');
|
|
31
|
+
}
|
|
32
|
+
// Build request body WITHOUT provider to get all quotes
|
|
33
|
+
const requestBody = {
|
|
34
|
+
destinationCurrency: getCurrencyCode(token),
|
|
35
|
+
destinationNetwork: getNetworkName(chainId),
|
|
36
|
+
sourceCurrency: sourceCurrency.toLowerCase(),
|
|
37
|
+
sourceAmount,
|
|
38
|
+
};
|
|
39
|
+
const response = await fetch(`${getBackendUrl()}/v1/onramp/quotes`, {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
headers: {
|
|
42
|
+
'Content-Type': 'application/json',
|
|
43
|
+
Authorization: `Bearer ${publishableKey}`,
|
|
44
|
+
},
|
|
45
|
+
body: JSON.stringify(requestBody),
|
|
46
|
+
});
|
|
47
|
+
if (!response.ok) {
|
|
48
|
+
const errorData = await response.json().catch(() => ({}));
|
|
49
|
+
throw new Error(errorData.error || errorData.errorMessage || 'Failed to fetch quotes');
|
|
50
|
+
}
|
|
51
|
+
const data = await response.json();
|
|
52
|
+
// Backend returns array when provider is not specified
|
|
53
|
+
return Array.isArray(data) ? data : [data];
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { getAllQuotes };
|
|
57
|
+
//# sourceMappingURL=onrampApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onrampApi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const PROVIDERS = [
|
|
2
|
+
{
|
|
3
|
+
id: 'coinbase',
|
|
4
|
+
name: 'Coinbase',
|
|
5
|
+
feeBps: 250,
|
|
6
|
+
highlight: 'best',
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
id: 'stripe',
|
|
10
|
+
name: 'Stripe',
|
|
11
|
+
feeBps: 405,
|
|
12
|
+
highlight: 'fast',
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
const getProviders = () => PROVIDERS;
|
|
16
|
+
/**
|
|
17
|
+
* Get provider quotes - for now returns mock data until real quote is fetched
|
|
18
|
+
*/
|
|
19
|
+
const getProviderQuotes = (amount) => {
|
|
20
|
+
return PROVIDERS.map((provider) => {
|
|
21
|
+
if (amount === null || Number.isNaN(amount) || amount <= 0) {
|
|
22
|
+
return {
|
|
23
|
+
provider,
|
|
24
|
+
netAmount: null,
|
|
25
|
+
feeAmount: null,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const feeAmount = +(amount * (provider.feeBps / 10000)).toFixed(2);
|
|
29
|
+
const netAmount = Math.max(amount - feeAmount, 0);
|
|
30
|
+
return {
|
|
31
|
+
provider,
|
|
32
|
+
netAmount,
|
|
33
|
+
feeAmount,
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { getProviderQuotes, getProviders };
|
|
39
|
+
//# sourceMappingURL=providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|