@rango-dev/widget-embedded 0.31.1-next.3 → 0.32.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/CHANGELOG.md +9 -0
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/BlockchainList/BlockchainList.d.ts.map +1 -1
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts +4 -1
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -1
- package/dist/components/BlockchainList/BlockchainList.types.d.ts +1 -0
- package/dist/components/BlockchainList/BlockchainList.types.d.ts.map +1 -1
- package/dist/components/BlockchainSelectorButton/BlockchainSelectorButton.d.ts +4 -0
- package/dist/components/BlockchainSelectorButton/BlockchainSelectorButton.d.ts.map +1 -0
- package/dist/components/BlockchainSelectorButton/BlockchainSelectorButton.styles.d.ts +483 -0
- package/dist/components/BlockchainSelectorButton/BlockchainSelectorButton.styles.d.ts.map +1 -0
- package/dist/components/BlockchainSelectorButton/BlockchainSelectorButton.types.d.ts +12 -0
- package/dist/components/BlockchainSelectorButton/BlockchainSelectorButton.types.d.ts.map +1 -0
- package/dist/components/BlockchainSelectorButton/index.d.ts +2 -0
- package/dist/components/BlockchainSelectorButton/index.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +11 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +3 -0
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -1
- package/dist/components/CustomCollapsible/CustomCollapsible.styles.d.ts +4 -0
- package/dist/components/CustomCollapsible/CustomCollapsible.styles.d.ts.map +1 -1
- package/dist/components/CustomDestination/CustomDestination.d.ts.map +1 -1
- package/dist/components/CustomDestination/CustomDestination.styles.d.ts +5 -2
- package/dist/components/CustomDestination/CustomDestination.styles.d.ts.map +1 -1
- package/dist/components/CustomTokenModal/CustomTokenModal.d.ts +4 -0
- package/dist/components/CustomTokenModal/CustomTokenModal.d.ts.map +1 -0
- package/dist/components/CustomTokenModal/CustomTokenModal.helpers.d.ts +3 -0
- package/dist/components/CustomTokenModal/CustomTokenModal.helpers.d.ts.map +1 -0
- package/dist/components/CustomTokenModal/CustomTokenModal.styles.d.ts +323 -0
- package/dist/components/CustomTokenModal/CustomTokenModal.styles.d.ts.map +1 -0
- package/dist/components/CustomTokenModal/CustomTokenModal.types.d.ts +9 -0
- package/dist/components/CustomTokenModal/CustomTokenModal.types.d.ts.map +1 -0
- package/dist/components/CustomTokenModal/index.d.ts +2 -0
- package/dist/components/CustomTokenModal/index.d.ts.map +1 -0
- package/dist/components/FilterSelector/FilterSelector.style.d.ts +6 -0
- package/dist/components/FilterSelector/FilterSelector.style.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +8 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
- package/dist/components/HistoryGroupedList/HistoryGroupedList.styles.d.ts +6 -0
- package/dist/components/HistoryGroupedList/HistoryGroupedList.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.styles.d.ts +4 -0
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/Layout/PageContainer.d.ts +1 -0
- package/dist/components/Layout/PageContainer.d.ts.map +1 -1
- package/dist/components/Layout/ScrollableArea.d.ts +1 -0
- package/dist/components/Layout/ScrollableArea.d.ts.map +1 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +1 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +14 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.styles.d.ts +4 -0
- package/dist/components/NoResult/NoResult.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.styles.d.ts +22 -1
- package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
- package/dist/components/Quote/QuoteCostDetails.styles.d.ts +5 -0
- package/dist/components/Quote/QuoteCostDetails.styles.d.ts.map +1 -1
- package/dist/components/Quote/QuoteSummary.styles.d.ts +2 -0
- package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts +4 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts +10 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +5 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts +4 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
- package/dist/components/Quotes/Quotes.styles.d.ts +3 -0
- package/dist/components/Quotes/Quotes.styles.d.ts.map +1 -1
- package/dist/components/RefreshModal/RefreshModal.styles.d.ts +2 -1
- package/dist/components/RefreshModal/RefreshModal.styles.d.ts.map +1 -1
- package/dist/components/SearchInput/SearchInput.styles.d.ts +1 -0
- package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +3 -0
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.styles.d.ts +5 -0
- package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +15 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +3 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +2 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -1
- package/dist/components/SwitchFromAndTo/SwitchFromAndTo.styles.d.ts +2 -0
- package/dist/components/SwitchFromAndTo/SwitchFromAndTo.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts +18 -0
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.types.d.ts +5 -2
- package/dist/components/TokenList/TokenList.types.d.ts.map +1 -1
- package/dist/components/WalletDerivationPathModal/WalletDerivationPathModal.d.ts +4 -0
- package/dist/components/WalletDerivationPathModal/WalletDerivationPathModal.d.ts.map +1 -0
- package/dist/components/{WalletStatefulConnect/DerivationPath.styles.d.ts → WalletDerivationPathModal/WalletDerivationPathModal.styles.d.ts} +3 -1
- package/dist/components/WalletDerivationPathModal/WalletDerivationPathModal.styles.d.ts.map +1 -0
- package/dist/components/WalletDerivationPathModal/WalletDerivationPathModal.types.d.ts +10 -0
- package/dist/components/WalletDerivationPathModal/WalletDerivationPathModal.types.d.ts.map +1 -0
- package/dist/components/WalletDerivationPathModal/index.d.ts +2 -0
- package/dist/components/WalletDerivationPathModal/index.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModal.d.ts +4 -0
- package/dist/components/WalletModal/WalletModal.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModal.types.d.ts +10 -0
- package/dist/components/WalletModal/WalletModal.types.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModalContent.d.ts +4 -0
- package/dist/components/WalletModal/WalletModalContent.d.ts.map +1 -0
- package/dist/components/{WalletStatefulConnect/ConnectStatus.styles.d.ts → WalletModal/WalletModalContent.styles.d.ts} +5 -1
- package/dist/components/{WalletStatefulConnect/ConnectStatus.styles.d.ts.map → WalletModal/WalletModalContent.styles.d.ts.map} +1 -1
- package/dist/components/WalletModal/index.d.ts +2 -0
- package/dist/components/WalletModal/index.d.ts.map +1 -0
- package/dist/components/WalletNamespacesModal/WalletNamespacesModal.d.ts +4 -0
- package/dist/components/WalletNamespacesModal/WalletNamespacesModal.d.ts.map +1 -0
- package/dist/components/{WalletStatefulConnect/Namespaces.styles.d.ts → WalletNamespacesModal/WalletNamespacesModal.styles.d.ts} +2 -1
- package/dist/components/WalletNamespacesModal/WalletNamespacesModal.styles.d.ts.map +1 -0
- package/dist/components/WalletNamespacesModal/WalletNamespacesModal.types.d.ts +10 -0
- package/dist/components/WalletNamespacesModal/WalletNamespacesModal.types.d.ts.map +1 -0
- package/dist/components/WalletNamespacesModal/index.d.ts +2 -0
- package/dist/components/WalletNamespacesModal/index.d.ts.map +1 -0
- package/dist/constants/customTokens.d.ts +2 -0
- package/dist/constants/customTokens.d.ts.map +1 -0
- package/dist/constants/navigationRoutes.d.ts +2 -0
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/searchParams.d.ts +1 -0
- package/dist/constants/searchParams.d.ts.map +1 -1
- package/dist/containers/App/App.styles.d.ts +1 -0
- package/dist/containers/App/App.styles.d.ts.map +1 -1
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts +2 -0
- package/dist/containers/ExpandedQuotes/ExpandedQuotes.styles.d.ts.map +1 -1
- package/dist/containers/Inputs/Inputs.styles.d.ts +2 -0
- package/dist/containers/Inputs/Inputs.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +3 -0
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
- package/dist/containers/Settings/Lists.d.ts.map +1 -1
- package/dist/hooks/useFetchCustomToken.d.ts +16 -0
- package/dist/hooks/useFetchCustomToken.d.ts.map +1 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +2 -2
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts +1 -0
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts +14 -11
- package/dist/hooks/useWalletList.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/dist/pages/AddCustomTokenPage.d.ts +3 -0
- package/dist/pages/AddCustomTokenPage.d.ts.map +1 -0
- package/dist/pages/CustomTokensPage.d.ts +3 -0
- package/dist/pages/CustomTokensPage.d.ts.map +1 -0
- package/dist/pages/SelectBlockchainPage.d.ts +2 -1
- package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts +2 -0
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/AppStore.d.ts +2 -0
- package/dist/store/AppStore.d.ts.map +1 -1
- package/dist/store/app.d.ts +2 -0
- package/dist/store/app.d.ts.map +1 -1
- package/dist/store/quote.d.ts.map +1 -1
- package/dist/store/slices/data.d.ts +4 -3
- package/dist/store/slices/data.d.ts.map +1 -1
- package/dist/store/slices/settings.d.ts +7 -2
- package/dist/store/slices/settings.d.ts.map +1 -1
- package/dist/store/utils/data.d.ts +4 -1
- package/dist/store/utils/data.d.ts.map +1 -1
- package/dist/types/config.d.ts +3 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/meta.d.ts +1 -0
- package/dist/utils/meta.d.ts.map +1 -1
- package/dist/utils/quote.d.ts +1 -0
- package/dist/utils/quote.d.ts.map +1 -1
- package/dist/utils/settings.d.ts +3 -2
- package/dist/utils/settings.d.ts.map +1 -1
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/widget-embedded.build.json +1 -1
- package/package.json +5 -5
- package/src/components/AppRoutes.tsx +30 -0
- package/src/components/BlockchainList/BlockchainList.styles.ts +3 -1
- package/src/components/BlockchainList/BlockchainList.tsx +26 -17
- package/src/components/BlockchainList/BlockchainList.types.ts +1 -0
- package/src/components/BlockchainSelectorButton/BlockchainSelectorButton.styles.ts +49 -0
- package/src/components/BlockchainSelectorButton/BlockchainSelectorButton.tsx +47 -0
- package/src/components/BlockchainSelectorButton/BlockchainSelectorButton.types.ts +11 -0
- package/src/components/BlockchainSelectorButton/index.ts +1 -0
- package/src/components/ConfirmWalletsModal/WalletList.tsx +243 -52
- package/src/components/CustomDestination/CustomDestination.tsx +5 -3
- package/src/components/CustomTokenModal/CustomTokenModal.helpers.ts +19 -0
- package/src/components/CustomTokenModal/CustomTokenModal.styles.ts +57 -0
- package/src/components/CustomTokenModal/CustomTokenModal.tsx +92 -0
- package/src/components/CustomTokenModal/CustomTokenModal.types.ts +9 -0
- package/src/components/CustomTokenModal/index.ts +1 -0
- package/src/components/HeaderButtons/WalletButton.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +113 -23
- package/src/components/TokenList/TokenList.styles.ts +1 -0
- package/src/components/TokenList/TokenList.tsx +76 -51
- package/src/components/TokenList/TokenList.types.ts +5 -2
- package/src/components/{WalletStatefulConnect/DerivationPath.tsx → WalletDerivationPathModal/WalletDerivationPathModal.tsx} +36 -18
- package/src/components/WalletDerivationPathModal/WalletDerivationPathModal.types.tsx +10 -0
- package/src/components/WalletDerivationPathModal/index.ts +1 -0
- package/src/components/WalletModal/WalletModal.tsx +25 -0
- package/src/components/WalletModal/WalletModal.types.ts +11 -0
- package/src/components/{WalletStatefulConnect/ConnectStatus.tsx → WalletModal/WalletModalContent.tsx} +5 -13
- package/src/components/WalletModal/index.ts +1 -0
- package/src/components/{WalletStatefulConnect/Namespaces.tsx → WalletNamespacesModal/WalletNamespacesModal.tsx} +27 -9
- package/src/components/{WalletStatefulConnect/Namespaces.types.tsx → WalletNamespacesModal/WalletNamespacesModal.types.tsx} +5 -2
- package/src/components/WalletNamespacesModal/index.ts +1 -0
- package/src/constants/customTokens.ts +6 -0
- package/src/constants/navigationRoutes.ts +2 -0
- package/src/constants/searchParams.ts +3 -0
- package/src/containers/Settings/Lists.tsx +25 -1
- package/src/hooks/useFetchCustomToken.ts +114 -0
- package/src/hooks/useSwapInput.ts +8 -3
- package/src/hooks/useSyncUrlAndStore/useSyncUrlAndStore.ts +6 -1
- package/src/hooks/useTheme.ts +5 -1
- package/src/hooks/useWalletList.ts +53 -22
- package/src/pages/AddCustomTokenPage.tsx +210 -0
- package/src/pages/CustomTokensPage.tsx +184 -0
- package/src/pages/HistoryPage.tsx +2 -2
- package/src/pages/LiquiditySourcePage.tsx +2 -2
- package/src/pages/SelectBlockchainPage.tsx +15 -8
- package/src/pages/SelectSwapItemsPage.tsx +1 -1
- package/src/pages/WalletsPage.tsx +162 -10
- package/src/store/app.ts +1 -0
- package/src/store/quote.ts +12 -2
- package/src/store/slices/data.ts +61 -8
- package/src/store/slices/settings.ts +35 -2
- package/src/store/utils/data.ts +26 -1
- package/src/store/wallets.ts +1 -1
- package/src/types/config.ts +4 -1
- package/src/utils/meta.ts +12 -1
- package/src/utils/quote.ts +16 -3
- package/src/utils/settings.ts +13 -1
- package/src/utils/swap.ts +7 -7
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +0 -3
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +0 -1
- package/dist/components/StatefulConnectModal/StatefulConnectModal.d.ts +0 -11
- package/dist/components/StatefulConnectModal/StatefulConnectModal.d.ts.map +0 -1
- package/dist/components/StatefulConnectModal/helpers.d.ts +0 -10
- package/dist/components/StatefulConnectModal/helpers.d.ts.map +0 -1
- package/dist/components/StatefulConnectModal/index.d.ts +0 -2
- package/dist/components/StatefulConnectModal/index.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/ConnectStatus.d.ts +0 -4
- package/dist/components/WalletStatefulConnect/ConnectStatus.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/ConnectStatus.types.d.ts +0 -8
- package/dist/components/WalletStatefulConnect/ConnectStatus.types.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/DerivationPath.d.ts +0 -4
- package/dist/components/WalletStatefulConnect/DerivationPath.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/DerivationPath.helpers.d.ts +0 -4
- package/dist/components/WalletStatefulConnect/DerivationPath.helpers.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/DerivationPath.styles.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/DerivationPath.types.d.ts +0 -6
- package/dist/components/WalletStatefulConnect/DerivationPath.types.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/ExperimentalChain.d.ts +0 -8
- package/dist/components/WalletStatefulConnect/ExperimentalChain.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.d.ts +0 -4
- package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.helpers.d.ts +0 -8
- package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.helpers.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.types.d.ts +0 -6
- package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.types.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/Namespaces.d.ts +0 -4
- package/dist/components/WalletStatefulConnect/Namespaces.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/Namespaces.helpers.d.ts +0 -3
- package/dist/components/WalletStatefulConnect/Namespaces.helpers.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/Namespaces.styles.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/Namespaces.types.d.ts +0 -7
- package/dist/components/WalletStatefulConnect/Namespaces.types.d.ts.map +0 -1
- package/dist/components/WalletStatefulConnect/index.d.ts +0 -5
- package/dist/components/WalletStatefulConnect/index.d.ts.map +0 -1
- package/dist/hooks/useStatefulConnect/index.d.ts +0 -5
- package/dist/hooks/useStatefulConnect/index.d.ts.map +0 -1
- package/dist/hooks/useStatefulConnect/useStatefulConnect.d.ts +0 -25
- package/dist/hooks/useStatefulConnect/useStatefulConnect.d.ts.map +0 -1
- package/dist/hooks/useStatefulConnect/useStatefulConnect.helpers.d.ts +0 -8
- package/dist/hooks/useStatefulConnect/useStatefulConnect.helpers.d.ts.map +0 -1
- package/dist/hooks/useStatefulConnect/useStatefulConnect.state.d.ts +0 -9
- package/dist/hooks/useStatefulConnect/useStatefulConnect.state.d.ts.map +0 -1
- package/dist/hooks/useStatefulConnect/useStatefulConnect.types.d.ts +0 -43
- package/dist/hooks/useStatefulConnect/useStatefulConnect.types.d.ts.map +0 -1
- package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +0 -10
- package/src/components/StatefulConnectModal/StatefulConnectModal.tsx +0 -168
- package/src/components/StatefulConnectModal/helpers.ts +0 -23
- package/src/components/StatefulConnectModal/index.ts +0 -1
- package/src/components/WalletStatefulConnect/ConnectStatus.types.ts +0 -11
- package/src/components/WalletStatefulConnect/DerivationPath.helpers.ts +0 -23
- package/src/components/WalletStatefulConnect/DerivationPath.types.ts +0 -6
- package/src/components/WalletStatefulConnect/ExperimentalChain.tsx +0 -36
- package/src/components/WalletStatefulConnect/ExperimentalChainStatus.helpers.ts +0 -53
- package/src/components/WalletStatefulConnect/ExperimentalChainStatus.tsx +0 -35
- package/src/components/WalletStatefulConnect/ExperimentalChainStatus.types.ts +0 -5
- package/src/components/WalletStatefulConnect/Namespaces.helpers.ts +0 -9
- package/src/components/WalletStatefulConnect/index.ts +0 -4
- package/src/hooks/useStatefulConnect/index.ts +0 -9
- package/src/hooks/useStatefulConnect/useStatefulConnect.helpers.ts +0 -13
- package/src/hooks/useStatefulConnect/useStatefulConnect.state.ts +0 -45
- package/src/hooks/useStatefulConnect/useStatefulConnect.ts +0 -232
- package/src/hooks/useStatefulConnect/useStatefulConnect.types.ts +0 -56
- /package/src/components/{WalletStatefulConnect/DerivationPath.styles.ts → WalletDerivationPathModal/WalletDerivationPathModal.styles.ts} +0 -0
- /package/src/components/{WalletStatefulConnect/ConnectStatus.styles.ts → WalletModal/WalletModalContent.styles.ts} +0 -0
- /package/src/components/{WalletStatefulConnect/Namespaces.styles.ts → WalletNamespacesModal/WalletNamespacesModal.styles.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"@lingui/core": "4.2.1",
|
|
26
26
|
"@lingui/react": "4.2.1",
|
|
27
27
|
"@rango-dev/logging-core": "^0.6.0",
|
|
28
|
-
"@rango-dev/provider-all": "^0.36.
|
|
28
|
+
"@rango-dev/provider-all": "^0.36.0",
|
|
29
29
|
"@rango-dev/queue-manager-core": "^0.27.0",
|
|
30
30
|
"@rango-dev/queue-manager-rango-preset": "^0.36.0",
|
|
31
31
|
"@rango-dev/queue-manager-react": "^0.27.0",
|
|
32
|
-
"@rango-dev/signer-solana": "^0.31.
|
|
33
|
-
"@rango-dev/ui": "^0.
|
|
32
|
+
"@rango-dev/signer-solana": "^0.31.0",
|
|
33
|
+
"@rango-dev/ui": "^0.38.0",
|
|
34
34
|
"@rango-dev/wallets-react": "^0.22.0",
|
|
35
35
|
"@rango-dev/wallets-shared": "^0.36.0",
|
|
36
36
|
"bignumber.js": "^9.1.1",
|
|
@@ -53,4 +53,4 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
}
|
|
56
|
-
}
|
|
56
|
+
}
|
|
@@ -4,7 +4,9 @@ import { useRoutes } from 'react-router-dom';
|
|
|
4
4
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
5
5
|
import { useSyncStoresWithConfig } from '../hooks/useSyncStoresWithConfig';
|
|
6
6
|
import { useSyncUrlAndStore } from '../hooks/useSyncUrlAndStore';
|
|
7
|
+
import { AddCustomTokenPage } from '../pages/AddCustomTokenPage';
|
|
7
8
|
import { ConfirmSwapPage } from '../pages/ConfirmSwapPage';
|
|
9
|
+
import { CustomTokensPage } from '../pages/CustomTokensPage';
|
|
8
10
|
import { HistoryPage } from '../pages/HistoryPage';
|
|
9
11
|
import { Home } from '../pages/Home';
|
|
10
12
|
import { LanguagePage } from '../pages/LanguagePage';
|
|
@@ -80,8 +82,36 @@ export function AppRoutes() {
|
|
|
80
82
|
path: navigationRoutes.bridges,
|
|
81
83
|
element: <LiquiditySourcePage sourceType="Bridges" />,
|
|
82
84
|
},
|
|
85
|
+
{
|
|
86
|
+
path: navigationRoutes.customTokens,
|
|
87
|
+
children: [
|
|
88
|
+
{
|
|
89
|
+
index: true,
|
|
90
|
+
element: <CustomTokensPage />,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
path: navigationRoutes.addCustomTokens,
|
|
94
|
+
children: [
|
|
95
|
+
{
|
|
96
|
+
index: true,
|
|
97
|
+
element: <AddCustomTokenPage />,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
path: navigationRoutes.blockchains,
|
|
101
|
+
element: (
|
|
102
|
+
<SelectBlockchainPage
|
|
103
|
+
hideCategory={true}
|
|
104
|
+
type="custom-token"
|
|
105
|
+
/>
|
|
106
|
+
),
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
},
|
|
83
112
|
],
|
|
84
113
|
},
|
|
114
|
+
|
|
85
115
|
{
|
|
86
116
|
path: navigationRoutes.swaps,
|
|
87
117
|
children: [
|
|
@@ -2,10 +2,12 @@ import { ImageContainer, styled } from '@rango-dev/ui';
|
|
|
2
2
|
|
|
3
3
|
import { ScrollableArea } from '../Layout';
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const BlockchainListContainer = styled('div', {
|
|
6
6
|
display: 'flex',
|
|
7
7
|
flexDirection: 'column',
|
|
8
8
|
overflow: 'hidden',
|
|
9
|
+
height: '100%',
|
|
10
|
+
justifyContent: 'center',
|
|
9
11
|
});
|
|
10
12
|
|
|
11
13
|
export const List = styled(ScrollableArea, {
|
|
@@ -14,11 +14,17 @@ import React, { useEffect, useState } from 'react';
|
|
|
14
14
|
import { useAppStore } from '../../store/AppStore';
|
|
15
15
|
|
|
16
16
|
import { filterBlockchains } from './BlockchainList.helpers';
|
|
17
|
-
import {
|
|
17
|
+
import { BlockchainListContainer, List } from './BlockchainList.styles';
|
|
18
18
|
import { LoadingBlockchainList } from './LoadingBlockchainList';
|
|
19
19
|
|
|
20
20
|
export function BlockchainList(props: PropTypes) {
|
|
21
|
-
const {
|
|
21
|
+
const {
|
|
22
|
+
list,
|
|
23
|
+
searchedFor,
|
|
24
|
+
onChange,
|
|
25
|
+
blockchainCategory,
|
|
26
|
+
showTitle = true,
|
|
27
|
+
} = props;
|
|
22
28
|
const [blockchains, setBlockchains] = useState<BlockchainMeta[]>(list);
|
|
23
29
|
const { fetchStatus } = useAppStore();
|
|
24
30
|
|
|
@@ -31,13 +37,10 @@ export function BlockchainList(props: PropTypes) {
|
|
|
31
37
|
const renderList = () => {
|
|
32
38
|
if (!blockchains.length && !!searchedFor) {
|
|
33
39
|
return (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
description={i18n.t('Try using different keywords')}
|
|
39
|
-
/>
|
|
40
|
-
</>
|
|
40
|
+
<NotFound
|
|
41
|
+
title={i18n.t('No results found')}
|
|
42
|
+
description={i18n.t('Try using different keywords')}
|
|
43
|
+
/>
|
|
41
44
|
);
|
|
42
45
|
}
|
|
43
46
|
return (
|
|
@@ -61,13 +64,19 @@ export function BlockchainList(props: PropTypes) {
|
|
|
61
64
|
};
|
|
62
65
|
|
|
63
66
|
return (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
<>
|
|
68
|
+
{showTitle && (
|
|
69
|
+
<>
|
|
70
|
+
<Typography variant="label" size="large">
|
|
71
|
+
{i18n.t('Select Blockchain')}
|
|
72
|
+
</Typography>
|
|
73
|
+
<Divider size={4} />
|
|
74
|
+
</>
|
|
75
|
+
)}
|
|
76
|
+
<BlockchainListContainer>
|
|
77
|
+
{fetchStatus === 'loading' && <LoadingBlockchainList />}
|
|
78
|
+
{fetchStatus === 'success' && renderList()}
|
|
79
|
+
</BlockchainListContainer>
|
|
80
|
+
</>
|
|
72
81
|
);
|
|
73
82
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { darkTheme, styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const InputContainer = styled('div', {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
justifyContent: 'space-between',
|
|
6
|
+
width: '100%',
|
|
7
|
+
height: '$40',
|
|
8
|
+
padding: '$4 $10',
|
|
9
|
+
borderRadius: '$sm',
|
|
10
|
+
cursor: 'pointer',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
backgroundColor: '$neutral300',
|
|
13
|
+
[`.${darkTheme} &`]: {
|
|
14
|
+
backgroundColor: '$neutral400',
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
'&:hover': {
|
|
18
|
+
backgroundColor: '$secondary100',
|
|
19
|
+
[`.${darkTheme} &`]: {
|
|
20
|
+
backgroundColor: '$neutral500',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
variants: {
|
|
24
|
+
disabled: {
|
|
25
|
+
true: {
|
|
26
|
+
cursor: 'default',
|
|
27
|
+
'&:hover': {
|
|
28
|
+
borderColor: '$neutral300',
|
|
29
|
+
'& svg': {
|
|
30
|
+
color: '$neutral700',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const Container = styled('div', {
|
|
39
|
+
display: 'flex',
|
|
40
|
+
flexDirection: 'column',
|
|
41
|
+
width: '100%',
|
|
42
|
+
'.title_typography': {
|
|
43
|
+
textTransform: 'capitalize',
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const FlexContainer = styled('div', {
|
|
48
|
+
display: 'flex',
|
|
49
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { PropTypes } from './BlockchainSelectorButton.types';
|
|
2
|
+
|
|
3
|
+
import { ChevronRightIcon, Divider, Image, Typography } from '@rango-dev/ui';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Container,
|
|
8
|
+
FlexContainer,
|
|
9
|
+
InputContainer,
|
|
10
|
+
} from './BlockchainSelectorButton.styles';
|
|
11
|
+
|
|
12
|
+
export function BlockchainSelectorButton(props: PropTypes) {
|
|
13
|
+
const { onClick, value, title, hasLogo, placeholder, disabled } = props;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Container>
|
|
17
|
+
<Typography size="large" variant="label">
|
|
18
|
+
{title}
|
|
19
|
+
</Typography>
|
|
20
|
+
<Divider size={10} />
|
|
21
|
+
<InputContainer
|
|
22
|
+
onClick={disabled ? undefined : onClick}
|
|
23
|
+
disabled={disabled}>
|
|
24
|
+
<FlexContainer>
|
|
25
|
+
{hasLogo && (
|
|
26
|
+
<>
|
|
27
|
+
<Image
|
|
28
|
+
src={value?.logo}
|
|
29
|
+
size={16}
|
|
30
|
+
useAsPlaceholder={!value?.logo}
|
|
31
|
+
type="circular"
|
|
32
|
+
/>
|
|
33
|
+
<Divider size={4} direction="horizontal" />
|
|
34
|
+
</>
|
|
35
|
+
)}
|
|
36
|
+
<Typography
|
|
37
|
+
className="title_typography"
|
|
38
|
+
size="medium"
|
|
39
|
+
variant="label">
|
|
40
|
+
{value?.name || placeholder}
|
|
41
|
+
</Typography>
|
|
42
|
+
</FlexContainer>
|
|
43
|
+
<ChevronRightIcon size={12} color="black" />
|
|
44
|
+
</InputContainer>
|
|
45
|
+
</Container>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BlockchainSelectorButton } from './BlockchainSelectorButton';
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { PropTypes } from './WalletList.type';
|
|
2
2
|
import type { Wallet, WalletInfoWithExtra } from '../../types';
|
|
3
|
+
import type { Namespace, WalletType } from '@rango-dev/wallets-shared';
|
|
3
4
|
|
|
4
5
|
import { i18n } from '@lingui/core';
|
|
5
|
-
import { warn } from '@rango-dev/logging-core';
|
|
6
6
|
import {
|
|
7
|
+
Button,
|
|
7
8
|
Divider,
|
|
9
|
+
Image,
|
|
10
|
+
MessageBox,
|
|
8
11
|
SelectableWallet,
|
|
9
12
|
Typography,
|
|
10
13
|
WalletState,
|
|
@@ -13,11 +16,11 @@ import React, { useEffect, useState } from 'react';
|
|
|
13
16
|
|
|
14
17
|
import { useWallets } from '../..';
|
|
15
18
|
import { WIDGET_UI_ID } from '../../constants';
|
|
16
|
-
import {
|
|
17
|
-
ResultStatus,
|
|
18
|
-
useStatefulConnect,
|
|
19
|
-
} from '../../hooks/useStatefulConnect';
|
|
20
19
|
import { useWalletList } from '../../hooks/useWalletList';
|
|
20
|
+
import {
|
|
21
|
+
TIME_TO_CLOSE_MODAL,
|
|
22
|
+
TIME_TO_IGNORE_MODAL,
|
|
23
|
+
} from '../../pages/WalletsPage';
|
|
21
24
|
import { useAppStore } from '../../store/AppStore';
|
|
22
25
|
import { useUiStore } from '../../store/ui';
|
|
23
26
|
import { useWalletsStore } from '../../store/wallets';
|
|
@@ -28,35 +31,77 @@ import {
|
|
|
28
31
|
isExperimentalChain,
|
|
29
32
|
} from '../../utils/wallets';
|
|
30
33
|
import { WatermarkedModal } from '../common/WatermarkedModal';
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
+
import { WalletDerivationPathModal } from '../WalletDerivationPathModal';
|
|
35
|
+
import { WalletModal } from '../WalletModal';
|
|
36
|
+
import { WalletNamespacesModal } from '../WalletNamespacesModal';
|
|
34
37
|
|
|
35
38
|
import { ShowMoreWallets } from './ConfirmWallets.styles';
|
|
39
|
+
import {
|
|
40
|
+
LogoContainer,
|
|
41
|
+
Spinner,
|
|
42
|
+
WalletImageContainer,
|
|
43
|
+
} from './WalletList.styles';
|
|
36
44
|
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
interface WalletNamespacesModalState {
|
|
46
|
+
open: boolean;
|
|
47
|
+
providerType: string;
|
|
48
|
+
providerImage: string;
|
|
49
|
+
availableNamespaces?: Namespace[];
|
|
50
|
+
singleNamespace?: boolean;
|
|
51
|
+
}
|
|
39
52
|
|
|
53
|
+
interface DerivationPathModalState {
|
|
54
|
+
open: boolean;
|
|
55
|
+
providerType: string;
|
|
56
|
+
providerImage: string;
|
|
57
|
+
namespace: Namespace;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const ACCOUNT_ADDRESS_MAX_CHARACTERS = 7;
|
|
40
61
|
export function WalletList(props: PropTypes) {
|
|
41
|
-
const { chain, isSelected, selectWallet, limit, onShowMore } =
|
|
62
|
+
const { chain, isSelected, selectWallet, limit, onShowMore, onConnect } =
|
|
63
|
+
props;
|
|
42
64
|
const isActiveTab = useUiStore.use.isActiveTab();
|
|
43
65
|
|
|
44
66
|
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
45
67
|
const { blockchains } = useAppStore();
|
|
46
|
-
const [
|
|
47
|
-
useState<
|
|
68
|
+
const [openWalletStateModal, setOpenWalletStateModal] =
|
|
69
|
+
useState<WalletType>('');
|
|
48
70
|
const [experimentalChainWallet, setExperimentalChainWallet] =
|
|
49
71
|
useState<Wallet | null>(null);
|
|
50
72
|
const [showExperimentalChainModal, setShowExperimentalChainModal] =
|
|
51
73
|
useState(false);
|
|
52
74
|
const [addingExperimentalChainStatus, setAddingExperimentalChainStatus] =
|
|
53
75
|
useState<'in-progress' | 'completed' | 'rejected' | null>(null);
|
|
76
|
+
const [namespacesModalState, setNamespacesModalState] =
|
|
77
|
+
useState<WalletNamespacesModalState | null>(null);
|
|
78
|
+
const [derivationPathModalState, setDerivationPathModalState] =
|
|
79
|
+
useState<DerivationPathModalState | null>(null);
|
|
54
80
|
const { suggestAndConnect } = useWallets();
|
|
55
|
-
|
|
56
|
-
const {
|
|
81
|
+
let modalTimerId: ReturnType<typeof setTimeout> | null = null;
|
|
82
|
+
const {
|
|
83
|
+
list,
|
|
84
|
+
error,
|
|
85
|
+
handleClick,
|
|
86
|
+
disconnectWallet,
|
|
87
|
+
disconnectConnectingWallets,
|
|
88
|
+
} = useWalletList({
|
|
57
89
|
chain,
|
|
90
|
+
onBeforeConnect: (type) => {
|
|
91
|
+
modalTimerId = setTimeout(() => {
|
|
92
|
+
setOpenWalletStateModal(type);
|
|
93
|
+
}, TIME_TO_IGNORE_MODAL);
|
|
94
|
+
},
|
|
95
|
+
onConnect: (type) => {
|
|
96
|
+
onConnect?.(type);
|
|
97
|
+
if (modalTimerId) {
|
|
98
|
+
clearTimeout(modalTimerId);
|
|
99
|
+
}
|
|
100
|
+
setTimeout(() => {
|
|
101
|
+
setOpenWalletStateModal('');
|
|
102
|
+
}, TIME_TO_CLOSE_MODAL);
|
|
103
|
+
},
|
|
58
104
|
});
|
|
59
|
-
|
|
60
105
|
const [sortedList, setSortedList] = useState<WalletInfoWithExtra[]>(list);
|
|
61
106
|
const numberOfSupportedWallets = list.length;
|
|
62
107
|
const shouldShowMoreWallets = limit && numberOfSupportedWallets - limit > 0;
|
|
@@ -72,6 +117,70 @@ export function WalletList(props: PropTypes) {
|
|
|
72
117
|
}
|
|
73
118
|
};
|
|
74
119
|
|
|
120
|
+
const handleCloseNamespaceModal = () => {
|
|
121
|
+
if (namespacesModalState) {
|
|
122
|
+
setNamespacesModalState({
|
|
123
|
+
...namespacesModalState,
|
|
124
|
+
open: false,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const handleCloseDerivationPathModal = () => {
|
|
130
|
+
if (derivationPathModalState) {
|
|
131
|
+
setDerivationPathModalState({
|
|
132
|
+
...derivationPathModalState,
|
|
133
|
+
open: false,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const handleOpenNamespacesModal = (wallet: WalletInfoWithExtra) => {
|
|
139
|
+
setNamespacesModalState({
|
|
140
|
+
open: true,
|
|
141
|
+
providerType: wallet.type,
|
|
142
|
+
providerImage: wallet.image,
|
|
143
|
+
availableNamespaces: wallet.namespaces,
|
|
144
|
+
singleNamespace: wallet.singleNamespace,
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const handleConfirmNamespaces = (selectedNamespaces: Namespace[]) => {
|
|
149
|
+
const wallet = sortedList.find(
|
|
150
|
+
(wallet) => wallet.type === namespacesModalState?.providerType
|
|
151
|
+
);
|
|
152
|
+
if (
|
|
153
|
+
wallet?.singleNamespace && // Currently we support derivation path only for single namespace wallets
|
|
154
|
+
wallet?.needsDerivationPath &&
|
|
155
|
+
selectedNamespaces[0]
|
|
156
|
+
) {
|
|
157
|
+
setDerivationPathModalState({
|
|
158
|
+
open: true,
|
|
159
|
+
providerType: wallet.type,
|
|
160
|
+
providerImage: wallet.image,
|
|
161
|
+
namespace: selectedNamespaces[0],
|
|
162
|
+
});
|
|
163
|
+
} else {
|
|
164
|
+
void handleClick(
|
|
165
|
+
namespacesModalState?.providerType as string,
|
|
166
|
+
selectedNamespaces.map((namespace) => ({
|
|
167
|
+
namespace,
|
|
168
|
+
}))
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
handleCloseNamespaceModal();
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const handleDerivationPathConfirm = (derivationPath: string) => {
|
|
175
|
+
if (derivationPath && derivationPathModalState?.namespace) {
|
|
176
|
+
void handleClick(derivationPathModalState.providerType, [
|
|
177
|
+
{ namespace: derivationPathModalState.namespace, derivationPath },
|
|
178
|
+
]);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
handleCloseDerivationPathModal();
|
|
182
|
+
};
|
|
183
|
+
|
|
75
184
|
useEffect(() => {
|
|
76
185
|
setSortedList((sortedList) => {
|
|
77
186
|
const selectedWalletIndex = list.findIndex((wallet) =>
|
|
@@ -114,6 +223,11 @@ export function WalletList(props: PropTypes) {
|
|
|
114
223
|
};
|
|
115
224
|
}, [addingExperimentalChainStatus]);
|
|
116
225
|
|
|
226
|
+
const handleCloseWalletModal = () => {
|
|
227
|
+
disconnectConnectingWallets();
|
|
228
|
+
setOpenWalletStateModal('');
|
|
229
|
+
};
|
|
230
|
+
|
|
117
231
|
return (
|
|
118
232
|
<>
|
|
119
233
|
{sortedList.slice(0, limit).map((wallet) => {
|
|
@@ -147,14 +261,27 @@ export function WalletList(props: PropTypes) {
|
|
|
147
261
|
: conciseAddress;
|
|
148
262
|
|
|
149
263
|
const onSelectableWalletClick = async () => {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
264
|
+
if (wallet.state === WalletState.DISCONNECTED) {
|
|
265
|
+
if (!!wallet.namespaces?.length) {
|
|
266
|
+
if (wallet.namespaces.length > 1) {
|
|
267
|
+
handleOpenNamespacesModal(wallet);
|
|
268
|
+
} else if (wallet.needsDerivationPath) {
|
|
269
|
+
setDerivationPathModalState({
|
|
270
|
+
open: true,
|
|
271
|
+
providerType: wallet.type,
|
|
272
|
+
providerImage: wallet.image,
|
|
273
|
+
namespace: wallet.namespaces[0],
|
|
274
|
+
});
|
|
275
|
+
} else {
|
|
276
|
+
void handleClick(wallet.type);
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
void handleClick(wallet.type);
|
|
280
|
+
}
|
|
153
281
|
} else if (!!wallet.namespaces && !conciseAddress) {
|
|
154
282
|
// wallet is connected on a different namespace
|
|
155
|
-
await
|
|
156
|
-
|
|
157
|
-
setSelectedWalletToConnect(wallet);
|
|
283
|
+
await disconnectWallet(wallet.type);
|
|
284
|
+
handleOpenNamespacesModal(wallet);
|
|
158
285
|
} else if (couldAddExperimentalChain) {
|
|
159
286
|
setExperimentalChainWallet({
|
|
160
287
|
walletType: wallet.type,
|
|
@@ -180,6 +307,29 @@ export function WalletList(props: PropTypes) {
|
|
|
180
307
|
: undefined;
|
|
181
308
|
return (
|
|
182
309
|
<React.Fragment key={`${wallet.title}_${blockchainDisplayName}`}>
|
|
310
|
+
<WalletModal
|
|
311
|
+
open={openWalletStateModal === wallet.type}
|
|
312
|
+
onClose={handleCloseWalletModal}
|
|
313
|
+
image={wallet.image}
|
|
314
|
+
state={wallet.state}
|
|
315
|
+
error={error}
|
|
316
|
+
/>
|
|
317
|
+
<WalletNamespacesModal
|
|
318
|
+
open={!!namespacesModalState?.open}
|
|
319
|
+
onClose={handleCloseNamespaceModal}
|
|
320
|
+
onConfirm={handleConfirmNamespaces}
|
|
321
|
+
image={namespacesModalState?.providerImage}
|
|
322
|
+
availableNamespaces={namespacesModalState?.availableNamespaces}
|
|
323
|
+
singleNamespace={namespacesModalState?.singleNamespace}
|
|
324
|
+
/>
|
|
325
|
+
<WalletDerivationPathModal
|
|
326
|
+
open={!!derivationPathModalState?.open}
|
|
327
|
+
selectedNamespace={derivationPathModalState?.namespace}
|
|
328
|
+
type={derivationPathModalState?.providerType}
|
|
329
|
+
image={derivationPathModalState?.providerImage}
|
|
330
|
+
onClose={handleCloseDerivationPathModal}
|
|
331
|
+
onConfirm={handleDerivationPathConfirm}
|
|
332
|
+
/>
|
|
183
333
|
{!!experimentalChainWallet && (
|
|
184
334
|
<WatermarkedModal
|
|
185
335
|
open={!!experimentalChainWallet && showExperimentalChainModal}
|
|
@@ -187,12 +337,30 @@ export function WalletList(props: PropTypes) {
|
|
|
187
337
|
onClose={() => {
|
|
188
338
|
setExperimentalChainWallet(null);
|
|
189
339
|
}}>
|
|
190
|
-
<
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}}
|
|
195
|
-
|
|
340
|
+
<MessageBox
|
|
341
|
+
title={i18n.t({
|
|
342
|
+
id: 'Add {blockchainDisplayName} Chain',
|
|
343
|
+
values: { blockchainDisplayName },
|
|
344
|
+
})}
|
|
345
|
+
type="warning"
|
|
346
|
+
description={i18n.t({
|
|
347
|
+
id: 'You should connect a {blockchainDisplayName} supported wallet or choose a different {blockchainDisplayName} address',
|
|
348
|
+
values: { blockchainDisplayName },
|
|
349
|
+
})}>
|
|
350
|
+
<Divider size={18} />
|
|
351
|
+
<Divider size={32} />
|
|
352
|
+
<Button
|
|
353
|
+
onClick={addExperimentalChain.bind(
|
|
354
|
+
null,
|
|
355
|
+
experimentalChainWallet
|
|
356
|
+
)}
|
|
357
|
+
variant="outlined"
|
|
358
|
+
type="primary"
|
|
359
|
+
fullWidth
|
|
360
|
+
size="large">
|
|
361
|
+
{i18n.t('Confirm')}
|
|
362
|
+
</Button>
|
|
363
|
+
</MessageBox>
|
|
196
364
|
</WatermarkedModal>
|
|
197
365
|
)}
|
|
198
366
|
{addingExperimentalChainStatus && (
|
|
@@ -200,11 +368,53 @@ export function WalletList(props: PropTypes) {
|
|
|
200
368
|
open={!!addingExperimentalChainStatus}
|
|
201
369
|
onClose={setAddingExperimentalChainStatus.bind(null, null)}
|
|
202
370
|
container={modalContainer}>
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
371
|
+
{addingExperimentalChainStatus === 'in-progress' && (
|
|
372
|
+
<MessageBox
|
|
373
|
+
type="loading"
|
|
374
|
+
title={i18n.t({
|
|
375
|
+
id: 'Add {blockchainDisplayName} Chain',
|
|
376
|
+
values: { blockchainDisplayName },
|
|
377
|
+
})}
|
|
378
|
+
description={i18n.t({
|
|
379
|
+
id: 'You should connect a {blockchainDisplayName} supported wallet or choose a different {blockchainDisplayName} address',
|
|
380
|
+
values: { blockchainDisplayName },
|
|
381
|
+
})}
|
|
382
|
+
icon={
|
|
383
|
+
<LogoContainer>
|
|
384
|
+
<WalletImageContainer>
|
|
385
|
+
<Image src={wallet.image} size={45} />
|
|
386
|
+
</WalletImageContainer>
|
|
387
|
+
<Spinner />
|
|
388
|
+
</LogoContainer>
|
|
389
|
+
}
|
|
390
|
+
/>
|
|
391
|
+
)}
|
|
392
|
+
|
|
393
|
+
{addingExperimentalChainStatus === 'completed' && (
|
|
394
|
+
<MessageBox
|
|
395
|
+
type="success"
|
|
396
|
+
title={i18n.t({
|
|
397
|
+
id: '{blockchainDisplayName} Chain Added',
|
|
398
|
+
values: { blockchainDisplayName },
|
|
399
|
+
})}
|
|
400
|
+
description={i18n.t({
|
|
401
|
+
id: '{blockchainDisplayName} is added to your wallet, you can use it to swap.',
|
|
402
|
+
values: { blockchainDisplayName },
|
|
403
|
+
})}
|
|
404
|
+
/>
|
|
405
|
+
)}
|
|
406
|
+
|
|
407
|
+
{addingExperimentalChainStatus === 'rejected' && (
|
|
408
|
+
<MessageBox
|
|
409
|
+
type="error"
|
|
410
|
+
title={i18n.t('Request Rejected')}
|
|
411
|
+
description={i18n.t({
|
|
412
|
+
id: "You've rejected adding {blockchainDisplayName} chain to your wallet.",
|
|
413
|
+
values: { blockchainDisplayName },
|
|
414
|
+
})}
|
|
415
|
+
/>
|
|
416
|
+
)}
|
|
417
|
+
|
|
208
418
|
<Divider direction="vertical" size={32} />
|
|
209
419
|
</WatermarkedModal>
|
|
210
420
|
)}
|
|
@@ -219,25 +429,6 @@ export function WalletList(props: PropTypes) {
|
|
|
219
429
|
</React.Fragment>
|
|
220
430
|
);
|
|
221
431
|
})}
|
|
222
|
-
<StatefulConnectModal
|
|
223
|
-
wallet={selectedWalletToConnect}
|
|
224
|
-
onClose={() => {
|
|
225
|
-
setSelectedWalletToConnect(undefined);
|
|
226
|
-
}}
|
|
227
|
-
onConnect={(result) => {
|
|
228
|
-
if (props.onConnect && result.status === ResultStatus.Connected) {
|
|
229
|
-
if (selectedWalletToConnect?.type) {
|
|
230
|
-
props.onConnect(selectedWalletToConnect.type);
|
|
231
|
-
} else {
|
|
232
|
-
warn(
|
|
233
|
-
new Error(
|
|
234
|
-
"The selected wallet hasn't been detected after the connection process finished. It usually shouldn't happen."
|
|
235
|
-
)
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
}}
|
|
240
|
-
/>
|
|
241
432
|
{shouldShowMoreWallets && (
|
|
242
433
|
<ShowMoreWallets selected={false} onClick={onShowMore}>
|
|
243
434
|
<Typography variant="label" size="medium">
|
|
@@ -16,8 +16,10 @@ import React, { useEffect, useRef } from 'react';
|
|
|
16
16
|
|
|
17
17
|
import { useAppStore } from '../../store/AppStore';
|
|
18
18
|
import { useQuoteStore } from '../../store/quote';
|
|
19
|
-
import {
|
|
20
|
-
|
|
19
|
+
import {
|
|
20
|
+
getBlockchainDisplayNameFor,
|
|
21
|
+
isValidTokenAddress,
|
|
22
|
+
} from '../../utils/meta';
|
|
21
23
|
import { CustomCollapsible } from '../CustomCollapsible/CustomCollapsible';
|
|
22
24
|
import { ExpandedIcon } from '../CustomCollapsible/CustomCollapsible.styles';
|
|
23
25
|
|
|
@@ -44,7 +46,7 @@ export function CustomDestination(props: PropTypes) {
|
|
|
44
46
|
const isFirefox = navigator?.userAgent.includes('Firefox');
|
|
45
47
|
const isAddressChecked = open && !!customDestination && blockchain;
|
|
46
48
|
const isAddressInvalid =
|
|
47
|
-
isAddressChecked && !
|
|
49
|
+
isAddressChecked && !isValidTokenAddress(blockchain, customDestination);
|
|
48
50
|
const handleClear = () => {
|
|
49
51
|
setCustomDestination('');
|
|
50
52
|
};
|