@lifi/widget 4.0.0-beta.1 → 4.0.0-beta.11
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/dist/esm/App.d.ts +9 -3
- package/dist/esm/App.d.ts.map +1 -0
- package/dist/esm/App.js +42 -24
- package/dist/esm/App.js.map +1 -1
- package/dist/esm/AppDefault.js +150 -172
- package/dist/esm/AppDefault.js.map +1 -1
- package/dist/esm/AppDrawer.d.ts +11 -9
- package/dist/esm/AppDrawer.d.ts.map +1 -0
- package/dist/esm/AppDrawer.js +61 -50
- package/dist/esm/AppDrawer.js.map +1 -1
- package/dist/esm/AppDrawerContext.js +7 -3
- package/dist/esm/AppDrawerContext.js.map +1 -1
- package/dist/esm/AppLayout.js +31 -17
- package/dist/esm/AppLayout.js.map +1 -1
- package/dist/esm/AppProvider.js +28 -14
- package/dist/esm/AppProvider.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.js +115 -111
- package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.js +34 -42
- package/dist/esm/components/AmountInput/AmountInput.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js +62 -53
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.style.js +21 -0
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.style.js.map +1 -0
- package/dist/esm/components/AmountInput/AmountInputStartAdornment.js +19 -13
- package/dist/esm/components/AmountInput/AmountInputStartAdornment.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.js +94 -69
- package/dist/esm/components/AmountInput/PriceFormHelperText.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.style.js +26 -30
- package/dist/esm/components/AmountInput/PriceFormHelperText.style.js.map +1 -1
- package/dist/esm/components/AppContainer.js +90 -111
- package/dist/esm/components/AppContainer.js.map +1 -1
- package/dist/esm/components/Avatar/AccountAvatar.js +27 -11
- package/dist/esm/components/Avatar/AccountAvatar.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.js +42 -10
- package/dist/esm/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.style.js +50 -62
- package/dist/esm/components/Avatar/Avatar.style.js.map +1 -1
- package/dist/esm/components/Avatar/ChainBadgeContent.js +15 -8
- package/dist/esm/components/Avatar/ChainBadgeContent.js.map +1 -1
- package/dist/esm/components/Avatar/SmallAvatar.js +17 -11
- package/dist/esm/components/Avatar/SmallAvatar.js.map +1 -1
- package/dist/esm/components/Avatar/TokenAvatar.js +59 -16
- package/dist/esm/components/Avatar/TokenAvatar.js.map +1 -1
- package/dist/esm/components/Avatar/utils.js +6 -3
- package/dist/esm/components/Avatar/utils.js.map +1 -1
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js +48 -43
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js.map +1 -1
- package/dist/esm/components/BottomSheet/BottomSheet.js +44 -31
- package/dist/esm/components/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/esm/components/ButtonTertiary.js +19 -25
- package/dist/esm/components/ButtonTertiary.js.map +1 -1
- package/dist/esm/components/Card/Card.js +63 -69
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/Card/CardButton.js +12 -4
- package/dist/esm/components/Card/CardButton.js.map +1 -1
- package/dist/esm/components/Card/CardButton.style.js +25 -21
- package/dist/esm/components/Card/CardButton.style.js.map +1 -1
- package/dist/esm/components/Card/CardHeader.js +24 -20
- package/dist/esm/components/Card/CardHeader.js.map +1 -1
- package/dist/esm/components/Card/CardIconButton.js +12 -10
- package/dist/esm/components/Card/CardIconButton.js.map +1 -1
- package/dist/esm/components/Card/CardLabel.js +59 -58
- package/dist/esm/components/Card/CardLabel.js.map +1 -1
- package/dist/esm/components/Card/CardTitle.js +20 -24
- package/dist/esm/components/Card/CardTitle.js.map +1 -1
- package/dist/esm/components/Card/InputCard.js +9 -5
- package/dist/esm/components/Card/InputCard.js.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.js +121 -59
- package/dist/esm/components/ChainSelect/ChainSelect.js.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.style.js +51 -56
- package/dist/esm/components/ChainSelect/ChainSelect.style.js.map +1 -1
- package/dist/esm/components/ChainSelect/useChainSelect.js +57 -73
- package/dist/esm/components/ChainSelect/useChainSelect.js.map +1 -1
- package/dist/esm/components/Chains/AllChainsAvatar.js +95 -98
- package/dist/esm/components/Chains/AllChainsAvatar.js.map +1 -1
- package/dist/esm/components/Chains/ChainList.js +51 -16
- package/dist/esm/components/Chains/ChainList.js.map +1 -1
- package/dist/esm/components/Chains/ChainList.style.js +38 -40
- package/dist/esm/components/Chains/ChainList.style.js.map +1 -1
- package/dist/esm/components/Chains/ChainListItem.js +53 -21
- package/dist/esm/components/Chains/ChainListItem.js.map +1 -1
- package/dist/esm/components/Chains/ChainSearchInput.js +37 -23
- package/dist/esm/components/Chains/ChainSearchInput.js.map +1 -1
- package/dist/esm/components/Chains/ChainsExpanded.js +24 -10
- package/dist/esm/components/Chains/ChainsExpanded.js.map +1 -1
- package/dist/esm/components/Chains/ChainsExpanded.style.js +17 -15
- package/dist/esm/components/Chains/ChainsExpanded.style.js.map +1 -1
- package/dist/esm/components/Chains/PinChainButton.js +40 -31
- package/dist/esm/components/Chains/PinChainButton.js.map +1 -1
- package/dist/esm/components/Chains/SelectChainContent.js +76 -58
- package/dist/esm/components/Chains/SelectChainContent.js.map +1 -1
- package/dist/esm/components/Chains/VirtualizedChainList.js +141 -118
- package/dist/esm/components/Chains/VirtualizedChainList.js.map +1 -1
- package/dist/esm/components/ContextMenu.js +59 -0
- package/dist/esm/components/ContextMenu.js.map +1 -0
- package/dist/esm/components/ContextMenu.style.js +12 -0
- package/dist/esm/components/ContextMenu.style.js.map +1 -0
- package/dist/esm/components/ContractComponent/ContractComponent.js +12 -7
- package/dist/esm/components/ContractComponent/ContractComponent.js.map +1 -1
- package/dist/esm/components/ContractComponent/ItemPrice.d.ts +11 -6
- package/dist/esm/components/ContractComponent/ItemPrice.d.ts.map +1 -0
- package/dist/esm/components/ContractComponent/ItemPrice.js +27 -22
- package/dist/esm/components/ContractComponent/ItemPrice.js.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFT.d.ts +7 -2
- package/dist/esm/components/ContractComponent/NFT/NFT.d.ts.map +1 -0
- package/dist/esm/components/ContractComponent/NFT/NFT.js +31 -22
- package/dist/esm/components/ContractComponent/NFT/NFT.js.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFT.style.js +10 -6
- package/dist/esm/components/ContractComponent/NFT/NFT.style.js.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/NFTBase.d.ts +7 -2
- package/dist/esm/components/ContractComponent/NFT/NFTBase.d.ts.map +1 -0
- package/dist/esm/components/ContractComponent/NFT/NFTBase.js +74 -23
- package/dist/esm/components/ContractComponent/NFT/NFTBase.js.map +1 -1
- package/dist/esm/components/ContractComponent/NFT/types.d.ts +18 -13
- package/dist/esm/components/ContractComponent/NFT/types.d.ts.map +1 -0
- package/dist/esm/components/Dialog/Dialog.js +36 -0
- package/dist/esm/components/Dialog/Dialog.js.map +1 -0
- package/dist/esm/components/Dialog/Dialog.style.js +42 -0
- package/dist/esm/components/Dialog/Dialog.style.js.map +1 -0
- package/dist/esm/components/Expansion/Expansion.js +30 -28
- package/dist/esm/components/Expansion/Expansion.js.map +1 -1
- package/dist/esm/components/Expansion/Expansion.style.js +36 -36
- package/dist/esm/components/Expansion/Expansion.style.js.map +1 -1
- package/dist/esm/components/Expansion/ExpansionTransition.js +30 -14
- package/dist/esm/components/Expansion/ExpansionTransition.js.map +1 -1
- package/dist/esm/components/FeeBreakdownTooltip.js +37 -15
- package/dist/esm/components/FeeBreakdownTooltip.js.map +1 -1
- package/dist/esm/components/FullPageContainer.js +11 -8
- package/dist/esm/components/FullPageContainer.js.map +1 -1
- package/dist/esm/components/Header/ActivitiesButton.js +60 -0
- package/dist/esm/components/Header/ActivitiesButton.js.map +1 -0
- package/dist/esm/components/Header/ActivitiesButton.style.js +39 -0
- package/dist/esm/components/Header/ActivitiesButton.style.js.map +1 -0
- package/dist/esm/components/Header/BackButton.js +22 -20
- package/dist/esm/components/Header/BackButton.js.map +1 -1
- package/dist/esm/components/Header/CloseDrawerButton.js +22 -13
- package/dist/esm/components/Header/CloseDrawerButton.js.map +1 -1
- package/dist/esm/components/Header/DisconnectIconButton.js +18 -10
- package/dist/esm/components/Header/DisconnectIconButton.js.map +1 -1
- package/dist/esm/components/Header/Header.js +40 -35
- package/dist/esm/components/Header/Header.js.map +1 -1
- package/dist/esm/components/Header/Header.style.js +64 -88
- package/dist/esm/components/Header/Header.style.js.map +1 -1
- package/dist/esm/components/Header/NavigationHeader.js +61 -41
- package/dist/esm/components/Header/NavigationHeader.js.map +1 -1
- package/dist/esm/components/Header/SettingsButton.js +30 -21
- package/dist/esm/components/Header/SettingsButton.js.map +1 -1
- package/dist/esm/components/Header/SettingsButton.style.js +35 -44
- package/dist/esm/components/Header/SettingsButton.style.js.map +1 -1
- package/dist/esm/components/Header/SplitNavigationTabs.js +31 -19
- package/dist/esm/components/Header/SplitNavigationTabs.js.map +1 -1
- package/dist/esm/components/Header/WalletHeader.js +109 -65
- package/dist/esm/components/Header/WalletHeader.js.map +1 -1
- package/dist/esm/components/Header/WalletMenu.js +98 -47
- package/dist/esm/components/Header/WalletMenu.js.map +1 -1
- package/dist/esm/components/Header/WalletMenu.style.js +24 -24
- package/dist/esm/components/Header/WalletMenu.style.js.map +1 -1
- package/dist/esm/components/IconCircle/IconCircle.js +19 -0
- package/dist/esm/components/IconCircle/IconCircle.js.map +1 -0
- package/dist/esm/components/IconCircle/IconCircle.style.js +57 -0
- package/dist/esm/components/IconCircle/IconCircle.style.js.map +1 -0
- package/dist/esm/components/IconCircle/statusIcons.js +15 -0
- package/dist/esm/components/IconCircle/statusIcons.js.map +1 -0
- package/dist/esm/components/IconTypography.js +9 -7
- package/dist/esm/components/IconTypography.js.map +1 -1
- package/dist/esm/components/Initializer.js +8 -4
- package/dist/esm/components/Initializer.js.map +1 -1
- package/dist/esm/components/Input.js +13 -9
- package/dist/esm/components/Input.js.map +1 -1
- package/dist/esm/components/ListItem/ListItem.js +21 -19
- package/dist/esm/components/ListItem/ListItem.js.map +1 -1
- package/dist/esm/components/ListItem/ListItemButton.js +11 -7
- package/dist/esm/components/ListItem/ListItemButton.js.map +1 -1
- package/dist/esm/components/ListItemButton.js +28 -34
- package/dist/esm/components/ListItemButton.js.map +1 -1
- package/dist/esm/components/ListItemText.js +6 -6
- package/dist/esm/components/ListItemText.js.map +1 -1
- package/dist/esm/components/Menu.js +20 -20
- package/dist/esm/components/Menu.js.map +1 -1
- package/dist/esm/components/Messages/AccountDeployedMessage.js +25 -11
- package/dist/esm/components/Messages/AccountDeployedMessage.js.map +1 -1
- package/dist/esm/components/Messages/AccountNotDeployedMessage.js +22 -8
- package/dist/esm/components/Messages/AccountNotDeployedMessage.js.map +1 -1
- package/dist/esm/components/Messages/AlertMessage.js +15 -3
- package/dist/esm/components/Messages/AlertMessage.js.map +1 -1
- package/dist/esm/components/Messages/AlertMessage.style.js +35 -51
- package/dist/esm/components/Messages/AlertMessage.style.js.map +1 -1
- package/dist/esm/components/Messages/FundsSufficiencyMessage.js +22 -10
- package/dist/esm/components/Messages/FundsSufficiencyMessage.js.map +1 -1
- package/dist/esm/components/Messages/GasRefuelMessage.js +61 -31
- package/dist/esm/components/Messages/GasRefuelMessage.js.map +1 -1
- package/dist/esm/components/Messages/GasRefuelMessage.style.js +16 -20
- package/dist/esm/components/Messages/GasRefuelMessage.style.js.map +1 -1
- package/dist/esm/components/Messages/GasSufficiencyMessage.js +41 -21
- package/dist/esm/components/Messages/GasSufficiencyMessage.js.map +1 -1
- package/dist/esm/components/Messages/MinFromAmountUSDMessage.js +25 -13
- package/dist/esm/components/Messages/MinFromAmountUSDMessage.js.map +1 -1
- package/dist/esm/components/Messages/MissingRouteRequiredAccountMessage.js +29 -18
- package/dist/esm/components/Messages/MissingRouteRequiredAccountMessage.js.map +1 -1
- package/dist/esm/components/Messages/WarningMessages.js +43 -33
- package/dist/esm/components/Messages/WarningMessages.js.map +1 -1
- package/dist/esm/components/Messages/useMessageQueue.js +66 -82
- package/dist/esm/components/Messages/useMessageQueue.js.map +1 -1
- package/dist/esm/components/NotFound.js +42 -24
- package/dist/esm/components/NotFound.js.map +1 -1
- package/dist/esm/components/PageContainer.js +18 -16
- package/dist/esm/components/PageContainer.js.map +1 -1
- package/dist/esm/components/PageEntered.js +15 -11
- package/dist/esm/components/PageEntered.js.map +1 -1
- package/dist/esm/components/PoweredBy/PoweredBy.js +55 -32
- package/dist/esm/components/PoweredBy/PoweredBy.js.map +1 -1
- package/dist/esm/components/PoweredBy/PoweredBy.style.js +10 -8
- package/dist/esm/components/PoweredBy/PoweredBy.style.js.map +1 -1
- package/dist/esm/components/ProgressToNextUpdate.js +64 -47
- package/dist/esm/components/ProgressToNextUpdate.js.map +1 -1
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js +37 -40
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.style.js +29 -25
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.style.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCard.js +85 -67
- package/dist/esm/components/RouteCard/RouteCard.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCardEssentials.js +81 -45
- package/dist/esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCardSkeleton.js +51 -21
- package/dist/esm/components/RouteCard/RouteCardSkeleton.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteDetails.js +100 -0
- package/dist/esm/components/RouteCard/RouteDetails.js.map +1 -0
- package/dist/esm/components/RouteCard/RouteDetails.style.js +35 -0
- package/dist/esm/components/RouteCard/RouteDetails.style.js.map +1 -0
- package/dist/esm/components/RouteCard/RouteNotFoundCard.js +43 -25
- package/dist/esm/components/RouteCard/RouteNotFoundCard.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteToken.js +50 -0
- package/dist/esm/components/RouteCard/RouteToken.js.map +1 -0
- package/dist/esm/components/RouteCard/RouteToken.style.js +11 -0
- package/dist/esm/components/RouteCard/RouteToken.style.js.map +1 -0
- package/dist/esm/components/RouteCard/RouteTokens.js +50 -0
- package/dist/esm/components/RouteCard/RouteTokens.js.map +1 -0
- package/dist/esm/components/RouteCard/getMatchingLabels.js +21 -34
- package/dist/esm/components/RouteCard/getMatchingLabels.js.map +1 -1
- package/dist/esm/components/Routes/Routes.js +68 -43
- package/dist/esm/components/Routes/Routes.js.map +1 -1
- package/dist/esm/components/Routes/RoutesContent.js +71 -38
- package/dist/esm/components/Routes/RoutesContent.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.js +67 -51
- package/dist/esm/components/Routes/RoutesExpanded.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.style.js +32 -32
- package/dist/esm/components/Routes/RoutesExpanded.style.js.map +1 -1
- package/dist/esm/components/Search/SearchInput.js +54 -22
- package/dist/esm/components/Search/SearchInput.js.map +1 -1
- package/dist/esm/components/Search/SearchInput.style.js +45 -59
- package/dist/esm/components/Search/SearchInput.style.js.map +1 -1
- package/dist/esm/components/Search/SearchNotFound.js +11 -4
- package/dist/esm/components/Search/SearchNotFound.js.map +1 -1
- package/dist/esm/components/Search/SearchNotFound.style.js +25 -26
- package/dist/esm/components/Search/SearchNotFound.style.js.map +1 -1
- package/dist/esm/components/SelectChainAndToken.js +32 -28
- package/dist/esm/components/SelectChainAndToken.js.map +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.js +68 -55
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.js.map +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js +87 -107
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.js +114 -98
- package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.style.js +53 -0
- package/dist/esm/components/SendToWallet/SendToWalletButton.style.js.map +1 -0
- package/dist/esm/components/SendToWallet/SendToWalletExpandButton.js +48 -39
- package/dist/esm/components/SendToWallet/SendToWalletExpandButton.js.map +1 -1
- package/dist/esm/components/SettingsListItemButton.js +7 -5
- package/dist/esm/components/SettingsListItemButton.js.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.d.ts +10 -2
- package/dist/esm/components/Skeleton/WidgetSkeleton.d.ts.map +1 -0
- package/dist/esm/components/Skeleton/WidgetSkeleton.js +119 -26
- package/dist/esm/components/Skeleton/WidgetSkeleton.js.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.js +63 -63
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.js.map +1 -1
- package/dist/esm/components/Step/CircularProgress.js +43 -24
- package/dist/esm/components/Step/CircularProgress.js.map +1 -1
- package/dist/esm/components/Step/CircularProgress.style.js +40 -51
- package/dist/esm/components/Step/CircularProgress.style.js.map +1 -1
- package/dist/esm/components/Step/DestinationWalletAddress.js +55 -31
- package/dist/esm/components/Step/DestinationWalletAddress.js.map +1 -1
- package/dist/esm/components/Step/Step.js +90 -71
- package/dist/esm/components/Step/Step.js.map +1 -1
- package/dist/esm/components/Step/StepAction.js +64 -43
- package/dist/esm/components/Step/StepAction.js.map +1 -1
- package/dist/esm/components/Step/StepActions.js +199 -0
- package/dist/esm/components/Step/StepActions.js.map +1 -0
- package/dist/esm/components/Step/StepActions.style.js +27 -0
- package/dist/esm/components/Step/StepActions.style.js.map +1 -0
- package/dist/esm/components/Step/StepList.js +34 -32
- package/dist/esm/components/Step/StepList.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.js +188 -142
- package/dist/esm/components/StepActions/StepActions.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.style.js +57 -58
- package/dist/esm/components/StepActions/StepActions.style.js.map +1 -1
- package/dist/esm/components/StepDivider/StepDivider.js +12 -5
- package/dist/esm/components/StepDivider/StepDivider.js.map +1 -1
- package/dist/esm/components/StepDivider/StepDivider.style.js +10 -6
- package/dist/esm/components/StepDivider/StepDivider.style.js.map +1 -1
- package/dist/esm/components/Switch.js +45 -49
- package/dist/esm/components/Switch.js.map +1 -1
- package/dist/esm/components/Tabs/NavigationTabs.js +34 -34
- package/dist/esm/components/Tabs/NavigationTabs.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.style.js +28 -34
- package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
- package/dist/esm/components/TextFitter/TextFitter.js +58 -52
- package/dist/esm/components/TextFitter/TextFitter.js.map +1 -1
- package/dist/esm/components/Timer/StepTimer.js +38 -52
- package/dist/esm/components/Timer/StepTimer.js.map +1 -1
- package/dist/esm/components/Timer/TimerContent.js +38 -15
- package/dist/esm/components/Timer/TimerContent.js.map +1 -1
- package/dist/esm/components/Token/Token.js +200 -102
- package/dist/esm/components/Token/Token.js.map +1 -1
- package/dist/esm/components/Token/Token.style.js +27 -30
- package/dist/esm/components/Token/Token.style.js.map +1 -1
- package/dist/esm/components/TokenList/PinTokenButton.js +34 -27
- package/dist/esm/components/TokenList/PinTokenButton.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheet.js +35 -22
- package/dist/esm/components/TokenList/TokenDetailsSheet.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js +172 -87
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js +27 -23
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.js +63 -39
- package/dist/esm/components/TokenList/TokenList.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.style.js +26 -26
- package/dist/esm/components/TokenList/TokenList.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenListItem.js +265 -121
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/TokenNotFound.js +10 -6
- package/dist/esm/components/TokenList/TokenNotFound.js.map +1 -1
- package/dist/esm/components/TokenList/VirtualizedTokenList.js +120 -140
- package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/dist/esm/components/TokenList/useTokenSelect.js +76 -88
- package/dist/esm/components/TokenList/useTokenSelect.js.map +1 -1
- package/dist/esm/components/TokenRate/TokenRate.js +34 -35
- package/dist/esm/components/TokenRate/TokenRate.js.map +1 -1
- package/dist/esm/components/TokenRate/TokenRate.style.js +17 -15
- package/dist/esm/components/TokenRate/TokenRate.style.js.map +1 -1
- package/dist/esm/components/Tools/ToolItem.js +35 -14
- package/dist/esm/components/Tools/ToolItem.js.map +1 -1
- package/dist/esm/components/Tools/Tools.js +46 -30
- package/dist/esm/components/Tools/Tools.js.map +1 -1
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.js +78 -0
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.js.map +1 -0
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.style.js +30 -0
- package/dist/esm/components/TransactionCard/ActiveTransactionCard.style.js.map +1 -0
- package/dist/esm/components/TransactionCard/TransactionCard.js +32 -0
- package/dist/esm/components/TransactionCard/TransactionCard.js.map +1 -0
- package/dist/esm/components/TransactionCard/TransactionCard.style.js +14 -0
- package/dist/esm/components/TransactionCard/TransactionCard.style.js.map +1 -0
- package/dist/esm/components/TransactionCard/TransactionCardSkeleton.js +63 -0
- package/dist/esm/components/TransactionCard/TransactionCardSkeleton.js.map +1 -0
- package/dist/esm/components/TransactionDetails.js +260 -115
- package/dist/esm/components/TransactionDetails.js.map +1 -1
- package/dist/esm/config/constants.d.ts +5 -2
- package/dist/esm/config/constants.d.ts.map +1 -0
- package/dist/esm/config/constants.js +6 -2
- package/dist/esm/config/constants.js.map +1 -1
- package/dist/esm/config/queryClient.js +17 -20
- package/dist/esm/config/queryClient.js.map +1 -1
- package/dist/esm/config/version.d.ts +6 -2
- package/dist/esm/config/version.d.ts.map +1 -0
- package/dist/esm/config/version.js +6 -2
- package/dist/esm/config/version.js.map +1 -1
- package/dist/esm/hooks/timer/time.js +23 -22
- package/dist/esm/hooks/timer/time.js.map +1 -1
- package/dist/esm/hooks/timer/useExecutionTimer.js +29 -0
- package/dist/esm/hooks/timer/useExecutionTimer.js.map +1 -0
- package/dist/esm/hooks/timer/useInterval.js +17 -16
- package/dist/esm/hooks/timer/useInterval.js.map +1 -1
- package/dist/esm/hooks/timer/useTimer.js +64 -65
- package/dist/esm/hooks/timer/useTimer.js.map +1 -1
- package/dist/esm/hooks/timer/validate.js +12 -12
- package/dist/esm/hooks/timer/validate.js.map +1 -1
- package/dist/esm/hooks/useAccountsBalancesData.js +66 -60
- package/dist/esm/hooks/useAccountsBalancesData.js.map +1 -1
- package/dist/esm/hooks/useActionMessage.js +16 -16
- package/dist/esm/hooks/useActionMessage.js.map +1 -1
- package/dist/esm/hooks/useAddressActivity.js +34 -30
- package/dist/esm/hooks/useAddressActivity.js.map +1 -1
- package/dist/esm/hooks/useAddressValidation.js +53 -57
- package/dist/esm/hooks/useAddressValidation.js.map +1 -1
- package/dist/esm/hooks/useAvailableChains.js +64 -73
- package/dist/esm/hooks/useAvailableChains.js.map +1 -1
- package/dist/esm/hooks/useChain.js +13 -10
- package/dist/esm/hooks/useChain.js.map +1 -1
- package/dist/esm/hooks/useChains.js +24 -21
- package/dist/esm/hooks/useChains.js.map +1 -1
- package/dist/esm/hooks/useContactSupport.js +15 -0
- package/dist/esm/hooks/useContactSupport.js.map +1 -0
- package/dist/esm/hooks/useDebouncedWatch.js +26 -24
- package/dist/esm/hooks/useDebouncedWatch.js.map +1 -1
- package/dist/esm/hooks/useDefaultElementId.js +8 -4
- package/dist/esm/hooks/useDefaultElementId.js.map +1 -1
- package/dist/esm/hooks/useExplorer.js +43 -53
- package/dist/esm/hooks/useExplorer.js.map +1 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.js +69 -85
- package/dist/esm/hooks/useFilteredByTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useFromAmountThreshold.js +27 -21
- package/dist/esm/hooks/useFromAmountThreshold.js.map +1 -1
- package/dist/esm/hooks/useFromTokenSufficiency.js +54 -62
- package/dist/esm/hooks/useFromTokenSufficiency.js.map +1 -1
- package/dist/esm/hooks/useGasRecommendation.js +37 -40
- package/dist/esm/hooks/useGasRecommendation.js.map +1 -1
- package/dist/esm/hooks/useGasRefuel.js +44 -60
- package/dist/esm/hooks/useGasRefuel.js.map +1 -1
- package/dist/esm/hooks/useGasSufficiency.js +103 -148
- package/dist/esm/hooks/useGasSufficiency.js.map +1 -1
- package/dist/esm/hooks/useHasChainExpansion.js +15 -22
- package/dist/esm/hooks/useHasChainExpansion.js.map +1 -1
- package/dist/esm/hooks/useHeader.js +21 -17
- package/dist/esm/hooks/useHeader.js.map +1 -1
- package/dist/esm/hooks/useInitializeSDKProviders.js +13 -9
- package/dist/esm/hooks/useInitializeSDKProviders.js.map +1 -1
- package/dist/esm/hooks/useInitializer.js +16 -12
- package/dist/esm/hooks/useInitializer.js.map +1 -1
- package/dist/esm/hooks/useIsBatchingSupported.js +35 -31
- package/dist/esm/hooks/useIsBatchingSupported.js.map +1 -1
- package/dist/esm/hooks/useIsContractAddress.js +28 -21
- package/dist/esm/hooks/useIsContractAddress.js.map +1 -1
- package/dist/esm/hooks/useLanguages.js +51 -60
- package/dist/esm/hooks/useLanguages.js.map +1 -1
- package/dist/esm/hooks/useListHeight.js +46 -59
- package/dist/esm/hooks/useListHeight.js.map +1 -1
- package/dist/esm/hooks/useLongPress.js +38 -39
- package/dist/esm/hooks/useLongPress.js.map +1 -1
- package/dist/esm/hooks/useNavigateBack.js +16 -14
- package/dist/esm/hooks/useNavigateBack.js.map +1 -1
- package/dist/esm/hooks/useRouteExecution.js +159 -189
- package/dist/esm/hooks/useRouteExecution.js.map +1 -1
- package/dist/esm/hooks/useRouteRequiredAccountConnection.js +35 -43
- package/dist/esm/hooks/useRouteRequiredAccountConnection.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +302 -393
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useScrollableContainer.js +25 -28
- package/dist/esm/hooks/useScrollableContainer.js.map +1 -1
- package/dist/esm/hooks/useSetContentHeight.js +21 -21
- package/dist/esm/hooks/useSetContentHeight.js.map +1 -1
- package/dist/esm/hooks/useSettingMonitor.js +49 -53
- package/dist/esm/hooks/useSettingMonitor.js.map +1 -1
- package/dist/esm/hooks/useSwapOnly.js +7 -4
- package/dist/esm/hooks/useSwapOnly.js.map +1 -1
- package/dist/esm/hooks/useToAddressAutoPopulate.js +48 -67
- package/dist/esm/hooks/useToAddressAutoPopulate.js.map +1 -1
- package/dist/esm/hooks/useToAddressRequirements.js +40 -56
- package/dist/esm/hooks/useToAddressRequirements.js.map +1 -1
- package/dist/esm/hooks/useToAddressReset.js +28 -43
- package/dist/esm/hooks/useToAddressReset.js.map +1 -1
- package/dist/esm/hooks/useToken.js +21 -18
- package/dist/esm/hooks/useToken.js.map +1 -1
- package/dist/esm/hooks/useTokenAddressBalance.js +19 -15
- package/dist/esm/hooks/useTokenAddressBalance.js.map +1 -1
- package/dist/esm/hooks/useTokenBalance.js +90 -89
- package/dist/esm/hooks/useTokenBalance.js.map +1 -1
- package/dist/esm/hooks/useTokenBalances.js +110 -127
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenBalancesQueries.js +61 -74
- package/dist/esm/hooks/useTokenBalancesQueries.js.map +1 -1
- package/dist/esm/hooks/useTokenRateText.js +36 -0
- package/dist/esm/hooks/useTokenRateText.js.map +1 -0
- package/dist/esm/hooks/useTokenSearch.js +46 -53
- package/dist/esm/hooks/useTokenSearch.js.map +1 -1
- package/dist/esm/hooks/useTokens.js +96 -103
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/hooks/useTools.js +40 -36
- package/dist/esm/hooks/useTools.js.map +1 -1
- package/dist/esm/hooks/useTransactionDetails.js +47 -60
- package/dist/esm/hooks/useTransactionDetails.js.map +1 -1
- package/dist/esm/hooks/useTransactionHistory.js +66 -59
- package/dist/esm/hooks/useTransactionHistory.js.map +1 -1
- package/dist/esm/hooks/useTransactionList.js +58 -0
- package/dist/esm/hooks/useTransactionList.js.map +1 -0
- package/dist/esm/hooks/useWideVariant.js +10 -6
- package/dist/esm/hooks/useWideVariant.js.map +1 -1
- package/dist/esm/hooks/useWidgetChains.d.ts +11 -5
- package/dist/esm/hooks/useWidgetChains.d.ts.map +1 -0
- package/dist/esm/hooks/useWidgetChains.js +7 -3
- package/dist/esm/hooks/useWidgetChains.js.map +1 -1
- package/dist/esm/hooks/useWidgetEvents.d.ts +9 -4
- package/dist/esm/hooks/useWidgetEvents.d.ts.map +1 -0
- package/dist/esm/hooks/useWidgetEvents.js +7 -6
- package/dist/esm/hooks/useWidgetEvents.js.map +1 -1
- package/dist/esm/i18n/bn.json +345 -346
- package/dist/esm/i18n/de.json +345 -346
- package/dist/esm/i18n/en.json +345 -346
- package/dist/esm/i18n/es.json +345 -346
- package/dist/esm/i18n/fr.json +345 -346
- package/dist/esm/i18n/hi.json +345 -346
- package/dist/esm/i18n/id.json +345 -346
- package/dist/esm/i18n/it.json +345 -346
- package/dist/esm/i18n/ja.json +345 -346
- package/dist/esm/i18n/ko.json +345 -346
- package/dist/esm/i18n/pl.json +345 -346
- package/dist/esm/i18n/pt.json +345 -346
- package/dist/esm/i18n/th.json +345 -346
- package/dist/esm/i18n/tr.json +345 -346
- package/dist/esm/i18n/uk.json +345 -346
- package/dist/esm/i18n/vi.json +345 -346
- package/dist/esm/i18n/zh.json +345 -346
- package/dist/esm/icons/lifi.js +5 -1
- package/dist/esm/icons/lifi.js.map +1 -1
- package/dist/esm/index.d.ts +33 -33
- package/dist/esm/index.js +28 -31
- package/dist/esm/pages/ActivitiesPage/ActiveTransactionItem.js +36 -0
- package/dist/esm/pages/ActivitiesPage/ActiveTransactionItem.js.map +1 -0
- package/dist/esm/pages/ActivitiesPage/ActivitiesPage.js +102 -0
- package/dist/esm/pages/ActivitiesPage/ActivitiesPage.js.map +1 -0
- package/dist/esm/pages/ActivitiesPage/ActivitiesPageMenuButton.js +55 -0
- package/dist/esm/pages/ActivitiesPage/ActivitiesPageMenuButton.js.map +1 -0
- package/dist/esm/pages/ActivitiesPage/TransactionHistoryEmpty.js +44 -0
- package/dist/esm/pages/ActivitiesPage/TransactionHistoryEmpty.js.map +1 -0
- package/dist/esm/pages/ActivitiesPage/TransactionHistoryItem.js +24 -0
- package/dist/esm/pages/ActivitiesPage/TransactionHistoryItem.js.map +1 -0
- package/dist/esm/pages/LanguagesPage.js +34 -27
- package/dist/esm/pages/LanguagesPage.js.map +1 -1
- package/dist/esm/pages/MainPage/MainPage.js +55 -45
- package/dist/esm/pages/MainPage/MainPage.js.map +1 -1
- package/dist/esm/pages/MainPage/MainWarningMessages.js +14 -7
- package/dist/esm/pages/MainPage/MainWarningMessages.js.map +1 -1
- package/dist/esm/pages/MainPage/ReviewButton.js +58 -66
- package/dist/esm/pages/MainPage/ReviewButton.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.js +69 -42
- package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.style.js +8 -4
- package/dist/esm/pages/RoutesPage/RoutesPage.style.js.map +1 -1
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js +34 -24
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js +80 -54
- package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.js +38 -28
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.js.map +1 -1
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js +46 -45
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js +174 -115
- package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js.map +1 -1
- package/dist/esm/pages/SendToWallet/BookmarksPage.js +103 -96
- package/dist/esm/pages/SendToWallet/BookmarksPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js +79 -42
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js.map +1 -1
- package/dist/esm/pages/SendToWallet/ConnectedWalletsPage.js +89 -94
- package/dist/esm/pages/SendToWallet/ConnectedWalletsPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/EmptyListIndicator.js +15 -8
- package/dist/esm/pages/SendToWallet/EmptyListIndicator.js.map +1 -1
- package/dist/esm/pages/SendToWallet/RecentWalletsPage.js +108 -109
- package/dist/esm/pages/SendToWallet/RecentWalletsPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToConfiguredWalletPage.js +71 -76
- package/dist/esm/pages/SendToWallet/SendToConfiguredWalletPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js +235 -159
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js +115 -122
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js +46 -37
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/GasPriceSettings.js +54 -18
- package/dist/esm/pages/SettingsPage/GasPriceSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/LanguageSetting.js +30 -27
- package/dist/esm/pages/SettingsPage/LanguageSetting.js.map +1 -1
- package/dist/esm/pages/SettingsPage/ResetSettingsButton.js +62 -32
- package/dist/esm/pages/SettingsPage/ResetSettingsButton.js.map +1 -1
- package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.js +10 -8
- package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js +46 -22
- package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/BadgedValue.js +12 -4
- package/dist/esm/pages/SettingsPage/SettingsCard/BadgedValue.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.js +20 -17
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +45 -17
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.js +33 -27
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsPage.js +37 -21
- package/dist/esm/pages/SettingsPage/SettingsPage.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +89 -74
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +55 -69
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SmallBalanceFilterSettings.js +73 -56
- package/dist/esm/pages/SettingsPage/SmallBalanceFilterSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/ThemeSettings.js +57 -33
- package/dist/esm/pages/SettingsPage/ThemeSettings.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/ActionRow.js +14 -0
- package/dist/esm/pages/TransactionDetailsPage/ActionRow.js.map +1 -0
- package/dist/esm/pages/TransactionDetailsPage/ActionRow.style.js +29 -0
- package/dist/esm/pages/TransactionDetailsPage/ActionRow.style.js.map +1 -0
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.js +14 -20
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.style.js +14 -0
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.style.js.map +1 -0
- package/dist/esm/pages/TransactionDetailsPage/ReceiptsCard.js +28 -0
- package/dist/esm/pages/TransactionDetailsPage/ReceiptsCard.js.map +1 -0
- package/dist/esm/pages/TransactionDetailsPage/ReceiptsCard.style.js +22 -0
- package/dist/esm/pages/TransactionDetailsPage/ReceiptsCard.style.js.map +1 -0
- package/dist/esm/pages/TransactionDetailsPage/SentToWalletRow.js +50 -0
- package/dist/esm/pages/TransactionDetailsPage/SentToWalletRow.js.map +1 -0
- package/dist/esm/pages/TransactionDetailsPage/StepActionRow.js +27 -0
- package/dist/esm/pages/TransactionDetailsPage/StepActionRow.js.map +1 -0
- package/dist/esm/pages/TransactionDetailsPage/StepActionsList.js +44 -0
- package/dist/esm/pages/TransactionDetailsPage/StepActionsList.js.map +1 -0
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js +81 -85
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js +75 -31
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.js +64 -30
- package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js +77 -35
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js +143 -91
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/RouteTracker.js +45 -37
- package/dist/esm/pages/TransactionPage/RouteTracker.js.map +1 -1
- package/dist/esm/pages/TransactionPage/StartTransactionButton.js +19 -10
- package/dist/esm/pages/TransactionPage/StartTransactionButton.js.map +1 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js +225 -179
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.style.js +59 -63
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.style.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +144 -72
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionPage.js +187 -160
- package/dist/esm/pages/TransactionPage/TransactionPage.js.map +1 -1
- package/dist/esm/pages/TransactionPage/utils.js +9 -8
- package/dist/esm/pages/TransactionPage/utils.js.map +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.js +79 -93
- package/dist/esm/providers/I18nProvider/I18nProvider.js.map +1 -1
- package/dist/esm/providers/I18nProvider/constants.js +40 -36
- package/dist/esm/providers/I18nProvider/constants.js.map +1 -1
- package/dist/esm/providers/I18nProvider/enResource.d.ts +2 -2
- package/dist/esm/providers/I18nProvider/enResource.js +2 -4
- package/dist/esm/providers/I18nProvider/i18n.js +15 -16
- package/dist/esm/providers/I18nProvider/i18n.js.map +1 -1
- package/dist/esm/providers/I18nProvider/types.d.ts +11 -10
- package/dist/esm/providers/I18nProvider/types.d.ts.map +1 -0
- package/dist/esm/providers/QueryClientProvider.js +13 -7
- package/dist/esm/providers/QueryClientProvider.js.map +1 -1
- package/dist/esm/providers/SDKClientProvider.js +41 -26
- package/dist/esm/providers/SDKClientProvider.js.map +1 -1
- package/dist/esm/providers/ThemeProvider/ThemeProvider.js +23 -16
- package/dist/esm/providers/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.js +36 -22
- package/dist/esm/providers/WalletProvider/WalletProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/useExternalWalletProvider.js +37 -49
- package/dist/esm/providers/WalletProvider/useExternalWalletProvider.js.map +1 -1
- package/dist/esm/providers/WidgetProvider/WidgetProvider.js +41 -36
- package/dist/esm/providers/WidgetProvider/WidgetProvider.js.map +1 -1
- package/dist/esm/stores/StoreProvider.js +36 -13
- package/dist/esm/stores/StoreProvider.js.map +1 -1
- package/dist/esm/stores/bookmarks/BookmarkStore.js +24 -18
- package/dist/esm/stores/bookmarks/BookmarkStore.js.map +1 -1
- package/dist/esm/stores/bookmarks/createBookmarkStore.js +41 -52
- package/dist/esm/stores/bookmarks/createBookmarkStore.js.map +1 -1
- package/dist/esm/stores/bookmarks/types.d.ts +23 -18
- package/dist/esm/stores/bookmarks/types.d.ts.map +1 -0
- package/dist/esm/stores/bookmarks/useBookmarkActions.js +15 -12
- package/dist/esm/stores/bookmarks/useBookmarkActions.js.map +1 -1
- package/dist/esm/stores/bookmarks/useBookmarks.js +16 -8
- package/dist/esm/stores/bookmarks/useBookmarks.js.map +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.js +78 -113
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/createChainOrderStore.js +82 -101
- package/dist/esm/stores/chains/createChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/useChainOrder.js +9 -10
- package/dist/esm/stores/chains/useChainOrder.js.map +1 -1
- package/dist/esm/stores/form/FormStore.js +68 -88
- package/dist/esm/stores/form/FormStore.js.map +1 -1
- package/dist/esm/stores/form/FormStoreContext.js +6 -2
- package/dist/esm/stores/form/FormStoreContext.js.map +1 -1
- package/dist/esm/stores/form/FormUpdater.js +33 -42
- package/dist/esm/stores/form/FormUpdater.js.map +1 -1
- package/dist/esm/stores/form/URLSearchParamsBuilder.js +75 -87
- package/dist/esm/stores/form/URLSearchParamsBuilder.js.map +1 -1
- package/dist/esm/stores/form/createFormStore.js +165 -175
- package/dist/esm/stores/form/createFormStore.js.map +1 -1
- package/dist/esm/stores/form/getDefaultValuesFromQueryString.js +20 -30
- package/dist/esm/stores/form/getDefaultValuesFromQueryString.js.map +1 -1
- package/dist/esm/stores/form/types.d.ts +64 -72
- package/dist/esm/stores/form/types.d.ts.map +1 -0
- package/dist/esm/stores/form/types.js +8 -4
- package/dist/esm/stores/form/types.js.map +1 -1
- package/dist/esm/stores/form/useFieldActions.d.ts +7 -11
- package/dist/esm/stores/form/useFieldActions.d.ts.map +1 -0
- package/dist/esm/stores/form/useFieldActions.js +59 -51
- package/dist/esm/stores/form/useFieldActions.js.map +1 -1
- package/dist/esm/stores/form/useFieldValues.d.ts +7 -2
- package/dist/esm/stores/form/useFieldValues.d.ts.map +1 -0
- package/dist/esm/stores/form/useFieldValues.js +7 -5
- package/dist/esm/stores/form/useFieldValues.js.map +1 -1
- package/dist/esm/stores/form/useFormRef.js +26 -43
- package/dist/esm/stores/form/useFormRef.js.map +1 -1
- package/dist/esm/stores/form/useFormStore.js +11 -9
- package/dist/esm/stores/form/useFormStore.js.map +1 -1
- package/dist/esm/stores/form/useTouchedFields.js +7 -4
- package/dist/esm/stores/form/useTouchedFields.js.map +1 -1
- package/dist/esm/stores/header/useHeaderStore.js +52 -75
- package/dist/esm/stores/header/useHeaderStore.js.map +1 -1
- package/dist/esm/stores/inputMode/useInputModeStore.js +18 -17
- package/dist/esm/stores/inputMode/useInputModeStore.js.map +1 -1
- package/dist/esm/stores/pinnedTokens/PinnedTokensStore.js +19 -16
- package/dist/esm/stores/pinnedTokens/PinnedTokensStore.js.map +1 -1
- package/dist/esm/stores/pinnedTokens/createPinnedTokensStore.js +54 -58
- package/dist/esm/stores/pinnedTokens/createPinnedTokensStore.js.map +1 -1
- package/dist/esm/stores/routes/RouteExecutionStore.js +21 -19
- package/dist/esm/stores/routes/RouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.js +82 -116
- package/dist/esm/stores/routes/createRouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/routes/types.js +13 -9
- package/dist/esm/stores/routes/types.js.map +1 -1
- package/dist/esm/stores/routes/useIntermediateRoutesStore.js +17 -14
- package/dist/esm/stores/routes/useIntermediateRoutesStore.js.map +1 -1
- package/dist/esm/stores/routes/useRouteExecutionIndicator.js +24 -0
- package/dist/esm/stores/routes/useRouteExecutionIndicator.js.map +1 -0
- package/dist/esm/stores/routes/useSetExecutableRoute.js +7 -3
- package/dist/esm/stores/routes/useSetExecutableRoute.js.map +1 -1
- package/dist/esm/stores/routes/utils.js +27 -34
- package/dist/esm/stores/routes/utils.js.map +1 -1
- package/dist/esm/stores/settings/SettingsStore.js +21 -19
- package/dist/esm/stores/settings/SettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/createSettingsStore.js +124 -153
- package/dist/esm/stores/settings/createSettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/types.d.ts +24 -54
- package/dist/esm/stores/settings/types.d.ts.map +1 -0
- package/dist/esm/stores/settings/types.js +5 -1
- package/dist/esm/stores/settings/types.js.map +1 -1
- package/dist/esm/stores/settings/useSettings.js +10 -6
- package/dist/esm/stores/settings/useSettings.js.map +1 -1
- package/dist/esm/stores/settings/useSettingsActions.js +66 -80
- package/dist/esm/stores/settings/useSettingsActions.js.map +1 -1
- package/dist/esm/stores/settings/useSplitSubvariantStore.js +26 -26
- package/dist/esm/stores/settings/useSplitSubvariantStore.js.map +1 -1
- package/dist/esm/stores/settings/utils/getStateValues.js +18 -14
- package/dist/esm/stores/settings/utils/getStateValues.js.map +1 -1
- package/dist/esm/themes/azureLight.d.ts +7 -2
- package/dist/esm/themes/azureLight.d.ts.map +1 -0
- package/dist/esm/themes/azureLight.js +39 -58
- package/dist/esm/themes/azureLight.js.map +1 -1
- package/dist/esm/themes/createTheme.d.ts +8 -2
- package/dist/esm/themes/createTheme.d.ts.map +1 -0
- package/dist/esm/themes/createTheme.js +302 -420
- package/dist/esm/themes/createTheme.js.map +1 -1
- package/dist/esm/themes/jumper.d.ts +7 -2
- package/dist/esm/themes/jumper.d.ts.map +1 -0
- package/dist/esm/themes/jumper.js +56 -74
- package/dist/esm/themes/jumper.js.map +1 -1
- package/dist/esm/themes/palettes.d.ts +51 -47
- package/dist/esm/themes/palettes.d.ts.map +1 -0
- package/dist/esm/themes/palettes.js +39 -47
- package/dist/esm/themes/palettes.js.map +1 -1
- package/dist/esm/themes/types.d.ts +75 -72
- package/dist/esm/themes/types.d.ts.map +1 -0
- package/dist/esm/themes/utils.js +11 -7
- package/dist/esm/themes/utils.js.map +1 -1
- package/dist/esm/themes/watermelonLight.d.ts +7 -2
- package/dist/esm/themes/watermelonLight.d.ts.map +1 -0
- package/dist/esm/themes/watermelonLight.js +43 -77
- package/dist/esm/themes/watermelonLight.js.map +1 -1
- package/dist/esm/themes/windows95.d.ts +7 -2
- package/dist/esm/themes/windows95.d.ts.map +1 -0
- package/dist/esm/themes/windows95.js +74 -124
- package/dist/esm/themes/windows95.js.map +1 -1
- package/dist/esm/types/events.d.ts +95 -92
- package/dist/esm/types/events.d.ts.map +1 -0
- package/dist/esm/types/events.js +29 -25
- package/dist/esm/types/events.js.map +1 -1
- package/dist/esm/types/token.d.ts +11 -14
- package/dist/esm/types/token.d.ts.map +1 -0
- package/dist/esm/types/widget.d.ts +285 -280
- package/dist/esm/types/widget.d.ts.map +1 -0
- package/dist/esm/types/widget.js +48 -44
- package/dist/esm/types/widget.js.map +1 -1
- package/dist/esm/utils/chainType.js +12 -7
- package/dist/esm/utils/chainType.js.map +1 -1
- package/dist/esm/utils/compactNumberFormatter.d.ts +13 -9
- package/dist/esm/utils/compactNumberFormatter.d.ts.map +1 -0
- package/dist/esm/utils/compactNumberFormatter.js +61 -75
- package/dist/esm/utils/compactNumberFormatter.js.map +1 -1
- package/dist/esm/utils/converters.js +164 -188
- package/dist/esm/utils/converters.js.map +1 -1
- package/dist/esm/utils/currencyExtendedFormatter.d.ts +5 -1
- package/dist/esm/utils/currencyExtendedFormatter.d.ts.map +1 -0
- package/dist/esm/utils/currencyExtendedFormatter.js +13 -11
- package/dist/esm/utils/currencyExtendedFormatter.js.map +1 -1
- package/dist/esm/utils/deepEqual.js +29 -49
- package/dist/esm/utils/deepEqual.js.map +1 -1
- package/dist/esm/utils/deepMerge.js +11 -13
- package/dist/esm/utils/deepMerge.js.map +1 -1
- package/dist/esm/utils/elements.js +16 -14
- package/dist/esm/utils/elements.js.map +1 -1
- package/dist/esm/utils/enum.js +5 -1
- package/dist/esm/utils/enum.js.map +1 -1
- package/dist/esm/utils/fees.js +66 -74
- package/dist/esm/utils/fees.js.map +1 -1
- package/dist/esm/utils/format.d.ts +26 -22
- package/dist/esm/utils/format.d.ts.map +1 -0
- package/dist/esm/utils/format.js +85 -130
- package/dist/esm/utils/format.js.map +1 -1
- package/dist/esm/utils/getActionMessage.js +62 -105
- package/dist/esm/utils/getActionMessage.js.map +1 -1
- package/dist/esm/utils/getErrorMessage.js +115 -116
- package/dist/esm/utils/getErrorMessage.js.map +1 -1
- package/dist/esm/utils/getPriceImpact.d.ts +16 -7
- package/dist/esm/utils/getPriceImpact.d.ts.map +1 -0
- package/dist/esm/utils/getPriceImpact.js +10 -9
- package/dist/esm/utils/getPriceImpact.js.map +1 -1
- package/dist/esm/utils/input.js +21 -25
- package/dist/esm/utils/input.js.map +1 -1
- package/dist/esm/utils/item.js +22 -31
- package/dist/esm/utils/item.js.map +1 -1
- package/dist/esm/utils/navigationRoutes.d.ts +25 -26
- package/dist/esm/utils/navigationRoutes.d.ts.map +1 -0
- package/dist/esm/utils/navigationRoutes.js +61 -60
- package/dist/esm/utils/navigationRoutes.js.map +1 -1
- package/dist/esm/utils/percentFormatter.d.ts +10 -6
- package/dist/esm/utils/percentFormatter.d.ts.map +1 -0
- package/dist/esm/utils/percentFormatter.js +20 -20
- package/dist/esm/utils/percentFormatter.js.map +1 -1
- package/dist/esm/utils/prepareActions.js +17 -20
- package/dist/esm/utils/prepareActions.js.map +1 -1
- package/dist/esm/utils/queries.js +5 -1
- package/dist/esm/utils/queries.js.map +1 -1
- package/dist/esm/utils/timer.js +16 -21
- package/dist/esm/utils/timer.js.map +1 -1
- package/dist/esm/utils/token.js +49 -67
- package/dist/esm/utils/token.js.map +1 -1
- package/dist/esm/utils/tokenList.js +140 -197
- package/dist/esm/utils/tokenList.js.map +1 -1
- package/dist/esm/utils/variant.js +8 -8
- package/dist/esm/utils/variant.js.map +1 -1
- package/dist/esm/utils/wallet.js +5 -3
- package/dist/esm/utils/wallet.js.map +1 -1
- package/dist/esm/utils/widgetSize.js +9 -9
- package/dist/esm/utils/widgetSize.js.map +1 -1
- package/package.json +15 -13
- package/src/App.tsx +4 -1
- package/src/AppDefault.tsx +27 -42
- package/src/AppDrawer.tsx +77 -72
- package/src/AppDrawerContext.ts +3 -2
- package/src/AppProvider.tsx +0 -3
- package/src/components/AmountInput/AmountInput.style.tsx +22 -12
- package/src/components/AmountInput/AmountInput.tsx +1 -6
- package/src/components/AmountInput/AmountInputEndAdornment.style.ts +22 -0
- package/src/components/AmountInput/AmountInputEndAdornment.tsx +74 -70
- package/src/components/AmountInput/PriceFormHelperText.style.tsx +28 -26
- package/src/components/AmountInput/PriceFormHelperText.tsx +17 -15
- package/src/components/AppContainer.tsx +26 -28
- package/src/components/Avatar/AccountAvatar.tsx +2 -1
- package/src/components/Avatar/Avatar.style.tsx +22 -6
- package/src/components/Avatar/SmallAvatar.tsx +4 -1
- package/src/components/BaseTransactionButton/BaseTransactionButton.tsx +2 -0
- package/src/components/BaseTransactionButton/types.ts +2 -0
- package/src/components/BottomSheet/BottomSheet.tsx +5 -2
- package/src/components/ButtonTertiary.tsx +19 -17
- package/src/components/Card/Card.tsx +61 -59
- package/src/components/Card/CardButton.style.tsx +27 -23
- package/src/components/Card/CardHeader.tsx +22 -20
- package/src/components/Card/CardIconButton.tsx +6 -1
- package/src/components/Card/CardLabel.tsx +21 -3
- package/src/components/Card/CardTitle.tsx +4 -1
- package/src/components/Card/InputCard.tsx +8 -4
- package/src/components/ChainSelect/ChainSelect.style.tsx +17 -6
- package/src/components/ChainSelect/ChainSelect.tsx +111 -103
- package/src/components/ChainSelect/useChainSelect.ts +19 -10
- package/src/components/Chains/AllChainsAvatar.tsx +5 -5
- package/src/components/Chains/ChainList.style.tsx +37 -13
- package/src/components/Chains/ChainList.tsx +2 -2
- package/src/components/Chains/ChainListItem.tsx +59 -57
- package/src/components/Chains/ChainSearchInput.tsx +2 -2
- package/src/components/Chains/ChainsExpanded.style.tsx +4 -1
- package/src/components/Chains/ChainsExpanded.tsx +14 -15
- package/src/components/Chains/PinChainButton.tsx +5 -1
- package/src/components/Chains/SelectChainContent.tsx +88 -83
- package/src/components/Chains/VirtualizedChainList.tsx +2 -2
- package/src/components/ContextMenu.style.tsx +13 -0
- package/src/components/ContextMenu.tsx +75 -0
- package/src/components/ContractComponent/NFT/NFT.style.ts +8 -6
- package/src/components/Dialog/Dialog.style.tsx +59 -0
- package/src/components/{Dialog.tsx → Dialog/Dialog.tsx} +3 -3
- package/src/components/Expansion/Expansion.style.tsx +4 -1
- package/src/components/Expansion/Expansion.tsx +2 -2
- package/src/components/Expansion/ExpansionTransition.tsx +2 -2
- package/src/components/FullPageContainer.tsx +9 -6
- package/src/components/Header/ActivitiesButton.style.tsx +67 -0
- package/src/components/Header/ActivitiesButton.tsx +58 -0
- package/src/components/Header/CloseDrawerButton.tsx +4 -1
- package/src/components/Header/DisconnectIconButton.tsx +6 -1
- package/src/components/Header/Header.style.ts +22 -6
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Header/NavigationHeader.tsx +2 -2
- package/src/components/Header/SettingsButton.style.tsx +11 -6
- package/src/components/Header/SettingsButton.tsx +2 -1
- package/src/components/Header/SplitNavigationTabs.tsx +2 -1
- package/src/components/Header/WalletMenu.style.tsx +4 -1
- package/src/components/Header/WalletMenu.tsx +6 -1
- package/src/components/IconCircle/IconCircle.style.tsx +85 -0
- package/src/components/IconCircle/IconCircle.tsx +29 -0
- package/src/components/IconCircle/statusIcons.ts +14 -0
- package/src/components/IconTypography.ts +9 -7
- package/src/components/Input.tsx +4 -1
- package/src/components/ListItem/ListItem.tsx +22 -19
- package/src/components/ListItem/ListItemButton.tsx +4 -1
- package/src/components/ListItemButton.tsx +4 -1
- package/src/components/ListItemText.tsx +4 -1
- package/src/components/Menu.tsx +4 -1
- package/src/components/Messages/AlertMessage.style.tsx +7 -2
- package/src/components/Messages/AlertMessage.tsx +2 -2
- package/src/components/Messages/GasRefuelMessage.style.ts +16 -14
- package/src/components/Messages/WarningMessages.tsx +0 -3
- package/src/components/Messages/useMessageQueue.ts +10 -12
- package/src/components/PageContainer.ts +4 -1
- package/src/components/PoweredBy/PoweredBy.style.ts +4 -1
- package/src/components/ReverseTokensButton/ReverseTokensButton.style.tsx +16 -10
- package/src/components/ReverseTokensButton/ReverseTokensButton.tsx +3 -9
- package/src/components/RouteCard/RouteCard.tsx +10 -44
- package/src/components/RouteCard/RouteDetails.style.tsx +43 -0
- package/src/components/RouteCard/RouteDetails.tsx +214 -0
- package/src/components/RouteCard/RouteToken.style.tsx +9 -0
- package/src/components/RouteCard/RouteToken.tsx +71 -0
- package/src/components/RouteCard/RouteTokens.tsx +55 -0
- package/src/components/Routes/RoutesContent.tsx +82 -80
- package/src/components/Routes/RoutesExpanded.style.ts +35 -31
- package/src/components/Routes/RoutesExpanded.tsx +77 -74
- package/src/components/Search/SearchInput.style.tsx +10 -3
- package/src/components/Search/SearchInput.tsx +8 -3
- package/src/components/Search/SearchNotFound.style.tsx +10 -3
- package/src/components/Search/SearchNotFound.tsx +2 -1
- package/src/components/SelectChainAndToken.tsx +8 -37
- package/src/components/SelectTokenButton/SelectTokenButton.style.tsx +22 -4
- package/src/components/SelectTokenButton/SelectTokenButton.tsx +4 -16
- package/src/components/SendToWallet/{SendToWallet.style.tsx → SendToWalletButton.style.tsx} +28 -2
- package/src/components/SendToWallet/SendToWalletButton.tsx +20 -6
- package/src/components/SendToWallet/SendToWalletExpandButton.tsx +45 -48
- package/src/components/SettingsListItemButton.tsx +6 -5
- package/src/components/Skeleton/WidgetSkeleton.style.tsx +45 -25
- package/src/components/Skeleton/WidgetSkeleton.tsx +4 -2
- package/src/components/Step/CircularProgress.style.tsx +10 -2
- package/src/components/Step/CircularProgress.tsx +1 -1
- package/src/components/Step/StepActions.style.tsx +33 -0
- package/src/components/Step/StepActions.tsx +320 -0
- package/src/components/Step/StepList.tsx +2 -2
- package/src/components/StepActions/StepActions.style.tsx +19 -9
- package/src/components/StepActions/types.ts +3 -3
- package/src/components/StepDivider/StepDivider.style.tsx +8 -6
- package/src/components/Switch.tsx +4 -1
- package/src/components/Tabs/NavigationTabs.tsx +36 -31
- package/src/components/Tabs/Tabs.style.tsx +7 -2
- package/src/components/Timer/StepTimer.tsx +17 -28
- package/src/components/Timer/TimerContent.tsx +3 -1
- package/src/components/Token/Token.style.tsx +11 -3
- package/src/components/Token/Token.tsx +3 -3
- package/src/components/TokenList/PinTokenButton.tsx +2 -1
- package/src/components/TokenList/TokenDetailsSheet.tsx +4 -1
- package/src/components/TokenList/TokenDetailsSheetContent.style.tsx +16 -10
- package/src/components/TokenList/TokenDetailsSheetContent.tsx +174 -172
- package/src/components/TokenList/TokenList.style.tsx +26 -21
- package/src/components/TokenList/TokenListItem.tsx +2 -2
- package/src/components/TokenList/useTokenSelect.ts +16 -3
- package/src/components/TokenRate/TokenRate.style.ts +4 -1
- package/src/components/Tools/ToolItem.tsx +4 -5
- package/src/components/Tools/Tools.tsx +2 -2
- package/src/components/TransactionCard/ActiveTransactionCard.style.tsx +36 -0
- package/src/components/TransactionCard/ActiveTransactionCard.tsx +84 -0
- package/src/components/TransactionCard/TransactionCard.style.tsx +14 -0
- package/src/components/TransactionCard/TransactionCard.tsx +37 -0
- package/src/components/TransactionCard/TransactionCardSkeleton.tsx +68 -0
- package/src/config/queryClient.ts +1 -1
- package/src/config/version.ts +1 -1
- package/src/hooks/timer/useExecutionTimer.ts +21 -0
- package/src/hooks/timer/useInterval.ts +1 -1
- package/src/hooks/timer/validate.ts +2 -2
- package/src/hooks/useAccountsBalancesData.ts +4 -1
- package/src/hooks/useActionMessage.ts +1 -1
- package/src/hooks/useAddressValidation.ts +7 -2
- package/src/hooks/useAvailableChains.ts +5 -1
- package/src/hooks/useChain.ts +11 -1
- package/src/hooks/useChains.ts +12 -2
- package/src/hooks/useContactSupport.ts +16 -0
- package/src/hooks/useDebouncedWatch.ts +2 -2
- package/src/hooks/useDefaultElementId.ts +1 -1
- package/src/hooks/useExplorer.ts +4 -1
- package/src/hooks/useFilteredByTokenBalances.ts +4 -1
- package/src/hooks/useFromAmountThreshold.ts +4 -1
- package/src/hooks/useFromTokenSufficiency.ts +6 -1
- package/src/hooks/useGasRecommendation.ts +2 -1
- package/src/hooks/useGasRefuel.ts +8 -1
- package/src/hooks/useGasSufficiency.ts +6 -1
- package/src/hooks/useHasChainExpansion.ts +4 -1
- package/src/hooks/useHeader.ts +1 -1
- package/src/hooks/useInitializeSDKProviders.ts +2 -2
- package/src/hooks/useInitializer.ts +1 -1
- package/src/hooks/useIsBatchingSupported.ts +4 -1
- package/src/hooks/useLanguages.ts +6 -2
- package/src/hooks/useListHeight.ts +2 -2
- package/src/hooks/useLongPress.ts +10 -1
- package/src/hooks/useNavigateBack.ts +2 -2
- package/src/hooks/useRouteExecution.ts +9 -2
- package/src/hooks/useRouteRequiredAccountConnection.ts +5 -1
- package/src/hooks/useRoutes.ts +16 -2
- package/src/hooks/useScrollableContainer.ts +7 -5
- package/src/hooks/useSetContentHeight.ts +2 -2
- package/src/hooks/useSettingMonitor.ts +15 -3
- package/src/hooks/useSwapOnly.ts +1 -1
- package/src/hooks/useToAddressAutoPopulate.ts +3 -5
- package/src/hooks/useToAddressRequirements.ts +27 -12
- package/src/hooks/useToAddressReset.ts +6 -22
- package/src/hooks/useToken.ts +5 -1
- package/src/hooks/useTokenAddressBalance.ts +7 -2
- package/src/hooks/useTokenBalance.ts +10 -1
- package/src/hooks/useTokenBalances.ts +9 -1
- package/src/hooks/useTokenBalancesQueries.ts +5 -1
- package/src/hooks/useTokenRateText.ts +55 -0
- package/src/hooks/useTokenSearch.ts +4 -1
- package/src/hooks/useTokens.ts +6 -1
- package/src/hooks/useTools.ts +1 -1
- package/src/hooks/useTransactionDetails.ts +6 -1
- package/src/hooks/useTransactionHistory.ts +54 -12
- package/src/hooks/useTransactionList.ts +83 -0
- package/src/hooks/useWideVariant.ts +1 -1
- package/src/hooks/useWidgetChains.ts +11 -1
- package/src/hooks/useWidgetEvents.ts +2 -2
- package/src/pages/ActivitiesPage/ActiveTransactionItem.tsx +43 -0
- package/src/pages/ActivitiesPage/ActivitiesPage.tsx +147 -0
- package/src/pages/ActivitiesPage/ActivitiesPageMenuButton.tsx +71 -0
- package/src/pages/ActivitiesPage/TransactionHistoryItem.tsx +30 -0
- package/src/pages/ActivitiesPage/types.ts +16 -0
- package/src/pages/MainPage/MainPage.tsx +0 -3
- package/src/pages/MainPage/ReviewButton.tsx +1 -0
- package/src/pages/RoutesPage/RoutesPage.style.ts +4 -1
- package/src/pages/RoutesPage/RoutesPage.tsx +2 -2
- package/src/pages/SelectEnabledToolsPage.tsx +1 -1
- package/src/pages/SelectTokenPage/SearchTokenInput.tsx +4 -2
- package/src/pages/SendToWallet/BookmarkAddressSheet.tsx +184 -172
- package/src/pages/SendToWallet/BookmarksPage.tsx +35 -95
- package/src/pages/SendToWallet/ConfirmAddressSheet.tsx +4 -9
- package/src/pages/SendToWallet/ConnectedWalletsPage.tsx +38 -85
- package/src/pages/SendToWallet/EmptyListIndicator.tsx +2 -2
- package/src/pages/SendToWallet/RecentWalletsPage.tsx +45 -110
- package/src/pages/SendToWallet/SendToConfiguredWalletPage.tsx +30 -83
- package/src/pages/SendToWallet/SendToWalletPage.style.tsx +76 -63
- package/src/pages/SettingsPage/ResetSettingsButton.style.tsx +10 -8
- package/src/pages/SettingsPage/ResetSettingsButton.tsx +20 -18
- package/src/pages/SettingsPage/SettingsCard/SettingCard.style.tsx +7 -2
- package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +12 -2
- package/src/pages/SettingsPage/SettingsCard/SettingsAccordian.tsx +6 -3
- package/src/pages/SettingsPage/SettingsPage.tsx +2 -1
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +55 -50
- package/src/pages/TransactionDetailsPage/ActionRow.style.tsx +31 -0
- package/src/pages/TransactionDetailsPage/ActionRow.tsx +22 -0
- package/src/pages/TransactionDetailsPage/ContactSupportButton.style.tsx +12 -0
- package/src/pages/TransactionDetailsPage/ContactSupportButton.tsx +7 -18
- package/src/pages/TransactionDetailsPage/ReceiptsCard.style.tsx +25 -0
- package/src/pages/TransactionDetailsPage/ReceiptsCard.tsx +22 -0
- package/src/pages/TransactionDetailsPage/SentToWalletRow.tsx +57 -0
- package/src/pages/TransactionDetailsPage/StepActionRow.tsx +29 -0
- package/src/pages/TransactionDetailsPage/StepActionsList.tsx +68 -0
- package/src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +24 -60
- package/src/pages/TransactionDetailsPage/TransactionDetailsSkeleton.tsx +2 -1
- package/src/pages/TransactionDetailsPage/TransferIdCard.tsx +17 -9
- package/src/pages/TransactionPage/ConfirmToAddressSheet.tsx +4 -5
- package/src/pages/TransactionPage/ExchangeRateBottomSheet.tsx +52 -51
- package/src/pages/TransactionPage/RouteTracker.tsx +2 -2
- package/src/pages/TransactionPage/StatusBottomSheet.style.tsx +28 -21
- package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +20 -19
- package/src/pages/TransactionPage/TransactionPage.tsx +3 -3
- package/src/pages/TransactionPage/utils.ts +2 -2
- package/src/providers/I18nProvider/I18nProvider.tsx +0 -1
- package/src/providers/I18nProvider/i18n.ts +2 -2
- package/src/providers/SDKClientProvider.tsx +33 -13
- package/src/providers/WalletProvider/WalletProvider.tsx +31 -10
- package/src/stores/bookmarks/BookmarkStore.tsx +1 -1
- package/src/stores/bookmarks/createBookmarkStore.ts +2 -1
- package/src/stores/bookmarks/useBookmarkActions.ts +1 -1
- package/src/stores/chains/ChainOrderStore.tsx +2 -2
- package/src/stores/chains/createChainOrderStore.ts +6 -3
- package/src/stores/form/FormStoreContext.ts +3 -2
- package/src/stores/form/FormUpdater.tsx +0 -6
- package/src/stores/form/URLSearchParamsBuilder.tsx +0 -4
- package/src/stores/form/createFormStore.ts +4 -1
- package/src/stores/form/useFieldActions.ts +7 -2
- package/src/stores/form/useFieldValues.ts +3 -1
- package/src/stores/form/useFormRef.ts +5 -10
- package/src/stores/form/useTouchedFields.ts +2 -1
- package/src/stores/header/useHeaderStore.tsx +5 -3
- package/src/stores/inputMode/useInputModeStore.ts +20 -18
- package/src/stores/pinnedTokens/PinnedTokensStore.tsx +1 -1
- package/src/stores/pinnedTokens/createPinnedTokensStore.ts +4 -1
- package/src/stores/routes/RouteExecutionStore.tsx +3 -3
- package/src/stores/routes/createRouteExecutionStore.ts +55 -43
- package/src/stores/routes/types.ts +4 -1
- package/src/stores/routes/useIntermediateRoutesStore.ts +17 -16
- package/src/stores/routes/useRouteExecutionIndicator.ts +43 -0
- package/src/stores/routes/useSetExecutableRoute.ts +5 -3
- package/src/stores/routes/utils.ts +6 -6
- package/src/stores/settings/SettingsStore.tsx +3 -2
- package/src/stores/settings/createSettingsStore.ts +4 -1
- package/src/stores/settings/types.ts +0 -8
- package/src/stores/settings/useSettingsActions.ts +12 -1
- package/src/stores/settings/useSplitSubvariantStore.tsx +2 -2
- package/src/themes/createTheme.ts +8 -11
- package/src/themes/utils.ts +1 -1
- package/src/utils/chainType.ts +2 -1
- package/src/utils/compactNumberFormatter.ts +1 -1
- package/src/utils/converters.ts +4 -2
- package/src/utils/currencyExtendedFormatter.ts +1 -1
- package/src/utils/deepEqual.ts +1 -1
- package/src/utils/deepMerge.ts +2 -2
- package/src/utils/elements.ts +8 -6
- package/src/utils/enum.ts +4 -2
- package/src/utils/fees.ts +8 -2
- package/src/utils/format.ts +8 -5
- package/src/utils/getErrorMessage.ts +1 -1
- package/src/utils/getPriceImpact.ts +1 -1
- package/src/utils/input.ts +1 -1
- package/src/utils/item.ts +1 -1
- package/src/utils/navigationRoutes.ts +6 -9
- package/src/utils/percentFormatter.ts +4 -1
- package/src/utils/tokenList.ts +8 -4
- package/src/utils/wallet.ts +1 -1
- package/dist/esm/AppDefault.d.ts +0 -9
- package/dist/esm/AppDrawerContext.d.ts +0 -5
- package/dist/esm/AppLayout.d.ts +0 -1
- package/dist/esm/AppProvider.d.ts +0 -3
- package/dist/esm/components/ActiveTransactions/ActiveTransactionItem.d.ts +0 -4
- package/dist/esm/components/ActiveTransactions/ActiveTransactionItem.js +0 -65
- package/dist/esm/components/ActiveTransactions/ActiveTransactionItem.js.map +0 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.d.ts +0 -2
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.js +0 -24
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.js.map +0 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.d.ts +0 -2
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.js +0 -22
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.js.map +0 -1
- package/dist/esm/components/AmountInput/AmountInput.d.ts +0 -3
- package/dist/esm/components/AmountInput/AmountInput.style.d.ts +0 -9
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +0 -2
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.js +0 -67
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.js.map +0 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.d.ts +0 -2
- package/dist/esm/components/AmountInput/AmountInputStartAdornment.d.ts +0 -2
- package/dist/esm/components/AmountInput/PriceFormHelperText.d.ts +0 -2
- package/dist/esm/components/AmountInput/PriceFormHelperText.style.d.ts +0 -1
- package/dist/esm/components/AppContainer.d.ts +0 -10
- package/dist/esm/components/Avatar/AccountAvatar.d.ts +0 -10
- package/dist/esm/components/Avatar/Avatar.d.ts +0 -11
- package/dist/esm/components/Avatar/Avatar.style.d.ts +0 -15
- package/dist/esm/components/Avatar/ChainBadgeContent.d.ts +0 -7
- package/dist/esm/components/Avatar/SmallAvatar.d.ts +0 -8
- package/dist/esm/components/Avatar/TokenAvatar.d.ts +0 -10
- package/dist/esm/components/Avatar/utils.d.ts +0 -1
- package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.d.ts +0 -2
- package/dist/esm/components/BaseTransactionButton/types.d.ts +0 -8
- package/dist/esm/components/BaseTransactionButton/types.js +0 -2
- package/dist/esm/components/BaseTransactionButton/types.js.map +0 -1
- package/dist/esm/components/BottomSheet/BottomSheet.d.ts +0 -2
- package/dist/esm/components/BottomSheet/types.d.ts +0 -12
- package/dist/esm/components/BottomSheet/types.js +0 -2
- package/dist/esm/components/BottomSheet/types.js.map +0 -1
- package/dist/esm/components/ButtonTertiary.d.ts +0 -1
- package/dist/esm/components/Card/Card.d.ts +0 -7
- package/dist/esm/components/Card/CardButton.d.ts +0 -7
- package/dist/esm/components/Card/CardButton.style.d.ts +0 -3
- package/dist/esm/components/Card/CardHeader.d.ts +0 -1
- package/dist/esm/components/Card/CardIconButton.d.ts +0 -4
- package/dist/esm/components/Card/CardLabel.d.ts +0 -6
- package/dist/esm/components/Card/CardTitle.d.ts +0 -3
- package/dist/esm/components/Card/InputCard.d.ts +0 -1
- package/dist/esm/components/ChainSelect/ChainSelect.d.ts +0 -2
- package/dist/esm/components/ChainSelect/ChainSelect.style.d.ts +0 -7
- package/dist/esm/components/ChainSelect/useChainSelect.d.ts +0 -10
- package/dist/esm/components/Chains/AllChainsAvatar.d.ts +0 -7
- package/dist/esm/components/Chains/ChainList.d.ts +0 -15
- package/dist/esm/components/Chains/ChainList.style.d.ts +0 -14
- package/dist/esm/components/Chains/ChainListItem.d.ts +0 -14
- package/dist/esm/components/Chains/ChainSearchInput.d.ts +0 -10
- package/dist/esm/components/Chains/ChainsExpanded.d.ts +0 -7
- package/dist/esm/components/Chains/ChainsExpanded.style.d.ts +0 -6
- package/dist/esm/components/Chains/PinChainButton.d.ts +0 -7
- package/dist/esm/components/Chains/SelectChainContent.d.ts +0 -9
- package/dist/esm/components/Chains/VirtualizedChainList.d.ts +0 -15
- package/dist/esm/components/ContractComponent/ContractComponent.d.ts +0 -3
- package/dist/esm/components/ContractComponent/NFT/NFT.style.d.ts +0 -1
- package/dist/esm/components/ContractComponent/NFT/types.js +0 -2
- package/dist/esm/components/ContractComponent/NFT/types.js.map +0 -1
- package/dist/esm/components/Dialog.d.ts +0 -27
- package/dist/esm/components/Dialog.js +0 -32
- package/dist/esm/components/Dialog.js.map +0 -1
- package/dist/esm/components/Expansion/Expansion.d.ts +0 -1
- package/dist/esm/components/Expansion/Expansion.style.d.ts +0 -32
- package/dist/esm/components/Expansion/ExpansionTransition.d.ts +0 -8
- package/dist/esm/components/FeeBreakdownTooltip.d.ts +0 -10
- package/dist/esm/components/FullPageContainer.d.ts +0 -2
- package/dist/esm/components/Header/BackButton.d.ts +0 -1
- package/dist/esm/components/Header/CloseDrawerButton.d.ts +0 -5
- package/dist/esm/components/Header/DisconnectIconButton.d.ts +0 -4
- package/dist/esm/components/Header/Header.d.ts +0 -2
- package/dist/esm/components/Header/Header.style.d.ts +0 -13
- package/dist/esm/components/Header/NavigationHeader.d.ts +0 -1
- package/dist/esm/components/Header/SettingsButton.d.ts +0 -1
- package/dist/esm/components/Header/SettingsButton.style.d.ts +0 -6
- package/dist/esm/components/Header/SplitNavigationTabs.d.ts +0 -1
- package/dist/esm/components/Header/TransactionHistoryButton.d.ts +0 -1
- package/dist/esm/components/Header/TransactionHistoryButton.js +0 -12
- package/dist/esm/components/Header/TransactionHistoryButton.js.map +0 -1
- package/dist/esm/components/Header/WalletHeader.d.ts +0 -1
- package/dist/esm/components/Header/WalletMenu.d.ts +0 -3
- package/dist/esm/components/Header/WalletMenu.style.d.ts +0 -1
- package/dist/esm/components/IconTypography.d.ts +0 -1
- package/dist/esm/components/Initializer.d.ts +0 -1
- package/dist/esm/components/Input.d.ts +0 -1
- package/dist/esm/components/ListItem/ListItem.d.ts +0 -1
- package/dist/esm/components/ListItem/ListItemButton.d.ts +0 -1
- package/dist/esm/components/ListItemButton.d.ts +0 -1
- package/dist/esm/components/ListItemText.d.ts +0 -1
- package/dist/esm/components/Menu.d.ts +0 -1
- package/dist/esm/components/Messages/AccountDeployedMessage.d.ts +0 -2
- package/dist/esm/components/Messages/AccountNotDeployedMessage.d.ts +0 -2
- package/dist/esm/components/Messages/AlertMessage.d.ts +0 -11
- package/dist/esm/components/Messages/AlertMessage.style.d.ts +0 -7
- package/dist/esm/components/Messages/FundsSufficiencyMessage.d.ts +0 -2
- package/dist/esm/components/Messages/GasRefuelMessage.d.ts +0 -2
- package/dist/esm/components/Messages/GasRefuelMessage.style.d.ts +0 -1
- package/dist/esm/components/Messages/GasSufficiencyMessage.d.ts +0 -7
- package/dist/esm/components/Messages/MinFromAmountUSDMessage.d.ts +0 -6
- package/dist/esm/components/Messages/MissingRouteRequiredAccountMessage.d.ts +0 -8
- package/dist/esm/components/Messages/ToAddressRequiredMessage.d.ts +0 -2
- package/dist/esm/components/Messages/ToAddressRequiredMessage.js +0 -13
- package/dist/esm/components/Messages/ToAddressRequiredMessage.js.map +0 -1
- package/dist/esm/components/Messages/WarningMessages.d.ts +0 -8
- package/dist/esm/components/Messages/types.d.ts +0 -1
- package/dist/esm/components/Messages/types.js +0 -2
- package/dist/esm/components/Messages/types.js.map +0 -1
- package/dist/esm/components/Messages/useMessageQueue.d.ts +0 -12
- package/dist/esm/components/NotFound.d.ts +0 -1
- package/dist/esm/components/PageContainer.d.ts +0 -7
- package/dist/esm/components/PageEntered.d.ts +0 -1
- package/dist/esm/components/PoweredBy/PoweredBy.d.ts +0 -1
- package/dist/esm/components/PoweredBy/PoweredBy.style.d.ts +0 -1
- package/dist/esm/components/ProgressToNextUpdate.d.ts +0 -6
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.d.ts +0 -3
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +0 -3
- package/dist/esm/components/RouteCard/RouteCard.d.ts +0 -3
- package/dist/esm/components/RouteCard/RouteCard.style.d.ts +0 -1
- package/dist/esm/components/RouteCard/RouteCard.style.js +0 -8
- package/dist/esm/components/RouteCard/RouteCard.style.js.map +0 -1
- package/dist/esm/components/RouteCard/RouteCardEssentials.d.ts +0 -2
- package/dist/esm/components/RouteCard/RouteCardEssentialsExpanded.d.ts +0 -2
- package/dist/esm/components/RouteCard/RouteCardEssentialsExpanded.js +0 -29
- package/dist/esm/components/RouteCard/RouteCardEssentialsExpanded.js.map +0 -1
- package/dist/esm/components/RouteCard/RouteCardSkeleton.d.ts +0 -3
- package/dist/esm/components/RouteCard/RouteNotFoundCard.d.ts +0 -1
- package/dist/esm/components/RouteCard/getMatchingLabels.d.ts +0 -3
- package/dist/esm/components/RouteCard/types.d.ts +0 -13
- package/dist/esm/components/RouteCard/types.js +0 -2
- package/dist/esm/components/RouteCard/types.js.map +0 -1
- package/dist/esm/components/Routes/Routes.d.ts +0 -2
- package/dist/esm/components/Routes/RoutesContent.d.ts +0 -13
- package/dist/esm/components/Routes/RoutesExpanded.d.ts +0 -6
- package/dist/esm/components/Routes/RoutesExpanded.style.d.ts +0 -8
- package/dist/esm/components/Search/SearchInput.d.ts +0 -15
- package/dist/esm/components/Search/SearchInput.style.d.ts +0 -11
- package/dist/esm/components/Search/SearchNotFound.d.ts +0 -6
- package/dist/esm/components/Search/SearchNotFound.style.d.ts +0 -8
- package/dist/esm/components/SelectChainAndToken.d.ts +0 -2
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.d.ts +0 -5
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.d.ts +0 -11
- package/dist/esm/components/SendToWallet/SendToWallet.style.d.ts +0 -3
- package/dist/esm/components/SendToWallet/SendToWallet.style.js +0 -55
- package/dist/esm/components/SendToWallet/SendToWallet.style.js.map +0 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.d.ts +0 -2
- package/dist/esm/components/SendToWallet/SendToWalletExpandButton.d.ts +0 -1
- package/dist/esm/components/SettingsListItemButton.d.ts +0 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +0 -11
- package/dist/esm/components/Step/CircularProgress.d.ts +0 -4
- package/dist/esm/components/Step/CircularProgress.style.d.ts +0 -7
- package/dist/esm/components/Step/DestinationWalletAddress.d.ts +0 -6
- package/dist/esm/components/Step/Step.d.ts +0 -8
- package/dist/esm/components/Step/StepAction.d.ts +0 -5
- package/dist/esm/components/Step/StepList.d.ts +0 -3
- package/dist/esm/components/StepActions/StepActions.d.ts +0 -2
- package/dist/esm/components/StepActions/StepActions.style.d.ts +0 -10
- package/dist/esm/components/StepActions/types.d.ts +0 -17
- package/dist/esm/components/StepActions/types.js +0 -2
- package/dist/esm/components/StepActions/types.js.map +0 -1
- package/dist/esm/components/StepDivider/StepDivider.d.ts +0 -1
- package/dist/esm/components/StepDivider/StepDivider.style.d.ts +0 -1
- package/dist/esm/components/Switch.d.ts +0 -1
- package/dist/esm/components/Tabs/NavigationTabs.d.ts +0 -4
- package/dist/esm/components/Tabs/Tabs.style.d.ts +0 -4
- package/dist/esm/components/TextFitter/TextFitter.d.ts +0 -3
- package/dist/esm/components/TextFitter/types.d.ts +0 -12
- package/dist/esm/components/TextFitter/types.js +0 -2
- package/dist/esm/components/TextFitter/types.js.map +0 -1
- package/dist/esm/components/Timer/StepTimer.d.ts +0 -5
- package/dist/esm/components/Timer/TimerContent.d.ts +0 -2
- package/dist/esm/components/Token/Token.d.ts +0 -15
- package/dist/esm/components/Token/Token.style.d.ts +0 -5
- package/dist/esm/components/TokenList/PinTokenButton.d.ts +0 -6
- package/dist/esm/components/TokenList/TokenDetailsSheet.d.ts +0 -2
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.d.ts +0 -8
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.d.ts +0 -5
- package/dist/esm/components/TokenList/TokenList.d.ts +0 -3
- package/dist/esm/components/TokenList/TokenList.style.d.ts +0 -7
- package/dist/esm/components/TokenList/TokenListItem.d.ts +0 -3
- package/dist/esm/components/TokenList/TokenNotFound.d.ts +0 -2
- package/dist/esm/components/TokenList/VirtualizedTokenList.d.ts +0 -3
- package/dist/esm/components/TokenList/types.d.ts +0 -51
- package/dist/esm/components/TokenList/types.js +0 -2
- package/dist/esm/components/TokenList/types.js.map +0 -1
- package/dist/esm/components/TokenList/useTokenSelect.d.ts +0 -2
- package/dist/esm/components/TokenRate/TokenRate.d.ts +0 -7
- package/dist/esm/components/TokenRate/TokenRate.style.d.ts +0 -1
- package/dist/esm/components/Tools/ToolItem.d.ts +0 -8
- package/dist/esm/components/Tools/Tools.d.ts +0 -8
- package/dist/esm/components/TransactionDetails.d.ts +0 -7
- package/dist/esm/config/queryClient.d.ts +0 -2
- package/dist/esm/hooks/timer/time.d.ts +0 -11
- package/dist/esm/hooks/timer/useInterval.d.ts +0 -1
- package/dist/esm/hooks/timer/useTimer.d.ts +0 -19
- package/dist/esm/hooks/timer/validate.d.ts +0 -2
- package/dist/esm/hooks/useAccountsBalancesData.d.ts +0 -6
- package/dist/esm/hooks/useActionMessage.d.ts +0 -5
- package/dist/esm/hooks/useAddressActivity.d.ts +0 -8
- package/dist/esm/hooks/useAddressValidation.d.ts +0 -25
- package/dist/esm/hooks/useAvailableChains.d.ts +0 -10
- package/dist/esm/hooks/useChain.d.ts +0 -5
- package/dist/esm/hooks/useChains.d.ts +0 -7
- package/dist/esm/hooks/useDebouncedWatch.d.ts +0 -2
- package/dist/esm/hooks/useDefaultElementId.d.ts +0 -1
- package/dist/esm/hooks/useExplorer.d.ts +0 -15
- package/dist/esm/hooks/useFilteredByTokenBalances.d.ts +0 -9
- package/dist/esm/hooks/useFromAmountThreshold.d.ts +0 -4
- package/dist/esm/hooks/useFromTokenSufficiency.d.ts +0 -5
- package/dist/esm/hooks/useGasRecommendation.d.ts +0 -2
- package/dist/esm/hooks/useGasRefuel.d.ts +0 -7
- package/dist/esm/hooks/useGasSufficiency.d.ts +0 -13
- package/dist/esm/hooks/useHasChainExpansion.d.ts +0 -2
- package/dist/esm/hooks/useHeader.d.ts +0 -2
- package/dist/esm/hooks/useInitializeSDKProviders.d.ts +0 -1
- package/dist/esm/hooks/useInitializer.d.ts +0 -1
- package/dist/esm/hooks/useIsBatchingSupported.d.ts +0 -5
- package/dist/esm/hooks/useIsContractAddress.d.ts +0 -7
- package/dist/esm/hooks/useLanguages.d.ts +0 -5
- package/dist/esm/hooks/useListHeight.d.ts +0 -9
- package/dist/esm/hooks/useLongPress.d.ts +0 -7
- package/dist/esm/hooks/useNavigateBack.d.ts +0 -1
- package/dist/esm/hooks/useRouteExecution.d.ts +0 -14
- package/dist/esm/hooks/useRouteRequiredAccountConnection.d.ts +0 -10
- package/dist/esm/hooks/useRoutes.d.ts +0 -18
- package/dist/esm/hooks/useScrollableContainer.d.ts +0 -3
- package/dist/esm/hooks/useSetContentHeight.d.ts +0 -2
- package/dist/esm/hooks/useSettingMonitor.d.ts +0 -13
- package/dist/esm/hooks/useSwapOnly.d.ts +0 -1
- package/dist/esm/hooks/useToAddressAutoPopulate.d.ts +0 -13
- package/dist/esm/hooks/useToAddressRequirements.d.ts +0 -12
- package/dist/esm/hooks/useToAddressReset.d.ts +0 -4
- package/dist/esm/hooks/useToken.d.ts +0 -4
- package/dist/esm/hooks/useTokenAddressBalance.d.ts +0 -7
- package/dist/esm/hooks/useTokenBalance.d.ts +0 -9
- package/dist/esm/hooks/useTokenBalances.d.ts +0 -9
- package/dist/esm/hooks/useTokenBalancesQueries.d.ts +0 -11
- package/dist/esm/hooks/useTokenSearch.d.ts +0 -6
- package/dist/esm/hooks/useTokens.d.ts +0 -8
- package/dist/esm/hooks/useTools.d.ts +0 -4
- package/dist/esm/hooks/useTransactionDetails.d.ts +0 -4
- package/dist/esm/hooks/useTransactionHistory.d.ts +0 -5
- package/dist/esm/hooks/useWideVariant.d.ts +0 -1
- package/dist/esm/icons/lifi.d.ts +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.d.ts +0 -1
- package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.js +0 -26
- package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.js.map +0 -1
- package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.d.ts +0 -1
- package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +0 -37
- package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js.map +0 -1
- package/dist/esm/pages/LanguagesPage.d.ts +0 -1
- package/dist/esm/pages/MainPage/MainPage.d.ts +0 -1
- package/dist/esm/pages/MainPage/MainWarningMessages.d.ts +0 -7
- package/dist/esm/pages/MainPage/ReviewButton.d.ts +0 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.d.ts +0 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.style.d.ts +0 -1
- package/dist/esm/pages/SelectChainPage/SelectChainPage.d.ts +0 -2
- package/dist/esm/pages/SelectChainPage/types.d.ts +0 -4
- package/dist/esm/pages/SelectChainPage/types.js +0 -2
- package/dist/esm/pages/SelectChainPage/types.js.map +0 -1
- package/dist/esm/pages/SelectEnabledToolsPage.d.ts +0 -3
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -6
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.d.ts +0 -3
- package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.d.ts +0 -8
- package/dist/esm/pages/SendToWallet/BookmarksPage.d.ts +0 -1
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.d.ts +0 -8
- package/dist/esm/pages/SendToWallet/ConnectedWalletsPage.d.ts +0 -1
- package/dist/esm/pages/SendToWallet/EmptyListIndicator.d.ts +0 -6
- package/dist/esm/pages/SendToWallet/RecentWalletsPage.d.ts +0 -1
- package/dist/esm/pages/SendToWallet/SendToConfiguredWalletPage.d.ts +0 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.d.ts +0 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +0 -22
- package/dist/esm/pages/SendToWallet/types.d.ts +0 -4
- package/dist/esm/pages/SendToWallet/types.js +0 -2
- package/dist/esm/pages/SendToWallet/types.js.map +0 -1
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.d.ts +0 -3
- package/dist/esm/pages/SettingsPage/GasPriceSettings.d.ts +0 -1
- package/dist/esm/pages/SettingsPage/LanguageSetting.d.ts +0 -1
- package/dist/esm/pages/SettingsPage/ResetSettingsButton.d.ts +0 -1
- package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.d.ts +0 -1
- package/dist/esm/pages/SettingsPage/RoutePrioritySettings.d.ts +0 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/BadgedValue.d.ts +0 -8
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +0 -2
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.d.ts +0 -17
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.d.ts +0 -6
- package/dist/esm/pages/SettingsPage/SettingsCard/types.d.ts +0 -5
- package/dist/esm/pages/SettingsPage/SettingsCard/types.js +0 -2
- package/dist/esm/pages/SettingsPage/SettingsCard/types.js.map +0 -1
- package/dist/esm/pages/SettingsPage/SettingsPage.d.ts +0 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.d.ts +0 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.d.ts +0 -9
- package/dist/esm/pages/SettingsPage/SmallBalanceFilterSettings.d.ts +0 -1
- package/dist/esm/pages/SettingsPage/ThemeSettings.d.ts +0 -1
- package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.d.ts +0 -5
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.d.ts +0 -1
- package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsSkeleton.d.ts +0 -1
- package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.d.ts +0 -6
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryEmpty.d.ts +0 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryEmpty.js +0 -26
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryEmpty.js.map +0 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryItem.d.ts +0 -5
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryItem.js +0 -72
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryItem.js.map +0 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryPage.d.ts +0 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryPage.js +0 -50
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryPage.js.map +0 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistorySkeleton.d.ts +0 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistorySkeleton.js +0 -27
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistorySkeleton.js.map +0 -1
- package/dist/esm/pages/TransactionHistoryPage/constants.d.ts +0 -1
- package/dist/esm/pages/TransactionHistoryPage/constants.js +0 -2
- package/dist/esm/pages/TransactionHistoryPage/constants.js.map +0 -1
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.d.ts +0 -8
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.d.ts +0 -13
- package/dist/esm/pages/TransactionPage/RouteTracker.d.ts +0 -8
- package/dist/esm/pages/TransactionPage/StartTransactionButton.d.ts +0 -2
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.d.ts +0 -2
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.style.d.ts +0 -8
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.d.ts +0 -9
- package/dist/esm/pages/TransactionPage/TransactionPage.d.ts +0 -1
- package/dist/esm/pages/TransactionPage/types.d.ts +0 -5
- package/dist/esm/pages/TransactionPage/types.js +0 -2
- package/dist/esm/pages/TransactionPage/types.js.map +0 -1
- package/dist/esm/pages/TransactionPage/utils.d.ts +0 -2
- package/dist/esm/providers/I18nProvider/I18nProvider.d.ts +0 -1
- package/dist/esm/providers/I18nProvider/constants.d.ts +0 -3
- package/dist/esm/providers/I18nProvider/enResource.js.map +0 -1
- package/dist/esm/providers/I18nProvider/i18n.d.ts +0 -3
- package/dist/esm/providers/I18nProvider/types.js +0 -2
- package/dist/esm/providers/I18nProvider/types.js.map +0 -1
- package/dist/esm/providers/QueryClientProvider.d.ts +0 -2
- package/dist/esm/providers/SDKClientProvider.d.ts +0 -4
- package/dist/esm/providers/ThemeProvider/ThemeProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.d.ts +0 -7
- package/dist/esm/providers/WalletProvider/useExternalWalletProvider.d.ts +0 -8
- package/dist/esm/providers/WidgetProvider/WidgetProvider.d.ts +0 -3
- package/dist/esm/providers/WidgetProvider/types.d.ts +0 -7
- package/dist/esm/providers/WidgetProvider/types.js +0 -2
- package/dist/esm/providers/WidgetProvider/types.js.map +0 -1
- package/dist/esm/stores/StoreProvider.d.ts +0 -3
- package/dist/esm/stores/bookmarks/BookmarkStore.d.ts +0 -4
- package/dist/esm/stores/bookmarks/createBookmarkStore.d.ts +0 -26
- package/dist/esm/stores/bookmarks/types.js +0 -2
- package/dist/esm/stores/bookmarks/types.js.map +0 -1
- package/dist/esm/stores/bookmarks/useBookmarkActions.d.ts +0 -2
- package/dist/esm/stores/bookmarks/useBookmarks.d.ts +0 -2
- package/dist/esm/stores/chains/ChainOrderStore.d.ts +0 -4
- package/dist/esm/stores/chains/createChainOrderStore.d.ts +0 -30
- package/dist/esm/stores/chains/types.d.ts +0 -24
- package/dist/esm/stores/chains/types.js +0 -2
- package/dist/esm/stores/chains/types.js.map +0 -1
- package/dist/esm/stores/chains/useChainOrder.d.ts +0 -2
- package/dist/esm/stores/form/FormStore.d.ts +0 -7
- package/dist/esm/stores/form/FormStoreContext.d.ts +0 -2
- package/dist/esm/stores/form/FormUpdater.d.ts +0 -4
- package/dist/esm/stores/form/URLSearchParamsBuilder.d.ts +0 -1
- package/dist/esm/stores/form/createFormStore.d.ts +0 -3
- package/dist/esm/stores/form/getDefaultValuesFromQueryString.d.ts +0 -7
- package/dist/esm/stores/form/useFormRef.d.ts +0 -3
- package/dist/esm/stores/form/useFormStore.d.ts +0 -2
- package/dist/esm/stores/form/useTouchedFields.d.ts +0 -11
- package/dist/esm/stores/header/types.d.ts +0 -18
- package/dist/esm/stores/header/types.js +0 -2
- package/dist/esm/stores/header/types.js.map +0 -1
- package/dist/esm/stores/header/useHeaderStore.d.ts +0 -10
- package/dist/esm/stores/inputMode/useInputModeStore.d.ts +0 -9
- package/dist/esm/stores/pinnedTokens/PinnedTokensStore.d.ts +0 -4
- package/dist/esm/stores/pinnedTokens/createPinnedTokensStore.d.ts +0 -19
- package/dist/esm/stores/pinnedTokens/types.d.ts +0 -17
- package/dist/esm/stores/pinnedTokens/types.js +0 -2
- package/dist/esm/stores/pinnedTokens/types.js.map +0 -1
- package/dist/esm/stores/routes/RouteExecutionStore.d.ts +0 -8
- package/dist/esm/stores/routes/createRouteExecutionStore.d.ts +0 -19
- package/dist/esm/stores/routes/types.d.ts +0 -20
- package/dist/esm/stores/routes/useExecutingRoutesIds.d.ts +0 -1
- package/dist/esm/stores/routes/useExecutingRoutesIds.js +0 -15
- package/dist/esm/stores/routes/useExecutingRoutesIds.js.map +0 -1
- package/dist/esm/stores/routes/useIntermediateRoutesStore.d.ts +0 -8
- package/dist/esm/stores/routes/useSetExecutableRoute.d.ts +0 -1
- package/dist/esm/stores/routes/utils.d.ts +0 -8
- package/dist/esm/stores/settings/SettingsStore.d.ts +0 -8
- package/dist/esm/stores/settings/createSettingsStore.d.ts +0 -55
- package/dist/esm/stores/settings/useSendToWalletStore.d.ts +0 -6
- package/dist/esm/stores/settings/useSendToWalletStore.js +0 -18
- package/dist/esm/stores/settings/useSendToWalletStore.js.map +0 -1
- package/dist/esm/stores/settings/useSettings.d.ts +0 -2
- package/dist/esm/stores/settings/useSettingsActions.d.ts +0 -10
- package/dist/esm/stores/settings/useSplitSubvariantStore.d.ts +0 -3
- package/dist/esm/stores/settings/utils/getStateValues.d.ts +0 -2
- package/dist/esm/stores/types.d.ts +0 -5
- package/dist/esm/stores/types.js +0 -2
- package/dist/esm/stores/types.js.map +0 -1
- package/dist/esm/themes/types.js +0 -2
- package/dist/esm/themes/types.js.map +0 -1
- package/dist/esm/themes/utils.d.ts +0 -4
- package/dist/esm/types/token.js +0 -2
- package/dist/esm/types/token.js.map +0 -1
- package/dist/esm/utils/chainType.d.ts +0 -8
- package/dist/esm/utils/compactNumberFormatter.test.d.ts +0 -1
- package/dist/esm/utils/compactNumberFormatter.test.js +0 -64
- package/dist/esm/utils/compactNumberFormatter.test.js.map +0 -1
- package/dist/esm/utils/converters.d.ts +0 -3
- package/dist/esm/utils/deepEqual.d.ts +0 -2
- package/dist/esm/utils/deepMerge.d.ts +0 -1
- package/dist/esm/utils/elements.d.ts +0 -11
- package/dist/esm/utils/enum.d.ts +0 -1
- package/dist/esm/utils/fees.d.ts +0 -13
- package/dist/esm/utils/format.test.d.ts +0 -1
- package/dist/esm/utils/format.test.js +0 -47
- package/dist/esm/utils/format.test.js.map +0 -1
- package/dist/esm/utils/getActionMessage.d.ts +0 -7
- package/dist/esm/utils/getErrorMessage.d.ts +0 -6
- package/dist/esm/utils/input.d.ts +0 -1
- package/dist/esm/utils/item.d.ts +0 -6
- package/dist/esm/utils/prepareActions.d.ts +0 -2
- package/dist/esm/utils/queries.d.ts +0 -1
- package/dist/esm/utils/timer.d.ts +0 -7
- package/dist/esm/utils/token.d.ts +0 -19
- package/dist/esm/utils/tokenList.d.ts +0 -10
- package/dist/esm/utils/variant.d.ts +0 -2
- package/dist/esm/utils/wallet.d.ts +0 -1
- package/dist/esm/utils/widgetSize.d.ts +0 -3
- package/src/components/ActiveTransactions/ActiveTransactionItem.tsx +0 -112
- package/src/components/ActiveTransactions/ActiveTransactions.style.ts +0 -28
- package/src/components/ActiveTransactions/ActiveTransactions.tsx +0 -47
- package/src/components/AmountInput/AmountInputAdornment.style.tsx +0 -69
- package/src/components/Header/TransactionHistoryButton.tsx +0 -21
- package/src/components/Messages/ToAddressRequiredMessage.tsx +0 -27
- package/src/components/RouteCard/RouteCard.style.ts +0 -8
- package/src/components/RouteCard/RouteCardEssentialsExpanded.tsx +0 -57
- package/src/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.tsx +0 -45
- package/src/pages/ActiveTransactionsPage/ActiveTransactionsPage.tsx +0 -96
- package/src/pages/TransactionHistoryPage/TransactionHistoryItem.tsx +0 -118
- package/src/pages/TransactionHistoryPage/TransactionHistoryPage.tsx +0 -92
- package/src/pages/TransactionHistoryPage/TransactionHistorySkeleton.tsx +0 -58
- package/src/pages/TransactionHistoryPage/constants.ts +0 -1
- package/src/stores/routes/useExecutingRoutesIds.ts +0 -24
- package/src/stores/settings/useSendToWalletStore.ts +0 -25
- /package/src/pages/{TransactionHistoryPage → ActivitiesPage}/TransactionHistoryEmpty.tsx +0 -0
|
@@ -1,92 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { createFormStore, formDefaultValues } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { useWidgetConfig } from "../../providers/WidgetProvider/WidgetProvider.js";
|
|
2
|
+
import { FormStoreContext } from "./FormStoreContext.js";
|
|
3
|
+
import { getDefaultValuesFromQueryString } from "./getDefaultValuesFromQueryString.js";
|
|
4
|
+
import { createFormStore, formDefaultValues } from "./createFormStore.js";
|
|
5
|
+
import { FormUpdater } from "./FormUpdater.js";
|
|
6
|
+
import { useFormRef } from "./useFormRef.js";
|
|
7
|
+
import { useMemo, useRef } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/stores/form/FormStore.tsx
|
|
10
10
|
const initialiseDefaultValues = (defaultValues) => ({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
toAmount: (typeof defaultValues.toAmount === 'number'
|
|
17
|
-
? defaultValues.toAmount?.toPrecision?.()
|
|
18
|
-
: defaultValues.toAmount) || formDefaultValues.toAmount,
|
|
19
|
-
// Prevent setting address when the field is hidden
|
|
20
|
-
toAddress: defaultValues.toAddress || formDefaultValues.toAddress,
|
|
11
|
+
...formDefaultValues,
|
|
12
|
+
...defaultValues,
|
|
13
|
+
fromAmount: (typeof defaultValues.fromAmount === "number" ? defaultValues.fromAmount?.toPrecision?.() : defaultValues.fromAmount) || formDefaultValues.fromAmount,
|
|
14
|
+
toAmount: (typeof defaultValues.toAmount === "number" ? defaultValues.toAmount?.toPrecision?.() : defaultValues.toAmount) || formDefaultValues.toAmount,
|
|
15
|
+
toAddress: defaultValues.toAddress || formDefaultValues.toAddress
|
|
21
16
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
configHasFromAmount,
|
|
74
|
-
configHasToAmount,
|
|
75
|
-
configHasToAddress,
|
|
76
|
-
configHasToChain,
|
|
77
|
-
configHasToToken,
|
|
78
|
-
]);
|
|
79
|
-
if (!storeRef.current) {
|
|
80
|
-
const queryDefaults = getDefaultValuesFromQueryString({
|
|
81
|
-
buildUrl,
|
|
82
|
-
includeToAddress: false,
|
|
83
|
-
});
|
|
84
|
-
storeRef.current = createFormStore(initialiseDefaultValues({
|
|
85
|
-
...reactiveFormValues,
|
|
86
|
-
...queryDefaults,
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
|
-
useFormRef(storeRef.current, formRef);
|
|
90
|
-
return (_jsxs(FormStoreContext.Provider, { value: storeRef.current, children: [children, _jsx(FormUpdater, { reactiveFormValues: reactiveFormValues })] }));
|
|
17
|
+
const FormStoreProvider = ({ children, formRef }) => {
|
|
18
|
+
const widgetConfig = useWidgetConfig();
|
|
19
|
+
const { fromChain, fromToken, toChain, toToken, fromAmount, toAmount, toAddress, formUpdateKey, buildUrl } = widgetConfig;
|
|
20
|
+
const storeRef = useRef(null);
|
|
21
|
+
const configHasFromChain = Object.hasOwn(widgetConfig, "fromChain");
|
|
22
|
+
const configHasFromToken = Object.hasOwn(widgetConfig, "fromToken");
|
|
23
|
+
const configHasFromAmount = Object.hasOwn(widgetConfig, "fromAmount");
|
|
24
|
+
const configHasToAmount = Object.hasOwn(widgetConfig, "toAmount");
|
|
25
|
+
const configHasToAddress = Object.hasOwn(widgetConfig, "toAddress");
|
|
26
|
+
const configHasToChain = Object.hasOwn(widgetConfig, "toChain");
|
|
27
|
+
const configHasToToken = Object.hasOwn(widgetConfig, "toToken");
|
|
28
|
+
const reactiveFormValues = useMemo(() => ({
|
|
29
|
+
...configHasFromChain ? { fromChain } : void 0,
|
|
30
|
+
...configHasFromToken ? { fromToken } : void 0,
|
|
31
|
+
...configHasFromAmount ? { fromAmount: (typeof fromAmount === "number" ? fromAmount?.toPrecision() : fromAmount) || formDefaultValues.fromAmount } : void 0,
|
|
32
|
+
...configHasToAmount ? { toAmount: (typeof toAmount === "number" ? toAmount?.toPrecision() : toAmount) || formDefaultValues.toAmount } : void 0,
|
|
33
|
+
...configHasToChain ? { toChain } : void 0,
|
|
34
|
+
...configHasToToken ? { toToken } : void 0,
|
|
35
|
+
...configHasToAddress ? { toAddress: toAddress?.address || formDefaultValues.toAddress } : void 0
|
|
36
|
+
}), [
|
|
37
|
+
fromAmount,
|
|
38
|
+
toAmount,
|
|
39
|
+
fromChain,
|
|
40
|
+
fromToken,
|
|
41
|
+
toAddress,
|
|
42
|
+
toChain,
|
|
43
|
+
toToken,
|
|
44
|
+
formUpdateKey,
|
|
45
|
+
configHasFromChain,
|
|
46
|
+
configHasFromToken,
|
|
47
|
+
configHasFromAmount,
|
|
48
|
+
configHasToAmount,
|
|
49
|
+
configHasToAddress,
|
|
50
|
+
configHasToChain,
|
|
51
|
+
configHasToToken
|
|
52
|
+
]);
|
|
53
|
+
if (!storeRef.current) {
|
|
54
|
+
const queryDefaults = getDefaultValuesFromQueryString({
|
|
55
|
+
buildUrl,
|
|
56
|
+
includeToAddress: false
|
|
57
|
+
});
|
|
58
|
+
storeRef.current = createFormStore(initialiseDefaultValues({
|
|
59
|
+
...reactiveFormValues,
|
|
60
|
+
...queryDefaults
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
useFormRef(storeRef.current, formRef);
|
|
64
|
+
return /* @__PURE__ */ jsxs(FormStoreContext.Provider, {
|
|
65
|
+
value: storeRef.current,
|
|
66
|
+
children: [children, /* @__PURE__ */ jsx(FormUpdater, { reactiveFormValues })]
|
|
67
|
+
});
|
|
91
68
|
};
|
|
69
|
+
//#endregion
|
|
70
|
+
export { FormStoreProvider };
|
|
71
|
+
|
|
92
72
|
//# sourceMappingURL=FormStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormStore.js","
|
|
1
|
+
{"version":3,"file":"FormStore.js","names":[],"sources":["../../../../src/stores/form/FormStore.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react'\nimport { useMemo, useRef } from 'react'\nimport { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'\nimport type { FormRef } from '../../types/widget.js'\nimport { createFormStore, formDefaultValues } from './createFormStore.js'\nimport { FormStoreContext } from './FormStoreContext.js'\nimport { FormUpdater } from './FormUpdater.js'\nimport { getDefaultValuesFromQueryString } from './getDefaultValuesFromQueryString.js'\nimport type { DefaultValues, FormStoreStore } from './types.js'\nimport { useFormRef } from './useFormRef.js'\n\n// decorates and initialise the form date for use in the form store\nconst initialiseDefaultValues = (defaultValues: Partial<DefaultValues>) => ({\n ...formDefaultValues,\n ...defaultValues,\n fromAmount:\n (typeof defaultValues.fromAmount === 'number'\n ? (defaultValues.fromAmount as number)?.toPrecision?.()\n : defaultValues.fromAmount) || formDefaultValues.fromAmount,\n toAmount:\n (typeof defaultValues.toAmount === 'number'\n ? (defaultValues.toAmount as number)?.toPrecision?.()\n : defaultValues.toAmount) || formDefaultValues.toAmount,\n // Prevent setting address when the field is hidden\n toAddress: defaultValues.toAddress || formDefaultValues.toAddress,\n})\n\ninterface FormStoreProviderProps extends PropsWithChildren {\n formRef?: FormRef\n}\n\nexport const FormStoreProvider: React.FC<FormStoreProviderProps> = ({\n children,\n formRef,\n}) => {\n const widgetConfig = useWidgetConfig()\n\n const {\n fromChain,\n fromToken,\n toChain,\n toToken,\n fromAmount,\n toAmount,\n toAddress,\n formUpdateKey,\n buildUrl,\n } = widgetConfig\n\n const storeRef = useRef<FormStoreStore>(null)\n\n const configHasFromChain = Object.hasOwn(widgetConfig, 'fromChain')\n const configHasFromToken = Object.hasOwn(widgetConfig, 'fromToken')\n const configHasFromAmount = Object.hasOwn(widgetConfig, 'fromAmount')\n const configHasToAmount = Object.hasOwn(widgetConfig, 'toAmount')\n const configHasToAddress = Object.hasOwn(widgetConfig, 'toAddress')\n const configHasToChain = Object.hasOwn(widgetConfig, 'toChain')\n const configHasToToken = Object.hasOwn(widgetConfig, 'toToken')\n\n // We use the presence/absence of a property to decide if the form values in state need to be updated\n // We only build and set a property on the memoized form values here if they are included in the\n // config - undefined is considered a valid value that will reset that form field\n // biome-ignore lint/correctness/useExhaustiveDependencies: formUpdateKey is needed here.\n const reactiveFormValues = useMemo(\n () => ({\n ...(configHasFromChain ? { fromChain } : undefined),\n ...(configHasFromToken ? { fromToken } : undefined),\n ...(configHasFromAmount\n ? {\n fromAmount:\n (typeof fromAmount === 'number'\n ? fromAmount?.toPrecision()\n : fromAmount) || formDefaultValues.fromAmount,\n }\n : undefined),\n ...(configHasToAmount\n ? {\n toAmount:\n (typeof toAmount === 'number'\n ? toAmount?.toPrecision()\n : toAmount) || formDefaultValues.toAmount,\n }\n : undefined),\n ...(configHasToChain ? { toChain } : undefined),\n ...(configHasToToken ? { toToken } : undefined),\n ...(configHasToAddress\n ? {\n toAddress: toAddress?.address || formDefaultValues.toAddress,\n }\n : undefined),\n }),\n [\n fromAmount,\n toAmount,\n fromChain,\n fromToken,\n toAddress,\n toChain,\n toToken,\n // formUpdateKey should be a randomly assigned unique key. It can be used to force updates for the form field values\n formUpdateKey,\n configHasFromChain,\n configHasFromToken,\n configHasFromAmount,\n configHasToAmount,\n configHasToAddress,\n configHasToChain,\n configHasToToken,\n ]\n )\n\n if (!storeRef.current) {\n const queryDefaults = getDefaultValuesFromQueryString({\n buildUrl,\n includeToAddress: false,\n })\n storeRef.current = createFormStore(\n initialiseDefaultValues({\n ...reactiveFormValues,\n ...queryDefaults,\n })\n )\n }\n\n useFormRef(storeRef.current, formRef)\n\n return (\n <FormStoreContext.Provider value={storeRef.current}>\n {children}\n <FormUpdater reactiveFormValues={reactiveFormValues} />\n </FormStoreContext.Provider>\n )\n}\n"],"mappings":";;;;;;;;;AAYA,MAAM,2BAA2B,mBAA2C;CAC1E,GAAG;CACH,GAAG;CACH,aACG,OAAO,cAAc,eAAe,WAChC,cAAc,YAAuB,eAAe,GACrD,cAAc,eAAe,kBAAkB;CACrD,WACG,OAAO,cAAc,aAAa,WAC9B,cAAc,UAAqB,eAAe,GACnD,cAAc,aAAa,kBAAkB;CAEnD,WAAW,cAAc,aAAa,kBAAkB;CACzD;AAMD,MAAa,qBAAuD,EAClE,UACA,cACI;CACJ,MAAM,eAAe,iBAAiB;CAEtC,MAAM,EACJ,WACA,WACA,SACA,SACA,YACA,UACA,WACA,eACA,aACE;CAEJ,MAAM,WAAW,OAAuB,KAAK;CAE7C,MAAM,qBAAqB,OAAO,OAAO,cAAc,YAAY;CACnE,MAAM,qBAAqB,OAAO,OAAO,cAAc,YAAY;CACnE,MAAM,sBAAsB,OAAO,OAAO,cAAc,aAAa;CACrE,MAAM,oBAAoB,OAAO,OAAO,cAAc,WAAW;CACjE,MAAM,qBAAqB,OAAO,OAAO,cAAc,YAAY;CACnE,MAAM,mBAAmB,OAAO,OAAO,cAAc,UAAU;CAC/D,MAAM,mBAAmB,OAAO,OAAO,cAAc,UAAU;CAM/D,MAAM,qBAAqB,eAClB;EACL,GAAI,qBAAqB,EAAE,WAAW,GAAG,KAAA;EACzC,GAAI,qBAAqB,EAAE,WAAW,GAAG,KAAA;EACzC,GAAI,sBACA,EACE,aACG,OAAO,eAAe,WACnB,YAAY,aAAa,GACzB,eAAe,kBAAkB,YACxC,GACD,KAAA;EACJ,GAAI,oBACA,EACE,WACG,OAAO,aAAa,WACjB,UAAU,aAAa,GACvB,aAAa,kBAAkB,UACtC,GACD,KAAA;EACJ,GAAI,mBAAmB,EAAE,SAAS,GAAG,KAAA;EACrC,GAAI,mBAAmB,EAAE,SAAS,GAAG,KAAA;EACrC,GAAI,qBACA,EACE,WAAW,WAAW,WAAW,kBAAkB,WACpD,GACD,KAAA;EACL,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,KAAI,CAAC,SAAS,SAAS;EACrB,MAAM,gBAAgB,gCAAgC;GACpD;GACA,kBAAkB;GACnB,CAAC;AACF,WAAS,UAAU,gBACjB,wBAAwB;GACtB,GAAG;GACH,GAAG;GACJ,CAAC,CACH;;AAGH,YAAW,SAAS,SAAS,QAAQ;AAErC,QACE,qBAAC,iBAAiB,UAAlB;EAA2B,OAAO,SAAS;YAA3C,CACG,UACD,oBAAC,aAAD,EAAiC,oBAAsB,CAAA,CAC7B"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import { createContext } from
|
|
2
|
-
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
//#region src/stores/form/FormStoreContext.ts
|
|
3
|
+
const FormStoreContext = createContext(null);
|
|
4
|
+
//#endregion
|
|
5
|
+
export { FormStoreContext };
|
|
6
|
+
|
|
3
7
|
//# sourceMappingURL=FormStoreContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormStoreContext.js","
|
|
1
|
+
{"version":3,"file":"FormStoreContext.js","names":[],"sources":["../../../../src/stores/form/FormStoreContext.ts"],"sourcesContent":["import { type Context, createContext } from 'react'\nimport type { FormStoreStore } from './types.js'\n\nexport const FormStoreContext: Context<FormStoreStore | null> =\n createContext<FormStoreStore | null>(null)\n"],"mappings":";;AAGA,MAAa,mBACX,cAAqC,KAAK"}
|
|
@@ -1,46 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
setUserAndDefaultValues(accountForChainId(reactiveFormValues, account.chainId));
|
|
25
|
-
}, [
|
|
26
|
-
toAddress,
|
|
27
|
-
reactiveFormValues,
|
|
28
|
-
setUserAndDefaultValues,
|
|
29
|
-
setSendToWallet,
|
|
30
|
-
setSelectedBookmark,
|
|
31
|
-
]);
|
|
32
|
-
return null;
|
|
1
|
+
import { useWidgetConfig } from "../../providers/WidgetProvider/WidgetProvider.js";
|
|
2
|
+
import { useBookmarkActions } from "../bookmarks/useBookmarkActions.js";
|
|
3
|
+
import { useFieldActions } from "./useFieldActions.js";
|
|
4
|
+
import { formDefaultValues } from "./createFormStore.js";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
|
+
import { useAccount } from "@lifi/wallet-management";
|
|
7
|
+
//#region src/stores/form/FormUpdater.tsx
|
|
8
|
+
const FormUpdater = ({ reactiveFormValues }) => {
|
|
9
|
+
const { toAddress } = useWidgetConfig();
|
|
10
|
+
const { account } = useAccount();
|
|
11
|
+
const { setSelectedBookmark } = useBookmarkActions();
|
|
12
|
+
const { setUserAndDefaultValues } = useFieldActions();
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (toAddress) setSelectedBookmark(toAddress);
|
|
15
|
+
setUserAndDefaultValues(accountForChainId(reactiveFormValues, account.chainId));
|
|
16
|
+
}, [
|
|
17
|
+
toAddress,
|
|
18
|
+
reactiveFormValues,
|
|
19
|
+
setUserAndDefaultValues,
|
|
20
|
+
setSelectedBookmark
|
|
21
|
+
]);
|
|
22
|
+
return null;
|
|
33
23
|
};
|
|
34
24
|
const accountForChainId = (defaultValues, chainId) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
return result;
|
|
25
|
+
const result = { ...defaultValues };
|
|
26
|
+
for (const key in result) {
|
|
27
|
+
const k = key;
|
|
28
|
+
if (result[k] === formDefaultValues[k]) {
|
|
29
|
+
if ((k === "fromChain" || k === "toChain") && chainId) result[k] = chainId;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
45
33
|
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { FormUpdater };
|
|
36
|
+
|
|
46
37
|
//# sourceMappingURL=FormUpdater.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormUpdater.js","
|
|
1
|
+
{"version":3,"file":"FormUpdater.js","names":[],"sources":["../../../../src/stores/form/FormUpdater.tsx"],"sourcesContent":["import { useAccount } from '@lifi/wallet-management'\nimport { useEffect } from 'react'\nimport { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'\nimport { useBookmarkActions } from '../../stores/bookmarks/useBookmarkActions.js'\nimport { formDefaultValues } from '../../stores/form/createFormStore.js'\nimport type { DefaultValues } from './types.js'\nimport { useFieldActions } from './useFieldActions.js'\n\nexport const FormUpdater: React.FC<{\n reactiveFormValues: Partial<DefaultValues>\n}> = ({ reactiveFormValues }) => {\n const { toAddress } = useWidgetConfig()\n const { account } = useAccount()\n const { setSelectedBookmark } = useBookmarkActions()\n const { setUserAndDefaultValues } = useFieldActions()\n\n // React to changes in widget config options (reactiveFormValues), updating userValues accordingly.\n // Includes special logic for chain fields, where account.chainId is only a fallback and not a direct reactivity source.\n // biome-ignore lint/correctness/useExhaustiveDependencies: account.chainId is used as a fallback only and does not need to be a dependency for reactivity.\n useEffect(() => {\n if (toAddress) {\n setSelectedBookmark(toAddress)\n }\n\n setUserAndDefaultValues(\n accountForChainId(reactiveFormValues, account.chainId)\n )\n }, [\n toAddress,\n reactiveFormValues,\n setUserAndDefaultValues,\n setSelectedBookmark,\n ])\n\n return null\n}\n\nconst accountForChainId = (\n defaultValues: Partial<DefaultValues>,\n chainId?: number\n) => {\n const result: Partial<DefaultValues> = { ...defaultValues }\n for (const key in result) {\n const k = key as keyof DefaultValues\n if (result[k] === formDefaultValues[k]) {\n if ((k === 'fromChain' || k === 'toChain') && chainId) {\n result[k] = chainId\n }\n }\n }\n return result\n}\n"],"mappings":";;;;;;;AAQA,MAAa,eAEP,EAAE,yBAAyB;CAC/B,MAAM,EAAE,cAAc,iBAAiB;CACvC,MAAM,EAAE,YAAY,YAAY;CAChC,MAAM,EAAE,wBAAwB,oBAAoB;CACpD,MAAM,EAAE,4BAA4B,iBAAiB;AAKrD,iBAAgB;AACd,MAAI,UACF,qBAAoB,UAAU;AAGhC,0BACE,kBAAkB,oBAAoB,QAAQ,QAAQ,CACvD;IACA;EACD;EACA;EACA;EACA;EACD,CAAC;AAEF,QAAO;;AAGT,MAAM,qBACJ,eACA,YACG;CACH,MAAM,SAAiC,EAAE,GAAG,eAAe;AAC3D,MAAK,MAAM,OAAO,QAAQ;EACxB,MAAM,IAAI;AACV,MAAI,OAAO,OAAO,kBAAkB;QAC7B,MAAM,eAAe,MAAM,cAAc,QAC5C,QAAO,KAAK;;;AAIlB,QAAO"}
|
|
@@ -1,91 +1,79 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { useWidgetConfig } from "../../providers/WidgetProvider/WidgetProvider.js";
|
|
2
|
+
import { useFieldValues } from "./useFieldValues.js";
|
|
3
|
+
import { useBookmarkActions } from "../bookmarks/useBookmarkActions.js";
|
|
4
|
+
import { useFieldActions } from "./useFieldActions.js";
|
|
5
|
+
import { getDefaultValuesFromQueryString } from "./getDefaultValuesFromQueryString.js";
|
|
6
|
+
import { useAddressValidation } from "../../hooks/useAddressValidation.js";
|
|
7
|
+
import { useTouchedFields } from "./useTouchedFields.js";
|
|
8
|
+
import { useEffect } from "react";
|
|
9
|
+
import { useLocation } from "@tanstack/react-router";
|
|
10
|
+
//#region src/stores/form/URLSearchParamsBuilder.tsx
|
|
11
11
|
const formValueKeys = [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
"fromAmount",
|
|
13
|
+
"fromChain",
|
|
14
|
+
"fromToken",
|
|
15
|
+
"toAddress",
|
|
16
|
+
"toChain",
|
|
17
|
+
"toToken"
|
|
18
18
|
];
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// set the values on the querysting
|
|
76
|
-
const url = new URL(window.location);
|
|
77
|
-
formValueKeys.forEach((key, _index) => {
|
|
78
|
-
const value = getFieldValues(key)[0];
|
|
79
|
-
if (isTouched(key) && value) {
|
|
80
|
-
url.searchParams.set(key, value.toString());
|
|
81
|
-
}
|
|
82
|
-
else if (url.searchParams.has(key) && !value) {
|
|
83
|
-
url.searchParams.delete(key);
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
url.searchParams.sort();
|
|
87
|
-
window.history.replaceState(window.history.state, '', url);
|
|
88
|
-
}, [pathname, touchedFields, values, isTouched, getFieldValues]);
|
|
89
|
-
return null;
|
|
19
|
+
const URLSearchParamsBuilder = () => {
|
|
20
|
+
const { pathname } = useLocation();
|
|
21
|
+
const touchedFields = useTouchedFields();
|
|
22
|
+
const values = useFieldValues(...formValueKeys);
|
|
23
|
+
const { setSelectedBookmark, addRecentWallet } = useBookmarkActions();
|
|
24
|
+
const { validateAddress } = useAddressValidation();
|
|
25
|
+
const { buildUrl } = useWidgetConfig();
|
|
26
|
+
const { getFieldValues, isTouched, setUserAndDefaultValues } = useFieldActions();
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const { toAddress, ...initialFormValues } = getDefaultValuesFromQueryString({ buildUrl });
|
|
29
|
+
/**
|
|
30
|
+
* When URL builder is enabled and user opens a page with toAddress parameter,
|
|
31
|
+
* validate the address and set it up as a bookmark. This allows direct linking
|
|
32
|
+
* to the widget with a pre-filled destination address that will be treated the
|
|
33
|
+
* same way as a manually entered and validated address.
|
|
34
|
+
*/
|
|
35
|
+
const initializeFromAddress = async () => {
|
|
36
|
+
if (toAddress) try {
|
|
37
|
+
const validationResult = await validateAddress({ value: toAddress });
|
|
38
|
+
if (validationResult.isValid && toAddress) {
|
|
39
|
+
const bookmark = {
|
|
40
|
+
address: validationResult.address,
|
|
41
|
+
chainType: validationResult.chainType
|
|
42
|
+
};
|
|
43
|
+
setUserAndDefaultValues({ toAddress });
|
|
44
|
+
setSelectedBookmark(bookmark);
|
|
45
|
+
addRecentWallet(bookmark);
|
|
46
|
+
}
|
|
47
|
+
} catch (_) {}
|
|
48
|
+
};
|
|
49
|
+
setUserAndDefaultValues(initialFormValues);
|
|
50
|
+
initializeFromAddress();
|
|
51
|
+
}, [
|
|
52
|
+
setUserAndDefaultValues,
|
|
53
|
+
validateAddress,
|
|
54
|
+
setSelectedBookmark,
|
|
55
|
+
addRecentWallet,
|
|
56
|
+
buildUrl
|
|
57
|
+
]);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
const url = new URL(window.location);
|
|
60
|
+
formValueKeys.forEach((key, _index) => {
|
|
61
|
+
const value = getFieldValues(key)[0];
|
|
62
|
+
if (isTouched(key) && value) url.searchParams.set(key, value.toString());
|
|
63
|
+
else if (url.searchParams.has(key) && !value) url.searchParams.delete(key);
|
|
64
|
+
});
|
|
65
|
+
url.searchParams.sort();
|
|
66
|
+
window.history.replaceState(window.history.state, "", url);
|
|
67
|
+
}, [
|
|
68
|
+
pathname,
|
|
69
|
+
touchedFields,
|
|
70
|
+
values,
|
|
71
|
+
isTouched,
|
|
72
|
+
getFieldValues
|
|
73
|
+
]);
|
|
74
|
+
return null;
|
|
90
75
|
};
|
|
76
|
+
//#endregion
|
|
77
|
+
export { URLSearchParamsBuilder };
|
|
78
|
+
|
|
91
79
|
//# sourceMappingURL=URLSearchParamsBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"URLSearchParamsBuilder.js","
|
|
1
|
+
{"version":3,"file":"URLSearchParamsBuilder.js","names":[],"sources":["../../../../src/stores/form/URLSearchParamsBuilder.tsx"],"sourcesContent":["import { useLocation } from '@tanstack/react-router'\nimport { useEffect } from 'react'\nimport { useAddressValidation } from '../../hooks/useAddressValidation.js'\nimport { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'\nimport { useBookmarkActions } from '../bookmarks/useBookmarkActions.js'\nimport type { FormFieldNames } from '../form/types.js'\nimport { useFieldActions } from '../form/useFieldActions.js'\nimport { useFieldValues } from '../form/useFieldValues.js'\nimport { useTouchedFields } from '../form/useTouchedFields.js'\nimport { getDefaultValuesFromQueryString } from './getDefaultValuesFromQueryString.js'\n\nconst formValueKeys: FormFieldNames[] = [\n 'fromAmount',\n 'fromChain',\n 'fromToken',\n 'toAddress',\n 'toChain',\n 'toToken',\n]\n\nexport const URLSearchParamsBuilder = () => {\n const { pathname } = useLocation()\n const touchedFields = useTouchedFields()\n const values = useFieldValues(...formValueKeys)\n const { setSelectedBookmark, addRecentWallet } = useBookmarkActions()\n const { validateAddress } = useAddressValidation()\n const { buildUrl } = useWidgetConfig()\n // Using these methods as trying to use the touchedFields and values above\n // often has a lag that can effect the widgets initialisation sequence\n // and accidentally cause values to be wiped from the query string\n const { getFieldValues, isTouched, setUserAndDefaultValues } =\n useFieldActions()\n\n useEffect(() => {\n // get the initial values from the querystring\n const formValues = getDefaultValuesFromQueryString({ buildUrl })\n const { toAddress, ...initialFormValues } = formValues\n\n /**\n * When URL builder is enabled and user opens a page with toAddress parameter,\n * validate the address and set it up as a bookmark. This allows direct linking\n * to the widget with a pre-filled destination address that will be treated the\n * same way as a manually entered and validated address.\n */\n const initializeFromAddress = async () => {\n if (toAddress) {\n try {\n const validationResult = await validateAddress({\n value: toAddress,\n })\n if (validationResult.isValid && toAddress) {\n const bookmark = {\n address: validationResult.address,\n chainType: validationResult.chainType,\n }\n setUserAndDefaultValues({ toAddress })\n setSelectedBookmark(bookmark)\n addRecentWallet(bookmark)\n }\n } catch (_) {\n // Address validation failed\n }\n }\n }\n\n setUserAndDefaultValues(initialFormValues)\n initializeFromAddress()\n }, [\n setUserAndDefaultValues,\n validateAddress,\n setSelectedBookmark,\n addRecentWallet,\n buildUrl,\n ])\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: run only when pathname changes\n useEffect(() => {\n // set the values on the querysting\n const url = new URL(window.location as any)\n formValueKeys.forEach((key, _index) => {\n const value = getFieldValues(key)[0]\n if (isTouched(key) && value) {\n url.searchParams.set(key, value.toString())\n } else if (url.searchParams.has(key) && !value) {\n url.searchParams.delete(key)\n }\n })\n url.searchParams.sort()\n window.history.replaceState(window.history.state, '', url)\n }, [pathname, touchedFields, values, isTouched, getFieldValues])\n\n return null\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAM,gBAAkC;CACtC;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,+BAA+B;CAC1C,MAAM,EAAE,aAAa,aAAa;CAClC,MAAM,gBAAgB,kBAAkB;CACxC,MAAM,SAAS,eAAe,GAAG,cAAc;CAC/C,MAAM,EAAE,qBAAqB,oBAAoB,oBAAoB;CACrE,MAAM,EAAE,oBAAoB,sBAAsB;CAClD,MAAM,EAAE,aAAa,iBAAiB;CAItC,MAAM,EAAE,gBAAgB,WAAW,4BACjC,iBAAiB;AAEnB,iBAAgB;EAGd,MAAM,EAAE,WAAW,GAAG,sBADH,gCAAgC,EAAE,UAAU,CAAC;;;;;;;EAShE,MAAM,wBAAwB,YAAY;AACxC,OAAI,UACF,KAAI;IACF,MAAM,mBAAmB,MAAM,gBAAgB,EAC7C,OAAO,WACR,CAAC;AACF,QAAI,iBAAiB,WAAW,WAAW;KACzC,MAAM,WAAW;MACf,SAAS,iBAAiB;MAC1B,WAAW,iBAAiB;MAC7B;AACD,6BAAwB,EAAE,WAAW,CAAC;AACtC,yBAAoB,SAAS;AAC7B,qBAAgB,SAAS;;YAEpB,GAAG;;AAMhB,0BAAwB,kBAAkB;AAC1C,yBAAuB;IACtB;EACD;EACA;EACA;EACA;EACA;EACD,CAAC;AAGF,iBAAgB;EAEd,MAAM,MAAM,IAAI,IAAI,OAAO,SAAgB;AAC3C,gBAAc,SAAS,KAAK,WAAW;GACrC,MAAM,QAAQ,eAAe,IAAI,CAAC;AAClC,OAAI,UAAU,IAAI,IAAI,MACpB,KAAI,aAAa,IAAI,KAAK,MAAM,UAAU,CAAC;YAClC,IAAI,aAAa,IAAI,IAAI,IAAI,CAAC,MACvC,KAAI,aAAa,OAAO,IAAI;IAE9B;AACF,MAAI,aAAa,MAAM;AACvB,SAAO,QAAQ,aAAa,OAAO,QAAQ,OAAO,IAAI,IAAI;IACzD;EAAC;EAAU;EAAe;EAAQ;EAAW;EAAe,CAAC;AAEhE,QAAO"}
|