@lifi/widget 3.29.1 → 3.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/esm/AppProvider.d.ts +0 -1
- package/dist/esm/AppProvider.js +1 -1
- package/dist/esm/AppProvider.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.d.ts +0 -9
- package/dist/esm/components/AmountInput/AmountInput.js +1 -1
- package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +0 -1
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.js +1 -6
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.d.ts +1 -1
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js +3 -2
- package/dist/esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.d.ts +1 -7
- package/dist/esm/components/AmountInput/PriceFormHelperText.js +4 -3
- package/dist/esm/components/AmountInput/PriceFormHelperText.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.d.ts +0 -4
- package/dist/esm/components/Avatar/Avatar.js +1 -1
- package/dist/esm/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/Avatar/TokenAvatar.d.ts +0 -15
- package/dist/esm/components/Avatar/TokenAvatar.js +2 -2
- package/dist/esm/components/Avatar/TokenAvatar.js.map +1 -1
- package/dist/esm/components/Card/CardButton.style.d.ts +0 -1
- package/dist/esm/components/Card/CardButton.style.js +0 -7
- package/dist/esm/components/Card/CardButton.style.js.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.js +35 -18
- package/dist/esm/components/ChainSelect/ChainSelect.js.map +1 -1
- package/dist/esm/components/ChainSelect/useChainSelect.d.ts +1 -1
- package/dist/esm/components/ChainSelect/useChainSelect.js +3 -3
- package/dist/esm/components/ChainSelect/useChainSelect.js.map +1 -1
- package/dist/esm/components/Chains/AllChainsAvatar.d.ts +7 -0
- package/dist/esm/components/Chains/AllChainsAvatar.js +77 -0
- package/dist/esm/components/Chains/AllChainsAvatar.js.map +1 -0
- package/dist/esm/components/Chains/ChainList.d.ts +2 -1
- package/dist/esm/components/Chains/ChainList.js +2 -2
- package/dist/esm/components/Chains/ChainList.js.map +1 -1
- package/dist/esm/components/Chains/ChainSearchInput.js +2 -2
- package/dist/esm/components/Chains/ChainSearchInput.js.map +1 -1
- package/dist/esm/components/Chains/SelectChainContent.js +1 -1
- package/dist/esm/components/Chains/SelectChainContent.js.map +1 -1
- package/dist/esm/components/Chains/VirtualizedChainList.d.ts +2 -1
- package/dist/esm/components/Chains/VirtualizedChainList.js +42 -10
- package/dist/esm/components/Chains/VirtualizedChainList.js.map +1 -1
- package/dist/esm/components/FeeBreakdownTooltip.d.ts +2 -3
- package/dist/esm/components/FeeBreakdownTooltip.js +1 -1
- package/dist/esm/components/FeeBreakdownTooltip.js.map +1 -1
- package/dist/esm/components/Header/Header.d.ts +1 -2
- package/dist/esm/components/Header/Header.js +1 -1
- package/dist/esm/components/Header/Header.js.map +1 -1
- package/dist/esm/components/Header/WalletHeader.d.ts +0 -1
- package/dist/esm/components/Header/WalletHeader.js +1 -1
- package/dist/esm/components/Header/WalletHeader.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCardEssentials.js +1 -1
- package/dist/esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.d.ts +1 -10
- package/dist/esm/components/StepActions/StepActions.js +6 -6
- package/dist/esm/components/StepActions/StepActions.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.style.d.ts +0 -1
- package/dist/esm/components/Tabs/Tabs.style.js +1 -1
- package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
- package/dist/esm/components/Timer/TimerContent.js +1 -2
- package/dist/esm/components/Timer/TimerContent.js.map +1 -1
- package/dist/esm/components/Token/Token.d.ts +0 -2
- package/dist/esm/components/Token/Token.js +2 -2
- package/dist/esm/components/Token/Token.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheet.d.ts +1 -5
- package/dist/esm/components/TokenList/TokenDetailsSheet.js +4 -2
- package/dist/esm/components/TokenList/TokenDetailsSheet.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js +2 -2
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.js +11 -53
- package/dist/esm/components/TokenList/TokenList.js.map +1 -1
- package/dist/esm/components/TokenList/TokenListItem.d.ts +1 -4
- package/dist/esm/components/TokenList/TokenListItem.js +30 -26
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/VirtualizedTokenList.js +56 -37
- package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/dist/esm/components/TokenList/types.d.ts +8 -11
- package/dist/esm/components/TokenList/useTokenSelect.d.ts +0 -4
- package/dist/esm/components/TokenList/useTokenSelect.js +3 -4
- package/dist/esm/components/TokenList/useTokenSelect.js.map +1 -1
- package/dist/esm/components/TokenRate/TokenRate.js +1 -3
- package/dist/esm/components/TokenRate/TokenRate.js.map +1 -1
- package/dist/esm/components/TransactionDetails.js +2 -2
- package/dist/esm/components/TransactionDetails.js.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/hooks/timer/time.d.ts +0 -8
- package/dist/esm/hooks/timer/time.js.map +1 -1
- package/dist/esm/hooks/timer/useTimer.d.ts +3 -2
- package/dist/esm/hooks/useAccountsBalancesData.d.ts +6 -0
- package/dist/esm/hooks/useAccountsBalancesData.js +64 -0
- package/dist/esm/hooks/useAccountsBalancesData.js.map +1 -0
- package/dist/esm/hooks/useAvailableChains.d.ts +2 -1
- package/dist/esm/hooks/useChain.d.ts +1 -1
- package/dist/esm/hooks/useChains.d.ts +1 -1
- package/dist/esm/hooks/useExplorer.d.ts +2 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.d.ts +9 -0
- package/dist/esm/hooks/useFilteredByTokenBalances.js +78 -0
- package/dist/esm/hooks/useFilteredByTokenBalances.js.map +1 -0
- package/dist/esm/hooks/useListHeight.d.ts +0 -3
- package/dist/esm/hooks/useListHeight.js +2 -3
- package/dist/esm/hooks/useListHeight.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +2 -2
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useToAddressAutoPopulate.d.ts +2 -1
- package/dist/esm/hooks/useToken.d.ts +2 -2
- package/dist/esm/hooks/useToken.js +13 -10
- package/dist/esm/hooks/useToken.js.map +1 -1
- package/dist/esm/hooks/useTokenAddressBalance.d.ts +3 -3
- package/dist/esm/hooks/useTokenAddressBalance.js +10 -14
- package/dist/esm/hooks/useTokenAddressBalance.js.map +1 -1
- package/dist/esm/hooks/useTokenBalances.d.ts +6 -9
- package/dist/esm/hooks/useTokenBalances.js +57 -72
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenBalancesQueries.d.ts +11 -0
- package/dist/esm/hooks/useTokenBalancesQueries.js +74 -0
- package/dist/esm/hooks/useTokenBalancesQueries.js.map +1 -0
- package/dist/esm/hooks/useTokenSearch.js +3 -3
- package/dist/esm/hooks/useTokenSearch.js.map +1 -1
- package/dist/esm/hooks/useTokens.d.ts +6 -6
- package/dist/esm/hooks/useTokens.js +98 -69
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/i18n/bn.json +3 -3
- package/dist/esm/i18n/de.json +3 -3
- package/dist/esm/i18n/en.json +3 -3
- package/dist/esm/i18n/es.json +3 -3
- package/dist/esm/i18n/fr.json +3 -3
- package/dist/esm/i18n/hi.json +3 -3
- package/dist/esm/i18n/id.json +3 -3
- package/dist/esm/i18n/it.json +3 -3
- package/dist/esm/i18n/ja.json +3 -3
- package/dist/esm/i18n/ko.json +3 -3
- package/dist/esm/i18n/pl.json +3 -3
- package/dist/esm/i18n/pt.json +5 -5
- package/dist/esm/i18n/th.json +3 -3
- package/dist/esm/i18n/tr.json +3 -3
- package/dist/esm/i18n/uk.json +3 -3
- package/dist/esm/i18n/vi.json +3 -3
- package/dist/esm/i18n/zh.json +3 -3
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.js +6 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.js.map +1 -1
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js +2 -4
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +27 -17
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/dist/esm/pages/TransactionPage/RouteTracker.d.ts +2 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.d.ts +0 -5
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js +1 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
- package/dist/esm/providers/I18nProvider/types.d.ts +4 -3
- package/dist/esm/providers/WalletProvider/EVMProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/EVMProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/EVMProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/SVMProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/SVMProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/SVMProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/SuiProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/SuiProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/SuiProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/UTXOProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/UTXOProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/UTXOProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.js.map +1 -1
- package/dist/esm/stores/bookmarks/BookmarkStore.d.ts +1 -2
- package/dist/esm/stores/bookmarks/BookmarkStore.js +1 -1
- package/dist/esm/stores/bookmarks/BookmarkStore.js.map +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.d.ts +0 -5
- package/dist/esm/stores/chains/ChainOrderStore.js +2 -2
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/createChainOrderStore.d.ts +3 -2
- package/dist/esm/stores/chains/createChainOrderStore.js +13 -8
- package/dist/esm/stores/chains/createChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/types.d.ts +4 -1
- package/dist/esm/stores/chains/useChainOrder.js +5 -1
- package/dist/esm/stores/chains/useChainOrder.js.map +1 -1
- package/dist/esm/stores/header/types.d.ts +2 -1
- package/dist/esm/stores/header/useHeaderStore.d.ts +1 -4
- package/dist/esm/stores/header/useHeaderStore.js +3 -3
- package/dist/esm/stores/header/useHeaderStore.js.map +1 -1
- package/dist/esm/stores/inputMode/useInputModeStore.d.ts +1 -1
- package/dist/esm/stores/routes/RouteExecutionStore.d.ts +2 -2
- package/dist/esm/stores/routes/RouteExecutionStore.js +1 -1
- package/dist/esm/stores/routes/RouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/settings/types.d.ts +3 -3
- package/dist/esm/stores/settings/types.js.map +1 -1
- package/dist/esm/stores/settings/useSettingsStore.d.ts +1 -2
- package/dist/esm/stores/settings/useSettingsStore.js +1 -1
- package/dist/esm/stores/settings/useSettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/useSplitSubvariantStore.d.ts +1 -4
- package/dist/esm/stores/settings/useSplitSubvariantStore.js +3 -3
- package/dist/esm/stores/settings/useSplitSubvariantStore.js.map +1 -1
- package/dist/esm/types/events.d.ts +0 -4
- package/dist/esm/types/events.js +0 -4
- package/dist/esm/types/events.js.map +1 -1
- package/dist/esm/types/token.d.ts +7 -2
- package/dist/esm/utils/chainType.d.ts +1 -0
- package/dist/esm/utils/chainType.js +2 -0
- package/dist/esm/utils/chainType.js.map +1 -1
- package/dist/esm/utils/fees.d.ts +1 -4
- package/dist/esm/utils/fees.js +3 -3
- package/dist/esm/utils/fees.js.map +1 -1
- package/dist/esm/utils/format.js +1 -1
- package/dist/esm/utils/format.js.map +1 -1
- package/dist/esm/utils/navigationRoutes.d.ts +2 -1
- package/dist/esm/utils/token.d.ts +8 -0
- package/dist/esm/utils/token.js +29 -0
- package/dist/esm/utils/token.js.map +1 -0
- package/dist/esm/utils/tokenList.d.ts +9 -0
- package/dist/esm/utils/tokenList.js +106 -0
- package/dist/esm/utils/tokenList.js.map +1 -0
- package/package.json +10 -10
- package/package.json.tmp +9 -9
- package/src/AppProvider.tsx +1 -1
- package/src/components/AmountInput/AmountInput.tsx +1 -1
- package/src/components/AmountInput/AmountInputAdornment.style.tsx +1 -7
- package/src/components/AmountInput/AmountInputEndAdornment.tsx +3 -2
- package/src/components/AmountInput/PriceFormHelperText.tsx +4 -3
- package/src/components/Avatar/Avatar.tsx +1 -1
- package/src/components/Avatar/TokenAvatar.tsx +2 -2
- package/src/components/Card/CardButton.style.tsx +0 -8
- package/src/components/ChainSelect/ChainSelect.tsx +112 -40
- package/src/components/ChainSelect/useChainSelect.ts +3 -3
- package/src/components/Chains/AllChainsAvatar.tsx +113 -0
- package/src/components/Chains/ChainList.tsx +3 -0
- package/src/components/Chains/ChainSearchInput.tsx +2 -2
- package/src/components/Chains/SelectChainContent.tsx +1 -0
- package/src/components/Chains/VirtualizedChainList.tsx +80 -12
- package/src/components/FeeBreakdownTooltip.tsx +2 -5
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Header/WalletHeader.tsx +1 -1
- package/src/components/RouteCard/RouteCardEssentials.tsx +1 -1
- package/src/components/SendToWallet/SendToWalletButton.tsx +0 -1
- package/src/components/StepActions/StepActions.tsx +6 -6
- package/src/components/Tabs/Tabs.style.tsx +1 -1
- package/src/components/Timer/TimerContent.tsx +1 -2
- package/src/components/Token/Token.tsx +2 -2
- package/src/components/TokenList/TokenDetailsSheet.tsx +4 -9
- package/src/components/TokenList/TokenDetailsSheetContent.tsx +2 -6
- package/src/components/TokenList/TokenList.tsx +57 -129
- package/src/components/TokenList/TokenListItem.tsx +177 -154
- package/src/components/TokenList/VirtualizedTokenList.tsx +88 -48
- package/src/components/TokenList/types.ts +15 -11
- package/src/components/TokenList/useTokenSelect.ts +3 -9
- package/src/components/TokenRate/TokenRate.tsx +0 -1
- package/src/components/TransactionDetails.tsx +2 -3
- package/src/config/version.ts +1 -1
- package/src/hooks/timer/time.ts +0 -10
- package/src/hooks/timer/useTimer.ts +2 -2
- package/src/hooks/useAccountsBalancesData.ts +101 -0
- package/src/hooks/useAvailableChains.ts +1 -1
- package/src/hooks/useExplorer.ts +1 -1
- package/src/hooks/useFilteredByTokenBalances.ts +130 -0
- package/src/hooks/useListHeight.ts +2 -3
- package/src/hooks/useRoutes.ts +4 -2
- package/src/hooks/useToAddressAutoPopulate.ts +1 -1
- package/src/hooks/useToken.ts +31 -13
- package/src/hooks/useTokenAddressBalance.ts +15 -20
- package/src/hooks/useTokenBalances.ts +81 -80
- package/src/hooks/useTokenBalancesQueries.ts +94 -0
- package/src/hooks/useTokenSearch.ts +4 -7
- package/src/hooks/useTokens.ts +153 -87
- package/src/i18n/bn.json +3 -3
- package/src/i18n/de.json +3 -3
- package/src/i18n/en.json +3 -3
- package/src/i18n/es.json +3 -3
- package/src/i18n/fr.json +3 -3
- package/src/i18n/hi.json +3 -3
- package/src/i18n/id.json +3 -3
- package/src/i18n/it.json +3 -3
- package/src/i18n/ja.json +3 -3
- package/src/i18n/ko.json +3 -3
- package/src/i18n/pl.json +3 -3
- package/src/i18n/pt.json +5 -5
- package/src/i18n/th.json +3 -3
- package/src/i18n/tr.json +3 -3
- package/src/i18n/uk.json +3 -3
- package/src/i18n/vi.json +3 -3
- package/src/i18n/zh.json +3 -3
- package/src/pages/SelectTokenPage/SearchTokenInput.tsx +5 -0
- package/src/pages/SelectTokenPage/SelectTokenPage.tsx +7 -13
- package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +0 -1
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +33 -30
- package/src/pages/TransactionPage/RouteTracker.tsx +1 -1
- package/src/pages/TransactionPage/StatusBottomSheet.tsx +5 -3
- package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +1 -1
- package/src/providers/I18nProvider/types.ts +3 -3
- package/src/providers/WalletProvider/EVMProvider.tsx +1 -1
- package/src/providers/WalletProvider/SVMProvider.tsx +1 -1
- package/src/providers/WalletProvider/SuiProvider.tsx +1 -1
- package/src/providers/WalletProvider/UTXOProvider.tsx +1 -1
- package/src/providers/WalletProvider/WalletProvider.tsx +1 -1
- package/src/stores/bookmarks/BookmarkStore.tsx +1 -1
- package/src/stores/chains/ChainOrderStore.tsx +3 -7
- package/src/stores/chains/createChainOrderStore.ts +17 -8
- package/src/stores/chains/types.ts +3 -1
- package/src/stores/chains/useChainOrder.ts +5 -1
- package/src/stores/header/types.ts +1 -1
- package/src/stores/header/useHeaderStore.tsx +3 -3
- package/src/stores/inputMode/useInputModeStore.ts +1 -1
- package/src/stores/routes/RouteExecutionStore.tsx +4 -3
- package/src/stores/settings/types.ts +2 -6
- package/src/stores/settings/useSettingsStore.ts +1 -1
- package/src/stores/settings/useSplitSubvariantStore.tsx +5 -4
- package/src/types/events.ts +0 -4
- package/src/types/token.ts +11 -2
- package/src/utils/chainType.ts +2 -0
- package/src/utils/fees.ts +3 -3
- package/src/utils/format.ts +2 -1
- package/src/utils/navigationRoutes.ts +1 -1
- package/src/utils/token.ts +67 -0
- package/src/utils/tokenList.ts +172 -0
- package/dist/esm/AppDrawer.style.d.ts +0 -1
- package/dist/esm/AppDrawer.style.js +0 -12
- package/dist/esm/AppDrawer.style.js.map +0 -1
- package/dist/esm/components/Select.d.ts +0 -3
- package/dist/esm/components/Select.js +0 -35
- package/dist/esm/components/Select.js.map +0 -1
- package/dist/esm/components/StepActions/StepFees.d.ts +0 -5
- package/dist/esm/components/StepActions/StepFees.js +0 -32
- package/dist/esm/components/StepActions/StepFees.js.map +0 -1
- package/dist/esm/components/TokenList/utils.d.ts +0 -2
- package/dist/esm/components/TokenList/utils.js +0 -35
- package/dist/esm/components/TokenList/utils.js.map +0 -1
- package/dist/esm/pages/MainPage/MainPage.style.d.ts +0 -1
- package/dist/esm/pages/MainPage/MainPage.style.js +0 -8
- package/dist/esm/pages/MainPage/MainPage.style.js.map +0 -1
- package/dist/esm/pages/SelectNativeTokenPage.d.ts +0 -2
- package/dist/esm/pages/SelectNativeTokenPage.js +0 -23
- package/dist/esm/pages/SelectNativeTokenPage.js.map +0 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.d.ts +0 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.js +0 -6
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.js.map +0 -1
- package/dist/esm/pages/SelectTokenPage/types.d.ts +0 -4
- package/dist/esm/pages/SelectTokenPage/types.js +0 -6
- package/dist/esm/pages/SelectTokenPage/types.js.map +0 -1
- package/dist/esm/providers/WidgetProvider/utils.d.ts +0 -5
- package/dist/esm/providers/WidgetProvider/utils.js +0 -17
- package/dist/esm/providers/WidgetProvider/utils.js.map +0 -1
- package/dist/esm/stores/form/useFieldController.d.ts +0 -11
- package/dist/esm/stores/form/useFieldController.js +0 -20
- package/dist/esm/stores/form/useFieldController.js.map +0 -1
- package/dist/esm/stores/form/useValidation.d.ts +0 -2
- package/dist/esm/stores/form/useValidation.js +0 -14
- package/dist/esm/stores/form/useValidation.js.map +0 -1
- package/dist/esm/stores/form/useValidationActions.d.ts +0 -2
- package/dist/esm/stores/form/useValidationActions.js +0 -10
- package/dist/esm/stores/form/useValidationActions.js.map +0 -1
- package/src/AppDrawer.style.tsx +0 -12
- package/src/components/Select.tsx +0 -42
- package/src/components/StepActions/StepFees.tsx +0 -49
- package/src/components/TokenList/utils.ts +0 -42
- package/src/pages/MainPage/MainPage.style.tsx +0 -8
- package/src/pages/SelectNativeTokenPage.tsx +0 -47
- package/src/pages/SelectTokenPage/SearchTokenInput.style.tsx +0 -6
- package/src/pages/SelectTokenPage/types.ts +0 -4
- package/src/providers/WidgetProvider/utils.ts +0 -26
- package/src/stores/form/useFieldController.ts +0 -31
- package/src/stores/form/useValidation.ts +0 -15
- package/src/stores/form/useValidationActions.ts +0 -12
package/src/i18n/hi.json
CHANGED
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"slippage": ""
|
|
213
213
|
},
|
|
214
214
|
"main": {
|
|
215
|
+
"allNetworks": "",
|
|
215
216
|
"allTokens": "",
|
|
216
217
|
"bridgeStepDetails": "",
|
|
217
218
|
"checkoutStepDetails": "",
|
|
@@ -310,10 +311,9 @@
|
|
|
310
311
|
"tokenOnChainAmount": "",
|
|
311
312
|
"tokenSearch": "",
|
|
312
313
|
"valueLoss": "",
|
|
313
|
-
"searchChain": "",
|
|
314
|
-
"searchChains": "",
|
|
315
314
|
"searchBridges": "",
|
|
316
|
-
"searchExchanges": ""
|
|
315
|
+
"searchExchanges": "",
|
|
316
|
+
"searchNetwork": ""
|
|
317
317
|
},
|
|
318
318
|
"settings": {
|
|
319
319
|
"appearance": "",
|
package/src/i18n/id.json
CHANGED
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"slippage": "Perbedaan persentase maksimum antara harga yang diharapkan dan harga sebenarnya saat transfer dilakukan. Nilai ini dapat diubah dalam pengaturan."
|
|
213
213
|
},
|
|
214
214
|
"main": {
|
|
215
|
+
"allNetworks": "",
|
|
215
216
|
"allTokens": "Semua Token",
|
|
216
217
|
"bridgeStepDetails": "Bridge dari {{from}} to {{to}} via {{tool}}",
|
|
217
218
|
"checkoutStepDetails": "Dapatkan melalui {{tool}}",
|
|
@@ -310,10 +311,9 @@
|
|
|
310
311
|
"tokenOnChainAmount": "{{amount, numberExt}} {{tokenSymbol}} di {{chainName}}",
|
|
311
312
|
"tokenSearch": "",
|
|
312
313
|
"valueLoss": "Kehilangan nilai",
|
|
313
|
-
"searchChain": "",
|
|
314
|
-
"searchChains": "Cari berdasarkan nama rantai",
|
|
315
314
|
"searchBridges": "Cari berdasarkan nama bridge",
|
|
316
|
-
"searchExchanges": "Cari berdasarkan nama exchange"
|
|
315
|
+
"searchExchanges": "Cari berdasarkan nama exchange",
|
|
316
|
+
"searchNetwork": ""
|
|
317
317
|
},
|
|
318
318
|
"settings": {
|
|
319
319
|
"appearance": "",
|
package/src/i18n/it.json
CHANGED
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"slippage": ""
|
|
213
213
|
},
|
|
214
214
|
"main": {
|
|
215
|
+
"allNetworks": "",
|
|
215
216
|
"allTokens": "",
|
|
216
217
|
"bridgeStepDetails": "",
|
|
217
218
|
"checkoutStepDetails": "",
|
|
@@ -310,10 +311,9 @@
|
|
|
310
311
|
"tokenOnChainAmount": "",
|
|
311
312
|
"tokenSearch": "",
|
|
312
313
|
"valueLoss": "Perdita di valore",
|
|
313
|
-
"searchChain": "",
|
|
314
|
-
"searchChains": "",
|
|
315
314
|
"searchBridges": "",
|
|
316
|
-
"searchExchanges": ""
|
|
315
|
+
"searchExchanges": "",
|
|
316
|
+
"searchNetwork": ""
|
|
317
317
|
},
|
|
318
318
|
"settings": {
|
|
319
319
|
"appearance": "",
|
package/src/i18n/ja.json
CHANGED
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"slippage": ""
|
|
213
213
|
},
|
|
214
214
|
"main": {
|
|
215
|
+
"allNetworks": "",
|
|
215
216
|
"allTokens": "すべてのトークン",
|
|
216
217
|
"bridgeStepDetails": "{{from}} から {{to}} を {{tool}} でブリッジ",
|
|
217
218
|
"checkoutStepDetails": "{{tool}} 経由で購入",
|
|
@@ -310,10 +311,9 @@
|
|
|
310
311
|
"tokenOnChainAmount": "",
|
|
311
312
|
"tokenSearch": "",
|
|
312
313
|
"valueLoss": "損失額",
|
|
313
|
-
"searchChain": "",
|
|
314
|
-
"searchChains": "",
|
|
315
314
|
"searchBridges": "",
|
|
316
|
-
"searchExchanges": ""
|
|
315
|
+
"searchExchanges": "",
|
|
316
|
+
"searchNetwork": ""
|
|
317
317
|
},
|
|
318
318
|
"settings": {
|
|
319
319
|
"appearance": "",
|
package/src/i18n/ko.json
CHANGED
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"slippage": ""
|
|
213
213
|
},
|
|
214
214
|
"main": {
|
|
215
|
+
"allNetworks": "",
|
|
215
216
|
"allTokens": "",
|
|
216
217
|
"bridgeStepDetails": "",
|
|
217
218
|
"checkoutStepDetails": "",
|
|
@@ -310,10 +311,9 @@
|
|
|
310
311
|
"tokenOnChainAmount": "",
|
|
311
312
|
"tokenSearch": "",
|
|
312
313
|
"valueLoss": "가치 손실",
|
|
313
|
-
"searchChain": "",
|
|
314
|
-
"searchChains": "",
|
|
315
314
|
"searchBridges": "",
|
|
316
|
-
"searchExchanges": ""
|
|
315
|
+
"searchExchanges": "",
|
|
316
|
+
"searchNetwork": ""
|
|
317
317
|
},
|
|
318
318
|
"settings": {
|
|
319
319
|
"appearance": "",
|
package/src/i18n/pl.json
CHANGED
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"slippage": ""
|
|
213
213
|
},
|
|
214
214
|
"main": {
|
|
215
|
+
"allNetworks": "",
|
|
215
216
|
"allTokens": "",
|
|
216
217
|
"bridgeStepDetails": "",
|
|
217
218
|
"checkoutStepDetails": "",
|
|
@@ -310,10 +311,9 @@
|
|
|
310
311
|
"tokenOnChainAmount": "",
|
|
311
312
|
"tokenSearch": "",
|
|
312
313
|
"valueLoss": "",
|
|
313
|
-
"searchChain": "",
|
|
314
|
-
"searchChains": "",
|
|
315
314
|
"searchBridges": "",
|
|
316
|
-
"searchExchanges": ""
|
|
315
|
+
"searchExchanges": "",
|
|
316
|
+
"searchNetwork": ""
|
|
317
317
|
},
|
|
318
318
|
"settings": {
|
|
319
319
|
"appearance": "",
|
package/src/i18n/pt.json
CHANGED
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"slippage": "A diferença percentual máxima entre o preço esperado, e o preço atual pelo qual a transferência é executada. Esse valor pode ser alterado nas configurações."
|
|
213
213
|
},
|
|
214
214
|
"main": {
|
|
215
|
+
"allNetworks": "Todas as redes",
|
|
215
216
|
"allTokens": "Todos os tokens",
|
|
216
217
|
"bridgeStepDetails": "Ponte de {{from}} para {{to}} via {{tool}}",
|
|
217
218
|
"checkoutStepDetails": "Comprar via {{tool}}",
|
|
@@ -240,7 +241,7 @@
|
|
|
240
241
|
"process": {
|
|
241
242
|
"bridge": {
|
|
242
243
|
"actionRequired": "Assinar a transação de transferência de fundos entre redes",
|
|
243
|
-
"messageRequired": "",
|
|
244
|
+
"messageRequired": "Assinar mensagem da ponte",
|
|
244
245
|
"done": "Transação da ponte confirmada",
|
|
245
246
|
"pending": "Transação de transferência de fundos entre redes, pendente",
|
|
246
247
|
"started": "Preparando a transação da ponte"
|
|
@@ -259,7 +260,7 @@
|
|
|
259
260
|
},
|
|
260
261
|
"swap": {
|
|
261
262
|
"actionRequired": "Assinar transação de troca",
|
|
262
|
-
"messageRequired": "",
|
|
263
|
+
"messageRequired": "Assinar mensagem da conversão",
|
|
263
264
|
"done": "Conversão concluída",
|
|
264
265
|
"pending": "Transação de troca pendente",
|
|
265
266
|
"started": "Preparando a transação de conversão"
|
|
@@ -310,10 +311,9 @@
|
|
|
310
311
|
"tokenOnChainAmount": "{{amount, numberExt}} {{tokenSymbol}} na {{chainName}}",
|
|
311
312
|
"tokenSearch": "Pesquisar por token ou endereço",
|
|
312
313
|
"valueLoss": "Perda de Valor",
|
|
313
|
-
"searchChain": "Pesquisar cadeia",
|
|
314
|
-
"searchChains": "Pesquisar pelo nome da rede",
|
|
315
314
|
"searchBridges": "Pesquisar pelo nome da ponte",
|
|
316
|
-
"searchExchanges": "Pesquisar pelo nome da corretora"
|
|
315
|
+
"searchExchanges": "Pesquisar pelo nome da corretora",
|
|
316
|
+
"searchNetwork": "Procurar rede"
|
|
317
317
|
},
|
|
318
318
|
"settings": {
|
|
319
319
|
"appearance": "Aparência",
|
package/src/i18n/th.json
CHANGED
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"slippage": ""
|
|
213
213
|
},
|
|
214
214
|
"main": {
|
|
215
|
+
"allNetworks": "",
|
|
215
216
|
"allTokens": "โทเคนทั้งหมด",
|
|
216
217
|
"bridgeStepDetails": "บริดจ์จาก{{from}} ไปยัง {{to}} โดย {{tool}}",
|
|
217
218
|
"checkoutStepDetails": "ซื้อผ่าน {{tool}}",
|
|
@@ -310,10 +311,9 @@
|
|
|
310
311
|
"tokenOnChainAmount": "",
|
|
311
312
|
"tokenSearch": "",
|
|
312
313
|
"valueLoss": "มูลค่าที่สูญเสีย",
|
|
313
|
-
"searchChain": "",
|
|
314
|
-
"searchChains": "",
|
|
315
314
|
"searchBridges": "",
|
|
316
|
-
"searchExchanges": ""
|
|
315
|
+
"searchExchanges": "",
|
|
316
|
+
"searchNetwork": ""
|
|
317
317
|
},
|
|
318
318
|
"settings": {
|
|
319
319
|
"appearance": "",
|
package/src/i18n/tr.json
CHANGED
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"slippage": "Beklenen fiyat ile transferin gerçekleştirildiği gerçek fiyat arasındaki maksimum yüzde fark. Bu değer ayarlardan değiştirilebilir."
|
|
213
213
|
},
|
|
214
214
|
"main": {
|
|
215
|
+
"allNetworks": "",
|
|
215
216
|
"allTokens": "Tüm varlıklar",
|
|
216
217
|
"bridgeStepDetails": "{{tool}} aracılığıyla {{from}} ağından {{to}} ağına köprüle",
|
|
217
218
|
"checkoutStepDetails": "{{tool}} aracılığıyla alım yap",
|
|
@@ -310,10 +311,9 @@
|
|
|
310
311
|
"tokenOnChainAmount": "",
|
|
311
312
|
"tokenSearch": "",
|
|
312
313
|
"valueLoss": "Değer kaybı",
|
|
313
|
-
"searchChain": "",
|
|
314
|
-
"searchChains": "Zincir adına göre ara",
|
|
315
314
|
"searchBridges": "Köprü adına göre ara",
|
|
316
|
-
"searchExchanges": "Borsa adına göre ara"
|
|
315
|
+
"searchExchanges": "Borsa adına göre ara",
|
|
316
|
+
"searchNetwork": ""
|
|
317
317
|
},
|
|
318
318
|
"settings": {
|
|
319
319
|
"appearance": "",
|
package/src/i18n/uk.json
CHANGED
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"slippage": "Максимальна процентна різниця між очікуваною ціною і фактичною ціною з якою виконується трансфер. Ця величина може бути змінена в налаштуваннях."
|
|
213
213
|
},
|
|
214
214
|
"main": {
|
|
215
|
+
"allNetworks": "",
|
|
215
216
|
"allTokens": "Всі токени",
|
|
216
217
|
"bridgeStepDetails": "Бридж з {{from}} до {{to}} через {{tool}}",
|
|
217
218
|
"checkoutStepDetails": "Купівля через {{tool}}",
|
|
@@ -310,10 +311,9 @@
|
|
|
310
311
|
"tokenOnChainAmount": "{{amount, numberExt}} {{tokenSymbol}} на {{chainName}}",
|
|
311
312
|
"tokenSearch": "Шукати за ім'ям або адресою",
|
|
312
313
|
"valueLoss": "Втрата вартості",
|
|
313
|
-
"searchChain": "Шукати чейн",
|
|
314
|
-
"searchChains": "Пошук за назвою чейна",
|
|
315
314
|
"searchBridges": "Пошук за назвою моста",
|
|
316
|
-
"searchExchanges": "Пошук за назвою обмінника"
|
|
315
|
+
"searchExchanges": "Пошук за назвою обмінника",
|
|
316
|
+
"searchNetwork": ""
|
|
317
317
|
},
|
|
318
318
|
"settings": {
|
|
319
319
|
"appearance": "Вигляд",
|
package/src/i18n/vi.json
CHANGED
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"slippage": ""
|
|
213
213
|
},
|
|
214
214
|
"main": {
|
|
215
|
+
"allNetworks": "",
|
|
215
216
|
"allTokens": "Tất cả mã thông báo",
|
|
216
217
|
"bridgeStepDetails": "Chuyển từ {{from}} đến {{to}} thông qua {{tool}}",
|
|
217
218
|
"checkoutStepDetails": "Thanh toán thông qua {{tool}}",
|
|
@@ -310,10 +311,9 @@
|
|
|
310
311
|
"tokenOnChainAmount": "",
|
|
311
312
|
"tokenSearch": "",
|
|
312
313
|
"valueLoss": "Bạn sẽ mất",
|
|
313
|
-
"searchChain": "",
|
|
314
|
-
"searchChains": "",
|
|
315
314
|
"searchBridges": "",
|
|
316
|
-
"searchExchanges": ""
|
|
315
|
+
"searchExchanges": "",
|
|
316
|
+
"searchNetwork": ""
|
|
317
317
|
},
|
|
318
318
|
"settings": {
|
|
319
319
|
"appearance": "",
|
package/src/i18n/zh.json
CHANGED
|
@@ -212,6 +212,7 @@
|
|
|
212
212
|
"slippage": "真实的成交价位与预设的成交价位间相差的最大百分比。该值可以在设置中更改。"
|
|
213
213
|
},
|
|
214
214
|
"main": {
|
|
215
|
+
"allNetworks": "",
|
|
215
216
|
"allTokens": "所有代币",
|
|
216
217
|
"bridgeStepDetails": "通过 {{tool}} 把资产从 {{from}} 链跨到 {{to}} 链上",
|
|
217
218
|
"checkoutStepDetails": "通过 {{tool}} 购买",
|
|
@@ -310,10 +311,9 @@
|
|
|
310
311
|
"tokenOnChainAmount": "",
|
|
311
312
|
"tokenSearch": "",
|
|
312
313
|
"valueLoss": "资金损失",
|
|
313
|
-
"searchChain": "",
|
|
314
|
-
"searchChains": "搜索链",
|
|
315
314
|
"searchBridges": "搜索跨链桥",
|
|
316
|
-
"searchExchanges": "搜索交易所"
|
|
315
|
+
"searchExchanges": "搜索交易所",
|
|
316
|
+
"searchNetwork": ""
|
|
317
317
|
},
|
|
318
318
|
"settings": {
|
|
319
319
|
"appearance": "",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect } from 'react'
|
|
2
2
|
import { useTranslation } from 'react-i18next'
|
|
3
3
|
import { SearchInput } from '../../components/Search/SearchInput.js'
|
|
4
|
+
import { useChainOrderStore } from '../../stores/chains/ChainOrderStore.js'
|
|
4
5
|
import { useFieldActions } from '../../stores/form/useFieldActions.js'
|
|
5
6
|
import { useFieldValues } from '../../stores/form/useFieldValues.js'
|
|
6
7
|
|
|
@@ -8,6 +9,8 @@ export const SearchTokenInput = () => {
|
|
|
8
9
|
const { t } = useTranslation()
|
|
9
10
|
const [value] = useFieldValues('tokenSearchFilter')
|
|
10
11
|
const { setFieldValue, setAsTouched } = useFieldActions()
|
|
12
|
+
const [fromChain, toChain] = useFieldValues('fromChain', 'toChain')
|
|
13
|
+
const isAllNetworks = useChainOrderStore((state) => state.isAllNetworks)
|
|
11
14
|
|
|
12
15
|
const onChange = useCallback(
|
|
13
16
|
(newValue: string | number | undefined) => {
|
|
@@ -32,6 +35,8 @@ export const SearchTokenInput = () => {
|
|
|
32
35
|
|
|
33
36
|
return (
|
|
34
37
|
<SearchInput
|
|
38
|
+
// Reset the search input when a chain or the "All Networks" is changed
|
|
39
|
+
key={`${fromChain}-${toChain}-${isAllNetworks}`}
|
|
35
40
|
name="tokenSearchFilter"
|
|
36
41
|
placeholder={t('main.tokenSearch')}
|
|
37
42
|
onChange={(e) => onChange((e.target as HTMLInputElement).value)}
|
|
@@ -92,22 +92,16 @@ type WrappedTokenListProps = {
|
|
|
92
92
|
const WrappedTokenList = ({ headerRef, formType }: WrappedTokenListProps) => {
|
|
93
93
|
const { navigateBack } = useNavigateBack()
|
|
94
94
|
const listParentRef = useRef<HTMLUListElement | null>(null)
|
|
95
|
-
const { listHeight
|
|
95
|
+
const { listHeight } = useListHeight({
|
|
96
96
|
listParentRef,
|
|
97
97
|
headerRef,
|
|
98
98
|
})
|
|
99
99
|
return (
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
parentRef={listParentRef}
|
|
107
|
-
height={listHeight}
|
|
108
|
-
onClick={navigateBack}
|
|
109
|
-
formType={formType}
|
|
110
|
-
/>
|
|
111
|
-
</Box>
|
|
100
|
+
<TokenList
|
|
101
|
+
parentRef={listParentRef}
|
|
102
|
+
height={listHeight}
|
|
103
|
+
onClick={navigateBack}
|
|
104
|
+
formType={formType}
|
|
105
|
+
/>
|
|
112
106
|
)
|
|
113
107
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import Percent from '@mui/icons-material/Percent'
|
|
2
2
|
import WarningRounded from '@mui/icons-material/WarningRounded'
|
|
3
|
-
import { Box,
|
|
3
|
+
import { Box, Typography } from '@mui/material'
|
|
4
4
|
import type { ChangeEventHandler, FocusEventHandler } from 'react'
|
|
5
|
-
import {
|
|
5
|
+
import { useRef, useState } from 'react'
|
|
6
6
|
import { useTranslation } from 'react-i18next'
|
|
7
7
|
import { useSettingMonitor } from '../../../hooks/useSettingMonitor.js'
|
|
8
8
|
import { useSettings } from '../../../stores/settings/useSettings.js'
|
|
9
9
|
import { useSettingsActions } from '../../../stores/settings/useSettingsActions.js'
|
|
10
10
|
import { defaultSlippage } from '../../../stores/settings/useSettingsStore.js'
|
|
11
|
-
import { formatSlippage } from '../../../utils/format.js'
|
|
11
|
+
import { formatInputAmount, formatSlippage } from '../../../utils/format.js'
|
|
12
12
|
import { BadgedValue } from '../SettingsCard/BadgedValue.js'
|
|
13
13
|
import { SettingCardExpandable } from '../SettingsCard/SettingCardExpandable.js'
|
|
14
14
|
import {
|
|
@@ -18,7 +18,8 @@ import {
|
|
|
18
18
|
SlippageLimitsWarningContainer,
|
|
19
19
|
} from './SlippageSettings.style.js'
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const defaultSlippageInputValue = '0.5'
|
|
22
|
+
const maxFractionDigits = 5
|
|
22
23
|
|
|
23
24
|
export const SlippageSettings: React.FC = () => {
|
|
24
25
|
const { t } = useTranslation()
|
|
@@ -35,7 +36,7 @@ export const SlippageSettings: React.FC = () => {
|
|
|
35
36
|
|
|
36
37
|
const customInputValue =
|
|
37
38
|
!slippage || slippage === defaultSlippage
|
|
38
|
-
?
|
|
39
|
+
? defaultSlippageInputValue
|
|
39
40
|
: slippage
|
|
40
41
|
|
|
41
42
|
const [inputValue, setInputValue] = useState(customInputValue)
|
|
@@ -44,35 +45,37 @@ export const SlippageSettings: React.FC = () => {
|
|
|
44
45
|
setValue('slippage', defaultSlippage)
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
const formatAndSetSlippage = (value: string, returnInitial = false) => {
|
|
49
|
+
const formattedSlippage = formatSlippage(
|
|
50
|
+
value,
|
|
51
|
+
defaultValue.current,
|
|
52
|
+
returnInitial
|
|
53
|
+
)
|
|
54
|
+
const formattedValue =
|
|
55
|
+
Number(formattedSlippage) === 0 && !returnInitial
|
|
56
|
+
? '0'
|
|
57
|
+
: formatInputAmount(formattedSlippage, maxFractionDigits, returnInitial)
|
|
58
|
+
const maxLength =
|
|
59
|
+
Number(formattedValue) < 10
|
|
60
|
+
? maxFractionDigits + 2
|
|
61
|
+
: maxFractionDigits + 3
|
|
62
|
+
const slicedValue = formattedValue.slice(0, maxLength)
|
|
63
|
+
setInputValue(slicedValue)
|
|
64
|
+
setValue('slippage', slicedValue.length ? slicedValue : defaultSlippage)
|
|
65
|
+
}
|
|
54
66
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
formattedValue.length ? formattedValue : defaultSlippage
|
|
59
|
-
)
|
|
60
|
-
},
|
|
61
|
-
[debouncedSetValue]
|
|
62
|
-
)
|
|
67
|
+
const handleInputUpdate: ChangeEventHandler<HTMLInputElement> = (event) => {
|
|
68
|
+
formatAndSetSlippage(event.target.value, true)
|
|
69
|
+
}
|
|
63
70
|
|
|
64
71
|
const handleInputFocus: FocusEventHandler<HTMLInputElement> = (event) => {
|
|
65
72
|
setFocused('input')
|
|
73
|
+
formatAndSetSlippage(event.target.value)
|
|
74
|
+
}
|
|
66
75
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
setInputValue(formattedValue)
|
|
71
|
-
|
|
72
|
-
setValue(
|
|
73
|
-
'slippage',
|
|
74
|
-
formattedValue.length ? formattedValue : defaultSlippage
|
|
75
|
-
)
|
|
76
|
+
const handleInputBlur: FocusEventHandler<HTMLInputElement> = (event) => {
|
|
77
|
+
setFocused(undefined)
|
|
78
|
+
formatAndSetSlippage(event.target.value)
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
const badgeColor = isSlippageNotRecommended
|
|
@@ -126,7 +129,7 @@ export const SlippageSettings: React.FC = () => {
|
|
|
126
129
|
onFocus={handleInputFocus}
|
|
127
130
|
value={inputValue}
|
|
128
131
|
autoComplete="off"
|
|
129
|
-
onBlur={
|
|
132
|
+
onBlur={handleInputBlur}
|
|
130
133
|
/>
|
|
131
134
|
</SettingsFieldSet>
|
|
132
135
|
{isSlippageNotRecommended && (
|
|
@@ -5,7 +5,7 @@ import { useRoutes } from '../../hooks/useRoutes.js'
|
|
|
5
5
|
import { useRouteExecutionStoreContext } from '../../stores/routes/RouteExecutionStore.js'
|
|
6
6
|
import { useSetExecutableRoute } from '../../stores/routes/useSetExecutableRoute.js'
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface RouteTrackerProps {
|
|
9
9
|
observableRouteId: string
|
|
10
10
|
onChange: Dispatch<SetStateAction<string>>
|
|
11
11
|
onFetching: Dispatch<SetStateAction<boolean>>
|
|
@@ -59,9 +59,11 @@ export const StatusBottomSheet: React.FC<RouteExecution> = ({
|
|
|
59
59
|
)
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
const StatusBottomSheetContent: React.FC<StatusBottomSheetContentProps> = ({
|
|
63
|
+
status,
|
|
64
|
+
route,
|
|
65
|
+
onClose,
|
|
66
|
+
}) => {
|
|
65
67
|
const { t } = useTranslation()
|
|
66
68
|
const { navigateBack, navigate } = useNavigateBack()
|
|
67
69
|
const { setFieldValue } = useFieldActions()
|
|
@@ -113,7 +113,7 @@ const TokenValueBottomSheetContent: React.FC<TokenValueBottomSheetProps> = ({
|
|
|
113
113
|
fontWeight: 600,
|
|
114
114
|
}}
|
|
115
115
|
>
|
|
116
|
-
{hasRelayerSupport
|
|
116
|
+
{hasRelayerSupport || !gasCostUSD
|
|
117
117
|
? t('main.fees.free')
|
|
118
118
|
: t('format.currency', { value: gasCostUSD })}
|
|
119
119
|
</Typography>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as languages from '../../i18n/index.js'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type PartialResource<T> = T extends object
|
|
4
4
|
? {
|
|
5
5
|
[P in keyof T]?: PartialResource<T[P]>
|
|
6
6
|
}
|
|
@@ -8,7 +8,7 @@ export type PartialResource<T> = T extends object
|
|
|
8
8
|
|
|
9
9
|
export type LanguageKey = keyof typeof languages
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
type LanguageResource = typeof languages.en
|
|
12
12
|
|
|
13
13
|
export type LanguageResources =
|
|
14
14
|
| {
|
|
@@ -18,7 +18,7 @@ export type LanguageResources =
|
|
|
18
18
|
[language: string]: PartialResource<LanguageResource>
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
type LanguageTranslationResource = {
|
|
22
22
|
[N in 'translation']: PartialResource<LanguageResource>
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -7,7 +7,7 @@ import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js'
|
|
|
7
7
|
import { EVMBaseProvider } from './EVMBaseProvider.js'
|
|
8
8
|
import { EVMExternalContext } from './EVMExternalContext.js'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
function useInWagmiContext(): boolean {
|
|
11
11
|
const { chains } = useWidgetConfig()
|
|
12
12
|
const context = useContext(WagmiContext)
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@ import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js'
|
|
|
7
7
|
import { SVMBaseProvider } from './SVMBaseProvider.js'
|
|
8
8
|
import { SVMExternalContext } from './SVMExternalContext.js'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
function useInSolanaContext(): boolean {
|
|
11
11
|
const { chains } = useWidgetConfig()
|
|
12
12
|
const context = useContext(ConnectionContext)
|
|
13
13
|
return (
|
|
@@ -7,7 +7,7 @@ import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js'
|
|
|
7
7
|
import { SuiBaseProvider } from './SuiBaseProvider.js'
|
|
8
8
|
import { SuiExternalContext } from './SuiExternalContext.js'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
function useInSuiContext(): boolean {
|
|
11
11
|
const { chains } = useWidgetConfig()
|
|
12
12
|
const context = useContext(SuiClientContext)
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@ import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js'
|
|
|
7
7
|
import { UTXOBaseProvider } from './UTXOBaseProvider.js'
|
|
8
8
|
import { UTXOExternalContext } from './UTXOExternalContext.js'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
function useInBigmiContext(): boolean {
|
|
11
11
|
const { chains } = useWidgetConfig()
|
|
12
12
|
const context = useContext(BigmiContext)
|
|
13
13
|
|
|
@@ -25,7 +25,7 @@ export const WalletProvider: FC<PropsWithChildren> = ({ children }) => {
|
|
|
25
25
|
)
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
const WalletMenuProvider: FC<PropsWithChildren> = ({ children }) => {
|
|
29
29
|
const { walletConfig } = useWidgetConfig()
|
|
30
30
|
const { i18n } = useTranslation()
|
|
31
31
|
const { internalChainTypes } = useExternalWalletProvider()
|
|
@@ -5,7 +5,7 @@ import type { PersistStoreProviderProps } from '../types.js'
|
|
|
5
5
|
import { createBookmarksStore } from './createBookmarkStore.js'
|
|
6
6
|
import type { BookmarkState, BookmarkStore } from './types.js'
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const BookmarkStoreContext = createContext<BookmarkStore | null>(null)
|
|
9
9
|
|
|
10
10
|
export const BookmarkStoreProvider: React.FC<PersistStoreProviderProps> = ({
|
|
11
11
|
children,
|
|
@@ -12,13 +12,9 @@ import type { PersistStoreProviderProps } from '../types.js'
|
|
|
12
12
|
import { createChainOrderStore } from './createChainOrderStore.js'
|
|
13
13
|
import type { ChainOrderState } from './types.js'
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
StoreApi<ChainOrderState>
|
|
17
|
-
>
|
|
15
|
+
type ChainOrderStore = UseBoundStoreWithEqualityFn<StoreApi<ChainOrderState>>
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
null
|
|
21
|
-
)
|
|
17
|
+
const ChainOrderStoreContext = createContext<ChainOrderStore | null>(null)
|
|
22
18
|
|
|
23
19
|
export function ChainOrderStoreProvider({
|
|
24
20
|
children,
|
|
@@ -105,7 +101,7 @@ export function ChainOrderStoreProvider({
|
|
|
105
101
|
)
|
|
106
102
|
}
|
|
107
103
|
|
|
108
|
-
|
|
104
|
+
function useChainOrderStoreContext() {
|
|
109
105
|
const useStore = useContext(ChainOrderStoreContext)
|
|
110
106
|
if (!useStore) {
|
|
111
107
|
throw new Error(
|