From ca693143892a25d5468f315c665d49cce972e422 Mon Sep 17 00:00:00 2001 From: Eugene Chybisov Date: Thu, 8 Jun 2023 15:06:00 +0200 Subject: [PATCH 01/13] fix: adjust swap/bridge terminology across the widget --- .github/workflows/deploy.yml | 1 + packages/widget/src/AppDrawer.tsx | 2 +- packages/widget/src/AppRoutes.tsx | 12 +- .../components/ActiveSwaps/ActiveSwapItem.tsx | 2 +- .../components/ActiveSwaps/ActiveSwaps.tsx | 4 +- .../GasMessage/FundsSufficiencyMessage.tsx | 2 +- .../GasMessage/GasRefuelMessage.tsx | 4 +- .../GasMessage/GasSufficiencyMessage.tsx | 6 +- .../components/Header/NavigationHeader.tsx | 34 +-- .../widget/src/components/Header/index.ts | 2 +- .../widget/src/components/Header/types.ts | 7 +- .../components/Header/useHeaderActionStore.ts | 16 -- .../src/components/Header/useHeaderStore.ts | 27 +++ .../components/Insurance/InsuranceCard.tsx | 12 +- packages/widget/src/components/NFT/NFT.tsx | 2 +- .../SelectTokenButton/SelectTokenButton.tsx | 10 +- .../components/SendToWallet/SendToWallet.tsx | 11 +- .../SendToWallet/SendToWalletButton.tsx | 2 +- .../Step/DestinationWalletAddress.tsx | 4 +- .../src/components/Step/GasStepProcess.tsx | 2 +- packages/widget/src/components/Step/Step.tsx | 16 +- .../widget/src/components/Step/StepTimer.tsx | 4 +- .../components/StepActions/StepActions.tsx | 10 +- .../src/components/SwapButton/SwapButton.tsx | 12 +- .../widget/src/components/SwapButton/types.ts | 4 +- .../src/components/SwapInput/SwapInput.tsx | 2 +- .../SwapRouteCard/SwapRouteCard.tsx | 10 +- .../SwapRouteCard/SwapRouteCardEssentials.tsx | 2 +- .../SwapRouteCard/SwapRouteNotFoundCard.tsx | 4 +- .../src/components/SwapRoutes/SwapRoutes.tsx | 4 +- .../SwapRoutes/SwapRoutesExpanded.tsx | 4 +- .../widget/src/components/Token/Token.tsx | 2 +- .../components/TokenList/TokenNotFound.tsx | 2 +- .../TokenList/VirtualizedTokenList.tsx | 4 +- .../widget/src/hooks/useProcessMessage.ts | 80 +++---- packages/widget/src/i18n/en.json | 207 +++++++++--------- .../ActiveSwapsPage/ActiveSwapsEmpty.tsx | 4 +- .../pages/ActiveSwapsPage/ActiveSwapsPage.tsx | 8 +- .../src/pages/MainPage/MainSwapButton.tsx | 4 +- .../SelectEnabledToolsPage.tsx | 4 +- .../SelectNativeTokenPage.tsx | 2 +- .../SelectTokenPage/SearchTokenInput.tsx | 2 +- .../SettingsPage/ResetSettingsButton.tsx | 6 +- .../SettingsPage/RoutePrioritySelect.tsx | 2 +- .../pages/SwapDetailsPage/SwapDetailsPage.tsx | 10 +- .../SwapHistoryPage/SwapHistoryEmpty.tsx | 4 +- .../pages/SwapHistoryPage/SwapHistoryItem.tsx | 2 +- .../pages/SwapHistoryPage/SwapHistoryPage.tsx | 8 +- .../SwapPage/ExchangeRateBottomSheet.tsx | 10 +- .../src/pages/SwapPage/StartSwapButton.tsx | 2 +- .../src/pages/SwapPage/StatusBottomSheet.tsx | 23 +- .../widget/src/pages/SwapPage/SwapPage.tsx | 65 +++--- .../pages/SwapPage/TokenValueBottomSheet.tsx | 12 +- .../pages/SwapRoutesPage/SwapRoutesPage.tsx | 6 +- packages/widget/src/utils/navigationRoutes.ts | 30 +-- 55 files changed, 385 insertions(+), 348 deletions(-) delete mode 100644 packages/widget/src/components/Header/useHeaderActionStore.ts create mode 100644 packages/widget/src/components/Header/useHeaderStore.ts diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 489eac093..8519173fc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - adjust-terminology jobs: build: diff --git a/packages/widget/src/AppDrawer.tsx b/packages/widget/src/AppDrawer.tsx index 4322bb9e5..d4ff92cbc 100644 --- a/packages/widget/src/AppDrawer.tsx +++ b/packages/widget/src/AppDrawer.tsx @@ -112,7 +112,7 @@ export const DrawerButtonText = ({ open }: { open: boolean }) => { return ( - {open ? t('button.hide') : t('button.lifiSwap')} + {open ? t('button.hide') : t('button.lifiExchange')} ); }; diff --git a/packages/widget/src/AppRoutes.tsx b/packages/widget/src/AppRoutes.tsx index 91ab6a80d..d693136cb 100644 --- a/packages/widget/src/AppRoutes.tsx +++ b/packages/widget/src/AppRoutes.tsx @@ -52,27 +52,27 @@ export const AppRoutes = () => { element: , }, { - path: navigationRoutes.swapRoutes, + path: navigationRoutes.routes, element: , }, { - path: navigationRoutes.activeSwaps, + path: navigationRoutes.activeTransactions, element: , }, { - path: navigationRoutes.swapHistory, + path: navigationRoutes.transactionHistory, element: , }, { - path: `${navigationRoutes.swapHistory}?/${navigationRoutes.swapRoutes}?/${navigationRoutes.swapExecution}?/${navigationRoutes.swapDetails}`, + path: `${navigationRoutes.transactionHistory}?/${navigationRoutes.routes}?/${navigationRoutes.transactionExecution}?/${navigationRoutes.transactionDetails}`, element: , }, { - path: `${navigationRoutes.swapRoutes}?/${navigationRoutes.swapExecution}?/${navigationRoutes.selectWallet}`, + path: `${navigationRoutes.routes}?/${navigationRoutes.transactionExecution}?/${navigationRoutes.selectWallet}`, element: , }, { - path: `${navigationRoutes.swapRoutes}?/${navigationRoutes.activeSwaps}?/${navigationRoutes.swapExecution}`, + path: `${navigationRoutes.routes}?/${navigationRoutes.activeTransactions}?/${navigationRoutes.transactionExecution}`, element: , }, { diff --git a/packages/widget/src/components/ActiveSwaps/ActiveSwapItem.tsx b/packages/widget/src/components/ActiveSwaps/ActiveSwapItem.tsx index fa9411cb7..0b3fc4765 100644 --- a/packages/widget/src/components/ActiveSwaps/ActiveSwapItem.tsx +++ b/packages/widget/src/components/ActiveSwaps/ActiveSwapItem.tsx @@ -34,7 +34,7 @@ export const ActiveSwapItem: React.FC<{ } const handleClick = () => { - navigate(navigationRoutes.swapExecution, { state: { routeId } }); + navigate(navigationRoutes.transactionExecution, { state: { routeId } }); }; const getStatusComponent = () => { diff --git a/packages/widget/src/components/ActiveSwaps/ActiveSwaps.tsx b/packages/widget/src/components/ActiveSwaps/ActiveSwaps.tsx index f9b10987e..72a77f725 100644 --- a/packages/widget/src/components/ActiveSwaps/ActiveSwaps.tsx +++ b/packages/widget/src/components/ActiveSwaps/ActiveSwaps.tsx @@ -20,14 +20,14 @@ export const ActiveSwaps: React.FC = (props) => { } const handleShowAll = () => { - navigate(navigationRoutes.activeSwaps); + navigate(navigationRoutes.activeTransactions); }; const hasShowAll = executingRoutes?.length > 2; return ( - {t('header.activeSwaps')} + {t('header.activeTransactions')} {executingRoutes.slice(0, 2).map((routeId) => ( diff --git a/packages/widget/src/components/GasMessage/FundsSufficiencyMessage.tsx b/packages/widget/src/components/GasMessage/FundsSufficiencyMessage.tsx index 137b46fc2..1eb3f0c58 100644 --- a/packages/widget/src/components/GasMessage/FundsSufficiencyMessage.tsx +++ b/packages/widget/src/components/GasMessage/FundsSufficiencyMessage.tsx @@ -19,7 +19,7 @@ export const FundsSufficiencyMessage = () => { /> - {t(`swap.warning.message.insufficientFunds`)} + {t(`warning.message.insufficientFunds`)} ); diff --git a/packages/widget/src/components/GasMessage/GasRefuelMessage.tsx b/packages/widget/src/components/GasMessage/GasRefuelMessage.tsx index 147149c11..d5c94d801 100644 --- a/packages/widget/src/components/GasMessage/GasRefuelMessage.tsx +++ b/packages/widget/src/components/GasMessage/GasRefuelMessage.tsx @@ -44,7 +44,7 @@ export const GasRefuelMessage: React.FC = (props) => { }} /> - {t(`swap.info.title.autoRefuel`)} + {t(`info.title.autoRefuel`)} @@ -56,7 +56,7 @@ export const GasRefuelMessage: React.FC = (props) => { mountOnEnter > - {t(`swap.info.message.autoRefuel`, { + {t(`info.message.autoRefuel`, { chainName: chain?.name, })} diff --git a/packages/widget/src/components/GasMessage/GasSufficiencyMessage.tsx b/packages/widget/src/components/GasMessage/GasSufficiencyMessage.tsx index 6eb029e91..35f8b40ce 100644 --- a/packages/widget/src/components/GasMessage/GasSufficiencyMessage.tsx +++ b/packages/widget/src/components/GasMessage/GasSufficiencyMessage.tsx @@ -24,11 +24,11 @@ export const GasSufficiencyMessage: React.FC = ({ }} /> - {t(`swap.warning.title.insufficientGas`)} + {t(`warning.title.insufficientGas`)} - {t(`swap.warning.message.insufficientGas`)} + {t(`warning.message.insufficientGas`)} {insufficientGas?.map((item, index) => ( = ({ pb={insufficientGas?.length - 1 === index ? 2 : 0} pt={0.5} > - {t(`swap.tokenOnChainAmount`, { + {t(`main.tokenOnChainAmount`, { amount: item.insufficientAmount?.toString(), tokenSymbol: item.token.symbol, chainName: item.chain?.name, diff --git a/packages/widget/src/components/Header/NavigationHeader.tsx b/packages/widget/src/components/Header/NavigationHeader.tsx index 284393a1b..007170e8f 100644 --- a/packages/widget/src/components/Header/NavigationHeader.tsx +++ b/packages/widget/src/components/Header/NavigationHeader.tsx @@ -15,14 +15,14 @@ import { import { HeaderAppBar } from './Header.style'; import { NavigationTabs } from './NavigationTabs'; import { WalletMenuButton } from './WalletHeader'; -import { useHeaderActionStore } from './useHeaderActionStore'; +import { useHeaderStore } from './useHeaderStore'; export const NavigationHeader: React.FC = () => { const { t } = useTranslation(); const { variant, subvariant, hiddenUI } = useWidgetConfig(); const { navigate, navigateBack } = useNavigateBack(); const { account } = useWallet(); - const { element } = useHeaderActionStore(); + const { element, title } = useHeaderStore(); const { pathname } = useLocation(); const cleanedPathname = pathname.endsWith('/') @@ -43,8 +43,8 @@ export const NavigationHeader: React.FC = () => { return t(`settings.enabledBridges`); case navigationRoutes.exchanges: return t(`settings.enabledExchanges`); - case navigationRoutes.swapHistory: - return t(`header.swapHistory`); + case navigationRoutes.transactionHistory: + return t(`header.transactionHistory`); case navigationRoutes.fromToken: { if (variant === 'nft') { return t(`header.payWith`); @@ -57,21 +57,21 @@ export const NavigationHeader: React.FC = () => { case navigationRoutes.toChain: case navigationRoutes.toTokenNative: return t(`header.selectChain`); - case navigationRoutes.swapRoutes: - return t(`header.routes`); - case navigationRoutes.activeSwaps: - return t(`header.activeSwaps`); - case navigationRoutes.swapExecution: { + case navigationRoutes.routes: + return t(`header.youGet`); + case navigationRoutes.activeTransactions: + return t(`header.activeTransactions`); + case navigationRoutes.transactionExecution: { if (variant === 'nft') { return t(`header.purchase`); } - return t(`header.swap`); + return t(`header.exchange`); } - case navigationRoutes.swapDetails: { + case navigationRoutes.transactionDetails: { if (variant === 'nft') { return t(`header.purchaseDetails`); } - return t(`header.swapDetails`); + return t(`header.transactionDetails`); } default: { switch (variant) { @@ -80,7 +80,7 @@ export const NavigationHeader: React.FC = () => { case 'refuel': return t(`header.gas`); default: - return t(`header.swap`); + return t(`header.exchange`); } } } @@ -108,7 +108,7 @@ export const NavigationHeader: React.FC = () => { flex={1} noWrap > - {handleHeaderTitle()} + {title || handleHeaderTitle()} )} @@ -118,14 +118,16 @@ export const NavigationHeader: React.FC = () => { <> {account.isActive && !hiddenUI?.includes(HiddenUI.History) ? ( navigate(navigationRoutes.swapHistory)} + onClick={() => + navigate(navigationRoutes.transactionHistory) + } > diff --git a/packages/widget/src/components/Header/index.ts b/packages/widget/src/components/Header/index.ts index e5db6f08b..b1f3f9a33 100644 --- a/packages/widget/src/components/Header/index.ts +++ b/packages/widget/src/components/Header/index.ts @@ -1,2 +1,2 @@ export * from './Header'; -export * from './useHeaderActionStore'; +export * from './useHeaderStore'; diff --git a/packages/widget/src/components/Header/types.ts b/packages/widget/src/components/Header/types.ts index 77ab85fae..c23caee86 100644 --- a/packages/widget/src/components/Header/types.ts +++ b/packages/widget/src/components/Header/types.ts @@ -1,8 +1,11 @@ -export interface HeaderActionState { +export interface HeaderState { element?: React.ReactNode | null; + title?: string; } -export interface HeaderActionStore extends HeaderActionState { +export interface HeaderStore extends HeaderState { setAction(element?: React.ReactNode | null): () => void; + setTitle(title?: string): () => void; removeAction(): void; + removeTitle(): void; } diff --git a/packages/widget/src/components/Header/useHeaderActionStore.ts b/packages/widget/src/components/Header/useHeaderActionStore.ts deleted file mode 100644 index 78ec7d22d..000000000 --- a/packages/widget/src/components/Header/useHeaderActionStore.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { create } from 'zustand'; -import type { HeaderActionStore } from './types'; - -export const useHeaderActionStore = create((set, get) => ({ - setAction: (element) => { - set(() => ({ - element, - })); - return get().removeAction; - }, - removeAction: () => { - set(() => ({ - element: null, - })); - }, -})); diff --git a/packages/widget/src/components/Header/useHeaderStore.ts b/packages/widget/src/components/Header/useHeaderStore.ts new file mode 100644 index 000000000..cf719aa32 --- /dev/null +++ b/packages/widget/src/components/Header/useHeaderStore.ts @@ -0,0 +1,27 @@ +import { create } from 'zustand'; +import type { HeaderStore } from './types'; + +export const useHeaderStore = create((set, get) => ({ + setAction: (element) => { + set(() => ({ + element, + })); + return get().removeAction; + }, + setTitle: (title) => { + set(() => ({ + title, + })); + return get().removeTitle; + }, + removeAction: () => { + set(() => ({ + element: null, + })); + }, + removeTitle: () => { + set(() => ({ + title: undefined, + })); + }, +})); diff --git a/packages/widget/src/components/Insurance/InsuranceCard.tsx b/packages/widget/src/components/Insurance/InsuranceCard.tsx index f7ecc36fe..740a570cd 100644 --- a/packages/widget/src/components/Insurance/InsuranceCard.tsx +++ b/packages/widget/src/components/Insurance/InsuranceCard.tsx @@ -43,8 +43,8 @@ export const InsuranceCard: React.FC = ({ {status === RouteExecutionStatus.Idle - ? t('swap.tags.insurance') - : t('swap.tags.insured')} + ? t('main.tags.insurance') + : t('main.tags.insured')} {status === RouteExecutionStatus.Idle ? ( @@ -76,11 +76,11 @@ export const InsuranceCard: React.FC = ({ {status === RouteExecutionStatus.Idle - ? t('swap.insurance.insure', { + ? t('insurance.insure', { amount: insuredAmount, tokenSymbol: insuredTokenSymbol, }) - : t('swap.insurance.insured', { + : t('insurance.insured', { amount: insuredAmount, tokenSymbol: insuredTokenSymbol, })} @@ -99,10 +99,10 @@ export const InsuranceCard: React.FC = ({ }} > - {t('swap.insurance.bridgeExploits')} + {t('insurance.bridgeExploits')} - {t('swap.insurance.slippageError')} + {t('insurance.slippageError')} diff --git a/packages/widget/src/components/NFT/NFT.tsx b/packages/widget/src/components/NFT/NFT.tsx index 11214f262..d5f782947 100644 --- a/packages/widget/src/components/NFT/NFT.tsx +++ b/packages/widget/src/components/NFT/NFT.tsx @@ -64,7 +64,7 @@ export const NFT: React.FC = ({ ) : owner ? ( - {t('swap.ownedBy')}{' '} + {t('main.ownedBy')}{' '} {cardTitle} @@ -69,7 +69,7 @@ export const SelectTokenButton: React.FC< } title={isSelected ? token.symbol : defaultPlaceholder} subheader={ - isSelected ? t(`swap.onChain`, { chainName: chain.name }) : null + isSelected ? t(`main.onChain`, { chainName: chain.name }) : null } selected={isSelected} compact={compact} diff --git a/packages/widget/src/components/SendToWallet/SendToWallet.tsx b/packages/widget/src/components/SendToWallet/SendToWallet.tsx index d2dd9c056..02bd9f5a0 100644 --- a/packages/widget/src/components/SendToWallet/SendToWallet.tsx +++ b/packages/widget/src/components/SendToWallet/SendToWallet.tsx @@ -30,8 +30,7 @@ export const SendToWallet: React.FC = forwardRef((props, ref) => { name: SwapFormKey.ToAddress, rules: { required: - requiredToAddress && - (t('swap.error.title.walletAddressRequired') as string), + requiredToAddress && (t('error.title.walletAddressRequired') as string), validate: async (value: string) => { try { if (!value) { @@ -40,10 +39,10 @@ export const SendToWallet: React.FC = forwardRef((props, ref) => { const address = await account.signer?.provider?.resolveName(value); return ( isAddress(address || value) || - (t('swap.error.title.walletAddressInvalid') as string) + (t('error.title.walletAddressInvalid') as string) ); } catch { - return t('swap.error.title.walletEnsAddressInvalid') as string; + return t('error.title.walletEnsAddressInvalid') as string; } }, onBlur: () => trigger(SwapFormKey.ToAddress), @@ -91,7 +90,7 @@ export const SendToWallet: React.FC = forwardRef((props, ref) => { > - {t('swap.sendToWallet')} + {t('main.sendToWallet')} = forwardRef((props, ref) => { onBlur={onBlur} name={name} value={value} - placeholder={t('swap.walletAddressOrEns') as string} + placeholder={t('main.walletAddressOrEns') as string} disabled={Boolean(toAddress && disabledToAddress)} /> diff --git a/packages/widget/src/components/SendToWallet/SendToWalletButton.tsx b/packages/widget/src/components/SendToWallet/SendToWalletButton.tsx index 3831a6ac8..8cc538dda 100644 --- a/packages/widget/src/components/SendToWallet/SendToWalletButton.tsx +++ b/packages/widget/src/components/SendToWallet/SendToWalletButton.tsx @@ -32,7 +32,7 @@ export const SendToWalletButton: React.FC = () => { return ( {isDone - ? t('swap.sentToAddress', { + ? t('main.sentToAddress', { address: toAddress, }) - : t('swap.sendToAddress', { + : t('main.sendToAddress', { address: toAddress, })} diff --git a/packages/widget/src/components/Step/GasStepProcess.tsx b/packages/widget/src/components/Step/GasStepProcess.tsx index 664b05c2b..43a7c1b61 100644 --- a/packages/widget/src/components/Step/GasStepProcess.tsx +++ b/packages/widget/src/components/Step/GasStepProcess.tsx @@ -37,7 +37,7 @@ export const GasStepProcess: React.FC<{ )) ?? 0, })}{' '} - {isDone ? t('swap.gasFeePaid') : t('swap.gasFeeEstimated')} + {isDone ? t('main.gasFeePaid') : t('main.gasFeeEstimated')} diff --git a/packages/widget/src/components/Step/Step.tsx b/packages/widget/src/components/Step/Step.tsx index cd125dd3c..0eebe95ac 100644 --- a/packages/widget/src/components/Step/Step.tsx +++ b/packages/widget/src/components/Step/Step.tsx @@ -38,21 +38,21 @@ export const Step: React.FC<{ ); if (hasCrossStep && hasSwapStep) { return variant === 'nft' - ? t('swap.stepBridgeAndBuy') - : t('swap.stepSwapAndBridge'); + ? t('main.stepBridgeAndBuy') + : t('main.stepSwapAndBridge'); } if (hasCrossStep) { return variant === 'nft' - ? t('swap.stepBridgeAndBuy') - : t('swap.stepBridge'); + ? t('main.stepBridgeAndBuy') + : t('main.stepBridge'); } return variant === 'nft' - ? t('swap.stepSwapAndBuy') - : t('swap.stepSwap'); + ? t('main.stepSwapAndBuy') + : t('main.stepSwap'); default: return variant === 'nft' - ? t('swap.stepSwapAndBuy') - : t('swap.stepSwap'); + ? t('main.stepSwapAndBuy') + : t('main.stepSwap'); } }; diff --git a/packages/widget/src/components/Step/StepTimer.tsx b/packages/widget/src/components/Step/StepTimer.tsx index b0d45952b..622888ea9 100644 --- a/packages/widget/src/components/Step/StepTimer.tsx +++ b/packages/widget/src/components/Step/StepTimer.tsx @@ -54,7 +54,7 @@ export const StepTimer: React.FC<{ if (!isExecutionStarted) { return ( <> - {t('swap.estimatedTime', { + {t('main.estimatedTime', { value: Math.ceil(step.estimate.executionDuration / 60), })} @@ -72,7 +72,7 @@ export const StepTimer: React.FC<{ } return isTimerExpired ? ( - <>{t('swap.inProgress')} + <>{t('main.inProgress')} ) : ( // eslint-disable-next-line react/jsx-no-useless-fragment <>{`${minutes}:${seconds < 10 ? `0${seconds}` : seconds}`} diff --git a/packages/widget/src/components/StepActions/StepActions.tsx b/packages/widget/src/components/StepActions/StepActions.tsx index e03f7406f..af04e6544 100644 --- a/packages/widget/src/components/StepActions/StepActions.tsx +++ b/packages/widget/src/components/StepActions/StepActions.tsx @@ -67,7 +67,7 @@ export const StepActions: React.FC = ({ - {t(`swap.stepDetails`, { + {t(`main.stepDetails`, { tool: step.toolDetails.name, })} @@ -221,7 +221,7 @@ export const CustomStepDetailsLabel: React.FC = ({ return ( - {t(`swap.${variant}StepDetails`, { + {t(`main.${variant}StepDetails`, { tool: step.toolDetails.name, })} @@ -235,7 +235,7 @@ export const CrossStepDetailsLabel: React.FC< const { getChainById } = useChains(); return ( - {t('swap.crossStepDetails', { + {t('main.crossStepDetails', { from: getChainById(step.action.fromChainId)?.name, to: getChainById(step.action.toChainId)?.name, tool: step.toolDetails.name, @@ -251,7 +251,7 @@ export const SwapStepDetailsLabel: React.FC< const { getChainById } = useChains(); return ( - {t('swap.swapStepDetails', { + {t('main.swapStepDetails', { chain: getChainById(step.action.fromChainId)?.name, tool: step.toolDetails.name, })} @@ -266,7 +266,7 @@ export const ProtocolStepDetailsLabel: React.FC< return ( {step.toolDetails.key === 'lifuelProtocol' - ? t('swap.refuelStepDetails', { + ? t('main.refuelStepDetails', { tool: step.toolDetails.name, }) : step.toolDetails.name} diff --git a/packages/widget/src/components/SwapButton/SwapButton.tsx b/packages/widget/src/components/SwapButton/SwapButton.tsx index 66a5b9d45..885e3c05d 100644 --- a/packages/widget/src/components/SwapButton/SwapButton.tsx +++ b/packages/widget/src/components/SwapButton/SwapButton.tsx @@ -7,7 +7,7 @@ import type { SwapButtonProps } from './types'; export const SwapButton: React.FC = ({ onClick, - hasRoute, + route, text, disabled, loading, @@ -31,14 +31,14 @@ export const SwapButton: React.FC = ({ const getButtonText = () => { if (account.isActive) { - if (!hasRoute) { + if (!route) { switch (variant) { case 'nft': return t(`button.buy`); case 'refuel': return t(`button.getGas`); default: - return t(`button.swap`); + return t(`button.exchange`); } } if (text) { @@ -48,9 +48,11 @@ export const SwapButton: React.FC = ({ case 'nft': return t(`button.reviewPurchase`); case 'refuel': - return t(`button.reviewGasSwap`); + return t(`button.reviewBridge`); default: - return t(`button.reviewSwap`); + const transactionType = + route.fromChainId === route.toChainId ? 'Swap' : 'Bridge'; + return t(`button.review${transactionType}`); } } return t(`button.connectWallet`); diff --git a/packages/widget/src/components/SwapButton/types.ts b/packages/widget/src/components/SwapButton/types.ts index 1aa35c1fd..d3703f56f 100644 --- a/packages/widget/src/components/SwapButton/types.ts +++ b/packages/widget/src/components/SwapButton/types.ts @@ -1,6 +1,8 @@ +import type { Route } from '@lifi/sdk'; + export interface SwapButtonProps { onClick?(): void; - hasRoute?: boolean; + route?: Route; text?: string; disabled?: boolean; loading?: boolean; diff --git a/packages/widget/src/components/SwapInput/SwapInput.tsx b/packages/widget/src/components/SwapInput/SwapInput.tsx index 7d33608b6..34c5d5c69 100644 --- a/packages/widget/src/components/SwapInput/SwapInput.tsx +++ b/packages/widget/src/components/SwapInput/SwapInput.tsx @@ -100,7 +100,7 @@ export const SwapInputBase: React.FC< return ( - {t('swap.fromAmount')} + {t('main.fromAmount')} {cardExpanded || !route.tags?.length ? ( - {t(`swap.tags.insurable`)} + {t(`main.tags.insurable`)} ) : null} @@ -70,7 +70,7 @@ export const SwapRouteCard: React.FC< - {t(`swap.tags.${route.tags[0].toLowerCase()}` as any)} + {t(`main.tags.${route.tags[0].toLowerCase()}` as any)} @@ -120,7 +120,7 @@ const InsuranceTooltip: React.FC< title={ - {t('swap.insurance.insure', { + {t('insurance.insure', { amount: insuredAmount, tokenSymbol: insuredTokenSymbol, })} @@ -132,10 +132,10 @@ const InsuranceTooltip: React.FC< }} > - {t('swap.insurance.bridgeExploits')} + {t('insurance.bridgeExploits')} - {t('swap.insurance.slippageError')} + {t('insurance.slippageError')} diff --git a/packages/widget/src/components/SwapRouteCard/SwapRouteCardEssentials.tsx b/packages/widget/src/components/SwapRouteCard/SwapRouteCardEssentials.tsx index 1f3e7d720..694cbf0f1 100644 --- a/packages/widget/src/components/SwapRouteCard/SwapRouteCardEssentials.tsx +++ b/packages/widget/src/components/SwapRouteCard/SwapRouteCardEssentials.tsx @@ -111,7 +111,7 @@ export const SwapRouteCardEssentials: React.FC< fontWeight="500" lineHeight={1} > - {t('swap.estimatedTime', { + {t('main.estimatedTime', { value: executionTimeMinutes, })} diff --git a/packages/widget/src/components/SwapRouteCard/SwapRouteNotFoundCard.tsx b/packages/widget/src/components/SwapRouteCard/SwapRouteNotFoundCard.tsx index 44cde9ab4..5c715ccdc 100644 --- a/packages/widget/src/components/SwapRouteCard/SwapRouteNotFoundCard.tsx +++ b/packages/widget/src/components/SwapRouteCard/SwapRouteNotFoundCard.tsx @@ -19,7 +19,7 @@ export const SwapRouteNotFoundCard: React.FC = () => { - {t('swap.info.title.routeNotFound')} + {t('info.title.routeNotFound')} { textAlign="center" mt={2} > - {t('swap.info.message.routeNotFound')} + {t('info.message.routeNotFound')} ); diff --git a/packages/widget/src/components/SwapRoutes/SwapRoutes.tsx b/packages/widget/src/components/SwapRoutes/SwapRoutes.tsx index caa02086c..de9a1adfd 100644 --- a/packages/widget/src/components/SwapRoutes/SwapRoutes.tsx +++ b/packages/widget/src/components/SwapRoutes/SwapRoutes.tsx @@ -36,7 +36,7 @@ export const SwapRoutes: React.FC = (props) => { } const handleCardClick = () => { - navigate(navigationRoutes.swapRoutes); + navigate(navigationRoutes.routes); }; const routeNotFound = !currentRoute && !isLoading && !isFetching; @@ -47,7 +47,7 @@ export const SwapRoutes: React.FC = (props) => { return ( - {variant === 'nft' ? t('swap.fromAmount') : t('header.routes')} + {variant === 'nft' ? t('main.fromAmount') : t('header.youGet')} { const handleRouteClick = (route: Route) => { if (isValid && !isValidating) { setExecutableRoute(route); - navigate(navigationRoutes.swapExecution, { + navigate(navigationRoutes.transactionExecution, { state: { routeId: route.id }, }); } @@ -78,7 +78,7 @@ export const SwapRoutesExpandedElement = () => {
- {variant === 'nft' ? t('swap.fromAmount') : t('header.routes')} + {variant === 'nft' ? t('main.fromAmount') : t('header.youGet')} = ({ /> ) : ( - {t(`swap.tokenOnChain`, { + {t(`main.tokenOnChain`, { tokenSymbol: token?.symbol, chainName: chain?.name, })} diff --git a/packages/widget/src/components/TokenList/TokenNotFound.tsx b/packages/widget/src/components/TokenList/TokenNotFound.tsx index d00448e46..ad93c069f 100644 --- a/packages/widget/src/components/TokenList/TokenNotFound.tsx +++ b/packages/widget/src/components/TokenList/TokenNotFound.tsx @@ -33,7 +33,7 @@ export const TokenNotFound: React.FC = ({ formType }) => { mt={2} px={2} > - {t('swap.info.message.emptyTokenList', { + {t('info.message.emptyTokenList', { chainName: getChainById(selectedChainId)?.name, })} diff --git a/packages/widget/src/components/TokenList/VirtualizedTokenList.tsx b/packages/widget/src/components/TokenList/VirtualizedTokenList.tsx index b88ab57b2..e2c2fc7aa 100644 --- a/packages/widget/src/components/TokenList/VirtualizedTokenList.tsx +++ b/packages/widget/src/components/TokenList/VirtualizedTokenList.tsx @@ -92,7 +92,7 @@ export const VirtualizedTokenList: FC = ({ px={2} pb={1.25} > - {t('swap.featuredTokens')} + {t('main.featuredTokens')} ) : null } @@ -108,7 +108,7 @@ export const VirtualizedTokenList: FC = ({ px={2} py={1.25} > - {t('swap.otherTokens')} + {t('main.otherTokens')} ) : null } diff --git a/packages/widget/src/hooks/useProcessMessage.ts b/packages/widget/src/hooks/useProcessMessage.ts index c8a777460..82ebc8382 100644 --- a/packages/widget/src/hooks/useProcessMessage.ts +++ b/packages/widget/src/hooks/useProcessMessage.ts @@ -30,36 +30,36 @@ const processStatusMessages: Record< Partial string>> > = { TOKEN_ALLOWANCE: { - STARTED: (t) => t(`swap.process.tokenAllowance.started`), - ACTION_REQUIRED: (t) => t(`swap.process.tokenAllowance.pending`), - PENDING: (t) => t(`swap.process.tokenAllowance.pending`), - DONE: (t) => t(`swap.process.tokenAllowance.done`), + STARTED: (t) => t(`main.process.tokenAllowance.started`), + ACTION_REQUIRED: (t) => t(`main.process.tokenAllowance.pending`), + PENDING: (t) => t(`main.process.tokenAllowance.pending`), + DONE: (t) => t(`main.process.tokenAllowance.done`), }, SWITCH_CHAIN: { - ACTION_REQUIRED: (t) => t(`swap.process.switchChain.actionRequired`), - DONE: (t) => t(`swap.process.switchChain.done`), + ACTION_REQUIRED: (t) => t(`main.process.switchChain.actionRequired`), + DONE: (t) => t(`main.process.switchChain.done`), }, SWAP: { - STARTED: (t) => t(`swap.process.swap.started`), - ACTION_REQUIRED: (t) => t(`swap.process.swap.actionRequired`), - PENDING: (t) => t(`swap.process.swap.pending`), + STARTED: (t) => t(`main.process.swap.started`), + ACTION_REQUIRED: (t) => t(`main.process.swap.actionRequired`), + PENDING: (t) => t(`main.process.swap.pending`), DONE: (t, variant) => variant === 'nft' - ? t(`swap.process.nft.done`) - : t(`swap.process.swap.done`), + ? t(`main.process.nft.done`) + : t(`main.process.swap.done`), }, CROSS_CHAIN: { - STARTED: (t) => t(`swap.process.crossChain.started`), - ACTION_REQUIRED: (t) => t(`swap.process.crossChain.actionRequired`), - PENDING: (t) => t(`swap.process.crossChain.pending`), - DONE: (t) => t(`swap.process.crossChain.done`), + STARTED: (t) => t(`main.process.crossChain.started`), + ACTION_REQUIRED: (t) => t(`main.process.crossChain.actionRequired`), + PENDING: (t) => t(`main.process.crossChain.pending`), + DONE: (t) => t(`main.process.crossChain.done`), }, RECEIVING_CHAIN: { - PENDING: (t) => t(`swap.process.receivingChain.pending`), + PENDING: (t) => t(`main.process.receivingChain.pending`), DONE: (t, variant) => variant === 'nft' - ? t(`swap.process.nft.done`) - : t(`swap.process.receivingChain.done`), + ? t(`main.process.nft.done`) + : t(`main.process.receivingChain.done`), }, TRANSACTION: {}, }; @@ -80,8 +80,8 @@ const processSubstatusMessages: Record< }, DONE: { // COMPLETED: 'The transfer is complete.', - PARTIAL: (t) => t(`swap.process.receivingChain.partial`), - REFUNDED: (t) => t(`swap.process.receivingChain.partial`), + PARTIAL: (t) => t(`main.process.receivingChain.partial`), + REFUNDED: (t) => t(`main.process.receivingChain.partial`), }, FAILED: { // TODO: should be moved to failed status @@ -106,7 +106,7 @@ export function getProcessMessage( } { if (process.error && process.status === 'FAILED') { const getTransactionNotSentMessage = () => - t(`swap.error.message.transactionNotSent`, { + t(`error.message.transactionNotSent`, { amount: formatTokenAmount( step.action.fromAmount, step.action.fromToken.decimals, @@ -118,52 +118,52 @@ export function getProcessMessage( let message: string = ''; switch (process.error.code) { case LifiErrorCode.AllowanceRequired: - title = t(`swap.error.title.allowanceRequired`); - message = t(`swap.error.message.allowanceRequired`, { + title = t(`error.title.allowanceRequired`); + message = t(`error.message.allowanceRequired`, { tokenSymbol: step.action.fromToken.symbol, }); break; case LifiErrorCode.BalanceError: - title = t(`swap.error.title.balanceIsTooLow`); + title = t(`error.title.balanceIsTooLow`); message = getTransactionNotSentMessage(); break; case LifiErrorCode.ChainSwitchError: - title = t(`swap.error.title.chainSwitch`); + title = t(`error.title.chainSwitch`); message = getTransactionNotSentMessage(); break; case LifiErrorCode.GasLimitError: - title = t(`swap.error.title.gasLimitIsTooLow`); + title = t(`error.title.gasLimitIsTooLow`); message = getTransactionNotSentMessage(); break; case LifiErrorCode.InsufficientFunds: - title = t(`swap.error.title.insufficientFunds`); + title = t(`error.title.insufficientFunds`); message = `${t( - `swap.error.message.insufficientFunds`, + `error.message.insufficientFunds`, )} ${getTransactionNotSentMessage()}`; break; case LifiErrorCode.SlippageError: - title = t(`swap.error.title.slippageNotMet`); - message = t(`swap.error.message.slippageThreshold`); + title = t(`error.title.slippageNotMet`); + message = t(`error.message.slippageThreshold`); break; case LifiErrorCode.TransactionFailed: - title = t(`swap.error.title.transactionFailed`); - message = t(`swap.error.message.transactionFailed`); + title = t(`error.title.transactionFailed`); + message = t(`error.message.transactionFailed`); break; case LifiErrorCode.TransactionUnderpriced: - title = t(`swap.error.title.transactionUnderpriced`); + title = t(`error.title.transactionUnderpriced`); message = getTransactionNotSentMessage(); break; case LifiErrorCode.TransactionUnprepared: - title = t(`swap.error.title.transactionUnprepared`); + title = t(`error.title.transactionUnprepared`); message = getTransactionNotSentMessage(); break; case LifiErrorCode.TransactionCanceled: - title = t(`swap.error.title.transactionCanceled`); + title = t(`error.title.transactionCanceled`); message = getTransactionNotSentMessage(); break; case LifiErrorCode.TransactionRejected: - title = t(`swap.error.title.transactionRejected`); - message = t(`swap.error.message.transactionRejected`, { + title = t(`error.title.transactionRejected`); + message = t(`error.message.transactionRejected`, { amount: formatTokenAmount( step.action.fromAmount, step.action.fromToken.decimals, @@ -174,11 +174,11 @@ export function getProcessMessage( break; case LifiErrorCode.ProviderUnavailable: default: - title = t(`swap.error.title.unknown`); + title = t(`error.title.unknown`); if (process.txLink) { - message = t(`swap.error.message.transactionFailed`); + message = t(`error.message.transactionFailed`); } else { - message = t(`swap.error.message.unknown`); + message = t(`error.message.unknown`); } break; } diff --git a/packages/widget/src/i18n/en.json b/packages/widget/src/i18n/en.json index 6825c09e0..f7cd3116b 100644 --- a/packages/widget/src/i18n/en.json +++ b/packages/widget/src/i18n/en.json @@ -12,26 +12,24 @@ "delete": "Delete", "disconnect": "Disconnect", "done": "Done", + "exchange": "Exchange", "getGas": "Get gas", "hide": "Hide", "learnMore": "Learn more", - "lifiSwap": "LI.FI Swap", + "lifiExchange": "LI.FI Exchange", "light": "Light", "max": "max", "ok": "Ok", - "okay": "Okay", - "removeSwap": "Remove swap", + "removeTransaction": "Remove transaction", "reset": "Reset", "resetSettings": "Reset settings", - "restartSwap": "Restart swap", - "reviewGasSwap": "Review gas swap", + "reviewBridge": "Review bridge", "reviewPurchase": "Review purchase", "reviewSwap": "Review swap", "seeDetails": "See details", "showAll": "Show all", - "startGasSwap": "Start gas swap", - "startSwap": "Start swap", - "swap": "Swap", + "startBridging": "Start bridging", + "startSwapping": "Start swapping", "tryAgain": "Try again", "viewCoverage": "View coverage", "viewOnExplorer": "View on explorer" @@ -41,24 +39,24 @@ "number": "{{value, number(maximumFractionDigits: 9)}}" }, "header": { - "activeSwaps": "Active swaps", + "activeTransactions": "Active transactions", "bridge": "Bridge", "checkout": "Checkout", - "from": "Swap from", + "exchange": "Exchange", + "from": "Exchange from", "gas": "Gas", - "gasSwap": "Gas swap", "payWith": "Pay with", "purchase": "Purchase", "purchaseDetails": "Purchase details", - "routes": "You get", "selectChain": "Select chain", "selectWallet": "Select your wallet", "settings": "Settings", "swap": "Swap", - "swapDetails": "Swap details", - "swapHistory": "Swap history", - "to": "Swap to", - "walletConnected": "Wallet connected" + "to": "Exchange to", + "transactionDetails": "Transaction details", + "transactionHistory": "Transaction history", + "walletConnected": "Wallet connected", + "youGet": "You get" }, "language": { "name": "English", @@ -77,38 +75,9 @@ "showDestinationWallet": "Show destination wallet", "slippage": "Slippage" }, - "swap": { + "main": { "crossStepDetails": "Bridge from {{from}} to {{to}} via {{tool}}", "currentAmount": "Current amount", - "error": { - "message": { - "allowanceRequired": "Transfer amount for {{tokenSymbol}} exceeds your current allowance. Please increase your allowance and try again.", - "insufficientFunds": "You don't have enough gas to cover the cost of the transaction.", - "slippageThreshold": "The slippage is larger than the defined threshold. Please request a new route to get a fresh quote.", - "transactionFailed": "Please check the block explorer for more information.", - "transactionNotSent": "Transaction was not sent. {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}} remain in your wallet.", - "transactionRejected": "Your signature is required to complete the transaction. {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}} remain in your wallet.", - "unknown": "Please try again or contact support." - }, - "title": { - "allowanceRequired": "Insufficient allowance", - "balanceIsTooLow": "The balance is too low", - "chainSwitch": "Chain switch required", - "failed": "Swap failed", - "gasLimitIsTooLow": "The gas limit is too low", - "insufficientFunds": "Insufficient funds", - "slippageNotMet": "Slippage conditions not met", - "transactionCanceled": "Transaction canceled", - "transactionFailed": "Transaction failed", - "transactionRejected": "Signature required", - "transactionUnderpriced": "Transaction is underpriced", - "transactionUnprepared": "Unable to prepare transaction", - "unknown": "Something went wrong", - "walletAddressInvalid": "Wallet address is invalid.", - "walletAddressRequired": "Wallet address is required.", - "walletEnsAddressInvalid": "Wallet address is invalid or network doesn't support ENS." - } - }, "estimatedTime": "{{value}}m", "featuredTokens": "Featured tokens", "from": "From", @@ -117,27 +86,6 @@ "gasFeeEstimated": "estimated gas fee", "gasFeePaid": "gas fee paid", "inProgress": "in progress", - "insurance": { - "bridgeExploits": "Bridge malfunctions, hacks or exploits", - "insure": "Insure {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in transit.", - "insured": "You've insured {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in transit:", - "slippageError": "Error in slippage for tokens received" - }, - "info": { - "message": { - "autoRefuel": "You're low on {{chainName}} gas. By continuing, you'll get enough gas to complete the swap.", - "emptyActiveSwaps": "Swaps in progress will appear here. Once completed, find them in swap history.", - "emptySwapHistory": "Swap history is only stored locally and will be deleted if you clear your browser data.", - "emptyTokenList": "We couldn't find tokens on {{chainName}} chain or you don't have any. Please try search again or choose another chain.", - "routeNotFound": "Try another token combination." - }, - "title": { - "autoRefuel": "Get gas", - "emptyActiveSwaps": "No active swaps", - "emptySwapHistory": "No recent swaps", - "routeNotFound": "No routes available" - } - }, "nftStepDetails": "Purchase NFT via {{tool}}", "onChain": "on {{chainName}}", "otherTokens": "Other tokens", @@ -183,6 +131,7 @@ "selectToken": "Select token", "sendToAddress": "Send to {{address}}", "sendToWallet": "Send to a different wallet", + "sending": "Sending", "sentToAddress": "Sent to {{address}}", "stepBridge": "Bridge", "stepBridgeAndBuy": "Bridge and buy", @@ -190,23 +139,8 @@ "stepSwap": "Swap", "stepSwapAndBridge": "Swap and bridge", "stepSwapAndBuy": "Swap and buy", - "success": { - "message": { - "swapPartiallySuccessful": "We've tried to complete the swap, but {{tool}} ran out of liquidity for {{tokenSymbol}} token.", - "purchaseSuccessful": "You now own {{assetName}} in {{walletAddress}} wallet on {{chainName}} chain.", - "swapSuccessful": "There are now {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in {{walletAddress}} wallet on {{chainName}} chain." - }, - "title": { - "gasSwapSuccessful": "Gas swap successful", - "purchaseSuccessful": "Purchase successful", - "refundIssued": "Refund issued", - "swapPartiallySuccessful": "Swap partially successful", - "swapSuccessful": "Swap successful" - } - }, "supportId": "Support ID", "swapStepDetails": "Swap on {{chain}} via {{tool}}", - "swapping": "Swapping", "tags": { "cheapest": "Cheap", "fastest": "Fast", @@ -221,37 +155,102 @@ "tokenOnChainAmount": "{{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}}", "tokenSearch": "Search by token name or address", "valueLoss": "Value loss", - "walletAddressOrEns": "Wallet address or ENS name", - "warning": { - "message": { - "deleteActiveSwaps": "Active swaps are only stored locally and can't be recovered if you delete them.", - "deleteSwapHistory": "Swap history is only stored locally and can't be recovered if you delete it.", - "highValueLoss": "The value of the received tokens is significantly lower than the swapped tokens and transaction cost.", - "insufficientFunds": "You don't have enough funds to complete the swap.", - "insufficientGas": "You don't have enough gas to complete the swap. You need to add at least:", - "rateChanged": "The exchange rate has changed. By continuing the swap, you'll accept the new rate.", - "resetSettings": "This will reset your route priority, slippage, gas price, enabled bridges and exchanges." - }, - "title": { - "deleteActiveSwaps": "Delete all active swaps?", - "deleteSwap": "Delete this swap?", - "deleteSwapHistory": "Delete swap history?", - "highValueLoss": "High value loss", - "insufficientGas": "Insufficient gas", - "rateChanged": "Rate changed", - "resetSettings": "Reset settings?" - } + "walletAddressOrEns": "Wallet address or ENS name" + }, + "error": { + "message": { + "allowanceRequired": "Transfer amount for {{tokenSymbol}} exceeds your current allowance. Please increase your allowance and try again.", + "insufficientFunds": "You don't have enough gas to cover the cost of the transaction.", + "slippageThreshold": "The slippage is larger than the defined threshold. Please request a new route to get a fresh quote.", + "transactionFailed": "Please check the block explorer for more information.", + "transactionNotSent": "Transaction was not sent. {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}} remain in your wallet.", + "transactionRejected": "Your signature is required to complete the transaction. {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}} remain in your wallet.", + "unknown": "Please try again or contact support." + }, + "title": { + "allowanceRequired": "Insufficient allowance", + "balanceIsTooLow": "The balance is too low", + "chainSwitch": "Chain switch required", + "gasLimitIsTooLow": "The gas limit is too low", + "insufficientFunds": "Insufficient funds", + "slippageNotMet": "Slippage conditions not met", + "transactionCanceled": "Transaction canceled", + "transactionFailed": "Transaction failed", + "transactionRejected": "Signature required", + "transactionUnderpriced": "Transaction is underpriced", + "transactionUnprepared": "Unable to prepare transaction", + "unknown": "Something went wrong", + "walletAddressInvalid": "Wallet address is invalid.", + "walletAddressRequired": "Wallet address is required.", + "walletEnsAddressInvalid": "Wallet address is invalid or network doesn't support ENS." + } + }, + "insurance": { + "bridgeExploits": "Bridge malfunctions, hacks or exploits", + "insure": "Insure {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in transit.", + "insured": "You've insured {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in transit:", + "slippageError": "Error in slippage for tokens received" + }, + "info": { + "message": { + "autoRefuel": "You're low on {{chainName}} gas. By continuing, you'll get enough gas to complete the transaction.", + "emptyActiveTransactions": "Transactions in progress will appear here. Once completed, find them in transaction history.", + "emptyTokenList": "We couldn't find tokens on {{chainName}} chain or you don't have any. Please try search again or choose another chain.", + "emptyTransactionHistory": "Transaction history is only stored locally and will be deleted if you clear your browser data.", + "routeNotFound": "Try another token combination." + }, + "title": { + "autoRefuel": "Get gas", + "emptyActiveTransactions": "No active transactions", + "emptyTransactionHistory": "No recent transactions", + "routeNotFound": "No routes available" + } + }, + "success": { + "message": { + "exchangePartiallySuccessful": "We've tried to complete the transaction, but {{tool}} ran out of liquidity for {{tokenSymbol}} token.", + "exchangeSuccessful": "There are now {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in {{walletAddress}} wallet on {{chainName}} chain.", + "purchaseSuccessful": "You now own {{assetName}} in {{walletAddress}} wallet on {{chainName}} chain." + }, + "title": { + "bridgePartiallySuccessful": "Bridge partially successful", + "bridgeSuccessful": "Bridge successful", + "gasBridgeSuccessful": "Gas bridge successful", + "purchaseSuccessful": "Purchase successful", + "refundIssued": "Refund issued", + "swapPartiallySuccessful": "Swap partially successful", + "swapSuccessful": "Swap successful" + } + }, + "warning": { + "message": { + "deleteActiveTransactions": "Active transactions are only stored locally and can't be recovered if you delete them.", + "deleteTransactionHistory": "Transaction history is only stored locally and can't be recovered if you delete it.", + "highValueLoss": "The value of the received tokens is significantly lower than the exchanged tokens and transaction cost.", + "insufficientFunds": "You don't have enough funds to complete the transaction.", + "insufficientGas": "You don't have enough gas to complete the transaction. You need to add at least:", + "rateChanged": "The exchange rate has changed. By continuing the transaction, you'll accept the new rate.", + "resetSettings": "This will reset your route priority, slippage, gas price, enabled bridges and exchanges." + }, + "title": { + "deleteActiveTransactions": "Delete all active transactions?", + "deleteTransaction": "Delete this transaction?", + "deleteTransactionHistory": "Delete transaction history?", + "highValueLoss": "High value loss", + "insufficientGas": "Insufficient gas", + "rateChanged": "Rate changed", + "resetSettings": "Reset settings?" } }, "tooltip": { "additionalProviderFee": "Additional bridges, DEXs, and service fees.", "estimatedNetworkFee": "Estimated network fee.", - "estimatedTime": "Estimated swap execution time in minutes.", + "estimatedTime": "Estimated execution time in minutes.", "notFound": { "text": "We couldn't find this page.", "title": "404" }, - "numberOfSteps": "A number of swap steps. Each step can contain 1-2 transactions that require a signature.", + "numberOfSteps": "A number of exchange steps. Each step can contain 1-2 transactions that require a signature.", "progressToNextUpdate": "Displayed data will auto-refresh after {{value}} seconds. Click here to update manually.", "recommended": "A cheap route that balances complexity and ease of use.", "settingsModified": "Settings (modified)" diff --git a/packages/widget/src/pages/ActiveSwapsPage/ActiveSwapsEmpty.tsx b/packages/widget/src/pages/ActiveSwapsPage/ActiveSwapsEmpty.tsx index 330fc8385..bdc3176a5 100644 --- a/packages/widget/src/pages/ActiveSwapsPage/ActiveSwapsEmpty.tsx +++ b/packages/widget/src/pages/ActiveSwapsPage/ActiveSwapsEmpty.tsx @@ -19,7 +19,7 @@ export const ActiveSwapsEmpty: React.FC = () => { - {t('swap.info.title.emptyActiveSwaps')} + {t('info.title.emptyActiveTransactions')} { textAlign="center" mt={2} > - {t('swap.info.message.emptyActiveSwaps')} + {t('info.message.emptyActiveTransactions')} ); diff --git a/packages/widget/src/pages/ActiveSwapsPage/ActiveSwapsPage.tsx b/packages/widget/src/pages/ActiveSwapsPage/ActiveSwapsPage.tsx index 3e82c55c1..f7d9a3b03 100644 --- a/packages/widget/src/pages/ActiveSwapsPage/ActiveSwapsPage.tsx +++ b/packages/widget/src/pages/ActiveSwapsPage/ActiveSwapsPage.tsx @@ -13,7 +13,7 @@ import { useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { ActiveSwapItem } from '../../components/ActiveSwaps'; import { Dialog } from '../../components/Dialog'; -import { useHeaderActionStore } from '../../components/Header'; +import { useHeaderStore } from '../../components/Header'; import { useWallet } from '../../providers'; import { useExecutingRoutesIds, useRouteExecutionStore } from '../../stores'; import { ActiveSwapsEmpty } from './ActiveSwapsEmpty'; @@ -31,7 +31,7 @@ export const ActiveSwapsPage = () => { useEffect(() => { if (executingRoutes.length) { - return useHeaderActionStore.getState().setAction( + return useHeaderStore.getState().setAction( , @@ -56,10 +56,10 @@ export const ActiveSwapsPage = () => { ))} - {t('swap.warning.title.deleteActiveSwaps')} + {t('warning.title.deleteActiveTransactions')} - {t('swap.warning.message.deleteActiveSwaps')} + {t('warning.message.deleteActiveTransactions')} diff --git a/packages/widget/src/pages/MainPage/MainSwapButton.tsx b/packages/widget/src/pages/MainPage/MainSwapButton.tsx index 87009a527..ba5d1cfb5 100644 --- a/packages/widget/src/pages/MainPage/MainSwapButton.tsx +++ b/packages/widget/src/pages/MainPage/MainSwapButton.tsx @@ -17,7 +17,7 @@ export const MainSwapButton: React.FC = () => { const handleClick = async () => { if (currentRoute) { setExecutableRoute(currentRoute); - navigate(navigationRoutes.swapExecution, { + navigate(navigationRoutes.transactionExecution, { state: { routeId: currentRoute.id }, }); } @@ -26,7 +26,7 @@ export const MainSwapButton: React.FC = () => { return ( {allToolsSelected ? ( diff --git a/packages/widget/src/pages/SelectNativeTokenPage/SelectNativeTokenPage.tsx b/packages/widget/src/pages/SelectNativeTokenPage/SelectNativeTokenPage.tsx index 45cdbb3ef..f5e596daf 100644 --- a/packages/widget/src/pages/SelectNativeTokenPage/SelectNativeTokenPage.tsx +++ b/packages/widget/src/pages/SelectNativeTokenPage/SelectNativeTokenPage.tsx @@ -33,7 +33,7 @@ export const SelectNativeTokenPage: React.FC = ({ ))} diff --git a/packages/widget/src/pages/SelectTokenPage/SearchTokenInput.tsx b/packages/widget/src/pages/SelectTokenPage/SearchTokenInput.tsx index 8d25208f4..e07efaa5e 100644 --- a/packages/widget/src/pages/SelectTokenPage/SearchTokenInput.tsx +++ b/packages/widget/src/pages/SelectTokenPage/SearchTokenInput.tsx @@ -23,7 +23,7 @@ export const SearchTokenInput = () => { diff --git a/packages/widget/src/pages/SettingsPage/ResetSettingsButton.tsx b/packages/widget/src/pages/SettingsPage/ResetSettingsButton.tsx index dfa77dccb..7e982ad0f 100644 --- a/packages/widget/src/pages/SettingsPage/ResetSettingsButton.tsx +++ b/packages/widget/src/pages/SettingsPage/ResetSettingsButton.tsx @@ -36,15 +36,15 @@ export const ResetSettingsButton: React.FC = () => { }; return ( - + - {t('swap.warning.title.resetSettings')} + {t('warning.title.resetSettings')} - {t('swap.warning.message.resetSettings')} + {t('warning.message.resetSettings')} diff --git a/packages/widget/src/pages/SettingsPage/RoutePrioritySelect.tsx b/packages/widget/src/pages/SettingsPage/RoutePrioritySelect.tsx index 2ff1ef0d3..8bd775110 100644 --- a/packages/widget/src/pages/SettingsPage/RoutePrioritySelect.tsx +++ b/packages/widget/src/pages/SettingsPage/RoutePrioritySelect.tsx @@ -27,7 +27,7 @@ export const RoutePrioritySelect: React.FC = () => { dense > {Orders.map((order) => { - const tag = t(`swap.tags.${order.toLowerCase()}` as any); + const tag = t(`main.tags.${order.toLowerCase()}` as any); const tagName = `${tag[0]}${tag.slice(1).toLowerCase()}`; return ( diff --git a/packages/widget/src/pages/SwapDetailsPage/SwapDetailsPage.tsx b/packages/widget/src/pages/SwapDetailsPage/SwapDetailsPage.tsx index eeff6b4a4..86b5eec2b 100644 --- a/packages/widget/src/pages/SwapDetailsPage/SwapDetailsPage.tsx +++ b/packages/widget/src/pages/SwapDetailsPage/SwapDetailsPage.tsx @@ -17,7 +17,7 @@ import { shallow } from 'zustand/shallow'; import { Card, CardTitle } from '../../components/Card'; import { ContractComponent } from '../../components/ContractComponent'; import { Dialog } from '../../components/Dialog'; -import { useHeaderActionStore } from '../../components/Header'; +import { useHeaderStore } from '../../components/Header'; import { Insurance } from '../../components/Insurance'; import { getStepList } from '../../components/Step'; import { useNavigateBack } from '../../hooks'; @@ -65,7 +65,7 @@ export const SwapDetailsPage: React.FC = () => { }; useEffect(() => { - return useHeaderActionStore.getState().setAction( + return useHeaderStore.getState().setAction( , @@ -120,7 +120,7 @@ export const SwapDetailsPage: React.FC = () => { flex: 1, }} > - {t('swap.supportId')} + {t('main.supportId')} @@ -148,10 +148,10 @@ export const SwapDetailsPage: React.FC = () => { - {t('swap.warning.title.deleteSwap')} + {t('warning.title.deleteTransaction')} - {t('swap.warning.message.deleteSwapHistory')} + {t('warning.message.deleteTransactionHistory')} diff --git a/packages/widget/src/pages/SwapHistoryPage/SwapHistoryEmpty.tsx b/packages/widget/src/pages/SwapHistoryPage/SwapHistoryEmpty.tsx index 30f5de2a6..d7c3eb7b4 100644 --- a/packages/widget/src/pages/SwapHistoryPage/SwapHistoryEmpty.tsx +++ b/packages/widget/src/pages/SwapHistoryPage/SwapHistoryEmpty.tsx @@ -19,7 +19,7 @@ export const SwapHistoryEmpty: React.FC = () => { - {t('swap.info.title.emptySwapHistory')} + {t('info.title.emptyTransactionHistory')} { textAlign="center" mt={2} > - {t('swap.info.message.emptySwapHistory')} + {t('info.message.emptyTransactionHistory')} ); diff --git a/packages/widget/src/pages/SwapHistoryPage/SwapHistoryItem.tsx b/packages/widget/src/pages/SwapHistoryPage/SwapHistoryItem.tsx index ce9bbd762..821c64b78 100644 --- a/packages/widget/src/pages/SwapHistoryPage/SwapHistoryItem.tsx +++ b/packages/widget/src/pages/SwapHistoryPage/SwapHistoryItem.tsx @@ -14,7 +14,7 @@ export const SwapHistoryItem: React.FC<{ const navigate = useNavigate(); const handleClick = () => { - navigate(navigationRoutes.swapDetails, { + navigate(navigationRoutes.transactionDetails, { state: { routeId: route.id }, }); }; diff --git a/packages/widget/src/pages/SwapHistoryPage/SwapHistoryPage.tsx b/packages/widget/src/pages/SwapHistoryPage/SwapHistoryPage.tsx index 8db24e66e..30368a60a 100644 --- a/packages/widget/src/pages/SwapHistoryPage/SwapHistoryPage.tsx +++ b/packages/widget/src/pages/SwapHistoryPage/SwapHistoryPage.tsx @@ -12,7 +12,7 @@ import { import { useCallback, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Dialog } from '../../components/Dialog'; -import { useHeaderActionStore } from '../../components/Header'; +import { useHeaderStore } from '../../components/Header'; import { useWallet } from '../../providers'; import { useRouteExecutionStore } from '../../stores'; import { useSwapHistory } from '../../stores/routes'; @@ -32,7 +32,7 @@ export const SwapHistoryPage: React.FC = () => { useEffect(() => { if (swaps.length) { - return useHeaderActionStore.getState().setAction( + return useHeaderStore.getState().setAction( , @@ -56,10 +56,10 @@ export const SwapHistoryPage: React.FC = () => { )} - {t('swap.warning.title.deleteSwapHistory')} + {t('warning.title.deleteTransactionHistory')} - {t('swap.warning.message.deleteSwapHistory')} + {t('warning.message.deleteTransactionHistory')} diff --git a/packages/widget/src/pages/SwapPage/ExchangeRateBottomSheet.tsx b/packages/widget/src/pages/SwapPage/ExchangeRateBottomSheet.tsx index 005261004..e70e78c2c 100644 --- a/packages/widget/src/pages/SwapPage/ExchangeRateBottomSheet.tsx +++ b/packages/widget/src/pages/SwapPage/ExchangeRateBottomSheet.tsx @@ -103,12 +103,12 @@ const ExchangeRateBottomSheetContent: React.FC< - {t('swap.warning.title.rateChanged')} + {t('warning.title.rateChanged')} - {t('swap.warning.message.rateChanged')} + {t('warning.message.rateChanged')} - {t('swap.quotedAmount')} + {t('main.quotedAmount')} {t('format.number', { value: formatTokenAmount( @@ -121,7 +121,7 @@ const ExchangeRateBottomSheetContent: React.FC< - {t('swap.currentAmount')} + {t('main.currentAmount')} {t('format.number', { value: formatTokenAmount( @@ -134,7 +134,7 @@ const ExchangeRateBottomSheetContent: React.FC< - {t('swap.rateChange')} + {t('main.rateChange')} {Big(data?.newToAmount || 0) .div(Big(data?.oldToAmount || 0)) diff --git a/packages/widget/src/pages/SwapPage/StartSwapButton.tsx b/packages/widget/src/pages/SwapPage/StartSwapButton.tsx index 31dd475a6..19a1f44f4 100644 --- a/packages/widget/src/pages/SwapPage/StartSwapButton.tsx +++ b/packages/widget/src/pages/SwapPage/StartSwapButton.tsx @@ -22,7 +22,7 @@ export const StartSwapButton: React.FC = ({ diff --git a/packages/widget/src/pages/SwapPage/StatusBottomSheet.tsx b/packages/widget/src/pages/SwapPage/StatusBottomSheet.tsx index 2e264a207..7a4d25df5 100644 --- a/packages/widget/src/pages/SwapPage/StatusBottomSheet.tsx +++ b/packages/widget/src/pages/SwapPage/StatusBottomSheet.tsx @@ -90,12 +90,15 @@ export const StatusBottomSheet: React.FC = ({ const handleSeeDetails = () => { handleClose(); - navigate(navigationRoutes.swapDetails, { + navigate(navigationRoutes.transactionDetails, { state: { routeId: route.id }, replace: true, }); }; + const transactionType = + route.fromChainId === route.toChainId ? 'swap' : 'bridge'; + let title; let primaryMessage; let secondaryMessage; @@ -104,10 +107,10 @@ export const StatusBottomSheet: React.FC = ({ case RouteExecutionStatus.Done: { title = variant === 'nft' - ? t('swap.success.title.purchaseSuccessful') - : t('swap.success.title.swapSuccessful'); + ? t('success.title.purchaseSuccessful') + : t(`success.title.${transactionType}Successful`); if (token) { - primaryMessage = t('swap.success.message.swapSuccessful', { + primaryMessage = t('success.message.exchangeSuccessful', { amount: formatTokenAmount(token.amount), tokenSymbol: token.symbol, chainName: getChainById(token.chainId)?.name, @@ -118,13 +121,13 @@ export const StatusBottomSheet: React.FC = ({ break; } case RouteExecutionStatus.Done | RouteExecutionStatus.Partial: { - title = t('swap.success.title.swapPartiallySuccessful'); - primaryMessage = t('swap.success.message.swapPartiallySuccessful', { + title = t(`success.title.${transactionType}PartiallySuccessful`); + primaryMessage = t('success.message.exchangePartiallySuccessful', { tool: route.steps.at(-1)?.toolDetails.name, tokenSymbol: route.steps.at(-1)?.action.toToken.symbol, }); if (token) { - secondaryMessage = t('swap.success.message.swapSuccessful', { + secondaryMessage = t('success.message.exchangeSuccessful', { amount: formatTokenAmount(token.amount), tokenSymbol: token.symbol, chainName: getChainById(token.chainId)?.name, @@ -135,13 +138,13 @@ export const StatusBottomSheet: React.FC = ({ break; } case RouteExecutionStatus.Done | RouteExecutionStatus.Refunded: { - title = t('swap.success.title.refundIssued'); - primaryMessage = t('swap.success.message.swapPartiallySuccessful', { + title = t('success.title.refundIssued'); + primaryMessage = t('success.message.exchangePartiallySuccessful', { tool: route.steps.at(-1)?.toolDetails.name, tokenSymbol: route.steps.at(-1)?.action.toToken.symbol, }); if (token) { - secondaryMessage = t('swap.success.message.swapSuccessful', { + secondaryMessage = t('success.message.exchangeSuccessful', { amount: formatTokenAmount(token.amount), tokenSymbol: token.symbol, chainName: getChainById(token.chainId)?.name, diff --git a/packages/widget/src/pages/SwapPage/SwapPage.tsx b/packages/widget/src/pages/SwapPage/SwapPage.tsx index 0b1169630..b83d3e8e6 100644 --- a/packages/widget/src/pages/SwapPage/SwapPage.tsx +++ b/packages/widget/src/pages/SwapPage/SwapPage.tsx @@ -1,13 +1,14 @@ import type { ExchangeRateUpdateParams } from '@lifi/sdk'; import DeleteIcon from '@mui/icons-material/Delete'; import { Box, Button, Tooltip } from '@mui/material'; -import { useRef, useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; import { useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { useLocation } from 'react-router-dom'; import type { BottomSheetBase } from '../../components/BottomSheet'; import { ContractComponent } from '../../components/ContractComponent'; import { GasMessage } from '../../components/GasMessage'; +import { useHeaderStore } from '../../components/Header'; import { Insurance } from '../../components/Insurance'; import { getStepList } from '../../components/Step'; import { @@ -56,20 +57,36 @@ export const SwapPage: React.FC = () => { onAcceptExchangeRateUpdate, }); + useEffect(() => { + if (route && variant !== 'nft') { + const transactionType = + route.fromChainId === route.toChainId ? 'Swap' : 'Bridge'; + return useHeaderStore + .getState() + .setTitle( + status === RouteExecutionStatus.Idle + ? t(`button.review${transactionType}`) + : t(`header.${transactionType.toLowerCase() as 'swap' | 'bridge'}`), + ); + } + }, [route, status, t, variant]); + + if (!route) { + return null; + } + const tokenValueLossThresholdExceeded = getTokenValueLossThreshold(route); const handleExecuteRoute = () => { if (tokenValueBottomSheetRef.current?.isOpen()) { - if (route) { - emitter.emit(WidgetEvent.RouteHighValueLoss, { - fromAmountUsd: route.fromAmountUSD, - gasCostUSD: route.gasCostUSD, - toAmountUSD: route.toAmountUSD, - valueLoss: calcValueLoss(route), - }); - } - tokenValueBottomSheetRef.current?.close(); + emitter.emit(WidgetEvent.RouteHighValueLoss, { + fromAmountUsd: route.fromAmountUSD, + gasCostUSD: route.gasCostUSD, + toAmountUSD: route.toAmountUSD, + valueLoss: calcValueLoss(route), + }); } + tokenValueBottomSheetRef.current?.close(); executeRoute(); setValue(SwapFormKey.FromAmount, ''); }; @@ -99,9 +116,11 @@ export const SwapPage: React.FC = () => { case 'nft': return t('button.buyNow'); case 'refuel': - return t('button.startGasSwap'); + return t('button.startBridging'); default: - return t('button.startSwap'); + const transactionType = + route.fromChainId === route.toChainId ? 'Swapping' : 'Bridging'; + return t(`button.start${transactionType}`); } case RouteExecutionStatus.Failed: return t('button.tryAgain'); @@ -118,20 +137,20 @@ export const SwapPage: React.FC = () => { const insuranceAvailable = insurance && variant !== 'refuel' && - (route?.insurance?.state === 'INSURED' || + (route.insurance?.state === 'INSURED' || (status === RouteExecutionStatus.Idle && - route?.insurance?.state === 'INSURABLE')); + route.insurance?.state === 'INSURABLE')); const insuranceCoverageId = - route?.steps[0].execution?.process + route.steps[0].execution?.process .filter((process) => process.type !== 'TOKEN_ALLOWANCE') - .find((process) => process.txHash)?.txHash ?? route?.fromAddress; + .find((process) => process.txHash)?.txHash ?? route.fromAddress; return ( {getStepList(route)} {variant === 'nft' ? : null} - {route && insuranceAvailable ? ( + {insuranceAvailable ? ( { /> {status === RouteExecutionStatus.Failed ? ( { ) : null} - {route && status ? ( - - ) : null} - {route && tokenValueLossThresholdExceeded && variant !== 'nft' ? ( + {status ? : null} + {tokenValueLossThresholdExceeded && variant !== 'nft' ? ( ) : null} - {route ? ( - - ) : null} + ); }; diff --git a/packages/widget/src/pages/SwapPage/TokenValueBottomSheet.tsx b/packages/widget/src/pages/SwapPage/TokenValueBottomSheet.tsx index 710a4dc32..413257a88 100644 --- a/packages/widget/src/pages/SwapPage/TokenValueBottomSheet.tsx +++ b/packages/widget/src/pages/SwapPage/TokenValueBottomSheet.tsx @@ -51,30 +51,30 @@ const TokenValueBottomSheetContent: React.FC = ({ - {t('swap.warning.title.highValueLoss')} + {t('warning.title.highValueLoss')} - {t('swap.warning.message.highValueLoss')} + {t('warning.message.highValueLoss')} - {t('swap.swapping')} + {t('main.sending')} {t('format.currency', { value: route.fromAmountUSD })} - {t('swap.gasCost')} + {t('main.gasCost')} {t('format.currency', { value: route.gasCostUSD })} - {t('swap.receiving')} + {t('main.receiving')} {t('format.currency', { value: route.toAmountUSD })} - {t('swap.valueLoss')} + {t('main.valueLoss')} {calcValueLoss(route)} diff --git a/packages/widget/src/pages/SwapRoutesPage/SwapRoutesPage.tsx b/packages/widget/src/pages/SwapRoutesPage/SwapRoutesPage.tsx index c4693c2c6..b3ba11ac8 100644 --- a/packages/widget/src/pages/SwapRoutesPage/SwapRoutesPage.tsx +++ b/packages/widget/src/pages/SwapRoutesPage/SwapRoutesPage.tsx @@ -2,7 +2,7 @@ import type { Route } from '@lifi/sdk'; import type { BoxProps } from '@mui/material'; import { useEffect } from 'react'; -import { useHeaderActionStore } from '../../components/Header'; +import { useHeaderStore } from '../../components/Header'; import { ProgressToNextUpdate } from '../../components/ProgressToNextUpdate'; import { SwapRouteCard, @@ -28,7 +28,7 @@ export const SwapRoutesPage: React.FC = () => { const handleRouteClick = (route: Route) => { setExecutableRoute(route); - navigate(navigationRoutes.swapExecution, { + navigate(navigationRoutes.transactionExecution, { state: { routeId: route.id }, }); }; @@ -42,7 +42,7 @@ export const SwapRoutesPage: React.FC = () => { }, []); useEffect(() => { - return useHeaderActionStore + return useHeaderStore .getState() .setAction( Date: Thu, 8 Jun 2023 15:54:41 +0200 Subject: [PATCH 02/13] chore: rearrange keys --- packages/widget/src/i18n/en.json | 215 +++++++++++++++---------------- 1 file changed, 107 insertions(+), 108 deletions(-) diff --git a/packages/widget/src/i18n/en.json b/packages/widget/src/i18n/en.json index f7cd3116b..e2dd49320 100644 --- a/packages/widget/src/i18n/en.json +++ b/packages/widget/src/i18n/en.json @@ -1,4 +1,12 @@ { + "language": { + "name": "English", + "title": "Language" + }, + "format": { + "currency": "{{value, currency(currency: USD)}}", + "number": "{{value, number(maximumFractionDigits: 9)}}" + }, "button": { "auto": "Auto", "buy": "Buy", @@ -34,10 +42,6 @@ "viewCoverage": "View coverage", "viewOnExplorer": "View on explorer" }, - "format": { - "currency": "{{value, currency(currency: USD)}}", - "number": "{{value, number(maximumFractionDigits: 9)}}" - }, "header": { "activeTransactions": "Active transactions", "bridge": "Bridge", @@ -58,22 +62,96 @@ "walletConnected": "Wallet connected", "youGet": "You get" }, - "language": { - "name": "English", - "title": "Language" + "info": { + "message": { + "autoRefuel": "You're low on {{chainName}} gas. By continuing, you'll get enough gas to complete the transaction.", + "emptyActiveTransactions": "Transactions in progress will appear here. Once completed, find them in transaction history.", + "emptyTokenList": "We couldn't find tokens on {{chainName}} chain or you don't have any. Please try search again or choose another chain.", + "emptyTransactionHistory": "Transaction history is only stored locally and will be deleted if you clear your browser data.", + "routeNotFound": "Try another token combination." + }, + "title": { + "autoRefuel": "Get gas", + "emptyActiveTransactions": "No active transactions", + "emptyTransactionHistory": "No recent transactions", + "routeNotFound": "No routes available" + } }, - "settings": { - "enabledBridges": "Enabled bridges", - "enabledExchanges": "Enabled exchanges", - "gasPrice": { - "fast": "Fast", - "normal": "Normal", - "slow": "Slow", - "title": "Gas price" + "success": { + "message": { + "exchangePartiallySuccessful": "We've tried to complete the transaction, but {{tool}} ran out of liquidity for {{tokenSymbol}} token.", + "exchangeSuccessful": "There are now {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in {{walletAddress}} wallet on {{chainName}} chain.", + "purchaseSuccessful": "You now own {{assetName}} in {{walletAddress}} wallet on {{chainName}} chain." }, - "routePriority": "Route priority", - "showDestinationWallet": "Show destination wallet", - "slippage": "Slippage" + "title": { + "bridgePartiallySuccessful": "Bridge partially successful", + "bridgeSuccessful": "Bridge successful", + "purchaseSuccessful": "Purchase successful", + "refundIssued": "Refund issued", + "swapPartiallySuccessful": "Swap partially successful", + "swapSuccessful": "Swap successful" + } + }, + "warning": { + "message": { + "deleteActiveTransactions": "Active transactions are only stored locally and can't be recovered if you delete them.", + "deleteTransactionHistory": "Transaction history is only stored locally and can't be recovered if you delete it.", + "highValueLoss": "The value of the received tokens is significantly lower than the exchanged tokens and transaction cost.", + "insufficientFunds": "You don't have enough funds to complete the transaction.", + "insufficientGas": "You don't have enough gas to complete the transaction. You need to add at least:", + "rateChanged": "The exchange rate has changed. By continuing the transaction, you'll accept the new rate.", + "resetSettings": "This will reset your route priority, slippage, gas price, enabled bridges and exchanges." + }, + "title": { + "deleteActiveTransactions": "Delete all active transactions?", + "deleteTransaction": "Delete this transaction?", + "deleteTransactionHistory": "Delete transaction history?", + "highValueLoss": "High value loss", + "insufficientGas": "Insufficient gas", + "rateChanged": "Rate changed", + "resetSettings": "Reset settings?" + } + }, + "error": { + "message": { + "allowanceRequired": "Transfer amount for {{tokenSymbol}} exceeds your current allowance. Please increase your allowance and try again.", + "insufficientFunds": "You don't have enough gas to cover the cost of the transaction.", + "slippageThreshold": "The slippage is larger than the defined threshold. Please request a new route to get a fresh quote.", + "transactionFailed": "Please check the block explorer for more information.", + "transactionNotSent": "Transaction was not sent. {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}} remain in your wallet.", + "transactionRejected": "Your signature is required to complete the transaction. {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}} remain in your wallet.", + "unknown": "Please try again or contact support." + }, + "title": { + "allowanceRequired": "Insufficient allowance", + "balanceIsTooLow": "The balance is too low", + "chainSwitch": "Chain switch required", + "gasLimitIsTooLow": "The gas limit is too low", + "insufficientFunds": "Insufficient funds", + "slippageNotMet": "Slippage conditions not met", + "transactionCanceled": "Transaction canceled", + "transactionFailed": "Transaction failed", + "transactionRejected": "Signature required", + "transactionUnderpriced": "Transaction is underpriced", + "transactionUnprepared": "Unable to prepare transaction", + "unknown": "Something went wrong", + "walletAddressInvalid": "Wallet address is invalid.", + "walletAddressRequired": "Wallet address is required.", + "walletEnsAddressInvalid": "Wallet address is invalid or network doesn't support ENS." + } + }, + "tooltip": { + "additionalProviderFee": "Additional bridges, DEXs, and service fees.", + "estimatedNetworkFee": "Estimated network fee.", + "estimatedTime": "Estimated execution time in minutes.", + "notFound": { + "text": "We couldn't find this page.", + "title": "404" + }, + "numberOfSteps": "A number of exchange steps. Each step can contain 1-2 transactions that require a signature.", + "progressToNextUpdate": "Displayed data will auto-refresh after {{value}} seconds. Click here to update manually.", + "recommended": "A cheap route that balances complexity and ease of use.", + "settingsModified": "Settings (modified)" }, "main": { "crossStepDetails": "Bridge from {{from}} to {{to}} via {{tool}}", @@ -157,103 +235,24 @@ "valueLoss": "Value loss", "walletAddressOrEns": "Wallet address or ENS name" }, - "error": { - "message": { - "allowanceRequired": "Transfer amount for {{tokenSymbol}} exceeds your current allowance. Please increase your allowance and try again.", - "insufficientFunds": "You don't have enough gas to cover the cost of the transaction.", - "slippageThreshold": "The slippage is larger than the defined threshold. Please request a new route to get a fresh quote.", - "transactionFailed": "Please check the block explorer for more information.", - "transactionNotSent": "Transaction was not sent. {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}} remain in your wallet.", - "transactionRejected": "Your signature is required to complete the transaction. {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}} remain in your wallet.", - "unknown": "Please try again or contact support." - }, - "title": { - "allowanceRequired": "Insufficient allowance", - "balanceIsTooLow": "The balance is too low", - "chainSwitch": "Chain switch required", - "gasLimitIsTooLow": "The gas limit is too low", - "insufficientFunds": "Insufficient funds", - "slippageNotMet": "Slippage conditions not met", - "transactionCanceled": "Transaction canceled", - "transactionFailed": "Transaction failed", - "transactionRejected": "Signature required", - "transactionUnderpriced": "Transaction is underpriced", - "transactionUnprepared": "Unable to prepare transaction", - "unknown": "Something went wrong", - "walletAddressInvalid": "Wallet address is invalid.", - "walletAddressRequired": "Wallet address is required.", - "walletEnsAddressInvalid": "Wallet address is invalid or network doesn't support ENS." - } - }, "insurance": { "bridgeExploits": "Bridge malfunctions, hacks or exploits", "insure": "Insure {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in transit.", "insured": "You've insured {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in transit:", "slippageError": "Error in slippage for tokens received" }, - "info": { - "message": { - "autoRefuel": "You're low on {{chainName}} gas. By continuing, you'll get enough gas to complete the transaction.", - "emptyActiveTransactions": "Transactions in progress will appear here. Once completed, find them in transaction history.", - "emptyTokenList": "We couldn't find tokens on {{chainName}} chain or you don't have any. Please try search again or choose another chain.", - "emptyTransactionHistory": "Transaction history is only stored locally and will be deleted if you clear your browser data.", - "routeNotFound": "Try another token combination." - }, - "title": { - "autoRefuel": "Get gas", - "emptyActiveTransactions": "No active transactions", - "emptyTransactionHistory": "No recent transactions", - "routeNotFound": "No routes available" - } - }, - "success": { - "message": { - "exchangePartiallySuccessful": "We've tried to complete the transaction, but {{tool}} ran out of liquidity for {{tokenSymbol}} token.", - "exchangeSuccessful": "There are now {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in {{walletAddress}} wallet on {{chainName}} chain.", - "purchaseSuccessful": "You now own {{assetName}} in {{walletAddress}} wallet on {{chainName}} chain." - }, - "title": { - "bridgePartiallySuccessful": "Bridge partially successful", - "bridgeSuccessful": "Bridge successful", - "gasBridgeSuccessful": "Gas bridge successful", - "purchaseSuccessful": "Purchase successful", - "refundIssued": "Refund issued", - "swapPartiallySuccessful": "Swap partially successful", - "swapSuccessful": "Swap successful" - } - }, - "warning": { - "message": { - "deleteActiveTransactions": "Active transactions are only stored locally and can't be recovered if you delete them.", - "deleteTransactionHistory": "Transaction history is only stored locally and can't be recovered if you delete it.", - "highValueLoss": "The value of the received tokens is significantly lower than the exchanged tokens and transaction cost.", - "insufficientFunds": "You don't have enough funds to complete the transaction.", - "insufficientGas": "You don't have enough gas to complete the transaction. You need to add at least:", - "rateChanged": "The exchange rate has changed. By continuing the transaction, you'll accept the new rate.", - "resetSettings": "This will reset your route priority, slippage, gas price, enabled bridges and exchanges." - }, - "title": { - "deleteActiveTransactions": "Delete all active transactions?", - "deleteTransaction": "Delete this transaction?", - "deleteTransactionHistory": "Delete transaction history?", - "highValueLoss": "High value loss", - "insufficientGas": "Insufficient gas", - "rateChanged": "Rate changed", - "resetSettings": "Reset settings?" - } - }, - "tooltip": { - "additionalProviderFee": "Additional bridges, DEXs, and service fees.", - "estimatedNetworkFee": "Estimated network fee.", - "estimatedTime": "Estimated execution time in minutes.", - "notFound": { - "text": "We couldn't find this page.", - "title": "404" + "settings": { + "enabledBridges": "Enabled bridges", + "enabledExchanges": "Enabled exchanges", + "gasPrice": { + "fast": "Fast", + "normal": "Normal", + "slow": "Slow", + "title": "Gas price" }, - "numberOfSteps": "A number of exchange steps. Each step can contain 1-2 transactions that require a signature.", - "progressToNextUpdate": "Displayed data will auto-refresh after {{value}} seconds. Click here to update manually.", - "recommended": "A cheap route that balances complexity and ease of use.", - "settingsModified": "Settings (modified)" + "routePriority": "Route priority", + "showDestinationWallet": "Show destination wallet", + "slippage": "Slippage" }, "wallet": { "extensionNotFound": "Please make sure that only the {{name}} browser extension is active before choosing this wallet." From a4bffa31cbd2e247048ebccb787c1065471d72e4 Mon Sep 17 00:00:00 2001 From: Eugene Chybisov Date: Thu, 8 Jun 2023 15:55:20 +0200 Subject: [PATCH 03/13] chore: remove unnecessary configs --- packages/widget-embedded/src/config.ts | 53 +------------------------- 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/packages/widget-embedded/src/config.ts b/packages/widget-embedded/src/config.ts index 34ac855ed..ac73bf37f 100644 --- a/packages/widget-embedded/src/config.ts +++ b/packages/widget-embedded/src/config.ts @@ -9,73 +9,22 @@ export const WidgetVariants = [ ] as const; export const widgetBaseConfig: WidgetConfig = { - // fromChain: 137, - // toChain: 10, - // fromToken: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174', - // toToken: '0x7f5c764cbc14f9669b88837ca1490cca17c31607', // 0x0000000000000000000000000000000000000000 - // fromAmount: '20', - // toAddress: '0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0', - variant: 'nft', integrator: 'li.fi-playground', hiddenUI: ['history'], - chains: { - allow: [], // 1, 1285, 10, 56, 137 - deny: [], - }, - // useRecommendedRoute: true, buildSwapUrl: true, - // disabledUI: ['toAddress', 'fromAmount', 'toToken', 'fromToken'], sdkConfig: { // apiUrl: 'https://staging.li.quest/v1/', defaultRouteOptions: { - // slippage: 0.03, - // order: 'SAFEST', - // allowSwitchChain: false, - // fee: 0.05 + // maxPriceImpact: 0.4, }, }, - // theme: { - // palette: { - // background: { - // paper: '#121212', - // }, - // }, - // }, - bridges: { - // allow: ['stargate'], - // deny: ['connext'], - }, - languages: { - // allow: ['uk'], - // deny: ['uk'], - }, - // languageResources: { - // en: { - // button: { swap: 'Test' }, - // }, - // es, - // }, }; export const widgetConfig: WidgetConfig = { ...widgetBaseConfig, containerStyle: { - // border: `1px solid ${ - // window.matchMedia('(prefers-color-scheme: dark)').matches - // ? 'rgb(66, 66, 66)' - // : 'rgb(234, 234, 234)' - // }`, boxShadow: '0px 8px 32px rgba(0, 0, 0, 0.08)', borderRadius: '16px', }, - // theme: { - // components: { - // MuiAvatar: { - // defaultProps: { - // imgProps: { crossOrigin: 'anonymous' }, - // }, - // }, - // }, - // }, }; From 1cb952cc8c3051bfd94d10f9a6f47bb1d1d4d29f Mon Sep 17 00:00:00 2001 From: Eugene Chybisov Date: Fri, 9 Jun 2023 13:18:08 +0200 Subject: [PATCH 04/13] fix: use subvariant split state for button text --- packages/widget/src/components/SwapButton/SwapButton.tsx | 7 ++++++- packages/widget/src/i18n/en.json | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/widget/src/components/SwapButton/SwapButton.tsx b/packages/widget/src/components/SwapButton/SwapButton.tsx index 885e3c05d..02033f1cf 100644 --- a/packages/widget/src/components/SwapButton/SwapButton.tsx +++ b/packages/widget/src/components/SwapButton/SwapButton.tsx @@ -2,6 +2,7 @@ import { LoadingButton } from '@mui/lab'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import { useWallet, useWidgetConfig } from '../../providers'; +import { useSplitSubvariantStore } from '../../stores'; import { navigationRoutes } from '../../utils'; import type { SwapButtonProps } from './types'; @@ -14,8 +15,9 @@ export const SwapButton: React.FC = ({ }) => { const { t } = useTranslation(); const navigate = useNavigate(); - const { variant, walletManagement } = useWidgetConfig(); + const { variant, subvariant, walletManagement } = useWidgetConfig(); const { account, connect } = useWallet(); + const splitState = useSplitSubvariantStore((state) => state.state); const handleSwapButtonClick = async () => { if (!account.isActive) { @@ -38,6 +40,9 @@ export const SwapButton: React.FC = ({ case 'refuel': return t(`button.getGas`); default: + if (subvariant === 'split' && splitState) { + return t(`button.${splitState}`); + } return t(`button.exchange`); } } diff --git a/packages/widget/src/i18n/en.json b/packages/widget/src/i18n/en.json index e2dd49320..4481099ee 100644 --- a/packages/widget/src/i18n/en.json +++ b/packages/widget/src/i18n/en.json @@ -9,6 +9,7 @@ }, "button": { "auto": "Auto", + "bridge": "Bridge", "buy": "Buy", "buyNow": "Buy now", "cancel": "Cancel", @@ -38,6 +39,7 @@ "showAll": "Show all", "startBridging": "Start bridging", "startSwapping": "Start swapping", + "swap": "Swap", "tryAgain": "Try again", "viewCoverage": "View coverage", "viewOnExplorer": "View on explorer" From 84a9bae87b9273f1b03cb55f2534f75109859f3e Mon Sep 17 00:00:00 2001 From: Eugene Chybisov Date: Fri, 9 Jun 2023 13:35:34 +0200 Subject: [PATCH 05/13] fix: request additional route for insurance only when bridging --- .../widget/src/pages/SwapPage/SwapPage.tsx | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/widget/src/pages/SwapPage/SwapPage.tsx b/packages/widget/src/pages/SwapPage/SwapPage.tsx index b83d3e8e6..13559fa25 100644 --- a/packages/widget/src/pages/SwapPage/SwapPage.tsx +++ b/packages/widget/src/pages/SwapPage/SwapPage.tsx @@ -129,19 +129,18 @@ export const SwapPage: React.FC = () => { } }; - const SwapButton = - insurance && status === RouteExecutionStatus.Idle - ? StartIdleSwapButton - : StartSwapButton; - - const insuranceAvailable = + const insuredRoute = route.insurance?.state === 'INSURED'; + const insurableRoute = insurance && variant !== 'refuel' && - (route.insurance?.state === 'INSURED' || - (status === RouteExecutionStatus.Idle && - route.insurance?.state === 'INSURABLE')); + status === RouteExecutionStatus.Idle && + route.insurance?.state === 'INSURABLE'; + + const insuranceAvailable = insuredRoute || insurableRoute; + + const SwapButton = insurableRoute ? StartIdleSwapButton : StartSwapButton; - const insuranceCoverageId = + const getInsuranceCoverageId = () => route.steps[0].execution?.process .filter((process) => process.type !== 'TOKEN_ALLOWANCE') .find((process) => process.txHash)?.txHash ?? route.fromAddress; @@ -161,7 +160,7 @@ export const SwapPage: React.FC = () => { route.toToken.decimals, )} insuredTokenSymbol={route.toToken.symbol} - insuranceCoverageId={insuranceCoverageId} + insuranceCoverageId={getInsuranceCoverageId()} onChange={setRouteId} /> ) : null} @@ -175,7 +174,6 @@ export const SwapPage: React.FC = () => { onClick={handleSwapClick} route={route} insurableRouteId={stateRouteId} - // disabled={status === 'idle' && (isValidating || !isValid)} /> {status === RouteExecutionStatus.Failed ? ( Date: Fri, 9 Jun 2023 13:36:07 +0200 Subject: [PATCH 06/13] fix: make button gray in loading state --- packages/widget/src/config/theme.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/widget/src/config/theme.ts b/packages/widget/src/config/theme.ts index b40444a18..b79e79e45 100644 --- a/packages/widget/src/config/theme.ts +++ b/packages/widget/src/config/theme.ts @@ -215,13 +215,16 @@ export const createTheme = (mode: PaletteMode, theme: ThemeConfig = {}) => { pointerEvents: 'auto', }, [`&.${loadingButtonClasses.loading}.Mui-disabled`]: { - backgroundColor: primaryMainColor, - color: contrastButtonColor, - cursor: 'auto', - pointerEvents: 'auto', + color: + mode === 'light' + ? alpha(common.black, 0.56) + : alpha(common.white, 0.56), }, [`.${loadingButtonClasses.loadingIndicator}`]: { - color: contrastButtonColor, + color: + mode === 'light' + ? alpha(common.black, 0.56) + : alpha(common.white, 0.56), }, [`&.${loadingButtonClasses.root}.${loadingButtonClasses.loading}`]: { From 398e70b67bbef8add9c9e0a56db4afbfd4658400 Mon Sep 17 00:00:00 2001 From: Eugene Chybisov Date: Fri, 9 Jun 2023 13:36:30 +0200 Subject: [PATCH 07/13] fix: don't disable button when refreshing routes --- packages/widget/src/pages/MainPage/MainSwapButton.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/widget/src/pages/MainPage/MainSwapButton.tsx b/packages/widget/src/pages/MainPage/MainSwapButton.tsx index ba5d1cfb5..fafbd6051 100644 --- a/packages/widget/src/pages/MainPage/MainSwapButton.tsx +++ b/packages/widget/src/pages/MainPage/MainSwapButton.tsx @@ -10,7 +10,7 @@ export const MainSwapButton: React.FC = () => { const { isValid, isValidating } = useFormState(); const setExecutableRoute = useSetExecutableRoute(); - const { routes: swapRoutes, isLoading, isFetching } = useSwapRoutes(); + const { routes: swapRoutes } = useSwapRoutes(); const currentRoute = swapRoutes?.[0]; @@ -27,9 +27,7 @@ export const MainSwapButton: React.FC = () => { ); }; From dcd8993a574a34cf45e0354190ebacfc5a6f8af0 Mon Sep 17 00:00:00 2001 From: Eugene Chybisov Date: Fri, 9 Jun 2023 15:18:39 +0200 Subject: [PATCH 08/13] chore: bump packages --- lerna.json | 16 +- package.json | 8 +- packages/widget-embedded/package.json | 6 +- packages/widget-playground/package.json | 2 +- packages/widget/package.json | 6 +- tsconfig.json | 12 +- yarn.lock | 1600 +++++++---------------- 7 files changed, 485 insertions(+), 1165 deletions(-) diff --git a/lerna.json b/lerna.json index 74ad67f81..0a8d98202 100644 --- a/lerna.json +++ b/lerna.json @@ -1,19 +1,13 @@ { "npmClient": "yarn", - "packages": [ - "packages/*" - ], - "ignoreChanges": [ - "**/*.md" - ], + "packages": ["packages/*"], + "ignoreChanges": ["**/*.md"], "command": { "version": { - "ignore": [ - "**/*.md" - ] + "ignoreChanges": ["**/*.md"] } }, "changelogPreset": "conventionalcommits", - "useWorkspaces": true, - "version": "independent" + "version": "independent", + "$schema": "node_modules/lerna/schemas/lerna-schema.json" } diff --git a/package.json b/package.json index e30857aa6..01eca1384 100644 --- a/package.json +++ b/package.json @@ -27,12 +27,12 @@ "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.4.3", "@types/big.js": "^6.1.6", - "@types/eslint": "^8.40.0", + "@types/eslint": "^8.40.1", "@types/events": "^3.0.0", "@types/node": "^20.2.5", - "@types/react": "^18.2.8", + "@types/react": "^18.2.9", "@types/react-dom": "^18.2.4", - "@types/uuid": "^9.0.1", + "@types/uuid": "^9.0.2", "@typescript-eslint/eslint-plugin": "^5.59.9", "@typescript-eslint/parser": "^5.59.9", "cpy-cli": "^4.2.0", @@ -45,7 +45,7 @@ "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", - "lerna": "^6.6.2", + "lerna": "^7.0.0", "prettier": "^2.8.8", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/packages/widget-embedded/package.json b/packages/widget-embedded/package.json index 2a9c84f54..ee9456a49 100644 --- a/packages/widget-embedded/package.json +++ b/packages/widget-embedded/package.json @@ -30,14 +30,14 @@ "@mui/icons-material": "^5.11.16", "@mui/lab": "^5.0.0-alpha.133", "@mui/material": "^5.13.4", - "@opensea/seaport-js": "2.0.2", + "@opensea/seaport-js": "2.0.3", "@tanstack/react-query": "^4.29.12", "bignumber.js": "^9.1.1", "ethers": "^5.7.2", "events": "^3.3.0", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.11.2", + "react-router-dom": "^6.12.1", "web3": "^1.10.0" }, "devDependencies": { @@ -45,7 +45,7 @@ "@vitejs/plugin-react": "^4.0.0", "buffer": "^6.0.3", "esbuild": "^0.17.19", - "rollup": "^3.23.1", + "rollup": "^3.24.0", "rollup-plugin-polyfill-node": "^0.12.0", "typescript": "^5.1.3", "vite": "^4.3.9", diff --git a/packages/widget-playground/package.json b/packages/widget-playground/package.json index 486df9206..34e71c56e 100644 --- a/packages/widget-playground/package.json +++ b/packages/widget-playground/package.json @@ -33,7 +33,7 @@ "events": "^3.3.0", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.11.2" + "react-router-dom": "^6.12.1" }, "devDependencies": { "@esbuild-plugins/node-globals-polyfill": "^0.2.3", diff --git a/packages/widget/package.json b/packages/widget/package.json index 217a9b46c..4a1a99083 100644 --- a/packages/widget/package.json +++ b/packages/widget/package.json @@ -47,7 +47,7 @@ "lifi" ], "dependencies": { - "@emotion/react": "^11.11.0", + "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@ethersproject/abstract-signer": "^5.7.0", "@ethersproject/address": "^5.7.0", @@ -61,7 +61,7 @@ "@tanstack/react-query": "^4.29.12", "@tanstack/react-virtual": "^3.0.0-beta.54", "big.js": "^6.2.1", - "i18next": "^22.5.0", + "i18next": "^22.5.1", "i18next-browser-languagedetector": "^7.0.2", "microdiff": "^1.3.2", "mitt": "^3.0.0", @@ -70,7 +70,7 @@ "react-hook-form": "^7.44.3", "react-i18next": "^12.3.1", "react-intersection-observer": "^9.4.4", - "react-router-dom": "^6.11.2", + "react-router-dom": "^6.12.1", "react-timer-hook": "^3.0.6", "uuid": "^9.0.0", "zustand": "^4.3.8" diff --git a/tsconfig.json b/tsconfig.json index ef90ea298..9d744e427 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,17 +18,11 @@ "composite": true, "baseUrl": "./", "paths": { - "@lifi/widget": ["./packages/widget/src"], - "@lifi/widget/*": ["./packages/widget/src/*"], "@lifi/wallet-management": ["./packages/wallet-management/src"], "@lifi/wallet-management/*": ["./packages/wallet-management/src/*"], + "@lifi/widget": ["./packages/widget/src"], + "@lifi/widget/*": ["./packages/widget/src/*"] } }, - "exclude": [ - "**/.*/", - "**/build", - "**/dist", - "node_modules", - ".yarn" - ] + "exclude": ["**/.*/", "**/build", "**/dist", "node_modules", ".yarn"] } diff --git a/yarn.lock b/yarn.lock index 3f2377bd8..ec1fcbd8e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1881,9 +1881,9 @@ __metadata: languageName: node linkType: hard -"@emotion/react@npm:^11.11.0": - version: 11.11.0 - resolution: "@emotion/react@npm:11.11.0" +"@emotion/react@npm:^11.11.1": + version: 11.11.1 + resolution: "@emotion/react@npm:11.11.1" dependencies: "@babel/runtime": ^7.18.3 "@emotion/babel-plugin": ^11.11.0 @@ -1898,7 +1898,7 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 2653e7c3de7b6fd5b0e18dea15621a9886104cc7c8cd5522ca69e52bd547ef6f13644193f8e0a906eea1e29a4f1d8167cdfa4667572fb7fafe0c62ab30fbaab6 + checksum: aec3c36650f5f0d3d4445ff44d73dd88712b1609645b6af3e6d08049cfbc51f1785fe13dea1a1d4ab1b0800d68f2339ab11e459687180362b1ef98863155aae5 languageName: node linkType: hard @@ -2673,13 +2673,6 @@ __metadata: languageName: node linkType: hard -"@isaacs/string-locale-compare@npm:^1.1.0": - version: 1.1.0 - resolution: "@isaacs/string-locale-compare@npm:1.1.0" - checksum: 7287da5d11497b82c542d3c2abe534808015be4f4883e71c26853277b5456f6bbe4108535db847a29f385ad6dc9318ffb0f55ee79bb5f39993233d7dccf8751d - languageName: node - linkType: hard - "@jest/expect-utils@npm:^29.5.0": version: 29.5.0 resolution: "@jest/expect-utils@npm:29.5.0" @@ -2792,105 +2785,35 @@ __metadata: languageName: node linkType: hard -"@lerna/child-process@npm:6.6.2": - version: 6.6.2 - resolution: "@lerna/child-process@npm:6.6.2" +"@lerna/child-process@npm:7.0.0": + version: 7.0.0 + resolution: "@lerna/child-process@npm:7.0.0" dependencies: chalk: ^4.1.0 execa: ^5.0.0 strong-log-transformer: ^2.1.0 - checksum: f6c001043b2ab2756b56fca1bbac8b2e61ce8235c660d849e8abaf123fb0ac64cd4c8e0a01eef309850ab638a3903bf6c6910fbfbe3ce93d1cd4070a07269ab0 + checksum: b31e2ba363b6312ffd440f3332eb07ec304cfbe58b0fb55947b34669b80a3a27102db00d1bf4bdf9ab0ce5d0e83a424392629c83145596c16a59a5cbacbcfc1b languageName: node linkType: hard -"@lerna/create@npm:6.6.2": - version: 6.6.2 - resolution: "@lerna/create@npm:6.6.2" +"@lerna/create@npm:7.0.0": + version: 7.0.0 + resolution: "@lerna/create@npm:7.0.0" dependencies: - "@lerna/child-process": 6.6.2 - dedent: ^0.7.0 - fs-extra: ^9.1.0 - init-package-json: ^3.0.2 + "@lerna/child-process": 7.0.0 + dedent: 0.7.0 + fs-extra: ^11.1.1 + init-package-json: 5.0.0 npm-package-arg: 8.1.1 p-reduce: ^2.1.0 - pacote: 15.1.1 - pify: ^5.0.0 + pacote: ^15.2.0 + pify: 5.0.0 semver: ^7.3.4 slash: ^3.0.0 validate-npm-package-license: ^3.0.4 - validate-npm-package-name: ^4.0.0 + validate-npm-package-name: 5.0.0 yargs-parser: 20.2.4 - checksum: 83ff84bb27b2f244986c7c1e0d5c2258eb91da1dc2fb2e998d4b0e47373e1caef130888da19f33645199b5a04b9ba48a9eedba444998060b74f36949a674df62 - languageName: node - linkType: hard - -"@lerna/legacy-package-management@npm:6.6.2": - version: 6.6.2 - resolution: "@lerna/legacy-package-management@npm:6.6.2" - dependencies: - "@npmcli/arborist": 6.2.3 - "@npmcli/run-script": 4.1.7 - "@nrwl/devkit": ">=15.5.2 < 16" - "@octokit/rest": 19.0.3 - byte-size: 7.0.0 - chalk: 4.1.0 - clone-deep: 4.0.1 - cmd-shim: 5.0.0 - columnify: 1.6.0 - config-chain: 1.1.12 - conventional-changelog-core: 4.2.4 - conventional-recommended-bump: 6.1.0 - cosmiconfig: 7.0.0 - dedent: 0.7.0 - dot-prop: 6.0.1 - execa: 5.0.0 - file-url: 3.0.0 - find-up: 5.0.0 - fs-extra: 9.1.0 - get-port: 5.1.1 - get-stream: 6.0.0 - git-url-parse: 13.1.0 - glob-parent: 5.1.2 - globby: 11.1.0 - graceful-fs: 4.2.10 - has-unicode: 2.0.1 - inquirer: 8.2.4 - is-ci: 2.0.0 - is-stream: 2.0.0 - libnpmpublish: 7.1.4 - load-json-file: 6.2.0 - make-dir: 3.1.0 - minimatch: 3.0.5 - multimatch: 5.0.0 - node-fetch: 2.6.7 - npm-package-arg: 8.1.1 - npm-packlist: 5.1.1 - npm-registry-fetch: 14.0.3 - npmlog: 6.0.2 - p-map: 4.0.0 - p-map-series: 2.1.0 - p-queue: 6.6.2 - p-waterfall: 2.1.1 - pacote: 15.1.1 - pify: 5.0.0 - pretty-format: 29.4.3 - read-cmd-shim: 3.0.0 - read-package-json: 5.0.1 - resolve-from: 5.0.0 - semver: 7.3.8 - signal-exit: 3.0.7 - slash: 3.0.0 - ssri: 9.0.1 - strong-log-transformer: 2.1.0 - tar: 6.1.11 - temp-dir: 1.0.0 - tempy: 1.0.0 - upath: 2.0.1 - uuid: 8.3.2 - write-file-atomic: 4.0.1 - write-pkg: 4.0.0 - yargs: 16.2.0 - checksum: e5f8cf3a68b6b98c2a2546dec81927b99d1f58200892597943254ec2b5b027036ace7998c787662e95835e1c7d2b1f196204e1e62930362e06b04bb4b1045f4a + checksum: 9f0bddf5a359cfb799d4b2020cb585dd80f4a5a3e50167967a8b11bc541c7ef52021c34f71b3bb1c1a353dcd897ea93a4ad0a5188c9ec227829fe28efa89b600 languageName: node linkType: hard @@ -2947,7 +2870,7 @@ __metadata: "@mui/icons-material": ^5.11.16 "@mui/lab": ^5.0.0-alpha.133 "@mui/material": ^5.13.4 - "@opensea/seaport-js": 2.0.2 + "@opensea/seaport-js": 2.0.3 "@tanstack/react-query": ^4.29.12 "@vitejs/plugin-react": ^4.0.0 bignumber.js: ^9.1.1 @@ -2957,8 +2880,8 @@ __metadata: events: ^3.3.0 react: ^18.2.0 react-dom: ^18.2.0 - react-router-dom: ^6.11.2 - rollup: ^3.23.1 + react-router-dom: ^6.12.1 + rollup: ^3.24.0 rollup-plugin-polyfill-node: ^0.12.0 typescript: ^5.1.3 vite: ^4.3.9 @@ -2983,7 +2906,7 @@ __metadata: events: ^3.3.0 react: ^18.2.0 react-dom: ^18.2.0 - react-router-dom: ^6.11.2 + react-router-dom: ^6.12.1 rollup-plugin-polyfill-node: ^0.12.0 typescript: ^5.1.3 vite: ^4.3.9 @@ -2995,7 +2918,7 @@ __metadata: version: 0.0.0-use.local resolution: "@lifi/widget@workspace:packages/widget" dependencies: - "@emotion/react": ^11.11.0 + "@emotion/react": ^11.11.1 "@emotion/styled": ^11.11.0 "@ethersproject/abstract-signer": ^5.7.0 "@ethersproject/address": ^5.7.0 @@ -3010,7 +2933,7 @@ __metadata: "@tanstack/react-virtual": ^3.0.0-beta.54 big.js: ^6.2.1 cpy-cli: ^4.2.0 - i18next: ^22.5.0 + i18next: ^22.5.1 i18next-browser-languagedetector: ^7.0.2 microdiff: ^1.3.2 mitt: ^3.0.0 @@ -3019,7 +2942,7 @@ __metadata: react-hook-form: ^7.44.3 react-i18next: ^12.3.1 react-intersection-observer: ^9.4.4 - react-router-dom: ^6.11.2 + react-router-dom: ^6.12.1 react-timer-hook: ^3.0.6 typescript: ^5.1.3 uuid: ^9.0.0 @@ -3307,49 +3230,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/arborist@npm:6.2.3": - version: 6.2.3 - resolution: "@npmcli/arborist@npm:6.2.3" - dependencies: - "@isaacs/string-locale-compare": ^1.1.0 - "@npmcli/fs": ^3.1.0 - "@npmcli/installed-package-contents": ^2.0.0 - "@npmcli/map-workspaces": ^3.0.2 - "@npmcli/metavuln-calculator": ^5.0.0 - "@npmcli/name-from-folder": ^2.0.0 - "@npmcli/node-gyp": ^3.0.0 - "@npmcli/package-json": ^3.0.0 - "@npmcli/query": ^3.0.0 - "@npmcli/run-script": ^6.0.0 - bin-links: ^4.0.1 - cacache: ^17.0.4 - common-ancestor-path: ^1.0.1 - hosted-git-info: ^6.1.1 - json-parse-even-better-errors: ^3.0.0 - json-stringify-nice: ^1.1.4 - minimatch: ^6.1.6 - nopt: ^7.0.0 - npm-install-checks: ^6.0.0 - npm-package-arg: ^10.1.0 - npm-pick-manifest: ^8.0.1 - npm-registry-fetch: ^14.0.3 - npmlog: ^7.0.1 - pacote: ^15.0.8 - parse-conflict-json: ^3.0.0 - proc-log: ^3.0.0 - promise-all-reject-late: ^1.0.0 - promise-call-limit: ^1.0.1 - read-package-json-fast: ^3.0.2 - semver: ^7.3.7 - ssri: ^10.0.1 - treeverse: ^3.0.0 - walk-up-path: ^1.0.0 - bin: - arborist: bin/index.js - checksum: f52261745fdcdb95813ec47d0fbe375e6448f3d62f805601a7afe447540f3ffb741834a1c2275707c17a4322e723915c1bb8abb3400dd3a3476ab281b64954bc - languageName: node - linkType: hard - "@npmcli/fs@npm:^2.1.0": version: 2.1.2 resolution: "@npmcli/fs@npm:2.1.2" @@ -3385,7 +3265,7 @@ __metadata: languageName: node linkType: hard -"@npmcli/installed-package-contents@npm:^2.0.0, @npmcli/installed-package-contents@npm:^2.0.1": +"@npmcli/installed-package-contents@npm:^2.0.1": version: 2.0.2 resolution: "@npmcli/installed-package-contents@npm:2.0.2" dependencies: @@ -3397,30 +3277,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/map-workspaces@npm:^3.0.2": - version: 3.0.4 - resolution: "@npmcli/map-workspaces@npm:3.0.4" - dependencies: - "@npmcli/name-from-folder": ^2.0.0 - glob: ^10.2.2 - minimatch: ^9.0.0 - read-package-json-fast: ^3.0.0 - checksum: 99607dbc502b16d0ce7a47a81ccc496b3f5ed10df4e61e61a505929de12c356092996044174ae0cfd6d8cc177ef3b597eef4987b674fc0c5a306d3a8cc1fe91a - languageName: node - linkType: hard - -"@npmcli/metavuln-calculator@npm:^5.0.0": - version: 5.0.1 - resolution: "@npmcli/metavuln-calculator@npm:5.0.1" - dependencies: - cacache: ^17.0.0 - json-parse-even-better-errors: ^3.0.0 - pacote: ^15.0.0 - semver: ^7.3.5 - checksum: cd08ad9cc4ede499b0be1e22104ee48e207d4e00e8f64ac610945879f41be720b7514a5247af395b61eda8e4461c6e7ef37e2d970b555e20c25ef4f21b515b92 - languageName: node - linkType: hard - "@npmcli/move-file@npm:^2.0.0": version: 2.0.1 resolution: "@npmcli/move-file@npm:2.0.1" @@ -3431,20 +3287,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/name-from-folder@npm:^2.0.0": - version: 2.0.0 - resolution: "@npmcli/name-from-folder@npm:2.0.0" - checksum: fb3ef891aa57315fb6171866847f298577c8bda98a028e93e458048477133e142b4eb45ce9f3b80454f7c257612cb01754ee782d608507698dd712164436f5bd - languageName: node - linkType: hard - -"@npmcli/node-gyp@npm:^2.0.0": - version: 2.0.0 - resolution: "@npmcli/node-gyp@npm:2.0.0" - checksum: b6bbf0015000f9b64d31aefdc30f244b0348c57adb64017667e0304e96c38644d83da46a4581252652f5d606268df49118f9c9993b41d8020f62b7b15dd2c8d8 - languageName: node - linkType: hard - "@npmcli/node-gyp@npm:^3.0.0": version: 3.0.0 resolution: "@npmcli/node-gyp@npm:3.0.0" @@ -3452,27 +3294,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/package-json@npm:^3.0.0": - version: 3.1.0 - resolution: "@npmcli/package-json@npm:3.1.0" - dependencies: - glob: ^10.2.2 - json-parse-even-better-errors: ^3.0.0 - normalize-package-data: ^5.0.0 - npm-normalize-package-bin: ^3.0.1 - checksum: bcc3a464c681c48b43d245464e9c49aefd5686b3bce164fcd34e2271590c0bbb64e43342552d8302115295d47f9f00d996b65e724bdc092d3760ad27172cda20 - languageName: node - linkType: hard - -"@npmcli/promise-spawn@npm:^3.0.0": - version: 3.0.0 - resolution: "@npmcli/promise-spawn@npm:3.0.0" - dependencies: - infer-owner: ^1.0.4 - checksum: 3454465a2731cea5875ba51f80873e2205e5bd878c31517286b0ede4ea931c7bf3de895382287e906d03710fff6f9e44186bd0eee068ce578901c5d3b58e7692 - languageName: node - linkType: hard - "@npmcli/promise-spawn@npm:^6.0.0, @npmcli/promise-spawn@npm:^6.0.1": version: 6.0.2 resolution: "@npmcli/promise-spawn@npm:6.0.2" @@ -3482,29 +3303,7 @@ __metadata: languageName: node linkType: hard -"@npmcli/query@npm:^3.0.0": - version: 3.0.0 - resolution: "@npmcli/query@npm:3.0.0" - dependencies: - postcss-selector-parser: ^6.0.10 - checksum: 90fca7edd5f3e59e875dd8729e6c3aa174292e5b66caa0d7db85841cc5eeb414c7eb7d7637d30f638605d05e1238e718d09b8c1a251f43cfc21d9ac6835c7b39 - languageName: node - linkType: hard - -"@npmcli/run-script@npm:4.1.7": - version: 4.1.7 - resolution: "@npmcli/run-script@npm:4.1.7" - dependencies: - "@npmcli/node-gyp": ^2.0.0 - "@npmcli/promise-spawn": ^3.0.0 - node-gyp: ^9.0.0 - read-package-json-fast: ^2.0.3 - which: ^2.0.2 - checksum: 87c32b12fed981fe8a48de985dd1ae0350bcda2830ca4a35efe4b2b96932905cccd04e6e2de5bfea8ed4e2bf3b6f8315630ff9a09c72f80ff3c49f19a9fc80ff - languageName: node - linkType: hard - -"@npmcli/run-script@npm:^6.0.0": +"@npmcli/run-script@npm:6.0.2, @npmcli/run-script@npm:^6.0.0": version: 6.0.2 resolution: "@npmcli/run-script@npm:6.0.2" dependencies: @@ -3517,104 +3316,112 @@ __metadata: languageName: node linkType: hard -"@nrwl/cli@npm:15.9.4": - version: 15.9.4 - resolution: "@nrwl/cli@npm:15.9.4" +"@nrwl/devkit@npm:16.3.2": + version: 16.3.2 + resolution: "@nrwl/devkit@npm:16.3.2" + dependencies: + "@nx/devkit": 16.3.2 + checksum: df0e57f56e0ece702d947acdec5f2ff73fd6693f64c90eb63bbd36d4c594692adebd785c15e7c26023695fad421ba23c19f904ecba03c3cff800d4e6e6ecc3d1 + languageName: node + linkType: hard + +"@nrwl/tao@npm:16.3.2": + version: 16.3.2 + resolution: "@nrwl/tao@npm:16.3.2" dependencies: - nx: 15.9.4 - checksum: 039df998bbc56cc6d506a4c07500c97ce6662dff1ed0756d893d48398ffbfcfc9a1c274914011dbe331c0663b5c3e6de496ad6cdd05180ea0505fdcee19c67ff + nx: 16.3.2 + bin: + tao: index.js + checksum: 85f6c83170b0beccee7d86ae7cc3a09154d003be4fb9ab7b34f66044b71161d439766b6b19ef63424671780285476bad3375306c7e2af099d82c39d755997678 languageName: node linkType: hard -"@nrwl/devkit@npm:>=15.5.2 < 16": - version: 15.9.4 - resolution: "@nrwl/devkit@npm:15.9.4" +"@nx/devkit@npm:16.3.2, @nx/devkit@npm:>=16.1.3 < 17": + version: 16.3.2 + resolution: "@nx/devkit@npm:16.3.2" dependencies: + "@nrwl/devkit": 16.3.2 ejs: ^3.1.7 ignore: ^5.0.4 semver: 7.3.4 tmp: ~0.2.1 tslib: ^2.3.0 peerDependencies: - nx: ">= 14.1 <= 16" - checksum: 4207edab94384315bc80da673ae5c31bd63a8944c69ad1a2a2834d0e6f9ef5eb8a4118a1943ae855c6da889e326490cc4e5df718cb8df5853263e3b3c44d0148 + nx: ">= 15 <= 17" + checksum: 4062d383c814422565a436bdf676729e1cf787d43a3901c73d677a81d330f0019637c3116fe176f88e482dfc06fbc3784a1df27c4af20e6668514ee6733740b2 languageName: node linkType: hard -"@nrwl/nx-darwin-arm64@npm:15.9.4": - version: 15.9.4 - resolution: "@nrwl/nx-darwin-arm64@npm:15.9.4" +"@nx/nx-darwin-arm64@npm:16.3.2": + version: 16.3.2 + resolution: "@nx/nx-darwin-arm64@npm:16.3.2" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@nrwl/nx-darwin-x64@npm:15.9.4": - version: 15.9.4 - resolution: "@nrwl/nx-darwin-x64@npm:15.9.4" +"@nx/nx-darwin-x64@npm:16.3.2": + version: 16.3.2 + resolution: "@nx/nx-darwin-x64@npm:16.3.2" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@nrwl/nx-linux-arm-gnueabihf@npm:15.9.4": - version: 15.9.4 - resolution: "@nrwl/nx-linux-arm-gnueabihf@npm:15.9.4" +"@nx/nx-freebsd-x64@npm:16.3.2": + version: 16.3.2 + resolution: "@nx/nx-freebsd-x64@npm:16.3.2" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@nx/nx-linux-arm-gnueabihf@npm:16.3.2": + version: 16.3.2 + resolution: "@nx/nx-linux-arm-gnueabihf@npm:16.3.2" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@nrwl/nx-linux-arm64-gnu@npm:15.9.4": - version: 15.9.4 - resolution: "@nrwl/nx-linux-arm64-gnu@npm:15.9.4" +"@nx/nx-linux-arm64-gnu@npm:16.3.2": + version: 16.3.2 + resolution: "@nx/nx-linux-arm64-gnu@npm:16.3.2" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@nrwl/nx-linux-arm64-musl@npm:15.9.4": - version: 15.9.4 - resolution: "@nrwl/nx-linux-arm64-musl@npm:15.9.4" +"@nx/nx-linux-arm64-musl@npm:16.3.2": + version: 16.3.2 + resolution: "@nx/nx-linux-arm64-musl@npm:16.3.2" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@nrwl/nx-linux-x64-gnu@npm:15.9.4": - version: 15.9.4 - resolution: "@nrwl/nx-linux-x64-gnu@npm:15.9.4" +"@nx/nx-linux-x64-gnu@npm:16.3.2": + version: 16.3.2 + resolution: "@nx/nx-linux-x64-gnu@npm:16.3.2" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@nrwl/nx-linux-x64-musl@npm:15.9.4": - version: 15.9.4 - resolution: "@nrwl/nx-linux-x64-musl@npm:15.9.4" +"@nx/nx-linux-x64-musl@npm:16.3.2": + version: 16.3.2 + resolution: "@nx/nx-linux-x64-musl@npm:16.3.2" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@nrwl/nx-win32-arm64-msvc@npm:15.9.4": - version: 15.9.4 - resolution: "@nrwl/nx-win32-arm64-msvc@npm:15.9.4" +"@nx/nx-win32-arm64-msvc@npm:16.3.2": + version: 16.3.2 + resolution: "@nx/nx-win32-arm64-msvc@npm:16.3.2" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@nrwl/nx-win32-x64-msvc@npm:15.9.4": - version: 15.9.4 - resolution: "@nrwl/nx-win32-x64-msvc@npm:15.9.4" +"@nx/nx-win32-x64-msvc@npm:16.3.2": + version: 16.3.2 + resolution: "@nx/nx-win32-x64-msvc@npm:16.3.2" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@nrwl/tao@npm:15.9.4": - version: 15.9.4 - resolution: "@nrwl/tao@npm:15.9.4" - dependencies: - nx: 15.9.4 - bin: - tao: index.js - checksum: 03acf914b443fc5b0a93674dbdf9d770856d48adf8956819869aef6c5378ecb52e9696361e8c8799c639fd384f7ab5d109189d44251a8975901adcfe77fa0c9e - languageName: node - linkType: hard - "@octokit/auth-token@npm:^3.0.0": version: 3.0.3 resolution: "@octokit/auth-token@npm:3.0.3" @@ -3624,7 +3431,7 @@ __metadata: languageName: node linkType: hard -"@octokit/core@npm:^4.0.0": +"@octokit/core@npm:^4.2.1": version: 4.2.1 resolution: "@octokit/core@npm:4.2.1" dependencies: @@ -3661,20 +3468,6 @@ __metadata: languageName: node linkType: hard -"@octokit/openapi-types@npm:^12.11.0": - version: 12.11.0 - resolution: "@octokit/openapi-types@npm:12.11.0" - checksum: 8a7d4bd6288cc4085cabe0ca9af2b87c875c303af932cb138aa1b2290eb69d32407759ac23707bb02776466e671244a902e9857896903443a69aff4b6b2b0e3b - languageName: node - linkType: hard - -"@octokit/openapi-types@npm:^14.0.0": - version: 14.0.0 - resolution: "@octokit/openapi-types@npm:14.0.0" - checksum: 0a1f8f3be998cd82c5a640e9166d43fd183b33d5d36f5e1a9b81608e94d0da87c01ec46c9988f69cd26585d4e2ffc4d3ec99ee4f75e5fe997fc86dad0aa8293c - languageName: node - linkType: hard - "@octokit/openapi-types@npm:^17.2.0": version: 17.2.0 resolution: "@octokit/openapi-types@npm:17.2.0" @@ -3689,14 +3482,15 @@ __metadata: languageName: node linkType: hard -"@octokit/plugin-paginate-rest@npm:^3.0.0": - version: 3.1.0 - resolution: "@octokit/plugin-paginate-rest@npm:3.1.0" +"@octokit/plugin-paginate-rest@npm:^6.1.2": + version: 6.1.2 + resolution: "@octokit/plugin-paginate-rest@npm:6.1.2" dependencies: - "@octokit/types": ^6.41.0 + "@octokit/tsconfig": ^1.0.2 + "@octokit/types": ^9.2.3 peerDependencies: "@octokit/core": ">=4" - checksum: a09212a1c6e0be4a7929acd192659cb204fcb7c6a52cf7e7f1b87da0338d812c8c26e7ee44d00e8b9824d8904d6caaa978a84c26001ab982ffec5123600aa4d8 + checksum: a7b3e686c7cbd27ec07871cde6e0b1dc96337afbcef426bbe3067152a17b535abd480db1861ca28c88d93db5f7bfdbcadd0919ead19818c28a69d0e194038065 languageName: node linkType: hard @@ -3709,15 +3503,14 @@ __metadata: languageName: node linkType: hard -"@octokit/plugin-rest-endpoint-methods@npm:^6.0.0": - version: 6.8.1 - resolution: "@octokit/plugin-rest-endpoint-methods@npm:6.8.1" +"@octokit/plugin-rest-endpoint-methods@npm:^7.1.2": + version: 7.1.3 + resolution: "@octokit/plugin-rest-endpoint-methods@npm:7.1.3" dependencies: - "@octokit/types": ^8.1.1 - deprecation: ^2.3.1 + "@octokit/types": ^9.2.3 peerDependencies: "@octokit/core": ">=3" - checksum: 7ccefb3bd06089dbc6152a9555cf76f16a34673aa5512d5d353bc07434343eb97acd36ce91ef00707a5fdfa65f2fb03618071a5ef0df6c5e0bb077aea21b7b22 + checksum: ffe0981e2026b012aafad0630ca1d7b2d1d523ad790b75627e63368599f9886646b706a6dc6055454434cb2942d5b53bfc3ce7254036288dd8363c1705be2026 languageName: node linkType: hard @@ -3746,37 +3539,26 @@ __metadata: languageName: node linkType: hard -"@octokit/rest@npm:19.0.3": - version: 19.0.3 - resolution: "@octokit/rest@npm:19.0.3" +"@octokit/rest@npm:19.0.11": + version: 19.0.11 + resolution: "@octokit/rest@npm:19.0.11" dependencies: - "@octokit/core": ^4.0.0 - "@octokit/plugin-paginate-rest": ^3.0.0 + "@octokit/core": ^4.2.1 + "@octokit/plugin-paginate-rest": ^6.1.2 "@octokit/plugin-request-log": ^1.0.4 - "@octokit/plugin-rest-endpoint-methods": ^6.0.0 - checksum: 9ee96976c4c22dab11b3dacd541e694f3ad9bb1d44243985dc90ce6e8a42c3e3176a206e8d3a883b63b517fc15af8c8c88d8d0ecd9bac2b86a635a9667fc6ff4 - languageName: node - linkType: hard - -"@octokit/types@npm:^6.41.0": - version: 6.41.0 - resolution: "@octokit/types@npm:6.41.0" - dependencies: - "@octokit/openapi-types": ^12.11.0 - checksum: fd6f75e0b19b90d1a3d244d2b0c323ed8f2f05e474a281f60a321986683548ef2e0ec2b3a946aa9405d6092e055344455f69f58957c60f58368c8bdda5b7d2ab + "@octokit/plugin-rest-endpoint-methods": ^7.1.2 + checksum: 147518ad51d214ead88adc717b5fdc4f33317949d58c124f4069bdf07d2e6b49fa66861036b9e233aed71fcb88ff367a6da0357653484e466175ab4fb7183b3b languageName: node linkType: hard -"@octokit/types@npm:^8.1.1": - version: 8.2.1 - resolution: "@octokit/types@npm:8.2.1" - dependencies: - "@octokit/openapi-types": ^14.0.0 - checksum: 92f2fe5ea8c4c6ddbb2363c74cd865c64e5753eaa4895bc925b5064390890b1441c5406015d8a92285f386cc7e6fe714c47fe4beda370fcda9177153299c9e37 +"@octokit/tsconfig@npm:^1.0.2": + version: 1.0.2 + resolution: "@octokit/tsconfig@npm:1.0.2" + checksum: 74d56f3e9f326a8dd63700e9a51a7c75487180629c7a68bbafee97c612fbf57af8347369bfa6610b9268a3e8b833c19c1e4beb03f26db9a9dce31f6f7a19b5b1 languageName: node linkType: hard -"@octokit/types@npm:^9.0.0": +"@octokit/types@npm:^9.0.0, @octokit/types@npm:^9.2.3": version: 9.2.3 resolution: "@octokit/types@npm:9.2.3" dependencies: @@ -3785,14 +3567,14 @@ __metadata: languageName: node linkType: hard -"@opensea/seaport-js@npm:2.0.2": - version: 2.0.2 - resolution: "@opensea/seaport-js@npm:2.0.2" +"@opensea/seaport-js@npm:2.0.3": + version: 2.0.3 + resolution: "@opensea/seaport-js@npm:2.0.3" dependencies: "@0xsequence/multicall": ^0.43.29 ethers: ^5.7.2 merkletreejs: ^0.3.10 - checksum: a69abbb07517eca6e0db54ce0eadb0392dd86d1c9b2c807b8d0a05687efd5ea632756055a2fe3cb9216a8d16c6490641e56dcb87fbc27307e44c9c5f12c6957a + checksum: a6b47c2ebf30f17145b411e5a51494414c6ec439609366254af8a96ab87c727cee6d23a0df12465a9e645a774daec9882c8c67d2a5c70e9ac6eead5f8cec5cff languageName: node linkType: hard @@ -3828,10 +3610,10 @@ __metadata: languageName: node linkType: hard -"@remix-run/router@npm:1.6.2": - version: 1.6.2 - resolution: "@remix-run/router@npm:1.6.2" - checksum: 5969d313bff6ba5c75917910090cebafda84b9d3b4b453fae6b3d60fea9f938078578ffca769c532ab7ce252cd4a207b78d1024d7c727ab80dd572e62fd3b3f2 +"@remix-run/router@npm:1.6.3": + version: 1.6.3 + resolution: "@remix-run/router@npm:1.6.3" + checksum: f6968b1626af930b42f8cb5a044f05e4fbce05af6c7947beb1704e45c9570944e3be16ee008b185e5e13baac97948299eb55341b2a359c3e2e54b9d6646ae167 languageName: node linkType: hard @@ -4131,13 +3913,13 @@ __metadata: languageName: node linkType: hard -"@types/eslint@npm:^8.40.0": - version: 8.40.0 - resolution: "@types/eslint@npm:8.40.0" +"@types/eslint@npm:^8.40.1": + version: 8.40.1 + resolution: "@types/eslint@npm:8.40.1" dependencies: "@types/estree": "*" "@types/json-schema": "*" - checksum: bab41d7f590182e743853cdd5bf5359cbc4240df986223457c8a5f5674743a3fe2a8626704b65bf9121dfa0ce0a0efd760da8339cc329018f229d4d2d6ee1c43 + checksum: c210e4741f11d9fda0e06f4444a43f64af79ea72d60cd11ec4acc232374b34cbb49634286f949783d55d8a66b44fa0da041b6a90cfe37fcdf7f796b81776318b languageName: node linkType: hard @@ -4312,7 +4094,7 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:*, @types/react@npm:^18.2.8": +"@types/react@npm:*": version: 18.2.8 resolution: "@types/react@npm:18.2.8" dependencies: @@ -4323,6 +4105,17 @@ __metadata: languageName: node linkType: hard +"@types/react@npm:^18.2.9": + version: 18.2.9 + resolution: "@types/react@npm:18.2.9" + dependencies: + "@types/prop-types": "*" + "@types/scheduler": "*" + csstype: ^3.0.2 + checksum: f155256171a2d701eb962a1d3aa2a1c9ee36d9dd4a4aecb911d29e50717aab1a76914aef25242665147c455b9e8d081d1a60275d13ca81075c148ebd6607414a + languageName: node + linkType: hard + "@types/responselike@npm:^1.0.0": version: 1.0.0 resolution: "@types/responselike@npm:1.0.0" @@ -4371,10 +4164,10 @@ __metadata: languageName: node linkType: hard -"@types/uuid@npm:^9.0.1": - version: 9.0.1 - resolution: "@types/uuid@npm:9.0.1" - checksum: c472b8a77cbeded4bc529220b8611afa39bd64677f507838f8083d8aac8033b1f88cb9ddaa2f8589e0dcd2317291d0f6e1379f82d5ceebd6f74f3b4825288e00 +"@types/uuid@npm:^9.0.2": + version: 9.0.2 + resolution: "@types/uuid@npm:9.0.2" + checksum: 1754bcf3444e1e3aeadd6e774fc328eb53bc956665e2e8fb6ec127aa8e1f43d9a224c3d22a9a6233dca8dd81a12dc7fed4d84b8876dd5ec82d40f574f7ff8b68 languageName: node linkType: hard @@ -5005,22 +4798,6 @@ __metadata: languageName: node linkType: hard -"abbrev@npm:^2.0.0": - version: 2.0.0 - resolution: "abbrev@npm:2.0.0" - checksum: 0e994ad2aa6575f94670d8a2149afe94465de9cedaaaac364e7fb43a40c3691c980ff74899f682f4ca58fa96b4cbd7421a015d3a6defe43a442117d7821a2f36 - languageName: node - linkType: hard - -"abort-controller@npm:^3.0.0": - version: 3.0.0 - resolution: "abort-controller@npm:3.0.0" - dependencies: - event-target-shim: ^5.0.0 - checksum: 170bdba9b47b7e65906a28c8ce4f38a7a369d78e2271706f020849c1bfe0ee2067d4261df8bbb66eb84f79208fd5b710df759d64191db58cfba7ce8ef9c54b75 - languageName: node - linkType: hard - "abortcontroller-polyfill@npm:^1.7.3": version: 1.7.5 resolution: "abortcontroller-polyfill@npm:1.7.5" @@ -5216,7 +4993,7 @@ __metadata: languageName: node linkType: hard -"aproba@npm:^1.0.3 || ^2.0.0, aproba@npm:^2.0.0": +"aproba@npm:^1.0.3 || ^2.0.0": version: 2.0.0 resolution: "aproba@npm:2.0.0" checksum: 5615cadcfb45289eea63f8afd064ab656006361020e1735112e346593856f87435e02d8dcc7ff0d11928bc7d425f27bc7c2a84f6c0b35ab0ff659c814c138a24 @@ -5233,16 +5010,6 @@ __metadata: languageName: node linkType: hard -"are-we-there-yet@npm:^4.0.0": - version: 4.0.0 - resolution: "are-we-there-yet@npm:4.0.0" - dependencies: - delegates: ^1.0.0 - readable-stream: ^4.1.0 - checksum: 35d6a65ce9a0c53d8d8eeef8805528c483c5c3512f2050b32c07e61becc440c4ec8178d6ee6cedc1e5a81b819eb55d9c0a9fc7d9f862cae4c7dc30ec393f0a58 - languageName: node - linkType: hard - "argparse@npm:^1.0.7": version: 1.0.10 resolution: "argparse@npm:1.0.10" @@ -5455,13 +5222,6 @@ __metadata: languageName: node linkType: hard -"at-least-node@npm:^1.0.0": - version: 1.0.0 - resolution: "at-least-node@npm:1.0.0" - checksum: 463e2f8e43384f1afb54bc68485c436d7622acec08b6fad269b421cb1d29cebb5af751426793d0961ed243146fe4dc983402f6d5a51b720b277818dbf6f2e49e - languageName: node - linkType: hard - "available-typed-arrays@npm:^1.0.5": version: 1.0.5 resolution: "available-typed-arrays@npm:1.0.5" @@ -5676,18 +5436,6 @@ __metadata: languageName: node linkType: hard -"bin-links@npm:^4.0.1": - version: 4.0.1 - resolution: "bin-links@npm:4.0.1" - dependencies: - cmd-shim: ^6.0.0 - npm-normalize-package-bin: ^3.0.0 - read-cmd-shim: ^4.0.0 - write-file-atomic: ^5.0.0 - checksum: a806561750039bcd7d4234efe5c0b8b7ba0ea8495086740b0da6395abe311e2cdb75f8324787354193f652d2ac5ab038c4ca926ed7bcc6ce9bc2001607741104 - languageName: node - linkType: hard - "bind-decorator@npm:^1.0.11": version: 1.0.11 resolution: "bind-decorator@npm:1.0.11" @@ -5998,10 +5746,10 @@ __metadata: languageName: node linkType: hard -"byte-size@npm:7.0.0": - version: 7.0.0 - resolution: "byte-size@npm:7.0.0" - checksum: 6cdd45fb64ac3f80d5cbbc01df7974a4613b3e64bd792b6b8211c8669ca3d1f7efd9379ba24cebfc371ce3e890817dcdaf0bd7ed99571fe2de4b946e6c31a138 +"byte-size@npm:8.1.1": + version: 8.1.1 + resolution: "byte-size@npm:8.1.1" + checksum: 65f00881ffd3c2b282fe848ed954fa4ff8363eaa3f652102510668b90b3fad04d81889486ee1b641ee0d8c8b75cf32201f3b309e6b5fbb6cc869b48a91b62d3e languageName: node linkType: hard @@ -6038,7 +5786,7 @@ __metadata: languageName: node linkType: hard -"cacache@npm:^17.0.0, cacache@npm:^17.0.4": +"cacache@npm:^17.0.0": version: 17.1.3 resolution: "cacache@npm:17.1.3" dependencies: @@ -6226,13 +5974,6 @@ __metadata: languageName: node linkType: hard -"ci-info@npm:^2.0.0": - version: 2.0.0 - resolution: "ci-info@npm:2.0.0" - checksum: 3b374666a85ea3ca43fa49aa3a048d21c9b475c96eb13c133505d2324e7ae5efd6a454f41efe46a152269e9b6a00c9edbe63ec7fa1921957165aae16625acd67 - languageName: node - linkType: hard - "ci-info@npm:^3.2.0, ci-info@npm:^3.6.1": version: 3.8.0 resolution: "ci-info@npm:3.8.0" @@ -6390,16 +6131,7 @@ __metadata: languageName: node linkType: hard -"cmd-shim@npm:5.0.0": - version: 5.0.0 - resolution: "cmd-shim@npm:5.0.0" - dependencies: - mkdirp-infer-owner: ^2.0.0 - checksum: 83d2a46cdf4adbb38d3d3184364b2df0e4c001ac770f5ca94373825d7a48838b4cb8a59534ef48f02b0d556caa047728589ca65c640c17c0b417b3afb34acfbb - languageName: node - linkType: hard - -"cmd-shim@npm:^6.0.0": +"cmd-shim@npm:6.0.1": version: 6.0.1 resolution: "cmd-shim@npm:6.0.1" checksum: 359006b3a5bb4a0ff161a44ccc18fbba947db748ef0dd12273e476792e316a5edb0945d74bfa1e91cd88ce0511025fde87901eda092c479d83cfcd6734562683 @@ -6473,13 +6205,6 @@ __metadata: languageName: node linkType: hard -"common-ancestor-path@npm:^1.0.1": - version: 1.0.1 - resolution: "common-ancestor-path@npm:1.0.1" - checksum: 1d2e4186067083d8cc413f00fc2908225f04ae4e19417ded67faa6494fb313c4fcd5b28a52326d1a62b466e2b3a4325e92c31133c5fee628cdf8856b3a57c3d7 - languageName: node - linkType: hard - "compare-func@npm:^2.0.0": version: 2.0.0 resolution: "compare-func@npm:2.0.0" @@ -6509,16 +6234,6 @@ __metadata: languageName: node linkType: hard -"config-chain@npm:1.1.12": - version: 1.1.12 - resolution: "config-chain@npm:1.1.12" - dependencies: - ini: ^1.3.4 - proto-list: ~1.2.1 - checksum: a16332f87212b4015afcdfc95fe42b40b162e7f10b4f4370ab3239979b6e69a41b4e6fb34d7891aa028a557f2340da236f810df433b18dfa5c408b2eb8489bf7 - languageName: node - linkType: hard - "confusing-browser-globals@npm:^1.0.11": version: 1.0.11 resolution: "confusing-browser-globals@npm:1.0.11" @@ -6560,13 +6275,12 @@ __metadata: languageName: node linkType: hard -"conventional-changelog-angular@npm:5.0.12": - version: 5.0.12 - resolution: "conventional-changelog-angular@npm:5.0.12" +"conventional-changelog-angular@npm:6.0.0": + version: 6.0.0 + resolution: "conventional-changelog-angular@npm:6.0.0" dependencies: compare-func: ^2.0.0 - q: ^1.5.1 - checksum: 552db8762d210a5172b1ad8cd95312e2e2a0483ba43f8d30b075a56ccf05231fdca1d4d5843028d43bec6bc7f903f480005efc5386587321a15a1fc4d2b73016 + checksum: ddc59ead53a45b817d83208200967f5340866782b8362d5e2e34105fdfa3d3a31585ebbdec7750bdb9de53da869f847e8ca96634a9801f51e27ecf4e7ffe2bad languageName: node linkType: hard @@ -6616,7 +6330,26 @@ __metadata: languageName: node linkType: hard -"conventional-changelog-core@npm:4.2.4, conventional-changelog-core@npm:^4.2.1": +"conventional-changelog-core@npm:5.0.1": + version: 5.0.1 + resolution: "conventional-changelog-core@npm:5.0.1" + dependencies: + add-stream: ^1.0.0 + conventional-changelog-writer: ^6.0.0 + conventional-commits-parser: ^4.0.0 + dateformat: ^3.0.3 + get-pkg-repo: ^4.2.1 + git-raw-commits: ^3.0.0 + git-remote-origin-url: ^2.0.0 + git-semver-tags: ^5.0.0 + normalize-package-data: ^3.0.3 + read-pkg: ^3.0.0 + read-pkg-up: ^3.0.0 + checksum: 5f37f14f8d5effb4c6bf861df11e918a277ecc2cf94534eaed44d1455b11ef450d0f6d122f0e7450a44a268d9473730cf918b7558964dcba2f0ac0896824e66f + languageName: node + linkType: hard + +"conventional-changelog-core@npm:^4.2.1": version: 4.2.4 resolution: "conventional-changelog-core@npm:4.2.4" dependencies: @@ -6691,6 +6424,13 @@ __metadata: languageName: node linkType: hard +"conventional-changelog-preset-loader@npm:^3.0.0": + version: 3.0.0 + resolution: "conventional-changelog-preset-loader@npm:3.0.0" + checksum: 199c4730c5151f243d35c24585114900c2a7091eab5832cfeb49067a18a2b77d5c9a86b779e6e18b49278a1ff83c011c1d9bb6da95bd1f78d9e36d4d379216d5 + languageName: node + linkType: hard + "conventional-changelog-writer@npm:^5.0.0": version: 5.0.1 resolution: "conventional-changelog-writer@npm:5.0.1" @@ -6710,6 +6450,23 @@ __metadata: languageName: node linkType: hard +"conventional-changelog-writer@npm:^6.0.0": + version: 6.0.0 + resolution: "conventional-changelog-writer@npm:6.0.0" + dependencies: + conventional-commits-filter: ^3.0.0 + dateformat: ^3.0.3 + handlebars: ^4.7.7 + json-stringify-safe: ^5.0.1 + meow: ^8.1.2 + semver: ^6.3.0 + split: ^1.0.1 + bin: + conventional-changelog-writer: cli.js + checksum: 2515980f47d424c747f57b9e4456506a338464acd7ab50550c1dafe741bf8cb586cb85f18e1cd57d1e3b84124ae0f3e81c8e4141e3331cb4543f69ac5c6c5ea8 + languageName: node + linkType: hard + "conventional-changelog@npm:3.1.25": version: 3.1.25 resolution: "conventional-changelog@npm:3.1.25" @@ -6739,6 +6496,16 @@ __metadata: languageName: node linkType: hard +"conventional-commits-filter@npm:^3.0.0": + version: 3.0.0 + resolution: "conventional-commits-filter@npm:3.0.0" + dependencies: + lodash.ismatch: ^4.4.0 + modify-values: ^1.0.1 + checksum: 73337f42acff7189e1dfca8d13c9448ce085ac1c09976cb33617cc909949621befb1640b1c6c30a1be4953a1be0deea9e93fa0dc86725b8be8e249a64fbb4632 + languageName: node + linkType: hard + "conventional-commits-parser@npm:^3.2.0": version: 3.2.4 resolution: "conventional-commits-parser@npm:3.2.4" @@ -6755,6 +6522,20 @@ __metadata: languageName: node linkType: hard +"conventional-commits-parser@npm:^4.0.0": + version: 4.0.0 + resolution: "conventional-commits-parser@npm:4.0.0" + dependencies: + JSONStream: ^1.3.5 + is-text-path: ^1.0.1 + meow: ^8.1.2 + split2: ^3.2.2 + bin: + conventional-commits-parser: cli.js + checksum: 12d95b5ba8e0710a6d3cd2e01f01dd7818fdf0bb2b33f4b75444e2c9aee49598776b0706a528ed49e83aec5f1896c32cbc7f8e6589f61a15187293707448f928 + languageName: node + linkType: hard + "conventional-recommended-bump@npm:6.1.0": version: 6.1.0 resolution: "conventional-recommended-bump@npm:6.1.0" @@ -6773,6 +6554,23 @@ __metadata: languageName: node linkType: hard +"conventional-recommended-bump@npm:7.0.1": + version: 7.0.1 + resolution: "conventional-recommended-bump@npm:7.0.1" + dependencies: + concat-stream: ^2.0.0 + conventional-changelog-preset-loader: ^3.0.0 + conventional-commits-filter: ^3.0.0 + conventional-commits-parser: ^4.0.0 + git-raw-commits: ^3.0.0 + git-semver-tags: ^5.0.0 + meow: ^8.1.2 + bin: + conventional-recommended-bump: cli.js + checksum: e2d1f2f40f93612a6da035d0c1a12d70208e0da509a17a9c9296a05e73a6eca5d81fe8c6a7b45e973181fa7c876c6edb9a114a2d7da4f6df00c47c7684ab62d2 + languageName: node + linkType: hard + "convert-source-map@npm:^1.5.0, convert-source-map@npm:^1.7.0": version: 1.9.0 resolution: "convert-source-map@npm:1.9.0" @@ -6843,29 +6641,28 @@ __metadata: languageName: node linkType: hard -"cosmiconfig@npm:7.0.0": - version: 7.0.0 - resolution: "cosmiconfig@npm:7.0.0" +"cosmiconfig@npm:^7.0.0": + version: 7.1.0 + resolution: "cosmiconfig@npm:7.1.0" dependencies: "@types/parse-json": ^4.0.0 import-fresh: ^3.2.1 parse-json: ^5.0.0 path-type: ^4.0.0 yaml: ^1.10.0 - checksum: 6801feaa0249e9b9fdde5b3d70dc33b4f9c69095bec94d67e3fe08b66eac24dc7e2099f053597cfbc94b743de269aa5d2cfa7da3fde765433423b06bd122941a + checksum: c53bf7befc1591b2651a22414a5e786cd5f2eeaa87f3678a3d49d6069835a9d8d1aef223728e98aa8fec9a95bf831120d245096db12abe019fecb51f5696c96f languageName: node linkType: hard -"cosmiconfig@npm:^7.0.0": - version: 7.1.0 - resolution: "cosmiconfig@npm:7.1.0" +"cosmiconfig@npm:^8.2.0": + version: 8.2.0 + resolution: "cosmiconfig@npm:8.2.0" dependencies: - "@types/parse-json": ^4.0.0 import-fresh: ^3.2.1 + js-yaml: ^4.1.0 parse-json: ^5.0.0 path-type: ^4.0.0 - yaml: ^1.10.0 - checksum: c53bf7befc1591b2651a22414a5e786cd5f2eeaa87f3678a3d49d6069835a9d8d1aef223728e98aa8fec9a95bf831120d245096db12abe019fecb51f5696c96f + checksum: 836d5d8efa750f3fb17b03d6ca74cd3154ed025dffd045304b3ef59637f662bde1e5dc88f8830080d180ec60841719cf4ea2ce73fb21ec694b16865c478ff297 languageName: node linkType: hard @@ -6982,13 +6779,6 @@ __metadata: languageName: node linkType: hard -"crypto-random-string@npm:^2.0.0": - version: 2.0.0 - resolution: "crypto-random-string@npm:2.0.0" - checksum: 0283879f55e7c16fdceacc181f87a0a65c53bc16ffe1d58b9d19a6277adcd71900d02bb2c4843dd55e78c51e30e89b0fec618a7f170ebcc95b33182c28f05fd6 - languageName: node - linkType: hard - "css.escape@npm:^1.5.1": version: 1.5.1 resolution: "css.escape@npm:1.5.1" @@ -6996,15 +6786,6 @@ __metadata: languageName: node linkType: hard -"cssesc@npm:^3.0.0": - version: 3.0.0 - resolution: "cssesc@npm:3.0.0" - bin: - cssesc: bin/cssesc - checksum: f8c4ababffbc5e2ddf2fa9957dda1ee4af6048e22aeda1869d0d00843223c1b13ad3f5d88b51caa46c994225eacb636b764eb807a8883e2fb6f99b4f4e8c48b2 - languageName: node - linkType: hard - "csstype@npm:^3.0.2, csstype@npm:^3.1.2": version: 3.1.2 resolution: "csstype@npm:3.1.2" @@ -7045,7 +6826,7 @@ __metadata: languageName: node linkType: hard -"dateformat@npm:^3.0.0": +"dateformat@npm:^3.0.0, dateformat@npm:^3.0.3": version: 3.0.3 resolution: "dateformat@npm:3.0.3" checksum: ca4911148abb09887bd9bdcd632c399b06f3ecad709a18eb594d289a1031982f441e08e281db77ffebcb2cbcbfa1ac578a7cbfbf8743f41009aa5adc1846ed34 @@ -7131,7 +6912,7 @@ __metadata: languageName: node linkType: hard -"dedent@npm:0.7.0, dedent@npm:^0.7.0": +"dedent@npm:0.7.0": version: 0.7.0 resolution: "dedent@npm:0.7.0" checksum: 87de191050d9a40dd70cad01159a0bcf05ecb59750951242070b6abf9569088684880d00ba92a955b4058804f16eeaf91d604f283929b4f614d181cd7ae633d2 @@ -7213,22 +6994,6 @@ __metadata: languageName: node linkType: hard -"del@npm:^6.0.0": - version: 6.1.1 - resolution: "del@npm:6.1.1" - dependencies: - globby: ^11.0.1 - graceful-fs: ^4.2.4 - is-glob: ^4.0.1 - is-path-cwd: ^2.2.0 - is-path-inside: ^3.0.2 - p-map: ^4.0.0 - rimraf: ^3.0.2 - slash: ^3.0.0 - checksum: 563288b73b8b19a7261c47fd21a330eeab6e2acd7c6208c49790dfd369127120dd7836cdf0c1eca216b77c94782a81507eac6b4734252d3bef2795cb366996b6 - languageName: node - linkType: hard - "delay@npm:^5.0.0": version: 5.0.0 resolution: "delay@npm:5.0.0" @@ -7257,7 +7022,7 @@ __metadata: languageName: node linkType: hard -"deprecation@npm:^2.0.0, deprecation@npm:^2.3.1": +"deprecation@npm:^2.0.0": version: 2.3.1 resolution: "deprecation@npm:2.3.1" checksum: f56a05e182c2c195071385455956b0c4106fe14e36245b00c689ceef8e8ab639235176a96977ba7c74afb173317fac2e0ec6ec7a1c6d1e6eaa401c586c714132 @@ -7364,15 +7129,6 @@ __metadata: languageName: node linkType: hard -"dot-prop@npm:6.0.1": - version: 6.0.1 - resolution: "dot-prop@npm:6.0.1" - dependencies: - is-obj: ^2.0.0 - checksum: 0f47600a4b93e1dc37261da4e6909652c008832a5d3684b5bf9a9a0d3f4c67ea949a86dceed9b72f5733ed8e8e6383cc5958df3bbd0799ee317fd181f2ece700 - languageName: node - linkType: hard - "dot-prop@npm:^5.1.0": version: 5.3.0 resolution: "dot-prop@npm:5.3.0" @@ -7534,7 +7290,7 @@ __metadata: languageName: node linkType: hard -"envinfo@npm:^7.7.4": +"envinfo@npm:7.8.1": version: 7.8.1 resolution: "envinfo@npm:7.8.1" bin: @@ -8590,13 +8346,6 @@ __metadata: languageName: node linkType: hard -"event-target-shim@npm:^5.0.0": - version: 5.0.1 - resolution: "event-target-shim@npm:5.0.1" - checksum: 1ffe3bb22a6d51bdeb6bf6f7cf97d2ff4a74b017ad12284cc9e6a279e727dc30a5de6bb613e5596ff4dc3e517841339ad09a7eec44266eccb1aa201a30448166 - languageName: node - linkType: hard - "eventemitter2@npm:^6.4.5": version: 6.4.9 resolution: "eventemitter2@npm:6.4.9" @@ -8881,13 +8630,6 @@ __metadata: languageName: node linkType: hard -"file-url@npm:3.0.0": - version: 3.0.0 - resolution: "file-url@npm:3.0.0" - checksum: 4724f669ee22468f23a39e37b8349a14f94dd9abda8385920db9900a2b2ae5ad90a314d85ea0089b6f45e9d0850833a6d1e41ac15a81a5618685129c6d7c7629 - languageName: node - linkType: hard - "filelist@npm:^1.0.4": version: 1.0.4 resolution: "filelist@npm:1.0.4" @@ -8928,16 +8670,6 @@ __metadata: languageName: node linkType: hard -"find-up@npm:5.0.0, find-up@npm:^5.0.0": - version: 5.0.0 - resolution: "find-up@npm:5.0.0" - dependencies: - locate-path: ^6.0.0 - path-exists: ^4.0.0 - checksum: 07955e357348f34660bde7920783204ff5a26ac2cafcaa28bace494027158a97b9f56faaf2d89a6106211a8174db650dd9f503f9c0d526b1202d5554a00b9095 - languageName: node - linkType: hard - "find-up@npm:^2.0.0": version: 2.1.0 resolution: "find-up@npm:2.1.0" @@ -8966,6 +8698,16 @@ __metadata: languageName: node linkType: hard +"find-up@npm:^5.0.0": + version: 5.0.0 + resolution: "find-up@npm:5.0.0" + dependencies: + locate-path: ^6.0.0 + path-exists: ^4.0.0 + checksum: 07955e357348f34660bde7920783204ff5a26ac2cafcaa28bace494027158a97b9f56faaf2d89a6106211a8174db650dd9f503f9c0d526b1202d5554a00b9095 + languageName: node + linkType: hard + "flat-cache@npm:^3.0.4": version: 3.0.4 resolution: "flat-cache@npm:3.0.4" @@ -9078,19 +8820,7 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:9.1.0, fs-extra@npm:^9.1.0": - version: 9.1.0 - resolution: "fs-extra@npm:9.1.0" - dependencies: - at-least-node: ^1.0.0 - graceful-fs: ^4.2.0 - jsonfile: ^6.0.1 - universalify: ^2.0.0 - checksum: ba71ba32e0faa74ab931b7a0031d1523c66a73e225de7426e275e238e312d07313d2da2d33e34a52aa406c8763ade5712eb3ec9ba4d9edce652bcacdc29e6b20 - languageName: node - linkType: hard - -"fs-extra@npm:^11.1.0": +"fs-extra@npm:^11.1.0, fs-extra@npm:^11.1.1": version: 11.1.1 resolution: "fs-extra@npm:11.1.1" dependencies: @@ -9214,22 +8944,6 @@ __metadata: languageName: node linkType: hard -"gauge@npm:^5.0.0": - version: 5.0.1 - resolution: "gauge@npm:5.0.1" - dependencies: - aproba: ^1.0.3 || ^2.0.0 - color-support: ^1.1.3 - console-control-strings: ^1.1.0 - has-unicode: ^2.0.1 - signal-exit: ^4.0.1 - string-width: ^4.2.3 - strip-ansi: ^6.0.1 - wide-align: ^1.1.5 - checksum: 09b1eb8d8c850df7e4e2822feef27427afc845d4839fa13a08ddad74f882caf668dd1e77ac5e059d3e9a7b0cef59b706d28be40e1dc5fd326da32965e1f206a6 - languageName: node - linkType: hard - "gensync@npm:^1.0.0-beta.2": version: 1.0.0-beta.2 resolution: "gensync@npm:1.0.0-beta.2" @@ -9256,7 +8970,7 @@ __metadata: languageName: node linkType: hard -"get-pkg-repo@npm:^4.0.0": +"get-pkg-repo@npm:^4.0.0, get-pkg-repo@npm:^4.2.1": version: 4.2.1 resolution: "get-pkg-repo@npm:4.2.1" dependencies: @@ -9334,6 +9048,19 @@ __metadata: languageName: node linkType: hard +"git-raw-commits@npm:^3.0.0": + version: 3.0.0 + resolution: "git-raw-commits@npm:3.0.0" + dependencies: + dargs: ^7.0.0 + meow: ^8.1.2 + split2: ^3.2.2 + bin: + git-raw-commits: cli.js + checksum: 198892f307829d22fc8ec1c9b4a63876a1fde847763857bb74bd1b04c6f6bc0d7464340c25d0f34fd0fb395759363aa1f8ce324357027320d80523bf234676ab + languageName: node + linkType: hard + "git-remote-origin-url@npm:^2.0.0": version: 2.0.0 resolution: "git-remote-origin-url@npm:2.0.0" @@ -9356,6 +9083,18 @@ __metadata: languageName: node linkType: hard +"git-semver-tags@npm:^5.0.0": + version: 5.0.0 + resolution: "git-semver-tags@npm:5.0.0" + dependencies: + meow: ^8.1.2 + semver: ^6.3.0 + bin: + git-semver-tags: cli.js + checksum: 837d47ba46711e464fbddc6850adb1d8e715e1529ef0951171cbd7fcba3e44b2cb8011f66a9c9e1b86d687178a55258b061fbedf7c23afdc3f116f26be565aa4 + languageName: node + linkType: hard + "git-up@npm:^7.0.0": version: 7.0.0 resolution: "git-up@npm:7.0.0" @@ -9505,7 +9244,7 @@ __metadata: languageName: node linkType: hard -"globby@npm:11.1.0, globby@npm:^11.0.1, globby@npm:^11.1.0": +"globby@npm:11.1.0, globby@npm:^11.1.0": version: 11.1.0 resolution: "globby@npm:11.1.0" dependencies: @@ -9581,14 +9320,7 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:4.2.10": - version: 4.2.10 - resolution: "graceful-fs@npm:4.2.10" - checksum: 3f109d70ae123951905d85032ebeae3c2a5a7a997430df00ea30df0e3a6c60cf6689b109654d6fdacd28810a053348c4d14642da1d075049e6be1ba5216218da - languageName: node - linkType: hard - -"graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.15, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": +"graceful-fs@npm:4.2.11, graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.15, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: ac85f94da92d8eb6b7f5a8b20ce65e43d66761c55ce85ac96df6865308390da45a8d3f0296dd3a663de65d30ba497bd46c696cc1e248c72b13d6d567138a4fc7 @@ -9786,16 +9518,7 @@ __metadata: languageName: node linkType: hard -"hosted-git-info@npm:^5.0.0": - version: 5.2.1 - resolution: "hosted-git-info@npm:5.2.1" - dependencies: - lru-cache: ^7.5.1 - checksum: fa35df185224adfd69141f3b2f8cc31f50e705a5ebb415ccfbfd055c5b94bd08d3e658edf1edad9e2ac7d81831ac7cf261f5d219b3adc8d744fb8cdacaaf2ead - languageName: node - linkType: hard - -"hosted-git-info@npm:^6.0.0, hosted-git-info@npm:^6.1.1": +"hosted-git-info@npm:^6.0.0": version: 6.1.1 resolution: "hosted-git-info@npm:6.1.1" dependencies: @@ -9917,12 +9640,12 @@ __metadata: languageName: node linkType: hard -"i18next@npm:^22.5.0": - version: 22.5.0 - resolution: "i18next@npm:22.5.0" +"i18next@npm:^22.5.1": + version: 22.5.1 + resolution: "i18next@npm:22.5.1" dependencies: "@babel/runtime": ^7.20.6 - checksum: 291c0e02fda20bd1827b6529dad74c01867892c7ac000befe0f69e10ad97ab074a2ae5b4ce1e0638c28ae1a6f59d1ed8503ea05bd1c324d731a44dd94c43a49a + checksum: 175f8ab7fac2abcee147b00cc2d8e7d4fa9b05cdc227f02cac841fc2fd9545ed4a6d88774f594f8ad12dc944e4d34cc8e88aa00c8b9947baef9e859d93abd305 languageName: node linkType: hard @@ -10002,7 +9725,7 @@ __metadata: languageName: node linkType: hard -"import-local@npm:^3.0.2": +"import-local@npm:3.1.0": version: 3.1.0 resolution: "import-local@npm:3.1.0" dependencies: @@ -10059,48 +9782,25 @@ __metadata: languageName: node linkType: hard -"ini@npm:^1.3.2, ini@npm:^1.3.4": +"ini@npm:^1.3.2, ini@npm:^1.3.8": version: 1.3.8 resolution: "ini@npm:1.3.8" checksum: dfd98b0ca3a4fc1e323e38a6c8eb8936e31a97a918d3b377649ea15bdb15d481207a0dda1021efbd86b464cae29a0d33c1d7dcaf6c5672bee17fa849bc50a1b3 languageName: node linkType: hard -"init-package-json@npm:3.0.2, init-package-json@npm:^3.0.2": - version: 3.0.2 - resolution: "init-package-json@npm:3.0.2" +"init-package-json@npm:5.0.0": + version: 5.0.0 + resolution: "init-package-json@npm:5.0.0" dependencies: - npm-package-arg: ^9.0.1 - promzard: ^0.3.0 - read: ^1.0.7 - read-package-json: ^5.0.0 + npm-package-arg: ^10.0.0 + promzard: ^1.0.0 + read: ^2.0.0 + read-package-json: ^6.0.0 semver: ^7.3.5 validate-npm-package-license: ^3.0.4 - validate-npm-package-name: ^4.0.0 - checksum: e027f60e4a1564809eee790d5a842341c784888fd7c7ace5f9a34ea76224c0adb6f3ab3bf205cf1c9c877a6e1a76c68b00847a984139f60813125d7b42a23a13 - languageName: node - linkType: hard - -"inquirer@npm:8.2.4": - version: 8.2.4 - resolution: "inquirer@npm:8.2.4" - dependencies: - ansi-escapes: ^4.2.1 - chalk: ^4.1.1 - cli-cursor: ^3.1.0 - cli-width: ^3.0.0 - external-editor: ^3.0.3 - figures: ^3.0.0 - lodash: ^4.17.21 - mute-stream: 0.0.8 - ora: ^5.4.1 - run-async: ^2.4.0 - rxjs: ^7.5.5 - string-width: ^4.1.0 - strip-ansi: ^6.0.0 - through: ^2.3.6 - wrap-ansi: ^7.0.0 - checksum: dfcb6529d3af443dfea2241cb471508091b51f5121a088fdb8728b23ec9b349ef0a5e13a0ef2c8e19457b0bed22f7cbbcd561f7a4529d084c562a58c605e2655 + validate-npm-package-name: ^5.0.0 + checksum: ad601c717d5ea3ff5a416cbe7d39417bb3914596dce7a386bffe856229435ebef06eb600736326effdd4e57a02d41164aa525d31d51ec49812c8e8c215d1d7c8 languageName: node linkType: hard @@ -10206,14 +9906,14 @@ __metadata: languageName: node linkType: hard -"is-ci@npm:2.0.0": - version: 2.0.0 - resolution: "is-ci@npm:2.0.0" +"is-ci@npm:3.0.1": + version: 3.0.1 + resolution: "is-ci@npm:3.0.1" dependencies: - ci-info: ^2.0.0 + ci-info: ^3.2.0 bin: is-ci: bin.js - checksum: 77b869057510f3efa439bbb36e9be429d53b3f51abd4776eeea79ab3b221337fe1753d1e50058a9e2c650d38246108beffb15ccfd443929d77748d8c0cc90144 + checksum: 192c66dc7826d58f803ecae624860dccf1899fc1f3ac5505284c0a5cf5f889046ffeb958fa651e5725d5705c5bcb14f055b79150ea5fcad7456a9569de60260e languageName: node linkType: hard @@ -10355,14 +10055,7 @@ __metadata: languageName: node linkType: hard -"is-path-cwd@npm:^2.2.0": - version: 2.2.0 - resolution: "is-path-cwd@npm:2.2.0" - checksum: 46a840921bb8cc0dc7b5b423a14220e7db338072a4495743a8230533ce78812dc152548c86f4b828411fe98c5451959f07cf841c6a19f611e46600bd699e8048 - languageName: node - linkType: hard - -"is-path-inside@npm:^3.0.2, is-path-inside@npm:^3.0.3": +"is-path-inside@npm:^3.0.3": version: 3.0.3 resolution: "is-path-inside@npm:3.0.3" checksum: abd50f06186a052b349c15e55b182326f1936c89a78bf6c8f2b707412517c097ce04bc49a0ca221787bc44e1049f51f09a2ffb63d22899051988d3a618ba13e9 @@ -10630,7 +10323,7 @@ __metadata: languageName: node linkType: hard -"jest-diff@npm:^29.5.0": +"jest-diff@npm:>=29.4.3 < 30, jest-diff@npm:^29.5.0": version: 29.5.0 resolution: "jest-diff@npm:29.5.0" dependencies: @@ -10782,7 +10475,7 @@ __metadata: languageName: node linkType: hard -"json-parse-even-better-errors@npm:^2.3.0, json-parse-even-better-errors@npm:^2.3.1": +"json-parse-even-better-errors@npm:^2.3.0": version: 2.3.1 resolution: "json-parse-even-better-errors@npm:2.3.1" checksum: 798ed4cf3354a2d9ccd78e86d2169515a0097a5c133337807cdf7f1fc32e1391d207ccfc276518cc1d7d8d4db93288b8a50ba4293d212ad1336e52a8ec0a941f @@ -10853,13 +10546,6 @@ __metadata: languageName: node linkType: hard -"json-stringify-nice@npm:^1.1.4": - version: 1.1.4 - resolution: "json-stringify-nice@npm:1.1.4" - checksum: 6ddf781148b46857ab04e97f47be05f14c4304b86eb5478369edbeacd070c21c697269964b982fc977e8989d4c59091103b1d9dc291aba40096d6cbb9a392b72 - languageName: node - linkType: hard - "json-stringify-safe@npm:^5.0.1, json-stringify-safe@npm:~5.0.1": version: 5.0.1 resolution: "json-stringify-safe@npm:5.0.1" @@ -10962,20 +10648,6 @@ __metadata: languageName: node linkType: hard -"just-diff-apply@npm:^5.2.0": - version: 5.5.0 - resolution: "just-diff-apply@npm:5.5.0" - checksum: ed6bbd59781542ccb786bd843038e4591e8390aa788075beb69d358051f68fbeb122bda050b7f42515d51fb64b907d5c7bea694a0543b87b24ce406cfb5f5bfa - languageName: node - linkType: hard - -"just-diff@npm:^6.0.0": - version: 6.0.2 - resolution: "just-diff@npm:6.0.2" - checksum: 1a0c7524f640cb88ab013862733e710f840927834208fd3b85cbc5da2ced97acc75e7dcfe493268ac6a6514c51dd8624d2fd9d057050efba3c02b81a6dcb7ff9 - languageName: node - linkType: hard - "keccak@npm:^3.0.0, keccak@npm:^3.0.1": version: 3.0.3 resolution: "keccak@npm:3.0.3" @@ -11027,48 +10699,46 @@ __metadata: languageName: node linkType: hard -"lerna@npm:^6.6.2": - version: 6.6.2 - resolution: "lerna@npm:6.6.2" - dependencies: - "@lerna/child-process": 6.6.2 - "@lerna/create": 6.6.2 - "@lerna/legacy-package-management": 6.6.2 - "@npmcli/arborist": 6.2.3 - "@npmcli/run-script": 4.1.7 - "@nrwl/devkit": ">=15.5.2 < 16" +"lerna@npm:^7.0.0": + version: 7.0.0 + resolution: "lerna@npm:7.0.0" + dependencies: + "@lerna/child-process": 7.0.0 + "@lerna/create": 7.0.0 + "@npmcli/run-script": 6.0.2 + "@nx/devkit": ">=16.1.3 < 17" "@octokit/plugin-enterprise-rest": 6.0.1 - "@octokit/rest": 19.0.3 - byte-size: 7.0.0 + "@octokit/rest": 19.0.11 + byte-size: 8.1.1 chalk: 4.1.0 clone-deep: 4.0.1 - cmd-shim: 5.0.0 + cmd-shim: 6.0.1 columnify: 1.6.0 - config-chain: 1.1.12 - conventional-changelog-angular: 5.0.12 - conventional-changelog-core: 4.2.4 - conventional-recommended-bump: 6.1.0 - cosmiconfig: 7.0.0 + conventional-changelog-angular: 6.0.0 + conventional-changelog-core: 5.0.1 + conventional-recommended-bump: 7.0.1 + cosmiconfig: ^8.2.0 dedent: 0.7.0 - dot-prop: 6.0.1 - envinfo: ^7.7.4 + envinfo: 7.8.1 execa: 5.0.0 - fs-extra: 9.1.0 + fs-extra: ^11.1.1 get-port: 5.1.1 get-stream: 6.0.0 git-url-parse: 13.1.0 glob-parent: 5.1.2 globby: 11.1.0 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 has-unicode: 2.0.1 - import-local: ^3.0.2 - init-package-json: 3.0.2 + import-local: 3.1.0 + ini: ^1.3.8 + init-package-json: 5.0.0 inquirer: ^8.2.4 - is-ci: 2.0.0 + is-ci: 3.0.1 is-stream: 2.0.0 - js-yaml: ^4.1.0 - libnpmaccess: ^6.0.3 - libnpmpublish: 7.1.4 + jest-diff: ">=29.4.3 < 30" + js-yaml: 4.1.0 + libnpmaccess: 7.0.2 + libnpmpublish: 7.3.0 load-json-file: 6.2.0 make-dir: 3.1.0 minimatch: 3.0.5 @@ -11076,40 +10746,40 @@ __metadata: node-fetch: 2.6.7 npm-package-arg: 8.1.1 npm-packlist: 5.1.1 - npm-registry-fetch: ^14.0.3 + npm-registry-fetch: ^14.0.5 npmlog: ^6.0.2 - nx: ">=15.5.2 < 16" + nx: ">=16.1.3 < 17" p-map: 4.0.0 p-map-series: 2.1.0 p-pipe: 3.1.0 p-queue: 6.6.2 p-reduce: 2.1.0 p-waterfall: 2.1.1 - pacote: 15.1.1 + pacote: ^15.2.0 pify: 5.0.0 - read-cmd-shim: 3.0.0 - read-package-json: 5.0.1 + read-cmd-shim: 4.0.0 + read-package-json: 6.0.4 resolve-from: 5.0.0 rimraf: ^4.4.1 semver: ^7.3.8 signal-exit: 3.0.7 slash: 3.0.0 - ssri: 9.0.1 + ssri: ^9.0.1 strong-log-transformer: 2.1.0 tar: 6.1.11 temp-dir: 1.0.0 - typescript: ^3 || ^4 - upath: ^2.0.1 - uuid: 8.3.2 + typescript: ">=3 < 6" + upath: 2.0.1 + uuid: ^9.0.0 validate-npm-package-license: 3.0.4 - validate-npm-package-name: 4.0.0 - write-file-atomic: 4.0.1 + validate-npm-package-name: 5.0.0 + write-file-atomic: 5.0.1 write-pkg: 4.0.0 yargs: 16.2.0 yargs-parser: 20.2.4 bin: lerna: dist/cli.js - checksum: ece77edd8ab1f1ddfe47095c9f812af6b65a58c8851b146ecba5d6a8ae1b316195e7968781cd15e57fa67895de5e60211600c6d8a987264f2f322b0f59ee6772 + checksum: 2144b5d4b76ebd1f7ed12e8f1a193a205718b7cdb86925b3fe9494ba7220d11f3e65fc103df67a3c018bf1bd3c804359b012d2ce7b9ea8df5eacddb5e1dd1251 languageName: node linkType: hard @@ -11185,21 +10855,19 @@ __metadata: languageName: node linkType: hard -"libnpmaccess@npm:^6.0.3": - version: 6.0.4 - resolution: "libnpmaccess@npm:6.0.4" +"libnpmaccess@npm:7.0.2": + version: 7.0.2 + resolution: "libnpmaccess@npm:7.0.2" dependencies: - aproba: ^2.0.0 - minipass: ^3.1.1 - npm-package-arg: ^9.0.1 - npm-registry-fetch: ^13.0.0 - checksum: 86130b435c67a03254489c3b3684d435260b609164f76bcc69adbee78652c36a64551228b2c5ddc2b16851e9e367ee0ba173a641406768397716faa006042322 + npm-package-arg: ^10.1.0 + npm-registry-fetch: ^14.0.3 + checksum: 73d49f39391173276c46c12e32f503709338efd867d255d062ae9bc9e9f464d61240747f42bdd6dc6003a5dc275a27352ebfc11ed4cb424091463f302d823f23 languageName: node linkType: hard -"libnpmpublish@npm:7.1.4": - version: 7.1.4 - resolution: "libnpmpublish@npm:7.1.4" +"libnpmpublish@npm:7.3.0": + version: 7.3.0 + resolution: "libnpmpublish@npm:7.3.0" dependencies: ci-info: ^3.6.1 normalize-package-data: ^5.0.0 @@ -11209,7 +10877,7 @@ __metadata: semver: ^7.3.7 sigstore: ^1.4.0 ssri: ^10.0.1 - checksum: 334996850d0015b97e615f47cf13e4eb65c9d74b702da70031209a969a0cd99b6b8577dc153f6588843172f930fba71199bd9a71b4ac034ec94ede6d27acbbd6 + checksum: 03bedb65eb2293cfe5039f925ec1041deea698c5ac802bb74f6a0d44ee70529c38c32eea7c722f3a1f1219b54314021ad7f4764f93b66d619bea62ce0759faa0 languageName: node linkType: hard @@ -11428,7 +11096,7 @@ __metadata: languageName: node linkType: hard -"make-fetch-happen@npm:^10.0.3, make-fetch-happen@npm:^10.0.6": +"make-fetch-happen@npm:^10.0.3": version: 10.2.1 resolution: "make-fetch-happen@npm:10.2.1" dependencies: @@ -11541,7 +11209,7 @@ __metadata: languageName: node linkType: hard -"meow@npm:^8.0.0": +"meow@npm:^8.0.0, meow@npm:^8.1.2": version: 8.1.2 resolution: "meow@npm:8.1.2" dependencies: @@ -11737,15 +11405,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^6.1.6": - version: 6.2.0 - resolution: "minimatch@npm:6.2.0" - dependencies: - brace-expansion: ^2.0.1 - checksum: 0ffb77d05bd483fcc344ba3e64a501d569e658fa6c592d94e9716ffc7925de7a8c2ac294cafa822b160bd8b2cbf7e01012917e06ffb9a85cfa9604629b3f2c04 - languageName: node - linkType: hard - "minimatch@npm:^8.0.2": version: 8.0.4 resolution: "minimatch@npm:8.0.4" @@ -11877,7 +11536,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^4.0.0, minipass@npm:^4.2.4": +"minipass@npm:^4.2.4": version: 4.2.8 resolution: "minipass@npm:4.2.8" checksum: 7f4914d5295a9a30807cae5227a37a926e6d910c03f315930fde52332cf0575dfbc20295318f91f0baf0e6bb11a6f668e30cde8027dea7a11b9d159867a3c830 @@ -11924,17 +11583,6 @@ __metadata: languageName: node linkType: hard -"mkdirp-infer-owner@npm:^2.0.0": - version: 2.0.0 - resolution: "mkdirp-infer-owner@npm:2.0.0" - dependencies: - chownr: ^2.0.0 - infer-owner: ^1.0.4 - mkdirp: ^1.0.3 - checksum: d8f4ecd32f6762459d6b5714eae6487c67ae9734ab14e26d14377ddd9b2a1bf868d8baa18c0f3e73d3d513f53ec7a698e0f81a9367102c870a55bef7833880f7 - languageName: node - linkType: hard - "mkdirp-promise@npm:^5.0.1": version: 5.0.1 resolution: "mkdirp-promise@npm:5.0.1" @@ -11980,7 +11628,7 @@ __metadata: languageName: node linkType: hard -"modify-values@npm:^1.0.0": +"modify-values@npm:^1.0.0, modify-values@npm:^1.0.1": version: 1.0.1 resolution: "modify-values@npm:1.0.1" checksum: 8296610c608bc97b03c2cf889c6cdf4517e32fa2d836440096374c2209f6b7b3e256c209493a0b32584b9cb32d528e99d0dd19dcd9a14d2d915a312d391cc7e9 @@ -12071,13 +11719,20 @@ __metadata: languageName: node linkType: hard -"mute-stream@npm:0.0.8, mute-stream@npm:~0.0.4": +"mute-stream@npm:0.0.8": version: 0.0.8 resolution: "mute-stream@npm:0.0.8" checksum: ff48d251fc3f827e5b1206cda0ffdaec885e56057ee86a3155e1951bc940fd5f33531774b1cc8414d7668c10a8907f863f6561875ee6e8768931a62121a531a1 languageName: node linkType: hard +"mute-stream@npm:~1.0.0": + version: 1.0.0 + resolution: "mute-stream@npm:1.0.0" + checksum: 36fc968b0e9c9c63029d4f9dc63911950a3bdf55c9a87f58d3a266289b67180201cade911e7699f8b2fa596b34c9db43dad37649e3f7fdd13c3bb9edb0017ee7 + languageName: node + linkType: hard + "nano-json-stream-parser@npm:^0.1.2": version: 0.1.2 resolution: "nano-json-stream-parser@npm:0.1.2" @@ -12231,17 +11886,6 @@ __metadata: languageName: node linkType: hard -"nopt@npm:^7.0.0": - version: 7.1.0 - resolution: "nopt@npm:7.1.0" - dependencies: - abbrev: ^2.0.0 - bin: - nopt: bin/nopt.js - checksum: 77185170d491b2ffdda0c72ce12dcf222b670814b7fb5ba1b750c708a6e5421b5607345c1f6341602476c8ef0a26929f5b861efa284e106c60b4baa6e6edb262 - languageName: node - linkType: hard - "normalize-package-data@npm:^2.3.2, normalize-package-data@npm:^2.5.0": version: 2.5.0 resolution: "normalize-package-data@npm:2.5.0" @@ -12254,7 +11898,7 @@ __metadata: languageName: node linkType: hard -"normalize-package-data@npm:^3.0.0, normalize-package-data@npm:^3.0.2": +"normalize-package-data@npm:^3.0.0, normalize-package-data@npm:^3.0.2, normalize-package-data@npm:^3.0.3": version: 3.0.3 resolution: "normalize-package-data@npm:3.0.3" dependencies: @@ -12266,18 +11910,6 @@ __metadata: languageName: node linkType: hard -"normalize-package-data@npm:^4.0.0": - version: 4.0.1 - resolution: "normalize-package-data@npm:4.0.1" - dependencies: - hosted-git-info: ^5.0.0 - is-core-module: ^2.8.1 - semver: ^7.3.5 - validate-npm-package-license: ^3.0.4 - checksum: 292e0aa740e73d62f84bbd9d55d4bfc078155f32d5d7572c32c9807f96d543af0f43ff7e5c80bfa6238667123fd68bd83cd412eae9b27b85b271fb041f624528 - languageName: node - linkType: hard - "normalize-package-data@npm:^5.0.0": version: 5.0.0 resolution: "normalize-package-data@npm:5.0.0" @@ -12331,14 +11963,7 @@ __metadata: languageName: node linkType: hard -"npm-normalize-package-bin@npm:^2.0.0": - version: 2.0.0 - resolution: "npm-normalize-package-bin@npm:2.0.0" - checksum: 7c5379f9b188b564c4332c97bdd9a5d6b7b15f02b5823b00989d6a0e6fb31eb0280f02b0a924f930e1fcaf00e60fae333aec8923d2a4c7747613c7d629d8aa25 - languageName: node - linkType: hard - -"npm-normalize-package-bin@npm:^3.0.0, npm-normalize-package-bin@npm:^3.0.1": +"npm-normalize-package-bin@npm:^3.0.0": version: 3.0.1 resolution: "npm-normalize-package-bin@npm:3.0.1" checksum: de416d720ab22137a36292ff8a333af499ea0933ef2320a8c6f56a73b0f0448227fec4db5c890d702e26d21d04f271415eab6580b5546456861cc0c19498a4bf @@ -12368,18 +11993,6 @@ __metadata: languageName: node linkType: hard -"npm-package-arg@npm:^9.0.1": - version: 9.1.2 - resolution: "npm-package-arg@npm:9.1.2" - dependencies: - hosted-git-info: ^5.0.0 - proc-log: ^2.0.1 - semver: ^7.3.5 - validate-npm-package-name: ^4.0.0 - checksum: 3793488843985ed71deb14fcba7c068d8ed03a18fd8f6b235c6a64465c9a25f60261598106d5cc8677c0bee9548e405c34c2e3c7a822e3113d3389351c745dfa - languageName: node - linkType: hard - "npm-packlist@npm:5.1.1": version: 5.1.1 resolution: "npm-packlist@npm:5.1.1" @@ -12403,7 +12016,7 @@ __metadata: languageName: node linkType: hard -"npm-pick-manifest@npm:^8.0.0, npm-pick-manifest@npm:^8.0.1": +"npm-pick-manifest@npm:^8.0.0": version: 8.0.1 resolution: "npm-pick-manifest@npm:8.0.1" dependencies: @@ -12415,37 +12028,7 @@ __metadata: languageName: node linkType: hard -"npm-registry-fetch@npm:14.0.3": - version: 14.0.3 - resolution: "npm-registry-fetch@npm:14.0.3" - dependencies: - make-fetch-happen: ^11.0.0 - minipass: ^4.0.0 - minipass-fetch: ^3.0.0 - minipass-json-stream: ^1.0.1 - minizlib: ^2.1.2 - npm-package-arg: ^10.0.0 - proc-log: ^3.0.0 - checksum: 451224e7272c8418000f6a0e27fb01d7eb5231bcd98dbd42acac3f275f0b5317590c152860cc84afa706427121b59f9422939e00af5690442b70e64cfa39de0a - languageName: node - linkType: hard - -"npm-registry-fetch@npm:^13.0.0": - version: 13.3.1 - resolution: "npm-registry-fetch@npm:13.3.1" - dependencies: - make-fetch-happen: ^10.0.6 - minipass: ^3.1.6 - minipass-fetch: ^2.0.3 - minipass-json-stream: ^1.0.1 - minizlib: ^2.1.2 - npm-package-arg: ^9.0.1 - proc-log: ^2.0.0 - checksum: 5a941c2c799568e0dbccfc15f280444da398dadf2eede1b1921f08ddd5cb5f32c7cb4d16be96401f95a33073aeec13a3fd928c753790d3c412c2e64e7f7c6ee4 - languageName: node - linkType: hard - -"npm-registry-fetch@npm:^14.0.0, npm-registry-fetch@npm:^14.0.3": +"npm-registry-fetch@npm:^14.0.0, npm-registry-fetch@npm:^14.0.3, npm-registry-fetch@npm:^14.0.5": version: 14.0.5 resolution: "npm-registry-fetch@npm:14.0.5" dependencies: @@ -12469,7 +12052,7 @@ __metadata: languageName: node linkType: hard -"npmlog@npm:6.0.2, npmlog@npm:^6.0.0, npmlog@npm:^6.0.2": +"npmlog@npm:^6.0.0, npmlog@npm:^6.0.2": version: 6.0.2 resolution: "npmlog@npm:6.0.2" dependencies: @@ -12481,18 +12064,6 @@ __metadata: languageName: node linkType: hard -"npmlog@npm:^7.0.1": - version: 7.0.1 - resolution: "npmlog@npm:7.0.1" - dependencies: - are-we-there-yet: ^4.0.0 - console-control-strings: ^1.1.0 - gauge: ^5.0.0 - set-blocking: ^2.0.0 - checksum: caabeb1f557c1094ad7ed3275b968b83ccbaefc133f17366ebb9fe8eb44e1aace28c31419d6244bfc0422aede1202875d555fe6661978bf04386f6cf617f43a4 - languageName: node - linkType: hard - "number-to-bn@npm:1.7.0": version: 1.7.0 resolution: "number-to-bn@npm:1.7.0" @@ -12503,21 +12074,21 @@ __metadata: languageName: node linkType: hard -"nx@npm:15.9.4, nx@npm:>=15.5.2 < 16": - version: 15.9.4 - resolution: "nx@npm:15.9.4" +"nx@npm:16.3.2, nx@npm:>=16.1.3 < 17": + version: 16.3.2 + resolution: "nx@npm:16.3.2" dependencies: - "@nrwl/cli": 15.9.4 - "@nrwl/nx-darwin-arm64": 15.9.4 - "@nrwl/nx-darwin-x64": 15.9.4 - "@nrwl/nx-linux-arm-gnueabihf": 15.9.4 - "@nrwl/nx-linux-arm64-gnu": 15.9.4 - "@nrwl/nx-linux-arm64-musl": 15.9.4 - "@nrwl/nx-linux-x64-gnu": 15.9.4 - "@nrwl/nx-linux-x64-musl": 15.9.4 - "@nrwl/nx-win32-arm64-msvc": 15.9.4 - "@nrwl/nx-win32-x64-msvc": 15.9.4 - "@nrwl/tao": 15.9.4 + "@nrwl/tao": 16.3.2 + "@nx/nx-darwin-arm64": 16.3.2 + "@nx/nx-darwin-x64": 16.3.2 + "@nx/nx-freebsd-x64": 16.3.2 + "@nx/nx-linux-arm-gnueabihf": 16.3.2 + "@nx/nx-linux-arm64-gnu": 16.3.2 + "@nx/nx-linux-arm64-musl": 16.3.2 + "@nx/nx-linux-x64-gnu": 16.3.2 + "@nx/nx-linux-x64-musl": 16.3.2 + "@nx/nx-win32-arm64-msvc": 16.3.2 + "@nx/nx-win32-x64-msvc": 16.3.2 "@parcel/watcher": 2.0.4 "@yarnpkg/lockfile": ^1.1.0 "@yarnpkg/parsers": ^3.0.0-rc.18 @@ -12555,23 +12126,25 @@ __metadata: "@swc-node/register": ^1.4.2 "@swc/core": ^1.2.173 dependenciesMeta: - "@nrwl/nx-darwin-arm64": + "@nx/nx-darwin-arm64": + optional: true + "@nx/nx-darwin-x64": optional: true - "@nrwl/nx-darwin-x64": + "@nx/nx-freebsd-x64": optional: true - "@nrwl/nx-linux-arm-gnueabihf": + "@nx/nx-linux-arm-gnueabihf": optional: true - "@nrwl/nx-linux-arm64-gnu": + "@nx/nx-linux-arm64-gnu": optional: true - "@nrwl/nx-linux-arm64-musl": + "@nx/nx-linux-arm64-musl": optional: true - "@nrwl/nx-linux-x64-gnu": + "@nx/nx-linux-x64-gnu": optional: true - "@nrwl/nx-linux-x64-musl": + "@nx/nx-linux-x64-musl": optional: true - "@nrwl/nx-win32-arm64-msvc": + "@nx/nx-win32-arm64-msvc": optional: true - "@nrwl/nx-win32-x64-msvc": + "@nx/nx-win32-x64-msvc": optional: true peerDependenciesMeta: "@swc-node/register": @@ -12580,7 +12153,7 @@ __metadata: optional: true bin: nx: bin/nx.js - checksum: 61b92c070db1474462eb31f86cf3ac5a5ab2a3f454bed307a0b931cf09ef5ee883c90f05b4440f5760ff57f3965ecdd744320ff3b0475fba9b52004840173b5f + checksum: 627decdb89cea60f45ab035b33a53f2e3170f24c0eed07cfbec59eeeda4a6d62b57738e5f34fd1cdcdc00dcff83bb4d1022fe892c69e89420182d50ff0f6b547 languageName: node linkType: hard @@ -12952,35 +12525,7 @@ __metadata: languageName: node linkType: hard -"pacote@npm:15.1.1": - version: 15.1.1 - resolution: "pacote@npm:15.1.1" - dependencies: - "@npmcli/git": ^4.0.0 - "@npmcli/installed-package-contents": ^2.0.1 - "@npmcli/promise-spawn": ^6.0.1 - "@npmcli/run-script": ^6.0.0 - cacache: ^17.0.0 - fs-minipass: ^3.0.0 - minipass: ^4.0.0 - npm-package-arg: ^10.0.0 - npm-packlist: ^7.0.0 - npm-pick-manifest: ^8.0.0 - npm-registry-fetch: ^14.0.0 - proc-log: ^3.0.0 - promise-retry: ^2.0.1 - read-package-json: ^6.0.0 - read-package-json-fast: ^3.0.0 - sigstore: ^1.0.0 - ssri: ^10.0.0 - tar: ^6.1.11 - bin: - pacote: lib/bin.js - checksum: 109388e873615cdad342f5dbd3639389c00aaac2c84b824dcb1a9460b4cf1c66264387b1d0200b1769abda7feca94165804d1308ca5e59904ae24d489d3bfb13 - languageName: node - linkType: hard - -"pacote@npm:^15.0.0, pacote@npm:^15.0.8": +"pacote@npm:^15.2.0": version: 15.2.0 resolution: "pacote@npm:15.2.0" dependencies: @@ -13017,17 +12562,6 @@ __metadata: languageName: node linkType: hard -"parse-conflict-json@npm:^3.0.0": - version: 3.0.1 - resolution: "parse-conflict-json@npm:3.0.1" - dependencies: - json-parse-even-better-errors: ^3.0.0 - just-diff: ^6.0.0 - just-diff-apply: ^5.2.0 - checksum: d8d2656bc02d4df36846366baec36b419da2fe944e31298719a4d28d28f772aa7cad2a69d01f6f329918e7c298ac481d1e6a9138d62d5662d5620a74f794af8f - languageName: node - linkType: hard - "parse-headers@npm:^2.0.0": version: 2.0.5 resolution: "parse-headers@npm:2.0.5" @@ -13228,16 +12762,6 @@ __metadata: languageName: node linkType: hard -"postcss-selector-parser@npm:^6.0.10": - version: 6.0.13 - resolution: "postcss-selector-parser@npm:6.0.13" - dependencies: - cssesc: ^3.0.0 - util-deprecate: ^1.0.2 - checksum: f89163338a1ce3b8ece8e9055cd5a3165e79a15e1c408e18de5ad8f87796b61ec2d48a2902d179ae0c4b5de10fccd3a325a4e660596549b040bc5ad1b465f096 - languageName: node - linkType: hard - "postcss@npm:^8.4.23": version: 8.4.24 resolution: "postcss@npm:8.4.24" @@ -13295,17 +12819,6 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:29.4.3": - version: 29.4.3 - resolution: "pretty-format@npm:29.4.3" - dependencies: - "@jest/schemas": ^29.4.3 - ansi-styles: ^5.0.0 - react-is: ^18.0.0 - checksum: 3258b9a010bd79b3cf73783ad1e4592b6326fc981b6e31b742f316f14e7fbac09b48a9dbf274d092d9bde404db9fe16f518370e121837dc078a597392e6e5cc5 - languageName: node - linkType: hard - "pretty-format@npm:^27.0.2": version: 27.5.1 resolution: "pretty-format@npm:27.5.1" @@ -13328,13 +12841,6 @@ __metadata: languageName: node linkType: hard -"proc-log@npm:^2.0.0, proc-log@npm:^2.0.1": - version: 2.0.1 - resolution: "proc-log@npm:2.0.1" - checksum: f6f23564ff759097db37443e6e2765af84979a703d2c52c1b9df506ee9f87caa101ba49d8fdc115c1a313ec78e37e8134704e9069e6a870f3499d98bb24c436f - languageName: node - linkType: hard - "proc-log@npm:^3.0.0": version: 3.0.0 resolution: "proc-log@npm:3.0.0" @@ -13356,20 +12862,6 @@ __metadata: languageName: node linkType: hard -"promise-all-reject-late@npm:^1.0.0": - version: 1.0.1 - resolution: "promise-all-reject-late@npm:1.0.1" - checksum: d7d61ac412352e2c8c3463caa5b1c3ca0f0cc3db15a09f180a3da1446e33d544c4261fc716f772b95e4c27d559cfd2388540f44104feb356584f9c73cfb9ffcb - languageName: node - linkType: hard - -"promise-call-limit@npm:^1.0.1": - version: 1.0.2 - resolution: "promise-call-limit@npm:1.0.2" - checksum: d0664dd2954c063115c58a4d0f929ff8dcfca634146dfdd4ec86f4993cfe14db229fb990457901ad04c923b3fb872067f3b47e692e0c645c01536b92fc4460bd - languageName: node - linkType: hard - "promise-inflight@npm:^1.0.1": version: 1.0.1 resolution: "promise-inflight@npm:1.0.1" @@ -13397,12 +12889,12 @@ __metadata: languageName: node linkType: hard -"promzard@npm:^0.3.0": - version: 0.3.0 - resolution: "promzard@npm:0.3.0" +"promzard@npm:^1.0.0": + version: 1.0.0 + resolution: "promzard@npm:1.0.0" dependencies: - read: 1 - checksum: 443a3b39ac916099988ee0161ab4e22edd1fa27e3d39a38d60e48c11ca6df3f5a90bfe44d95af06ed8659c4050b789ffe64c3f9f8e49a4bea1ea19105c98445a + read: ^2.0.0 + checksum: c06948827171612faae321ebaf23ff8bd9ebb3e1e0f37616990bc4b81c663b192e447b3fe3b424211beb0062cec0cfe6ba3ce70c8b448b4aa59752b765dbb302 languageName: node linkType: hard @@ -13417,13 +12909,6 @@ __metadata: languageName: node linkType: hard -"proto-list@npm:~1.2.1": - version: 1.2.4 - resolution: "proto-list@npm:1.2.4" - checksum: 4d4826e1713cbfa0f15124ab0ae494c91b597a3c458670c9714c36e8baddf5a6aad22842776f2f5b137f259c8533e741771445eb8df82e861eea37a6eaba03f7 - languageName: node - linkType: hard - "protocols@npm:^2.0.0, protocols@npm:^2.0.1": version: 2.0.1 resolution: "protocols@npm:2.0.1" @@ -13694,27 +13179,27 @@ __metadata: languageName: node linkType: hard -"react-router-dom@npm:^6.11.2": - version: 6.11.2 - resolution: "react-router-dom@npm:6.11.2" +"react-router-dom@npm:^6.12.1": + version: 6.12.1 + resolution: "react-router-dom@npm:6.12.1" dependencies: - "@remix-run/router": 1.6.2 - react-router: 6.11.2 + "@remix-run/router": 1.6.3 + react-router: 6.12.1 peerDependencies: react: ">=16.8" react-dom: ">=16.8" - checksum: ba44ff37f2956bc18991f2eedb32a3fa46d35832f61ded6c5d167e853ca289868fca6635467866280c73bc3da00dce8437dbbec57da100c0a3e3e3850af00b83 + checksum: 885528986b6e32bde0cc6ff1f318186ce6931cf4a2a36511fe12eafb380576b448a991d43fe473dbb9bc97bb7efa0c87ac179a7470345a1d3534a34b65578677 languageName: node linkType: hard -"react-router@npm:6.11.2": - version: 6.11.2 - resolution: "react-router@npm:6.11.2" +"react-router@npm:6.12.1": + version: 6.12.1 + resolution: "react-router@npm:6.12.1" dependencies: - "@remix-run/router": 1.6.2 + "@remix-run/router": 1.6.3 peerDependencies: react: ">=16.8" - checksum: e47f875dca70033a3b42704cb5ec076b60f9629a5cdc3be613707f3d5a5706123fb80301037455c285c6d5a1011b443e1784e0103969ebfac7071648d360c413 + checksum: a23a0f2e6635eba19aec8d50b9126f61663d1e6ee6e69d6b2ca6e5dd678496b54d925f0d86a375270646da11cc12be66ac5e6ebf73962957af91ac828b63d10b languageName: node linkType: hard @@ -13751,31 +13236,14 @@ __metadata: languageName: node linkType: hard -"read-cmd-shim@npm:3.0.0": - version: 3.0.0 - resolution: "read-cmd-shim@npm:3.0.0" - checksum: b518c6026f3320e30b692044f6ff5c4dc80f9c71261296da8994101b569b26b12b8e5df397bba2d4691dd3a3a2f770a1eca7be18a69ec202fac6dcfadc5016fd - languageName: node - linkType: hard - -"read-cmd-shim@npm:^4.0.0": +"read-cmd-shim@npm:4.0.0": version: 4.0.0 resolution: "read-cmd-shim@npm:4.0.0" checksum: 2fb5a8a38984088476f559b17c6a73324a5db4e77e210ae0aab6270480fd85c355fc990d1c79102e25e555a8201606ed12844d6e3cd9f35d6a1518791184e05b languageName: node linkType: hard -"read-package-json-fast@npm:^2.0.3": - version: 2.0.3 - resolution: "read-package-json-fast@npm:2.0.3" - dependencies: - json-parse-even-better-errors: ^2.3.0 - npm-normalize-package-bin: ^1.0.1 - checksum: fca37b3b2160b9dda7c5588b767f6a2b8ce68d03a044000e568208e20bea0cf6dd2de17b90740ce8da8b42ea79c0b3859649dadf29510bbe77224ea65326a903 - languageName: node - linkType: hard - -"read-package-json-fast@npm:^3.0.0, read-package-json-fast@npm:^3.0.2": +"read-package-json-fast@npm:^3.0.0": version: 3.0.2 resolution: "read-package-json-fast@npm:3.0.2" dependencies: @@ -13785,31 +13253,7 @@ __metadata: languageName: node linkType: hard -"read-package-json@npm:5.0.1": - version: 5.0.1 - resolution: "read-package-json@npm:5.0.1" - dependencies: - glob: ^8.0.1 - json-parse-even-better-errors: ^2.3.1 - normalize-package-data: ^4.0.0 - npm-normalize-package-bin: ^1.0.1 - checksum: e8c2ad72df1f17e71268feabdb9bb0153ed2c7d38a05b759c5c49cf368a754bdd3c0e8a279fbc8d707802ff91d2cf144a995e6ebd5534de2848d52ab2c14034d - languageName: node - linkType: hard - -"read-package-json@npm:^5.0.0": - version: 5.0.2 - resolution: "read-package-json@npm:5.0.2" - dependencies: - glob: ^8.0.1 - json-parse-even-better-errors: ^2.3.1 - normalize-package-data: ^4.0.0 - npm-normalize-package-bin: ^2.0.0 - checksum: 0882ac9cec1bc92fb5515e9727611fb2909351e1e5c840dce3503cbb25b4cd48eb44b61071986e0fc51043208161f07d364a7336206c8609770186818753b51a - languageName: node - linkType: hard - -"read-package-json@npm:^6.0.0": +"read-package-json@npm:6.0.4, read-package-json@npm:^6.0.0": version: 6.0.4 resolution: "read-package-json@npm:6.0.4" dependencies: @@ -13888,12 +13332,12 @@ __metadata: languageName: node linkType: hard -"read@npm:1, read@npm:^1.0.7": - version: 1.0.7 - resolution: "read@npm:1.0.7" +"read@npm:^2.0.0": + version: 2.1.0 + resolution: "read@npm:2.1.0" dependencies: - mute-stream: ~0.0.4 - checksum: 2777c254e5732cac96f5d0a1c0f6b836c89ae23d8febd405b206f6f24d5de1873420f1a0795e0e3721066650d19adf802c7882c4027143ee0acf942a4f34f97b + mute-stream: ~1.0.0 + checksum: e745999138022b56d32daf7cce9b7552b2ec648e4e2578d076a410575a0a400faf74f633dd74ef1b1c42563397d322c1ad5a0068471c38978b02ef97056c2991 languageName: node linkType: hard @@ -13935,18 +13379,6 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:^4.1.0": - version: 4.4.0 - resolution: "readable-stream@npm:4.4.0" - dependencies: - abort-controller: ^3.0.0 - buffer: ^6.0.3 - events: ^3.3.0 - process: ^0.11.10 - checksum: cc1630c2de134aee92646e77b1770019633000c408fd48609babf2caa53f00ca794928023aa9ad3d435a1044cec87d2ce7e2b7389dd1caf948b65c175edb7f52 - languageName: node - linkType: hard - "readable-stream@npm:~1.0.15": version: 1.0.34 resolution: "readable-stream@npm:1.0.34" @@ -14272,9 +13704,9 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^3.23.1": - version: 3.23.1 - resolution: "rollup@npm:3.23.1" +"rollup@npm:^3.24.0": + version: 3.24.0 + resolution: "rollup@npm:3.24.0" dependencies: fsevents: ~2.3.2 dependenciesMeta: @@ -14282,7 +13714,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 4b3b3bbfd490b41ec5473d1141fe2beb0c86f600b56378fce97e0485192818256f8cbf4d43450b097ee7042e6629fb0187488807e2d15050860718f458c44685 + checksum: 373d0062a79cfce3583d4f6b7ab8ac9aa3201a9af1fa20b24f61a4ddea95a45974c4a8baed3087cb4e7bfc34a9dcd6774b7a635eb071ba52f97f51a59e860d6e languageName: node linkType: hard @@ -14295,12 +13727,12 @@ __metadata: "@testing-library/react": ^14.0.0 "@testing-library/user-event": ^14.4.3 "@types/big.js": ^6.1.6 - "@types/eslint": ^8.40.0 + "@types/eslint": ^8.40.1 "@types/events": ^3.0.0 "@types/node": ^20.2.5 - "@types/react": ^18.2.8 + "@types/react": ^18.2.9 "@types/react-dom": ^18.2.4 - "@types/uuid": ^9.0.1 + "@types/uuid": ^9.0.2 "@typescript-eslint/eslint-plugin": ^5.59.9 "@typescript-eslint/parser": ^5.59.9 cpy-cli: ^4.2.0 @@ -14313,7 +13745,7 @@ __metadata: eslint-plugin-prettier: ^4.2.1 eslint-plugin-react: ^7.32.2 eslint-plugin-react-hooks: ^4.6.0 - lerna: ^6.6.2 + lerna: ^7.0.0 prettier: ^2.8.8 react: ^18.2.0 react-dom: ^18.2.0 @@ -14485,17 +13917,6 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.3.8": - version: 7.3.8 - resolution: "semver@npm:7.3.8" - dependencies: - lru-cache: ^6.0.0 - bin: - semver: bin/semver.js - checksum: ba9c7cbbf2b7884696523450a61fee1a09930d888b7a8d7579025ad93d459b2d1949ee5bbfeb188b2be5f4ac163544c5e98491ad6152df34154feebc2cc337c1 - languageName: node - linkType: hard - "semver@npm:^6.0.0, semver@npm:^6.1.1, semver@npm:^6.1.2, semver@npm:^6.3.0": version: 6.3.0 resolution: "semver@npm:6.3.0" @@ -14661,7 +14082,7 @@ __metadata: languageName: node linkType: hard -"sigstore@npm:^1.0.0, sigstore@npm:^1.3.0, sigstore@npm:^1.4.0": +"sigstore@npm:^1.3.0, sigstore@npm:^1.4.0": version: 1.5.2 resolution: "sigstore@npm:1.5.2" dependencies: @@ -14805,7 +14226,7 @@ __metadata: languageName: node linkType: hard -"split2@npm:^3.0.0": +"split2@npm:^3.0.0, split2@npm:^3.2.2": version: 3.2.2 resolution: "split2@npm:3.2.2" dependencies: @@ -14814,7 +14235,7 @@ __metadata: languageName: node linkType: hard -"split@npm:^1.0.0": +"split@npm:^1.0.0, split@npm:^1.0.1": version: 1.0.1 resolution: "split@npm:1.0.1" dependencies: @@ -14851,15 +14272,6 @@ __metadata: languageName: node linkType: hard -"ssri@npm:9.0.1, ssri@npm:^9.0.0": - version: 9.0.1 - resolution: "ssri@npm:9.0.1" - dependencies: - minipass: ^3.1.1 - checksum: fb58f5e46b6923ae67b87ad5ef1c5ab6d427a17db0bead84570c2df3cd50b4ceb880ebdba2d60726588272890bae842a744e1ecce5bd2a2a582fccd5068309eb - languageName: node - linkType: hard - "ssri@npm:^10.0.0, ssri@npm:^10.0.1": version: 10.0.4 resolution: "ssri@npm:10.0.4" @@ -14869,6 +14281,15 @@ __metadata: languageName: node linkType: hard +"ssri@npm:^9.0.0, ssri@npm:^9.0.1": + version: 9.0.1 + resolution: "ssri@npm:9.0.1" + dependencies: + minipass: ^3.1.1 + checksum: fb58f5e46b6923ae67b87ad5ef1c5ab6d427a17db0bead84570c2df3cd50b4ceb880ebdba2d60726588272890bae842a744e1ecce5bd2a2a582fccd5068309eb + languageName: node + linkType: hard + "stack-utils@npm:^2.0.3": version: 2.0.6 resolution: "stack-utils@npm:2.0.6" @@ -15286,26 +14707,6 @@ __metadata: languageName: node linkType: hard -"temp-dir@npm:^2.0.0": - version: 2.0.0 - resolution: "temp-dir@npm:2.0.0" - checksum: cc4f0404bf8d6ae1a166e0e64f3f409b423f4d1274d8c02814a59a5529f07db6cd070a749664141b992b2c1af337fa9bb451a460a43bb9bcddc49f235d3115aa - languageName: node - linkType: hard - -"tempy@npm:1.0.0": - version: 1.0.0 - resolution: "tempy@npm:1.0.0" - dependencies: - del: ^6.0.0 - is-stream: ^2.0.0 - temp-dir: ^2.0.0 - type-fest: ^0.16.0 - unique-string: ^2.0.0 - checksum: 11541b9d4c5b6b6e4912ded3058cfb5a1294dcc0519b73fc1fc74f950f9a68cd380f78cbefe38514ac9233f749efc6486ac14592dcb29ad35a9b3807328cba1b - languageName: node - linkType: hard - "text-encoding-utf-8@npm:^1.0.2": version: 1.0.2 resolution: "text-encoding-utf-8@npm:1.0.2" @@ -15432,13 +14833,6 @@ __metadata: languageName: node linkType: hard -"treeverse@npm:^3.0.0": - version: 3.0.0 - resolution: "treeverse@npm:3.0.0" - checksum: 73168d9887fa57b0719218f176c5a3cfbaaf310922879acb4adf76665bc17dcdb6ed3e4163f0c27eee17e346886186a1515ea6f87e96cdc10df1dce13bf622a0 - languageName: node - linkType: hard - "trim-newlines@npm:^3.0.0": version: 3.0.1 resolution: "trim-newlines@npm:3.0.1" @@ -15537,13 +14931,6 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^0.16.0": - version: 0.16.0 - resolution: "type-fest@npm:0.16.0" - checksum: 1a4102c06dc109db00418c753062e206cab65befd469d000ece4452ee649bf2a9cf57686d96fb42326bc9d918d9a194d4452897b486dcc41989e5c99e4e87094 - languageName: node - linkType: hard - "type-fest@npm:^0.18.0": version: 0.18.1 resolution: "type-fest@npm:0.18.1" @@ -15644,17 +15031,7 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^3 || ^4": - version: 4.9.5 - resolution: "typescript@npm:4.9.5" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: ee000bc26848147ad423b581bd250075662a354d84f0e06eb76d3b892328d8d4440b7487b5a83e851b12b255f55d71835b008a66cbf8f255a11e4400159237db - languageName: node - linkType: hard - -"typescript@npm:^5.1.3": +"typescript@npm:>=3 < 6, typescript@npm:^5.1.3": version: 5.1.3 resolution: "typescript@npm:5.1.3" bin: @@ -15664,17 +15041,7 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@^3 || ^4#~builtin": - version: 4.9.5 - resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin::version=4.9.5&hash=289587" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: 1f8f3b6aaea19f0f67cba79057674ba580438a7db55057eb89cc06950483c5d632115c14077f6663ea76fd09fce3c190e6414bb98582ec80aa5a4eaf345d5b68 - languageName: node - linkType: hard - -"typescript@patch:typescript@^5.1.3#~builtin": +"typescript@patch:typescript@>=3 < 6#~builtin, typescript@patch:typescript@^5.1.3#~builtin": version: 5.1.3 resolution: "typescript@patch:typescript@npm%3A5.1.3#~builtin::version=5.1.3&hash=77c9e2" bin: @@ -15779,15 +15146,6 @@ __metadata: languageName: node linkType: hard -"unique-string@npm:^2.0.0": - version: 2.0.0 - resolution: "unique-string@npm:2.0.0" - dependencies: - crypto-random-string: ^2.0.0 - checksum: ef68f639136bcfe040cf7e3cd7a8dff076a665288122855148a6f7134092e6ed33bf83a7f3a9185e46c98dddc445a0da6ac25612afa1a7c38b8b654d6c02498e - languageName: node - linkType: hard - "universal-user-agent@npm:^6.0.0": version: 6.0.0 resolution: "universal-user-agent@npm:6.0.0" @@ -15816,7 +15174,7 @@ __metadata: languageName: node linkType: hard -"upath@npm:2.0.1, upath@npm:^2.0.1": +"upath@npm:2.0.1": version: 2.0.1 resolution: "upath@npm:2.0.1" checksum: 2db04f24a03ef72204c7b969d6991abec9e2cb06fb4c13a1fd1c59bc33b46526b16c3325e55930a11ff86a77a8cbbcda8f6399bf914087028c5beae21ecdb33c @@ -15879,7 +15237,7 @@ __metadata: languageName: node linkType: hard -"util-deprecate@npm:^1.0.1, util-deprecate@npm:^1.0.2, util-deprecate@npm:~1.0.1": +"util-deprecate@npm:^1.0.1, util-deprecate@npm:~1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" checksum: 474acf1146cb2701fe3b074892217553dfcf9a031280919ba1b8d651a068c9b15d863b7303cb15bd00a862b498e6cf4ad7b4a08fb134edd5a6f7641681cb54a2 @@ -15906,15 +15264,6 @@ __metadata: languageName: node linkType: hard -"uuid@npm:8.3.2, uuid@npm:^8.3.2": - version: 8.3.2 - resolution: "uuid@npm:8.3.2" - bin: - uuid: dist/bin/uuid - checksum: 5575a8a75c13120e2f10e6ddc801b2c7ed7d8f3c8ac22c7ed0c7b2ba6383ec0abda88c905085d630e251719e0777045ae3236f04c812184b7c765f63a70e58df - languageName: node - linkType: hard - "uuid@npm:^3.3.2": version: 3.4.0 resolution: "uuid@npm:3.4.0" @@ -15924,6 +15273,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:^8.3.2": + version: 8.3.2 + resolution: "uuid@npm:8.3.2" + bin: + uuid: dist/bin/uuid + checksum: 5575a8a75c13120e2f10e6ddc801b2c7ed7d8f3c8ac22c7ed0c7b2ba6383ec0abda88c905085d630e251719e0777045ae3236f04c812184b7c765f63a70e58df + languageName: node + linkType: hard + "uuid@npm:^9.0.0": version: 9.0.0 resolution: "uuid@npm:9.0.0" @@ -15950,12 +15308,12 @@ __metadata: languageName: node linkType: hard -"validate-npm-package-name@npm:4.0.0, validate-npm-package-name@npm:^4.0.0": - version: 4.0.0 - resolution: "validate-npm-package-name@npm:4.0.0" +"validate-npm-package-name@npm:5.0.0, validate-npm-package-name@npm:^5.0.0": + version: 5.0.0 + resolution: "validate-npm-package-name@npm:5.0.0" dependencies: builtins: ^5.0.0 - checksum: a32fd537bad17fcb59cfd58ae95a414d443866020d448ec3b22e8d40550cb585026582a57efbe1f132b882eea4da8ac38ee35f7be0dd72988a3cb55d305a20c1 + checksum: 5342a994986199b3c28e53a8452a14b2bb5085727691ea7aa0d284a6606b127c371e0925ae99b3f1ef7cc7d2c9de75f52eb61a3d1cc45e39bca1e3a9444cbb4e languageName: node linkType: hard @@ -15968,15 +15326,6 @@ __metadata: languageName: node linkType: hard -"validate-npm-package-name@npm:^5.0.0": - version: 5.0.0 - resolution: "validate-npm-package-name@npm:5.0.0" - dependencies: - builtins: ^5.0.0 - checksum: 5342a994986199b3c28e53a8452a14b2bb5085727691ea7aa0d284a6606b127c371e0925ae99b3f1ef7cc7d2c9de75f52eb61a3d1cc45e39bca1e3a9444cbb4e - languageName: node - linkType: hard - "varint@npm:^5.0.0": version: 5.0.2 resolution: "varint@npm:5.0.2" @@ -16046,13 +15395,6 @@ __metadata: languageName: node linkType: hard -"walk-up-path@npm:^1.0.0": - version: 1.0.0 - resolution: "walk-up-path@npm:1.0.0" - checksum: b8019ac4fb9ba1576839ec66d2217f62ab773c1cc4c704bfd1c79b1359fef5366f1382d3ab230a66a14c3adb1bf0fe102d1fdaa3437881e69154dfd1432abd32 - languageName: node - linkType: hard - "wcwidth@npm:^1.0.0, wcwidth@npm:^1.0.1": version: 1.0.1 resolution: "wcwidth@npm:1.0.1" @@ -16546,13 +15888,13 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:4.0.1": - version: 4.0.1 - resolution: "write-file-atomic@npm:4.0.1" +"write-file-atomic@npm:5.0.1": + version: 5.0.1 + resolution: "write-file-atomic@npm:5.0.1" dependencies: imurmurhash: ^0.1.4 - signal-exit: ^3.0.7 - checksum: 8f780232533ca6223c63c9b9c01c4386ca8c625ebe5017a9ed17d037aec19462ae17109e0aa155bff5966ee4ae7a27b67a99f55caf3f32ffd84155e9da3929fc + signal-exit: ^4.0.1 + checksum: 8dbb0e2512c2f72ccc20ccedab9986c7d02d04039ed6e8780c987dc4940b793339c50172a1008eed7747001bfacc0ca47562668a069a7506c46c77d7ba3926a9 languageName: node linkType: hard @@ -16567,16 +15909,6 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^5.0.0": - version: 5.0.1 - resolution: "write-file-atomic@npm:5.0.1" - dependencies: - imurmurhash: ^0.1.4 - signal-exit: ^4.0.1 - checksum: 8dbb0e2512c2f72ccc20ccedab9986c7d02d04039ed6e8780c987dc4940b793339c50172a1008eed7747001bfacc0ca47562668a069a7506c46c77d7ba3926a9 - languageName: node - linkType: hard - "write-json-file@npm:^3.2.0": version: 3.2.0 resolution: "write-json-file@npm:3.2.0" From 14c05de5376b7a162c8c121f9903f762f1d580cd Mon Sep 17 00:00:00 2001 From: Eugene Chybisov Date: Fri, 9 Jun 2023 17:00:25 +0200 Subject: [PATCH 09/13] refactor: code terminology cleanup --- packages/widget-embedded/src/config.ts | 2 +- packages/widget-embedded/src/index.tsx | 6 -- packages/widget-playground/src/config.ts | 4 +- packages/widget-playground/src/index.tsx | 1 - packages/widget/src/App.tsx | 4 +- packages/widget/src/AppProvider.tsx | 10 +-- packages/widget/src/AppRoutes.tsx | 20 ++--- .../src/components/ActiveSwaps/index.ts | 2 - .../ActiveTransactionItem.tsx} | 4 +- .../ActiveTransactions.style.ts} | 0 .../ActiveTransactions.tsx} | 8 +- .../components/ActiveTransactions/index.ts | 2 + .../AmountInput.style.tsx} | 0 .../AmountInput.tsx} | 30 +++---- .../AmountInputAdornment.style.tsx} | 0 .../AmountInputEndAdornment.tsx} | 14 ++-- .../AmountInputStartAdornment.tsx} | 10 +-- .../FormPriceHelperText.tsx | 16 ++-- .../src/components/AmountInput/index.ts | 1 + .../components/ChainSelect/ChainSelect.tsx | 8 +- .../components/ChainSelect/useChainSelect.ts | 16 ++-- .../DefaultTransactionButton.tsx | 48 +++++++++++ .../DefaultTransactionButton/index.ts | 2 + .../DefaultTransactionButton/types.ts | 6 ++ .../src/components/Header/NavigationTabs.tsx | 8 +- .../Insurance/InsuranceCollapsed.tsx | 4 +- packages/widget/src/components/NFT/NFT.tsx | 14 ++-- .../ReverseTokensButton.tsx | 20 ++--- .../RouteCard.style.ts} | 0 .../RouteCard.tsx} | 10 +-- .../RouteCardEssentials.tsx} | 11 +-- .../RouteCardSkeleton.tsx} | 9 ++- .../RouteNotFoundCard.tsx} | 2 +- .../widget/src/components/RouteCard/index.ts | 3 + .../{SwapRouteCard => RouteCard}/types.ts | 6 +- .../{SwapRouteCard => RouteCard}/utils.ts | 0 .../SwapRoutes.tsx => Routes/Routes.tsx} | 22 +++--- .../RoutesExpanded.style.ts} | 0 .../RoutesExpanded.tsx} | 24 +++--- .../widget/src/components/Routes/index.ts | 2 + .../src/components/SelectChainAndToken.tsx | 10 +-- .../SelectTokenButton/SelectTokenButton.tsx | 10 +-- .../components/SendToWallet/SendToWallet.tsx | 14 ++-- .../SendToWallet/SendToWalletButton.tsx | 4 +- .../src/components/SwapButton/SwapButton.tsx | 79 ------------------- .../widget/src/components/SwapButton/index.ts | 2 - .../widget/src/components/SwapButton/types.ts | 9 --- .../widget/src/components/SwapInput/index.ts | 1 - .../src/components/SwapRouteCard/index.ts | 3 - .../widget/src/components/SwapRoutes/index.ts | 2 - .../src/components/TokenList/TokenList.tsx | 6 +- .../components/TokenList/TokenNotFound.tsx | 8 +- .../widget/src/components/TokenList/types.ts | 4 +- .../components/TokenList/useTokenSelect.ts | 23 +++--- packages/widget/src/hooks/index.ts | 2 +- packages/widget/src/hooks/useChains.ts | 15 ++-- .../widget/src/hooks/useFundsSufficiency.ts | 8 +- packages/widget/src/hooks/useGasRefuel.ts | 10 +-- .../widget/src/hooks/useRouteExecution.ts | 2 - .../hooks/{useSwapRoutes.ts => useRoutes.ts} | 26 +++--- .../widget/src/pages/ActiveSwapsPage/index.ts | 1 - .../ActiveTransactionsEmpty.tsx} | 2 +- .../ActiveTransactionsPage.tsx} | 10 +-- .../src/pages/ActiveTransactionsPage/index.ts | 1 + .../src/pages/MainPage/MainGasMessage.tsx | 4 +- .../widget/src/pages/MainPage/MainPage.tsx | 16 ++-- .../src/pages/MainPage/MainSwapButton.tsx | 33 -------- .../src/pages/MainPage/ReviewButton.tsx | 67 ++++++++++++++++ .../RoutesPage.style.ts} | 0 .../RoutesPage.tsx} | 38 ++++----- packages/widget/src/pages/RoutesPage/index.ts | 1 + .../widget/src/pages/SelectChainPage/types.ts | 4 +- .../SelectNativeTokenPage.tsx | 4 +- .../SelectTokenPage/SearchTokenInput.tsx | 6 +- .../pages/SelectTokenPage/SelectTokenPage.tsx | 4 +- .../widget/src/pages/SwapDetailsPage/index.ts | 1 - .../widget/src/pages/SwapHistoryPage/index.ts | 1 - packages/widget/src/pages/SwapPage/index.ts | 1 - packages/widget/src/pages/SwapPage/types.ts | 10 --- .../widget/src/pages/SwapRoutesPage/index.ts | 1 - .../TransactionDetailsPage.style.tsx} | 0 .../TransactionDetailsPage.tsx} | 4 +- .../src/pages/TransactionDetailsPage/index.ts | 1 + .../TransactionHistoryEmpty.tsx} | 2 +- .../TransactionHistoryItem.tsx} | 2 +- .../TransactionHistoryPage.tsx} | 26 +++--- .../src/pages/TransactionHistoryPage/index.ts | 1 + .../ExchangeRateBottomSheet.tsx | 0 .../StartTransactionButton.tsx} | 30 +++---- .../StatusBottomSheet.style.tsx | 0 .../StatusBottomSheet.tsx | 16 ++-- .../TokenValueBottomSheet.tsx | 0 .../TransactionPage.style.tsx} | 0 .../TransactionPage.tsx} | 27 ++++--- .../widget/src/pages/TransactionPage/index.ts | 1 + .../widget/src/pages/TransactionPage/types.ts | 8 ++ .../{SwapPage => TransactionPage}/utils.ts | 0 .../FormProvider.tsx} | 33 ++++---- .../FormUpdater.tsx | 38 ++++----- .../URLSearchParamsBuilder.tsx | 14 ++-- .../index.ts | 2 +- .../src/providers/FormProvider/types.ts | 44 +++++++++++ .../src/providers/SwapFormProvider/types.ts | 44 ----------- packages/widget/src/providers/index.ts | 2 +- .../routes/createRouteExecutionStore.ts | 2 +- packages/widget/src/stores/routes/index.ts | 2 +- ...wapHistory.ts => useTransactionHistory.ts} | 2 +- packages/widget/src/types/widget.ts | 2 +- 108 files changed, 525 insertions(+), 570 deletions(-) delete mode 100644 packages/widget/src/components/ActiveSwaps/index.ts rename packages/widget/src/components/{ActiveSwaps/ActiveSwapItem.tsx => ActiveTransactions/ActiveTransactionItem.tsx} (96%) rename packages/widget/src/components/{ActiveSwaps/ActiveSwaps.style.ts => ActiveTransactions/ActiveTransactions.style.ts} (100%) rename packages/widget/src/components/{ActiveSwaps/ActiveSwaps.tsx => ActiveTransactions/ActiveTransactions.tsx} (81%) create mode 100644 packages/widget/src/components/ActiveTransactions/index.ts rename packages/widget/src/components/{SwapInput/SwapInput.style.tsx => AmountInput/AmountInput.style.tsx} (100%) rename packages/widget/src/components/{SwapInput/SwapInput.tsx => AmountInput/AmountInput.tsx} (79%) rename packages/widget/src/components/{SwapInput/SwapInputAdornment.style.tsx => AmountInput/AmountInputAdornment.style.tsx} (100%) rename packages/widget/src/components/{SwapInput/SwapInputEndAdornment.tsx => AmountInput/AmountInputEndAdornment.tsx} (80%) rename packages/widget/src/components/{SwapInput/SwapInputStartAdornment.tsx => AmountInput/AmountInputStartAdornment.tsx} (66%) rename packages/widget/src/components/{SwapInput => AmountInput}/FormPriceHelperText.tsx (84%) create mode 100644 packages/widget/src/components/AmountInput/index.ts create mode 100644 packages/widget/src/components/DefaultTransactionButton/DefaultTransactionButton.tsx create mode 100644 packages/widget/src/components/DefaultTransactionButton/index.ts create mode 100644 packages/widget/src/components/DefaultTransactionButton/types.ts rename packages/widget/src/components/{SwapRouteCard/SwapRouteCard.style.ts => RouteCard/RouteCard.style.ts} (100%) rename packages/widget/src/components/{SwapRouteCard/SwapRouteCard.tsx => RouteCard/RouteCard.tsx} (95%) rename packages/widget/src/components/{SwapRouteCard/SwapRouteCardEssentials.tsx => RouteCard/RouteCardEssentials.tsx} (94%) rename packages/widget/src/components/{SwapRouteCard/SwapRouteCardSkeleton.tsx => RouteCard/RouteCardSkeleton.tsx} (90%) rename packages/widget/src/components/{SwapRouteCard/SwapRouteNotFoundCard.tsx => RouteCard/RouteNotFoundCard.tsx} (93%) create mode 100644 packages/widget/src/components/RouteCard/index.ts rename packages/widget/src/components/{SwapRouteCard => RouteCard}/types.ts (61%) rename packages/widget/src/components/{SwapRouteCard => RouteCard}/utils.ts (100%) rename packages/widget/src/components/{SwapRoutes/SwapRoutes.tsx => Routes/Routes.tsx} (78%) rename packages/widget/src/components/{SwapRoutes/SwapRoutesExpanded.style.ts => Routes/RoutesExpanded.style.ts} (100%) rename packages/widget/src/components/{SwapRoutes/SwapRoutesExpanded.tsx => Routes/RoutesExpanded.tsx} (87%) create mode 100644 packages/widget/src/components/Routes/index.ts delete mode 100644 packages/widget/src/components/SwapButton/SwapButton.tsx delete mode 100644 packages/widget/src/components/SwapButton/index.ts delete mode 100644 packages/widget/src/components/SwapButton/types.ts delete mode 100644 packages/widget/src/components/SwapInput/index.ts delete mode 100644 packages/widget/src/components/SwapRouteCard/index.ts delete mode 100644 packages/widget/src/components/SwapRoutes/index.ts rename packages/widget/src/hooks/{useSwapRoutes.ts => useRoutes.ts} (94%) delete mode 100644 packages/widget/src/pages/ActiveSwapsPage/index.ts rename packages/widget/src/pages/{ActiveSwapsPage/ActiveSwapsEmpty.tsx => ActiveTransactionsPage/ActiveTransactionsEmpty.tsx} (93%) rename packages/widget/src/pages/{ActiveSwapsPage/ActiveSwapsPage.tsx => ActiveTransactionsPage/ActiveTransactionsPage.tsx} (87%) create mode 100644 packages/widget/src/pages/ActiveTransactionsPage/index.ts delete mode 100644 packages/widget/src/pages/MainPage/MainSwapButton.tsx create mode 100644 packages/widget/src/pages/MainPage/ReviewButton.tsx rename packages/widget/src/pages/{SwapRoutesPage/SwapRoutesPage.style.ts => RoutesPage/RoutesPage.style.ts} (100%) rename packages/widget/src/pages/{SwapRoutesPage/SwapRoutesPage.tsx => RoutesPage/RoutesPage.tsx} (69%) create mode 100644 packages/widget/src/pages/RoutesPage/index.ts delete mode 100644 packages/widget/src/pages/SwapDetailsPage/index.ts delete mode 100644 packages/widget/src/pages/SwapHistoryPage/index.ts delete mode 100644 packages/widget/src/pages/SwapPage/index.ts delete mode 100644 packages/widget/src/pages/SwapPage/types.ts delete mode 100644 packages/widget/src/pages/SwapRoutesPage/index.ts rename packages/widget/src/pages/{SwapDetailsPage/SwapDetailsPage.style.tsx => TransactionDetailsPage/TransactionDetailsPage.style.tsx} (100%) rename packages/widget/src/pages/{SwapDetailsPage/SwapDetailsPage.tsx => TransactionDetailsPage/TransactionDetailsPage.tsx} (97%) create mode 100644 packages/widget/src/pages/TransactionDetailsPage/index.ts rename packages/widget/src/pages/{SwapHistoryPage/SwapHistoryEmpty.tsx => TransactionHistoryPage/TransactionHistoryEmpty.tsx} (93%) rename packages/widget/src/pages/{SwapHistoryPage/SwapHistoryItem.tsx => TransactionHistoryPage/TransactionHistoryItem.tsx} (97%) rename packages/widget/src/pages/{SwapHistoryPage/SwapHistoryPage.tsx => TransactionHistoryPage/TransactionHistoryPage.tsx} (73%) create mode 100644 packages/widget/src/pages/TransactionHistoryPage/index.ts rename packages/widget/src/pages/{SwapPage => TransactionPage}/ExchangeRateBottomSheet.tsx (100%) rename packages/widget/src/pages/{SwapPage/StartSwapButton.tsx => TransactionPage/StartTransactionButton.tsx} (60%) rename packages/widget/src/pages/{SwapPage => TransactionPage}/StatusBottomSheet.style.tsx (100%) rename packages/widget/src/pages/{SwapPage => TransactionPage}/StatusBottomSheet.tsx (94%) rename packages/widget/src/pages/{SwapPage => TransactionPage}/TokenValueBottomSheet.tsx (100%) rename packages/widget/src/pages/{SwapPage/SwapPage.style.tsx => TransactionPage/TransactionPage.style.tsx} (100%) rename packages/widget/src/pages/{SwapPage/SwapPage.tsx => TransactionPage/TransactionPage.tsx} (91%) create mode 100644 packages/widget/src/pages/TransactionPage/index.ts create mode 100644 packages/widget/src/pages/TransactionPage/types.ts rename packages/widget/src/pages/{SwapPage => TransactionPage}/utils.ts (100%) rename packages/widget/src/providers/{SwapFormProvider/SwapFormProvider.tsx => FormProvider/FormProvider.tsx} (58%) rename packages/widget/src/providers/{SwapFormProvider => FormProvider}/FormUpdater.tsx (66%) rename packages/widget/src/providers/{SwapFormProvider => FormProvider}/URLSearchParamsBuilder.tsx (83%) rename packages/widget/src/providers/{SwapFormProvider => FormProvider}/index.ts (65%) create mode 100644 packages/widget/src/providers/FormProvider/types.ts delete mode 100644 packages/widget/src/providers/SwapFormProvider/types.ts rename packages/widget/src/stores/routes/{useSwapHistory.ts => useTransactionHistory.ts} (92%) diff --git a/packages/widget-embedded/src/config.ts b/packages/widget-embedded/src/config.ts index ac73bf37f..7aaa1e32f 100644 --- a/packages/widget-embedded/src/config.ts +++ b/packages/widget-embedded/src/config.ts @@ -12,7 +12,7 @@ export const widgetBaseConfig: WidgetConfig = { variant: 'nft', integrator: 'li.fi-playground', hiddenUI: ['history'], - buildSwapUrl: true, + buildUrl: true, sdkConfig: { // apiUrl: 'https://staging.li.quest/v1/', defaultRouteOptions: { diff --git a/packages/widget-embedded/src/index.tsx b/packages/widget-embedded/src/index.tsx index 2e8f7cf36..150f95282 100644 --- a/packages/widget-embedded/src/index.tsx +++ b/packages/widget-embedded/src/index.tsx @@ -41,12 +41,6 @@ root.render( - {/* - - } /> - } /> - - */} diff --git a/packages/widget-playground/src/config.ts b/packages/widget-playground/src/config.ts index ae7226242..9e3f4a547 100644 --- a/packages/widget-playground/src/config.ts +++ b/packages/widget-playground/src/config.ts @@ -31,7 +31,7 @@ export const widgetBaseConfig: WidgetConfig = { deny: [], }, // useRecommendedRoute: true, - buildSwapUrl: true, + buildUrl: true, // hiddenUI: ['poweredBy', 'language', 'appearance', 'drawerButton'], // disabledUI: ['toAddress', 'fromAmount', 'toToken', 'fromToken'], // requiredUI: ['toAddress'], @@ -136,7 +136,7 @@ export const widgetBaseConfig: WidgetConfig = { }, // languageResources: { // en: { - // button: { swap: 'Test' }, + // button: { exchange: 'Test' }, // }, // es, // }, diff --git a/packages/widget-playground/src/index.tsx b/packages/widget-playground/src/index.tsx index 0d99587a9..5b28123fa 100644 --- a/packages/widget-playground/src/index.tsx +++ b/packages/widget-playground/src/index.tsx @@ -17,7 +17,6 @@ root.render( - } /> } /> diff --git a/packages/widget/src/App.tsx b/packages/widget/src/App.tsx index e08577c3c..1ccbf8397 100644 --- a/packages/widget/src/App.tsx +++ b/packages/widget/src/App.tsx @@ -11,7 +11,7 @@ import { import { Header } from './components/Header'; import { Initializer } from './components/Initializer'; import { PoweredBy } from './components/PoweredBy'; -import { SwapRoutesExpanded } from './components/SwapRoutes'; +import { RoutesExpanded } from './components/Routes'; import { useExpandableVariant } from './hooks'; import type { WidgetConfig, WidgetProps } from './types'; @@ -49,7 +49,7 @@ export const AppDefault = () => { - {expandable ? : null} + {expandable ? : null} ); }; diff --git a/packages/widget/src/AppProvider.tsx b/packages/widget/src/AppProvider.tsx index 8ece9fbf9..d48ac7bba 100644 --- a/packages/widget/src/AppProvider.tsx +++ b/packages/widget/src/AppProvider.tsx @@ -4,9 +4,9 @@ import { Fragment } from 'react'; import { MemoryRouter, useInRouterContext } from 'react-router-dom'; import { queryClient } from './config/queryClient'; import { + FormProvider, I18nProvider, SDKProvider, - SwapFormProvider, ThemeProvider, URLSearchParamsBuilder, WalletProvider, @@ -28,9 +28,9 @@ export const AppProvider: React.FC> = ({ - + {children} - + @@ -42,13 +42,13 @@ export const AppProvider: React.FC> = ({ }; export const AppRouter: React.FC> = ({ children }) => { - const { buildSwapUrl } = useWidgetConfig(); + const { buildUrl } = useWidgetConfig(); const inRouterContext = useInRouterContext(); const Router = inRouterContext ? Fragment : MemoryRouter; return ( {children} - {buildSwapUrl ? : null} + {buildUrl ? : null} ); }; diff --git a/packages/widget/src/AppRoutes.tsx b/packages/widget/src/AppRoutes.tsx index d693136cb..7335d0760 100644 --- a/packages/widget/src/AppRoutes.tsx +++ b/packages/widget/src/AppRoutes.tsx @@ -1,16 +1,16 @@ import { useRoutes } from 'react-router-dom'; import { NotFound } from './components/NotFound'; -import { ActiveSwapsPage } from './pages/ActiveSwapsPage'; +import { ActiveTransactionsPage } from './pages/ActiveTransactionsPage'; import { MainPage } from './pages/MainPage'; +import { RoutesPage } from './pages/RoutesPage'; import { SelectChainPage } from './pages/SelectChainPage'; import { SelectEnabledToolsPage } from './pages/SelectEnabledToolsPage'; import { SelectTokenPage } from './pages/SelectTokenPage'; import { SelectWalletPage } from './pages/SelectWalletPage'; import { SettingsPage } from './pages/SettingsPage'; -import { SwapDetailsPage } from './pages/SwapDetailsPage'; -import { SwapHistoryPage } from './pages/SwapHistoryPage'; -import { SwapPage } from './pages/SwapPage'; -import { SwapRoutesPage } from './pages/SwapRoutesPage'; +import { TransactionDetailsPage } from './pages/TransactionDetailsPage'; +import { TransactionHistoryPage } from './pages/TransactionHistoryPage'; +import { TransactionPage } from './pages/TransactionPage'; import { navigationRoutes } from './utils'; export const AppRoutes = () => { @@ -53,19 +53,19 @@ export const AppRoutes = () => { }, { path: navigationRoutes.routes, - element: , + element: , }, { path: navigationRoutes.activeTransactions, - element: , + element: , }, { path: navigationRoutes.transactionHistory, - element: , + element: , }, { path: `${navigationRoutes.transactionHistory}?/${navigationRoutes.routes}?/${navigationRoutes.transactionExecution}?/${navigationRoutes.transactionDetails}`, - element: , + element: , }, { path: `${navigationRoutes.routes}?/${navigationRoutes.transactionExecution}?/${navigationRoutes.selectWallet}`, @@ -73,7 +73,7 @@ export const AppRoutes = () => { }, { path: `${navigationRoutes.routes}?/${navigationRoutes.activeTransactions}?/${navigationRoutes.transactionExecution}`, - element: , + element: , }, { path: '*', diff --git a/packages/widget/src/components/ActiveSwaps/index.ts b/packages/widget/src/components/ActiveSwaps/index.ts deleted file mode 100644 index 68e0ff52c..000000000 --- a/packages/widget/src/components/ActiveSwaps/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './ActiveSwapItem'; -export * from './ActiveSwaps'; diff --git a/packages/widget/src/components/ActiveSwaps/ActiveSwapItem.tsx b/packages/widget/src/components/ActiveTransactions/ActiveTransactionItem.tsx similarity index 96% rename from packages/widget/src/components/ActiveSwaps/ActiveSwapItem.tsx rename to packages/widget/src/components/ActiveTransactions/ActiveTransactionItem.tsx index 0b3fc4765..64be3bdec 100644 --- a/packages/widget/src/components/ActiveSwaps/ActiveSwapItem.tsx +++ b/packages/widget/src/components/ActiveTransactions/ActiveTransactionItem.tsx @@ -8,9 +8,9 @@ import { RouteExecutionStatus } from '../../stores'; import { navigationRoutes } from '../../utils'; import { StepTimer } from '../Step/StepTimer'; import { TokenAvatar, TokenAvatarGroup } from '../TokenAvatar'; -import { ListItem, ListItemButton } from './ActiveSwaps.style'; +import { ListItem, ListItemButton } from './ActiveTransactions.style'; -export const ActiveSwapItem: React.FC<{ +export const ActiveTransactionItem: React.FC<{ routeId: string; dense?: boolean; }> = ({ routeId, dense }) => { diff --git a/packages/widget/src/components/ActiveSwaps/ActiveSwaps.style.ts b/packages/widget/src/components/ActiveTransactions/ActiveTransactions.style.ts similarity index 100% rename from packages/widget/src/components/ActiveSwaps/ActiveSwaps.style.ts rename to packages/widget/src/components/ActiveTransactions/ActiveTransactions.style.ts diff --git a/packages/widget/src/components/ActiveSwaps/ActiveSwaps.tsx b/packages/widget/src/components/ActiveTransactions/ActiveTransactions.tsx similarity index 81% rename from packages/widget/src/components/ActiveSwaps/ActiveSwaps.tsx rename to packages/widget/src/components/ActiveTransactions/ActiveTransactions.tsx index 72a77f725..3b03b017c 100644 --- a/packages/widget/src/components/ActiveSwaps/ActiveSwaps.tsx +++ b/packages/widget/src/components/ActiveTransactions/ActiveTransactions.tsx @@ -6,10 +6,10 @@ import { useWallet } from '../../providers'; import { useExecutingRoutesIds } from '../../stores'; import { navigationRoutes } from '../../utils'; import { Card, CardTitle } from '../Card'; -import { ActiveSwapItem } from './ActiveSwapItem'; -import { ShowAllButton } from './ActiveSwaps.style'; +import { ActiveTransactionItem } from './ActiveTransactionItem'; +import { ShowAllButton } from './ActiveTransactions.style'; -export const ActiveSwaps: React.FC = (props) => { +export const ActiveTransactions: React.FC = (props) => { const { t } = useTranslation(); const navigate = useNavigate(); const { account } = useWallet(); @@ -30,7 +30,7 @@ export const ActiveSwaps: React.FC = (props) => { {t('header.activeTransactions')} {executingRoutes.slice(0, 2).map((routeId) => ( - + ))} {hasShowAll ? ( diff --git a/packages/widget/src/components/ActiveTransactions/index.ts b/packages/widget/src/components/ActiveTransactions/index.ts new file mode 100644 index 000000000..32c3a4b1a --- /dev/null +++ b/packages/widget/src/components/ActiveTransactions/index.ts @@ -0,0 +1,2 @@ +export * from './ActiveTransactionItem'; +export * from './ActiveTransactions'; diff --git a/packages/widget/src/components/SwapInput/SwapInput.style.tsx b/packages/widget/src/components/AmountInput/AmountInput.style.tsx similarity index 100% rename from packages/widget/src/components/SwapInput/SwapInput.style.tsx rename to packages/widget/src/components/AmountInput/AmountInput.style.tsx diff --git a/packages/widget/src/components/SwapInput/SwapInput.tsx b/packages/widget/src/components/AmountInput/AmountInput.tsx similarity index 79% rename from packages/widget/src/components/SwapInput/SwapInput.tsx rename to packages/widget/src/components/AmountInput/AmountInput.tsx index 34c5d5c69..2312a9eee 100644 --- a/packages/widget/src/components/SwapInput/SwapInput.tsx +++ b/packages/widget/src/components/AmountInput/AmountInput.tsx @@ -5,41 +5,41 @@ import { useLayoutEffect, useRef } from 'react'; import { useController, useWatch } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { useToken } from '../../hooks'; -import type { SwapFormTypeProps } from '../../providers'; -import { SwapFormKeyHelper, useWidgetConfig } from '../../providers'; +import type { FormTypeProps } from '../../providers'; +import { FormKeyHelper, useWidgetConfig } from '../../providers'; import { DisabledUI } from '../../types'; import { fitInputText, formatInputAmount } from '../../utils'; import { Card, CardTitle } from '../Card'; -import { FormPriceHelperText } from './FormPriceHelperText'; import { FormControl, Input, maxInputFontSize, minInputFontSize, -} from './SwapInput.style'; -import { SwapInputEndAdornment } from './SwapInputEndAdornment'; -import { SwapInputStartAdornment } from './SwapInputStartAdornment'; +} from './AmountInput.style'; +import { AmountInputEndAdornment } from './AmountInputEndAdornment'; +import { AmountInputStartAdornment } from './AmountInputStartAdornment'; +import { FormPriceHelperText } from './FormPriceHelperText'; -export const SwapInput: React.FC = ({ +export const AmountInput: React.FC = ({ formType, ...props }) => { const { disabledUI } = useWidgetConfig(); const [chainId, tokenAddress] = useWatch({ name: [ - SwapFormKeyHelper.getChainKey(formType), - SwapFormKeyHelper.getTokenKey(formType), + FormKeyHelper.getChainKey(formType), + FormKeyHelper.getTokenKey(formType), ], }); const { token } = useToken(chainId, tokenAddress); const disabled = disabledUI?.includes(DisabledUI.FromAmount); return ( - } + startAdornment={} endAdornment={ - !disabled ? : undefined + !disabled ? : undefined } bottomAdornment={} disabled={disabled} @@ -48,8 +48,8 @@ export const SwapInput: React.FC = ({ ); }; -export const SwapInputBase: React.FC< - SwapFormTypeProps & +export const AmountInputBase: React.FC< + FormTypeProps & BoxProps & { token?: Token; startAdornment?: ReactNode; @@ -67,7 +67,7 @@ export const SwapInputBase: React.FC< ...props }) => { const { t } = useTranslation(); - const amountKey = SwapFormKeyHelper.getAmountKey(formType); + const amountKey = FormKeyHelper.getAmountKey(formType); const { field: { onChange, onBlur, value }, } = useController({ diff --git a/packages/widget/src/components/SwapInput/SwapInputAdornment.style.tsx b/packages/widget/src/components/AmountInput/AmountInputAdornment.style.tsx similarity index 100% rename from packages/widget/src/components/SwapInput/SwapInputAdornment.style.tsx rename to packages/widget/src/components/AmountInput/AmountInputAdornment.style.tsx diff --git a/packages/widget/src/components/SwapInput/SwapInputEndAdornment.tsx b/packages/widget/src/components/AmountInput/AmountInputEndAdornment.tsx similarity index 80% rename from packages/widget/src/components/SwapInput/SwapInputEndAdornment.tsx rename to packages/widget/src/components/AmountInput/AmountInputEndAdornment.tsx index 4e1f0fad2..bcb08182e 100644 --- a/packages/widget/src/components/SwapInput/SwapInputEndAdornment.tsx +++ b/packages/widget/src/components/AmountInput/AmountInputEndAdornment.tsx @@ -7,19 +7,19 @@ import { useGasRecommendation, useTokenAddressBalance, } from '../../hooks'; -import type { SwapFormTypeProps } from '../../providers'; -import { SwapFormKeyHelper } from '../../providers'; +import type { FormTypeProps } from '../../providers'; +import { FormKeyHelper } from '../../providers'; import { formatTokenAmount } from '../../utils'; -import { Button } from './SwapInputAdornment.style'; +import { Button } from './AmountInputAdornment.style'; -export const SwapInputEndAdornment = ({ formType }: SwapFormTypeProps) => { +export const AmountInputEndAdornment = ({ formType }: FormTypeProps) => { const { t } = useTranslation(); const { setValue } = useFormContext(); const { getChainById } = useChains(); const [chainId, tokenAddress] = useWatch({ name: [ - SwapFormKeyHelper.getChainKey(formType), - SwapFormKeyHelper.getTokenKey(formType), + FormKeyHelper.getChainKey(formType), + FormKeyHelper.getTokenKey(formType), ], }); const { data } = useGasRecommendation(chainId); @@ -45,7 +45,7 @@ export const SwapInputEndAdornment = ({ formType }: SwapFormTypeProps) => { } } - setValue(SwapFormKeyHelper.getAmountKey(formType), maxAmount || '', { + setValue(FormKeyHelper.getAmountKey(formType), maxAmount || '', { shouldTouch: true, }); }; diff --git a/packages/widget/src/components/SwapInput/SwapInputStartAdornment.tsx b/packages/widget/src/components/AmountInput/AmountInputStartAdornment.tsx similarity index 66% rename from packages/widget/src/components/SwapInput/SwapInputStartAdornment.tsx rename to packages/widget/src/components/AmountInput/AmountInputStartAdornment.tsx index d103602dd..52cb8537c 100644 --- a/packages/widget/src/components/SwapInput/SwapInputStartAdornment.tsx +++ b/packages/widget/src/components/AmountInput/AmountInputStartAdornment.tsx @@ -1,16 +1,16 @@ import { useWatch } from 'react-hook-form'; import { useChain, useToken } from '../../hooks'; -import type { SwapFormTypeProps } from '../../providers'; -import { SwapFormKeyHelper } from '../../providers'; +import type { FormTypeProps } from '../../providers'; +import { FormKeyHelper } from '../../providers'; import { TokenAvatar, TokenAvatarDefault } from '../TokenAvatar'; -export const SwapInputStartAdornment: React.FC = ({ +export const AmountInputStartAdornment: React.FC = ({ formType, }) => { const [chainId, tokenAddress] = useWatch({ name: [ - SwapFormKeyHelper.getChainKey(formType), - SwapFormKeyHelper.getTokenKey(formType), + FormKeyHelper.getChainKey(formType), + FormKeyHelper.getTokenKey(formType), ], }); diff --git a/packages/widget/src/components/SwapInput/FormPriceHelperText.tsx b/packages/widget/src/components/AmountInput/FormPriceHelperText.tsx similarity index 84% rename from packages/widget/src/components/SwapInput/FormPriceHelperText.tsx rename to packages/widget/src/components/AmountInput/FormPriceHelperText.tsx index af84e5d66..fb0cb3501 100644 --- a/packages/widget/src/components/SwapInput/FormPriceHelperText.tsx +++ b/packages/widget/src/components/AmountInput/FormPriceHelperText.tsx @@ -3,17 +3,15 @@ import { FormHelperText, Skeleton, Typography } from '@mui/material'; import { useWatch } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { useTokenAddressBalance } from '../../hooks'; -import type { SwapFormTypeProps } from '../../providers'; -import { SwapFormKeyHelper } from '../../providers'; +import type { FormTypeProps } from '../../providers'; +import { FormKeyHelper } from '../../providers'; import { formatTokenAmount, formatTokenPrice } from '../../utils'; -export const FormPriceHelperText: React.FC = ({ - formType, -}) => { +export const FormPriceHelperText: React.FC = ({ formType }) => { const [chainId, tokenAddress] = useWatch({ name: [ - SwapFormKeyHelper.getChainKey(formType), - SwapFormKeyHelper.getTokenKey(formType), + FormKeyHelper.getChainKey(formType), + FormKeyHelper.getTokenKey(formType), ], }); @@ -30,7 +28,7 @@ export const FormPriceHelperText: React.FC = ({ }; export const FormPriceHelperTextBase: React.FC< - SwapFormTypeProps & { + FormTypeProps & { isLoading?: boolean; tokenAddress?: string; token?: TokenAmount; @@ -38,7 +36,7 @@ export const FormPriceHelperTextBase: React.FC< > = ({ formType, isLoading, tokenAddress, token }) => { const { t } = useTranslation(); const amount = useWatch({ - name: SwapFormKeyHelper.getAmountKey(formType), + name: FormKeyHelper.getAmountKey(formType), }); const fromAmountTokenPrice = formatTokenPrice(amount, token?.priceUSD); diff --git a/packages/widget/src/components/AmountInput/index.ts b/packages/widget/src/components/AmountInput/index.ts new file mode 100644 index 000000000..1b1107c21 --- /dev/null +++ b/packages/widget/src/components/AmountInput/index.ts @@ -0,0 +1 @@ +export * from './AmountInput'; diff --git a/packages/widget/src/components/ChainSelect/ChainSelect.tsx b/packages/widget/src/components/ChainSelect/ChainSelect.tsx index 76d0dd414..11bac45e1 100644 --- a/packages/widget/src/components/ChainSelect/ChainSelect.tsx +++ b/packages/widget/src/components/ChainSelect/ChainSelect.tsx @@ -3,14 +3,14 @@ import type { EVMChain } from '@lifi/sdk'; import { Avatar, Box, Skeleton, Tooltip, Typography } from '@mui/material'; import { useWatch } from 'react-hook-form'; import { useNavigate } from 'react-router-dom'; -import type { SwapFormTypeProps } from '../../providers'; -import { SwapFormKeyHelper } from '../../providers'; +import type { FormTypeProps } from '../../providers'; +import { FormKeyHelper } from '../../providers'; import { maxChainToOrder } from '../../stores'; import { navigationRoutes } from '../../utils'; import { ChainCard, ChainContainer } from './ChainSelect.style'; import { useChainSelect } from './useChainSelect'; -export const ChainSelect = ({ formType }: SwapFormTypeProps) => { +export const ChainSelect = ({ formType }: FormTypeProps) => { const navigate = useNavigate(); const { chainOrder, @@ -21,7 +21,7 @@ export const ChainSelect = ({ formType }: SwapFormTypeProps) => { setCurrentChain, } = useChainSelect(formType); const [chainId] = useWatch({ - name: [SwapFormKeyHelper.getChainKey(formType)], + name: [FormKeyHelper.getChainKey(formType)], }); const hasChainInOrderedList = chainOrder.includes(chainId); diff --git a/packages/widget/src/components/ChainSelect/useChainSelect.ts b/packages/widget/src/components/ChainSelect/useChainSelect.ts index dd15815a4..da26d4c4b 100644 --- a/packages/widget/src/components/ChainSelect/useChainSelect.ts +++ b/packages/widget/src/components/ChainSelect/useChainSelect.ts @@ -1,12 +1,12 @@ import type { EVMChain } from '@lifi/sdk'; import { useController, useFormContext } from 'react-hook-form'; import { useChains, useSwapOnly } from '../../hooks'; -import type { SwapFormType } from '../../providers'; -import { SwapFormKey, SwapFormKeyHelper } from '../../providers'; +import type { FormType } from '../../providers'; +import { FormKey, FormKeyHelper } from '../../providers'; import { useChainOrder } from '../../stores'; -export const useChainSelect = (formType: SwapFormType) => { - const chainKey = SwapFormKeyHelper.getChainKey(formType); +export const useChainSelect = (formType: FormType) => { + const chainKey = FormKeyHelper.getChainKey(formType); const { field: { onChange, onBlur }, } = useController({ name: chainKey }); @@ -30,13 +30,13 @@ export const useChainSelect = (formType: SwapFormType) => { onChange(chainId); onBlur(); if (swapOnly) { - setValue(SwapFormKeyHelper.getChainKey('to'), chainId, { + setValue(FormKeyHelper.getChainKey('to'), chainId, { shouldTouch: true, }); } - setValue(SwapFormKeyHelper.getTokenKey(formType), ''); - setValue(SwapFormKeyHelper.getAmountKey(formType), ''); - setValue(SwapFormKey.TokenSearchFilter, ''); + setValue(FormKeyHelper.getTokenKey(formType), ''); + setValue(FormKeyHelper.getAmountKey(formType), ''); + setValue(FormKey.TokenSearchFilter, ''); setChainOrder(chainId); }; diff --git a/packages/widget/src/components/DefaultTransactionButton/DefaultTransactionButton.tsx b/packages/widget/src/components/DefaultTransactionButton/DefaultTransactionButton.tsx new file mode 100644 index 000000000..eb32fa394 --- /dev/null +++ b/packages/widget/src/components/DefaultTransactionButton/DefaultTransactionButton.tsx @@ -0,0 +1,48 @@ +import { LoadingButton } from '@mui/lab'; +import { useTranslation } from 'react-i18next'; +import { useNavigate } from 'react-router-dom'; +import { useWallet, useWidgetConfig } from '../../providers'; +import { navigationRoutes } from '../../utils'; +import type { DefaultTransactionButtonProps } from './types'; + +export const DefaultTransactionButton: React.FC< + DefaultTransactionButtonProps +> = ({ onClick, text, disabled, loading }) => { + const { t } = useTranslation(); + const navigate = useNavigate(); + const { walletManagement } = useWidgetConfig(); + const { account, connect } = useWallet(); + + const handleClick = async () => { + if (account.isActive) { + onClick?.(); + } else if (walletManagement) { + await connect(); + } else { + navigate(navigationRoutes.selectWallet); + } + }; + + const getButtonText = () => { + if (account.isActive) { + if (text) { + return text; + } + } + return t(`button.connectWallet`); + }; + + return ( + + {getButtonText()} + + ); +}; diff --git a/packages/widget/src/components/DefaultTransactionButton/index.ts b/packages/widget/src/components/DefaultTransactionButton/index.ts new file mode 100644 index 000000000..c528ea73b --- /dev/null +++ b/packages/widget/src/components/DefaultTransactionButton/index.ts @@ -0,0 +1,2 @@ +export { DefaultTransactionButton } from './DefaultTransactionButton'; +export * from './types'; diff --git a/packages/widget/src/components/DefaultTransactionButton/types.ts b/packages/widget/src/components/DefaultTransactionButton/types.ts new file mode 100644 index 000000000..09ad6b2cd --- /dev/null +++ b/packages/widget/src/components/DefaultTransactionButton/types.ts @@ -0,0 +1,6 @@ +export interface DefaultTransactionButtonProps { + onClick?(): void; + text?: string; + disabled?: boolean; + loading?: boolean; +} diff --git a/packages/widget/src/components/Header/NavigationTabs.tsx b/packages/widget/src/components/Header/NavigationTabs.tsx index d1265444e..47545a330 100644 --- a/packages/widget/src/components/Header/NavigationTabs.tsx +++ b/packages/widget/src/components/Header/NavigationTabs.tsx @@ -1,6 +1,6 @@ import { useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; -import { SwapFormKey } from '../../providers'; +import { FormKey } from '../../providers'; import { useSplitSubvariantStore } from '../../stores'; import { HeaderAppBar } from './Header.style'; import { NavbarTab, NavbarTabs } from './NavigationTabs.style'; @@ -13,9 +13,9 @@ export const NavigationTabs = () => { ]); const { setValue } = useFormContext(); const handleChange = (_: React.SyntheticEvent, value: number) => { - setValue(SwapFormKey.FromAmount, ''); - setValue(SwapFormKey.FromToken, ''); - setValue(SwapFormKey.ToToken, ''); + setValue(FormKey.FromAmount, ''); + setValue(FormKey.FromToken, ''); + setValue(FormKey.ToToken, ''); setState(value === 0 ? 'swap' : 'bridge'); }; diff --git a/packages/widget/src/components/Insurance/InsuranceCollapsed.tsx b/packages/widget/src/components/Insurance/InsuranceCollapsed.tsx index 150fafc3f..e55fd30ab 100644 --- a/packages/widget/src/components/Insurance/InsuranceCollapsed.tsx +++ b/packages/widget/src/components/Insurance/InsuranceCollapsed.tsx @@ -1,5 +1,5 @@ import { Collapse } from '@mui/material'; -import { useSwapRoutes } from '../../hooks'; +import { useRoutes } from '../../hooks'; import { RouteExecutionStatus, useRouteExecutionStore, @@ -19,7 +19,7 @@ export const InsuranceCollapsed: React.FC = ({ const routeExecution = useRouteExecutionStore( (state) => state.routes[insurableRouteId], ); - const { routes } = useSwapRoutes({ + const { routes } = useRoutes({ insurableRoute: routeExecution?.route, }); diff --git a/packages/widget/src/components/NFT/NFT.tsx b/packages/widget/src/components/NFT/NFT.tsx index d5f782947..a7825700e 100644 --- a/packages/widget/src/components/NFT/NFT.tsx +++ b/packages/widget/src/components/NFT/NFT.tsx @@ -3,7 +3,7 @@ import { Box, Link, Skeleton, Typography } from '@mui/material'; import { useEffect } from 'react'; import { useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; -import { SwapFormKey } from '../../providers'; +import { FormKey } from '../../providers'; import { Token } from '../Token'; import { PreviewAvatar } from './NFT.style'; import type { NFTProps } from './types'; @@ -22,14 +22,14 @@ export const NFT: React.FC = ({ const { setValue } = useFormContext(); useEffect(() => { if (token) { - setValue(SwapFormKey.ToChain, token.chainId); - setValue(SwapFormKey.ToToken, token.address); - setValue(SwapFormKey.ToAmount, token.amount); + setValue(FormKey.ToChain, token.chainId); + setValue(FormKey.ToToken, token.address); + setValue(FormKey.ToAmount, token.amount); } if (contract) { - setValue(SwapFormKey.ToContractAddress, contract.address); - setValue(SwapFormKey.ToContractCallData, contract.callData); - setValue(SwapFormKey.ToContractGasLimit, contract.gasLimit); + setValue(FormKey.ToContractAddress, contract.address); + setValue(FormKey.ToContractCallData, contract.callData); + setValue(FormKey.ToContractGasLimit, contract.gasLimit); } }, [contract, setValue, token]); return ( diff --git a/packages/widget/src/components/ReverseTokensButton/ReverseTokensButton.tsx b/packages/widget/src/components/ReverseTokensButton/ReverseTokensButton.tsx index 4f5775966..7acd96f98 100644 --- a/packages/widget/src/components/ReverseTokensButton/ReverseTokensButton.tsx +++ b/packages/widget/src/components/ReverseTokensButton/ReverseTokensButton.tsx @@ -1,7 +1,7 @@ import SwapHorizIcon from '@mui/icons-material/SwapHoriz'; import SwapVertIcon from '@mui/icons-material/SwapVert'; import { useFormContext } from 'react-hook-form'; -import { SwapFormKey } from '../../providers'; +import { FormKey } from '../../providers'; import { IconButton } from './ReverseTokensButton.style'; export const ReverseTokensButton: React.FC<{ vertical?: boolean }> = ({ @@ -10,16 +10,16 @@ export const ReverseTokensButton: React.FC<{ vertical?: boolean }> = ({ const { setValue, getValues } = useFormContext(); const handleClick = () => { const [fromChain, fromToken, toChain, toToken] = getValues([ - SwapFormKey.FromChain, - SwapFormKey.FromToken, - SwapFormKey.ToChain, - SwapFormKey.ToToken, + FormKey.FromChain, + FormKey.FromToken, + FormKey.ToChain, + FormKey.ToToken, ]); - setValue(SwapFormKey.FromAmount, '', { shouldTouch: true }); - setValue(SwapFormKey.FromChain, toChain, { shouldTouch: true }); - setValue(SwapFormKey.FromToken, toToken, { shouldTouch: true }); - setValue(SwapFormKey.ToChain, fromChain, { shouldTouch: true }); - setValue(SwapFormKey.ToToken, fromToken, { shouldTouch: true }); + setValue(FormKey.FromAmount, '', { shouldTouch: true }); + setValue(FormKey.FromChain, toChain, { shouldTouch: true }); + setValue(FormKey.FromToken, toToken, { shouldTouch: true }); + setValue(FormKey.ToChain, fromChain, { shouldTouch: true }); + setValue(FormKey.ToToken, fromToken, { shouldTouch: true }); }; return ( diff --git a/packages/widget/src/components/SwapRouteCard/SwapRouteCard.style.ts b/packages/widget/src/components/RouteCard/RouteCard.style.ts similarity index 100% rename from packages/widget/src/components/SwapRouteCard/SwapRouteCard.style.ts rename to packages/widget/src/components/RouteCard/RouteCard.style.ts diff --git a/packages/widget/src/components/SwapRouteCard/SwapRouteCard.tsx b/packages/widget/src/components/RouteCard/RouteCard.tsx similarity index 95% rename from packages/widget/src/components/SwapRouteCard/SwapRouteCard.tsx rename to packages/widget/src/components/RouteCard/RouteCard.tsx index 025e4a0f4..1b8eee662 100644 --- a/packages/widget/src/components/SwapRouteCard/SwapRouteCard.tsx +++ b/packages/widget/src/components/RouteCard/RouteCard.tsx @@ -14,11 +14,11 @@ import { Card, CardIconButton, CardLabel, CardLabelTypography } from '../Card'; import type { InsuredAmount } from '../Insurance'; import { StepActions } from '../StepActions'; import { Token } from '../Token'; -import { SwapRouteCardEssentials } from './SwapRouteCardEssentials'; -import type { SwapRouteCardProps } from './types'; +import { RouteCardEssentials } from './RouteCardEssentials'; +import type { RouteCardProps } from './types'; -export const SwapRouteCard: React.FC< - SwapRouteCardProps & Omit +export const RouteCard: React.FC< + RouteCardProps & Omit > = ({ route, active, variant = 'default', expanded, ...other }) => { const { t } = useTranslation(); const { variant: widgetVariant } = useWidgetConfig(); @@ -93,7 +93,7 @@ export const SwapRouteCard: React.FC< ))} - + ); diff --git a/packages/widget/src/components/SwapRouteCard/SwapRouteCardEssentials.tsx b/packages/widget/src/components/RouteCard/RouteCardEssentials.tsx similarity index 94% rename from packages/widget/src/components/SwapRouteCard/SwapRouteCardEssentials.tsx rename to packages/widget/src/components/RouteCard/RouteCardEssentials.tsx index 694cbf0f1..84d36dae1 100644 --- a/packages/widget/src/components/SwapRouteCard/SwapRouteCardEssentials.tsx +++ b/packages/widget/src/components/RouteCard/RouteCardEssentials.tsx @@ -4,13 +4,14 @@ import LayersIcon from '@mui/icons-material/Layers'; import MonetizationOnIcon from '@mui/icons-material/MonetizationOn'; import { Box, Tooltip, Typography } from '@mui/material'; import { useTranslation } from 'react-i18next'; -import { IconTypography } from './SwapRouteCard.style'; -import type { SwapRouteCardEssentialsProps } from './types'; +import { IconTypography } from './RouteCard.style'; +import type { RouteCardEssentialsProps } from './types'; import { getFeeCostsBreakdown, getGasCostsBreakdown } from './utils'; -export const SwapRouteCardEssentials: React.FC< - SwapRouteCardEssentialsProps -> = ({ route, dense }) => { +export const RouteCardEssentials: React.FC = ({ + route, + dense, +}) => { const { t } = useTranslation(); const executionTimeMinutes = Math.ceil( route.steps diff --git a/packages/widget/src/components/SwapRouteCard/SwapRouteCardSkeleton.tsx b/packages/widget/src/components/RouteCard/RouteCardSkeleton.tsx similarity index 90% rename from packages/widget/src/components/SwapRouteCard/SwapRouteCardSkeleton.tsx rename to packages/widget/src/components/RouteCard/RouteCardSkeleton.tsx index 2fae294e7..a35fbb9fa 100644 --- a/packages/widget/src/components/SwapRouteCard/SwapRouteCardSkeleton.tsx +++ b/packages/widget/src/components/RouteCard/RouteCardSkeleton.tsx @@ -2,11 +2,12 @@ import type { BoxProps } from '@mui/material'; import { Box, Skeleton } from '@mui/material'; import { useWidgetConfig } from '../../providers'; import { Card } from '../Card'; -import type { SwapRouteCardSkeletonProps } from './types'; +import type { RouteCardSkeletonProps } from './types'; -export const SwapRouteCardSkeleton: React.FC< - SwapRouteCardSkeletonProps & BoxProps -> = ({ variant, ...other }) => { +export const RouteCardSkeleton: React.FC = ({ + variant, + ...other +}) => { const { variant: widgetVariant } = useWidgetConfig(); const cardContent = ( diff --git a/packages/widget/src/components/SwapRouteCard/SwapRouteNotFoundCard.tsx b/packages/widget/src/components/RouteCard/RouteNotFoundCard.tsx similarity index 93% rename from packages/widget/src/components/SwapRouteCard/SwapRouteNotFoundCard.tsx rename to packages/widget/src/components/RouteCard/RouteNotFoundCard.tsx index 5c715ccdc..dd413e78d 100644 --- a/packages/widget/src/components/SwapRouteCard/SwapRouteNotFoundCard.tsx +++ b/packages/widget/src/components/RouteCard/RouteNotFoundCard.tsx @@ -2,7 +2,7 @@ import RouteIcon from '@mui/icons-material/Route'; import { Box, Typography } from '@mui/material'; import { useTranslation } from 'react-i18next'; -export const SwapRouteNotFoundCard: React.FC = () => { +export const RouteNotFoundCard: React.FC = () => { const { t } = useTranslation(); return ( = (props) => { +export const Routes: React.FC = (props) => { const { t } = useTranslation(); const navigate = useNavigate(); const { variant, useRecommendedRoute } = useWidgetConfig(); @@ -27,7 +23,7 @@ export const SwapRoutes: React.FC = (props) => { dataUpdatedAt, refetchTime, refetch, - } = useSwapRoutes(); + } = useRoutes(); const currentRoute = routes?.[0]; @@ -62,11 +58,11 @@ export const SwapRoutes: React.FC = (props) => { /> {isLoading ? ( - + ) : !currentRoute ? ( - + ) : ( - + )} diff --git a/packages/widget/src/components/SwapRoutes/SwapRoutesExpanded.style.ts b/packages/widget/src/components/Routes/RoutesExpanded.style.ts similarity index 100% rename from packages/widget/src/components/SwapRoutes/SwapRoutesExpanded.style.ts rename to packages/widget/src/components/Routes/RoutesExpanded.style.ts diff --git a/packages/widget/src/components/SwapRoutes/SwapRoutesExpanded.tsx b/packages/widget/src/components/Routes/RoutesExpanded.tsx similarity index 87% rename from packages/widget/src/components/SwapRoutes/SwapRoutesExpanded.tsx rename to packages/widget/src/components/Routes/RoutesExpanded.tsx index 949443291..bb1779251 100644 --- a/packages/widget/src/components/SwapRoutes/SwapRoutesExpanded.tsx +++ b/packages/widget/src/components/Routes/RoutesExpanded.tsx @@ -4,33 +4,29 @@ import { Collapse, Grow, Stack, Typography } from '@mui/material'; import { useFormState } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { useMatch, useNavigate } from 'react-router-dom'; -import { useSwapRoutes } from '../../hooks'; +import { useRoutes } from '../../hooks'; import { useWidgetConfig } from '../../providers'; import { useSetExecutableRoute } from '../../stores'; import { navigationRoutes } from '../../utils'; import { ProgressToNextUpdate } from '../ProgressToNextUpdate'; -import { - SwapRouteCard, - SwapRouteCardSkeleton, - SwapRouteNotFoundCard, -} from '../SwapRouteCard'; +import { RouteCard, RouteCardSkeleton, RouteNotFoundCard } from '../RouteCard'; import { CollapseContainer, Container, Header, ScrollableContainer, -} from './SwapRoutesExpanded.style'; +} from './RoutesExpanded.style'; const timeout = { enter: 225, exit: 225, appear: 0 }; -export const SwapRoutesExpanded = () => { +export const RoutesExpanded = () => { const element = useMatch('/'); return (
- +
@@ -38,7 +34,7 @@ export const SwapRoutesExpanded = () => { ); }; -export const SwapRoutesExpandedElement = () => { +export const RoutesExpandedElement = () => { const { t } = useTranslation(); const navigate = useNavigate(); const setExecutableRoute = useSetExecutableRoute(); @@ -52,7 +48,7 @@ export const SwapRoutesExpandedElement = () => { dataUpdatedAt, refetchTime, refetch, - } = useSwapRoutes(); + } = useRoutes(); const currentRoute = routes?.[0]; @@ -96,14 +92,14 @@ export const SwapRoutesExpandedElement = () => { paddingBottom={3} > {routeNotFound ? ( - + ) : isLoading || (isFetching && !routes?.length) ? ( Array.from({ length: 3 }).map((_, index) => ( - + )) ) : ( routes?.map((route: Route, index: number) => ( - handleRouteClick(route)} diff --git a/packages/widget/src/components/Routes/index.ts b/packages/widget/src/components/Routes/index.ts new file mode 100644 index 000000000..10e1e56b8 --- /dev/null +++ b/packages/widget/src/components/Routes/index.ts @@ -0,0 +1,2 @@ +export * from './Routes'; +export * from './RoutesExpanded'; diff --git a/packages/widget/src/components/SelectChainAndToken.tsx b/packages/widget/src/components/SelectChainAndToken.tsx index 9e48f9083..32f6a7421 100644 --- a/packages/widget/src/components/SelectChainAndToken.tsx +++ b/packages/widget/src/components/SelectChainAndToken.tsx @@ -3,7 +3,7 @@ import { Box, useMediaQuery } from '@mui/material'; import { useWatch } from 'react-hook-form'; import { ReverseTokensButton } from '../components/ReverseTokensButton'; import { SelectTokenButton } from '../components/SelectTokenButton'; -import { SwapFormKey, useWidgetConfig } from '../providers'; +import { FormKey, useWidgetConfig } from '../providers'; import { DisabledUI, HiddenUI } from '../types'; export const SelectChainAndToken: React.FC = (props) => { @@ -13,10 +13,10 @@ export const SelectChainAndToken: React.FC = (props) => { const { disabledUI, hiddenUI, variant } = useWidgetConfig(); const [fromChain, toChain, fromToken, toToken] = useWatch({ name: [ - SwapFormKey.FromChain, - SwapFormKey.ToChain, - SwapFormKey.FromToken, - SwapFormKey.ToToken, + FormKey.FromChain, + FormKey.ToChain, + FormKey.FromToken, + FormKey.ToToken, ], }); diff --git a/packages/widget/src/components/SelectTokenButton/SelectTokenButton.tsx b/packages/widget/src/components/SelectTokenButton/SelectTokenButton.tsx index 7238e4f9a..5d5009e06 100644 --- a/packages/widget/src/components/SelectTokenButton/SelectTokenButton.tsx +++ b/packages/widget/src/components/SelectTokenButton/SelectTokenButton.tsx @@ -3,15 +3,15 @@ import { useWatch } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import { useChain, useSwapOnly, useToken } from '../../hooks'; -import type { SwapFormTypeProps } from '../../providers'; -import { SwapFormKeyHelper, useWidgetConfig } from '../../providers'; +import type { FormTypeProps } from '../../providers'; +import { FormKeyHelper, useWidgetConfig } from '../../providers'; import { navigationRoutes } from '../../utils'; import { Card, CardTitle } from '../Card'; import { TokenAvatar, TokenAvatarDefault } from '../TokenAvatar'; import { SelectTokenCardHeader } from './SelectTokenButton.style'; export const SelectTokenButton: React.FC< - SwapFormTypeProps & { + FormTypeProps & { compact: boolean; } > = ({ formType, compact }) => { @@ -19,9 +19,9 @@ export const SelectTokenButton: React.FC< const navigate = useNavigate(); const { disabledUI, variant } = useWidgetConfig(); const swapOnly = useSwapOnly(); - const tokenKey = SwapFormKeyHelper.getTokenKey(formType); + const tokenKey = FormKeyHelper.getTokenKey(formType); const [chainId, tokenAddress] = useWatch({ - name: [SwapFormKeyHelper.getChainKey(formType), tokenKey], + name: [FormKeyHelper.getChainKey(formType), tokenKey], }); const { chain, isLoading: isChainLoading } = useChain(chainId); const { token, isLoading: isTokenLoading } = useToken(chainId, tokenAddress); diff --git a/packages/widget/src/components/SendToWallet/SendToWallet.tsx b/packages/widget/src/components/SendToWallet/SendToWallet.tsx index 02bd9f5a0..7cb56727f 100644 --- a/packages/widget/src/components/SendToWallet/SendToWallet.tsx +++ b/packages/widget/src/components/SendToWallet/SendToWallet.tsx @@ -4,7 +4,7 @@ import { Collapse, FormHelperText } from '@mui/material'; import { forwardRef, useEffect, useRef } from 'react'; import { useController, useFormContext, useFormState } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; -import { SwapFormKey, useWallet, useWidgetConfig } from '../../providers'; +import { FormKey, useWallet, useWidgetConfig } from '../../providers'; import { useSendToWalletStore, useSettings } from '../../stores'; import { DisabledUI, HiddenUI, RequiredUI } from '../../types'; import { Card, CardTitle } from '../Card'; @@ -27,7 +27,7 @@ export const SendToWallet: React.FC = forwardRef((props, ref) => { const { field: { onChange, onBlur, name, value }, } = useController({ - name: SwapFormKey.ToAddress, + name: FormKey.ToAddress, rules: { required: requiredToAddress && (t('error.title.walletAddressRequired') as string), @@ -45,7 +45,7 @@ export const SendToWallet: React.FC = forwardRef((props, ref) => { return t('error.title.walletEnsAddressInvalid') as string; } }, - onBlur: () => trigger(SwapFormKey.ToAddress), + onBlur: () => trigger(FormKey.ToAddress), }, }); @@ -65,15 +65,13 @@ export const SendToWallet: React.FC = forwardRef((props, ref) => { }, [showInstantly, setSendToWallet]); useEffect(() => { - const value = getValues(SwapFormKey.ToAddress); + const value = getValues(FormKey.ToAddress); if (value) { - trigger(SwapFormKey.ToAddress); + trigger(FormKey.ToAddress); // Trigger validation if we change requiredToAddress in the runtime } else if (requiredToAddressRef.current !== requiredToAddress) { requiredToAddressRef.current = requiredToAddress; - trigger(SwapFormKey.ToAddress).then(() => - clearErrors(SwapFormKey.ToAddress), - ); + trigger(FormKey.ToAddress).then(() => clearErrors(FormKey.ToAddress)); } }, [account.chainId, clearErrors, getValues, requiredToAddress, trigger]); diff --git a/packages/widget/src/components/SendToWallet/SendToWalletButton.tsx b/packages/widget/src/components/SendToWallet/SendToWalletButton.tsx index 8cc538dda..c69cab686 100644 --- a/packages/widget/src/components/SendToWallet/SendToWalletButton.tsx +++ b/packages/widget/src/components/SendToWallet/SendToWalletButton.tsx @@ -2,7 +2,7 @@ import WalletIcon from '@mui/icons-material/Wallet'; import { Button, Tooltip } from '@mui/material'; import { useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; -import { SwapFormKey, useWallet, useWidgetConfig } from '../../providers'; +import { FormKey, useWallet, useWidgetConfig } from '../../providers'; import { useSendToWalletStore, useSettings } from '../../stores'; import { DisabledUI, HiddenUI, RequiredUI } from '../../types'; @@ -25,7 +25,7 @@ export const SendToWalletButton: React.FC = () => { const handleClick = () => { if (showSendToWallet && !disabledUI?.includes(DisabledUI.ToAddress)) { - setValue(SwapFormKey.ToAddress, '', { shouldTouch: true }); + setValue(FormKey.ToAddress, '', { shouldTouch: true }); } toggleSendToWallet(); }; diff --git a/packages/widget/src/components/SwapButton/SwapButton.tsx b/packages/widget/src/components/SwapButton/SwapButton.tsx deleted file mode 100644 index 02033f1cf..000000000 --- a/packages/widget/src/components/SwapButton/SwapButton.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import { LoadingButton } from '@mui/lab'; -import { useTranslation } from 'react-i18next'; -import { useNavigate } from 'react-router-dom'; -import { useWallet, useWidgetConfig } from '../../providers'; -import { useSplitSubvariantStore } from '../../stores'; -import { navigationRoutes } from '../../utils'; -import type { SwapButtonProps } from './types'; - -export const SwapButton: React.FC = ({ - onClick, - route, - text, - disabled, - loading, -}) => { - const { t } = useTranslation(); - const navigate = useNavigate(); - const { variant, subvariant, walletManagement } = useWidgetConfig(); - const { account, connect } = useWallet(); - const splitState = useSplitSubvariantStore((state) => state.state); - - const handleSwapButtonClick = async () => { - if (!account.isActive) { - if (walletManagement) { - await connect(); - } else { - navigate(navigationRoutes.selectWallet); - } - } else { - onClick?.(); - } - }; - - const getButtonText = () => { - if (account.isActive) { - if (!route) { - switch (variant) { - case 'nft': - return t(`button.buy`); - case 'refuel': - return t(`button.getGas`); - default: - if (subvariant === 'split' && splitState) { - return t(`button.${splitState}`); - } - return t(`button.exchange`); - } - } - if (text) { - return text; - } - switch (variant) { - case 'nft': - return t(`button.reviewPurchase`); - case 'refuel': - return t(`button.reviewBridge`); - default: - const transactionType = - route.fromChainId === route.toChainId ? 'Swap' : 'Bridge'; - return t(`button.review${transactionType}`); - } - } - return t(`button.connectWallet`); - }; - - return ( - - {getButtonText()} - - ); -}; diff --git a/packages/widget/src/components/SwapButton/index.ts b/packages/widget/src/components/SwapButton/index.ts deleted file mode 100644 index 7884d21db..000000000 --- a/packages/widget/src/components/SwapButton/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { SwapButton } from './SwapButton'; -export * from './types'; diff --git a/packages/widget/src/components/SwapButton/types.ts b/packages/widget/src/components/SwapButton/types.ts deleted file mode 100644 index d3703f56f..000000000 --- a/packages/widget/src/components/SwapButton/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Route } from '@lifi/sdk'; - -export interface SwapButtonProps { - onClick?(): void; - route?: Route; - text?: string; - disabled?: boolean; - loading?: boolean; -} diff --git a/packages/widget/src/components/SwapInput/index.ts b/packages/widget/src/components/SwapInput/index.ts deleted file mode 100644 index c76c112f6..000000000 --- a/packages/widget/src/components/SwapInput/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './SwapInput'; diff --git a/packages/widget/src/components/SwapRouteCard/index.ts b/packages/widget/src/components/SwapRouteCard/index.ts deleted file mode 100644 index ea1deb218..000000000 --- a/packages/widget/src/components/SwapRouteCard/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './SwapRouteCard'; -export * from './SwapRouteCardSkeleton'; -export * from './SwapRouteNotFoundCard'; diff --git a/packages/widget/src/components/SwapRoutes/index.ts b/packages/widget/src/components/SwapRoutes/index.ts deleted file mode 100644 index dc9ebb9cc..000000000 --- a/packages/widget/src/components/SwapRoutes/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './SwapRoutes'; -export * from './SwapRoutesExpanded'; diff --git a/packages/widget/src/components/TokenList/TokenList.tsx b/packages/widget/src/components/TokenList/TokenList.tsx index a3c41a535..a1a8bca47 100644 --- a/packages/widget/src/components/TokenList/TokenList.tsx +++ b/packages/widget/src/components/TokenList/TokenList.tsx @@ -8,7 +8,7 @@ import { useTokenBalances, useTokenSearch, } from '../../hooks'; -import { SwapFormKey, SwapFormKeyHelper, useWallet } from '../../providers'; +import { FormKey, FormKeyHelper, useWallet } from '../../providers'; import type { TokenAmount } from '../../types'; import { TokenNotFound } from './TokenNotFound'; import { VirtualizedTokenList } from './VirtualizedTokenList'; @@ -23,10 +23,10 @@ export const TokenList: FC = ({ const parentRef = useRef(null); const { account } = useWallet(); const [selectedChainId] = useWatch({ - name: [SwapFormKeyHelper.getChainKey(formType)], + name: [FormKeyHelper.getChainKey(formType)], }); const [tokenSearchFilter]: string[] = useDebouncedWatch( - [SwapFormKey.TokenSearchFilter], + [FormKey.TokenSearchFilter], 320, ); diff --git a/packages/widget/src/components/TokenList/TokenNotFound.tsx b/packages/widget/src/components/TokenList/TokenNotFound.tsx index ad93c069f..7d7116af6 100644 --- a/packages/widget/src/components/TokenList/TokenNotFound.tsx +++ b/packages/widget/src/components/TokenList/TokenNotFound.tsx @@ -3,13 +3,13 @@ import { Box, Typography } from '@mui/material'; import { useWatch } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { useChains } from '../../hooks'; -import type { SwapFormTypeProps } from '../../providers'; -import { SwapFormKeyHelper } from '../../providers'; +import type { FormTypeProps } from '../../providers'; +import { FormKeyHelper } from '../../providers'; -export const TokenNotFound: React.FC = ({ formType }) => { +export const TokenNotFound: React.FC = ({ formType }) => { const { t } = useTranslation(); const [selectedChainId] = useWatch({ - name: [SwapFormKeyHelper.getChainKey(formType)], + name: [FormKeyHelper.getChainKey(formType)], }); const { getChainById } = useChains(); return ( diff --git a/packages/widget/src/components/TokenList/types.ts b/packages/widget/src/components/TokenList/types.ts index 3f5a42d43..f96d25dd4 100644 --- a/packages/widget/src/components/TokenList/types.ts +++ b/packages/widget/src/components/TokenList/types.ts @@ -1,10 +1,10 @@ import type { ExtendedChain } from '@lifi/sdk'; import type { MutableRefObject } from 'react'; -import type { SwapFormType } from '../../providers'; +import type { FormType } from '../../providers'; import type { TokenAmount } from '../../types'; export interface TokenListProps { - formType: SwapFormType; + formType: FormType; height: number; onClick?(): void; } diff --git a/packages/widget/src/components/TokenList/useTokenSelect.ts b/packages/widget/src/components/TokenList/useTokenSelect.ts index 3e02b7ec2..fce0b7d09 100644 --- a/packages/widget/src/components/TokenList/useTokenSelect.ts +++ b/packages/widget/src/components/TokenList/useTokenSelect.ts @@ -1,13 +1,10 @@ import { useCallback } from 'react'; import { useController, useFormContext } from 'react-hook-form'; -import type { SwapFormType } from '../../providers'; -import { SwapFormKeyHelper } from '../../providers'; +import type { FormType } from '../../providers'; +import { FormKeyHelper } from '../../providers'; -export const useTokenSelect = ( - formType: SwapFormType, - onClick?: () => void, -) => { - const tokenKey = SwapFormKeyHelper.getTokenKey(formType); +export const useTokenSelect = (formType: FormType, onClick?: () => void) => { + const tokenKey = FormKeyHelper.getTokenKey(formType); const { field: { onChange, onBlur }, } = useController({ name: tokenKey }); @@ -18,23 +15,23 @@ export const useTokenSelect = ( onChange(tokenAddress); onBlur(); const selectedChainId = - chainId ?? getValues(SwapFormKeyHelper.getChainKey(formType)); + chainId ?? getValues(FormKeyHelper.getChainKey(formType)); // Set chain again to trigger URL builder update - setValue(SwapFormKeyHelper.getChainKey(formType), selectedChainId, { + setValue(FormKeyHelper.getChainKey(formType), selectedChainId, { shouldDirty: true, shouldTouch: true, }); - setValue(SwapFormKeyHelper.getAmountKey(formType), ''); + setValue(FormKeyHelper.getAmountKey(formType), ''); const oppositeFormType = formType === 'from' ? 'to' : 'from'; const [selectedOppositeToken, selectedOppositeChainId] = getValues([ - SwapFormKeyHelper.getTokenKey(oppositeFormType), - SwapFormKeyHelper.getChainKey(oppositeFormType), + FormKeyHelper.getTokenKey(oppositeFormType), + FormKeyHelper.getChainKey(oppositeFormType), ]); if ( selectedOppositeToken === tokenAddress && selectedOppositeChainId === selectedChainId ) { - setValue(SwapFormKeyHelper.getTokenKey(oppositeFormType), '', { + setValue(FormKeyHelper.getTokenKey(oppositeFormType), '', { shouldDirty: true, shouldTouch: true, }); diff --git a/packages/widget/src/hooks/index.ts b/packages/widget/src/hooks/index.ts index 6d8b1257a..5c98c4b5e 100644 --- a/packages/widget/src/hooks/index.ts +++ b/packages/widget/src/hooks/index.ts @@ -14,9 +14,9 @@ export * from './useInitializer'; export * from './useNavigateBack'; export * from './useProcessMessage'; export * from './useRouteExecution'; +export * from './useRoutes'; export * from './useScrollableContainer'; export * from './useSwapOnly'; -export * from './useSwapRoutes'; export * from './useToken'; export * from './useTokenAddressBalance'; export * from './useTokenBalance'; diff --git a/packages/widget/src/hooks/useChains.ts b/packages/widget/src/hooks/useChains.ts index c031e0892..62afcaf82 100644 --- a/packages/widget/src/hooks/useChains.ts +++ b/packages/widget/src/hooks/useChains.ts @@ -1,12 +1,7 @@ import { useQuery } from '@tanstack/react-query'; import { useCallback } from 'react'; import { useFormContext } from 'react-hook-form'; -import { - isItemAllowed, - SwapFormKey, - useLiFi, - useWidgetConfig, -} from '../providers'; +import { FormKey, isItemAllowed, useLiFi, useWidgetConfig } from '../providers'; import { useChainOrderStore } from '../stores'; export const useChains = () => { @@ -27,14 +22,14 @@ export const useChains = () => { filteredChains.map((chain) => chain.id), ); const [fromChainValue, toChainValue] = getValues([ - SwapFormKey.FromChain, - SwapFormKey.ToChain, + FormKey.FromChain, + FormKey.ToChain, ]); if (!fromChainValue) { - setValue(SwapFormKey.FromChain, chainOrder[0]); + setValue(FormKey.FromChain, chainOrder[0]); } if (!toChainValue) { - setValue(SwapFormKey.ToChain, chainOrder[0]); + setValue(FormKey.ToChain, chainOrder[0]); } return { availableChains, filteredChains }; }, diff --git a/packages/widget/src/hooks/useFundsSufficiency.ts b/packages/widget/src/hooks/useFundsSufficiency.ts index 8c06c3823..fc26671d3 100644 --- a/packages/widget/src/hooks/useFundsSufficiency.ts +++ b/packages/widget/src/hooks/useFundsSufficiency.ts @@ -2,7 +2,7 @@ import type { Route } from '@lifi/sdk'; import { useQuery } from '@tanstack/react-query'; import Big from 'big.js'; import { useWatch } from 'react-hook-form'; -import { SwapFormKey, useWallet } from '../providers'; +import { FormKey, useWallet } from '../providers'; import { isRouteDone } from '../stores'; import { useGetTokenBalancesWithRetry } from './useGetTokenBalancesWithRetry'; import { useTokenAddressBalance } from './useTokenAddressBalance'; @@ -15,11 +15,7 @@ export const useFundsSufficiency = (route?: Route) => { account.signer?.provider, ); const [fromChainId, fromTokenAddress, fromAmount] = useWatch({ - name: [ - SwapFormKey.FromChain, - SwapFormKey.FromToken, - SwapFormKey.FromAmount, - ], + name: [FormKey.FromChain, FormKey.FromToken, FormKey.FromAmount], }); let chainId = fromChainId; diff --git a/packages/widget/src/hooks/useGasRefuel.ts b/packages/widget/src/hooks/useGasRefuel.ts index d99356f42..560b50632 100644 --- a/packages/widget/src/hooks/useGasRefuel.ts +++ b/packages/widget/src/hooks/useGasRefuel.ts @@ -2,7 +2,7 @@ import Big from 'big.js'; import { useMemo } from 'react'; import { useWatch } from 'react-hook-form'; import { useChains } from '.'; -import { SwapFormKey } from '../providers'; +import { FormKey } from '../providers'; import { useGasRecommendation } from './useGasRecommendation'; import { useTokenBalance } from './useTokenBalance'; @@ -11,10 +11,10 @@ export const useGasRefuel = () => { const [fromChainId, fromTokenAddress, toChainId, toAddress] = useWatch({ name: [ - SwapFormKey.FromChain, - SwapFormKey.FromToken, - SwapFormKey.ToChain, - SwapFormKey.ToAddress, + FormKey.FromChain, + FormKey.FromToken, + FormKey.ToChain, + FormKey.ToAddress, ], }); diff --git a/packages/widget/src/hooks/useRouteExecution.ts b/packages/widget/src/hooks/useRouteExecution.ts index 9e15fa9e9..2932606ef 100644 --- a/packages/widget/src/hooks/useRouteExecution.ts +++ b/packages/widget/src/hooks/useRouteExecution.ts @@ -156,11 +156,9 @@ export const useRouteExecution = ({ executeRouteMutation.mutateAsync(undefined, { onError: (error) => { console.warn('Execution failed!', routeId, error); - // Notification.showNotification(NotificationType.SwapExecution_ERROR); }, onSuccess: (route: Route) => { console.log('Executed successfully!', route); - // Notification.showNotification(NotificationType.TRANSACTION_SUCCESSFULL); }, }); }, [executeRouteMutation, routeId]); diff --git a/packages/widget/src/hooks/useSwapRoutes.ts b/packages/widget/src/hooks/useRoutes.ts similarity index 94% rename from packages/widget/src/hooks/useSwapRoutes.ts rename to packages/widget/src/hooks/useRoutes.ts index 77dca91b0..e4c59734c 100644 --- a/packages/widget/src/hooks/useSwapRoutes.ts +++ b/packages/widget/src/hooks/useRoutes.ts @@ -6,17 +6,17 @@ import Big from 'big.js'; import { useWatch } from 'react-hook-form'; import { v4 as uuidv4 } from 'uuid'; import { useDebouncedWatch, useGasRefuel, useToken } from '.'; -import { SwapFormKey, useLiFi, useWallet, useWidgetConfig } from '../providers'; +import { FormKey, useLiFi, useWallet, useWidgetConfig } from '../providers'; import { useSettings } from '../stores'; import { useSwapOnly } from './useSwapOnly'; const refetchTime = 60_000; -interface SwapRoutesProps { +interface RoutesProps { insurableRoute?: Route; } -export const useSwapRoutes = ({ insurableRoute }: SwapRoutesProps = {}) => { +export const useRoutes = ({ insurableRoute }: RoutesProps = {}) => { const lifi = useLiFi(); const { variant, sdkConfig, insurance, contractTool } = useWidgetConfig(); const { account } = useWallet(); @@ -35,7 +35,7 @@ export const useSwapRoutes = ({ insurableRoute }: SwapRoutesProps = {}) => { 'enabledBridges', 'enabledExchanges', ]); - const [fromTokenAmount] = useDebouncedWatch([SwapFormKey.FromAmount], 320); + const [fromTokenAmount] = useDebouncedWatch([FormKey.FromAmount], 320); const [ fromChainId, fromTokenAddress, @@ -48,15 +48,15 @@ export const useSwapRoutes = ({ insurableRoute }: SwapRoutesProps = {}) => { toTokenAddress, ] = useWatch({ name: [ - SwapFormKey.FromChain, - SwapFormKey.FromToken, - SwapFormKey.ToAddress, - SwapFormKey.ToAmount, - SwapFormKey.ToChain, - SwapFormKey.ToContractAddress, - SwapFormKey.ToContractCallData, - SwapFormKey.ToContractGasLimit, - SwapFormKey.ToToken, + FormKey.FromChain, + FormKey.FromToken, + FormKey.ToAddress, + FormKey.ToAmount, + FormKey.ToChain, + FormKey.ToContractAddress, + FormKey.ToContractCallData, + FormKey.ToContractGasLimit, + FormKey.ToToken, ], }); const { token: fromToken } = useToken(fromChainId, fromTokenAddress); diff --git a/packages/widget/src/pages/ActiveSwapsPage/index.ts b/packages/widget/src/pages/ActiveSwapsPage/index.ts deleted file mode 100644 index aaab21e13..000000000 --- a/packages/widget/src/pages/ActiveSwapsPage/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './ActiveSwapsPage'; diff --git a/packages/widget/src/pages/ActiveSwapsPage/ActiveSwapsEmpty.tsx b/packages/widget/src/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.tsx similarity index 93% rename from packages/widget/src/pages/ActiveSwapsPage/ActiveSwapsEmpty.tsx rename to packages/widget/src/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.tsx index bdc3176a5..60e513fdb 100644 --- a/packages/widget/src/pages/ActiveSwapsPage/ActiveSwapsEmpty.tsx +++ b/packages/widget/src/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.tsx @@ -2,7 +2,7 @@ import SwapHorizIcon from '@mui/icons-material/SwapHoriz'; import { Container, Typography } from '@mui/material'; import { useTranslation } from 'react-i18next'; -export const ActiveSwapsEmpty: React.FC = () => { +export const ActiveTransactionsEmpty: React.FC = () => { const { t } = useTranslation(); return ( { +export const ActiveTransactionsPage = () => { const { t } = useTranslation(); const { account } = useWallet(); const executingRoutes = useExecutingRoutesIds(account.address); @@ -40,7 +40,7 @@ export const ActiveSwapsPage = () => { }, [executingRoutes.length, toggleDialog]); if (!executingRoutes.length) { - return ; + return ; } return ( @@ -52,7 +52,7 @@ export const ActiveSwapsPage = () => { }} > {executingRoutes.map((routeId) => ( - + ))} diff --git a/packages/widget/src/pages/ActiveTransactionsPage/index.ts b/packages/widget/src/pages/ActiveTransactionsPage/index.ts new file mode 100644 index 000000000..77745771a --- /dev/null +++ b/packages/widget/src/pages/ActiveTransactionsPage/index.ts @@ -0,0 +1 @@ +export * from './ActiveTransactionsPage'; diff --git a/packages/widget/src/pages/MainPage/MainGasMessage.tsx b/packages/widget/src/pages/MainPage/MainGasMessage.tsx index 9ca4c2cf5..df2355dcc 100644 --- a/packages/widget/src/pages/MainPage/MainGasMessage.tsx +++ b/packages/widget/src/pages/MainPage/MainGasMessage.tsx @@ -1,9 +1,9 @@ import type { BoxProps } from '@mui/material'; import { GasMessage } from '../../components/GasMessage'; -import { useSwapRoutes } from '../../hooks'; +import { useRoutes } from '../../hooks'; export const MainGasMessage: React.FC = (props) => { - const { routes } = useSwapRoutes(); + const { routes } = useRoutes(); const currentRoute = routes?.[0]; diff --git a/packages/widget/src/pages/MainPage/MainPage.tsx b/packages/widget/src/pages/MainPage/MainPage.tsx index 4e5b7b2dd..c0a68b593 100644 --- a/packages/widget/src/pages/MainPage/MainPage.tsx +++ b/packages/widget/src/pages/MainPage/MainPage.tsx @@ -1,19 +1,19 @@ import { Box } from '@mui/material'; -import { ActiveSwaps } from '../../components/ActiveSwaps'; +import { ActiveTransactions } from '../../components/ActiveTransactions'; +import { AmountInput } from '../../components/AmountInput'; import { ContractComponent } from '../../components/ContractComponent'; import { GasRefuelMessage } from '../../components/GasMessage'; +import { Routes } from '../../components/Routes'; import { SelectChainAndToken } from '../../components/SelectChainAndToken'; import { SendToWallet, SendToWalletButton, } from '../../components/SendToWallet'; -import { SwapInput } from '../../components/SwapInput'; -import { SwapRoutes } from '../../components/SwapRoutes'; import { useExpandableVariant } from '../../hooks'; import { useWidgetConfig } from '../../providers'; import { MainGasMessage } from './MainGasMessage'; import { FormContainer } from './MainPage.style'; -import { MainSwapButton } from './MainSwapButton'; +import { ReviewButton } from './ReviewButton'; export const MainPage: React.FC = () => { const expandable = useExpandableVariant(); @@ -21,16 +21,16 @@ export const MainPage: React.FC = () => { const nft = variant === 'nft'; return ( - + {nft ? : null} - {!nft ? : null} - {!expandable ? : null} + {!nft ? : null} + {!expandable ? : null} - + diff --git a/packages/widget/src/pages/MainPage/MainSwapButton.tsx b/packages/widget/src/pages/MainPage/MainSwapButton.tsx deleted file mode 100644 index fafbd6051..000000000 --- a/packages/widget/src/pages/MainPage/MainSwapButton.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { useFormState } from 'react-hook-form'; -import { useNavigate } from 'react-router-dom'; -import { SwapButton } from '../../components/SwapButton'; -import { useSwapRoutes } from '../../hooks'; -import { useSetExecutableRoute } from '../../stores'; -import { navigationRoutes } from '../../utils'; - -export const MainSwapButton: React.FC = () => { - const navigate = useNavigate(); - const { isValid, isValidating } = useFormState(); - const setExecutableRoute = useSetExecutableRoute(); - - const { routes: swapRoutes } = useSwapRoutes(); - - const currentRoute = swapRoutes?.[0]; - - const handleClick = async () => { - if (currentRoute) { - setExecutableRoute(currentRoute); - navigate(navigationRoutes.transactionExecution, { - state: { routeId: currentRoute.id }, - }); - } - }; - - return ( - - ); -}; diff --git a/packages/widget/src/pages/MainPage/ReviewButton.tsx b/packages/widget/src/pages/MainPage/ReviewButton.tsx new file mode 100644 index 000000000..2e0dd1365 --- /dev/null +++ b/packages/widget/src/pages/MainPage/ReviewButton.tsx @@ -0,0 +1,67 @@ +import { useFormState } from 'react-hook-form'; +import { useTranslation } from 'react-i18next'; +import { useNavigate } from 'react-router-dom'; +import { DefaultTransactionButton } from '../../components/DefaultTransactionButton'; +import { useRoutes } from '../../hooks'; +import { useWidgetConfig } from '../../providers'; +import { useSetExecutableRoute, useSplitSubvariantStore } from '../../stores'; +import { navigationRoutes } from '../../utils'; + +export const ReviewButton: React.FC = () => { + const { t } = useTranslation(); + const navigate = useNavigate(); + const { isValid, isValidating } = useFormState(); + const setExecutableRoute = useSetExecutableRoute(); + const { variant, subvariant } = useWidgetConfig(); + const splitState = useSplitSubvariantStore((state) => state.state); + + const { routes } = useRoutes(); + + const currentRoute = routes?.[0]; + + const handleClick = async () => { + if (currentRoute) { + setExecutableRoute(currentRoute); + navigate(navigationRoutes.transactionExecution, { + state: { routeId: currentRoute.id }, + }); + } + }; + + const getButtonText = () => { + if (currentRoute) { + switch (variant) { + case 'nft': + return t(`button.reviewPurchase`); + case 'refuel': + return t(`button.reviewBridge`); + default: + const transactionType = + currentRoute.fromChainId === currentRoute.toChainId + ? 'Swap' + : 'Bridge'; + return t(`button.review${transactionType}`); + } + } else { + switch (variant) { + case 'nft': + return t(`button.buy`); + case 'refuel': + return t(`button.getGas`); + default: + if (subvariant === 'split' && splitState) { + return t(`button.${splitState}`); + } + return t(`button.exchange`); + } + } + }; + + return ( + + ); +}; diff --git a/packages/widget/src/pages/SwapRoutesPage/SwapRoutesPage.style.ts b/packages/widget/src/pages/RoutesPage/RoutesPage.style.ts similarity index 100% rename from packages/widget/src/pages/SwapRoutesPage/SwapRoutesPage.style.ts rename to packages/widget/src/pages/RoutesPage/RoutesPage.style.ts diff --git a/packages/widget/src/pages/SwapRoutesPage/SwapRoutesPage.tsx b/packages/widget/src/pages/RoutesPage/RoutesPage.tsx similarity index 69% rename from packages/widget/src/pages/SwapRoutesPage/SwapRoutesPage.tsx rename to packages/widget/src/pages/RoutesPage/RoutesPage.tsx index b3ba11ac8..32790f8ed 100644 --- a/packages/widget/src/pages/SwapRoutesPage/SwapRoutesPage.tsx +++ b/packages/widget/src/pages/RoutesPage/RoutesPage.tsx @@ -5,25 +5,19 @@ import { useEffect } from 'react'; import { useHeaderStore } from '../../components/Header'; import { ProgressToNextUpdate } from '../../components/ProgressToNextUpdate'; import { - SwapRouteCard, - SwapRouteCardSkeleton, - SwapRouteNotFoundCard, -} from '../../components/SwapRouteCard'; -import { useNavigateBack, useSwapRoutes } from '../../hooks'; + RouteCard, + RouteCardSkeleton, + RouteNotFoundCard, +} from '../../components/RouteCard'; +import { useNavigateBack, useRoutes } from '../../hooks'; import { useSetExecutableRoute } from '../../stores'; import { navigationRoutes } from '../../utils'; -import { Stack } from './SwapRoutesPage.style'; +import { Stack } from './RoutesPage.style'; -export const SwapRoutesPage: React.FC = () => { +export const RoutesPage: React.FC = () => { const { navigateBack, navigate } = useNavigateBack(); - const { - routes: swapRoutes, - isLoading, - isFetching, - dataUpdatedAt, - refetchTime, - refetch, - } = useSwapRoutes(); + const { routes, isLoading, isFetching, dataUpdatedAt, refetchTime, refetch } = + useRoutes(); const setExecutableRoute = useSetExecutableRoute(); const handleRouteClick = (route: Route) => { @@ -34,7 +28,7 @@ export const SwapRoutesPage: React.FC = () => { }; useEffect(() => { - if (!swapRoutes?.length && !isLoading && !isFetching) { + if (!routes?.length && !isLoading && !isFetching) { navigateBack(); } // redirect to the home page if no routes are found on page reload @@ -57,24 +51,24 @@ export const SwapRoutesPage: React.FC = () => { ); }, [dataUpdatedAt, isFetching, refetch, refetchTime]); - const routeNotFound = !swapRoutes?.length && !isLoading && !isFetching; + const routeNotFound = !routes?.length && !isLoading && !isFetching; return ( {routeNotFound ? ( - + ) : isLoading ? ( Array.from({ length: 3 }).map((_, index) => ( - + )) ) : ( - swapRoutes?.map((route: Route, index: number) => ( - ( + handleRouteClick(route)} active={index === 0} - expanded={swapRoutes?.length <= 2} + expanded={routes?.length <= 2} /> )) )} diff --git a/packages/widget/src/pages/RoutesPage/index.ts b/packages/widget/src/pages/RoutesPage/index.ts new file mode 100644 index 000000000..30db2ec87 --- /dev/null +++ b/packages/widget/src/pages/RoutesPage/index.ts @@ -0,0 +1 @@ +export * from './RoutesPage'; diff --git a/packages/widget/src/pages/SelectChainPage/types.ts b/packages/widget/src/pages/SelectChainPage/types.ts index fa00f2548..e0574a72c 100644 --- a/packages/widget/src/pages/SelectChainPage/types.ts +++ b/packages/widget/src/pages/SelectChainPage/types.ts @@ -1,5 +1,5 @@ -import type { SwapFormTypeProps } from '../../providers'; +import type { FormTypeProps } from '../../providers'; -export interface SelectChainPageProps extends SwapFormTypeProps { +export interface SelectChainPageProps extends FormTypeProps { selectNativeToken?: boolean; } diff --git a/packages/widget/src/pages/SelectNativeTokenPage/SelectNativeTokenPage.tsx b/packages/widget/src/pages/SelectNativeTokenPage/SelectNativeTokenPage.tsx index f5e596daf..2c5019d94 100644 --- a/packages/widget/src/pages/SelectNativeTokenPage/SelectNativeTokenPage.tsx +++ b/packages/widget/src/pages/SelectNativeTokenPage/SelectNativeTokenPage.tsx @@ -5,9 +5,9 @@ import { ListItemText } from '../../components/ListItemText'; import { TokenAvatar } from '../../components/TokenAvatar'; import { useTokenSelect } from '../../components/TokenList'; import { useChains, useNavigateBack } from '../../hooks'; -import type { SwapFormTypeProps } from '../../providers'; +import type { FormTypeProps } from '../../providers'; -export const SelectNativeTokenPage: React.FC = ({ +export const SelectNativeTokenPage: React.FC = ({ formType, }) => { const { t } = useTranslation(); diff --git a/packages/widget/src/pages/SelectTokenPage/SearchTokenInput.tsx b/packages/widget/src/pages/SelectTokenPage/SearchTokenInput.tsx index e07efaa5e..1d0901008 100644 --- a/packages/widget/src/pages/SelectTokenPage/SearchTokenInput.tsx +++ b/packages/widget/src/pages/SelectTokenPage/SearchTokenInput.tsx @@ -4,7 +4,7 @@ import { useEffect } from 'react'; import { useFormContext } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { Card } from '../../components/Card'; -import { SwapFormKey } from '../../providers'; +import { FormKey } from '../../providers'; import { Input } from './SearchTokenInput.style'; export const SearchTokenInput = () => { @@ -13,7 +13,7 @@ export const SearchTokenInput = () => { useEffect( () => () => { - setValue(SwapFormKey.TokenSearchFilter, ''); + setValue(FormKey.TokenSearchFilter, ''); }, [setValue], ); @@ -32,7 +32,7 @@ export const SearchTokenInput = () => { } inputProps={{ inputMode: 'search', - ...register(SwapFormKey.TokenSearchFilter), + ...register(FormKey.TokenSearchFilter), }} autoComplete="off" /> diff --git a/packages/widget/src/pages/SelectTokenPage/SelectTokenPage.tsx b/packages/widget/src/pages/SelectTokenPage/SelectTokenPage.tsx index ec0bdc024..ff68c88f7 100644 --- a/packages/widget/src/pages/SelectTokenPage/SelectTokenPage.tsx +++ b/packages/widget/src/pages/SelectTokenPage/SelectTokenPage.tsx @@ -9,12 +9,12 @@ import { useScrollableOverflowHidden, useSwapOnly, } from '../../hooks'; -import type { SwapFormTypeProps } from '../../providers'; +import type { FormTypeProps } from '../../providers'; import { SearchTokenInput } from './SearchTokenInput'; const minTokenListHeight = 360; -export const SelectTokenPage: FC = ({ formType }) => { +export const SelectTokenPage: FC = ({ formType }) => { useScrollableOverflowHidden(); const { navigateBack } = useNavigateBack(); const headerRef = useRef(null); diff --git a/packages/widget/src/pages/SwapDetailsPage/index.ts b/packages/widget/src/pages/SwapDetailsPage/index.ts deleted file mode 100644 index 5aae14ad7..000000000 --- a/packages/widget/src/pages/SwapDetailsPage/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './SwapDetailsPage'; diff --git a/packages/widget/src/pages/SwapHistoryPage/index.ts b/packages/widget/src/pages/SwapHistoryPage/index.ts deleted file mode 100644 index ab0ccd37b..000000000 --- a/packages/widget/src/pages/SwapHistoryPage/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './SwapHistoryPage'; diff --git a/packages/widget/src/pages/SwapPage/index.ts b/packages/widget/src/pages/SwapPage/index.ts deleted file mode 100644 index aca6123a3..000000000 --- a/packages/widget/src/pages/SwapPage/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './SwapPage'; diff --git a/packages/widget/src/pages/SwapPage/types.ts b/packages/widget/src/pages/SwapPage/types.ts deleted file mode 100644 index a04365438..000000000 --- a/packages/widget/src/pages/SwapPage/types.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Route } from '@lifi/sdk'; - -export interface StartSwapButtonProps { - onClick?(): void; - route?: Route; - text?: string; - disabled?: boolean; - loading?: boolean; - insurableRouteId: string; -} diff --git a/packages/widget/src/pages/SwapRoutesPage/index.ts b/packages/widget/src/pages/SwapRoutesPage/index.ts deleted file mode 100644 index bf909cdb8..000000000 --- a/packages/widget/src/pages/SwapRoutesPage/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './SwapRoutesPage'; diff --git a/packages/widget/src/pages/SwapDetailsPage/SwapDetailsPage.style.tsx b/packages/widget/src/pages/TransactionDetailsPage/TransactionDetailsPage.style.tsx similarity index 100% rename from packages/widget/src/pages/SwapDetailsPage/SwapDetailsPage.style.tsx rename to packages/widget/src/pages/TransactionDetailsPage/TransactionDetailsPage.style.tsx diff --git a/packages/widget/src/pages/SwapDetailsPage/SwapDetailsPage.tsx b/packages/widget/src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx similarity index 97% rename from packages/widget/src/pages/SwapDetailsPage/SwapDetailsPage.tsx rename to packages/widget/src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx index 86b5eec2b..5952de69d 100644 --- a/packages/widget/src/pages/SwapDetailsPage/SwapDetailsPage.tsx +++ b/packages/widget/src/pages/TransactionDetailsPage/TransactionDetailsPage.tsx @@ -24,9 +24,9 @@ import { useNavigateBack } from '../../hooks'; import { useWidgetConfig } from '../../providers'; import { useRouteExecutionStore } from '../../stores'; import { formatTokenAmount } from '../../utils'; -import { Container } from './SwapDetailsPage.style'; +import { Container } from './TransactionDetailsPage.style'; -export const SwapDetailsPage: React.FC = () => { +export const TransactionDetailsPage: React.FC = () => { const { t, i18n } = useTranslation(); const { navigateBack } = useNavigateBack(); const { variant } = useWidgetConfig(); diff --git a/packages/widget/src/pages/TransactionDetailsPage/index.ts b/packages/widget/src/pages/TransactionDetailsPage/index.ts new file mode 100644 index 000000000..ddb9e4401 --- /dev/null +++ b/packages/widget/src/pages/TransactionDetailsPage/index.ts @@ -0,0 +1 @@ +export * from './TransactionDetailsPage'; diff --git a/packages/widget/src/pages/SwapHistoryPage/SwapHistoryEmpty.tsx b/packages/widget/src/pages/TransactionHistoryPage/TransactionHistoryEmpty.tsx similarity index 93% rename from packages/widget/src/pages/SwapHistoryPage/SwapHistoryEmpty.tsx rename to packages/widget/src/pages/TransactionHistoryPage/TransactionHistoryEmpty.tsx index d7c3eb7b4..c6cf3b022 100644 --- a/packages/widget/src/pages/SwapHistoryPage/SwapHistoryEmpty.tsx +++ b/packages/widget/src/pages/TransactionHistoryPage/TransactionHistoryEmpty.tsx @@ -2,7 +2,7 @@ import ReceiptLongRoundedIcon from '@mui/icons-material/ReceiptLongRounded'; import { Container, Typography } from '@mui/material'; import { useTranslation } from 'react-i18next'; -export const SwapHistoryEmpty: React.FC = () => { +export const TransactionHistoryEmpty: React.FC = () => { const { t } = useTranslation(); return ( = ({ route }) => { const { i18n } = useTranslation(); diff --git a/packages/widget/src/pages/SwapHistoryPage/SwapHistoryPage.tsx b/packages/widget/src/pages/TransactionHistoryPage/TransactionHistoryPage.tsx similarity index 73% rename from packages/widget/src/pages/SwapHistoryPage/SwapHistoryPage.tsx rename to packages/widget/src/pages/TransactionHistoryPage/TransactionHistoryPage.tsx index 30368a60a..058ef984a 100644 --- a/packages/widget/src/pages/SwapHistoryPage/SwapHistoryPage.tsx +++ b/packages/widget/src/pages/TransactionHistoryPage/TransactionHistoryPage.tsx @@ -15,14 +15,14 @@ import { Dialog } from '../../components/Dialog'; import { useHeaderStore } from '../../components/Header'; import { useWallet } from '../../providers'; import { useRouteExecutionStore } from '../../stores'; -import { useSwapHistory } from '../../stores/routes'; -import { SwapHistoryEmpty } from './SwapHistoryEmpty'; -import { SwapHistoryItem } from './SwapHistoryItem'; +import { useTransactionHistory } from '../../stores/routes'; +import { TransactionHistoryEmpty } from './TransactionHistoryEmpty'; +import { TransactionHistoryItem } from './TransactionHistoryItem'; -export const SwapHistoryPage: React.FC = () => { +export const TransactionHistoryPage: React.FC = () => { const { t } = useTranslation(); const { account } = useWallet(); - const swaps = useSwapHistory(account.address); + const transactions = useTransactionHistory(account.address); const deleteRoutes = useRouteExecutionStore((store) => store.deleteRoutes); const [open, setOpen] = useState(false); @@ -31,28 +31,28 @@ export const SwapHistoryPage: React.FC = () => { }, []); useEffect(() => { - if (swaps.length) { + if (transactions.length) { return useHeaderStore.getState().setAction( , ); } - }, [swaps.length, toggleDialog]); + }, [transactions.length, toggleDialog]); - if (!swaps.length) { - return ; + if (!transactions.length) { + return ; } return ( - {swaps.length ? ( - swaps.map(({ route }) => ( - + {transactions.length ? ( + transactions.map(({ route }) => ( + )) ) : ( - + )} diff --git a/packages/widget/src/pages/TransactionHistoryPage/index.ts b/packages/widget/src/pages/TransactionHistoryPage/index.ts new file mode 100644 index 000000000..7ccf38b8d --- /dev/null +++ b/packages/widget/src/pages/TransactionHistoryPage/index.ts @@ -0,0 +1 @@ +export * from './TransactionHistoryPage'; diff --git a/packages/widget/src/pages/SwapPage/ExchangeRateBottomSheet.tsx b/packages/widget/src/pages/TransactionPage/ExchangeRateBottomSheet.tsx similarity index 100% rename from packages/widget/src/pages/SwapPage/ExchangeRateBottomSheet.tsx rename to packages/widget/src/pages/TransactionPage/ExchangeRateBottomSheet.tsx diff --git a/packages/widget/src/pages/SwapPage/StartSwapButton.tsx b/packages/widget/src/pages/TransactionPage/StartTransactionButton.tsx similarity index 60% rename from packages/widget/src/pages/SwapPage/StartSwapButton.tsx rename to packages/widget/src/pages/TransactionPage/StartTransactionButton.tsx index 19a1f44f4..a716411a5 100644 --- a/packages/widget/src/pages/SwapPage/StartSwapButton.tsx +++ b/packages/widget/src/pages/TransactionPage/StartTransactionButton.tsx @@ -1,13 +1,9 @@ -import { SwapButton } from '../../components/SwapButton'; -import { - useFundsSufficiency, - useGasSufficiency, - useSwapRoutes, -} from '../../hooks'; +import { DefaultTransactionButton } from '../../components/DefaultTransactionButton'; +import { useFundsSufficiency, useGasSufficiency, useRoutes } from '../../hooks'; import { useRouteExecutionStore } from '../../stores'; -import type { StartSwapButtonProps } from './types'; +import type { StartTransactionButtonProps } from './types'; -export const StartSwapButton: React.FC = ({ +export const StartTransactionButton: React.FC = ({ onClick, route, text, @@ -19,33 +15,27 @@ export const StartSwapButton: React.FC = ({ useFundsSufficiency(route); return ( - ); }; -export const StartIdleSwapButton: React.FC = ({ - onClick, - route, - text, - loading, - disabled, - insurableRouteId, -}) => { +export const StartInsurableTransactionButton: React.FC< + StartTransactionButtonProps +> = ({ onClick, text, route, loading, disabled, insurableRouteId }) => { const routeExecution = useRouteExecutionStore( (state) => state.routes[insurableRouteId], ); - const { isFetching } = useSwapRoutes({ + const { isFetching } = useRoutes({ insurableRoute: routeExecution?.route, }); return ( - = ({ const clearFromAmount = () => { refetchAllBalances(); - setValue(SwapFormKey.FromAmount, ''); - setValue(SwapFormKey.ToAmount, ''); + setValue(FormKey.FromAmount, ''); + setValue(FormKey.ToAmount, ''); }; const handleDone = () => { @@ -67,16 +67,16 @@ export const StatusBottomSheet: React.FC = ({ toToken.address !== route.toToken.address ) { setValue( - SwapFormKey.FromAmount, + FormKey.FromAmount, formatTokenAmount(toToken.amount, toToken.decimals), { shouldTouch: true }, ); - setValue(SwapFormKey.FromChain, toToken.chainId, { shouldTouch: true }); - setValue(SwapFormKey.FromToken, toToken.address, { shouldTouch: true }); - setValue(SwapFormKey.ToChain, route.toToken.chainId, { + setValue(FormKey.FromChain, toToken.chainId, { shouldTouch: true }); + setValue(FormKey.FromToken, toToken.address, { shouldTouch: true }); + setValue(FormKey.ToChain, route.toToken.chainId, { shouldTouch: true, }); - setValue(SwapFormKey.ToToken, route.toToken.address, { + setValue(FormKey.ToToken, route.toToken.address, { shouldTouch: true, }); } diff --git a/packages/widget/src/pages/SwapPage/TokenValueBottomSheet.tsx b/packages/widget/src/pages/TransactionPage/TokenValueBottomSheet.tsx similarity index 100% rename from packages/widget/src/pages/SwapPage/TokenValueBottomSheet.tsx rename to packages/widget/src/pages/TransactionPage/TokenValueBottomSheet.tsx diff --git a/packages/widget/src/pages/SwapPage/SwapPage.style.tsx b/packages/widget/src/pages/TransactionPage/TransactionPage.style.tsx similarity index 100% rename from packages/widget/src/pages/SwapPage/SwapPage.style.tsx rename to packages/widget/src/pages/TransactionPage/TransactionPage.style.tsx diff --git a/packages/widget/src/pages/SwapPage/SwapPage.tsx b/packages/widget/src/pages/TransactionPage/TransactionPage.tsx similarity index 91% rename from packages/widget/src/pages/SwapPage/SwapPage.tsx rename to packages/widget/src/pages/TransactionPage/TransactionPage.tsx index 13559fa25..f763bd52d 100644 --- a/packages/widget/src/pages/SwapPage/SwapPage.tsx +++ b/packages/widget/src/pages/TransactionPage/TransactionPage.tsx @@ -16,22 +16,25 @@ import { useRouteExecution, useWidgetEvents, } from '../../hooks'; -import { SwapFormKey, useWidgetConfig } from '../../providers'; +import { FormKey, useWidgetConfig } from '../../providers'; import { RouteExecutionStatus } from '../../stores'; import { WidgetEvent } from '../../types/events'; import { formatTokenAmount } from '../../utils'; import type { ExchangeRateBottomSheetBase } from './ExchangeRateBottomSheet'; import { ExchangeRateBottomSheet } from './ExchangeRateBottomSheet'; -import { StartIdleSwapButton, StartSwapButton } from './StartSwapButton'; +import { + StartInsurableTransactionButton, + StartTransactionButton, +} from './StartTransactionButton'; import { StatusBottomSheet } from './StatusBottomSheet'; -import { Container } from './SwapPage.style'; import { TokenValueBottomSheet, getTokenValueLossThreshold, } from './TokenValueBottomSheet'; +import { Container } from './TransactionPage.style'; import { calcValueLoss } from './utils'; -export const SwapPage: React.FC = () => { +export const TransactionPage: React.FC = () => { const { t } = useTranslation(); const { setValue } = useFormContext(); const emitter = useWidgetEvents(); @@ -88,10 +91,10 @@ export const SwapPage: React.FC = () => { } tokenValueBottomSheetRef.current?.close(); executeRoute(); - setValue(SwapFormKey.FromAmount, ''); + setValue(FormKey.FromAmount, ''); }; - const handleSwapClick = async () => { + const handleStartClick = async () => { if (status === RouteExecutionStatus.Idle) { if (tokenValueLossThresholdExceeded && variant !== 'nft') { tokenValueBottomSheetRef.current?.open(); @@ -109,7 +112,7 @@ export const SwapPage: React.FC = () => { deleteRoute(); }; - const getSwapButtonText = () => { + const getButtonText = () => { switch (status) { case RouteExecutionStatus.Idle: switch (variant) { @@ -138,7 +141,9 @@ export const SwapPage: React.FC = () => { const insuranceAvailable = insuredRoute || insurableRoute; - const SwapButton = insurableRoute ? StartIdleSwapButton : StartSwapButton; + const StartButton = insurableRoute + ? StartInsurableTransactionButton + : StartTransactionButton; const getInsuranceCoverageId = () => route.steps[0].execution?.process @@ -169,9 +174,9 @@ export const SwapPage: React.FC = () => { <> - diff --git a/packages/widget/src/pages/TransactionPage/index.ts b/packages/widget/src/pages/TransactionPage/index.ts new file mode 100644 index 000000000..4accc7a60 --- /dev/null +++ b/packages/widget/src/pages/TransactionPage/index.ts @@ -0,0 +1 @@ +export * from './TransactionPage'; diff --git a/packages/widget/src/pages/TransactionPage/types.ts b/packages/widget/src/pages/TransactionPage/types.ts new file mode 100644 index 000000000..4df2dc2fc --- /dev/null +++ b/packages/widget/src/pages/TransactionPage/types.ts @@ -0,0 +1,8 @@ +import type { Route } from '@lifi/sdk'; +import type { DefaultTransactionButtonProps } from '../../components/DefaultTransactionButton'; + +export interface StartTransactionButtonProps + extends DefaultTransactionButtonProps { + route?: Route; + insurableRouteId: string; +} diff --git a/packages/widget/src/pages/SwapPage/utils.ts b/packages/widget/src/pages/TransactionPage/utils.ts similarity index 100% rename from packages/widget/src/pages/SwapPage/utils.ts rename to packages/widget/src/pages/TransactionPage/utils.ts diff --git a/packages/widget/src/providers/SwapFormProvider/SwapFormProvider.tsx b/packages/widget/src/providers/FormProvider/FormProvider.tsx similarity index 58% rename from packages/widget/src/providers/SwapFormProvider/SwapFormProvider.tsx rename to packages/widget/src/providers/FormProvider/FormProvider.tsx index 30e623e58..48cbb957a 100644 --- a/packages/widget/src/providers/SwapFormProvider/SwapFormProvider.tsx +++ b/packages/widget/src/providers/FormProvider/FormProvider.tsx @@ -1,22 +1,25 @@ import { useMemo } from 'react'; -import { FormProvider, useForm } from 'react-hook-form'; +import { + FormProvider as ReactHookFormProvider, + useForm, +} from 'react-hook-form'; import { useWidgetConfig } from '../WidgetProvider'; import { FormUpdater } from './FormUpdater'; -import type { SwapFormValues } from './types'; -import { SwapFormKey } from './types'; +import type { FormValues } from './types'; +import { FormKey } from './types'; export const formDefaultValues = { - [SwapFormKey.FromAmount]: '', - [SwapFormKey.ToAddress]: '', - [SwapFormKey.TokenSearchFilter]: '', - [SwapFormKey.ContractOutputsToken]: '', - [SwapFormKey.ToContractAddress]: '', - [SwapFormKey.ToContractCallData]: '', - [SwapFormKey.ToContractGasLimit]: '', - [SwapFormKey.ToAmount]: '', + [FormKey.FromAmount]: '', + [FormKey.ToAddress]: '', + [FormKey.TokenSearchFilter]: '', + [FormKey.ContractOutputsToken]: '', + [FormKey.ToContractAddress]: '', + [FormKey.ToContractCallData]: '', + [FormKey.ToContractGasLimit]: '', + [FormKey.ToAmount]: '', }; -export const SwapFormProvider: React.FC> = ({ +export const FormProvider: React.FC> = ({ children, }) => { const { fromChain, fromToken, fromAmount, toChain, toToken, toAddress } = @@ -38,15 +41,15 @@ export const SwapFormProvider: React.FC> = ({ [fromAmount, fromChain, fromToken, toAddress, toChain, toToken], ); - const methods = useForm({ + const methods = useForm({ // values, defaultValues, }); return ( - + {children} - + ); }; diff --git a/packages/widget/src/providers/SwapFormProvider/FormUpdater.tsx b/packages/widget/src/providers/FormProvider/FormUpdater.tsx similarity index 66% rename from packages/widget/src/providers/SwapFormProvider/FormUpdater.tsx rename to packages/widget/src/providers/FormProvider/FormUpdater.tsx index 843aa28f2..fa52c3f3a 100644 --- a/packages/widget/src/providers/SwapFormProvider/FormUpdater.tsx +++ b/packages/widget/src/providers/FormProvider/FormUpdater.tsx @@ -1,13 +1,13 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import { useEffect, useRef } from 'react'; import { useFormContext } from 'react-hook-form'; -import type { SwapFormValues } from '../SwapFormProvider'; -import { SwapFormKey } from '../SwapFormProvider'; +import type { FormValues } from '.'; +import { FormKey } from '.'; import { useWallet } from '../WalletProvider'; import { isItemAllowed, useWidgetConfig } from '../WidgetProvider'; export const FormUpdater: React.FC<{ - defaultValues: Partial; + defaultValues: Partial; }> = ({ defaultValues }) => { const { fromChain, toChain, chains } = useWidgetConfig(); const { account } = useWallet(); @@ -30,30 +30,26 @@ export const FormUpdater: React.FC<{ return; } - const { isTouched: isFromChainTouched } = getFieldState( - SwapFormKey.FromChain, - ); - const { isTouched: isToChainTouched } = getFieldState(SwapFormKey.ToChain); - const { isTouched: isFromTokenTouched } = getFieldState( - SwapFormKey.FromToken, - ); - const { isTouched: isToTokenTouched } = getFieldState(SwapFormKey.ToToken); + const { isTouched: isFromChainTouched } = getFieldState(FormKey.FromChain); + const { isTouched: isToChainTouched } = getFieldState(FormKey.ToChain); + const { isTouched: isFromTokenTouched } = getFieldState(FormKey.FromToken); + const { isTouched: isToTokenTouched } = getFieldState(FormKey.ToToken); const { isTouched: isFromAmountTouched } = getFieldState( - SwapFormKey.FromAmount, + FormKey.FromAmount, ); if (!fromChain && !isFromChainTouched && !isFromTokenTouched) { - resetField(SwapFormKey.FromChain, { defaultValue: account.chainId }); - setValue(SwapFormKey.FromChain, account.chainId); - setValue(SwapFormKey.FromToken, ''); + resetField(FormKey.FromChain, { defaultValue: account.chainId }); + setValue(FormKey.FromChain, account.chainId); + setValue(FormKey.FromToken, ''); if (isFromAmountTouched) { - setValue(SwapFormKey.FromAmount, ''); + setValue(FormKey.FromAmount, ''); } } if (!toChain && !isToChainTouched && !isToTokenTouched) { - resetField(SwapFormKey.ToChain, { defaultValue: account.chainId }); - setValue(SwapFormKey.ToChain, account.chainId); - setValue(SwapFormKey.ToToken, ''); + resetField(FormKey.ToChain, { defaultValue: account.chainId }); + setValue(FormKey.ToChain, account.chainId); + setValue(FormKey.ToToken, ''); } }, [ account.chainId, @@ -70,12 +66,12 @@ export const FormUpdater: React.FC<{ // Makes widget config options reactive to changes // Acts similar to values property from useForm, but includes additional logic for chains useEffect(() => { - (Object.keys(defaultValues) as SwapFormKey[]).forEach((key) => { + (Object.keys(defaultValues) as FormKey[]).forEach((key) => { if (previousDefaultValues.current[key] !== defaultValues[key]) { const value = defaultValues[key] || // set the chain to the current user one if it is not present in the config - (key === SwapFormKey.FromChain || key === SwapFormKey.ToChain + (key === FormKey.FromChain || key === FormKey.ToChain ? account.chainId || '' : ''); setValue(key, value); diff --git a/packages/widget/src/providers/SwapFormProvider/URLSearchParamsBuilder.tsx b/packages/widget/src/providers/FormProvider/URLSearchParamsBuilder.tsx similarity index 83% rename from packages/widget/src/providers/SwapFormProvider/URLSearchParamsBuilder.tsx rename to packages/widget/src/providers/FormProvider/URLSearchParamsBuilder.tsx index 30e352600..fa56e06f8 100644 --- a/packages/widget/src/providers/SwapFormProvider/URLSearchParamsBuilder.tsx +++ b/packages/widget/src/providers/FormProvider/URLSearchParamsBuilder.tsx @@ -1,15 +1,15 @@ import { useEffect } from 'react'; import { useFormState, useWatch } from 'react-hook-form'; import { useLocation } from 'react-router-dom'; -import { SwapFormKey } from './types'; +import { FormKey } from './types'; const formValueKeys = [ - SwapFormKey.FromAmount, - SwapFormKey.FromChain, - SwapFormKey.FromToken, - SwapFormKey.ToAddress, - SwapFormKey.ToChain, - SwapFormKey.ToToken, + FormKey.FromAmount, + FormKey.FromChain, + FormKey.FromToken, + FormKey.ToAddress, + FormKey.ToChain, + FormKey.ToToken, ]; export const URLSearchParamsBuilder = () => { diff --git a/packages/widget/src/providers/SwapFormProvider/index.ts b/packages/widget/src/providers/FormProvider/index.ts similarity index 65% rename from packages/widget/src/providers/SwapFormProvider/index.ts rename to packages/widget/src/providers/FormProvider/index.ts index 00e7b8259..068385c5a 100644 --- a/packages/widget/src/providers/SwapFormProvider/index.ts +++ b/packages/widget/src/providers/FormProvider/index.ts @@ -1,3 +1,3 @@ -export * from './SwapFormProvider'; +export * from './FormProvider'; export * from './URLSearchParamsBuilder'; export * from './types'; diff --git a/packages/widget/src/providers/FormProvider/types.ts b/packages/widget/src/providers/FormProvider/types.ts new file mode 100644 index 000000000..f10f725e1 --- /dev/null +++ b/packages/widget/src/providers/FormProvider/types.ts @@ -0,0 +1,44 @@ +export enum FormKey { + ContractOutputsToken = 'contractOutputsToken', + FromAmount = 'fromAmount', + FromChain = 'fromChain', + FromToken = 'fromToken', + ToAddress = 'toAddress', + ToAmount = 'toAmount', + ToChain = 'toChain', + ToContractAddress = 'toContractAddress', + ToContractCallData = 'toContractCallData', + ToContractGasLimit = 'ToContractGasLimit', + ToToken = 'toToken', + TokenSearchFilter = 'tokenSearchFilter', +} + +export type FormValues = { + [FormKey.ContractOutputsToken]: string; + [FormKey.FromAmount]: string; + [FormKey.FromChain]: number; + [FormKey.FromToken]: string; + [FormKey.ToAddress]: string; + [FormKey.ToAmount]: string; + [FormKey.ToChain]: number; + [FormKey.ToContractAddress]: string; + [FormKey.ToContractCallData]: string; + [FormKey.ToContractGasLimit]: string; + [FormKey.ToToken]: string; + [FormKey.TokenSearchFilter]: string; +}; + +export type FormType = 'from' | 'to'; + +export const FormKeyHelper = { + getChainKey: (formType: FormType): 'fromChain' | 'toChain' => + `${formType}Chain`, + getTokenKey: (formType: FormType): 'fromToken' | 'toToken' => + `${formType}Token`, + getAmountKey: (formType: FormType): 'fromAmount' | 'toAmount' => + `${formType}Amount`, +}; + +export interface FormTypeProps { + formType: FormType; +} diff --git a/packages/widget/src/providers/SwapFormProvider/types.ts b/packages/widget/src/providers/SwapFormProvider/types.ts deleted file mode 100644 index c0bfe85f1..000000000 --- a/packages/widget/src/providers/SwapFormProvider/types.ts +++ /dev/null @@ -1,44 +0,0 @@ -export enum SwapFormKey { - ContractOutputsToken = 'contractOutputsToken', - FromAmount = 'fromAmount', - FromChain = 'fromChain', - FromToken = 'fromToken', - ToAddress = 'toAddress', - ToAmount = 'toAmount', - ToChain = 'toChain', - ToContractAddress = 'toContractAddress', - ToContractCallData = 'toContractCallData', - ToContractGasLimit = 'ToContractGasLimit', - ToToken = 'toToken', - TokenSearchFilter = 'tokenSearchFilter', -} - -export type SwapFormValues = { - [SwapFormKey.ContractOutputsToken]: string; - [SwapFormKey.FromAmount]: string; - [SwapFormKey.FromChain]: number; - [SwapFormKey.FromToken]: string; - [SwapFormKey.ToAddress]: string; - [SwapFormKey.ToAmount]: string; - [SwapFormKey.ToChain]: number; - [SwapFormKey.ToContractAddress]: string; - [SwapFormKey.ToContractCallData]: string; - [SwapFormKey.ToContractGasLimit]: string; - [SwapFormKey.ToToken]: string; - [SwapFormKey.TokenSearchFilter]: string; -}; - -export type SwapFormType = 'from' | 'to'; - -export const SwapFormKeyHelper = { - getChainKey: (formType: SwapFormType): 'fromChain' | 'toChain' => - `${formType}Chain`, - getTokenKey: (formType: SwapFormType): 'fromToken' | 'toToken' => - `${formType}Token`, - getAmountKey: (formType: SwapFormType): 'fromAmount' | 'toAmount' => - `${formType}Amount`, -}; - -export interface SwapFormTypeProps { - formType: SwapFormType; -} diff --git a/packages/widget/src/providers/index.ts b/packages/widget/src/providers/index.ts index 2b4ae7b66..14a159570 100644 --- a/packages/widget/src/providers/index.ts +++ b/packages/widget/src/providers/index.ts @@ -1,6 +1,6 @@ +export * from './FormProvider'; export * from './I18nProvider'; export * from './SDKProvider'; -export * from './SwapFormProvider'; export * from './ThemeProvider'; export * from './WalletProvider'; export * from './WidgetProvider'; diff --git a/packages/widget/src/stores/routes/createRouteExecutionStore.ts b/packages/widget/src/stores/routes/createRouteExecutionStore.ts index 3c090ce40..328c2bb3e 100644 --- a/packages/widget/src/stores/routes/createRouteExecutionStore.ts +++ b/packages/widget/src/stores/routes/createRouteExecutionStore.ts @@ -132,7 +132,7 @@ export const createRouteExecutionStore = ({ namePrefix }: PersistStoreProps) => ...persistedState, } as RouteExecutionState; try { - // Move swaps to history after 1 day + // Move transactions to history after 1 day const currentTime = new Date().getTime(); const oneDay = 1000 * 60 * 60 * 24; Object.values(state.routes).forEach((routeExecution) => { diff --git a/packages/widget/src/stores/routes/index.ts b/packages/widget/src/stores/routes/index.ts index 04a7bb0fe..7d382ea3d 100644 --- a/packages/widget/src/stores/routes/index.ts +++ b/packages/widget/src/stores/routes/index.ts @@ -2,5 +2,5 @@ export * from './RouteExecutionStore'; export * from './types'; export * from './useExecutingRoutesIds'; export * from './useSetExecutableRoute'; -export * from './useSwapHistory'; +export * from './useTransactionHistory'; export * from './utils'; diff --git a/packages/widget/src/stores/routes/useSwapHistory.ts b/packages/widget/src/stores/routes/useTransactionHistory.ts similarity index 92% rename from packages/widget/src/stores/routes/useSwapHistory.ts rename to packages/widget/src/stores/routes/useTransactionHistory.ts index f7028f9a0..c8eb1abcd 100644 --- a/packages/widget/src/stores/routes/useSwapHistory.ts +++ b/packages/widget/src/stores/routes/useTransactionHistory.ts @@ -4,7 +4,7 @@ import { useRouteExecutionStore } from './RouteExecutionStore'; import type { RouteExecution } from './types'; import { RouteExecutionStatus } from './types'; -export const useSwapHistory = (address?: string) => { +export const useTransactionHistory = (address?: string) => { return useRouteExecutionStore( (state) => Object.values(state.routes) diff --git a/packages/widget/src/types/widget.ts b/packages/widget/src/types/widget.ts index 6eca07178..973e74177 100644 --- a/packages/widget/src/types/widget.ts +++ b/packages/widget/src/types/widget.ts @@ -138,7 +138,7 @@ export interface WidgetConfig { walletManagement?: WidgetWalletManagement; sdkConfig?: SDKConfig; - buildSwapUrl?: boolean; + buildUrl?: boolean; localStorageKeyPrefix?: string; bridges?: { From afbf669743d99835fed96bb3b04c506a25dedfb6 Mon Sep 17 00:00:00 2001 From: Eugene Chybisov Date: Fri, 9 Jun 2023 18:27:40 +0200 Subject: [PATCH 10/13] fix: translation tags should work inside tooltip --- .../components/Insurance/InsuranceCard.tsx | 23 ++++++++++--------- .../src/components/RouteCard/RouteCard.tsx | 14 +++++++---- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/packages/widget/src/components/Insurance/InsuranceCard.tsx b/packages/widget/src/components/Insurance/InsuranceCard.tsx index 740a570cd..5fed41c05 100644 --- a/packages/widget/src/components/Insurance/InsuranceCard.tsx +++ b/packages/widget/src/components/Insurance/InsuranceCard.tsx @@ -74,17 +74,18 @@ export const InsuranceCard: React.FC = ({ - - {status === RouteExecutionStatus.Idle - ? t('insurance.insure', { - amount: insuredAmount, - tokenSymbol: insuredTokenSymbol, - }) - : t('insurance.insured', { - amount: insuredAmount, - tokenSymbol: insuredTokenSymbol, - })} - + ]} + /> - {t('insurance.insure', { - amount: insuredAmount, - tokenSymbol: insuredTokenSymbol, - })} + ]} + /> Date: Fri, 9 Jun 2023 18:27:51 +0200 Subject: [PATCH 11/13] fix: update progress text --- .../ProgressToNextUpdate/ProgressToNextUpdate.tsx | 14 ++++++++++---- packages/widget/src/i18n/en.json | 8 ++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/widget/src/components/ProgressToNextUpdate/ProgressToNextUpdate.tsx b/packages/widget/src/components/ProgressToNextUpdate/ProgressToNextUpdate.tsx index 9af77e89d..84212bcb0 100644 --- a/packages/widget/src/components/ProgressToNextUpdate/ProgressToNextUpdate.tsx +++ b/packages/widget/src/components/ProgressToNextUpdate/ProgressToNextUpdate.tsx @@ -1,7 +1,7 @@ import type { IconButtonProps } from '@mui/material'; import { Box, CircularProgress, IconButton, Tooltip } from '@mui/material'; import { useEffect, useState } from 'react'; -import { useTranslation } from 'react-i18next'; +import { Trans, useTranslation } from 'react-i18next'; const getProgressValue = (updatedAt: number, timeToUpdate: number) => updatedAt @@ -44,9 +44,15 @@ export const ProgressToNextUpdate: React.FC< return ( ]} + /> + } placement="top" enterDelay={400} arrow diff --git a/packages/widget/src/i18n/en.json b/packages/widget/src/i18n/en.json index 4481099ee..6e29b32d4 100644 --- a/packages/widget/src/i18n/en.json +++ b/packages/widget/src/i18n/en.json @@ -118,7 +118,7 @@ "message": { "allowanceRequired": "Transfer amount for {{tokenSymbol}} exceeds your current allowance. Please increase your allowance and try again.", "insufficientFunds": "You don't have enough gas to cover the cost of the transaction.", - "slippageThreshold": "The slippage is larger than the defined threshold. Please request a new route to get a fresh quote.", + "slippageThreshold": "The slippage is larger than the defined threshold. Please request a new quote.", "transactionFailed": "Please check the block explorer for more information.", "transactionNotSent": "Transaction was not sent. {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}} remain in your wallet.", "transactionRejected": "Your signature is required to complete the transaction. {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}} remain in your wallet.", @@ -151,7 +151,7 @@ "title": "404" }, "numberOfSteps": "A number of exchange steps. Each step can contain 1-2 transactions that require a signature.", - "progressToNextUpdate": "Displayed data will auto-refresh after {{value}} seconds. Click here to update manually.", + "progressToNextUpdate": "Quotes will update in {{value}} seconds. <0/> Click here to update now.", "recommended": "A cheap route that balances complexity and ease of use.", "settingsModified": "Settings (modified)" }, @@ -239,8 +239,8 @@ }, "insurance": { "bridgeExploits": "Bridge malfunctions, hacks or exploits", - "insure": "Insure {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in transit.", - "insured": "You've insured {{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in transit:", + "insure": "Insure <0>{{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in transit.", + "insured": "You've insured <0>{{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} in transit:", "slippageError": "Error in slippage for tokens received" }, "settings": { From af2220ed90ece2bc051b8fa290dc38d2726f749c Mon Sep 17 00:00:00 2001 From: Eugene Chybisov Date: Fri, 9 Jun 2023 18:37:12 +0200 Subject: [PATCH 12/13] fix: don't gray out button on loading state --- packages/widget/src/config/theme.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/widget/src/config/theme.ts b/packages/widget/src/config/theme.ts index b79e79e45..b40444a18 100644 --- a/packages/widget/src/config/theme.ts +++ b/packages/widget/src/config/theme.ts @@ -215,16 +215,13 @@ export const createTheme = (mode: PaletteMode, theme: ThemeConfig = {}) => { pointerEvents: 'auto', }, [`&.${loadingButtonClasses.loading}.Mui-disabled`]: { - color: - mode === 'light' - ? alpha(common.black, 0.56) - : alpha(common.white, 0.56), + backgroundColor: primaryMainColor, + color: contrastButtonColor, + cursor: 'auto', + pointerEvents: 'auto', }, [`.${loadingButtonClasses.loadingIndicator}`]: { - color: - mode === 'light' - ? alpha(common.black, 0.56) - : alpha(common.white, 0.56), + color: contrastButtonColor, }, [`&.${loadingButtonClasses.root}.${loadingButtonClasses.loading}`]: { From a2cf9c0c8b67525fc8677b8f82a903782e63f32c Mon Sep 17 00:00:00 2001 From: Eugene Chybisov Date: Mon, 12 Jun 2023 14:43:39 +0200 Subject: [PATCH 13/13] ci: remove branch --- .github/workflows/deploy.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8519173fc..489eac093 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - adjust-terminology jobs: build: