@lifi/widget 2.0.0-beta.13 → 2.0.0-beta.15
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/App.js +2 -2
- package/AppDrawer.d.ts +3 -2
- package/AppDrawer.js +7 -3
- package/AppDrawer.style.d.ts +2 -2
- package/AppProvider.js +4 -4
- package/AppRoutes.js +16 -16
- package/cjs/App.js +2 -2
- package/cjs/AppDrawer.d.ts +3 -2
- package/cjs/AppDrawer.js +7 -3
- package/cjs/AppDrawer.style.d.ts +2 -2
- package/cjs/AppProvider.js +3 -3
- package/cjs/AppRoutes.js +16 -16
- package/cjs/components/{ActiveSwaps/ActiveSwapItem.d.ts → ActiveTransactions/ActiveTransactionItem.d.ts} +1 -1
- package/cjs/components/{ActiveSwaps/ActiveSwapItem.js → ActiveTransactions/ActiveTransactionItem.js} +6 -6
- package/cjs/{pages/SwapRoutesPage/SwapRoutesPage.d.ts → components/ActiveTransactions/ActiveTransactions.d.ts} +1 -1
- package/cjs/components/{ActiveSwaps/ActiveSwaps.js → ActiveTransactions/ActiveTransactions.js} +7 -7
- package/cjs/components/{ActiveSwaps/ActiveSwaps.style.d.ts → ActiveTransactions/ActiveTransactions.style.d.ts} +4 -4
- package/cjs/components/ActiveTransactions/index.d.ts +2 -0
- package/cjs/components/{ActiveSwaps → ActiveTransactions}/index.js +2 -2
- package/cjs/components/{SwapInput/SwapInput.d.ts → AmountInput/AmountInput.d.ts} +3 -3
- package/cjs/components/{SwapInput/SwapInput.js → AmountInput/AmountInput.js} +14 -14
- package/{components/SwapInput/SwapInput.style.d.ts → cjs/components/AmountInput/AmountInput.style.d.ts} +1 -1
- package/{components/SwapInput/SwapInputAdornment.style.d.ts → cjs/components/AmountInput/AmountInputAdornment.style.d.ts} +2 -2
- package/cjs/components/AmountInput/AmountInputEndAdornment.d.ts +2 -0
- package/cjs/components/{SwapInput/SwapInputEndAdornment.js → AmountInput/AmountInputEndAdornment.js} +8 -8
- package/cjs/components/AmountInput/AmountInputStartAdornment.d.ts +3 -0
- package/cjs/components/{SwapInput/SwapInputStartAdornment.js → AmountInput/AmountInputStartAdornment.js} +5 -5
- package/cjs/components/AmountInput/FormPriceHelperText.d.ts +9 -0
- package/cjs/components/{SwapInput → AmountInput}/FormPriceHelperText.js +4 -4
- package/cjs/components/AmountInput/index.d.ts +1 -0
- package/cjs/{pages/SwapPage → components/AmountInput}/index.js +1 -1
- package/cjs/components/Card/CardIconButton.d.ts +2 -2
- package/cjs/components/Card/CardLabel.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.d.ts +2 -2
- package/cjs/components/ChainSelect/ChainSelect.js +1 -1
- package/cjs/components/ChainSelect/useChainSelect.d.ts +2 -2
- package/cjs/components/ChainSelect/useChainSelect.js +5 -5
- package/cjs/components/ContractComponent/ContractComponent.d.ts +2 -2
- package/cjs/components/ContractComponent/ContractComponent.js +3 -5
- package/cjs/components/DefaultTransactionButton/DefaultTransactionButton.d.ts +3 -0
- package/cjs/components/DefaultTransactionButton/DefaultTransactionButton.js +36 -0
- package/cjs/components/DefaultTransactionButton/index.d.ts +2 -0
- package/cjs/components/{SwapButton → DefaultTransactionButton}/index.js +3 -3
- package/cjs/components/{SwapButton → DefaultTransactionButton}/types.d.ts +1 -2
- package/cjs/components/GasMessage/FundsSufficiencyMessage.js +1 -1
- package/cjs/components/GasMessage/GasRefuelMessage.js +1 -1
- package/cjs/components/GasMessage/GasSufficiencyMessage.js +2 -2
- package/cjs/components/Header/Header.style.d.ts +2 -2
- package/cjs/components/Header/NavigationHeader.js +19 -19
- package/cjs/components/Header/NavigationTabs.js +3 -3
- package/cjs/components/Header/NavigationTabs.style.js +2 -2
- package/cjs/components/Header/index.d.ts +1 -1
- package/cjs/components/Header/index.js +1 -1
- package/cjs/components/Header/types.d.ts +5 -2
- package/cjs/components/Header/useHeaderStore.d.ts +2 -0
- package/cjs/components/Header/{useHeaderActionStore.js → useHeaderStore.js} +13 -2
- package/cjs/components/Insurance/InsuranceCard.js +9 -12
- package/cjs/components/Insurance/InsuranceCollapsed.js +1 -1
- package/cjs/components/ListItemButton.d.ts +1 -1
- package/cjs/components/NFT/NFT.d.ts +1 -2
- package/cjs/components/NFT/NFT.js +15 -13
- package/cjs/components/NFT/NFT.style.d.ts +1 -1
- package/cjs/components/NFT/NFTBase.d.ts +3 -0
- package/cjs/components/NFT/NFTBase.js +13 -0
- package/cjs/components/NFT/index.d.ts +1 -0
- package/cjs/components/NFT/index.js +1 -0
- package/cjs/components/NFT/types.d.ts +3 -1
- package/cjs/components/ProgressToNextUpdate/ProgressToNextUpdate.js +3 -3
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.js +9 -9
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
- package/cjs/components/RouteCard/RouteCard.d.ts +4 -0
- package/cjs/components/{SwapRouteCard/SwapRouteCard.js → RouteCard/RouteCard.js} +14 -14
- package/cjs/components/RouteCard/RouteCardEssentials.d.ts +3 -0
- package/cjs/components/{SwapRouteCard/SwapRouteCardEssentials.js → RouteCard/RouteCardEssentials.js} +7 -7
- package/cjs/components/RouteCard/RouteCardSkeleton.d.ts +4 -0
- package/cjs/components/{SwapRouteCard/SwapRouteCardSkeleton.js → RouteCard/RouteCardSkeleton.js} +6 -6
- package/cjs/components/RouteCard/RouteNotFoundCard.d.ts +2 -0
- package/cjs/components/{SwapRouteCard/SwapRouteNotFoundCard.js → RouteCard/RouteNotFoundCard.js} +4 -4
- package/cjs/components/RouteCard/index.d.ts +3 -0
- package/cjs/components/{SwapRoutes → RouteCard}/index.js +3 -2
- package/cjs/components/{SwapRouteCard → RouteCard}/types.d.ts +3 -3
- package/cjs/components/{SwapRoutes/SwapRoutes.d.ts → Routes/Routes.d.ts} +1 -1
- package/cjs/components/Routes/Routes.js +37 -0
- package/cjs/components/Routes/RoutesExpanded.d.ts +2 -0
- package/cjs/components/Routes/RoutesExpanded.js +44 -0
- package/cjs/components/Routes/index.d.ts +2 -0
- package/cjs/components/Routes/index.js +18 -0
- package/cjs/components/SelectChainAndToken.js +7 -7
- package/cjs/components/SelectTokenButton/SelectTokenButton.d.ts +2 -2
- package/cjs/components/SelectTokenButton/SelectTokenButton.js +11 -11
- package/cjs/components/SendToWallet/SendToWallet.js +9 -10
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/cjs/components/SendToWallet/SendToWalletButton.js +2 -2
- package/cjs/components/SmallAvatar.d.ts +1 -1
- package/cjs/components/Step/DestinationWalletAddress.js +2 -2
- package/cjs/components/Step/GasStepProcess.js +1 -1
- package/cjs/components/Step/Step.js +13 -13
- package/cjs/components/Step/StepTimer.js +2 -2
- package/cjs/components/StepActions/StepActions.d.ts +3 -3
- package/cjs/components/StepActions/StepActions.js +20 -16
- package/cjs/components/StepActions/StepActions.style.d.ts +1 -1
- package/cjs/components/StepActions/types.d.ts +2 -2
- package/cjs/components/Token/Token.js +1 -1
- package/cjs/components/TokenList/TokenList.js +2 -2
- package/cjs/components/TokenList/TokenList.style.d.ts +4 -4
- package/cjs/components/TokenList/TokenList.style.js +11 -8
- package/cjs/components/TokenList/TokenListItem.js +3 -7
- package/cjs/components/TokenList/TokenNotFound.d.ts +2 -2
- package/cjs/components/TokenList/TokenNotFound.js +2 -2
- package/cjs/components/TokenList/VirtualizedTokenList.js +2 -2
- package/cjs/components/TokenList/types.d.ts +2 -2
- package/cjs/components/TokenList/useTokenSelect.d.ts +2 -2
- package/cjs/components/TokenList/useTokenSelect.js +11 -9
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/index.d.ts +1 -1
- package/cjs/hooks/index.js +1 -1
- package/cjs/hooks/useChains.js +4 -4
- package/cjs/hooks/useFundsSufficiency.js +1 -5
- package/cjs/hooks/useGasRefuel.js +4 -4
- package/cjs/hooks/useProcessMessage.d.ts +2 -2
- package/cjs/hooks/useProcessMessage.js +46 -46
- package/cjs/hooks/useRouteExecution.js +0 -2
- package/cjs/hooks/{useSwapRoutes.d.ts → useRoutes.d.ts} +2 -2
- package/cjs/hooks/{useSwapRoutes.js → useRoutes.js} +24 -24
- package/cjs/i18n/bn.json +80 -80
- package/cjs/i18n/de.json +74 -74
- package/cjs/i18n/en.json +132 -131
- package/cjs/i18n/es.json +72 -72
- package/cjs/i18n/fr.json +102 -85
- package/cjs/i18n/id.json +86 -86
- package/cjs/i18n/it.json +86 -86
- package/cjs/i18n/ko.json +102 -85
- package/cjs/i18n/pt.json +86 -86
- package/cjs/i18n/th.json +102 -85
- package/cjs/i18n/tr.json +72 -72
- package/cjs/i18n/uk.json +97 -97
- package/cjs/i18n/vi.json +86 -86
- package/cjs/i18n/zh.json +86 -86
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +5 -1
- package/cjs/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.d.ts +2 -0
- package/cjs/pages/{ActiveSwapsPage/ActiveSwapsEmpty.js → ActiveTransactionsPage/ActiveTransactionsEmpty.js} +4 -4
- package/cjs/pages/ActiveTransactionsPage/ActiveTransactionsPage.d.ts +1 -0
- package/cjs/pages/{ActiveSwapsPage/ActiveSwapsPage.js → ActiveTransactionsPage/ActiveTransactionsPage.js} +8 -8
- package/cjs/pages/ActiveTransactionsPage/index.d.ts +1 -0
- package/cjs/pages/{ActiveSwapsPage → ActiveTransactionsPage}/index.js +1 -1
- package/cjs/pages/MainPage/MainGasMessage.js +1 -1
- package/cjs/pages/MainPage/MainPage.js +7 -7
- package/cjs/pages/MainPage/ReviewButton.d.ts +2 -0
- package/cjs/pages/MainPage/ReviewButton.js +62 -0
- package/{components/SwapRoutes/SwapRoutes.d.ts → cjs/pages/RoutesPage/RoutesPage.d.ts} +1 -1
- package/cjs/pages/{SwapRoutesPage/SwapRoutesPage.js → RoutesPage/RoutesPage.js} +11 -11
- package/cjs/pages/RoutesPage/index.d.ts +1 -0
- package/cjs/{components/SwapInput → pages/RoutesPage}/index.js +1 -1
- package/cjs/pages/SelectChainPage/types.d.ts +2 -2
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +1 -1
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +1 -1
- package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +2 -2
- package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +1 -1
- package/cjs/pages/SelectTokenPage/SearchTokenInput.js +3 -3
- package/cjs/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -2
- package/cjs/pages/SelectTokenPage/types.js +1 -1
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
- package/cjs/pages/SettingsPage/EnabledToolsButton.style.d.ts +1 -1
- package/cjs/pages/SettingsPage/ResetSettingsButton.js +1 -1
- package/cjs/pages/SettingsPage/RoutePrioritySelect.js +1 -1
- package/cjs/pages/TransactionDetailsPage/TransactionDetailsPage.d.ts +2 -0
- package/cjs/pages/{SwapDetailsPage/SwapDetailsPage.js → TransactionDetailsPage/TransactionDetailsPage.js} +9 -9
- package/cjs/pages/TransactionDetailsPage/index.d.ts +1 -0
- package/cjs/pages/{SwapDetailsPage → TransactionDetailsPage}/index.js +1 -1
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryEmpty.d.ts +2 -0
- package/cjs/pages/{SwapHistoryPage/SwapHistoryEmpty.js → TransactionHistoryPage/TransactionHistoryEmpty.js} +4 -4
- package/{pages/SwapHistoryPage/SwapHistoryItem.d.ts → cjs/pages/TransactionHistoryPage/TransactionHistoryItem.d.ts} +1 -1
- package/cjs/pages/{SwapHistoryPage/SwapHistoryItem.js → TransactionHistoryPage/TransactionHistoryItem.js} +4 -4
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryPage.d.ts +2 -0
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryPage.js +35 -0
- package/cjs/pages/TransactionHistoryPage/index.d.ts +1 -0
- package/cjs/pages/TransactionHistoryPage/index.js +17 -0
- package/cjs/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.js +3 -3
- package/cjs/pages/TransactionPage/StartTransactionButton.d.ts +4 -0
- package/cjs/pages/TransactionPage/StartTransactionButton.js +21 -0
- package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.js +24 -21
- package/cjs/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.js +1 -1
- package/cjs/pages/TransactionPage/TransactionPage.d.ts +2 -0
- package/cjs/pages/TransactionPage/TransactionPage.js +125 -0
- package/cjs/pages/TransactionPage/index.d.ts +1 -0
- package/cjs/pages/{SwapHistoryPage → TransactionPage}/index.js +1 -1
- package/cjs/pages/TransactionPage/types.d.ts +6 -0
- package/cjs/providers/{SwapFormProvider/SwapFormProvider.d.ts → FormProvider/FormProvider.d.ts} +1 -1
- package/cjs/providers/{SwapFormProvider/SwapFormProvider.js → FormProvider/FormProvider.js} +11 -11
- package/cjs/providers/FormProvider/FormUpdater.d.ts +5 -0
- package/cjs/providers/{SwapFormProvider → FormProvider}/FormUpdater.js +14 -14
- package/cjs/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.js +6 -6
- package/cjs/providers/{SwapFormProvider → FormProvider}/index.d.ts +1 -1
- package/cjs/providers/{SwapFormProvider → FormProvider}/index.js +1 -1
- package/cjs/providers/FormProvider/types.d.ts +37 -0
- package/cjs/providers/FormProvider/types.js +23 -0
- package/cjs/providers/index.d.ts +1 -1
- package/cjs/providers/index.js +1 -1
- package/cjs/stores/routes/createRouteExecutionStore.js +1 -1
- package/cjs/stores/routes/index.d.ts +1 -1
- package/cjs/stores/routes/index.js +1 -1
- package/cjs/stores/routes/types.js +1 -1
- package/cjs/stores/routes/useTransactionHistory.d.ts +2 -0
- package/cjs/stores/routes/{useSwapHistory.js → useTransactionHistory.js} +3 -3
- package/cjs/types/events.js +1 -1
- package/cjs/types/widget.d.ts +4 -3
- package/cjs/types/widget.js +3 -3
- package/cjs/utils/elements.js +1 -1
- package/cjs/utils/navigationRoutes.d.ts +5 -5
- package/cjs/utils/navigationRoutes.js +15 -15
- package/components/{ActiveSwaps/ActiveSwapItem.d.ts → ActiveTransactions/ActiveTransactionItem.d.ts} +1 -1
- package/components/{ActiveSwaps/ActiveSwapItem.js → ActiveTransactions/ActiveTransactionItem.js} +3 -3
- package/components/ActiveTransactions/ActiveTransactions.d.ts +3 -0
- package/components/{ActiveSwaps/ActiveSwaps.js → ActiveTransactions/ActiveTransactions.js} +5 -5
- package/components/{ActiveSwaps/ActiveSwaps.style.d.ts → ActiveTransactions/ActiveTransactions.style.d.ts} +4 -4
- package/components/ActiveTransactions/index.d.ts +2 -0
- package/components/ActiveTransactions/index.js +2 -0
- package/components/{SwapInput/SwapInput.d.ts → AmountInput/AmountInput.d.ts} +3 -3
- package/components/{SwapInput/SwapInput.js → AmountInput/AmountInput.js} +11 -11
- package/{cjs/components/SwapInput/SwapInput.style.d.ts → components/AmountInput/AmountInput.style.d.ts} +1 -1
- package/{cjs/components/SwapInput/SwapInputAdornment.style.d.ts → components/AmountInput/AmountInputAdornment.style.d.ts} +2 -2
- package/components/AmountInput/AmountInputEndAdornment.d.ts +2 -0
- package/components/{SwapInput/SwapInputEndAdornment.js → AmountInput/AmountInputEndAdornment.js} +6 -6
- package/components/AmountInput/AmountInputStartAdornment.d.ts +3 -0
- package/components/{SwapInput/SwapInputStartAdornment.js → AmountInput/AmountInputStartAdornment.js} +4 -4
- package/components/AmountInput/FormPriceHelperText.d.ts +9 -0
- package/components/{SwapInput → AmountInput}/FormPriceHelperText.js +5 -5
- package/components/AmountInput/index.d.ts +1 -0
- package/components/AmountInput/index.js +1 -0
- package/components/Card/CardIconButton.d.ts +2 -2
- package/components/Card/CardLabel.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.d.ts +2 -2
- package/components/ChainSelect/ChainSelect.js +2 -2
- package/components/ChainSelect/useChainSelect.d.ts +2 -2
- package/components/ChainSelect/useChainSelect.js +6 -6
- package/components/ContractComponent/ContractComponent.d.ts +2 -2
- package/components/ContractComponent/ContractComponent.js +3 -5
- package/components/DefaultTransactionButton/DefaultTransactionButton.d.ts +3 -0
- package/components/DefaultTransactionButton/DefaultTransactionButton.js +32 -0
- package/components/DefaultTransactionButton/index.d.ts +2 -0
- package/components/DefaultTransactionButton/index.js +2 -0
- package/components/{SwapButton → DefaultTransactionButton}/types.d.ts +1 -2
- package/components/GasMessage/FundsSufficiencyMessage.js +1 -1
- package/components/GasMessage/GasRefuelMessage.js +1 -1
- package/components/GasMessage/GasSufficiencyMessage.js +2 -2
- package/components/Header/Header.style.d.ts +2 -2
- package/components/Header/NavigationHeader.js +19 -19
- package/components/Header/NavigationTabs.js +4 -4
- package/components/Header/NavigationTabs.style.js +2 -2
- package/components/Header/index.d.ts +1 -1
- package/components/Header/index.js +1 -1
- package/components/Header/types.d.ts +5 -2
- package/components/Header/useHeaderStore.d.ts +2 -0
- package/components/Header/useHeaderStore.js +25 -0
- package/components/Insurance/InsuranceCard.js +9 -12
- package/components/Insurance/InsuranceCollapsed.js +2 -2
- package/components/ListItemButton.d.ts +1 -1
- package/components/NFT/NFT.d.ts +1 -2
- package/components/NFT/NFT.js +17 -15
- package/components/NFT/NFT.style.d.ts +1 -1
- package/components/NFT/NFTBase.d.ts +3 -0
- package/components/NFT/NFTBase.js +9 -0
- package/components/NFT/index.d.ts +1 -0
- package/components/NFT/index.js +1 -0
- package/components/NFT/types.d.ts +3 -1
- package/components/ProgressToNextUpdate/ProgressToNextUpdate.js +4 -4
- package/components/ReverseTokensButton/ReverseTokensButton.js +10 -10
- package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
- package/components/RouteCard/RouteCard.d.ts +4 -0
- package/components/{SwapRouteCard/SwapRouteCard.js → RouteCard/RouteCard.js} +13 -13
- package/components/RouteCard/RouteCardEssentials.d.ts +3 -0
- package/components/{SwapRouteCard/SwapRouteCardEssentials.js → RouteCard/RouteCardEssentials.js} +3 -3
- package/components/RouteCard/RouteCardSkeleton.d.ts +4 -0
- package/components/{SwapRouteCard/SwapRouteCardSkeleton.js → RouteCard/RouteCardSkeleton.js} +4 -4
- package/components/RouteCard/RouteNotFoundCard.d.ts +2 -0
- package/components/{SwapRouteCard/SwapRouteNotFoundCard.js → RouteCard/RouteNotFoundCard.js} +2 -2
- package/components/RouteCard/index.d.ts +3 -0
- package/components/RouteCard/index.js +3 -0
- package/components/{SwapRouteCard → RouteCard}/types.d.ts +3 -3
- package/{cjs/components/ActiveSwaps/ActiveSwaps.d.ts → components/Routes/Routes.d.ts} +1 -1
- package/components/Routes/Routes.js +33 -0
- package/components/Routes/RoutesExpanded.d.ts +2 -0
- package/components/{SwapRoutes/SwapRoutesExpanded.js → Routes/RoutesExpanded.js} +12 -10
- package/components/Routes/index.d.ts +2 -0
- package/components/Routes/index.js +2 -0
- package/components/SelectChainAndToken.js +8 -8
- package/components/SelectTokenButton/SelectTokenButton.d.ts +2 -2
- package/components/SelectTokenButton/SelectTokenButton.js +12 -12
- package/components/SendToWallet/SendToWallet.js +10 -11
- package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/components/SendToWallet/SendToWalletButton.js +3 -3
- package/components/SmallAvatar.d.ts +1 -1
- package/components/Step/DestinationWalletAddress.js +2 -2
- package/components/Step/GasStepProcess.js +1 -1
- package/components/Step/Step.js +13 -13
- package/components/Step/StepTimer.js +2 -2
- package/components/StepActions/StepActions.d.ts +3 -3
- package/components/StepActions/StepActions.js +20 -16
- package/components/StepActions/StepActions.style.d.ts +1 -1
- package/components/StepActions/types.d.ts +2 -2
- package/components/Token/Token.js +1 -1
- package/components/TokenList/TokenList.js +3 -3
- package/components/TokenList/TokenList.style.d.ts +4 -4
- package/components/TokenList/TokenList.style.js +11 -8
- package/components/TokenList/TokenListItem.js +4 -8
- package/components/TokenList/TokenNotFound.d.ts +2 -2
- package/components/TokenList/TokenNotFound.js +3 -3
- package/components/TokenList/VirtualizedTokenList.js +2 -2
- package/components/TokenList/types.d.ts +2 -2
- package/components/TokenList/useTokenSelect.d.ts +2 -2
- package/components/TokenList/useTokenSelect.js +12 -10
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/index.d.ts +1 -1
- package/hooks/index.js +1 -1
- package/hooks/useChains.js +5 -5
- package/hooks/useFundsSufficiency.js +2 -6
- package/hooks/useGasRefuel.js +5 -5
- package/hooks/useProcessMessage.d.ts +2 -2
- package/hooks/useProcessMessage.js +46 -46
- package/hooks/useRouteExecution.js +0 -2
- package/hooks/{useSwapRoutes.d.ts → useRoutes.d.ts} +2 -2
- package/hooks/{useSwapRoutes.js → useRoutes.js} +23 -23
- package/i18n/bn.json +80 -80
- package/i18n/de.json +74 -74
- package/i18n/en.json +132 -131
- package/i18n/es.json +72 -72
- package/i18n/fr.json +102 -85
- package/i18n/id.json +86 -86
- package/i18n/it.json +86 -86
- package/i18n/ko.json +102 -85
- package/i18n/pt.json +86 -86
- package/i18n/th.json +102 -85
- package/i18n/tr.json +72 -72
- package/i18n/uk.json +97 -97
- package/i18n/vi.json +86 -86
- package/i18n/zh.json +86 -86
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +30 -16
- package/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.d.ts +2 -0
- package/pages/{ActiveSwapsPage/ActiveSwapsEmpty.js → ActiveTransactionsPage/ActiveTransactionsEmpty.js} +2 -2
- package/pages/ActiveTransactionsPage/ActiveTransactionsPage.d.ts +1 -0
- package/pages/{ActiveSwapsPage/ActiveSwapsPage.js → ActiveTransactionsPage/ActiveTransactionsPage.js} +7 -7
- package/pages/ActiveTransactionsPage/index.d.ts +1 -0
- package/pages/ActiveTransactionsPage/index.js +1 -0
- package/pages/MainPage/MainGasMessage.js +2 -2
- package/pages/MainPage/MainPage.js +7 -7
- package/pages/MainPage/ReviewButton.d.ts +2 -0
- package/pages/MainPage/ReviewButton.js +58 -0
- package/{components/ActiveSwaps/ActiveSwaps.d.ts → pages/RoutesPage/RoutesPage.d.ts} +1 -1
- package/pages/{SwapRoutesPage/SwapRoutesPage.js → RoutesPage/RoutesPage.js} +11 -11
- package/pages/RoutesPage/index.d.ts +1 -0
- package/pages/RoutesPage/index.js +1 -0
- package/pages/SelectChainPage/types.d.ts +2 -2
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +2 -2
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +1 -1
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.d.ts +2 -2
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +1 -1
- package/pages/SelectTokenPage/SearchTokenInput.js +4 -4
- package/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -2
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
- package/pages/SettingsPage/EnabledToolsButton.style.d.ts +1 -1
- package/pages/SettingsPage/ResetSettingsButton.js +1 -1
- package/pages/SettingsPage/RoutePrioritySelect.js +1 -1
- package/pages/TransactionDetailsPage/TransactionDetailsPage.d.ts +2 -0
- package/pages/{SwapDetailsPage/SwapDetailsPage.js → TransactionDetailsPage/TransactionDetailsPage.js} +7 -7
- package/pages/TransactionDetailsPage/index.d.ts +1 -0
- package/pages/TransactionDetailsPage/index.js +1 -0
- package/pages/TransactionHistoryPage/TransactionHistoryEmpty.d.ts +2 -0
- package/pages/{SwapHistoryPage/SwapHistoryEmpty.js → TransactionHistoryPage/TransactionHistoryEmpty.js} +2 -2
- package/{cjs/pages/SwapHistoryPage/SwapHistoryItem.d.ts → pages/TransactionHistoryPage/TransactionHistoryItem.d.ts} +1 -1
- package/pages/{SwapHistoryPage/SwapHistoryItem.js → TransactionHistoryPage/TransactionHistoryItem.js} +2 -2
- package/pages/TransactionHistoryPage/TransactionHistoryPage.d.ts +2 -0
- package/pages/TransactionHistoryPage/TransactionHistoryPage.js +31 -0
- package/pages/TransactionHistoryPage/index.d.ts +1 -0
- package/pages/TransactionHistoryPage/index.js +1 -0
- package/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.js +3 -3
- package/pages/TransactionPage/StartTransactionButton.d.ts +4 -0
- package/pages/TransactionPage/StartTransactionButton.js +16 -0
- package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.js +25 -22
- package/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.js +1 -1
- package/pages/TransactionPage/TransactionPage.d.ts +2 -0
- package/pages/TransactionPage/TransactionPage.js +121 -0
- package/pages/TransactionPage/index.d.ts +1 -0
- package/pages/TransactionPage/index.js +1 -0
- package/pages/TransactionPage/types.d.ts +6 -0
- package/providers/{SwapFormProvider/SwapFormProvider.d.ts → FormProvider/FormProvider.d.ts} +1 -1
- package/providers/{SwapFormProvider/SwapFormProvider.js → FormProvider/FormProvider.js} +12 -12
- package/providers/FormProvider/FormUpdater.d.ts +5 -0
- package/providers/{SwapFormProvider → FormProvider}/FormUpdater.js +14 -14
- package/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.js +7 -7
- package/providers/{SwapFormProvider → FormProvider}/index.d.ts +1 -1
- package/providers/{SwapFormProvider → FormProvider}/index.js +1 -1
- package/providers/FormProvider/types.d.ts +37 -0
- package/providers/FormProvider/types.js +20 -0
- package/providers/index.d.ts +1 -1
- package/providers/index.js +1 -1
- package/stores/routes/createRouteExecutionStore.js +1 -1
- package/stores/routes/index.d.ts +1 -1
- package/stores/routes/index.js +1 -1
- package/stores/routes/useTransactionHistory.d.ts +2 -0
- package/stores/routes/{useSwapHistory.js → useTransactionHistory.js} +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +4 -3
- package/utils/navigationRoutes.d.ts +5 -5
- package/utils/navigationRoutes.js +15 -15
- package/cjs/components/ActiveSwaps/index.d.ts +0 -2
- package/cjs/components/Header/useHeaderActionStore.d.ts +0 -2
- package/cjs/components/SwapButton/SwapButton.d.ts +0 -3
- package/cjs/components/SwapButton/SwapButton.js +0 -56
- package/cjs/components/SwapButton/index.d.ts +0 -2
- package/cjs/components/SwapInput/FormPriceHelperText.d.ts +0 -9
- package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +0 -2
- package/cjs/components/SwapInput/SwapInputStartAdornment.d.ts +0 -3
- package/cjs/components/SwapInput/index.d.ts +0 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.d.ts +0 -4
- package/cjs/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +0 -3
- package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.d.ts +0 -4
- package/cjs/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +0 -2
- package/cjs/components/SwapRouteCard/index.d.ts +0 -3
- package/cjs/components/SwapRouteCard/index.js +0 -19
- package/cjs/components/SwapRoutes/SwapRoutes.js +0 -37
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -2
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +0 -42
- package/cjs/components/SwapRoutes/index.d.ts +0 -2
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +0 -2
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/cjs/pages/ActiveSwapsPage/index.d.ts +0 -1
- package/cjs/pages/MainPage/MainSwapButton.d.ts +0 -2
- package/cjs/pages/MainPage/MainSwapButton.js +0 -27
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.d.ts +0 -2
- package/cjs/pages/SwapDetailsPage/index.d.ts +0 -1
- package/cjs/pages/SwapHistoryPage/SwapHistoryEmpty.d.ts +0 -2
- package/cjs/pages/SwapHistoryPage/SwapHistoryPage.d.ts +0 -2
- package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +0 -35
- package/cjs/pages/SwapHistoryPage/index.d.ts +0 -1
- package/cjs/pages/SwapPage/StartSwapButton.d.ts +0 -4
- package/cjs/pages/SwapPage/StartSwapButton.js +0 -21
- package/cjs/pages/SwapPage/SwapPage.d.ts +0 -2
- package/cjs/pages/SwapPage/SwapPage.js +0 -111
- package/cjs/pages/SwapPage/index.d.ts +0 -1
- package/cjs/pages/SwapPage/types.d.ts +0 -9
- package/cjs/pages/SwapRoutesPage/index.d.ts +0 -1
- package/cjs/pages/SwapRoutesPage/index.js +0 -17
- package/cjs/providers/SwapFormProvider/FormUpdater.d.ts +0 -5
- package/cjs/providers/SwapFormProvider/types.d.ts +0 -37
- package/cjs/providers/SwapFormProvider/types.js +0 -23
- package/cjs/stores/routes/useSwapHistory.d.ts +0 -2
- package/components/ActiveSwaps/index.d.ts +0 -2
- package/components/ActiveSwaps/index.js +0 -2
- package/components/Header/useHeaderActionStore.d.ts +0 -2
- package/components/Header/useHeaderActionStore.js +0 -14
- package/components/SwapButton/SwapButton.d.ts +0 -3
- package/components/SwapButton/SwapButton.js +0 -52
- package/components/SwapButton/index.d.ts +0 -2
- package/components/SwapButton/index.js +0 -2
- package/components/SwapInput/FormPriceHelperText.d.ts +0 -9
- package/components/SwapInput/SwapInputEndAdornment.d.ts +0 -2
- package/components/SwapInput/SwapInputStartAdornment.d.ts +0 -3
- package/components/SwapInput/index.d.ts +0 -1
- package/components/SwapInput/index.js +0 -1
- package/components/SwapRouteCard/SwapRouteCard.d.ts +0 -4
- package/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +0 -3
- package/components/SwapRouteCard/SwapRouteCardSkeleton.d.ts +0 -4
- package/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +0 -2
- package/components/SwapRouteCard/index.d.ts +0 -3
- package/components/SwapRouteCard/index.js +0 -3
- package/components/SwapRoutes/SwapRoutes.js +0 -33
- package/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -2
- package/components/SwapRoutes/index.d.ts +0 -2
- package/components/SwapRoutes/index.js +0 -2
- package/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +0 -2
- package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/pages/ActiveSwapsPage/index.d.ts +0 -1
- package/pages/ActiveSwapsPage/index.js +0 -1
- package/pages/MainPage/MainSwapButton.d.ts +0 -2
- package/pages/MainPage/MainSwapButton.js +0 -23
- package/pages/SwapDetailsPage/SwapDetailsPage.d.ts +0 -2
- package/pages/SwapDetailsPage/index.d.ts +0 -1
- package/pages/SwapDetailsPage/index.js +0 -1
- package/pages/SwapHistoryPage/SwapHistoryEmpty.d.ts +0 -2
- package/pages/SwapHistoryPage/SwapHistoryPage.d.ts +0 -2
- package/pages/SwapHistoryPage/SwapHistoryPage.js +0 -31
- package/pages/SwapHistoryPage/index.d.ts +0 -1
- package/pages/SwapHistoryPage/index.js +0 -1
- package/pages/SwapPage/StartSwapButton.d.ts +0 -4
- package/pages/SwapPage/StartSwapButton.js +0 -16
- package/pages/SwapPage/SwapPage.d.ts +0 -2
- package/pages/SwapPage/SwapPage.js +0 -107
- package/pages/SwapPage/index.d.ts +0 -1
- package/pages/SwapPage/index.js +0 -1
- package/pages/SwapPage/types.d.ts +0 -9
- package/pages/SwapRoutesPage/SwapRoutesPage.d.ts +0 -3
- package/pages/SwapRoutesPage/index.d.ts +0 -1
- package/pages/SwapRoutesPage/index.js +0 -1
- package/providers/SwapFormProvider/FormUpdater.d.ts +0 -5
- package/providers/SwapFormProvider/types.d.ts +0 -37
- package/providers/SwapFormProvider/types.js +0 -20
- package/stores/routes/useSwapHistory.d.ts +0 -2
- /package/cjs/components/{ActiveSwaps/ActiveSwaps.style.js → ActiveTransactions/ActiveTransactions.style.js} +0 -0
- /package/cjs/components/{SwapInput/SwapInput.style.js → AmountInput/AmountInput.style.js} +0 -0
- /package/cjs/components/{SwapInput/SwapInputAdornment.style.js → AmountInput/AmountInputAdornment.style.js} +0 -0
- /package/cjs/components/{SwapButton → DefaultTransactionButton}/types.js +0 -0
- /package/cjs/components/{SwapRouteCard/SwapRouteCard.style.d.ts → RouteCard/RouteCard.style.d.ts} +0 -0
- /package/cjs/components/{SwapRouteCard/SwapRouteCard.style.js → RouteCard/RouteCard.style.js} +0 -0
- /package/cjs/components/{SwapRouteCard → RouteCard}/types.js +0 -0
- /package/cjs/components/{SwapRouteCard → RouteCard}/utils.d.ts +0 -0
- /package/cjs/components/{SwapRouteCard → RouteCard}/utils.js +0 -0
- /package/cjs/components/{SwapRoutes/SwapRoutesExpanded.style.d.ts → Routes/RoutesExpanded.style.d.ts} +0 -0
- /package/cjs/components/{SwapRoutes/SwapRoutesExpanded.style.js → Routes/RoutesExpanded.style.js} +0 -0
- /package/cjs/pages/{SwapRoutesPage/SwapRoutesPage.style.d.ts → RoutesPage/RoutesPage.style.d.ts} +0 -0
- /package/cjs/pages/{SwapRoutesPage/SwapRoutesPage.style.js → RoutesPage/RoutesPage.style.js} +0 -0
- /package/cjs/pages/{SwapDetailsPage/SwapDetailsPage.style.d.ts → TransactionDetailsPage/TransactionDetailsPage.style.d.ts} +0 -0
- /package/cjs/pages/{SwapDetailsPage/SwapDetailsPage.style.js → TransactionDetailsPage/TransactionDetailsPage.style.js} +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.d.ts +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.d.ts +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.d.ts +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.js +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.d.ts +0 -0
- /package/cjs/pages/{SwapPage/SwapPage.style.d.ts → TransactionPage/TransactionPage.style.d.ts} +0 -0
- /package/cjs/pages/{SwapPage/SwapPage.style.js → TransactionPage/TransactionPage.style.js} +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/types.js +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/utils.d.ts +0 -0
- /package/cjs/pages/{SwapPage → TransactionPage}/utils.js +0 -0
- /package/cjs/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.d.ts +0 -0
- /package/components/{ActiveSwaps/ActiveSwaps.style.js → ActiveTransactions/ActiveTransactions.style.js} +0 -0
- /package/components/{SwapInput/SwapInput.style.js → AmountInput/AmountInput.style.js} +0 -0
- /package/components/{SwapInput/SwapInputAdornment.style.js → AmountInput/AmountInputAdornment.style.js} +0 -0
- /package/components/{SwapButton → DefaultTransactionButton}/types.js +0 -0
- /package/components/{SwapRouteCard/SwapRouteCard.style.d.ts → RouteCard/RouteCard.style.d.ts} +0 -0
- /package/components/{SwapRouteCard/SwapRouteCard.style.js → RouteCard/RouteCard.style.js} +0 -0
- /package/components/{SwapRouteCard → RouteCard}/types.js +0 -0
- /package/components/{SwapRouteCard → RouteCard}/utils.d.ts +0 -0
- /package/components/{SwapRouteCard → RouteCard}/utils.js +0 -0
- /package/components/{SwapRoutes/SwapRoutesExpanded.style.d.ts → Routes/RoutesExpanded.style.d.ts} +0 -0
- /package/components/{SwapRoutes/SwapRoutesExpanded.style.js → Routes/RoutesExpanded.style.js} +0 -0
- /package/pages/{SwapRoutesPage/SwapRoutesPage.style.d.ts → RoutesPage/RoutesPage.style.d.ts} +0 -0
- /package/pages/{SwapRoutesPage/SwapRoutesPage.style.js → RoutesPage/RoutesPage.style.js} +0 -0
- /package/pages/{SwapDetailsPage/SwapDetailsPage.style.d.ts → TransactionDetailsPage/TransactionDetailsPage.style.d.ts} +0 -0
- /package/pages/{SwapDetailsPage/SwapDetailsPage.style.js → TransactionDetailsPage/TransactionDetailsPage.style.js} +0 -0
- /package/pages/{SwapPage → TransactionPage}/ExchangeRateBottomSheet.d.ts +0 -0
- /package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.d.ts +0 -0
- /package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.d.ts +0 -0
- /package/pages/{SwapPage → TransactionPage}/StatusBottomSheet.style.js +0 -0
- /package/pages/{SwapPage → TransactionPage}/TokenValueBottomSheet.d.ts +0 -0
- /package/pages/{SwapPage/SwapPage.style.d.ts → TransactionPage/TransactionPage.style.d.ts} +0 -0
- /package/pages/{SwapPage/SwapPage.style.js → TransactionPage/TransactionPage.style.js} +0 -0
- /package/pages/{SwapPage → TransactionPage}/types.js +0 -0
- /package/pages/{SwapPage → TransactionPage}/utils.d.ts +0 -0
- /package/pages/{SwapPage → TransactionPage}/utils.js +0 -0
- /package/providers/{SwapFormProvider → FormProvider}/URLSearchParamsBuilder.d.ts +0 -0
package/i18n/zh.json
CHANGED
|
@@ -77,38 +77,87 @@
|
|
|
77
77
|
"showDestinationWallet": "显示收款钱包",
|
|
78
78
|
"slippage": "滑点"
|
|
79
79
|
},
|
|
80
|
-
"
|
|
80
|
+
"info": {
|
|
81
|
+
"message": {
|
|
82
|
+
"autoRefuel": "您在 {{chainName}} 链上的燃气费很低。如果启用该选项,您将获得足够的燃气费完成此次兑换。",
|
|
83
|
+
"emptyActiveSwaps": "正在进行的兑换将在这里显示。一旦完成,你可在兑换记录中找到它们。",
|
|
84
|
+
"emptySwapHistory": "兑换记录只存储在本地,如果你清除浏览器数据,他们将被删除。",
|
|
85
|
+
"emptyTokenList": "我们无法在 {{chainName}} 链上找到这些代币,或者你的钱包内没有这些代币。请再次搜索或者选择其他链再试一次。",
|
|
86
|
+
"routeNotFound": "试试另一个代币组合。"
|
|
87
|
+
},
|
|
88
|
+
"title": {
|
|
89
|
+
"autoRefuel": "获得燃气费",
|
|
90
|
+
"emptyActiveSwaps": "没有正在进行的兑换",
|
|
91
|
+
"emptySwapHistory": "没有兑换记录",
|
|
92
|
+
"routeNotFound": "没有可用的路由"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"success": {
|
|
96
|
+
"message": {
|
|
97
|
+
"swapPartiallySuccessful": "我们试图完成兑换,但 {{tool}} 的 {{tokenSymbol}} 代币流动性不足。",
|
|
98
|
+
"purchaseSuccessful": "您的 {{walletAddress}} 钱包在 {{chainName}} 链上拥有该 {{assetName}} 财产",
|
|
99
|
+
"swapSuccessful": "现在有 {{amount, number(maximumFractionDigits: 9)}} 个{{tokenSymbol}} 在{{chainName}} 链上的{{walletAddress}} 钱包里。"
|
|
100
|
+
},
|
|
101
|
+
"title": {
|
|
102
|
+
"gasSwapSuccessful": "燃气费兑换成功",
|
|
103
|
+
"purchaseSuccessful": "购买成功",
|
|
104
|
+
"refundIssued": "退款已受理",
|
|
105
|
+
"swapPartiallySuccessful": "兑换部分完成",
|
|
106
|
+
"swapSuccessful": "兑换成功"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"warning": {
|
|
110
|
+
"message": {
|
|
111
|
+
"deleteActiveSwaps": "正在进行的兑换记录只存储在本地,如果删除它们,我们将无法恢复这些记录。",
|
|
112
|
+
"deleteSwapHistory": "兑换记录只存储在本地,如果你删除它,我们将无法恢复这些记录。",
|
|
113
|
+
"highValueLoss": "收到的代币的价值明显低于要被兑换的代币和交易成本。",
|
|
114
|
+
"insufficientFunds": "你没有足够的资金来完成这笔交易。",
|
|
115
|
+
"insufficientGas": "您没有足够的燃气费来完成此次交易。您至少需要添加:",
|
|
116
|
+
"rateChanged": "兑换比例已经改变,如果继续兑换,您将接受新的兑换比例。",
|
|
117
|
+
"resetSettings": "这将重置您的路由优先级,滑点,燃气费,选中的跨链桥和链上交易所。"
|
|
118
|
+
},
|
|
119
|
+
"title": {
|
|
120
|
+
"deleteActiveSwaps": "确定要清空正在进行的兑换记录?",
|
|
121
|
+
"deleteSwap": "确定要删除这个兑换记录?",
|
|
122
|
+
"deleteSwapHistory": "确定要清空兑换记录?",
|
|
123
|
+
"highValueLoss": "大额资金损失",
|
|
124
|
+
"insufficientGas": "燃气费不足",
|
|
125
|
+
"rateChanged": "兑换比例变动",
|
|
126
|
+
"resetSettings": "确定要恢复默认设置吗?"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"error": {
|
|
130
|
+
"message": {
|
|
131
|
+
"allowanceRequired": "{{tokenSymbol}} 的转账金额超过了您设置的支出上限。请提高该代币的支出上限,然后重试。",
|
|
132
|
+
"insufficientFunds": "您没有足够的燃气费支付该交易。",
|
|
133
|
+
"slippageThreshold": "滑点大于预设值,请选择其他路由并获取新的价格。",
|
|
134
|
+
"transactionFailed": "请查看区块浏览器以了解更多信息。",
|
|
135
|
+
"transactionNotSent": "交易未发送,不用担心,{{chainName}} 链上{{amount, number(maximumFractionDigits: 9)}} 个{{tokenSymbol}} 仍在您的钱包里。",
|
|
136
|
+
"transactionRejected": "需要您签名来完成此次交易,资金是安全的,{{chainName}} 链上{{amount, number(maximumFractionDigits: 9)}} 个{{tokenSymbol}} 仍在您的钱包里。",
|
|
137
|
+
"unknown": "请再试一次或者联系支持。"
|
|
138
|
+
},
|
|
139
|
+
"title": {
|
|
140
|
+
"allowanceRequired": "余额不足",
|
|
141
|
+
"balanceIsTooLow": "余额太低",
|
|
142
|
+
"chainSwitch": "请切换当前网络",
|
|
143
|
+
"failed": "兑换失败",
|
|
144
|
+
"gasLimitIsTooLow": "燃气费设置过低",
|
|
145
|
+
"insufficientFunds": "资金不足",
|
|
146
|
+
"slippageNotMet": "滑点未满足",
|
|
147
|
+
"transactionCanceled": "交易取消",
|
|
148
|
+
"transactionFailed": "交易失败",
|
|
149
|
+
"transactionRejected": "交易需要签名",
|
|
150
|
+
"transactionUnderpriced": "交易定价过低",
|
|
151
|
+
"transactionUnprepared": "无法开始该交易",
|
|
152
|
+
"unknown": "未知错误",
|
|
153
|
+
"walletAddressInvalid": "钱包地址无效。",
|
|
154
|
+
"walletAddressRequired": "请输入钱包地址。",
|
|
155
|
+
"walletEnsAddressInvalid": "钱包地址无效或者当前网络不支持ENS。"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"main": {
|
|
81
159
|
"crossStepDetails": "通过{{tool}}把资产从{{from}}链跨到{{to}}链上",
|
|
82
160
|
"currentAmount": "当前余额",
|
|
83
|
-
"error": {
|
|
84
|
-
"message": {
|
|
85
|
-
"allowanceRequired": "{{tokenSymbol}} 的转账金额超过了您设置的支出上限。请提高该代币的支出上限,然后重试。",
|
|
86
|
-
"insufficientFunds": "您没有足够的燃气费支付该交易。",
|
|
87
|
-
"slippageThreshold": "滑点大于预设值,请选择其他路由并获取新的价格。",
|
|
88
|
-
"transactionFailed": "请查看区块浏览器以了解更多信息。",
|
|
89
|
-
"transactionNotSent": "交易未发送,不用担心,{{chainName}} 链上{{amount, number(maximumFractionDigits: 9)}} 个{{tokenSymbol}} 仍在您的钱包里。",
|
|
90
|
-
"transactionRejected": "需要您签名来完成此次交易,资金是安全的,{{chainName}} 链上{{amount, number(maximumFractionDigits: 9)}} 个{{tokenSymbol}} 仍在您的钱包里。",
|
|
91
|
-
"unknown": "请再试一次或者联系支持。"
|
|
92
|
-
},
|
|
93
|
-
"title": {
|
|
94
|
-
"allowanceRequired": "余额不足",
|
|
95
|
-
"balanceIsTooLow": "余额太低",
|
|
96
|
-
"chainSwitch": "请切换当前网络",
|
|
97
|
-
"failed": "兑换失败",
|
|
98
|
-
"gasLimitIsTooLow": "燃气费设置过低",
|
|
99
|
-
"insufficientFunds": "资金不足",
|
|
100
|
-
"slippageNotMet": "滑点未满足",
|
|
101
|
-
"transactionCanceled": "交易取消",
|
|
102
|
-
"transactionFailed": "交易失败",
|
|
103
|
-
"transactionRejected": "交易需要签名",
|
|
104
|
-
"transactionUnderpriced": "交易定价过低",
|
|
105
|
-
"transactionUnprepared": "无法开始该交易",
|
|
106
|
-
"unknown": "未知错误",
|
|
107
|
-
"walletAddressInvalid": "钱包地址无效。",
|
|
108
|
-
"walletAddressRequired": "请输入钱包地址。",
|
|
109
|
-
"walletEnsAddressInvalid": "钱包地址无效或者当前网络不支持ENS。"
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
161
|
"estimatedTime": "{{value}}分钟",
|
|
113
162
|
"featuredTokens": "精选代币",
|
|
114
163
|
"from": "从",
|
|
@@ -117,27 +166,6 @@
|
|
|
117
166
|
"gasFeeEstimated": "预估燃气费",
|
|
118
167
|
"gasFeePaid": "已支付燃气费",
|
|
119
168
|
"inProgress": "进行中",
|
|
120
|
-
"insurance": {
|
|
121
|
-
"bridgeExploits": "跨链桥故障、被黑或者被利用漏洞",
|
|
122
|
-
"insure": "在跨链期间为<strong>{{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}}</strong> 投保。",
|
|
123
|
-
"insured": "在跨链期间为<strong>{{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}}</strong> 投保。",
|
|
124
|
-
"slippageError": "目标链代币的滑点错误"
|
|
125
|
-
},
|
|
126
|
-
"info": {
|
|
127
|
-
"message": {
|
|
128
|
-
"autoRefuel": "您在 {{chainName}} 链上的燃气费很低。如果启用该选项,您将获得足够的燃气费完成此次兑换。",
|
|
129
|
-
"emptyActiveSwaps": "正在进行的兑换将在这里显示。一旦完成,你可在兑换记录中找到它们。",
|
|
130
|
-
"emptySwapHistory": "兑换记录只存储在本地,如果你清除浏览器数据,他们将被删除。",
|
|
131
|
-
"emptyTokenList": "我们无法在 {{chainName}} 链上找到这些代币,或者你的钱包内没有这些代币。请再次搜索或者选择其他链再试一次。",
|
|
132
|
-
"routeNotFound": "试试另一个代币组合。"
|
|
133
|
-
},
|
|
134
|
-
"title": {
|
|
135
|
-
"autoRefuel": "获得燃气费",
|
|
136
|
-
"emptyActiveSwaps": "没有正在进行的兑换",
|
|
137
|
-
"emptySwapHistory": "没有兑换记录",
|
|
138
|
-
"routeNotFound": "没有可用的路由"
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
169
|
"nftStepDetails": "通过 {{tool}} 购买 NFT",
|
|
142
170
|
"onChain": "在{{chainName}} 上",
|
|
143
171
|
"otherTokens": "其他代币",
|
|
@@ -190,20 +218,6 @@
|
|
|
190
218
|
"stepSwap": "兑换",
|
|
191
219
|
"stepSwapAndBridge": "兑换和跨链",
|
|
192
220
|
"stepSwapAndBuy": "兑换并购买",
|
|
193
|
-
"success": {
|
|
194
|
-
"message": {
|
|
195
|
-
"swapPartiallySuccessful": "我们试图完成兑换,但 {{tool}} 的 {{tokenSymbol}} 代币流动性不足。",
|
|
196
|
-
"purchaseSuccessful": "您的 {{walletAddress}} 钱包在 {{chainName}} 链上拥有该 {{assetName}} 财产",
|
|
197
|
-
"swapSuccessful": "现在有 {{amount, number(maximumFractionDigits: 9)}} 个{{tokenSymbol}} 在{{chainName}} 链上的{{walletAddress}} 钱包里。"
|
|
198
|
-
},
|
|
199
|
-
"title": {
|
|
200
|
-
"gasSwapSuccessful": "燃气费兑换成功",
|
|
201
|
-
"purchaseSuccessful": "购买成功",
|
|
202
|
-
"refundIssued": "退款已受理",
|
|
203
|
-
"swapPartiallySuccessful": "兑换部分完成",
|
|
204
|
-
"swapSuccessful": "兑换成功"
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
221
|
"supportId": "支持ID",
|
|
208
222
|
"swapStepDetails": "通过{{tool}}在{{chain}}链上兑换代币",
|
|
209
223
|
"swapping": "兑换中",
|
|
@@ -221,27 +235,13 @@
|
|
|
221
235
|
"tokenOnChainAmount": "{{chainName}} 链上{{amount, number(maximumFractionDigits: 9)}} 个{{tokenSymbol}}",
|
|
222
236
|
"tokenSearch": "按代币名称或者地址搜索",
|
|
223
237
|
"valueLoss": "资金损失",
|
|
224
|
-
"walletAddressOrEns": "钱包地址或ENS名称"
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
"insufficientGas": "您没有足够的燃气费来完成此次交易。您至少需要添加:",
|
|
232
|
-
"rateChanged": "兑换比例已经改变,如果继续兑换,您将接受新的兑换比例。",
|
|
233
|
-
"resetSettings": "这将重置您的路由优先级,滑点,燃气费,选中的跨链桥和链上交易所。"
|
|
234
|
-
},
|
|
235
|
-
"title": {
|
|
236
|
-
"deleteActiveSwaps": "确定要清空正在进行的兑换记录?",
|
|
237
|
-
"deleteSwap": "确定要删除这个兑换记录?",
|
|
238
|
-
"deleteSwapHistory": "确定要清空兑换记录?",
|
|
239
|
-
"highValueLoss": "大额资金损失",
|
|
240
|
-
"insufficientGas": "燃气费不足",
|
|
241
|
-
"rateChanged": "兑换比例变动",
|
|
242
|
-
"resetSettings": "确定要恢复默认设置吗?"
|
|
243
|
-
}
|
|
244
|
-
}
|
|
238
|
+
"walletAddressOrEns": "钱包地址或ENS名称"
|
|
239
|
+
},
|
|
240
|
+
"insurance": {
|
|
241
|
+
"bridgeExploits": "跨链桥故障、被黑或者被利用漏洞",
|
|
242
|
+
"insure": "在跨链期间为<0>{{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}}</0> 投保。",
|
|
243
|
+
"insured": "在跨链期间为<0>{{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}}</0> 投保。",
|
|
244
|
+
"slippageError": "目标链代币的滑点错误"
|
|
245
245
|
},
|
|
246
246
|
"tooltip": {
|
|
247
247
|
"additionalProviderFee": "跨链和交易所的手续费。",
|
package/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './fonts/inter.css';
|
|
3
|
+
export { useFormContext, useWatch } from 'react-hook-form';
|
|
3
4
|
export type { WidgetDrawer } from './AppDrawer';
|
|
4
5
|
export * from './components/NFT';
|
|
5
6
|
export * from './config/version';
|
|
6
7
|
export { useWidgetEvents, widgetEvents } from './hooks';
|
|
8
|
+
export * from './providers/FormProvider/types';
|
|
7
9
|
export { useWallet } from './providers/WalletProvider';
|
|
8
10
|
export * from './types';
|
|
9
11
|
export declare const LiFiWidget: import("react").ForwardRefExoticComponent<import("./types").WidgetDrawerProps & import("./types").WidgetConfig & import("./types").WidgetConfigPartialProps & import("react").RefAttributes<import("./AppDrawer").WidgetDrawer>>;
|
package/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { App } from './App';
|
|
2
2
|
// TODO: remove or make optional
|
|
3
3
|
import './fonts/inter.css';
|
|
4
|
+
export { useFormContext, useWatch } from 'react-hook-form';
|
|
4
5
|
export * from './components/NFT';
|
|
5
6
|
export * from './config/version';
|
|
6
7
|
export { useWidgetEvents, widgetEvents } from './hooks';
|
|
8
|
+
export * from './providers/FormProvider/types';
|
|
7
9
|
export { useWallet } from './providers/WalletProvider';
|
|
8
10
|
export * from './types';
|
|
9
11
|
// ClassNameGenerator.configure((componentName) =>
|
package/package.json
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.15",
|
|
4
4
|
"description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
|
|
5
|
-
"main": "./
|
|
6
|
-
"module": "./index.
|
|
5
|
+
"main": "./src/index.ts",
|
|
6
|
+
"module": "./src/index.ts",
|
|
7
7
|
"types": "./index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"watch": "tsc -w -p ./tsconfig.json",
|
|
10
|
+
"build": "tsc --build --clean && yarn build:version && tsc --build && tsc --build tsconfig.cjs.json && yarn build:copy-files",
|
|
11
|
+
"build:copy-files": "node ../../scripts/copy-files.js && cpy 'src/**/*' '!src/**/*.ts*' build && cpy 'src/**/*' '!src/**/*.ts*' build/cjs",
|
|
12
|
+
"build:version": "node ../../scripts/version.js",
|
|
13
|
+
"pre-commit": "lint-staged",
|
|
14
|
+
"lint": "eslint --ext .tsx --ext .ts ./src",
|
|
15
|
+
"lint:fix": "eslint --ext .tsx --ext .ts ./src --fix",
|
|
16
|
+
"prettier:fix": "prettier --write ./src/."
|
|
17
|
+
},
|
|
8
18
|
"lint-staged": {
|
|
9
19
|
"src/**/*.{ts,tsx}": [
|
|
10
20
|
"yarn run lint:fix",
|
|
@@ -37,34 +47,38 @@
|
|
|
37
47
|
"lifi"
|
|
38
48
|
],
|
|
39
49
|
"dependencies": {
|
|
40
|
-
"@emotion/react": "^11.11.
|
|
50
|
+
"@emotion/react": "^11.11.1",
|
|
41
51
|
"@emotion/styled": "^11.11.0",
|
|
42
52
|
"@ethersproject/abstract-signer": "^5.7.0",
|
|
43
53
|
"@ethersproject/address": "^5.7.0",
|
|
44
54
|
"@ethersproject/experimental": "^5.7.0",
|
|
45
55
|
"@ethersproject/providers": "^5.7.2",
|
|
46
|
-
"@lifi/sdk": "^2.0.0-beta.
|
|
47
|
-
"@lifi/wallet-management": "^2.0.0-beta.
|
|
56
|
+
"@lifi/sdk": "^2.0.0-beta.16",
|
|
57
|
+
"@lifi/wallet-management": "^2.0.0-beta.10",
|
|
48
58
|
"@mui/icons-material": "^5.11.16",
|
|
49
|
-
"@mui/lab": "^5.0.0-alpha.
|
|
50
|
-
"@mui/material": "^5.13.
|
|
51
|
-
"@tanstack/react-query": "^4.29.
|
|
59
|
+
"@mui/lab": "^5.0.0-alpha.134",
|
|
60
|
+
"@mui/material": "^5.13.5",
|
|
61
|
+
"@tanstack/react-query": "^4.29.13",
|
|
52
62
|
"@tanstack/react-virtual": "^3.0.0-beta.54",
|
|
53
63
|
"big.js": "^6.2.1",
|
|
54
|
-
"i18next": "^22.5.
|
|
55
|
-
"i18next-browser-languagedetector": "^7.0.
|
|
64
|
+
"i18next": "^22.5.1",
|
|
65
|
+
"i18next-browser-languagedetector": "^7.0.2",
|
|
56
66
|
"microdiff": "^1.3.2",
|
|
57
67
|
"mitt": "^3.0.0",
|
|
58
68
|
"react": "^18.2.0",
|
|
59
69
|
"react-dom": "^18.2.0",
|
|
60
|
-
"react-hook-form": "^7.
|
|
70
|
+
"react-hook-form": "^7.44.3",
|
|
61
71
|
"react-i18next": "^12.3.1",
|
|
62
|
-
"react-intersection-observer": "^9.4.
|
|
63
|
-
"react-router-dom": "^6.
|
|
72
|
+
"react-intersection-observer": "^9.4.4",
|
|
73
|
+
"react-router-dom": "^6.12.1",
|
|
64
74
|
"react-timer-hook": "^3.0.6",
|
|
65
75
|
"uuid": "^9.0.0",
|
|
66
76
|
"zustand": "^4.3.8"
|
|
67
77
|
},
|
|
78
|
+
"devDependencies": {
|
|
79
|
+
"cpy-cli": "^4.2.0",
|
|
80
|
+
"typescript": "^5.1.3"
|
|
81
|
+
},
|
|
68
82
|
"peerDependencies": {
|
|
69
83
|
"@types/react": "^18.0.0",
|
|
70
84
|
"react": "^18.0.0",
|
|
@@ -79,5 +93,5 @@
|
|
|
79
93
|
"extends": "../../.eslintrc"
|
|
80
94
|
},
|
|
81
95
|
"sideEffects": false,
|
|
82
|
-
"
|
|
83
|
-
}
|
|
96
|
+
"gitHead": "183d16a641a21a8176105452c08d2f7079925125"
|
|
97
|
+
}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import SwapHorizIcon from '@mui/icons-material/SwapHoriz';
|
|
3
3
|
import { Container, Typography } from '@mui/material';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
export const
|
|
5
|
+
export const ActiveTransactionsEmpty = () => {
|
|
6
6
|
const { t } = useTranslation();
|
|
7
7
|
return (_jsxs(Container, { sx: {
|
|
8
8
|
display: 'flex',
|
|
@@ -11,5 +11,5 @@ export const ActiveSwapsEmpty = () => {
|
|
|
11
11
|
alignItems: 'center',
|
|
12
12
|
justifyContent: 'center',
|
|
13
13
|
paddingY: 12,
|
|
14
|
-
}, children: [_jsx(Typography, { fontSize: 48, children: _jsx(SwapHorizIcon, { fontSize: "inherit" }) }), _jsx(Typography, { fontSize: 18, fontWeight: 700, children: t('
|
|
14
|
+
}, children: [_jsx(Typography, { fontSize: 48, children: _jsx(SwapHorizIcon, { fontSize: "inherit" }) }), _jsx(Typography, { fontSize: 18, fontWeight: 700, children: t('info.title.emptyActiveTransactions') }), _jsx(Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, children: t('info.message.emptyActiveTransactions') })] }));
|
|
15
15
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ActiveTransactionsPage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,13 +3,13 @@ import DeleteIcon from '@mui/icons-material/DeleteOutline';
|
|
|
3
3
|
import { Button, Container, DialogActions, DialogContent, DialogContentText, DialogTitle, IconButton, List, } from '@mui/material';
|
|
4
4
|
import { useCallback, useEffect, useState } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import {
|
|
6
|
+
import { ActiveTransactionItem } from '../../components/ActiveTransactions';
|
|
7
7
|
import { Dialog } from '../../components/Dialog';
|
|
8
|
-
import {
|
|
8
|
+
import { useHeaderStore } from '../../components/Header';
|
|
9
9
|
import { useWallet } from '../../providers';
|
|
10
10
|
import { useExecutingRoutesIds, useRouteExecutionStore } from '../../stores';
|
|
11
|
-
import {
|
|
12
|
-
export const
|
|
11
|
+
import { ActiveTransactionsEmpty } from './ActiveTransactionsEmpty';
|
|
12
|
+
export const ActiveTransactionsPage = () => {
|
|
13
13
|
const { t } = useTranslation();
|
|
14
14
|
const { account } = useWallet();
|
|
15
15
|
const executingRoutes = useExecutingRoutesIds(account.address);
|
|
@@ -20,14 +20,14 @@ export const ActiveSwapsPage = () => {
|
|
|
20
20
|
}, []);
|
|
21
21
|
useEffect(() => {
|
|
22
22
|
if (executingRoutes.length) {
|
|
23
|
-
return
|
|
23
|
+
return useHeaderStore.getState().setAction(_jsx(IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: _jsx(DeleteIcon, {}) }));
|
|
24
24
|
}
|
|
25
25
|
}, [executingRoutes.length, toggleDialog]);
|
|
26
26
|
if (!executingRoutes.length) {
|
|
27
|
-
return _jsx(
|
|
27
|
+
return _jsx(ActiveTransactionsEmpty, {});
|
|
28
28
|
}
|
|
29
29
|
return (_jsxs(Container, { disableGutters: true, children: [_jsx(List, { sx: {
|
|
30
30
|
paddingLeft: 1.5,
|
|
31
31
|
paddingRight: 1.5,
|
|
32
|
-
}, children: executingRoutes.map((routeId) => (_jsx(
|
|
32
|
+
}, children: executingRoutes.map((routeId) => (_jsx(ActiveTransactionItem, { routeId: routeId }, routeId))) }), _jsxs(Dialog, { open: open, onClose: toggleDialog, children: [_jsx(DialogTitle, { children: t('warning.title.deleteActiveTransactions') }), _jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('warning.message.deleteActiveTransactions') }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: toggleDialog, children: t('button.cancel') }), _jsx(Button, { variant: "contained", onClick: () => deleteRoutes('active'), autoFocus: true, children: t('button.delete') })] })] })] }));
|
|
33
33
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ActiveTransactionsPage';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ActiveTransactionsPage';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { GasMessage } from '../../components/GasMessage';
|
|
3
|
-
import {
|
|
3
|
+
import { useRoutes } from '../../hooks';
|
|
4
4
|
export const MainGasMessage = (props) => {
|
|
5
|
-
const { routes } =
|
|
5
|
+
const { routes } = useRoutes();
|
|
6
6
|
const currentRoute = routes?.[0];
|
|
7
7
|
return _jsx(GasMessage, { route: currentRoute, ...props });
|
|
8
8
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
|
-
import {
|
|
3
|
+
import { ActiveTransactions } from '../../components/ActiveTransactions';
|
|
4
|
+
import { AmountInput } from '../../components/AmountInput';
|
|
4
5
|
import { ContractComponent } from '../../components/ContractComponent';
|
|
5
6
|
import { GasRefuelMessage } from '../../components/GasMessage';
|
|
7
|
+
import { Routes } from '../../components/Routes';
|
|
6
8
|
import { SelectChainAndToken } from '../../components/SelectChainAndToken';
|
|
7
9
|
import { SendToWallet, SendToWalletButton, } from '../../components/SendToWallet';
|
|
8
|
-
import { SwapInput } from '../../components/SwapInput';
|
|
9
|
-
import { SwapRoutes } from '../../components/SwapRoutes';
|
|
10
10
|
import { useExpandableVariant } from '../../hooks';
|
|
11
11
|
import { useWidgetConfig } from '../../providers';
|
|
12
12
|
import { MainGasMessage } from './MainGasMessage';
|
|
13
13
|
import { FormContainer } from './MainPage.style';
|
|
14
|
-
import {
|
|
14
|
+
import { ReviewButton } from './ReviewButton';
|
|
15
15
|
export const MainPage = () => {
|
|
16
16
|
const expandable = useExpandableVariant();
|
|
17
|
-
const {
|
|
18
|
-
const nft =
|
|
19
|
-
return (_jsxs(FormContainer, { disableGutters: true, children: [_jsx(
|
|
17
|
+
const { subvariant, contractComponent } = useWidgetConfig();
|
|
18
|
+
const nft = subvariant === 'nft';
|
|
19
|
+
return (_jsxs(FormContainer, { disableGutters: true, children: [_jsx(ActiveTransactions, { mx: 3, mt: 1, mb: 1 }), nft ? (_jsx(ContractComponent, { mx: 3, mt: 1, mb: 1, children: contractComponent })) : null, _jsx(SelectChainAndToken, { mt: 1, mx: 3, mb: 2 }), !nft ? _jsx(AmountInput, { formType: "from", mx: 3, mb: 2 }) : null, !expandable ? _jsx(Routes, { mx: 3, mb: 2 }) : null, _jsx(SendToWallet, { mx: 3, mb: 2 }), _jsx(GasRefuelMessage, { mx: 3, mb: 2 }), _jsx(MainGasMessage, { mx: 3, mb: 2 }), _jsxs(Box, { display: "flex", mx: 3, mb: 1, children: [_jsx(ReviewButton, {}), _jsx(SendToWalletButton, {})] })] }));
|
|
20
20
|
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useFormState } from 'react-hook-form';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { useNavigate } from 'react-router-dom';
|
|
5
|
+
import { DefaultTransactionButton } from '../../components/DefaultTransactionButton';
|
|
6
|
+
import { useRoutes } from '../../hooks';
|
|
7
|
+
import { useWidgetConfig } from '../../providers';
|
|
8
|
+
import { useSetExecutableRoute, useSplitSubvariantStore } from '../../stores';
|
|
9
|
+
import { navigationRoutes } from '../../utils';
|
|
10
|
+
export const ReviewButton = () => {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
const navigate = useNavigate();
|
|
13
|
+
const { isValid, isValidating } = useFormState();
|
|
14
|
+
const setExecutableRoute = useSetExecutableRoute();
|
|
15
|
+
const { subvariant } = useWidgetConfig();
|
|
16
|
+
const splitState = useSplitSubvariantStore((state) => state.state);
|
|
17
|
+
const { routes } = useRoutes();
|
|
18
|
+
const currentRoute = routes?.[0];
|
|
19
|
+
const handleClick = async () => {
|
|
20
|
+
if (currentRoute) {
|
|
21
|
+
setExecutableRoute(currentRoute);
|
|
22
|
+
navigate(navigationRoutes.transactionExecution, {
|
|
23
|
+
state: { routeId: currentRoute.id },
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const getButtonText = () => {
|
|
28
|
+
if (currentRoute) {
|
|
29
|
+
switch (subvariant) {
|
|
30
|
+
case 'nft':
|
|
31
|
+
return t(`button.reviewPurchase`);
|
|
32
|
+
case 'refuel':
|
|
33
|
+
return t(`button.reviewBridge`);
|
|
34
|
+
default:
|
|
35
|
+
const transactionType = currentRoute.fromChainId === currentRoute.toChainId
|
|
36
|
+
? 'Swap'
|
|
37
|
+
: 'Bridge';
|
|
38
|
+
return t(`button.review${transactionType}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
switch (subvariant) {
|
|
43
|
+
case 'nft':
|
|
44
|
+
return t(`button.buy`);
|
|
45
|
+
case 'refuel':
|
|
46
|
+
return t(`button.getGas`);
|
|
47
|
+
case 'split':
|
|
48
|
+
if (splitState) {
|
|
49
|
+
return t(`button.${splitState}`);
|
|
50
|
+
}
|
|
51
|
+
return t(`button.exchange`);
|
|
52
|
+
default:
|
|
53
|
+
return t(`button.exchange`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return (_jsx(DefaultTransactionButton, { text: getButtonText(), onClick: handleClick, disabled: currentRoute && (isValidating || !isValid) }));
|
|
58
|
+
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { useHeaderStore } from '../../components/Header';
|
|
4
4
|
import { ProgressToNextUpdate } from '../../components/ProgressToNextUpdate';
|
|
5
|
-
import {
|
|
6
|
-
import { useNavigateBack,
|
|
5
|
+
import { RouteCard, RouteCardSkeleton, RouteNotFoundCard, } from '../../components/RouteCard';
|
|
6
|
+
import { useNavigateBack, useRoutes } from '../../hooks';
|
|
7
7
|
import { useSetExecutableRoute } from '../../stores';
|
|
8
8
|
import { navigationRoutes } from '../../utils';
|
|
9
|
-
import { Stack } from './
|
|
10
|
-
export const
|
|
9
|
+
import { Stack } from './RoutesPage.style';
|
|
10
|
+
export const RoutesPage = () => {
|
|
11
11
|
const { navigateBack, navigate } = useNavigateBack();
|
|
12
|
-
const { routes
|
|
12
|
+
const { routes, isLoading, isFetching, dataUpdatedAt, refetchTime, refetch } = useRoutes();
|
|
13
13
|
const setExecutableRoute = useSetExecutableRoute();
|
|
14
14
|
const handleRouteClick = (route) => {
|
|
15
15
|
setExecutableRoute(route);
|
|
16
|
-
navigate(navigationRoutes.
|
|
16
|
+
navigate(navigationRoutes.transactionExecution, {
|
|
17
17
|
state: { routeId: route.id },
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
useEffect(() => {
|
|
21
|
-
if (!
|
|
21
|
+
if (!routes?.length && !isLoading && !isFetching) {
|
|
22
22
|
navigateBack();
|
|
23
23
|
}
|
|
24
24
|
// redirect to the home page if no routes are found on page reload
|
|
25
25
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
26
|
}, []);
|
|
27
27
|
useEffect(() => {
|
|
28
|
-
return
|
|
28
|
+
return useHeaderStore
|
|
29
29
|
.getState()
|
|
30
30
|
.setAction(_jsx(ProgressToNextUpdate, { updatedAt: dataUpdatedAt || new Date().getTime(), timeToUpdate: refetchTime, isLoading: isFetching, onClick: () => refetch(), sx: { marginRight: -1 }, size: "medium", edge: "end" }));
|
|
31
31
|
}, [dataUpdatedAt, isFetching, refetch, refetchTime]);
|
|
32
|
-
const routeNotFound = !
|
|
33
|
-
return (_jsx(Stack, { direction: "column", spacing: 2, flex: 1, children: routeNotFound ? (_jsx(
|
|
32
|
+
const routeNotFound = !routes?.length && !isLoading && !isFetching;
|
|
33
|
+
return (_jsx(Stack, { direction: "column", spacing: 2, flex: 1, children: routeNotFound ? (_jsx(RouteNotFoundCard, {})) : isLoading ? (Array.from({ length: 3 }).map((_, index) => (_jsx(RouteCardSkeleton, {}, index)))) : (routes?.map((route, index) => (_jsx(RouteCard, { route: route, onClick: () => handleRouteClick(route), active: index === 0, expanded: routes?.length <= 2 }, route.id)))) }));
|
|
34
34
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RoutesPage';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RoutesPage';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export interface SelectChainPageProps extends
|
|
1
|
+
import type { FormTypeProps } from '../../providers';
|
|
2
|
+
export interface SelectChainPageProps extends FormTypeProps {
|
|
3
3
|
selectNativeToken?: boolean;
|
|
4
4
|
}
|
|
@@ -4,7 +4,7 @@ import CheckBoxOutlineBlankOutlinedIcon from '@mui/icons-material/CheckBoxOutlin
|
|
|
4
4
|
import CheckBoxOutlinedIcon from '@mui/icons-material/CheckBoxOutlined';
|
|
5
5
|
import IndeterminateCheckBoxOutlinedIcon from '@mui/icons-material/IndeterminateCheckBoxOutlined';
|
|
6
6
|
import { Avatar, Container, IconButton, List, ListItemAvatar, } from '@mui/material';
|
|
7
|
-
import {
|
|
7
|
+
import { useHeaderStore } from '../../components/Header';
|
|
8
8
|
import { useEffect } from 'react';
|
|
9
9
|
import { shallow } from 'zustand/shallow';
|
|
10
10
|
import { ListItemText } from '../../components/ListItemText';
|
|
@@ -41,7 +41,7 @@ export const SelectEnabledToolsPage = ({ type }) => {
|
|
|
41
41
|
setTools(type, toolKeys, toolKeys);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
return
|
|
44
|
+
return useHeaderStore.getState().setAction(_jsx(IconButton, { size: "medium", edge: "end", onClick: toggleCheckboxes, children: allToolsSelected ? (_jsx(CheckBoxOutlinedIcon, {})) : enabledTools.length ? (_jsx(IndeterminateCheckBoxOutlinedIcon, {})) : (_jsx(CheckBoxOutlineBlankOutlinedIcon, {})) }));
|
|
45
45
|
}, [enabledTools.length, setTools, tools, type, typeKey]);
|
|
46
46
|
return (_jsx(Container, { disableGutters: true, children: _jsx(List, { sx: {
|
|
47
47
|
paddingLeft: 1.5,
|
|
@@ -17,4 +17,4 @@ export declare const ListItemButton: import("@emotion/styled").StyledComponent<i
|
|
|
17
17
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
18
18
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
19
19
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
20
|
-
}, "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "
|
|
20
|
+
}, "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "divider" | "dense" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
3
|
-
export declare const SelectNativeTokenPage: React.FC<
|
|
2
|
+
import type { FormTypeProps } from '../../providers';
|
|
3
|
+
export declare const SelectNativeTokenPage: React.FC<FormTypeProps>;
|
|
@@ -14,5 +14,5 @@ export const SelectNativeTokenPage = ({ formType, }) => {
|
|
|
14
14
|
return (_jsx(Container, { disableGutters: true, children: _jsx(List, { sx: {
|
|
15
15
|
paddingLeft: 1.5,
|
|
16
16
|
paddingRight: 1.5,
|
|
17
|
-
}, children: chains?.map((chain) => (_jsxs(ListItemButton, { onClick: () => selectToken(chain.nativeToken.address, chain.id), children: [_jsx(ListItemAvatar, { children: _jsx(TokenAvatar, { token: chain.nativeToken, chain: chain }) }), _jsx(ListItemText, { primary: chain.nativeToken.symbol, secondary: t('
|
|
17
|
+
}, children: chains?.map((chain) => (_jsxs(ListItemButton, { onClick: () => selectToken(chain.nativeToken.address, chain.id), children: [_jsx(ListItemAvatar, { children: _jsx(TokenAvatar, { token: chain.nativeToken, chain: chain }) }), _jsx(ListItemText, { primary: chain.nativeToken.symbol, secondary: t('main.onChain', { chainName: chain.name }) })] }, chain.id))) }) }));
|
|
18
18
|
};
|
|
@@ -5,16 +5,16 @@ import { useEffect } from 'react';
|
|
|
5
5
|
import { useFormContext } from 'react-hook-form';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { Card } from '../../components/Card';
|
|
8
|
-
import {
|
|
8
|
+
import { FormKey } from '../../providers';
|
|
9
9
|
import { Input } from './SearchTokenInput.style';
|
|
10
10
|
export const SearchTokenInput = () => {
|
|
11
11
|
const { t } = useTranslation();
|
|
12
12
|
const { register, setValue } = useFormContext();
|
|
13
13
|
useEffect(() => () => {
|
|
14
|
-
setValue(
|
|
14
|
+
setValue(FormKey.TokenSearchFilter, '');
|
|
15
15
|
}, [setValue]);
|
|
16
|
-
return (_jsx(Card, { children: _jsx(FormControl, { fullWidth: true, children: _jsx(Input, { size: "small", placeholder: t(`
|
|
16
|
+
return (_jsx(Card, { children: _jsx(FormControl, { fullWidth: true, children: _jsx(Input, { size: "small", placeholder: t(`main.tokenSearch`), defaultValue: "", endAdornment: _jsx(InputAdornment, { position: "end", children: _jsx(SearchIcon, {}) }), inputProps: {
|
|
17
17
|
inputMode: 'search',
|
|
18
|
-
...register(
|
|
18
|
+
...register(FormKey.TokenSearchFilter),
|
|
19
19
|
}, autoComplete: "off" }) }) }));
|
|
20
20
|
};
|