@lifi/widget 3.0.0-alpha.16 → 3.0.0-alpha.19
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/AppRoutes.tsx +22 -0
- package/_cjs/AppRoutes.js +17 -0
- package/_cjs/AppRoutes.js.map +1 -1
- package/_cjs/components/AccountAvatar.d.ts +7 -0
- package/_cjs/components/AccountAvatar.js +20 -0
- package/_cjs/components/AccountAvatar.js.map +1 -0
- package/_cjs/components/ActiveTransactions/ActiveTransactions.style.d.ts +2 -2
- package/_cjs/components/AlertMessage/AlertMessage.d.ts +11 -0
- package/_cjs/components/AlertMessage/AlertMessage.js +8 -0
- package/_cjs/components/AlertMessage/AlertMessage.js.map +1 -0
- package/_cjs/components/AlertMessage/AlertMessage.style.d.ts +12 -0
- package/_cjs/components/AlertMessage/AlertMessage.style.js +35 -0
- package/_cjs/components/AlertMessage/AlertMessage.style.js.map +1 -0
- package/_cjs/components/AlertMessage/index.d.ts +3 -0
- package/_cjs/components/AlertMessage/index.js +20 -0
- package/_cjs/components/AlertMessage/index.js.map +1 -0
- package/_cjs/components/AlertMessage/types.d.ts +1 -0
- package/_cjs/components/AlertMessage/types.js +3 -0
- package/_cjs/components/AlertMessage/types.js.map +1 -0
- package/_cjs/components/BaseTransactionButton/BaseTransactionButton.js +6 -3
- package/_cjs/components/BaseTransactionButton/BaseTransactionButton.js.map +1 -1
- package/_cjs/{pages/SettingsPage/SettingsCard/SettingCardButton.d.ts → components/Card/CardButton.d.ts} +2 -2
- package/_cjs/components/Card/CardButton.js +9 -0
- package/_cjs/components/Card/CardButton.js.map +1 -0
- package/_cjs/components/Card/CardButton.style.d.ts +13 -0
- package/_cjs/components/Card/CardButton.style.js +36 -0
- package/_cjs/components/Card/CardButton.style.js.map +1 -0
- package/_cjs/components/Card/index.d.ts +2 -0
- package/_cjs/components/Card/index.js +2 -0
- package/_cjs/components/Card/index.js.map +1 -1
- package/_cjs/components/ChainSelect/useChainSelect.js +4 -15
- package/_cjs/components/ChainSelect/useChainSelect.js.map +1 -1
- package/_cjs/components/GasMessage/FundsSufficiencyMessage.js +13 -5
- package/_cjs/components/GasMessage/FundsSufficiencyMessage.js.map +1 -1
- package/_cjs/components/GasMessage/GasMessage.style.d.ts +1 -14
- package/_cjs/components/GasMessage/GasMessage.style.js +1 -24
- package/_cjs/components/GasMessage/GasMessage.style.js.map +1 -1
- package/_cjs/components/GasMessage/GasRefuelMessage.js +4 -5
- package/_cjs/components/GasMessage/GasRefuelMessage.js.map +1 -1
- package/_cjs/components/GasMessage/GasSufficiencyMessage.js +2 -6
- package/_cjs/components/GasMessage/GasSufficiencyMessage.js.map +1 -1
- package/_cjs/components/Header/NavigationHeader.js +11 -2
- package/_cjs/components/Header/NavigationHeader.js.map +1 -1
- package/_cjs/components/ListItem/ListItem.d.ts +6 -0
- package/_cjs/components/ListItem/ListItem.js +27 -0
- package/_cjs/components/ListItem/ListItem.js.map +1 -0
- package/_cjs/components/ListItem/ListItemButton.d.ts +4 -0
- package/_cjs/components/ListItem/ListItemButton.js +12 -0
- package/_cjs/components/ListItem/ListItemButton.js.map +1 -0
- package/_cjs/components/ListItem/index.d.ts +2 -0
- package/_cjs/components/ListItem/index.js +19 -0
- package/_cjs/components/ListItem/index.js.map +1 -0
- package/_cjs/components/ListItemButton.d.ts +1 -1
- package/_cjs/components/ListItemButton.js +3 -2
- package/_cjs/components/ListItemButton.js.map +1 -1
- package/_cjs/components/Menu.d.ts +1 -0
- package/_cjs/components/Menu.js +25 -0
- package/_cjs/components/Menu.js.map +1 -0
- package/_cjs/components/PageContainer.d.ts +1 -2
- package/_cjs/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/_cjs/components/ReverseTokensButton/ReverseTokensButton.js +11 -3
- package/_cjs/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
- package/_cjs/components/Routes/Routes.js +1 -3
- package/_cjs/components/Routes/Routes.js.map +1 -1
- package/_cjs/components/Routes/RoutesExpanded.js +4 -7
- package/_cjs/components/Routes/RoutesExpanded.js.map +1 -1
- package/_cjs/components/SendToWallet/SendToWallet.style.d.ts +4 -3
- package/_cjs/components/SendToWallet/SendToWallet.style.js +26 -15
- package/_cjs/components/SendToWallet/SendToWallet.style.js.map +1 -1
- package/_cjs/components/SendToWallet/SendToWalletButton.d.ts +1 -2
- package/_cjs/components/SendToWallet/SendToWalletButton.js +55 -23
- package/_cjs/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/_cjs/components/SendToWallet/SendToWalletExpandButton.d.ts +2 -0
- package/_cjs/components/SendToWallet/SendToWalletExpandButton.js +41 -0
- package/_cjs/components/SendToWallet/SendToWalletExpandButton.js.map +1 -0
- package/_cjs/components/SendToWallet/index.d.ts +2 -1
- package/_cjs/components/SendToWallet/index.js +2 -1
- package/_cjs/components/SendToWallet/index.js.map +1 -1
- package/_cjs/components/SettingsListItemButton.d.ts +1 -1
- package/_cjs/components/Step/StepProcess.style.d.ts +1 -1
- package/_cjs/components/TokenList/TokenList.js +3 -2
- package/_cjs/components/TokenList/TokenList.js.map +1 -1
- package/_cjs/components/TokenList/TokenList.style.d.ts +2 -5
- package/_cjs/components/TokenList/TokenList.style.js +3 -28
- package/_cjs/components/TokenList/TokenList.style.js.map +1 -1
- package/_cjs/components/TokenList/TokenListItem.js +3 -2
- package/_cjs/components/TokenList/TokenListItem.js.map +1 -1
- package/_cjs/components/TokenList/VirtualizedTokenList.js +2 -2
- package/_cjs/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/_cjs/config/version.d.ts +1 -1
- package/_cjs/config/version.js +1 -1
- package/_cjs/hooks/index.d.ts +3 -1
- package/_cjs/hooks/index.js +3 -1
- package/_cjs/hooks/index.js.map +1 -1
- package/_cjs/hooks/useAccount.d.ts +14 -3
- package/_cjs/hooks/useAccount.js +24 -6
- package/_cjs/hooks/useAccount.js.map +1 -1
- package/_cjs/hooks/useAddressValidation.d.ts +17 -0
- package/_cjs/hooks/useAddressValidation.js +59 -0
- package/_cjs/hooks/useAddressValidation.js.map +1 -0
- package/_cjs/hooks/useFromTokenSufficiency.js +3 -4
- package/_cjs/hooks/useFromTokenSufficiency.js.map +1 -1
- package/_cjs/hooks/useGasSufficiency.js +6 -5
- package/_cjs/hooks/useGasSufficiency.js.map +1 -1
- package/_cjs/hooks/useRouteExecution.js +7 -5
- package/_cjs/hooks/useRouteExecution.js.map +1 -1
- package/_cjs/hooks/useRoutes.d.ts +2 -2
- package/_cjs/hooks/useRoutes.js +17 -29
- package/_cjs/hooks/useRoutes.js.map +1 -1
- package/_cjs/hooks/useToAddressRequirements.d.ts +4 -0
- package/_cjs/hooks/{useRequiredToAddress.js → useToAddressRequirements.js} +11 -8
- package/_cjs/hooks/useToAddressRequirements.js.map +1 -0
- package/_cjs/hooks/useToAddressReset.d.ts +4 -0
- package/_cjs/hooks/useToAddressReset.js +32 -0
- package/_cjs/hooks/useToAddressReset.js.map +1 -0
- package/_cjs/hooks/useTokenAddressBalance.d.ts +1 -1
- package/_cjs/hooks/useTokenBalance.d.ts +1 -1
- package/_cjs/hooks/useTokenBalance.js +4 -7
- package/_cjs/hooks/useTokenBalance.js.map +1 -1
- package/_cjs/hooks/useTokenBalances.d.ts +1 -1
- package/_cjs/hooks/useTokenBalances.js +3 -4
- package/_cjs/hooks/useTokenBalances.js.map +1 -1
- package/_cjs/hooks/useTransactionDetails.d.ts +1 -1
- package/_cjs/hooks/useTransactionDetails.js +24 -25
- package/_cjs/hooks/useTransactionDetails.js.map +1 -1
- package/_cjs/hooks/useTransactionHistory.js +2 -1
- package/_cjs/hooks/useTransactionHistory.js.map +1 -1
- package/_cjs/i18n/en.json +27 -6
- package/_cjs/pages/MainPage/MainPage.js +1 -1
- package/_cjs/pages/MainPage/MainPage.js.map +1 -1
- package/_cjs/pages/MainPage/ReviewButton.js +3 -2
- package/_cjs/pages/MainPage/ReviewButton.js.map +1 -1
- package/_cjs/pages/SendToWallet/BookmarkAddressSheet.d.ts +9 -0
- package/_cjs/pages/SendToWallet/BookmarkAddressSheet.js +111 -0
- package/_cjs/pages/SendToWallet/BookmarkAddressSheet.js.map +1 -0
- package/_cjs/pages/SendToWallet/BookmarksPage.d.ts +1 -0
- package/_cjs/pages/SendToWallet/BookmarksPage.js +88 -0
- package/_cjs/pages/SendToWallet/BookmarksPage.js.map +1 -0
- package/_cjs/pages/SendToWallet/ConfirmAddressSheet.d.ts +9 -0
- package/_cjs/pages/SendToWallet/ConfirmAddressSheet.js +35 -0
- package/_cjs/pages/SendToWallet/ConfirmAddressSheet.js.map +1 -0
- package/_cjs/pages/SendToWallet/ConnectedWalletsPage.d.ts +1 -0
- package/_cjs/pages/SendToWallet/ConnectedWalletsPage.js +84 -0
- package/_cjs/pages/SendToWallet/ConnectedWalletsPage.js.map +1 -0
- package/_cjs/pages/SendToWallet/EmptyListIndicator.d.ts +6 -0
- package/_cjs/pages/SendToWallet/EmptyListIndicator.js +8 -0
- package/_cjs/pages/SendToWallet/EmptyListIndicator.js.map +1 -0
- package/_cjs/pages/SendToWallet/RecentWalletsPage.d.ts +1 -0
- package/_cjs/pages/SendToWallet/RecentWalletsPage.js +105 -0
- package/_cjs/pages/SendToWallet/RecentWalletsPage.js.map +1 -0
- package/_cjs/pages/SendToWallet/SendToWalletPage.d.ts +1 -0
- package/_cjs/pages/SendToWallet/SendToWalletPage.js +131 -0
- package/_cjs/pages/SendToWallet/SendToWalletPage.js.map +1 -0
- package/_cjs/pages/SendToWallet/SendToWalletPage.style.d.ts +61 -0
- package/_cjs/pages/SendToWallet/SendToWalletPage.style.js +146 -0
- package/_cjs/pages/SendToWallet/SendToWalletPage.style.js.map +1 -0
- package/_cjs/pages/SendToWallet/index.d.ts +4 -0
- package/_cjs/pages/SendToWallet/index.js +21 -0
- package/_cjs/pages/SendToWallet/index.js.map +1 -0
- package/_cjs/pages/SettingsPage/BridgeAndExchangeSettings.js +2 -1
- package/_cjs/pages/SettingsPage/BridgeAndExchangeSettings.js.map +1 -1
- package/_cjs/pages/SettingsPage/LanguageSetting.js +2 -2
- package/_cjs/pages/SettingsPage/LanguageSetting.js.map +1 -1
- package/_cjs/pages/SettingsPage/SendToWalletOptionSetting.js +2 -2
- package/_cjs/pages/SettingsPage/SendToWalletOptionSetting.js.map +1 -1
- package/_cjs/pages/SettingsPage/SettingsCard/BadgedValue.js +2 -1
- package/_cjs/pages/SettingsPage/SettingsCard/BadgedValue.js.map +1 -1
- package/_cjs/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +0 -9
- package/_cjs/pages/SettingsPage/SettingsCard/SettingCard.style.js +2 -24
- package/_cjs/pages/SettingsPage/SettingsCard/SettingCard.style.js.map +1 -1
- package/_cjs/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +2 -3
- package/_cjs/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
- package/_cjs/pages/SettingsPage/SettingsCard/index.d.ts +0 -2
- package/_cjs/pages/SettingsPage/SettingsCard/index.js +0 -2
- package/_cjs/pages/SettingsPage/SettingsCard/index.js.map +1 -1
- package/_cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/_cjs/pages/SettingsPage/ThemeSettings.js +2 -1
- package/_cjs/pages/SettingsPage/ThemeSettings.js.map +1 -1
- package/_cjs/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/_cjs/pages/TransactionHistoryPage/TransactionHistoryItem.js +2 -1
- package/_cjs/pages/TransactionHistoryPage/TransactionHistoryItem.js.map +1 -1
- package/_cjs/providers/I18nProvider/I18nProvider.js +1 -1
- package/_cjs/providers/I18nProvider/I18nProvider.js.map +1 -1
- package/_cjs/providers/WalletProvider/SDKProviders.js.map +1 -1
- package/_cjs/stores/StoreProvider.js +2 -1
- package/_cjs/stores/StoreProvider.js.map +1 -1
- package/_cjs/stores/bookmarks/BookmarkStore.d.ts +7 -0
- package/_cjs/stores/bookmarks/BookmarkStore.js +25 -0
- package/_cjs/stores/bookmarks/BookmarkStore.js.map +1 -0
- package/_cjs/stores/bookmarks/createBookmarkStore.d.ts +3 -0
- package/_cjs/stores/bookmarks/createBookmarkStore.js +49 -0
- package/_cjs/stores/bookmarks/createBookmarkStore.js.map +1 -0
- package/_cjs/stores/bookmarks/index.d.ts +5 -0
- package/_cjs/stores/bookmarks/index.js +22 -0
- package/_cjs/stores/bookmarks/index.js.map +1 -0
- package/_cjs/stores/bookmarks/types.d.ts +24 -0
- package/_cjs/stores/bookmarks/types.js +3 -0
- package/_cjs/stores/bookmarks/types.js.map +1 -0
- package/_cjs/stores/bookmarks/useBookmarkActions.d.ts +2 -0
- package/_cjs/stores/bookmarks/useBookmarkActions.js +18 -0
- package/_cjs/stores/bookmarks/useBookmarkActions.js.map +1 -0
- package/_cjs/stores/bookmarks/useBookmarks.d.ts +2 -0
- package/_cjs/stores/bookmarks/useBookmarks.js +15 -0
- package/_cjs/stores/bookmarks/useBookmarks.js.map +1 -0
- package/_cjs/stores/form/FormStore.js +16 -3
- package/_cjs/stores/form/FormStore.js.map +1 -1
- package/_cjs/stores/form/types.js.map +1 -1
- package/_cjs/stores/form/useTouchedFields.d.ts +4 -4
- package/_cjs/stores/index.d.ts +1 -0
- package/_cjs/stores/index.js +1 -0
- package/_cjs/stores/index.js.map +1 -1
- package/_cjs/utils/chainType.d.ts +6 -0
- package/_cjs/utils/chainType.js +24 -0
- package/_cjs/utils/chainType.js.map +1 -0
- package/_cjs/utils/converters.d.ts +2 -2
- package/_cjs/utils/converters.js.map +1 -1
- package/_cjs/utils/index.d.ts +1 -0
- package/_cjs/utils/index.js +1 -0
- package/_cjs/utils/index.js.map +1 -1
- package/_cjs/utils/navigationRoutes.d.ts +4 -0
- package/_cjs/utils/navigationRoutes.js +12 -0
- package/_cjs/utils/navigationRoutes.js.map +1 -1
- package/_esm/AppRoutes.js +17 -0
- package/_esm/AppRoutes.js.map +1 -1
- package/_esm/components/AccountAvatar.d.ts +7 -0
- package/_esm/components/AccountAvatar.js +16 -0
- package/_esm/components/AccountAvatar.js.map +1 -0
- package/_esm/components/ActiveTransactions/ActiveTransactions.style.d.ts +2 -2
- package/_esm/components/AlertMessage/AlertMessage.d.ts +11 -0
- package/_esm/components/AlertMessage/AlertMessage.js +4 -0
- package/_esm/components/AlertMessage/AlertMessage.js.map +1 -0
- package/_esm/components/AlertMessage/AlertMessage.style.d.ts +12 -0
- package/_esm/components/AlertMessage/AlertMessage.style.js +32 -0
- package/_esm/components/AlertMessage/AlertMessage.style.js.map +1 -0
- package/_esm/components/AlertMessage/index.d.ts +3 -0
- package/_esm/components/AlertMessage/index.js +4 -0
- package/_esm/components/AlertMessage/index.js.map +1 -0
- package/_esm/components/AlertMessage/types.d.ts +1 -0
- package/_esm/components/AlertMessage/types.js +2 -0
- package/_esm/components/AlertMessage/types.js.map +1 -0
- package/_esm/components/BaseTransactionButton/BaseTransactionButton.js +7 -4
- package/_esm/components/BaseTransactionButton/BaseTransactionButton.js.map +1 -1
- package/_esm/{pages/SettingsPage/SettingsCard/SettingCardButton.d.ts → components/Card/CardButton.d.ts} +2 -2
- package/_esm/components/Card/CardButton.js +5 -0
- package/_esm/components/Card/CardButton.js.map +1 -0
- package/_esm/components/Card/CardButton.style.d.ts +13 -0
- package/_esm/components/Card/CardButton.style.js +33 -0
- package/_esm/components/Card/CardButton.style.js.map +1 -0
- package/_esm/components/Card/index.d.ts +2 -0
- package/_esm/components/Card/index.js +2 -0
- package/_esm/components/Card/index.js.map +1 -1
- package/_esm/components/ChainSelect/useChainSelect.js +5 -16
- package/_esm/components/ChainSelect/useChainSelect.js.map +1 -1
- package/_esm/components/GasMessage/FundsSufficiencyMessage.js +14 -6
- package/_esm/components/GasMessage/FundsSufficiencyMessage.js.map +1 -1
- package/_esm/components/GasMessage/GasMessage.style.d.ts +1 -14
- package/_esm/components/GasMessage/GasMessage.style.js +1 -24
- package/_esm/components/GasMessage/GasMessage.style.js.map +1 -1
- package/_esm/components/GasMessage/GasRefuelMessage.js +5 -6
- package/_esm/components/GasMessage/GasRefuelMessage.js.map +1 -1
- package/_esm/components/GasMessage/GasSufficiencyMessage.js +2 -6
- package/_esm/components/GasMessage/GasSufficiencyMessage.js.map +1 -1
- package/_esm/components/Header/NavigationHeader.js +11 -2
- package/_esm/components/Header/NavigationHeader.js.map +1 -1
- package/_esm/components/ListItem/ListItem.d.ts +6 -0
- package/_esm/components/ListItem/ListItem.js +24 -0
- package/_esm/components/ListItem/ListItem.js.map +1 -0
- package/_esm/components/ListItem/ListItemButton.d.ts +4 -0
- package/_esm/components/ListItem/ListItemButton.js +9 -0
- package/_esm/components/ListItem/ListItemButton.js.map +1 -0
- package/_esm/components/ListItem/index.d.ts +2 -0
- package/_esm/components/ListItem/index.js +3 -0
- package/_esm/components/ListItem/index.js.map +1 -0
- package/_esm/components/ListItemButton.d.ts +1 -1
- package/_esm/components/ListItemButton.js +3 -2
- package/_esm/components/ListItemButton.js.map +1 -1
- package/_esm/components/Menu.d.ts +1 -0
- package/_esm/components/Menu.js +22 -0
- package/_esm/components/Menu.js.map +1 -0
- package/_esm/components/PageContainer.d.ts +1 -2
- package/_esm/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/_esm/components/ReverseTokensButton/ReverseTokensButton.js +11 -3
- package/_esm/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
- package/_esm/components/Routes/Routes.js +1 -3
- package/_esm/components/Routes/Routes.js.map +1 -1
- package/_esm/components/Routes/RoutesExpanded.js +5 -8
- package/_esm/components/Routes/RoutesExpanded.js.map +1 -1
- package/_esm/components/SendToWallet/SendToWallet.style.d.ts +4 -3
- package/_esm/components/SendToWallet/SendToWallet.style.js +25 -14
- package/_esm/components/SendToWallet/SendToWallet.style.js.map +1 -1
- package/_esm/components/SendToWallet/SendToWalletButton.d.ts +1 -2
- package/_esm/components/SendToWallet/SendToWalletButton.js +59 -27
- package/_esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/_esm/components/SendToWallet/SendToWalletExpandButton.d.ts +2 -0
- package/_esm/components/SendToWallet/SendToWalletExpandButton.js +37 -0
- package/_esm/components/SendToWallet/SendToWalletExpandButton.js.map +1 -0
- package/_esm/components/SendToWallet/index.d.ts +2 -1
- package/_esm/components/SendToWallet/index.js +2 -1
- package/_esm/components/SendToWallet/index.js.map +1 -1
- package/_esm/components/SettingsListItemButton.d.ts +1 -1
- package/_esm/components/Step/StepProcess.style.d.ts +1 -1
- package/_esm/components/TokenList/TokenList.js +3 -2
- package/_esm/components/TokenList/TokenList.js.map +1 -1
- package/_esm/components/TokenList/TokenList.style.d.ts +2 -5
- package/_esm/components/TokenList/TokenList.style.js +3 -28
- package/_esm/components/TokenList/TokenList.style.js.map +1 -1
- package/_esm/components/TokenList/TokenListItem.js +3 -2
- package/_esm/components/TokenList/TokenListItem.js.map +1 -1
- package/_esm/components/TokenList/VirtualizedTokenList.js +2 -2
- package/_esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/_esm/config/version.d.ts +1 -1
- package/_esm/config/version.js +1 -1
- package/_esm/hooks/index.d.ts +3 -1
- package/_esm/hooks/index.js +3 -1
- package/_esm/hooks/index.js.map +1 -1
- package/_esm/hooks/useAccount.d.ts +14 -3
- package/_esm/hooks/useAccount.js +24 -6
- package/_esm/hooks/useAccount.js.map +1 -1
- package/_esm/hooks/useAddressValidation.d.ts +17 -0
- package/_esm/hooks/useAddressValidation.js +55 -0
- package/_esm/hooks/useAddressValidation.js.map +1 -0
- package/_esm/hooks/useFromTokenSufficiency.js +3 -4
- package/_esm/hooks/useFromTokenSufficiency.js.map +1 -1
- package/_esm/hooks/useGasSufficiency.js +6 -5
- package/_esm/hooks/useGasSufficiency.js.map +1 -1
- package/_esm/hooks/useRouteExecution.js +7 -5
- package/_esm/hooks/useRouteExecution.js.map +1 -1
- package/_esm/hooks/useRoutes.d.ts +2 -2
- package/_esm/hooks/useRoutes.js +19 -31
- package/_esm/hooks/useRoutes.js.map +1 -1
- package/_esm/hooks/useToAddressRequirements.d.ts +4 -0
- package/_esm/hooks/{useRequiredToAddress.js → useToAddressRequirements.js} +9 -6
- package/_esm/hooks/useToAddressRequirements.js.map +1 -0
- package/_esm/hooks/useToAddressReset.d.ts +4 -0
- package/_esm/hooks/useToAddressReset.js +28 -0
- package/_esm/hooks/useToAddressReset.js.map +1 -0
- package/_esm/hooks/useTokenAddressBalance.d.ts +1 -1
- package/_esm/hooks/useTokenBalance.d.ts +1 -1
- package/_esm/hooks/useTokenBalance.js +4 -7
- package/_esm/hooks/useTokenBalance.js.map +1 -1
- package/_esm/hooks/useTokenBalances.d.ts +1 -1
- package/_esm/hooks/useTokenBalances.js +3 -4
- package/_esm/hooks/useTokenBalances.js.map +1 -1
- package/_esm/hooks/useTransactionDetails.d.ts +1 -1
- package/_esm/hooks/useTransactionDetails.js +24 -25
- package/_esm/hooks/useTransactionDetails.js.map +1 -1
- package/_esm/hooks/useTransactionHistory.js +2 -1
- package/_esm/hooks/useTransactionHistory.js.map +1 -1
- package/_esm/i18n/en.json +27 -6
- package/_esm/pages/MainPage/MainPage.js +2 -2
- package/_esm/pages/MainPage/MainPage.js.map +1 -1
- package/_esm/pages/MainPage/ReviewButton.js +5 -4
- package/_esm/pages/MainPage/ReviewButton.js.map +1 -1
- package/_esm/pages/SendToWallet/BookmarkAddressSheet.d.ts +9 -0
- package/_esm/pages/SendToWallet/BookmarkAddressSheet.js +108 -0
- package/_esm/pages/SendToWallet/BookmarkAddressSheet.js.map +1 -0
- package/_esm/pages/SendToWallet/BookmarksPage.d.ts +1 -0
- package/_esm/pages/SendToWallet/BookmarksPage.js +84 -0
- package/_esm/pages/SendToWallet/BookmarksPage.js.map +1 -0
- package/_esm/pages/SendToWallet/ConfirmAddressSheet.d.ts +9 -0
- package/_esm/pages/SendToWallet/ConfirmAddressSheet.js +32 -0
- package/_esm/pages/SendToWallet/ConfirmAddressSheet.js.map +1 -0
- package/_esm/pages/SendToWallet/ConnectedWalletsPage.d.ts +1 -0
- package/_esm/pages/SendToWallet/ConnectedWalletsPage.js +80 -0
- package/_esm/pages/SendToWallet/ConnectedWalletsPage.js.map +1 -0
- package/_esm/pages/SendToWallet/EmptyListIndicator.d.ts +6 -0
- package/_esm/pages/SendToWallet/EmptyListIndicator.js +4 -0
- package/_esm/pages/SendToWallet/EmptyListIndicator.js.map +1 -0
- package/_esm/pages/SendToWallet/RecentWalletsPage.d.ts +1 -0
- package/_esm/pages/SendToWallet/RecentWalletsPage.js +101 -0
- package/_esm/pages/SendToWallet/RecentWalletsPage.js.map +1 -0
- package/_esm/pages/SendToWallet/SendToWalletPage.d.ts +1 -0
- package/_esm/pages/SendToWallet/SendToWalletPage.js +127 -0
- package/_esm/pages/SendToWallet/SendToWalletPage.js.map +1 -0
- package/_esm/pages/SendToWallet/SendToWalletPage.style.d.ts +61 -0
- package/_esm/pages/SendToWallet/SendToWalletPage.style.js +143 -0
- package/_esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -0
- package/_esm/pages/SendToWallet/index.d.ts +4 -0
- package/_esm/pages/SendToWallet/index.js +5 -0
- package/_esm/pages/SendToWallet/index.js.map +1 -0
- package/_esm/pages/SettingsPage/BridgeAndExchangeSettings.js +3 -2
- package/_esm/pages/SettingsPage/BridgeAndExchangeSettings.js.map +1 -1
- package/_esm/pages/SettingsPage/LanguageSetting.js +2 -2
- package/_esm/pages/SettingsPage/LanguageSetting.js.map +1 -1
- package/_esm/pages/SettingsPage/SendToWalletOptionSetting.js +2 -2
- package/_esm/pages/SettingsPage/SendToWalletOptionSetting.js.map +1 -1
- package/_esm/pages/SettingsPage/SettingsCard/BadgedValue.js +3 -2
- package/_esm/pages/SettingsPage/SettingsCard/BadgedValue.js.map +1 -1
- package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +0 -9
- package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.js +2 -24
- package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.js.map +1 -1
- package/_esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +2 -3
- package/_esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
- package/_esm/pages/SettingsPage/SettingsCard/index.d.ts +0 -2
- package/_esm/pages/SettingsPage/SettingsCard/index.js +0 -2
- package/_esm/pages/SettingsPage/SettingsCard/index.js.map +1 -1
- package/_esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/_esm/pages/SettingsPage/ThemeSettings.js +3 -2
- package/_esm/pages/SettingsPage/ThemeSettings.js.map +1 -1
- package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/_esm/pages/TransactionHistoryPage/TransactionHistoryItem.js +2 -1
- package/_esm/pages/TransactionHistoryPage/TransactionHistoryItem.js.map +1 -1
- package/_esm/providers/I18nProvider/I18nProvider.js +2 -2
- package/_esm/providers/I18nProvider/I18nProvider.js.map +1 -1
- package/_esm/providers/WalletProvider/SDKProviders.js.map +1 -1
- package/_esm/stores/StoreProvider.js +2 -1
- package/_esm/stores/StoreProvider.js.map +1 -1
- package/_esm/stores/bookmarks/BookmarkStore.d.ts +7 -0
- package/_esm/stores/bookmarks/BookmarkStore.js +20 -0
- package/_esm/stores/bookmarks/BookmarkStore.js.map +1 -0
- package/_esm/stores/bookmarks/createBookmarkStore.d.ts +3 -0
- package/_esm/stores/bookmarks/createBookmarkStore.js +45 -0
- package/_esm/stores/bookmarks/createBookmarkStore.js.map +1 -0
- package/_esm/stores/bookmarks/index.d.ts +5 -0
- package/_esm/stores/bookmarks/index.js +6 -0
- package/_esm/stores/bookmarks/index.js.map +1 -0
- package/_esm/stores/bookmarks/types.d.ts +24 -0
- package/_esm/stores/bookmarks/types.js +2 -0
- package/_esm/stores/bookmarks/types.js.map +1 -0
- package/_esm/stores/bookmarks/useBookmarkActions.d.ts +2 -0
- package/_esm/stores/bookmarks/useBookmarkActions.js +14 -0
- package/_esm/stores/bookmarks/useBookmarkActions.js.map +1 -0
- package/_esm/stores/bookmarks/useBookmarks.d.ts +2 -0
- package/_esm/stores/bookmarks/useBookmarks.js +11 -0
- package/_esm/stores/bookmarks/useBookmarks.js.map +1 -0
- package/_esm/stores/form/FormStore.js +16 -3
- package/_esm/stores/form/FormStore.js.map +1 -1
- package/_esm/stores/form/types.js.map +1 -1
- package/_esm/stores/form/useTouchedFields.d.ts +4 -4
- package/_esm/stores/index.d.ts +1 -0
- package/_esm/stores/index.js +1 -0
- package/_esm/stores/index.js.map +1 -1
- package/_esm/utils/chainType.d.ts +6 -0
- package/_esm/utils/chainType.js +20 -0
- package/_esm/utils/chainType.js.map +1 -0
- package/_esm/utils/converters.d.ts +2 -2
- package/_esm/utils/converters.js.map +1 -1
- package/_esm/utils/index.d.ts +1 -0
- package/_esm/utils/index.js +1 -0
- package/_esm/utils/index.js.map +1 -1
- package/_esm/utils/navigationRoutes.d.ts +4 -0
- package/_esm/utils/navigationRoutes.js +12 -0
- package/_esm/utils/navigationRoutes.js.map +1 -1
- package/components/AccountAvatar.tsx +55 -0
- package/components/AlertMessage/AlertMessage.style.tsx +40 -0
- package/components/AlertMessage/AlertMessage.tsx +31 -0
- package/components/AlertMessage/index.ts +3 -0
- package/components/AlertMessage/types.ts +1 -0
- package/components/BaseTransactionButton/BaseTransactionButton.tsx +7 -4
- package/components/Card/CardButton.style.tsx +36 -0
- package/components/Card/CardButton.tsx +26 -0
- package/components/Card/index.ts +2 -0
- package/components/ChainSelect/useChainSelect.ts +5 -23
- package/components/GasMessage/FundsSufficiencyMessage.tsx +18 -17
- package/components/GasMessage/GasMessage.style.ts +1 -31
- package/components/GasMessage/GasRefuelMessage.tsx +21 -22
- package/components/GasMessage/GasSufficiencyMessage.tsx +9 -21
- package/components/Header/NavigationHeader.tsx +11 -2
- package/components/ListItem/ListItem.tsx +24 -0
- package/components/ListItem/ListItemButton.tsx +9 -0
- package/components/ListItem/index.ts +2 -0
- package/components/ListItemButton.tsx +12 -8
- package/components/Menu.tsx +27 -0
- package/components/PageContainer.ts +1 -1
- package/components/ReverseTokensButton/ReverseTokensButton.tsx +12 -3
- package/components/Routes/Routes.tsx +1 -7
- package/components/Routes/RoutesExpanded.tsx +5 -8
- package/components/SendToWallet/SendToWallet.style.tsx +25 -15
- package/components/SendToWallet/SendToWalletButton.tsx +107 -43
- package/components/SendToWallet/SendToWalletExpandButton.tsx +65 -0
- package/components/SendToWallet/index.ts +2 -1
- package/components/TokenList/TokenList.style.tsx +3 -32
- package/components/TokenList/TokenList.tsx +3 -2
- package/components/TokenList/TokenListItem.tsx +4 -3
- package/components/TokenList/VirtualizedTokenList.tsx +2 -2
- package/config/version.ts +1 -1
- package/hooks/index.ts +3 -1
- package/hooks/useAccount.ts +37 -9
- package/hooks/useAddressValidation.ts +79 -0
- package/hooks/useFromTokenSufficiency.ts +3 -8
- package/hooks/useGasSufficiency.ts +6 -10
- package/hooks/useRouteExecution.ts +9 -5
- package/hooks/useRoutes.ts +20 -30
- package/hooks/{useRequiredToAddress.ts → useToAddressRequirements.ts} +8 -5
- package/hooks/useToAddressReset.ts +36 -0
- package/hooks/useTokenBalance.ts +5 -8
- package/hooks/useTokenBalances.ts +3 -6
- package/hooks/useTransactionDetails.ts +30 -31
- package/hooks/useTransactionHistory.ts +3 -2
- package/i18n/en.json +27 -6
- package/package.json +14 -14
- package/pages/MainPage/MainPage.tsx +3 -3
- package/pages/MainPage/ReviewButton.tsx +5 -5
- package/pages/SendToWallet/BookmarkAddressSheet.tsx +219 -0
- package/pages/SendToWallet/BookmarksPage.tsx +182 -0
- package/pages/SendToWallet/ConfirmAddressSheet.tsx +90 -0
- package/pages/SendToWallet/ConnectedWalletsPage.tsx +165 -0
- package/pages/SendToWallet/EmptyListIndicator.tsx +19 -0
- package/pages/SendToWallet/RecentWalletsPage.tsx +215 -0
- package/pages/SendToWallet/SendToWalletPage.style.tsx +182 -0
- package/pages/SendToWallet/SendToWalletPage.tsx +246 -0
- package/pages/SendToWallet/index.ts +4 -0
- package/pages/SettingsPage/BridgeAndExchangeSettings.tsx +4 -3
- package/pages/SettingsPage/LanguageSetting.tsx +4 -4
- package/pages/SettingsPage/SendToWalletOptionSetting.tsx +12 -12
- package/pages/SettingsPage/SettingsCard/BadgedValue.tsx +4 -3
- package/pages/SettingsPage/SettingsCard/SettingCard.style.tsx +2 -27
- package/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +13 -12
- package/pages/SettingsPage/SettingsCard/index.ts +0 -2
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +1 -1
- package/pages/SettingsPage/ThemeSettings.tsx +3 -2
- package/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +5 -1
- package/pages/TransactionHistoryPage/TransactionHistoryItem.tsx +4 -7
- package/providers/I18nProvider/I18nProvider.tsx +2 -2
- package/providers/WalletProvider/SDKProviders.tsx +2 -1
- package/stores/StoreProvider.tsx +8 -5
- package/stores/bookmarks/BookmarkStore.tsx +39 -0
- package/stores/bookmarks/createBookmarkStore.ts +63 -0
- package/stores/bookmarks/index.ts +5 -0
- package/stores/bookmarks/types.ts +31 -0
- package/stores/bookmarks/useBookmarkActions.ts +19 -0
- package/stores/bookmarks/useBookmarks.ts +16 -0
- package/stores/form/FormStore.tsx +25 -4
- package/stores/form/types.ts +2 -3
- package/stores/index.ts +1 -0
- package/utils/chainType.ts +25 -0
- package/utils/converters.ts +2 -3
- package/utils/index.ts +1 -0
- package/utils/navigationRoutes.ts +12 -0
- package/_cjs/components/SendToWallet/SendToWallet.d.ts +0 -4
- package/_cjs/components/SendToWallet/SendToWallet.js +0 -94
- package/_cjs/components/SendToWallet/SendToWallet.js.map +0 -1
- package/_cjs/hooks/useRequiredToAddress.d.ts +0 -1
- package/_cjs/hooks/useRequiredToAddress.js.map +0 -1
- package/_cjs/pages/SettingsPage/SettingsCard/SettingCard.d.ts +0 -2
- package/_cjs/pages/SettingsPage/SettingsCard/SettingCard.js +0 -12
- package/_cjs/pages/SettingsPage/SettingsCard/SettingCard.js.map +0 -1
- package/_cjs/pages/SettingsPage/SettingsCard/SettingCardButton.js +0 -9
- package/_cjs/pages/SettingsPage/SettingsCard/SettingCardButton.js.map +0 -1
- package/_esm/components/SendToWallet/SendToWallet.d.ts +0 -4
- package/_esm/components/SendToWallet/SendToWallet.js +0 -90
- package/_esm/components/SendToWallet/SendToWallet.js.map +0 -1
- package/_esm/hooks/useRequiredToAddress.d.ts +0 -1
- package/_esm/hooks/useRequiredToAddress.js.map +0 -1
- package/_esm/pages/SettingsPage/SettingsCard/SettingCard.d.ts +0 -2
- package/_esm/pages/SettingsPage/SettingsCard/SettingCard.js +0 -8
- package/_esm/pages/SettingsPage/SettingsCard/SettingCard.js.map +0 -1
- package/_esm/pages/SettingsPage/SettingsCard/SettingCardButton.js +0 -5
- package/_esm/pages/SettingsPage/SettingsCard/SettingCardButton.js.map +0 -1
- package/components/SendToWallet/SendToWallet.tsx +0 -144
- package/i18n/i18next.d.ts +0 -10
- package/pages/SettingsPage/SettingsCard/SettingCard.tsx +0 -16
- package/pages/SettingsPage/SettingsCard/SettingCardButton.tsx +0 -26
- package/react-app-env.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.19",
|
|
4
4
|
"description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./_cjs/index.js",
|
|
@@ -35,30 +35,30 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@emotion/react": "^11.11.3",
|
|
37
37
|
"@emotion/styled": "^11.11.0",
|
|
38
|
-
"@lifi/sdk": "^3.0.0-alpha.
|
|
39
|
-
"@lifi/wallet-management": "^3.0.0-alpha.
|
|
40
|
-
"@mui/icons-material": "^5.15.
|
|
41
|
-
"@mui/lab": "^5.0.0-alpha.
|
|
42
|
-
"@mui/material": "^5.15.
|
|
38
|
+
"@lifi/sdk": "^3.0.0-alpha.50",
|
|
39
|
+
"@lifi/wallet-management": "^3.0.0-alpha.12",
|
|
40
|
+
"@mui/icons-material": "^5.15.6",
|
|
41
|
+
"@mui/lab": "^5.0.0-alpha.162",
|
|
42
|
+
"@mui/material": "^5.15.6",
|
|
43
43
|
"@solana/wallet-adapter-base": "^0.9.23",
|
|
44
44
|
"@solana/wallet-adapter-react": "^0.15.35",
|
|
45
45
|
"@solana/wallet-adapter-wallets": "^0.19.25",
|
|
46
46
|
"@solana/web3.js": "^1.89.1",
|
|
47
|
-
"@tanstack/react-query": "^5.17.
|
|
48
|
-
"@tanstack/react-virtual": "^3.0.
|
|
49
|
-
"i18next": "^23.7.
|
|
47
|
+
"@tanstack/react-query": "^5.17.19",
|
|
48
|
+
"@tanstack/react-virtual": "^3.0.2",
|
|
49
|
+
"i18next": "^23.7.18",
|
|
50
50
|
"microdiff": "^1.3.2",
|
|
51
51
|
"mitt": "^3.0.1",
|
|
52
52
|
"react": "^18.2.0",
|
|
53
53
|
"react-dom": "^18.2.0",
|
|
54
|
-
"react-i18next": "^14.0.
|
|
54
|
+
"react-i18next": "^14.0.1",
|
|
55
55
|
"react-intersection-observer": "^9.5.3",
|
|
56
|
-
"react-router-dom": "^6.21.
|
|
56
|
+
"react-router-dom": "^6.21.3",
|
|
57
57
|
"react-timer-hook": "^3.0.7",
|
|
58
58
|
"uuid": "^9.0.1",
|
|
59
|
-
"viem": "^2.
|
|
60
|
-
"wagmi": "^2.
|
|
61
|
-
"zustand": "^4.
|
|
59
|
+
"viem": "^2.5.0",
|
|
60
|
+
"wagmi": "^2.5.1",
|
|
61
|
+
"zustand": "^4.5.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@tanstack/react-query": "^5.17.0",
|
|
@@ -7,8 +7,8 @@ import { PageContainer } from '../../components/PageContainer';
|
|
|
7
7
|
import { Routes } from '../../components/Routes';
|
|
8
8
|
import { SelectChainAndToken } from '../../components/SelectChainAndToken';
|
|
9
9
|
import {
|
|
10
|
-
SendToWallet,
|
|
11
10
|
SendToWalletButton,
|
|
11
|
+
SendToWalletExpandButton,
|
|
12
12
|
} from '../../components/SendToWallet';
|
|
13
13
|
import { useExpandableVariant } from '../../hooks';
|
|
14
14
|
import { useWidgetConfig } from '../../providers';
|
|
@@ -30,12 +30,12 @@ export const MainPage: React.FC = () => {
|
|
|
30
30
|
<SelectChainAndToken mt={1} mb={2} />
|
|
31
31
|
{!nft ? <AmountInput formType="from" mb={2} /> : null}
|
|
32
32
|
{!expandable ? <Routes mb={2} /> : null}
|
|
33
|
-
<
|
|
33
|
+
<SendToWalletButton />
|
|
34
34
|
<GasRefuelMessage mb={2} />
|
|
35
35
|
<MainGasMessage mb={2} />
|
|
36
36
|
<Box display="flex" mb={1}>
|
|
37
37
|
<ReviewButton />
|
|
38
|
-
<
|
|
38
|
+
<SendToWalletExpandButton />
|
|
39
39
|
</Box>
|
|
40
40
|
</PageContainer>
|
|
41
41
|
);
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { useTranslation } from 'react-i18next';
|
|
2
2
|
import { useNavigate } from 'react-router-dom';
|
|
3
3
|
import { BaseTransactionButton } from '../../components/BaseTransactionButton';
|
|
4
|
-
import { useRoutes } from '../../hooks';
|
|
4
|
+
import { useToAddressRequirements, useRoutes } from '../../hooks';
|
|
5
5
|
import { useWidgetConfig } from '../../providers';
|
|
6
6
|
import {
|
|
7
7
|
useSetExecutableRoute,
|
|
8
8
|
useSplitSubvariantStore,
|
|
9
|
-
|
|
9
|
+
useFieldValues,
|
|
10
10
|
} from '../../stores';
|
|
11
11
|
import { navigationRoutes } from '../../utils';
|
|
12
12
|
|
|
13
13
|
export const ReviewButton: React.FC = () => {
|
|
14
14
|
const { t } = useTranslation();
|
|
15
15
|
const navigate = useNavigate();
|
|
16
|
-
const { isValid, isValidating } = useValidation();
|
|
17
16
|
const setExecutableRoute = useSetExecutableRoute();
|
|
18
17
|
const { subvariant } = useWidgetConfig();
|
|
19
18
|
const splitState = useSplitSubvariantStore((state) => state.state);
|
|
20
|
-
|
|
19
|
+
const [toAddress] = useFieldValues('toAddress');
|
|
20
|
+
const { requiredToAddress } = useToAddressRequirements();
|
|
21
21
|
const { routes } = useRoutes();
|
|
22
22
|
|
|
23
23
|
const currentRoute = routes?.[0];
|
|
@@ -66,7 +66,7 @@ export const ReviewButton: React.FC = () => {
|
|
|
66
66
|
<BaseTransactionButton
|
|
67
67
|
text={getButtonText()}
|
|
68
68
|
onClick={handleClick}
|
|
69
|
-
disabled={currentRoute &&
|
|
69
|
+
disabled={currentRoute && requiredToAddress && !toAddress}
|
|
70
70
|
/>
|
|
71
71
|
);
|
|
72
72
|
};
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import ErrorIcon from '@mui/icons-material/Error';
|
|
2
|
+
import TurnedInIcon from '@mui/icons-material/TurnedIn';
|
|
3
|
+
import { Button, Typography } from '@mui/material';
|
|
4
|
+
import type { ChangeEvent, FocusEventHandler, MutableRefObject } from 'react';
|
|
5
|
+
import { forwardRef, useRef, useState } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import type { BottomSheetBase } from '../../components/BottomSheet';
|
|
8
|
+
import { BottomSheet } from '../../components/BottomSheet';
|
|
9
|
+
import { Input } from '../../components/Input';
|
|
10
|
+
import { useAddressValidation } from '../../hooks';
|
|
11
|
+
import type { Bookmark } from '../../stores';
|
|
12
|
+
import { useBookmarkActions } from '../../stores';
|
|
13
|
+
import {
|
|
14
|
+
AddressInput,
|
|
15
|
+
BookmarkInputFields,
|
|
16
|
+
IconContainer,
|
|
17
|
+
SendToWalletButtonRow,
|
|
18
|
+
SendToWalletCard,
|
|
19
|
+
SendToWalletSheetContainer,
|
|
20
|
+
SheetAddressContainer,
|
|
21
|
+
SheetTitle,
|
|
22
|
+
ValidationAlert,
|
|
23
|
+
} from './SendToWalletPage.style';
|
|
24
|
+
|
|
25
|
+
interface BookmarkAddressProps {
|
|
26
|
+
onAddBookmark: (bookmark: Bookmark) => void;
|
|
27
|
+
validatedWallet?: Bookmark;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const BookmarkAddressSheet = forwardRef<
|
|
31
|
+
BottomSheetBase,
|
|
32
|
+
BookmarkAddressProps
|
|
33
|
+
>(({ validatedWallet, onAddBookmark }, ref) => {
|
|
34
|
+
const { t } = useTranslation();
|
|
35
|
+
const bookmarkButtonRef = useRef<HTMLButtonElement>(null);
|
|
36
|
+
const [name, setName] = useState('');
|
|
37
|
+
const [address, setAddress] = useState('');
|
|
38
|
+
const [errorMessage, setErrorMessage] = useState('');
|
|
39
|
+
const { validateAddress, isValidating } = useAddressValidation();
|
|
40
|
+
const { getBookmark } = useBookmarkActions();
|
|
41
|
+
|
|
42
|
+
const nameValue = name || validatedWallet?.name || '';
|
|
43
|
+
const addressValue = address || validatedWallet?.address || '';
|
|
44
|
+
|
|
45
|
+
const handleCancel = () => {
|
|
46
|
+
setErrorMessage('');
|
|
47
|
+
(ref as MutableRefObject<BottomSheetBase>).current?.close();
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const validateWithAddressFromInput = async () => {
|
|
51
|
+
const validationResult = await validateAddress(address);
|
|
52
|
+
if (!validationResult.isValid) {
|
|
53
|
+
setErrorMessage(validationResult.error);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
name: nameValue.trim(),
|
|
59
|
+
address: validationResult.address,
|
|
60
|
+
chainType: validationResult.chainType,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const validateWithValidatedWallet = () => {
|
|
65
|
+
if (errorMessage) {
|
|
66
|
+
setErrorMessage('');
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
name: nameValue.trim(),
|
|
70
|
+
address: validatedWallet!.address,
|
|
71
|
+
chainType: validatedWallet!.chainType,
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const handleBookmark = async () => {
|
|
76
|
+
if (!nameValue) {
|
|
77
|
+
setErrorMessage(t('error.title.bookmarkNameRequired'));
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (!addressValue) {
|
|
81
|
+
setErrorMessage(t('error.title.addressRequired'));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const existingBookmark = getBookmark(addressValue);
|
|
86
|
+
if (existingBookmark) {
|
|
87
|
+
setErrorMessage(
|
|
88
|
+
t('error.title.bookmarkAlreadyExists', {
|
|
89
|
+
name: existingBookmark.name,
|
|
90
|
+
}),
|
|
91
|
+
);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// If the validatedWallet is supplied as a prop then we should assume
|
|
96
|
+
// the address has already been validated
|
|
97
|
+
const validatedBookmark = validatedWallet
|
|
98
|
+
? validateWithValidatedWallet()
|
|
99
|
+
: await validateWithAddressFromInput();
|
|
100
|
+
|
|
101
|
+
if (validatedBookmark) {
|
|
102
|
+
(ref as MutableRefObject<BottomSheetBase>).current?.close();
|
|
103
|
+
|
|
104
|
+
onAddBookmark({
|
|
105
|
+
name: validatedBookmark.name,
|
|
106
|
+
address: validatedBookmark.address,
|
|
107
|
+
chainType: validatedBookmark.chainType,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const handleAddressInputChange = (e: ChangeEvent) => {
|
|
113
|
+
setAddress((e.target as HTMLInputElement).value.trim());
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const handleNameInputChange = (e: ChangeEvent) => {
|
|
117
|
+
setName((e.target as HTMLInputElement).value.trim());
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const resetValues = () => {
|
|
121
|
+
setName('');
|
|
122
|
+
setAddress('');
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const handleAddressInputOnBlur: FocusEventHandler = async (e) => {
|
|
126
|
+
if (!(e.relatedTarget === bookmarkButtonRef.current) && !isValidating) {
|
|
127
|
+
if (!address) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const existingBookmark = getBookmark(address);
|
|
132
|
+
if (existingBookmark) {
|
|
133
|
+
setErrorMessage(
|
|
134
|
+
t('error.title.bookmarkAlreadyExists', {
|
|
135
|
+
name: existingBookmark.name,
|
|
136
|
+
}),
|
|
137
|
+
);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const validationResult = await validateAddress(address);
|
|
142
|
+
if (!validationResult.isValid) {
|
|
143
|
+
setErrorMessage(validationResult.error);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<BottomSheet ref={ref} onClose={resetValues}>
|
|
150
|
+
<SendToWalletSheetContainer>
|
|
151
|
+
<IconContainer>
|
|
152
|
+
<TurnedInIcon sx={{ fontSize: 48 }} />
|
|
153
|
+
</IconContainer>
|
|
154
|
+
<SheetTitle>{t('sendToWallet.bookmarkWallet')}</SheetTitle>
|
|
155
|
+
{validatedWallet ? (
|
|
156
|
+
<SheetAddressContainer>
|
|
157
|
+
{validatedWallet?.name ? (
|
|
158
|
+
<Typography fontWeight={600} mb={0.5}>
|
|
159
|
+
{validatedWallet?.name}
|
|
160
|
+
</Typography>
|
|
161
|
+
) : null}
|
|
162
|
+
<Typography>{validatedWallet?.address}</Typography>
|
|
163
|
+
</SheetAddressContainer>
|
|
164
|
+
) : null}
|
|
165
|
+
<BookmarkInputFields>
|
|
166
|
+
<SendToWalletCard>
|
|
167
|
+
<Input
|
|
168
|
+
size="small"
|
|
169
|
+
autoComplete="off"
|
|
170
|
+
autoCorrect="off"
|
|
171
|
+
autoCapitalize="off"
|
|
172
|
+
spellCheck="false"
|
|
173
|
+
onChange={handleNameInputChange}
|
|
174
|
+
value={name}
|
|
175
|
+
placeholder={validatedWallet?.name || t('sendToWallet.enterName')}
|
|
176
|
+
aria-label={validatedWallet?.name || t('sendToWallet.enterName')}
|
|
177
|
+
/>
|
|
178
|
+
</SendToWalletCard>
|
|
179
|
+
{!validatedWallet && (
|
|
180
|
+
<SendToWalletCard>
|
|
181
|
+
<AddressInput
|
|
182
|
+
size="small"
|
|
183
|
+
autoComplete="off"
|
|
184
|
+
autoCorrect="off"
|
|
185
|
+
autoCapitalize="off"
|
|
186
|
+
spellCheck="false"
|
|
187
|
+
onChange={handleAddressInputChange}
|
|
188
|
+
onBlur={handleAddressInputOnBlur}
|
|
189
|
+
value={address}
|
|
190
|
+
placeholder={t('sendToWallet.enterAddress')}
|
|
191
|
+
aria-label={t('sendToWallet.enterAddress')}
|
|
192
|
+
multiline
|
|
193
|
+
/>
|
|
194
|
+
</SendToWalletCard>
|
|
195
|
+
)}
|
|
196
|
+
{!!errorMessage && (
|
|
197
|
+
<ValidationAlert icon={<ErrorIcon />}>
|
|
198
|
+
{errorMessage}
|
|
199
|
+
</ValidationAlert>
|
|
200
|
+
)}
|
|
201
|
+
</BookmarkInputFields>
|
|
202
|
+
<SendToWalletButtonRow>
|
|
203
|
+
<Button sx={{ flexGrow: 1 }} variant="text" onClick={handleCancel}>
|
|
204
|
+
{t('button.cancel')}
|
|
205
|
+
</Button>
|
|
206
|
+
<Button
|
|
207
|
+
ref={bookmarkButtonRef}
|
|
208
|
+
sx={{ flexGrow: 1 }}
|
|
209
|
+
variant="contained"
|
|
210
|
+
onClick={handleBookmark}
|
|
211
|
+
focusRipple
|
|
212
|
+
>
|
|
213
|
+
{t('button.bookmark')}
|
|
214
|
+
</Button>
|
|
215
|
+
</SendToWalletButtonRow>
|
|
216
|
+
</SendToWalletSheetContainer>
|
|
217
|
+
</BottomSheet>
|
|
218
|
+
);
|
|
219
|
+
});
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
|
|
2
|
+
import DeleteIcon from '@mui/icons-material/Delete';
|
|
3
|
+
import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
|
|
4
|
+
import OpenInNewIcon from '@mui/icons-material/OpenInNew';
|
|
5
|
+
import TurnedInIcon from '@mui/icons-material/TurnedIn';
|
|
6
|
+
import { Button, ListItemAvatar, ListItemText, MenuItem } from '@mui/material';
|
|
7
|
+
import { useId, useRef, useState } from 'react';
|
|
8
|
+
import { useTranslation } from 'react-i18next';
|
|
9
|
+
import { AccountAvatar } from '../../components/AccountAvatar';
|
|
10
|
+
import type { BottomSheetBase } from '../../components/BottomSheet';
|
|
11
|
+
import { ListItem, ListItemButton } from '../../components/ListItem';
|
|
12
|
+
import { Menu } from '../../components/Menu';
|
|
13
|
+
import { useChains, useToAddressRequirements } from '../../hooks';
|
|
14
|
+
import type { Bookmark } from '../../stores';
|
|
15
|
+
import { useBookmarkActions, useBookmarks } from '../../stores';
|
|
16
|
+
import { defaultChainIdsByType, shortenAddress } from '../../utils';
|
|
17
|
+
import { BookmarkAddressSheet } from './BookmarkAddressSheet';
|
|
18
|
+
import { ConfirmAddressSheet } from './ConfirmAddressSheet';
|
|
19
|
+
import { EmptyListIndicator } from './EmptyListIndicator';
|
|
20
|
+
import {
|
|
21
|
+
BookmarkButtonContainer,
|
|
22
|
+
ListContainer,
|
|
23
|
+
OptionsMenuButton,
|
|
24
|
+
SendToWalletPageContainer,
|
|
25
|
+
} from './SendToWalletPage.style';
|
|
26
|
+
|
|
27
|
+
export const BookmarksPage = () => {
|
|
28
|
+
const { t } = useTranslation();
|
|
29
|
+
const [bookmark, setBookmark] = useState<Bookmark>();
|
|
30
|
+
const bookmarkAddressSheetRef = useRef<BottomSheetBase>(null);
|
|
31
|
+
const confirmAddressSheetRef = useRef<BottomSheetBase>(null);
|
|
32
|
+
const { bookmarks } = useBookmarks();
|
|
33
|
+
const { requiredToChainType } = useToAddressRequirements();
|
|
34
|
+
const { addBookmark, removeBookmark, setSelectedBookmark } =
|
|
35
|
+
useBookmarkActions();
|
|
36
|
+
const { getChainById } = useChains();
|
|
37
|
+
|
|
38
|
+
const handleAddBookmark = () => {
|
|
39
|
+
bookmarkAddressSheetRef.current?.open();
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const handleBookmarkSelected = (bookmark: Bookmark) => {
|
|
43
|
+
setBookmark(bookmark);
|
|
44
|
+
confirmAddressSheetRef.current?.open();
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const handleOnConfirm = (confirmedWallet: Bookmark) => {
|
|
48
|
+
setSelectedBookmark(confirmedWallet);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const moreMenuId = useId();
|
|
52
|
+
const [moreMenuAnchorEl, setMenuAnchorEl] = useState<HTMLElement | null>();
|
|
53
|
+
const open = Boolean(moreMenuAnchorEl);
|
|
54
|
+
const closeMenu = () => {
|
|
55
|
+
setMenuAnchorEl(null);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const handleMenuOpen = (el: HTMLElement, bookmark: Bookmark) => {
|
|
59
|
+
setMenuAnchorEl(el);
|
|
60
|
+
setBookmark(bookmark);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const handleCopyAddress = () => {
|
|
64
|
+
if (bookmark) {
|
|
65
|
+
navigator.clipboard.writeText(bookmark.address);
|
|
66
|
+
}
|
|
67
|
+
closeMenu();
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const handleViewOnExplorer = () => {
|
|
71
|
+
if (bookmark) {
|
|
72
|
+
const chain = getChainById(defaultChainIdsByType[bookmark.chainType]);
|
|
73
|
+
window.open(
|
|
74
|
+
`${chain?.metamask.blockExplorerUrls[0]}address/${bookmark.address}`,
|
|
75
|
+
'_blank',
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
closeMenu();
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const handleRemoveBookmark = () => {
|
|
82
|
+
if (bookmark) {
|
|
83
|
+
removeBookmark(bookmark.address);
|
|
84
|
+
}
|
|
85
|
+
closeMenu();
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<SendToWalletPageContainer disableGutters>
|
|
90
|
+
<ListContainer>
|
|
91
|
+
{bookmarks.map((bookmark) => (
|
|
92
|
+
<ListItem key={bookmark.address} sx={{ position: 'relative' }}>
|
|
93
|
+
<ListItemButton
|
|
94
|
+
onClick={() => handleBookmarkSelected(bookmark)}
|
|
95
|
+
disabled={
|
|
96
|
+
requiredToChainType &&
|
|
97
|
+
requiredToChainType !== bookmark.chainType
|
|
98
|
+
}
|
|
99
|
+
>
|
|
100
|
+
<ListItemAvatar>
|
|
101
|
+
<AccountAvatar
|
|
102
|
+
chainId={defaultChainIdsByType[bookmark.chainType]}
|
|
103
|
+
/>
|
|
104
|
+
</ListItemAvatar>
|
|
105
|
+
<ListItemText
|
|
106
|
+
primary={bookmark.name}
|
|
107
|
+
secondary={shortenAddress(bookmark.address)}
|
|
108
|
+
/>
|
|
109
|
+
</ListItemButton>
|
|
110
|
+
<OptionsMenuButton
|
|
111
|
+
aria-label={t('button.options')}
|
|
112
|
+
aria-controls={
|
|
113
|
+
open && bookmark.address === bookmark?.address
|
|
114
|
+
? moreMenuId
|
|
115
|
+
: undefined
|
|
116
|
+
}
|
|
117
|
+
aria-haspopup="true"
|
|
118
|
+
aria-expanded={open ? 'true' : undefined}
|
|
119
|
+
onClick={(e) => handleMenuOpen(e.target as HTMLElement, bookmark)}
|
|
120
|
+
sx={{
|
|
121
|
+
opacity:
|
|
122
|
+
requiredToChainType &&
|
|
123
|
+
requiredToChainType !== bookmark.chainType
|
|
124
|
+
? 0.5
|
|
125
|
+
: 1,
|
|
126
|
+
}}
|
|
127
|
+
>
|
|
128
|
+
<MoreHorizIcon fontSize="small" />
|
|
129
|
+
</OptionsMenuButton>
|
|
130
|
+
</ListItem>
|
|
131
|
+
))}
|
|
132
|
+
{!bookmarks.length && (
|
|
133
|
+
<EmptyListIndicator icon={<TurnedInIcon sx={{ fontSize: 48 }} />}>
|
|
134
|
+
{t('sendToWallet.noBookmarkedWallets')}
|
|
135
|
+
</EmptyListIndicator>
|
|
136
|
+
)}
|
|
137
|
+
<Menu
|
|
138
|
+
id={moreMenuId}
|
|
139
|
+
elevation={0}
|
|
140
|
+
anchorOrigin={{
|
|
141
|
+
vertical: 'bottom',
|
|
142
|
+
horizontal: 'right',
|
|
143
|
+
}}
|
|
144
|
+
transformOrigin={{
|
|
145
|
+
vertical: 'top',
|
|
146
|
+
horizontal: 'right',
|
|
147
|
+
}}
|
|
148
|
+
anchorEl={moreMenuAnchorEl}
|
|
149
|
+
open={open}
|
|
150
|
+
onClose={closeMenu}
|
|
151
|
+
>
|
|
152
|
+
<MenuItem onClick={handleCopyAddress}>
|
|
153
|
+
<ContentCopyIcon />
|
|
154
|
+
{t('button.copyAddress')}
|
|
155
|
+
</MenuItem>
|
|
156
|
+
<MenuItem onClick={handleViewOnExplorer}>
|
|
157
|
+
<OpenInNewIcon />
|
|
158
|
+
{t('button.viewOnExplorer')}
|
|
159
|
+
</MenuItem>
|
|
160
|
+
<MenuItem onClick={handleRemoveBookmark}>
|
|
161
|
+
<DeleteIcon />
|
|
162
|
+
{t('button.delete')}
|
|
163
|
+
</MenuItem>
|
|
164
|
+
</Menu>
|
|
165
|
+
</ListContainer>
|
|
166
|
+
<BookmarkButtonContainer>
|
|
167
|
+
<Button variant="contained" onClick={handleAddBookmark}>
|
|
168
|
+
{t('sendToWallet.addBookmark')}
|
|
169
|
+
</Button>
|
|
170
|
+
</BookmarkButtonContainer>
|
|
171
|
+
<BookmarkAddressSheet
|
|
172
|
+
ref={bookmarkAddressSheetRef}
|
|
173
|
+
onAddBookmark={addBookmark}
|
|
174
|
+
/>
|
|
175
|
+
<ConfirmAddressSheet
|
|
176
|
+
ref={confirmAddressSheetRef}
|
|
177
|
+
validatedBookmark={bookmark}
|
|
178
|
+
onConfirm={handleOnConfirm}
|
|
179
|
+
/>
|
|
180
|
+
</SendToWalletPageContainer>
|
|
181
|
+
);
|
|
182
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import InfoIcon from '@mui/icons-material/Info';
|
|
2
|
+
import WalletIcon from '@mui/icons-material/Wallet';
|
|
3
|
+
import { Button, Typography } from '@mui/material';
|
|
4
|
+
import type { MutableRefObject } from 'react';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { useNavigate } from 'react-router-dom';
|
|
8
|
+
import { AlertMessage } from '../../components/AlertMessage';
|
|
9
|
+
import type { BottomSheetBase } from '../../components/BottomSheet';
|
|
10
|
+
import { BottomSheet } from '../../components/BottomSheet';
|
|
11
|
+
import type { Bookmark } from '../../stores';
|
|
12
|
+
import { useFieldActions, useSendToWalletStore } from '../../stores';
|
|
13
|
+
import { navigationRoutes } from '../../utils';
|
|
14
|
+
import {
|
|
15
|
+
IconContainer,
|
|
16
|
+
SendToWalletButtonRow,
|
|
17
|
+
SendToWalletSheetContainer,
|
|
18
|
+
SheetAddressContainer,
|
|
19
|
+
SheetTitle,
|
|
20
|
+
} from './SendToWalletPage.style';
|
|
21
|
+
|
|
22
|
+
interface ConfirmAddressSheetProps {
|
|
23
|
+
onConfirm: (wallet: Bookmark) => void;
|
|
24
|
+
validatedBookmark?: Bookmark;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const ConfirmAddressSheet = forwardRef<
|
|
28
|
+
BottomSheetBase,
|
|
29
|
+
ConfirmAddressSheetProps
|
|
30
|
+
>(({ validatedBookmark, onConfirm }, ref) => {
|
|
31
|
+
const { t } = useTranslation();
|
|
32
|
+
const navigate = useNavigate();
|
|
33
|
+
const { setFieldValue } = useFieldActions();
|
|
34
|
+
const setSendToWallet = useSendToWalletStore(
|
|
35
|
+
(state) => state.setSendToWallet,
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const handleClose = () => {
|
|
39
|
+
(ref as MutableRefObject<BottomSheetBase>).current?.close();
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const handleConfirm = () => {
|
|
43
|
+
if (validatedBookmark) {
|
|
44
|
+
setFieldValue('toAddress', validatedBookmark.address);
|
|
45
|
+
onConfirm?.(validatedBookmark);
|
|
46
|
+
setSendToWallet(true);
|
|
47
|
+
handleClose();
|
|
48
|
+
navigate(navigationRoutes.home);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<BottomSheet ref={ref}>
|
|
54
|
+
<SendToWalletSheetContainer>
|
|
55
|
+
<IconContainer>
|
|
56
|
+
<WalletIcon sx={{ fontSize: 48 }} />
|
|
57
|
+
</IconContainer>
|
|
58
|
+
<SheetTitle>{t('sendToWallet.confirmWalletAddress')}</SheetTitle>
|
|
59
|
+
<SheetAddressContainer>
|
|
60
|
+
{validatedBookmark?.name ? (
|
|
61
|
+
<Typography fontWeight={600} mb={0.5}>
|
|
62
|
+
{validatedBookmark?.name}
|
|
63
|
+
</Typography>
|
|
64
|
+
) : null}
|
|
65
|
+
<Typography>{validatedBookmark?.address}</Typography>
|
|
66
|
+
</SheetAddressContainer>
|
|
67
|
+
<AlertMessage
|
|
68
|
+
title={
|
|
69
|
+
<Typography variant="body2">
|
|
70
|
+
{t('info.message.fundsToExchange')}
|
|
71
|
+
</Typography>
|
|
72
|
+
}
|
|
73
|
+
icon={<InfoIcon />}
|
|
74
|
+
/>
|
|
75
|
+
<SendToWalletButtonRow>
|
|
76
|
+
<Button sx={{ flexGrow: 1 }} variant="text" onClick={handleClose}>
|
|
77
|
+
{t('button.cancel')}
|
|
78
|
+
</Button>
|
|
79
|
+
<Button
|
|
80
|
+
sx={{ flexGrow: 1 }}
|
|
81
|
+
variant="contained"
|
|
82
|
+
onClick={handleConfirm}
|
|
83
|
+
>
|
|
84
|
+
{t('button.confirm')}
|
|
85
|
+
</Button>
|
|
86
|
+
</SendToWalletButtonRow>
|
|
87
|
+
</SendToWalletSheetContainer>
|
|
88
|
+
</BottomSheet>
|
|
89
|
+
);
|
|
90
|
+
});
|