From 9de1dddcf2231578c1cd6728f3a319d95e15b340 Mon Sep 17 00:00:00 2001 From: Shine Li Date: Mon, 17 Jun 2024 15:43:53 +1000 Subject: [PATCH 1/8] make import path consistent --- .../ChangedYourMindDrawer.tsx | 2 +- .../CoinSelector/CoinSelectorOption.tsx | 2 +- .../ConnectLoader/ConnectLoader.cy.tsx | 2 +- .../ConnectLoader/ConnectLoader.tsx | 2 +- .../FeesBreakdown/FeesBreakdown.cy.tsx | 2 +- .../FeesBreakdown/FeesBreakdown.tsx | 4 +- .../src/components/Footer/FooterButton.cy.tsx | 2 +- .../src/components/Footer/FooterLogo.cy.tsx | 2 +- .../components/Footer/QuickswapFooter.cy.tsx | 2 +- .../src/components/Footer/QuickswapFooter.tsx | 2 +- .../SelectForm/SelectForm.cy.tsx | 2 +- .../FormComponents/SelectForm/SelectForm.tsx | 2 +- .../TextInputForm/TextInputForm.cy.tsx | 2 +- .../components/Header/HeaderNavigation.cy.tsx | 2 +- .../src/components/Hero/RocketHero.tsx | 2 +- .../NetworkSwitchDrawer.tsx | 18 ++--- .../components/NotEnoughGas/NotEnoughGas.tsx | 4 +- .../components/NotEnoughImx/NotEnoughImx.tsx | 2 +- .../src/components/Status/StatusView.cy.tsx | 2 +- .../ThemeProvider/ThemeProvider.tsx | 6 +- .../src/components/TokenImage/TokenImage.tsx | 2 +- .../components/Transactions/ChangeWallet.tsx | 12 ++-- .../ClaimWithdrawalInProgress.tsx | 8 +-- .../Transactions/NoTransactions.tsx | 4 +- .../Transactions/NotEnoughEthToWithdraw.tsx | 6 +- .../Transactions/SupportMessage.tsx | 2 +- .../Transactions/TransactionDetails.tsx | 6 +- .../Transactions/TransactionItem.tsx | 6 +- .../TransactionItemWithdrawPending.tsx | 10 +-- .../Transactions/TransactionList.tsx | 8 +-- .../components/Transactions/Transactions.tsx | 36 +++++----- .../components/Transak/useTransakIframe.ts | 2 +- .../UnableToConnectDrawer.tsx | 2 +- .../components/WalletDrawer/WalletDrawer.tsx | 2 +- .../ConnectLoaderTestComponent.tsx | 2 +- .../EventTargetTestComponent.tsx | 2 +- .../view-context/BridgeViewContextTypes.ts | 2 +- .../ViewContextTestComponent.tsx | 6 +- packages/checkout/widgets-lib/src/factory.ts | 14 ++-- .../src/lib/clients/checkoutApi.ts | 2 +- .../src/views/loading/LoadingView.cy.tsx | 2 +- .../src/views/top-up/TopUpView.cy.tsx | 6 +- .../src/views/top-up/TopUpView.tsx | 12 ++-- .../src/widgets/bridge/BridgeWidget.cy.tsx | 10 +-- .../src/widgets/bridge/BridgeWidget.tsx | 27 +++---- .../src/widgets/bridge/BridgeWidgetRoot.tsx | 12 ++-- .../widgets/bridge/components/BridgeForm.tsx | 2 +- .../bridge/components/BridgeReviewSummary.tsx | 30 ++++---- .../components/WalletAndNetworkSelector.tsx | 16 ++--- .../bridge/components/WalletNetworkButton.tsx | 6 +- .../BridgeWidgetTestComponent.tsx | 2 +- .../bridge/views/ApproveTransaction.tsx | 2 +- .../src/widgets/bridge/views/Bridge.tsx | 2 +- .../src/widgets/bridge/views/BridgeReview.tsx | 10 +-- .../widgets/bridge/views/ClaimWithdrawal.tsx | 16 ++--- .../widgets/bridge/views/MoveInProgress.tsx | 8 +-- .../views/WalletNetworkSelectionView.tsx | 16 ++--- .../src/widgets/connect/ConnectWidget.cy.tsx | 2 +- .../src/widgets/connect/ConnectWidget.tsx | 2 +- .../src/widgets/connect/ConnectWidgetRoot.tsx | 10 +-- .../components/NonPassportWarningDrawer.tsx | 2 +- .../widgets/connect/components/WalletList.tsx | 4 +- .../widgets/connect/views/ReadyToConnect.tsx | 2 +- .../connect/views/SwitchNetworkEth.tsx | 2 +- .../connect/views/SwitchNetworkZkEVM.tsx | 2 +- .../src/widgets/on-ramp/OnRampWidget.tsx | 2 +- .../src/widgets/on-ramp/OnRampWidgetRoot.tsx | 16 ++--- .../on-ramp/views/OrderInProgress.cy.tsx | 2 +- .../src/widgets/sale/SaleWidgetRoot.tsx | 16 ++--- .../widgets/sale/components/CoinsDrawer.tsx | 2 +- .../sale/components/CoinsDrawerItem.tsx | 5 +- .../components/CreditCardWarningDrawer.tsx | 2 +- .../FundingRouteExecute.tsx | 4 +- .../src/widgets/sale/components/OrderFees.tsx | 4 +- .../src/widgets/sale/components/OrderItem.tsx | 6 +- .../widgets/sale/components/OrderItems.tsx | 2 +- .../widgets/sale/components/OrderReview.tsx | 4 +- .../sale/components/PaymentOptions.tsx | 2 +- .../sale/components/SelectCoinDropdown.tsx | 4 +- .../sale/functions/fetchFundingBalances.ts | 2 +- .../functions/fetchFundingBalancesUtils.ts | 16 ++--- .../sale/functions/fundingBalanceFees.ts | 6 +- .../sale/functions/transformToOrderQuote.ts | 2 +- .../widgets/sale/hooks/useFundingBalances.ts | 2 +- .../src/widgets/sale/hooks/useQuoteOrder.ts | 2 +- .../src/widgets/sale/utils/analytics.ts | 2 +- .../src/widgets/sale/utils/pricing.ts | 2 +- .../src/widgets/sale/views/OrderSummary.tsx | 4 +- .../src/widgets/swap/SwapWidget.cy.tsx | 2 +- .../src/widgets/swap/SwapWidgetRoot.tsx | 22 +++--- .../widgets/swap/components/SwapButton.tsx | 2 +- .../src/widgets/swap/components/SwapForm.tsx | 4 +- .../SwapWidgetTestComponent.tsx | 2 +- .../src/widgets/swap/views/SwapCoins.tsx | 2 +- .../src/widgets/wallet/WalletWidget.tsx | 4 +- .../src/widgets/wallet/WalletWidgetRoot.tsx | 16 ++--- .../components/BalanceItem/BalanceItem.cy.tsx | 2 +- .../components/BalanceItem/BalanceItem.tsx | 2 +- .../components/NetworkMenu/NetworkMenu.cy.tsx | 2 +- .../TokenBalanceList/TokenBalanceList.cy.tsx | 2 +- .../components/TransferAssetsL1Warning.tsx | 2 +- .../WalletAddress/WalletAddress.tsx | 6 +- .../WalletWidgetTestComponent.tsx | 2 +- .../src/widgets/wallet/views/Settings.tsx | 4 +- .../wallet/views/WalletBalances.cy.tsx | 2 +- .../widgets/wallet/views/WalletBalances.tsx | 8 +-- .../internal/bridge/sdk/src/config/index.ts | 2 +- .../sdk/src/contracts/createContract.ts | 2 +- .../bridge/sdk/src/lib/axelarUtils.ts | 10 +-- .../bridge/sdk/src/lib/gmpRecovery.ts | 10 +-- .../internal/bridge/sdk/src/lib/tenderly.ts | 6 +- packages/internal/bridge/sdk/src/lib/utils.ts | 12 ++-- .../internal/bridge/sdk/src/lib/validation.ts | 6 +- .../bridge/sdk/src/tokenBridge.test.ts | 37 +++++----- .../internal/bridge/sdk/src/tokenBridge.ts | 70 +++++++++---------- .../internal/cryptofiat/src/config/index.ts | 2 +- .../internal/cryptofiat/src/cryptofiat.ts | 4 +- packages/internal/dex/sdk/src/config/index.ts | 4 +- .../src/constants/tokens/immutable-mainnet.ts | 2 +- .../src/constants/tokens/immutable-testnet.ts | 2 +- ...ange.getUnsignedSwapTxFromAmountIn.test.ts | 2 +- ...nge.getUnsignedSwapTxFromAmountOut.test.ts | 2 +- packages/internal/dex/sdk/src/exchange.ts | 20 +++--- packages/internal/dex/sdk/src/lib/fees.ts | 4 +- .../dex/sdk/src/lib/getQuotesForRoutes.ts | 2 +- .../dex/sdk/src/lib/nativeTokenService.ts | 4 +- .../sdk/src/lib/poolUtils/fetchValidPools.ts | 6 +- .../poolUtils/generateAllAcyclicPaths.test.ts | 6 +- .../src/lib/poolUtils/generateERC20Pairs.ts | 2 +- .../generatePossiblePoolsFromERC20Pairs.ts | 2 +- packages/internal/dex/sdk/src/lib/router.ts | 4 +- .../sdk/src/lib/transactionUtils/approval.ts | 8 +-- .../sdk/src/lib/transactionUtils/gas.test.ts | 4 +- .../dex/sdk/src/lib/transactionUtils/gas.ts | 4 +- .../src/lib/transactionUtils/getQuote.test.ts | 8 +-- .../sdk/src/lib/transactionUtils/getQuote.ts | 10 +-- .../sdk/src/lib/transactionUtils/swap.test.ts | 8 +-- .../dex/sdk/src/lib/transactionUtils/swap.ts | 14 ++-- packages/internal/dex/sdk/src/lib/utils.ts | 6 +- packages/internal/dex/sdk/src/test/utils.ts | 14 ++-- .../internal/factory/sdk/src/config/index.ts | 6 +- .../factory/sdk/src/constants/factory.ts | 2 +- packages/internal/factory/sdk/src/factory.ts | 8 +-- packages/internal/metrics/src/performance.ts | 2 +- packages/minting-backend/sdk/src/index.ts | 2 +- .../orderbook/src/api-client/api-client.ts | 18 ++--- .../orderbook/src/erc721/erc721-factory.ts | 2 +- packages/orderbook/src/seaport/seaport.ts | 10 +-- packages/orderbook/src/seaport/transaction.ts | 2 +- packages/orderbook/src/test/cancel.e2e.ts | 2 +- packages/passport/sdk/src/authManager.ts | 2 +- packages/passport/sdk/src/guardian/index.ts | 4 +- packages/passport/sdk/src/mocks/zkEvm/msw.ts | 2 +- packages/passport/sdk/src/overlay/index.ts | 2 +- .../sdk/src/starkEx/workflows/order.ts | 2 +- .../src/starkEx/workflows/registerOffchain.ts | 8 +-- .../sdk/src/starkEx/workflows/transfer.ts | 2 +- .../src/storage/device_credentials_manager.ts | 2 +- packages/passport/sdk/src/utils/token.ts | 2 +- packages/passport/sdk/src/zkEvm/index.ts | 2 +- .../passport/sdk/src/zkEvm/relayerClient.ts | 2 +- .../passport/sdk/src/zkEvm/signTypedDataV4.ts | 2 +- .../sdk/src/zkEvm/user/registerZkEvmUser.ts | 2 +- packages/passport/sdk/tsconfig.json | 3 + 164 files changed, 495 insertions(+), 493 deletions(-) diff --git a/packages/checkout/widgets-lib/src/components/ChangedYourMindDrawer/ChangedYourMindDrawer.tsx b/packages/checkout/widgets-lib/src/components/ChangedYourMindDrawer/ChangedYourMindDrawer.tsx index e4f6bec986..4e6d3aeee8 100644 --- a/packages/checkout/widgets-lib/src/components/ChangedYourMindDrawer/ChangedYourMindDrawer.tsx +++ b/packages/checkout/widgets-lib/src/components/ChangedYourMindDrawer/ChangedYourMindDrawer.tsx @@ -9,8 +9,8 @@ import { } from '@biom3/react'; import { Checkout } from '@imtbl/checkout-sdk'; import { Environment } from '@imtbl/config'; -import { getRemoteImage } from 'lib/utils'; import { useTranslation } from 'react-i18next'; +import { getRemoteImage } from '../../lib/utils'; export interface ChangedYourMindDrawerProps { visible: boolean; diff --git a/packages/checkout/widgets-lib/src/components/CoinSelector/CoinSelectorOption.tsx b/packages/checkout/widgets-lib/src/components/CoinSelector/CoinSelectorOption.tsx index 7a31310445..77389f9968 100644 --- a/packages/checkout/widgets-lib/src/components/CoinSelector/CoinSelectorOption.tsx +++ b/packages/checkout/widgets-lib/src/components/CoinSelector/CoinSelectorOption.tsx @@ -1,6 +1,6 @@ import { MenuItem, AllIconKeys } from '@biom3/react'; import { useTranslation } from 'react-i18next'; -import { TokenImage } from 'components/TokenImage/TokenImage'; +import { TokenImage } from '../TokenImage/TokenImage'; export interface CoinSelectorOptionProps { testId?: string; diff --git a/packages/checkout/widgets-lib/src/components/ConnectLoader/ConnectLoader.cy.tsx b/packages/checkout/widgets-lib/src/components/ConnectLoader/ConnectLoader.cy.tsx index 030dee588f..9ca920b778 100644 --- a/packages/checkout/widgets-lib/src/components/ConnectLoader/ConnectLoader.cy.tsx +++ b/packages/checkout/widgets-lib/src/components/ConnectLoader/ConnectLoader.cy.tsx @@ -5,7 +5,7 @@ import { describe, it, cy } from 'local-cypress'; import { mount } from 'cypress/react18'; import { Environment } from '@imtbl/config'; import { Web3Provider } from '@ethersproject/providers'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../context/view-context/test-components/ViewContextTestComponent'; import { cyIntercept, cySmartGet } from '../../lib/testUtils'; import { ConnectLoader, ConnectLoaderParams } from './ConnectLoader'; import { StrongCheckoutWidgetsConfig } from '../../lib/withDefaultWidgetConfig'; diff --git a/packages/checkout/widgets-lib/src/components/ConnectLoader/ConnectLoader.tsx b/packages/checkout/widgets-lib/src/components/ConnectLoader/ConnectLoader.tsx index 01128f458d..b3f6080c98 100644 --- a/packages/checkout/widgets-lib/src/components/ConnectLoader/ConnectLoader.tsx +++ b/packages/checkout/widgets-lib/src/components/ConnectLoader/ConnectLoader.tsx @@ -11,7 +11,7 @@ import React, { useMemo, useReducer, } from 'react'; -import { ErrorView } from 'views/error/ErrorView'; +import { ErrorView } from '../../views/error/ErrorView'; import { ConnectLoaderActions, ConnectLoaderContext, diff --git a/packages/checkout/widgets-lib/src/components/FeesBreakdown/FeesBreakdown.cy.tsx b/packages/checkout/widgets-lib/src/components/FeesBreakdown/FeesBreakdown.cy.tsx index f4da472a4e..e52f61a5cb 100644 --- a/packages/checkout/widgets-lib/src/components/FeesBreakdown/FeesBreakdown.cy.tsx +++ b/packages/checkout/widgets-lib/src/components/FeesBreakdown/FeesBreakdown.cy.tsx @@ -1,7 +1,7 @@ import { describe, it, cy } from 'local-cypress'; import { mount } from 'cypress/react18'; import { Button } from '@biom3/react'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../context/view-context/test-components/ViewContextTestComponent'; import { cySmartGet } from '../../lib/testUtils'; import { SimpleLayout } from '../SimpleLayout/SimpleLayout'; import { FeesBreakdown } from './FeesBreakdown'; diff --git a/packages/checkout/widgets-lib/src/components/FeesBreakdown/FeesBreakdown.tsx b/packages/checkout/widgets-lib/src/components/FeesBreakdown/FeesBreakdown.tsx index 9cf8c950fb..09aea15712 100644 --- a/packages/checkout/widgets-lib/src/components/FeesBreakdown/FeesBreakdown.tsx +++ b/packages/checkout/widgets-lib/src/components/FeesBreakdown/FeesBreakdown.tsx @@ -1,9 +1,9 @@ import { Drawer, Box, Divider, MenuItem, } from '@biom3/react'; -import { formatZeroAmount, tokenValueFormat } from 'lib/utils'; import { useTranslation } from 'react-i18next'; -import { FormattedFee } from 'widgets/swap/functions/swapFees'; +import { formatZeroAmount, tokenValueFormat } from '../../lib/utils'; +import { FormattedFee } from '../../widgets/swap/functions/swapFees'; import { feeItemContainerStyles, feeItemLoadingStyles, feesBreakdownContentStyles } from './FeesBreakdownStyles'; import { FeeItem } from './FeeItem'; import { FooterLogo } from '../Footer/FooterLogo'; diff --git a/packages/checkout/widgets-lib/src/components/Footer/FooterButton.cy.tsx b/packages/checkout/widgets-lib/src/components/Footer/FooterButton.cy.tsx index 601a3240d0..ec82abd2fb 100644 --- a/packages/checkout/widgets-lib/src/components/Footer/FooterButton.cy.tsx +++ b/packages/checkout/widgets-lib/src/components/Footer/FooterButton.cy.tsx @@ -1,5 +1,5 @@ import { mount } from 'cypress/react18'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../context/view-context/test-components/ViewContextTestComponent'; import { SimpleLayout } from '../SimpleLayout/SimpleLayout'; import { FooterButton } from './FooterButton'; import { cySmartGet } from '../../lib/testUtils'; diff --git a/packages/checkout/widgets-lib/src/components/Footer/FooterLogo.cy.tsx b/packages/checkout/widgets-lib/src/components/Footer/FooterLogo.cy.tsx index f7b7418145..f1d1fbcfc7 100644 --- a/packages/checkout/widgets-lib/src/components/Footer/FooterLogo.cy.tsx +++ b/packages/checkout/widgets-lib/src/components/Footer/FooterLogo.cy.tsx @@ -1,5 +1,5 @@ import { mount } from 'cypress/react18'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../context/view-context/test-components/ViewContextTestComponent'; import { SimpleLayout } from '../SimpleLayout/SimpleLayout'; import { cySmartGet } from '../../lib/testUtils'; import { FooterLogo } from './FooterLogo'; diff --git a/packages/checkout/widgets-lib/src/components/Footer/QuickswapFooter.cy.tsx b/packages/checkout/widgets-lib/src/components/Footer/QuickswapFooter.cy.tsx index 1c0f8d9c34..22bba0471f 100644 --- a/packages/checkout/widgets-lib/src/components/Footer/QuickswapFooter.cy.tsx +++ b/packages/checkout/widgets-lib/src/components/Footer/QuickswapFooter.cy.tsx @@ -1,7 +1,7 @@ import { mount } from 'cypress/react18'; import { WidgetTheme } from '@imtbl/checkout-sdk'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; import { Environment } from '@imtbl/config'; +import { ViewContextTestComponent } from '../../context/view-context/test-components/ViewContextTestComponent'; import { SimpleLayout } from '../SimpleLayout/SimpleLayout'; import { cySmartGet } from '../../lib/testUtils'; import { QuickswapFooter } from './QuickswapFooter'; diff --git a/packages/checkout/widgets-lib/src/components/Footer/QuickswapFooter.tsx b/packages/checkout/widgets-lib/src/components/Footer/QuickswapFooter.tsx index f236957be9..2613a7cda3 100644 --- a/packages/checkout/widgets-lib/src/components/Footer/QuickswapFooter.tsx +++ b/packages/checkout/widgets-lib/src/components/Footer/QuickswapFooter.tsx @@ -3,7 +3,7 @@ import { Body, Box } from '@biom3/react'; import { WidgetTheme } from '@imtbl/checkout-sdk'; import { useTranslation } from 'react-i18next'; import { Environment } from '@imtbl/config'; -import { getRemoteImage } from 'lib/utils'; +import { getRemoteImage } from '../../lib/utils'; import { quickswapFooterStyles, quickswapFooterDisclaimerTextStyles, quickswapFooterLogoStyles } from './FooterStyles'; export interface QuickswapFooterProps { diff --git a/packages/checkout/widgets-lib/src/components/FormComponents/SelectForm/SelectForm.cy.tsx b/packages/checkout/widgets-lib/src/components/FormComponents/SelectForm/SelectForm.cy.tsx index 3005f638de..ed9976c4df 100644 --- a/packages/checkout/widgets-lib/src/components/FormComponents/SelectForm/SelectForm.cy.tsx +++ b/packages/checkout/widgets-lib/src/components/FormComponents/SelectForm/SelectForm.cy.tsx @@ -1,6 +1,6 @@ import { mount } from 'cypress/react18'; import { describe } from 'local-cypress'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../../context/view-context/test-components/ViewContextTestComponent'; import { SelectForm } from './SelectForm'; import { cySmartGet } from '../../../lib/testUtils'; diff --git a/packages/checkout/widgets-lib/src/components/FormComponents/SelectForm/SelectForm.tsx b/packages/checkout/widgets-lib/src/components/FormComponents/SelectForm/SelectForm.tsx index de769d6fc8..0cc7db4cb9 100644 --- a/packages/checkout/widgets-lib/src/components/FormComponents/SelectForm/SelectForm.tsx +++ b/packages/checkout/widgets-lib/src/components/FormComponents/SelectForm/SelectForm.tsx @@ -4,7 +4,7 @@ import { import { useMemo, useState } from 'react'; import { Environment } from '@imtbl/config'; import { WidgetTheme } from '@imtbl/checkout-sdk'; -import { TokenImage } from 'components/TokenImage/TokenImage'; +import { TokenImage } from '../../TokenImage/TokenImage'; import { FormControlWrapper } from '../FormControlWrapper/FormControlWrapper'; import { CoinSelector } from '../../CoinSelector/CoinSelector'; import { CoinSelectorOptionProps } from '../../CoinSelector/CoinSelectorOption'; diff --git a/packages/checkout/widgets-lib/src/components/FormComponents/TextInputForm/TextInputForm.cy.tsx b/packages/checkout/widgets-lib/src/components/FormComponents/TextInputForm/TextInputForm.cy.tsx index 6a7dc3c878..d35a7caac5 100644 --- a/packages/checkout/widgets-lib/src/components/FormComponents/TextInputForm/TextInputForm.cy.tsx +++ b/packages/checkout/widgets-lib/src/components/FormComponents/TextInputForm/TextInputForm.cy.tsx @@ -1,6 +1,6 @@ import { mount } from 'cypress/react18'; import { describe } from 'local-cypress'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../../context/view-context/test-components/ViewContextTestComponent'; import { cySmartGet } from '../../../lib/testUtils'; import { TextInputForm } from './TextInputForm'; diff --git a/packages/checkout/widgets-lib/src/components/Header/HeaderNavigation.cy.tsx b/packages/checkout/widgets-lib/src/components/Header/HeaderNavigation.cy.tsx index 918930a28d..48e889d46c 100644 --- a/packages/checkout/widgets-lib/src/components/Header/HeaderNavigation.cy.tsx +++ b/packages/checkout/widgets-lib/src/components/Header/HeaderNavigation.cy.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-console */ import { describe, it } from 'local-cypress'; import { mount } from 'cypress/react18'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; import { WidgetTheme } from '@imtbl/checkout-sdk'; import { ButtCon } from '@biom3/react'; +import { ViewContextTestComponent } from '../../context/view-context/test-components/ViewContextTestComponent'; import { cySmartGet } from '../../lib/testUtils'; import { SimpleLayout } from '../SimpleLayout/SimpleLayout'; import { HeaderNavigation } from './HeaderNavigation'; diff --git a/packages/checkout/widgets-lib/src/components/Hero/RocketHero.tsx b/packages/checkout/widgets-lib/src/components/Hero/RocketHero.tsx index a20ec5bc73..4418c724d7 100644 --- a/packages/checkout/widgets-lib/src/components/Hero/RocketHero.tsx +++ b/packages/checkout/widgets-lib/src/components/Hero/RocketHero.tsx @@ -1,7 +1,7 @@ import { Box } from '@biom3/react'; import { Fit, Layout, useRive } from '@rive-app/react-canvas-lite'; import { Environment } from '@imtbl/config'; -import { CHECKOUT_CDN_BASE_URL } from 'lib'; +import { CHECKOUT_CDN_BASE_URL } from '../../lib'; import { heroBackGroundStyles, heroImageStyles } from './HeroImageStyles'; interface RocketHeroProps { diff --git a/packages/checkout/widgets-lib/src/components/NetworkSwitchDrawer/NetworkSwitchDrawer.tsx b/packages/checkout/widgets-lib/src/components/NetworkSwitchDrawer/NetworkSwitchDrawer.tsx index 96c7c8b1a2..288c6ba216 100644 --- a/packages/checkout/widgets-lib/src/components/NetworkSwitchDrawer/NetworkSwitchDrawer.tsx +++ b/packages/checkout/widgets-lib/src/components/NetworkSwitchDrawer/NetworkSwitchDrawer.tsx @@ -7,21 +7,21 @@ import { Drawer, Heading, } from '@biom3/react'; +import { + useCallback, useMemo, useEffect, +} from 'react'; +import { useTranslation } from 'react-i18next'; import { Web3Provider } from '@ethersproject/providers'; import { ChainId, Checkout } from '@imtbl/checkout-sdk'; import { Environment } from '@imtbl/config'; -import { FooterLogo } from 'components/Footer/FooterLogo'; -import { getL1ChainId } from 'lib'; -import { getChainNameById } from 'lib/chains'; +import { FooterLogo } from '../Footer/FooterLogo'; +import { getL1ChainId } from '../../lib'; +import { getChainNameById } from '../../lib/chains'; import { isMetaMaskProvider, isWalletConnectProvider, -} from 'lib/provider'; -import { getRemoteImage } from 'lib/utils'; -import { - useCallback, useMemo, useEffect, -} from 'react'; -import { useTranslation } from 'react-i18next'; +} from '../../lib/provider'; +import { getRemoteImage } from '../../lib/utils'; export interface NetworkSwitchDrawerProps { visible: boolean; diff --git a/packages/checkout/widgets-lib/src/components/NotEnoughGas/NotEnoughGas.tsx b/packages/checkout/widgets-lib/src/components/NotEnoughGas/NotEnoughGas.tsx index c8fc5e3fec..5a537efa1a 100644 --- a/packages/checkout/widgets-lib/src/components/NotEnoughGas/NotEnoughGas.tsx +++ b/packages/checkout/widgets-lib/src/components/NotEnoughGas/NotEnoughGas.tsx @@ -3,10 +3,10 @@ import { Drawer, Box, Button, Heading, CloudImage, } from '@biom3/react'; import { useCallback, useState } from 'react'; -import { ETH_TOKEN_SYMBOL } from 'lib'; import { Environment } from '@imtbl/config'; -import { getRemoteImage } from 'lib/utils'; import { useTranslation } from 'react-i18next'; +import { ETH_TOKEN_SYMBOL } from '../../lib'; +import { getRemoteImage } from '../../lib/utils'; import { containerStyles, headingTextStyles, diff --git a/packages/checkout/widgets-lib/src/components/NotEnoughImx/NotEnoughImx.tsx b/packages/checkout/widgets-lib/src/components/NotEnoughImx/NotEnoughImx.tsx index 7ba7869d1e..2a109318bc 100644 --- a/packages/checkout/widgets-lib/src/components/NotEnoughImx/NotEnoughImx.tsx +++ b/packages/checkout/widgets-lib/src/components/NotEnoughImx/NotEnoughImx.tsx @@ -4,7 +4,7 @@ import { } from '@biom3/react'; import { useTranslation } from 'react-i18next'; import { Environment } from '@imtbl/config'; -import { getImxTokenImage } from 'lib/utils'; +import { getImxTokenImage } from '../../lib/utils'; import { containerStyles, contentTextStyles, diff --git a/packages/checkout/widgets-lib/src/components/Status/StatusView.cy.tsx b/packages/checkout/widgets-lib/src/components/Status/StatusView.cy.tsx index 11713627af..1bae7e51f8 100644 --- a/packages/checkout/widgets-lib/src/components/Status/StatusView.cy.tsx +++ b/packages/checkout/widgets-lib/src/components/Status/StatusView.cy.tsx @@ -1,6 +1,6 @@ import { describe, it } from 'local-cypress'; import { mount } from 'cypress/react18'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../context/view-context/test-components/ViewContextTestComponent'; import { cySmartGet } from '../../lib/testUtils'; import { StatusView } from './StatusView'; import { StatusType } from './StatusType'; diff --git a/packages/checkout/widgets-lib/src/components/ThemeProvider/ThemeProvider.tsx b/packages/checkout/widgets-lib/src/components/ThemeProvider/ThemeProvider.tsx index 69012aa32f..e2f078127a 100644 --- a/packages/checkout/widgets-lib/src/components/ThemeProvider/ThemeProvider.tsx +++ b/packages/checkout/widgets-lib/src/components/ThemeProvider/ThemeProvider.tsx @@ -1,8 +1,8 @@ import React, { ComponentProps } from 'react'; import { BiomeCombinedProviders, Box } from '@biom3/react'; -import { widgetTheme } from 'lib/theme'; -import { StrongCheckoutWidgetsConfig } from 'lib/withDefaultWidgetConfig'; -import { usePortalId } from 'lib/hooks/usePortalId'; +import { widgetTheme } from '../../lib/theme'; +import { StrongCheckoutWidgetsConfig } from '../../lib/withDefaultWidgetConfig'; +import { usePortalId } from '../../lib/hooks/usePortalId'; import { containerStyles } from './themeProviderStyles'; export interface ThemeProviderProps { diff --git a/packages/checkout/widgets-lib/src/components/TokenImage/TokenImage.tsx b/packages/checkout/widgets-lib/src/components/TokenImage/TokenImage.tsx index 84201a34f1..1060b976b6 100644 --- a/packages/checkout/widgets-lib/src/components/TokenImage/TokenImage.tsx +++ b/packages/checkout/widgets-lib/src/components/TokenImage/TokenImage.tsx @@ -1,7 +1,7 @@ import { useMemo, useState } from 'react'; import { Environment } from '@imtbl/config'; -import { getDefaultTokenImage } from 'lib/utils'; import { WidgetTheme } from '@imtbl/checkout-sdk'; +import { getDefaultTokenImage } from '../../lib/utils'; type ImageProps = { name?: string; diff --git a/packages/checkout/widgets-lib/src/components/Transactions/ChangeWallet.tsx b/packages/checkout/widgets-lib/src/components/Transactions/ChangeWallet.tsx index e31e7dc9c3..16c751c0af 100644 --- a/packages/checkout/widgets-lib/src/components/Transactions/ChangeWallet.tsx +++ b/packages/checkout/widgets-lib/src/components/Transactions/ChangeWallet.tsx @@ -2,15 +2,15 @@ import { Box, Button, EllipsizedText, FramedImage, Logo, } from '@biom3/react'; import { useContext, useEffect, useState } from 'react'; -import { BridgeContext } from 'widgets/bridge/context/BridgeContext'; -import { isWalletConnectProvider } from 'lib/provider'; +import { useTranslation } from 'react-i18next'; +import { BridgeContext } from '../../widgets/bridge/context/BridgeContext'; +import { isWalletConnectProvider } from '../../lib/provider'; import { UserJourney, useAnalytics, -} from 'context/analytics-provider/SegmentAnalyticsProvider'; -import { BridgeWidgetViews } from 'context/view-context/BridgeViewContextTypes'; -import { useTranslation } from 'react-i18next'; -import { useWalletConnect } from 'lib/hooks/useWalletConnect'; +} from '../../context/analytics-provider/SegmentAnalyticsProvider'; +import { BridgeWidgetViews } from '../../context/view-context/BridgeViewContextTypes'; +import { useWalletConnect } from '../../lib/hooks/useWalletConnect'; import { headingStyles, rawImageStyle, wcStickerLogoStyles, wcWalletLogoStyles, wcWalletLogoWrapperStyles, } from './ChangeWalletStyles'; diff --git a/packages/checkout/widgets-lib/src/components/Transactions/ClaimWithdrawalInProgress.tsx b/packages/checkout/widgets-lib/src/components/Transactions/ClaimWithdrawalInProgress.tsx index 88fd2735a4..3c9c663fe7 100644 --- a/packages/checkout/widgets-lib/src/components/Transactions/ClaimWithdrawalInProgress.tsx +++ b/packages/checkout/widgets-lib/src/components/Transactions/ClaimWithdrawalInProgress.tsx @@ -1,10 +1,10 @@ import { TransactionResponse } from '@ethersproject/providers'; import { useContext, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; -import { UserJourney, useAnalytics } from 'context/analytics-provider/SegmentAnalyticsProvider'; -import { ViewActions, ViewContext } from 'context/view-context/ViewContext'; -import { BridgeWidgetViews } from 'context/view-context/BridgeViewContextTypes'; -import { LoadingView } from 'views/loading/LoadingView'; +import { UserJourney, useAnalytics } from '../../context/analytics-provider/SegmentAnalyticsProvider'; +import { ViewActions, ViewContext } from '../../context/view-context/ViewContext'; +import { BridgeWidgetViews } from '../../context/view-context/BridgeViewContextTypes'; +import { LoadingView } from '../../views/loading/LoadingView'; interface ClaimWithdrawalInProgressProps { transactionResponse: TransactionResponse; diff --git a/packages/checkout/widgets-lib/src/components/Transactions/NoTransactions.tsx b/packages/checkout/widgets-lib/src/components/Transactions/NoTransactions.tsx index 7a1ef4b969..2cdd865a06 100644 --- a/packages/checkout/widgets-lib/src/components/Transactions/NoTransactions.tsx +++ b/packages/checkout/widgets-lib/src/components/Transactions/NoTransactions.tsx @@ -3,9 +3,9 @@ import { } from '@biom3/react'; import { Checkout } from '@imtbl/checkout-sdk'; import { useState, useEffect } from 'react'; -import { UserJourney, useAnalytics } from 'context/analytics-provider/SegmentAnalyticsProvider'; -import { PASSPORT_URL } from 'lib'; import { useTranslation } from 'react-i18next'; +import { UserJourney, useAnalytics } from '../../context/analytics-provider/SegmentAnalyticsProvider'; +import { PASSPORT_URL } from '../../lib'; import { noTransactionsBodyStyle, noTransactionsContainerStyle, passportBodyStyle, containerStyles, } from './noTransactionStyles'; diff --git a/packages/checkout/widgets-lib/src/components/Transactions/NotEnoughEthToWithdraw.tsx b/packages/checkout/widgets-lib/src/components/Transactions/NotEnoughEthToWithdraw.tsx index a4937a910e..5eadc3f5d1 100644 --- a/packages/checkout/widgets-lib/src/components/Transactions/NotEnoughEthToWithdraw.tsx +++ b/packages/checkout/widgets-lib/src/components/Transactions/NotEnoughEthToWithdraw.tsx @@ -2,11 +2,11 @@ import { Body, Box, Button, CloudImage, Drawer, Heading, } from '@biom3/react'; -import { ETH_TOKEN_SYMBOL } from 'lib'; import { useTranslation } from 'react-i18next'; import { useContext } from 'react'; -import { BridgeContext } from 'widgets/bridge/context/BridgeContext'; -import { getEthTokenImage } from 'lib/utils'; +import { ETH_TOKEN_SYMBOL } from '../../lib'; +import { getEthTokenImage } from '../../lib/utils'; +import { BridgeContext } from '../../widgets/bridge/context/BridgeContext'; import { actionButtonContainerStyles, actionButtonStyles, containerStyles, contentTextStyles, } from './NotEnoughEthToWithdrawStyles'; diff --git a/packages/checkout/widgets-lib/src/components/Transactions/SupportMessage.tsx b/packages/checkout/widgets-lib/src/components/Transactions/SupportMessage.tsx index f0753f1042..1b485e6381 100644 --- a/packages/checkout/widgets-lib/src/components/Transactions/SupportMessage.tsx +++ b/packages/checkout/widgets-lib/src/components/Transactions/SupportMessage.tsx @@ -1,8 +1,8 @@ import { Body, Box, Link } from '@biom3/react'; import { Checkout } from '@imtbl/checkout-sdk'; -import { PASSPORT_URL } from 'lib'; import { useState, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; +import { PASSPORT_URL } from '../../lib'; import { supportMessageBoxStyle, bodyStyle } from './SupportMessageStyles'; type SupportMessageProps = { diff --git a/packages/checkout/widgets-lib/src/components/Transactions/TransactionDetails.tsx b/packages/checkout/widgets-lib/src/components/Transactions/TransactionDetails.tsx index 898e87378c..6a24e90645 100644 --- a/packages/checkout/widgets-lib/src/components/Transactions/TransactionDetails.tsx +++ b/packages/checkout/widgets-lib/src/components/Transactions/TransactionDetails.tsx @@ -2,10 +2,10 @@ import { Box, Icon, Body, EllipsizedText, FramedImage, } from '@biom3/react'; import { ChainSlug } from '@imtbl/checkout-sdk'; -import { networkName } from 'lib'; -import { getChainIdBySlug } from 'lib/chains'; -import { Transaction } from 'lib/clients'; import { Environment } from '@imtbl/config'; +import { networkName } from '../../lib'; +import { getChainIdBySlug } from '../../lib/chains'; +import { Transaction } from '../../lib/clients'; import { getChainImage } from '../../lib/utils'; export interface TransactionDetailsProps { diff --git a/packages/checkout/widgets-lib/src/components/Transactions/TransactionItem.tsx b/packages/checkout/widgets-lib/src/components/Transactions/TransactionItem.tsx index 2bb4ecb336..be70a39b0c 100644 --- a/packages/checkout/widgets-lib/src/components/Transactions/TransactionItem.tsx +++ b/packages/checkout/widgets-lib/src/components/Transactions/TransactionItem.tsx @@ -5,11 +5,11 @@ import { MenuItem, Link, } from '@biom3/react'; -import { UserJourney, useAnalytics } from 'context/analytics-provider/SegmentAnalyticsProvider'; -import { Transaction } from 'lib/clients/checkoutApiType'; import { MouseEvent, useMemo } from 'react'; -import { TokenImage } from 'components/TokenImage/TokenImage'; import { Environment } from '@imtbl/config'; +import { UserJourney, useAnalytics } from '../../context/analytics-provider/SegmentAnalyticsProvider'; +import { Transaction } from '../../lib/clients/checkoutApiType'; +import { TokenImage } from '../TokenImage/TokenImage'; import { containerStyles } from './transactionItemStyles'; import { TransactionDetails } from './TransactionDetails'; diff --git a/packages/checkout/widgets-lib/src/components/Transactions/TransactionItemWithdrawPending.tsx b/packages/checkout/widgets-lib/src/components/Transactions/TransactionItemWithdrawPending.tsx index 93eac2910b..7139d9d6fb 100644 --- a/packages/checkout/widgets-lib/src/components/Transactions/TransactionItemWithdrawPending.tsx +++ b/packages/checkout/widgets-lib/src/components/Transactions/TransactionItemWithdrawPending.tsx @@ -7,14 +7,14 @@ import { Icon, MenuItem, } from '@biom3/react'; -import { UserJourney, useAnalytics } from 'context/analytics-provider/SegmentAnalyticsProvider'; -import { Transaction, TransactionStatus } from 'lib/clients/checkoutApiType'; import { useContext, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; -import { BridgeWidgetViews } from 'context/view-context/BridgeViewContextTypes'; -import { ViewActions, ViewContext } from 'context/view-context/ViewContext'; -import { TokenImage } from 'components/TokenImage/TokenImage'; import { Environment } from '@imtbl/config'; +import { UserJourney, useAnalytics } from '../../context/analytics-provider/SegmentAnalyticsProvider'; +import { Transaction, TransactionStatus } from '../../lib/clients/checkoutApiType'; +import { BridgeWidgetViews } from '../../context/view-context/BridgeViewContextTypes'; +import { ViewActions, ViewContext } from '../../context/view-context/ViewContext'; +import { TokenImage } from '../TokenImage/TokenImage'; import { actionsContainerStyles, actionsLayoutStyles, containerStyles } from './transactionItemStyles'; import { TransactionDetails } from './TransactionDetails'; diff --git a/packages/checkout/widgets-lib/src/components/Transactions/TransactionList.tsx b/packages/checkout/widgets-lib/src/components/Transactions/TransactionList.tsx index 628d0d1abf..8e80afdbdc 100644 --- a/packages/checkout/widgets-lib/src/components/Transactions/TransactionList.tsx +++ b/packages/checkout/widgets-lib/src/components/Transactions/TransactionList.tsx @@ -8,12 +8,12 @@ import { useEffect, useState, } from 'react'; -import { AXELAR_SCAN_URL } from 'lib'; -import { Transaction, TransactionStatus } from 'lib/clients'; -import { CryptoFiatContext } from 'context/crypto-fiat-context/CryptoFiatContext'; -import { calculateCryptoToFiat, getTokenImageByAddress, isNativeToken } from 'lib/utils'; import { formatUnits } from 'ethers/lib/utils'; import { useTranslation } from 'react-i18next'; +import { AXELAR_SCAN_URL } from '../../lib'; +import { Transaction, TransactionStatus } from '../../lib/clients'; +import { CryptoFiatContext } from '../../context/crypto-fiat-context/CryptoFiatContext'; +import { calculateCryptoToFiat, getTokenImageByAddress, isNativeToken } from '../../lib/utils'; import { TransactionItem } from './TransactionItem'; import { KnownNetworkMap } from './transactionsType'; import { containerStyles, transactionsListStyle } from './TransactionListStyles'; diff --git a/packages/checkout/widgets-lib/src/components/Transactions/Transactions.tsx b/packages/checkout/widgets-lib/src/components/Transactions/Transactions.tsx index 3a900ca179..72e6e2b0a5 100644 --- a/packages/checkout/widgets-lib/src/components/Transactions/Transactions.tsx +++ b/packages/checkout/widgets-lib/src/components/Transactions/Transactions.tsx @@ -1,43 +1,43 @@ -import { HeaderNavigation } from 'components/Header/HeaderNavigation'; -import { SimpleLayout } from 'components/SimpleLayout/SimpleLayout'; -import { FooterLogo } from 'components/Footer/FooterLogo'; import { useCallback, useContext, useEffect, useMemo, useState, } from 'react'; -import { EventTargetContext } from 'context/event-target-context/EventTargetContext'; import { Box } from '@biom3/react'; -import { - connectToProvider, - isPassportProvider, -} from 'lib/provider'; import { JsonRpcProvider, Web3Provider } from '@ethersproject/providers'; import { TokenFilterTypes, TokenInfo, WalletProviderRdns, } from '@imtbl/checkout-sdk'; +import { Environment } from '@imtbl/config'; +import { useTranslation } from 'react-i18next'; +import { HeaderNavigation } from '../Header/HeaderNavigation'; +import { SimpleLayout } from '../SimpleLayout/SimpleLayout'; +import { FooterLogo } from '../Footer/FooterLogo'; +import { EventTargetContext } from '../../context/event-target-context/EventTargetContext'; +import { + connectToProvider, + isPassportProvider, +} from '../../lib/provider'; import { DEFAULT_TRANSACTIONS_RETRY_POLICY, getL1ChainId, getL2ChainId, -} from 'lib'; -import { CheckoutApi, Transaction, TransactionType } from 'lib/clients'; -import { Environment } from '@imtbl/config'; -import { retry } from 'lib/retry'; -import { getChainSlugById } from 'lib/chains'; +} from '../../lib'; +import { CheckoutApi, Transaction, TransactionType } from '../../lib/clients'; +import { retry } from '../../lib/retry'; +import { getChainSlugById } from '../../lib/chains'; import { CryptoFiatActions, CryptoFiatContext, -} from 'context/crypto-fiat-context/CryptoFiatContext'; +} from '../../context/crypto-fiat-context/CryptoFiatContext'; import { UserJourney, useAnalytics, -} from 'context/analytics-provider/SegmentAnalyticsProvider'; -import { useTranslation } from 'react-i18next'; +} from '../../context/analytics-provider/SegmentAnalyticsProvider'; import { BridgeActions, BridgeContext, -} from 'widgets/bridge/context/BridgeContext'; -import { WalletDrawer } from 'components/WalletDrawer/WalletDrawer'; +} from '../../widgets/bridge/context/BridgeContext'; +import { WalletDrawer } from '../WalletDrawer/WalletDrawer'; import { sendBridgeWidgetCloseEvent } from '../../widgets/bridge/BridgeWidgetEvents'; import { Shimmer } from './Shimmer'; import { diff --git a/packages/checkout/widgets-lib/src/components/Transak/useTransakIframe.ts b/packages/checkout/widgets-lib/src/components/Transak/useTransakIframe.ts index 75eb573ba3..faa77ea9a1 100644 --- a/packages/checkout/widgets-lib/src/components/Transak/useTransakIframe.ts +++ b/packages/checkout/widgets-lib/src/components/Transak/useTransakIframe.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useState } from 'react'; import { Environment } from '@imtbl/config'; -import { sanitizeToLatin1 } from 'widgets/sale/functions/utils'; +import { sanitizeToLatin1 } from '../../widgets/sale/functions/utils'; import { TransakNFTData } from './TransakTypes'; export type TransakWidgetType = 'on-ramp' | 'nft-checkout'; diff --git a/packages/checkout/widgets-lib/src/components/UnableToConnectDrawer/UnableToConnectDrawer.tsx b/packages/checkout/widgets-lib/src/components/UnableToConnectDrawer/UnableToConnectDrawer.tsx index 5bae7a3784..82302a1b70 100644 --- a/packages/checkout/widgets-lib/src/components/UnableToConnectDrawer/UnableToConnectDrawer.tsx +++ b/packages/checkout/widgets-lib/src/components/UnableToConnectDrawer/UnableToConnectDrawer.tsx @@ -9,8 +9,8 @@ import { } from '@biom3/react'; import { Checkout } from '@imtbl/checkout-sdk'; import { Environment } from '@imtbl/config'; -import { getRemoteImage } from 'lib/utils'; import { useTranslation } from 'react-i18next'; +import { getRemoteImage } from '../../lib/utils'; export interface UnableToConnectDrawerProps { visible: boolean; diff --git a/packages/checkout/widgets-lib/src/components/WalletDrawer/WalletDrawer.tsx b/packages/checkout/widgets-lib/src/components/WalletDrawer/WalletDrawer.tsx index 23f27c5a73..b749618a84 100644 --- a/packages/checkout/widgets-lib/src/components/WalletDrawer/WalletDrawer.tsx +++ b/packages/checkout/widgets-lib/src/components/WalletDrawer/WalletDrawer.tsx @@ -1,8 +1,8 @@ import { Drawer, Select } from '@biom3/react'; -import { FormControlWrapper } from 'components/FormComponents/FormControlWrapper/FormControlWrapper'; import { useState } from 'react'; import { motion } from 'framer-motion'; import { EIP1193Provider, EIP6963ProviderDetail } from '@imtbl/checkout-sdk'; +import { FormControlWrapper } from '../FormComponents/FormControlWrapper/FormControlWrapper'; import { WalletItem } from './WalletItem'; import { walletItemListStyles } from './WalletDrawerStyles'; import { WalletConnectItem } from './WalletConnectItem'; diff --git a/packages/checkout/widgets-lib/src/context/connect-loader-context/test-components/ConnectLoaderTestComponent.tsx b/packages/checkout/widgets-lib/src/context/connect-loader-context/test-components/ConnectLoaderTestComponent.tsx index 11a699ca4b..80e3a60b57 100644 --- a/packages/checkout/widgets-lib/src/context/connect-loader-context/test-components/ConnectLoaderTestComponent.tsx +++ b/packages/checkout/widgets-lib/src/context/connect-loader-context/test-components/ConnectLoaderTestComponent.tsx @@ -1,5 +1,5 @@ import React, { useMemo, useReducer } from 'react'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../view-context/test-components/ViewContextTestComponent'; import { ConnectLoaderState, initialConnectLoaderState, diff --git a/packages/checkout/widgets-lib/src/context/event-target-context/test-components/EventTargetTestComponent.tsx b/packages/checkout/widgets-lib/src/context/event-target-context/test-components/EventTargetTestComponent.tsx index 77d740bf6b..1957066838 100644 --- a/packages/checkout/widgets-lib/src/context/event-target-context/test-components/EventTargetTestComponent.tsx +++ b/packages/checkout/widgets-lib/src/context/event-target-context/test-components/EventTargetTestComponent.tsx @@ -1,5 +1,5 @@ import React, { useMemo, useReducer } from 'react'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../view-context/test-components/ViewContextTestComponent'; import { EventTargetState, initialEventTargetState, diff --git a/packages/checkout/widgets-lib/src/context/view-context/BridgeViewContextTypes.ts b/packages/checkout/widgets-lib/src/context/view-context/BridgeViewContextTypes.ts index a744ee9f06..0a45e18724 100644 --- a/packages/checkout/widgets-lib/src/context/view-context/BridgeViewContextTypes.ts +++ b/packages/checkout/widgets-lib/src/context/view-context/BridgeViewContextTypes.ts @@ -1,6 +1,6 @@ import { ApproveBridgeResponse, BridgeTxResponse } from '@imtbl/bridge-sdk'; import { TransactionResponse } from '@ethersproject/providers'; -import { Transaction } from 'lib/clients'; +import { Transaction } from '../../lib/clients'; import { ViewType } from './ViewType'; export enum BridgeWidgetViews { diff --git a/packages/checkout/widgets-lib/src/context/view-context/test-components/ViewContextTestComponent.tsx b/packages/checkout/widgets-lib/src/context/view-context/test-components/ViewContextTestComponent.tsx index 8b148565d0..cc9156228f 100644 --- a/packages/checkout/widgets-lib/src/context/view-context/test-components/ViewContextTestComponent.tsx +++ b/packages/checkout/widgets-lib/src/context/view-context/test-components/ViewContextTestComponent.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { ThemeProvider } from 'components/ThemeProvider/ThemeProvider'; -import { withDefaultWidgetConfigs } from 'lib/withDefaultWidgetConfig'; import { Checkout, WidgetTheme } from '@imtbl/checkout-sdk'; -import { CustomAnalyticsProvider } from 'context/analytics-provider/CustomAnalyticsProvider'; import { I18nextProvider } from 'react-i18next'; +import { ThemeProvider } from '../../../components/ThemeProvider/ThemeProvider'; +import { withDefaultWidgetConfigs } from '../../../lib/withDefaultWidgetConfig'; +import { CustomAnalyticsProvider } from '../../analytics-provider/CustomAnalyticsProvider'; import i18n from '../../../i18n'; export interface TestProps { diff --git a/packages/checkout/widgets-lib/src/factory.ts b/packages/checkout/widgets-lib/src/factory.ts index b7d1d084e3..dae6f65ea7 100644 --- a/packages/checkout/widgets-lib/src/factory.ts +++ b/packages/checkout/widgets-lib/src/factory.ts @@ -7,14 +7,14 @@ import { WidgetProperties, WidgetConfigurations, } from '@imtbl/checkout-sdk'; -import { Connect } from 'widgets/connect/ConnectWidgetRoot'; -import { Swap } from 'widgets/swap/SwapWidgetRoot'; -import { OnRamp } from 'widgets/on-ramp/OnRampWidgetRoot'; -import { Wallet } from 'widgets/wallet/WalletWidgetRoot'; -import { Sale } from 'widgets/sale/SaleWidgetRoot'; import { Web3Provider } from '@ethersproject/providers'; -import { Bridge } from 'widgets/bridge/BridgeWidgetRoot'; -import { WalletConnectManager } from 'lib/walletConnect'; +import { Connect } from './widgets/connect/ConnectWidgetRoot'; +import { Swap } from './widgets/swap/SwapWidgetRoot'; +import { OnRamp } from './widgets/on-ramp/OnRampWidgetRoot'; +import { Wallet } from './widgets/wallet/WalletWidgetRoot'; +import { Sale } from './widgets/sale/SaleWidgetRoot'; +import { Bridge } from './widgets/bridge/BridgeWidgetRoot'; +import { WalletConnectManager } from './lib/walletConnect'; import { sendProviderUpdatedEvent, addProviderListenersForWidgetRoot, diff --git a/packages/checkout/widgets-lib/src/lib/clients/checkoutApi.ts b/packages/checkout/widgets-lib/src/lib/clients/checkoutApi.ts index f862031d4d..8ea17b5bbc 100644 --- a/packages/checkout/widgets-lib/src/lib/clients/checkoutApi.ts +++ b/packages/checkout/widgets-lib/src/lib/clients/checkoutApi.ts @@ -1,7 +1,7 @@ import axios, { AxiosError, HttpStatusCode } from 'axios'; import { Environment } from '@imtbl/config'; -import { ENV_DEVELOPMENT } from 'lib/constants'; import { IMMUTABLE_API_BASE_URL } from '@imtbl/checkout-sdk'; +import { ENV_DEVELOPMENT } from '../constants'; import { TransactionType, Transactions } from './checkoutApiType'; type CacheData = { diff --git a/packages/checkout/widgets-lib/src/views/loading/LoadingView.cy.tsx b/packages/checkout/widgets-lib/src/views/loading/LoadingView.cy.tsx index 87cd503ad3..35bc62f7c6 100644 --- a/packages/checkout/widgets-lib/src/views/loading/LoadingView.cy.tsx +++ b/packages/checkout/widgets-lib/src/views/loading/LoadingView.cy.tsx @@ -1,5 +1,5 @@ import { mount } from 'cypress/react18'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../context/view-context/test-components/ViewContextTestComponent'; import { LoadingView } from './LoadingView'; import { cySmartGet } from '../../lib/testUtils'; diff --git a/packages/checkout/widgets-lib/src/views/top-up/TopUpView.cy.tsx b/packages/checkout/widgets-lib/src/views/top-up/TopUpView.cy.tsx index bae2221d25..cc9bab5541 100644 --- a/packages/checkout/widgets-lib/src/views/top-up/TopUpView.cy.tsx +++ b/packages/checkout/widgets-lib/src/views/top-up/TopUpView.cy.tsx @@ -8,9 +8,9 @@ import { import { Environment } from '@imtbl/config'; import { BigNumber } from 'ethers'; import { Web3Provider } from '@ethersproject/providers'; -import { UserJourney } from 'context/analytics-provider/SegmentAnalyticsProvider'; -import { CustomAnalyticsProvider } from 'context/analytics-provider/CustomAnalyticsProvider'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { UserJourney } from '../../context/analytics-provider/SegmentAnalyticsProvider'; +import { CustomAnalyticsProvider } from '../../context/analytics-provider/CustomAnalyticsProvider'; +import { ViewContextTestComponent } from '../../context/view-context/test-components/ViewContextTestComponent'; import { TopUpView } from './TopUpView'; import { cyIntercept, cySmartGet } from '../../lib/testUtils'; import { orchestrationEvents } from '../../lib/orchestrationEvents'; diff --git a/packages/checkout/widgets-lib/src/views/top-up/TopUpView.tsx b/packages/checkout/widgets-lib/src/views/top-up/TopUpView.tsx index 9f26ce248a..bd52465eb2 100644 --- a/packages/checkout/widgets-lib/src/views/top-up/TopUpView.tsx +++ b/packages/checkout/widgets-lib/src/views/top-up/TopUpView.tsx @@ -2,10 +2,6 @@ import { Body, Box, Heading } from '@biom3/react'; import { ReactNode, useContext, useEffect, useState, } from 'react'; -import { - UserJourney, - useAnalytics, -} from 'context/analytics-provider/SegmentAnalyticsProvider'; import { StandardAnalyticsControlTypes } from '@imtbl/react-analytics'; import { Checkout, @@ -14,11 +10,15 @@ import { IMTBLWidgetEvents, } from '@imtbl/checkout-sdk'; import { Environment } from '@imtbl/config'; -import { DEFAULT_TOKEN_SYMBOLS } from 'context/crypto-fiat-context/CryptoFiatProvider'; -import { BridgeWidgetViews } from 'context/view-context/BridgeViewContextTypes'; import { Web3Provider } from '@ethersproject/providers'; import { useTranslation } from 'react-i18next'; import { $Dictionary } from 'i18next/typescript/helpers'; +import { + UserJourney, + useAnalytics, +} from '../../context/analytics-provider/SegmentAnalyticsProvider'; +import { DEFAULT_TOKEN_SYMBOLS } from '../../context/crypto-fiat-context/CryptoFiatProvider'; +import { BridgeWidgetViews } from '../../context/view-context/BridgeViewContextTypes'; import { HeaderNavigation } from '../../components/Header/HeaderNavigation'; import { SimpleLayout } from '../../components/SimpleLayout/SimpleLayout'; import { diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidget.cy.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidget.cy.tsx index c43e997655..a212a8245f 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidget.cy.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidget.cy.tsx @@ -1,16 +1,16 @@ import { mount } from 'cypress/react18'; import { beforeEach, cy } from 'local-cypress'; -import { cyIntercept, cySmartGet } from 'lib/testUtils'; import { ChainId, Checkout, SwitchNetworkResult, WalletProviderName, WidgetTheme, } from '@imtbl/checkout-sdk'; import { Environment } from '@imtbl/config'; -import { StrongCheckoutWidgetsConfig } from 'lib/withDefaultWidgetConfig'; import { Passport } from '@imtbl/passport'; -import { BigNumber } from 'ethers'; import { TokenBridge } from '@imtbl/bridge-sdk'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; -import { Transaction } from 'lib/clients'; +import { BigNumber } from 'ethers'; +import { cyIntercept, cySmartGet } from '../../lib/testUtils'; +import { StrongCheckoutWidgetsConfig } from '../../lib/withDefaultWidgetConfig'; +import { ViewContextTestComponent } from '../../context/view-context/test-components/ViewContextTestComponent'; +import { Transaction } from '../../lib/clients'; import BridgeWidget from './BridgeWidget'; import mockTransactionPending from './test-components/BridgeTransactionWithdrawalPending.json'; import mockTransactionInProgress from './test-components/BridgeTransactionInProgress.json'; diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidget.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidget.tsx index 8b3656a906..1af8b1b8ff 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidget.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidget.tsx @@ -10,13 +10,6 @@ import { useMemo, useReducer, } from 'react'; -import { StrongCheckoutWidgetsConfig } from 'lib/withDefaultWidgetConfig'; -import { CryptoFiatProvider } from 'context/crypto-fiat-context/CryptoFiatProvider'; -import { JsonRpcProvider, Web3Provider } from '@ethersproject/providers'; -import { BridgeClaimWithdrawalFailure, BridgeWidgetViews } from 'context/view-context/BridgeViewContextTypes'; -import { StatusView } from 'components/Status/StatusView'; -import { StatusType } from 'components/Status/StatusType'; -import { ImmutableConfiguration } from '@imtbl/config'; import { BridgeConfiguration, ETH_MAINNET_TO_ZKEVM_MAINNET, @@ -24,13 +17,19 @@ import { ETH_SEPOLIA_TO_ZKEVM_TESTNET, TokenBridge, } from '@imtbl/bridge-sdk'; -import { getL1ChainId, getL2ChainId } from 'lib'; -import { Transactions } from 'components/Transactions/Transactions'; -import { UserJourney, useAnalytics } from 'context/analytics-provider/SegmentAnalyticsProvider'; -import { TopUpView } from 'views/top-up/TopUpView'; import { useTranslation } from 'react-i18next'; -import { ClaimWithdrawalInProgress } from 'components/Transactions/ClaimWithdrawalInProgress'; -import { getDefaultTokenImage } from 'lib/utils'; +import { JsonRpcProvider, Web3Provider } from '@ethersproject/providers'; +import { ImmutableConfiguration } from '@imtbl/config'; +import { StrongCheckoutWidgetsConfig } from '../../lib/withDefaultWidgetConfig'; +import { CryptoFiatProvider } from '../../context/crypto-fiat-context/CryptoFiatProvider'; +import { StatusView } from '../../components/Status/StatusView'; +import { StatusType } from '../../components/Status/StatusType'; +import { getL1ChainId, getL2ChainId } from '../../lib'; +import { Transactions } from '../../components/Transactions/Transactions'; +import { UserJourney, useAnalytics } from '../../context/analytics-provider/SegmentAnalyticsProvider'; +import { TopUpView } from '../../views/top-up/TopUpView'; +import { ClaimWithdrawalInProgress } from '../../components/Transactions/ClaimWithdrawalInProgress'; +import { getDefaultTokenImage } from '../../lib/utils'; import { ViewActions, ViewContext, @@ -59,6 +58,8 @@ import { } from './BridgeWidgetEvents'; import { BridgeClaimWithdrawalSuccess, + BridgeClaimWithdrawalFailure, + BridgeWidgetViews, } from '../../context/view-context/BridgeViewContextTypes'; import { ClaimWithdrawal } from './views/ClaimWithdrawal'; diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidgetRoot.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidgetRoot.tsx index 460cb36108..6fe8d1a389 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidgetRoot.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/BridgeWidgetRoot.tsx @@ -7,12 +7,12 @@ import { WidgetTheme, WidgetType, } from '@imtbl/checkout-sdk'; -import { Base } from 'widgets/BaseWidgetRoot'; -import { isValidWalletProvider, isValidAmount, isValidAddress } from 'lib/validations/widgetValidators'; -import { ThemeProvider } from 'components/ThemeProvider/ThemeProvider'; -import { CustomAnalyticsProvider } from 'context/analytics-provider/CustomAnalyticsProvider'; -import { LoadingView } from 'views/loading/LoadingView'; -import { HandoverProvider } from 'context/handover-context/HandoverProvider'; +import { Base } from '../BaseWidgetRoot'; +import { isValidWalletProvider, isValidAmount, isValidAddress } from '../../lib/validations/widgetValidators'; +import { ThemeProvider } from '../../components/ThemeProvider/ThemeProvider'; +import { CustomAnalyticsProvider } from '../../context/analytics-provider/CustomAnalyticsProvider'; +import { LoadingView } from '../../views/loading/LoadingView'; +import { HandoverProvider } from '../../context/handover-context/HandoverProvider'; import i18n from '../../i18n'; const BridgeWidget = React.lazy(() => import('./BridgeWidget')); diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/components/BridgeForm.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/components/BridgeForm.tsx index 5610d3fcc5..21c59e5406 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/components/BridgeForm.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/components/BridgeForm.tsx @@ -10,9 +10,9 @@ import { import { useCallback, useContext, useEffect, useMemo, useRef, useState, } from 'react'; -import { UserJourney, useAnalytics } from 'context/analytics-provider/SegmentAnalyticsProvider'; import { useTranslation } from 'react-i18next'; import { Environment } from '@imtbl/config'; +import { UserJourney, useAnalytics } from '../../../context/analytics-provider/SegmentAnalyticsProvider'; import { amountInputValidation } from '../../../lib/validations/amountInputValidations'; import { BridgeActions, BridgeContext } from '../context/BridgeContext'; import { diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/components/BridgeReviewSummary.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/components/BridgeReviewSummary.tsx index e17484a1d0..1f67a32851 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/components/BridgeReviewSummary.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/components/BridgeReviewSummary.tsx @@ -1,7 +1,6 @@ import { useCallback, useContext, useMemo, useState, useEffect, } from 'react'; -import { BridgeWidgetViews } from 'context/view-context/BridgeViewContextTypes'; import { Body, Box, Button, Heading, Icon, Logo, MenuItem, } from '@biom3/react'; @@ -9,14 +8,19 @@ import { GasEstimateBridgeToL2Result, GasEstimateType, } from '@imtbl/checkout-sdk'; -import { abbreviateAddress } from 'lib/addressUtils'; -import { CryptoFiatContext } from 'context/crypto-fiat-context/CryptoFiatContext'; +import { ApproveBridgeResponse, BridgeTxResponse } from '@imtbl/bridge-sdk'; +import { BigNumber, utils } from 'ethers'; +import { useTranslation } from 'react-i18next'; +import { Web3Provider } from '@ethersproject/providers'; +import { BridgeWidgetViews } from '../../../context/view-context/BridgeViewContextTypes'; +import { abbreviateAddress } from '../../../lib/addressUtils'; +import { CryptoFiatContext } from '../../../context/crypto-fiat-context/CryptoFiatContext'; import { isMetaMaskProvider, isPassportProvider, isWalletConnectProvider, -} from 'lib/provider'; -import { calculateCryptoToFiat, getChainImage, isNativeToken } from 'lib/utils'; +} from '../../../lib/provider'; +import { calculateCryptoToFiat, getChainImage, isNativeToken } from '../../../lib/utils'; import { DEFAULT_QUOTE_REFRESH_INTERVAL, DEFAULT_TOKEN_DECIMALS, @@ -28,19 +32,15 @@ import { getL2ChainId, networkName, removeChainChangedListener, -} from 'lib'; -import { useInterval } from 'lib/hooks/useInterval'; -import { ApproveBridgeResponse, BridgeTxResponse } from '@imtbl/bridge-sdk'; -import { BigNumber, utils } from 'ethers'; +} from '../../../lib'; +import { useInterval } from '../../../lib/hooks/useInterval'; import { UserJourney, useAnalytics, -} from 'context/analytics-provider/SegmentAnalyticsProvider'; -import { useTranslation } from 'react-i18next'; -import { NetworkSwitchDrawer } from 'components/NetworkSwitchDrawer/NetworkSwitchDrawer'; -import { Web3Provider } from '@ethersproject/providers'; -import { useWalletConnect } from 'lib/hooks/useWalletConnect'; -import { NotEnoughGas } from 'components/NotEnoughGas/NotEnoughGas'; +} from '../../../context/analytics-provider/SegmentAnalyticsProvider'; +import { NetworkSwitchDrawer } from '../../../components/NetworkSwitchDrawer/NetworkSwitchDrawer'; +import { useWalletConnect } from '../../../lib/hooks/useWalletConnect'; +import { NotEnoughGas } from '../../../components/NotEnoughGas/NotEnoughGas'; import { arrowIconStyles, arrowIconWrapperStyles, diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/components/WalletAndNetworkSelector.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/components/WalletAndNetworkSelector.tsx index 100c18d186..ca08829a1b 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/components/WalletAndNetworkSelector.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/components/WalletAndNetworkSelector.tsx @@ -4,7 +4,6 @@ import { Drawer, Heading, } from '@biom3/react'; -import { BridgeWidgetViews } from 'context/view-context/BridgeViewContextTypes'; import { useCallback, useContext, @@ -14,22 +13,23 @@ import { } from 'react'; import { ChainId, WalletProviderName, WalletProviderRdns } from '@imtbl/checkout-sdk'; import { Web3Provider } from '@ethersproject/providers'; +import { useTranslation } from 'react-i18next'; +import { BridgeWidgetViews } from '../../../context/view-context/BridgeViewContextTypes'; import { connectToProvider, getWalletProviderNameByProvider, isMetaMaskProvider, isPassportProvider, isWalletConnectProvider, -} from 'lib/provider'; -import { getL1ChainId, getL2ChainId } from 'lib'; -import { getChainNameById } from 'lib/chains'; -import { ViewActions, ViewContext } from 'context/view-context/ViewContext'; -import { abbreviateAddress } from 'lib/addressUtils'; +} from '../../../lib/provider'; +import { getL1ChainId, getL2ChainId } from '../../../lib'; +import { getChainNameById } from '../../../lib/chains'; +import { ViewActions, ViewContext } from '../../../context/view-context/ViewContext'; +import { abbreviateAddress } from '../../../lib/addressUtils'; import { useAnalytics, UserJourney, -} from 'context/analytics-provider/SegmentAnalyticsProvider'; -import { useTranslation } from 'react-i18next'; +} from '../../../context/analytics-provider/SegmentAnalyticsProvider'; import { bridgeHeadingStyles, brigdeWalletWrapperStyles, diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/components/WalletNetworkButton.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/components/WalletNetworkButton.tsx index 606184c5d5..e0aab31f99 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/components/WalletNetworkButton.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/components/WalletNetworkButton.tsx @@ -2,11 +2,11 @@ import { Body, Box, Button, FramedImage, Heading, Logo, } from '@biom3/react'; import { ChainId, EIP6963ProviderDetail, WalletProviderRdns } from '@imtbl/checkout-sdk'; -import { getChainNameById } from 'lib/chains'; -import { Web3Provider } from '@ethersproject/providers'; import { useEffect, useMemo, useState } from 'react'; -import { useWalletConnect } from 'lib/hooks/useWalletConnect'; import { Environment } from '@imtbl/config'; +import { Web3Provider } from '@ethersproject/providers'; +import { getChainNameById } from '../../../lib/chains'; +import { useWalletConnect } from '../../../lib/hooks/useWalletConnect'; import { networkButtonStyles, walletButtonOuterStyles, diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/test-components/BridgeWidgetTestComponent.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/test-components/BridgeWidgetTestComponent.tsx index de631b6d5c..5f0903123b 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/test-components/BridgeWidgetTestComponent.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/test-components/BridgeWidgetTestComponent.tsx @@ -1,6 +1,6 @@ import React, { useCallback, useMemo, useReducer } from 'react'; import { Checkout } from '@imtbl/checkout-sdk'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../../context/view-context/test-components/ViewContextTestComponent'; import { initialBridgeState, BridgeContext, diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/views/ApproveTransaction.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/views/ApproveTransaction.tsx index f04370599d..d8264d5f53 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/views/ApproveTransaction.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/views/ApproveTransaction.tsx @@ -7,9 +7,9 @@ import { } from 'react'; import { CheckoutErrorType } from '@imtbl/checkout-sdk'; import { ApproveBridgeResponse, BridgeTxResponse } from '@imtbl/bridge-sdk'; -import { UserJourney, useAnalytics } from 'context/analytics-provider/SegmentAnalyticsProvider'; import { useTranslation } from 'react-i18next'; import { utils } from 'ethers'; +import { UserJourney, useAnalytics } from '../../../context/analytics-provider/SegmentAnalyticsProvider'; import { SimpleLayout } from '../../../components/SimpleLayout/SimpleLayout'; import { HeaderNavigation } from '../../../components/Header/HeaderNavigation'; import { sendBridgeWidgetCloseEvent } from '../BridgeWidgetEvents'; diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/views/Bridge.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/views/Bridge.tsx index de6f7f3e07..48f4b4a9b6 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/views/Bridge.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/views/Bridge.tsx @@ -5,8 +5,8 @@ import { useState, } from 'react'; import { TokenFilterTypes, WidgetTheme } from '@imtbl/checkout-sdk'; -import { UserJourney, useAnalytics } from 'context/analytics-provider/SegmentAnalyticsProvider'; import { useTranslation } from 'react-i18next'; +import { UserJourney, useAnalytics } from '../../../context/analytics-provider/SegmentAnalyticsProvider'; import { sendBridgeWidgetCloseEvent } from '../BridgeWidgetEvents'; import { SimpleLayout } from '../../../components/SimpleLayout/SimpleLayout'; import { HeaderNavigation } from '../../../components/Header/HeaderNavigation'; diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/views/BridgeReview.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/views/BridgeReview.tsx index c5d61f569d..9bfb96b605 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/views/BridgeReview.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/views/BridgeReview.tsx @@ -1,10 +1,10 @@ -import { HeaderNavigation } from 'components/Header/HeaderNavigation'; -import { SimpleLayout } from 'components/SimpleLayout/SimpleLayout'; -import { FooterLogo } from 'components/Footer/FooterLogo'; import { useContext, useEffect } from 'react'; -import { EventTargetContext } from 'context/event-target-context/EventTargetContext'; -import { UserJourney, useAnalytics } from 'context/analytics-provider/SegmentAnalyticsProvider'; import { useTranslation } from 'react-i18next'; +import { HeaderNavigation } from '../../../components/Header/HeaderNavigation'; +import { SimpleLayout } from '../../../components/SimpleLayout/SimpleLayout'; +import { FooterLogo } from '../../../components/Footer/FooterLogo'; +import { EventTargetContext } from '../../../context/event-target-context/EventTargetContext'; +import { UserJourney, useAnalytics } from '../../../context/analytics-provider/SegmentAnalyticsProvider'; import { sendBridgeWidgetCloseEvent } from '../BridgeWidgetEvents'; import { BridgeReviewSummary } from '../components/BridgeReviewSummary'; diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/views/ClaimWithdrawal.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/views/ClaimWithdrawal.tsx index b4e6c07ab2..1672aa3630 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/views/ClaimWithdrawal.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/views/ClaimWithdrawal.tsx @@ -5,19 +5,19 @@ import { useEffect, useState, } from 'react'; -import { UserJourney, useAnalytics } from 'context/analytics-provider/SegmentAnalyticsProvider'; import { useTranslation } from 'react-i18next'; -import { Transaction } from 'lib/clients'; -import { getChainNameById } from 'lib/chains'; -import { WITHDRAWAL_CLAIM_GAS_LIMIT, getL1ChainId } from 'lib'; -import { isPassportProvider } from 'lib/provider'; import { WalletProviderName } from '@imtbl/checkout-sdk'; -import { isNativeToken } from 'lib/utils'; import { BigNumber } from 'ethers'; import { FlowRateWithdrawResponse } from '@imtbl/bridge-sdk'; -import { NotEnoughEthToWithdraw } from 'components/Transactions/NotEnoughEthToWithdraw'; import { FeeData } from '@ethersproject/providers'; -import { BridgeWidgetViews } from 'context/view-context/BridgeViewContextTypes'; +import { UserJourney, useAnalytics } from '../../../context/analytics-provider/SegmentAnalyticsProvider'; +import { Transaction } from '../../../lib/clients'; +import { getChainNameById } from '../../../lib/chains'; +import { WITHDRAWAL_CLAIM_GAS_LIMIT, getL1ChainId } from '../../../lib'; +import { isPassportProvider } from '../../../lib/provider'; +import { isNativeToken } from '../../../lib/utils'; +import { NotEnoughEthToWithdraw } from '../../../components/Transactions/NotEnoughEthToWithdraw'; +import { BridgeWidgetViews } from '../../../context/view-context/BridgeViewContextTypes'; import { SimpleLayout } from '../../../components/SimpleLayout/SimpleLayout'; import { HeaderNavigation } from '../../../components/Header/HeaderNavigation'; import { sendBridgeWidgetCloseEvent } from '../BridgeWidgetEvents'; diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/views/MoveInProgress.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/views/MoveInProgress.tsx index da62b52a56..e9316e7d0b 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/views/MoveInProgress.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/views/MoveInProgress.tsx @@ -1,10 +1,10 @@ import { useContext, useEffect } from 'react'; -import { UserJourney, useAnalytics } from 'context/analytics-provider/SegmentAnalyticsProvider'; import { useTranslation } from 'react-i18next'; -import { ButtonNavigationStyles } from 'components/Header/HeaderStyles'; -import { BridgeWidgetViews } from 'context/view-context/BridgeViewContextTypes'; -import { ViewActions, ViewContext } from 'context/view-context/ViewContext'; import { Badge, ButtCon } from '@biom3/react'; +import { UserJourney, useAnalytics } from '../../../context/analytics-provider/SegmentAnalyticsProvider'; +import { ButtonNavigationStyles } from '../../../components/Header/HeaderStyles'; +import { BridgeWidgetViews } from '../../../context/view-context/BridgeViewContextTypes'; +import { ViewActions, ViewContext } from '../../../context/view-context/ViewContext'; import { SimpleTextBody } from '../../../components/Body/SimpleTextBody'; import { HeaderNavigation } from '../../../components/Header/HeaderNavigation'; import { RocketHero } from '../../../components/Hero/RocketHero'; diff --git a/packages/checkout/widgets-lib/src/widgets/bridge/views/WalletNetworkSelectionView.tsx b/packages/checkout/widgets-lib/src/widgets/bridge/views/WalletNetworkSelectionView.tsx index 6f884867ad..b818593bfa 100644 --- a/packages/checkout/widgets-lib/src/widgets/bridge/views/WalletNetworkSelectionView.tsx +++ b/packages/checkout/widgets-lib/src/widgets/bridge/views/WalletNetworkSelectionView.tsx @@ -1,14 +1,14 @@ -import { HeaderNavigation } from 'components/Header/HeaderNavigation'; -import { SimpleLayout } from 'components/SimpleLayout/SimpleLayout'; -import { FooterLogo } from 'components/Footer/FooterLogo'; import { useContext, useEffect } from 'react'; -import { EventTargetContext } from 'context/event-target-context/EventTargetContext'; -import { BridgeWidgetViews } from 'context/view-context/BridgeViewContextTypes'; -import { ButtonNavigationStyles } from 'components/Header/HeaderStyles'; import { ButtCon } from '@biom3/react'; -import { ViewActions, ViewContext } from 'context/view-context/ViewContext'; -import { UserJourney, useAnalytics } from 'context/analytics-provider/SegmentAnalyticsProvider'; import { useTranslation } from 'react-i18next'; +import { HeaderNavigation } from '../../../components/Header/HeaderNavigation'; +import { SimpleLayout } from '../../../components/SimpleLayout/SimpleLayout'; +import { FooterLogo } from '../../../components/Footer/FooterLogo'; +import { EventTargetContext } from '../../../context/event-target-context/EventTargetContext'; +import { BridgeWidgetViews } from '../../../context/view-context/BridgeViewContextTypes'; +import { ButtonNavigationStyles } from '../../../components/Header/HeaderStyles'; +import { ViewActions, ViewContext } from '../../../context/view-context/ViewContext'; +import { UserJourney, useAnalytics } from '../../../context/analytics-provider/SegmentAnalyticsProvider'; import { sendBridgeWidgetCloseEvent } from '../BridgeWidgetEvents'; import { WalletAndNetworkSelector } from '../components/WalletAndNetworkSelector'; diff --git a/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.cy.tsx b/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.cy.tsx index e9c3b7e32e..46928782e0 100644 --- a/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.cy.tsx +++ b/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.cy.tsx @@ -10,7 +10,7 @@ import { mount } from 'cypress/react18'; import { Environment } from '@imtbl/config'; import { ExternalProvider, Web3Provider } from '@ethersproject/providers'; import { Passport } from '@imtbl/passport'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../context/view-context/test-components/ViewContextTestComponent'; import { cyIntercept, cySmartGet } from '../../lib/testUtils'; import ConnectWidget from './ConnectWidget'; import { StrongCheckoutWidgetsConfig } from '../../lib/withDefaultWidgetConfig'; diff --git a/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.tsx b/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.tsx index 1199eeab04..e82eca4e3e 100644 --- a/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.tsx +++ b/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidget.tsx @@ -14,7 +14,7 @@ import { } from '@imtbl/checkout-sdk'; import { Web3Provider } from '@ethersproject/providers'; import { useTranslation } from 'react-i18next'; -import { isL1EthChainId, isZkEvmChainId } from 'lib/utils'; +import { isL1EthChainId, isZkEvmChainId } from '../../lib/utils'; import { sendCloseWidgetEvent, sendConnectFailedEvent, diff --git a/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidgetRoot.tsx b/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidgetRoot.tsx index 681dd1d6a2..b45e0cfcf9 100644 --- a/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidgetRoot.tsx +++ b/packages/checkout/widgets-lib/src/widgets/connect/ConnectWidgetRoot.tsx @@ -3,12 +3,12 @@ import { ChainId, ConnectWidgetParams, IMTBLWidgetEvents, WidgetProperties, WidgetType, } from '@imtbl/checkout-sdk'; -import { ThemeProvider } from 'components/ThemeProvider/ThemeProvider'; -import { CustomAnalyticsProvider } from 'context/analytics-provider/CustomAnalyticsProvider'; -import { LoadingView } from 'views/loading/LoadingView'; import { Environment } from '@imtbl/config'; -import { getChainNameById } from 'lib/chains'; -import { HandoverProvider } from 'context/handover-context/HandoverProvider'; +import { ThemeProvider } from '../../components/ThemeProvider/ThemeProvider'; +import { CustomAnalyticsProvider } from '../../context/analytics-provider/CustomAnalyticsProvider'; +import { LoadingView } from '../../views/loading/LoadingView'; +import { getChainNameById } from '../../lib/chains'; +import { HandoverProvider } from '../../context/handover-context/HandoverProvider'; import i18n from '../../i18n'; import { Base } from '../BaseWidgetRoot'; diff --git a/packages/checkout/widgets-lib/src/widgets/connect/components/NonPassportWarningDrawer.tsx b/packages/checkout/widgets-lib/src/widgets/connect/components/NonPassportWarningDrawer.tsx index 568d005446..d0e317aa90 100644 --- a/packages/checkout/widgets-lib/src/widgets/connect/components/NonPassportWarningDrawer.tsx +++ b/packages/checkout/widgets-lib/src/widgets/connect/components/NonPassportWarningDrawer.tsx @@ -8,7 +8,7 @@ import { Link, } from '@biom3/react'; import { Trans, useTranslation } from 'react-i18next'; -import { WalletWarningHero } from 'components/Hero/WalletWarningHero'; +import { WalletWarningHero } from '../../../components/Hero/WalletWarningHero'; export function NonPassportWarningDrawer({ visible, diff --git a/packages/checkout/widgets-lib/src/widgets/connect/components/WalletList.tsx b/packages/checkout/widgets-lib/src/widgets/connect/components/WalletList.tsx index 84ebcef6db..a65dd241c4 100644 --- a/packages/checkout/widgets-lib/src/widgets/connect/components/WalletList.tsx +++ b/packages/checkout/widgets-lib/src/widgets/connect/components/WalletList.tsx @@ -18,8 +18,8 @@ import { import { motion } from 'framer-motion'; import { useTranslation } from 'react-i18next'; import { Web3Provider } from '@ethersproject/providers'; -import { UnableToConnectDrawer } from 'components/UnableToConnectDrawer/UnableToConnectDrawer'; -import { ChangedYourMindDrawer } from 'components/ChangedYourMindDrawer/ChangedYourMindDrawer'; +import { UnableToConnectDrawer } from '../../../components/UnableToConnectDrawer/UnableToConnectDrawer'; +import { ChangedYourMindDrawer } from '../../../components/ChangedYourMindDrawer/ChangedYourMindDrawer'; import { ConnectWidgetViews } from '../../../context/view-context/ConnectViewContextTypes'; import { ConnectActions, ConnectContext } from '../context/ConnectContext'; import { WalletItem } from './WalletItem'; diff --git a/packages/checkout/widgets-lib/src/widgets/connect/views/ReadyToConnect.tsx b/packages/checkout/widgets-lib/src/widgets/connect/views/ReadyToConnect.tsx index d9162e6fc0..fcb56a4716 100644 --- a/packages/checkout/widgets-lib/src/widgets/connect/views/ReadyToConnect.tsx +++ b/packages/checkout/widgets-lib/src/widgets/connect/views/ReadyToConnect.tsx @@ -6,8 +6,8 @@ import { import { useContext, useState, useCallback, useMemo, useEffect, } from 'react'; -import { addProviderListenersForWidgetRoot } from 'lib'; import { useTranslation } from 'react-i18next'; +import { addProviderListenersForWidgetRoot } from '../../../lib'; import { SimpleTextBody } from '../../../components/Body/SimpleTextBody'; import { FooterButton } from '../../../components/Footer/FooterButton'; import { HeaderNavigation } from '../../../components/Header/HeaderNavigation'; diff --git a/packages/checkout/widgets-lib/src/widgets/connect/views/SwitchNetworkEth.tsx b/packages/checkout/widgets-lib/src/widgets/connect/views/SwitchNetworkEth.tsx index c662bdb4ea..063fe02358 100644 --- a/packages/checkout/widgets-lib/src/widgets/connect/views/SwitchNetworkEth.tsx +++ b/packages/checkout/widgets-lib/src/widgets/connect/views/SwitchNetworkEth.tsx @@ -2,7 +2,7 @@ import { useCallback, useContext, useEffect, useState, } from 'react'; import { useTranslation } from 'react-i18next'; -import { getChainNameById } from 'lib/chains'; +import { getChainNameById } from '../../../lib/chains'; import { SimpleTextBody } from '../../../components/Body/SimpleTextBody'; import { FooterButton } from '../../../components/Footer/FooterButton'; import { HeaderNavigation } from '../../../components/Header/HeaderNavigation'; diff --git a/packages/checkout/widgets-lib/src/widgets/connect/views/SwitchNetworkZkEVM.tsx b/packages/checkout/widgets-lib/src/widgets/connect/views/SwitchNetworkZkEVM.tsx index 136ebf7a5f..6f9278c2be 100644 --- a/packages/checkout/widgets-lib/src/widgets/connect/views/SwitchNetworkZkEVM.tsx +++ b/packages/checkout/widgets-lib/src/widgets/connect/views/SwitchNetworkZkEVM.tsx @@ -3,7 +3,7 @@ import { } from 'react'; import { Web3Provider } from '@ethersproject/providers'; import { useTranslation } from 'react-i18next'; -import { isWalletConnectProvider } from 'lib/provider'; +import { isWalletConnectProvider } from '../../../lib/provider'; import { SimpleTextBody } from '../../../components/Body/SimpleTextBody'; import { FooterButton } from '../../../components/Footer/FooterButton'; import { HeaderNavigation } from '../../../components/Header/HeaderNavigation'; diff --git a/packages/checkout/widgets-lib/src/widgets/on-ramp/OnRampWidget.tsx b/packages/checkout/widgets-lib/src/widgets/on-ramp/OnRampWidget.tsx index e292563959..a483ade846 100644 --- a/packages/checkout/widgets-lib/src/widgets/on-ramp/OnRampWidget.tsx +++ b/packages/checkout/widgets-lib/src/widgets/on-ramp/OnRampWidget.tsx @@ -2,8 +2,8 @@ import { useContext, useEffect, useMemo, useReducer, useState, } from 'react'; import { IMTBLWidgetEvents, OnRampWidgetParams } from '@imtbl/checkout-sdk'; -import { UserJourney } from 'context/analytics-provider/SegmentAnalyticsProvider'; import { useTranslation } from 'react-i18next'; +import { UserJourney } from '../../context/analytics-provider/SegmentAnalyticsProvider'; import { NATIVE } from '../../lib'; import { StrongCheckoutWidgetsConfig } from '../../lib/withDefaultWidgetConfig'; import { diff --git a/packages/checkout/widgets-lib/src/widgets/on-ramp/OnRampWidgetRoot.tsx b/packages/checkout/widgets-lib/src/widgets/on-ramp/OnRampWidgetRoot.tsx index eda5e20d39..8dfea225ba 100644 --- a/packages/checkout/widgets-lib/src/widgets/on-ramp/OnRampWidgetRoot.tsx +++ b/packages/checkout/widgets-lib/src/widgets/on-ramp/OnRampWidgetRoot.tsx @@ -8,14 +8,14 @@ import { WidgetTheme, WidgetType, } from '@imtbl/checkout-sdk'; -import { Base } from 'widgets/BaseWidgetRoot'; -import { ConnectLoader, ConnectLoaderParams } from 'components/ConnectLoader/ConnectLoader'; -import { getL1ChainId, getL2ChainId } from 'lib'; -import { isValidAddress, isValidAmount } from 'lib/validations/widgetValidators'; -import { ThemeProvider } from 'components/ThemeProvider/ThemeProvider'; -import { CustomAnalyticsProvider } from 'context/analytics-provider/CustomAnalyticsProvider'; -import { LoadingView } from 'views/loading/LoadingView'; -import { HandoverProvider } from 'context/handover-context/HandoverProvider'; +import { Base } from '../BaseWidgetRoot'; +import { ConnectLoader, ConnectLoaderParams } from '../../components/ConnectLoader/ConnectLoader'; +import { getL1ChainId, getL2ChainId } from '../../lib'; +import { isValidAddress, isValidAmount } from '../../lib/validations/widgetValidators'; +import { ThemeProvider } from '../../components/ThemeProvider/ThemeProvider'; +import { CustomAnalyticsProvider } from '../../context/analytics-provider/CustomAnalyticsProvider'; +import { LoadingView } from '../../views/loading/LoadingView'; +import { HandoverProvider } from '../../context/handover-context/HandoverProvider'; import { sendOnRampWidgetCloseEvent } from './OnRampWidgetEvents'; import i18n from '../../i18n'; diff --git a/packages/checkout/widgets-lib/src/widgets/on-ramp/views/OrderInProgress.cy.tsx b/packages/checkout/widgets-lib/src/widgets/on-ramp/views/OrderInProgress.cy.tsx index 6d125b09a7..24714a01d9 100644 --- a/packages/checkout/widgets-lib/src/widgets/on-ramp/views/OrderInProgress.cy.tsx +++ b/packages/checkout/widgets-lib/src/widgets/on-ramp/views/OrderInProgress.cy.tsx @@ -1,6 +1,6 @@ import { mount } from 'cypress/react18'; import { cy, describe } from 'local-cypress'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../../context/view-context/test-components/ViewContextTestComponent'; import { cySmartGet } from '../../../lib/testUtils'; import { OrderInProgress } from './OrderInProgress'; diff --git a/packages/checkout/widgets-lib/src/widgets/sale/SaleWidgetRoot.tsx b/packages/checkout/widgets-lib/src/widgets/sale/SaleWidgetRoot.tsx index 5104094877..e6ebc0e91e 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/SaleWidgetRoot.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/SaleWidgetRoot.tsx @@ -9,17 +9,17 @@ import { WidgetTheme, WidgetType, } from '@imtbl/checkout-sdk'; -import { Base } from 'widgets/BaseWidgetRoot'; +import { Base } from '../BaseWidgetRoot'; import { ConnectLoader, ConnectLoaderParams, -} from 'components/ConnectLoader/ConnectLoader'; -import { getL2ChainId } from 'lib'; -import { isValidWalletProvider } from 'lib/validations/widgetValidators'; -import { ThemeProvider } from 'components/ThemeProvider/ThemeProvider'; -import { CustomAnalyticsProvider } from 'context/analytics-provider/CustomAnalyticsProvider'; -import { LoadingView } from 'views/loading/LoadingView'; -import { HandoverProvider } from 'context/handover-context/HandoverProvider'; +} from '../../components/ConnectLoader/ConnectLoader'; +import { getL2ChainId } from '../../lib'; +import { isValidWalletProvider } from '../../lib/validations/widgetValidators'; +import { ThemeProvider } from '../../components/ThemeProvider/ThemeProvider'; +import { CustomAnalyticsProvider } from '../../context/analytics-provider/CustomAnalyticsProvider'; +import { LoadingView } from '../../views/loading/LoadingView'; +import { HandoverProvider } from '../../context/handover-context/HandoverProvider'; import { sendSaleWidgetCloseEvent } from './SaleWidgetEvents'; import i18n from '../../i18n'; diff --git a/packages/checkout/widgets-lib/src/widgets/sale/components/CoinsDrawer.tsx b/packages/checkout/widgets-lib/src/widgets/sale/components/CoinsDrawer.tsx index d0bd8e223d..606fcd4aed 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/components/CoinsDrawer.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/components/CoinsDrawer.tsx @@ -8,13 +8,13 @@ import { } from '@biom3/react'; import { motion } from 'framer-motion'; import { useTranslation } from 'react-i18next'; -import { listVariants, listItemVariants } from 'lib/animation/listAnimation'; import { SalePaymentTypes, TransactionRequirement, WidgetTheme, } from '@imtbl/checkout-sdk'; import { Environment } from '@imtbl/config'; +import { listVariants, listItemVariants } from '../../../lib/animation/listAnimation'; import { CoinsDrawerItem } from './CoinsDrawerItem'; import { FundingBalance } from '../types'; import { PaymentOptions } from './PaymentOptions'; diff --git a/packages/checkout/widgets-lib/src/widgets/sale/components/CoinsDrawerItem.tsx b/packages/checkout/widgets-lib/src/widgets/sale/components/CoinsDrawerItem.tsx index ed24e3007c..95f0fa4966 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/components/CoinsDrawerItem.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/components/CoinsDrawerItem.tsx @@ -6,12 +6,11 @@ import { prettyFormatNumber, } from '@biom3/react'; import { TransactionRequirement, WidgetTheme } from '@imtbl/checkout-sdk'; -import { calculateCryptoToFiat, tokenValueFormat } from 'lib/utils'; -import { TokenImage } from 'components/TokenImage/TokenImage'; import { useTranslation } from 'react-i18next'; import { ReactElement } from 'react'; - import { Environment } from '@imtbl/config'; +import { calculateCryptoToFiat, tokenValueFormat } from '../../../lib/utils'; +import { TokenImage } from '../../../components/TokenImage/TokenImage'; import { FundingBalance } from '../types'; import { getFundingBalanceTotalFees } from '../functions/fundingBalanceFees'; diff --git a/packages/checkout/widgets-lib/src/widgets/sale/components/CreditCardWarningDrawer.tsx b/packages/checkout/widgets-lib/src/widgets/sale/components/CreditCardWarningDrawer.tsx index c323028f70..f09725afb4 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/components/CreditCardWarningDrawer.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/components/CreditCardWarningDrawer.tsx @@ -2,8 +2,8 @@ import { Body, Box, ButtCon, Button, Drawer, Heading, } from '@biom3/react'; import { SalePaymentTypes } from '@imtbl/checkout-sdk'; -import { CreditCardWarningHero } from 'components/Hero/CreditCardWarningHero'; import { useTranslation } from 'react-i18next'; +import { CreditCardWarningHero } from '../../../components/Hero/CreditCardWarningHero'; import { useSaleContext } from '../context/SaleContextProvider'; export function CreditCardWarningDrawer() { diff --git a/packages/checkout/widgets-lib/src/widgets/sale/components/FundingRouteExecute/FundingRouteExecute.tsx b/packages/checkout/widgets-lib/src/widgets/sale/components/FundingRouteExecute/FundingRouteExecute.tsx index 3a4e1eef93..c04bbff478 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/components/FundingRouteExecute/FundingRouteExecute.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/components/FundingRouteExecute/FundingRouteExecute.tsx @@ -27,9 +27,9 @@ import { useRef, useState, } from 'react'; -import BridgeWidget from 'widgets/bridge/BridgeWidget'; import { useTranslation } from 'react-i18next'; -import OnRampWidget from 'widgets/on-ramp/OnRampWidget'; +import BridgeWidget from '../../../bridge/BridgeWidget'; +import OnRampWidget from '../../../on-ramp/OnRampWidget'; import { ConnectLoaderActions, ConnectLoaderContext, diff --git a/packages/checkout/widgets-lib/src/widgets/sale/components/OrderFees.tsx b/packages/checkout/widgets-lib/src/widgets/sale/components/OrderFees.tsx index 0fe5e101bb..d4233780ec 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/components/OrderFees.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/components/OrderFees.tsx @@ -1,7 +1,7 @@ import { SxProps } from '@biom3/react'; import { TokenInfo } from '@imtbl/checkout-sdk'; -import { Fees } from 'components/Fees/Fees'; -import { FormattedFee } from 'widgets/swap/functions/swapFees'; +import { Fees } from '../../../components/Fees/Fees'; +import { FormattedFee } from '../../swap/functions/swapFees'; export type FeesDisplay = { token: TokenInfo | undefined; diff --git a/packages/checkout/widgets-lib/src/widgets/sale/components/OrderItem.tsx b/packages/checkout/widgets-lib/src/widgets/sale/components/OrderItem.tsx index a486d78f59..61df00c090 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/components/OrderItem.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/components/OrderItem.tsx @@ -1,11 +1,11 @@ +import { ReactElement } from 'react'; import { Heading, MenuItem, MenuItemSize, SxProps, } from '@biom3/react'; import { SaleItem } from '@imtbl/checkout-sdk'; import { useTranslation } from 'react-i18next'; -import { calculateCryptoToFiat, tokenValueFormat } from 'lib/utils'; -import { ReactElement } from 'react'; -import { TokenImage } from 'components/TokenImage/TokenImage'; +import { calculateCryptoToFiat, tokenValueFormat } from '../../../lib/utils'; +import { TokenImage } from '../../../components/TokenImage/TokenImage'; import { OrderQuotePricing, FundingBalance } from '../types'; export interface OrderItemProps< diff --git a/packages/checkout/widgets-lib/src/widgets/sale/components/OrderItems.tsx b/packages/checkout/widgets-lib/src/widgets/sale/components/OrderItems.tsx index 1af14cd075..fde70aa274 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/components/OrderItems.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/components/OrderItems.tsx @@ -1,9 +1,9 @@ import { Box, SxProps } from '@biom3/react'; import { SaleItem } from '@imtbl/checkout-sdk'; -import { listVariants, listItemVariants } from 'lib/animation/listAnimation'; import { motion } from 'framer-motion'; import { ReactNode } from 'react'; +import { listVariants, listItemVariants } from '../../../lib/animation/listAnimation'; import { OrderItem } from './OrderItem'; import { OrderQuoteProduct, FundingBalance } from '../types'; import { getPricingBySymbol } from '../utils/pricing'; diff --git a/packages/checkout/widgets-lib/src/widgets/sale/components/OrderReview.tsx b/packages/checkout/widgets-lib/src/widgets/sale/components/OrderReview.tsx index e8230c2b9e..e21d87758b 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/components/OrderReview.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/components/OrderReview.tsx @@ -11,8 +11,8 @@ import { import { OrderSummarySubViews, SaleWidgetViews, -} from 'context/view-context/SaleViewContextTypes'; -import { calculateCryptoToFiat } from 'lib/utils'; +} from '../../../context/view-context/SaleViewContextTypes'; +import { calculateCryptoToFiat } from '../../../lib/utils'; import { HeaderNavigation } from '../../../components/Header/HeaderNavigation'; import { SimpleLayout } from '../../../components/SimpleLayout/SimpleLayout'; import { EventTargetContext } from '../../../context/event-target-context/EventTargetContext'; diff --git a/packages/checkout/widgets-lib/src/widgets/sale/components/PaymentOptions.tsx b/packages/checkout/widgets-lib/src/widgets/sale/components/PaymentOptions.tsx index 14e613492f..9141922b03 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/components/PaymentOptions.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/components/PaymentOptions.tsx @@ -1,9 +1,9 @@ import { Box, MenuItemSize } from '@biom3/react'; import { SalePaymentTypes } from '@imtbl/checkout-sdk'; -import { listItemVariants, listVariants } from 'lib/animation/listAnimation'; import { motion } from 'framer-motion'; import { useMemo } from 'react'; +import { listItemVariants, listVariants } from '../../../lib/animation/listAnimation'; import { PaymentOption } from './PaymentOption'; const defaultPaymentOptions: SalePaymentTypes[] = [ diff --git a/packages/checkout/widgets-lib/src/widgets/sale/components/SelectCoinDropdown.tsx b/packages/checkout/widgets-lib/src/widgets/sale/components/SelectCoinDropdown.tsx index 845645dbc3..8626b2d978 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/components/SelectCoinDropdown.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/components/SelectCoinDropdown.tsx @@ -9,8 +9,8 @@ import { import { useTranslation } from 'react-i18next'; import { calculateCryptoToFiat, tokenValueFormat, -} from 'lib/utils'; -import { TokenImage } from 'components/TokenImage/TokenImage'; +} from '../../../lib/utils'; +import { TokenImage } from '../../../components/TokenImage/TokenImage'; import { FundingBalance } from '../types'; import { useSaleContext } from '../context/SaleContextProvider'; diff --git a/packages/checkout/widgets-lib/src/widgets/sale/functions/fetchFundingBalances.ts b/packages/checkout/widgets-lib/src/widgets/sale/functions/fetchFundingBalances.ts index a5e7feb654..611996f799 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/functions/fetchFundingBalances.ts +++ b/packages/checkout/widgets-lib/src/widgets/sale/functions/fetchFundingBalances.ts @@ -1,7 +1,7 @@ import { Web3Provider } from '@ethersproject/providers'; import { Checkout, TransactionRequirement } from '@imtbl/checkout-sdk'; import { Environment } from '@imtbl/config'; -import { compareStr } from 'lib/utils'; +import { compareStr } from '../../../lib/utils'; import { OrderQuoteCurrency, FundingBalance, diff --git a/packages/checkout/widgets-lib/src/widgets/sale/functions/fetchFundingBalancesUtils.ts b/packages/checkout/widgets-lib/src/widgets/sale/functions/fetchFundingBalancesUtils.ts index ef03faa580..4dff91564c 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/functions/fetchFundingBalancesUtils.ts +++ b/packages/checkout/widgets-lib/src/widgets/sale/functions/fetchFundingBalancesUtils.ts @@ -14,11 +14,11 @@ import { } from '@imtbl/checkout-sdk'; import { BigNumber } from 'ethers'; -import { getTokenImageByAddress, isNativeToken } from 'lib/utils'; import { Environment } from '@imtbl/config'; import { Web3Provider } from '@ethersproject/providers'; -import { isGasFree } from 'lib/provider'; import { SwapFees } from '@imtbl/checkout-sdk/dist/types'; +import { getTokenImageByAddress, isNativeToken } from '../../../lib/utils'; +import { isGasFree } from '../../../lib/provider'; import { OrderQuoteCurrency, FundingBalance, @@ -137,7 +137,7 @@ export const getFundingBalances = ( if ( smartCheckoutResult.sufficient === false && smartCheckoutResult?.router?.routingOutcome.type - === RoutingOutcomeType.ROUTES_FOUND + === RoutingOutcomeType.ROUTES_FOUND ) { return getAlternativeFundingSteps( smartCheckoutResult.router.routingOutcome.fundingRoutes, @@ -150,13 +150,13 @@ export const getFundingBalances = ( export const getFnToSortFundingBalancesByPriority = (baseSymbol?: string) => (a: FundingBalance, b: FundingBalance) => { const aIsBase = a.fundingItem - && a.fundingItem.token - && a.fundingItem.token.symbol === baseSymbol + && a.fundingItem.token + && a.fundingItem.token.symbol === baseSymbol ? -1 : 0; const bIsBase = b.fundingItem - && b.fundingItem.token - && b.fundingItem.token.symbol === baseSymbol + && b.fundingItem.token + && b.fundingItem.token.symbol === baseSymbol ? -1 : 0; @@ -166,7 +166,7 @@ export const getFnToSortFundingBalancesByPriority = (baseSymbol?: string) => (a: if ( a.type === FundingBalanceType.SUFFICIENT - && b.type === FundingBalanceType.SUFFICIENT + && b.type === FundingBalanceType.SUFFICIENT ) { return 0; } diff --git a/packages/checkout/widgets-lib/src/widgets/sale/functions/fundingBalanceFees.ts b/packages/checkout/widgets-lib/src/widgets/sale/functions/fundingBalanceFees.ts index 80af405f7d..9b6b841ffd 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/functions/fundingBalanceFees.ts +++ b/packages/checkout/widgets-lib/src/widgets/sale/functions/fundingBalanceFees.ts @@ -1,12 +1,12 @@ import { utils } from 'ethers'; import { Fee, FundingStepType, TokenInfo } from '@imtbl/checkout-sdk'; +import { TFunction } from 'i18next'; import { calculateCryptoToFiat, abbreviateWalletAddress, tokenValueFormat, -} from 'lib/utils'; -import { FormattedFee } from 'widgets/swap/functions/swapFees'; -import { TFunction } from 'i18next'; +} from '../../../lib/utils'; +import { FormattedFee } from '../../swap/functions/swapFees'; import { FundingBalance } from '../types'; export type FeesBySymbol = Record; diff --git a/packages/checkout/widgets-lib/src/widgets/sale/functions/transformToOrderQuote.ts b/packages/checkout/widgets-lib/src/widgets/sale/functions/transformToOrderQuote.ts index 1795841df8..75d5a1b661 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/functions/transformToOrderQuote.ts +++ b/packages/checkout/widgets-lib/src/widgets/sale/functions/transformToOrderQuote.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { compareStr } from 'lib/utils'; +import { compareStr } from '../../../lib/utils'; import { OrderQuote } from '../types'; export type OrderQuoteApiResponse = { diff --git a/packages/checkout/widgets-lib/src/widgets/sale/hooks/useFundingBalances.ts b/packages/checkout/widgets-lib/src/widgets/sale/hooks/useFundingBalances.ts index 705e526633..5ef6b92a9d 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/hooks/useFundingBalances.ts +++ b/packages/checkout/widgets-lib/src/widgets/sale/hooks/useFundingBalances.ts @@ -1,6 +1,6 @@ import { useContext, useRef, useState } from 'react'; import { TransactionRequirement } from '@imtbl/checkout-sdk'; -import { CryptoFiatContext } from 'context/crypto-fiat-context/CryptoFiatContext'; +import { CryptoFiatContext } from '../../../context/crypto-fiat-context/CryptoFiatContext'; import { fetchFundingBalances } from '../functions/fetchFundingBalances'; import { FundingBalance, FundingBalanceResult } from '../types'; import { useSaleContext } from '../context/SaleContextProvider'; diff --git a/packages/checkout/widgets-lib/src/widgets/sale/hooks/useQuoteOrder.ts b/packages/checkout/widgets-lib/src/widgets/sale/hooks/useQuoteOrder.ts index cd3466d962..18af8ebd81 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/hooks/useQuoteOrder.ts +++ b/packages/checkout/widgets-lib/src/widgets/sale/hooks/useQuoteOrder.ts @@ -2,7 +2,7 @@ import { useState, useEffect, useRef } from 'react'; import { Environment } from '@imtbl/config'; import { SaleItem } from '@imtbl/checkout-sdk'; import { Web3Provider } from '@ethersproject/providers'; -import { compareStr } from 'lib/utils'; +import { compareStr } from '../../../lib/utils'; import { PRIMARY_SALES_API_BASE_URL } from '../utils/config'; import { OrderQuote, OrderQuoteCurrency, SaleErrorTypes } from '../types'; diff --git a/packages/checkout/widgets-lib/src/widgets/sale/utils/analytics.ts b/packages/checkout/widgets-lib/src/widgets/sale/utils/analytics.ts index 7e5a24c992..6123fe14b5 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/utils/analytics.ts +++ b/packages/checkout/widgets-lib/src/widgets/sale/utils/analytics.ts @@ -1,5 +1,5 @@ import { FundingItem, SalePaymentToken } from '@imtbl/checkout-sdk'; -import { calculateCryptoToFiat } from 'lib/utils'; +import { calculateCryptoToFiat } from '../../../lib/utils'; export const getPaymentTokenDetails = ( fundingItem: FundingItem, diff --git a/packages/checkout/widgets-lib/src/widgets/sale/utils/pricing.ts b/packages/checkout/widgets-lib/src/widgets/sale/utils/pricing.ts index 4a98d71cc6..9d86133eee 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/utils/pricing.ts +++ b/packages/checkout/widgets-lib/src/widgets/sale/utils/pricing.ts @@ -1,4 +1,4 @@ -import { tokenSymbolNameOverrides } from 'lib/utils'; +import { tokenSymbolNameOverrides } from '../../../lib/utils'; import { OrderQuotePricing } from '../types'; export const getPricingBySymbol = ( diff --git a/packages/checkout/widgets-lib/src/widgets/sale/views/OrderSummary.tsx b/packages/checkout/widgets-lib/src/widgets/sale/views/OrderSummary.tsx index 9785e07035..e716d22688 100644 --- a/packages/checkout/widgets-lib/src/widgets/sale/views/OrderSummary.tsx +++ b/packages/checkout/widgets-lib/src/widgets/sale/views/OrderSummary.tsx @@ -1,12 +1,12 @@ import { Box } from '@biom3/react'; import { useContext, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; +import { SalePaymentTypes } from '@imtbl/checkout-sdk'; import { SharedViews, ViewActions, ViewContext, -} from 'context/view-context/ViewContext'; -import { SalePaymentTypes } from '@imtbl/checkout-sdk'; +} from '../../../context/view-context/ViewContext'; import { OrderSummarySubViews, SaleWidgetViews, diff --git a/packages/checkout/widgets-lib/src/widgets/swap/SwapWidget.cy.tsx b/packages/checkout/widgets-lib/src/widgets/swap/SwapWidget.cy.tsx index 6903726f2b..f66da969d4 100644 --- a/packages/checkout/widgets-lib/src/widgets/swap/SwapWidget.cy.tsx +++ b/packages/checkout/widgets-lib/src/widgets/swap/SwapWidget.cy.tsx @@ -8,7 +8,7 @@ import { import { BigNumber } from 'ethers'; import { Environment } from '@imtbl/config'; import { Web3Provider } from '@ethersproject/providers'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../context/view-context/test-components/ViewContextTestComponent'; import { cyIntercept, cySmartGet } from '../../lib/testUtils'; import SwapWidget from './SwapWidget'; import { StrongCheckoutWidgetsConfig } from '../../lib/withDefaultWidgetConfig'; diff --git a/packages/checkout/widgets-lib/src/widgets/swap/SwapWidgetRoot.tsx b/packages/checkout/widgets-lib/src/widgets/swap/SwapWidgetRoot.tsx index 749f1fe612..e61aeda164 100644 --- a/packages/checkout/widgets-lib/src/widgets/swap/SwapWidgetRoot.tsx +++ b/packages/checkout/widgets-lib/src/widgets/swap/SwapWidgetRoot.tsx @@ -9,17 +9,17 @@ import { WidgetTheme, WidgetType, } from '@imtbl/checkout-sdk'; -import { Base } from 'widgets/BaseWidgetRoot'; -import { ConnectLoader, ConnectLoaderParams } from 'components/ConnectLoader/ConnectLoader'; -import { getL2ChainId } from 'lib'; -import { isPassportProvider } from 'lib/provider'; -import { ServiceUnavailableErrorView } from 'views/error/ServiceUnavailableErrorView'; -import { ServiceType } from 'views/error/serviceTypes'; -import { isValidAddress, isValidAmount, isValidWalletProvider } from 'lib/validations/widgetValidators'; -import { ThemeProvider } from 'components/ThemeProvider/ThemeProvider'; -import { CustomAnalyticsProvider } from 'context/analytics-provider/CustomAnalyticsProvider'; -import { LoadingView } from 'views/loading/LoadingView'; -import { HandoverProvider } from 'context/handover-context/HandoverProvider'; +import { Base } from '../BaseWidgetRoot'; +import { ConnectLoader, ConnectLoaderParams } from '../../components/ConnectLoader/ConnectLoader'; +import { getL2ChainId } from '../../lib'; +import { isPassportProvider } from '../../lib/provider'; +import { ServiceUnavailableErrorView } from '../../views/error/ServiceUnavailableErrorView'; +import { ServiceType } from '../../views/error/serviceTypes'; +import { isValidAddress, isValidAmount, isValidWalletProvider } from '../../lib/validations/widgetValidators'; +import { ThemeProvider } from '../../components/ThemeProvider/ThemeProvider'; +import { CustomAnalyticsProvider } from '../../context/analytics-provider/CustomAnalyticsProvider'; +import { LoadingView } from '../../views/loading/LoadingView'; +import { HandoverProvider } from '../../context/handover-context/HandoverProvider'; import { topUpBridgeOption, topUpOnRampOption } from './helpers'; import { sendSwapWidgetCloseEvent } from './SwapWidgetEvents'; import i18n from '../../i18n'; diff --git a/packages/checkout/widgets-lib/src/widgets/swap/components/SwapButton.tsx b/packages/checkout/widgets-lib/src/widgets/swap/components/SwapButton.tsx index 94ebbdb0a3..b2e26dc937 100644 --- a/packages/checkout/widgets-lib/src/widgets/swap/components/SwapButton.tsx +++ b/packages/checkout/widgets-lib/src/widgets/swap/components/SwapButton.tsx @@ -3,8 +3,8 @@ import { useContext, useState } from 'react'; import { TransactionResponse } from '@imtbl/dex-sdk'; import { CheckoutErrorType } from '@imtbl/checkout-sdk'; import { useTranslation } from 'react-i18next'; -import { getL2ChainId } from 'lib'; import { BigNumber } from 'ethers'; +import { getL2ChainId } from '../../../lib'; import { PrefilledSwapForm, SwapWidgetViews } from '../../../context/view-context/SwapViewContextTypes'; import { ViewContext, diff --git a/packages/checkout/widgets-lib/src/widgets/swap/components/SwapForm.tsx b/packages/checkout/widgets-lib/src/widgets/swap/components/SwapForm.tsx index 4e2a699c0c..63783869ba 100644 --- a/packages/checkout/widgets-lib/src/widgets/swap/components/SwapForm.tsx +++ b/packages/checkout/widgets-lib/src/widgets/swap/components/SwapForm.tsx @@ -8,10 +8,10 @@ import { import { BigNumber, utils } from 'ethers'; import { TokenInfo, WidgetTheme } from '@imtbl/checkout-sdk'; import { TransactionResponse } from '@imtbl/dex-sdk'; -import { UserJourney, useAnalytics } from 'context/analytics-provider/SegmentAnalyticsProvider'; import { useTranslation } from 'react-i18next'; import { Environment } from '@imtbl/config'; -import { NetworkSwitchDrawer } from 'components/NetworkSwitchDrawer/NetworkSwitchDrawer'; +import { UserJourney, useAnalytics } from '../../../context/analytics-provider/SegmentAnalyticsProvider'; +import { NetworkSwitchDrawer } from '../../../components/NetworkSwitchDrawer/NetworkSwitchDrawer'; import { amountInputValidation as textInputValidator } from '../../../lib/validations/amountInputValidations'; import { SwapContext } from '../context/SwapContext'; import { CryptoFiatActions, CryptoFiatContext } from '../../../context/crypto-fiat-context/CryptoFiatContext'; diff --git a/packages/checkout/widgets-lib/src/widgets/swap/test-components/SwapWidgetTestComponent.tsx b/packages/checkout/widgets-lib/src/widgets/swap/test-components/SwapWidgetTestComponent.tsx index 299b924e30..2e4ed0f393 100644 --- a/packages/checkout/widgets-lib/src/widgets/swap/test-components/SwapWidgetTestComponent.tsx +++ b/packages/checkout/widgets-lib/src/widgets/swap/test-components/SwapWidgetTestComponent.tsx @@ -1,5 +1,5 @@ import React, { useCallback, useMemo, useReducer } from 'react'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../../context/view-context/test-components/ViewContextTestComponent'; import { initialSwapState, SwapContext, swapReducer, SwapState, } from '../context/SwapContext'; diff --git a/packages/checkout/widgets-lib/src/widgets/swap/views/SwapCoins.tsx b/packages/checkout/widgets-lib/src/widgets/swap/views/SwapCoins.tsx index 151740769d..d4fae90b9a 100644 --- a/packages/checkout/widgets-lib/src/widgets/swap/views/SwapCoins.tsx +++ b/packages/checkout/widgets-lib/src/widgets/swap/views/SwapCoins.tsx @@ -6,8 +6,8 @@ import { } from 'react'; import { WidgetTheme } from '@imtbl/checkout-sdk'; import { useTranslation } from 'react-i18next'; -import { ConnectLoaderContext } from 'context/connect-loader-context/ConnectLoaderContext'; import { Environment } from '@imtbl/config'; +import { ConnectLoaderContext } from '../../../context/connect-loader-context/ConnectLoaderContext'; import { HeaderNavigation } from '../../../components/Header/HeaderNavigation'; import { SimpleLayout } from '../../../components/SimpleLayout/SimpleLayout'; import { QuickswapFooter } from '../../../components/Footer/QuickswapFooter'; diff --git a/packages/checkout/widgets-lib/src/widgets/wallet/WalletWidget.tsx b/packages/checkout/widgets-lib/src/widgets/wallet/WalletWidget.tsx index d170c4aa15..e7aaee4aba 100644 --- a/packages/checkout/widgets-lib/src/widgets/wallet/WalletWidget.tsx +++ b/packages/checkout/widgets-lib/src/widgets/wallet/WalletWidget.tsx @@ -4,9 +4,9 @@ import { useMemo, useReducer, } from 'react'; -import { IMTBLWidgetEvents, WalletWidgetParams } from '@imtbl/checkout-sdk'; -import { UserJourney } from 'context/analytics-provider/SegmentAnalyticsProvider'; import { useTranslation } from 'react-i18next'; +import { IMTBLWidgetEvents, WalletWidgetParams } from '@imtbl/checkout-sdk'; +import { UserJourney } from '../../context/analytics-provider/SegmentAnalyticsProvider'; import { initialWalletState, WalletActions, diff --git a/packages/checkout/widgets-lib/src/widgets/wallet/WalletWidgetRoot.tsx b/packages/checkout/widgets-lib/src/widgets/wallet/WalletWidgetRoot.tsx index 3b8f904c32..128e86d51f 100644 --- a/packages/checkout/widgets-lib/src/widgets/wallet/WalletWidgetRoot.tsx +++ b/packages/checkout/widgets-lib/src/widgets/wallet/WalletWidgetRoot.tsx @@ -8,14 +8,14 @@ import { WidgetTheme, WidgetType, } from '@imtbl/checkout-sdk'; -import { Base } from 'widgets/BaseWidgetRoot'; -import { ConnectLoader, ConnectLoaderParams } from 'components/ConnectLoader/ConnectLoader'; -import { getL1ChainId, getL2ChainId } from 'lib'; -import { isValidWalletProvider } from 'lib/validations/widgetValidators'; -import { ThemeProvider } from 'components/ThemeProvider/ThemeProvider'; -import { CustomAnalyticsProvider } from 'context/analytics-provider/CustomAnalyticsProvider'; -import { LoadingView } from 'views/loading/LoadingView'; -import { HandoverProvider } from 'context/handover-context/HandoverProvider'; +import { Base } from '../BaseWidgetRoot'; +import { ConnectLoader, ConnectLoaderParams } from '../../components/ConnectLoader/ConnectLoader'; +import { getL1ChainId, getL2ChainId } from '../../lib'; +import { isValidWalletProvider } from '../../lib/validations/widgetValidators'; +import { ThemeProvider } from '../../components/ThemeProvider/ThemeProvider'; +import { CustomAnalyticsProvider } from '../../context/analytics-provider/CustomAnalyticsProvider'; +import { LoadingView } from '../../views/loading/LoadingView'; +import { HandoverProvider } from '../../context/handover-context/HandoverProvider'; import { sendWalletWidgetCloseEvent } from './WalletWidgetEvents'; import i18n from '../../i18n'; diff --git a/packages/checkout/widgets-lib/src/widgets/wallet/components/BalanceItem/BalanceItem.cy.tsx b/packages/checkout/widgets-lib/src/widgets/wallet/components/BalanceItem/BalanceItem.cy.tsx index eba66b7abb..a8efa6a3d4 100644 --- a/packages/checkout/widgets-lib/src/widgets/wallet/components/BalanceItem/BalanceItem.cy.tsx +++ b/packages/checkout/widgets-lib/src/widgets/wallet/components/BalanceItem/BalanceItem.cy.tsx @@ -13,7 +13,7 @@ import { cy } from 'local-cypress'; import { Environment } from '@imtbl/config'; import { Web3Provider } from '@ethersproject/providers'; import { BigNumber } from 'ethers'; -import { BalanceInfo } from 'widgets/wallet/functions/tokenBalances'; +import { BalanceInfo } from '../../functions/tokenBalances'; import { WalletState } from '../../context/WalletContext'; import { BalanceItem } from './BalanceItem'; import { cyIntercept, cySmartGet } from '../../../../lib/testUtils'; diff --git a/packages/checkout/widgets-lib/src/widgets/wallet/components/BalanceItem/BalanceItem.tsx b/packages/checkout/widgets-lib/src/widgets/wallet/components/BalanceItem/BalanceItem.tsx index cc38e1f840..1baff5d169 100644 --- a/packages/checkout/widgets-lib/src/widgets/wallet/components/BalanceItem/BalanceItem.tsx +++ b/packages/checkout/widgets-lib/src/widgets/wallet/components/BalanceItem/BalanceItem.tsx @@ -6,7 +6,7 @@ import { IMTBLWidgetEvents, TokenFilterTypes, TokenInfo, WidgetTheme, } from '@imtbl/checkout-sdk'; import { Environment } from '@imtbl/config'; -import { TokenImage } from 'components/TokenImage/TokenImage'; +import { TokenImage } from '../../../../components/TokenImage/TokenImage'; import { ShowMenuItem } from './BalanceItemStyles'; import { BalanceInfo } from '../../functions/tokenBalances'; import { WalletContext } from '../../context/WalletContext'; diff --git a/packages/checkout/widgets-lib/src/widgets/wallet/components/NetworkMenu/NetworkMenu.cy.tsx b/packages/checkout/widgets-lib/src/widgets/wallet/components/NetworkMenu/NetworkMenu.cy.tsx index b8b516c752..d3f4ca6ecd 100644 --- a/packages/checkout/widgets-lib/src/widgets/wallet/components/NetworkMenu/NetworkMenu.cy.tsx +++ b/packages/checkout/widgets-lib/src/widgets/wallet/components/NetworkMenu/NetworkMenu.cy.tsx @@ -6,7 +6,7 @@ import { } from '@imtbl/checkout-sdk'; import { Web3Provider } from '@ethersproject/providers'; import { Environment } from '@imtbl/config'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../../../context/view-context/test-components/ViewContextTestComponent'; import { WalletContext, WalletState } from '../../context/WalletContext'; import { cyIntercept, cySmartGet } from '../../../../lib/testUtils'; import { NetworkMenu } from './NetworkMenu'; diff --git a/packages/checkout/widgets-lib/src/widgets/wallet/components/TokenBalanceList/TokenBalanceList.cy.tsx b/packages/checkout/widgets-lib/src/widgets/wallet/components/TokenBalanceList/TokenBalanceList.cy.tsx index 8031b1fd20..4ab984db93 100644 --- a/packages/checkout/widgets-lib/src/widgets/wallet/components/TokenBalanceList/TokenBalanceList.cy.tsx +++ b/packages/checkout/widgets-lib/src/widgets/wallet/components/TokenBalanceList/TokenBalanceList.cy.tsx @@ -1,7 +1,7 @@ import { describe, it, cy } from 'local-cypress'; import { mount } from 'cypress/react18'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; import { WidgetTheme } from '@imtbl/checkout-sdk'; +import { ViewContextTestComponent } from '../../../../context/view-context/test-components/ViewContextTestComponent'; import { TokenBalanceList } from './TokenBalanceList'; import { cyIntercept, cySmartGet } from '../../../../lib/testUtils'; import { ZERO_BALANCE_STRING } from '../../../../lib'; diff --git a/packages/checkout/widgets-lib/src/widgets/wallet/components/TransferAssetsL1Warning.tsx b/packages/checkout/widgets-lib/src/widgets/wallet/components/TransferAssetsL1Warning.tsx index 22a724b9c2..1264ff95c2 100644 --- a/packages/checkout/widgets-lib/src/widgets/wallet/components/TransferAssetsL1Warning.tsx +++ b/packages/checkout/widgets-lib/src/widgets/wallet/components/TransferAssetsL1Warning.tsx @@ -2,8 +2,8 @@ import { Body, Box, ButtCon, Drawer, Heading, } from '@biom3/react'; import { useTranslation } from 'react-i18next'; -import { TransferAssetsL1WarningHero } from 'components/Hero/TransferAssetsL1WarningHero'; import { Web3Provider } from '@ethersproject/providers'; +import { TransferAssetsL1WarningHero } from '../../../components/Hero/TransferAssetsL1WarningHero'; import { WalletAddress } from './WalletAddress/WalletAddress'; export function TransferAssetsL1Warning({ diff --git a/packages/checkout/widgets-lib/src/widgets/wallet/components/WalletAddress/WalletAddress.tsx b/packages/checkout/widgets-lib/src/widgets/wallet/components/WalletAddress/WalletAddress.tsx index 884ec5bebd..151f76e161 100644 --- a/packages/checkout/widgets-lib/src/widgets/wallet/components/WalletAddress/WalletAddress.tsx +++ b/packages/checkout/widgets-lib/src/widgets/wallet/components/WalletAddress/WalletAddress.tsx @@ -3,10 +3,10 @@ import { } from '@biom3/react'; import { Web3Provider } from '@ethersproject/providers'; import { useEffect, useMemo, useState } from 'react'; -import { getWalletLogoByName } from 'lib/logoUtils'; import { useTranslation } from 'react-i18next'; -import { abbreviateWalletAddress } from 'lib/utils'; -import { getWalletProviderNameByProvider, isPassportProvider } from 'lib/provider'; +import { getWalletLogoByName } from '../../../../lib/logoUtils'; +import { abbreviateWalletAddress } from '../../../../lib/utils'; +import { getWalletProviderNameByProvider, isPassportProvider } from '../../../../lib/provider'; import { UserJourney, useAnalytics, diff --git a/packages/checkout/widgets-lib/src/widgets/wallet/test-components/WalletWidgetTestComponent.tsx b/packages/checkout/widgets-lib/src/widgets/wallet/test-components/WalletWidgetTestComponent.tsx index d81d93cd79..8c0b80c232 100644 --- a/packages/checkout/widgets-lib/src/widgets/wallet/test-components/WalletWidgetTestComponent.tsx +++ b/packages/checkout/widgets-lib/src/widgets/wallet/test-components/WalletWidgetTestComponent.tsx @@ -1,5 +1,5 @@ import React, { useCallback, useMemo, useReducer } from 'react'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../../context/view-context/test-components/ViewContextTestComponent'; import { initialWalletState, WalletContext, diff --git a/packages/checkout/widgets-lib/src/widgets/wallet/views/Settings.tsx b/packages/checkout/widgets-lib/src/widgets/wallet/views/Settings.tsx index 5a34c29ed0..447b54e6ea 100644 --- a/packages/checkout/widgets-lib/src/widgets/wallet/views/Settings.tsx +++ b/packages/checkout/widgets-lib/src/widgets/wallet/views/Settings.tsx @@ -1,8 +1,8 @@ import { Box, Button } from '@biom3/react'; import { useContext, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { useWalletConnect } from 'lib/hooks/useWalletConnect'; -import { isWalletConnectProvider } from 'lib/provider'; +import { useWalletConnect } from '../../../lib/hooks/useWalletConnect'; +import { isWalletConnectProvider } from '../../../lib/provider'; import { FooterLogo } from '../../../components/Footer/FooterLogo'; import { HeaderNavigation } from '../../../components/Header/HeaderNavigation'; import { SimpleLayout } from '../../../components/SimpleLayout/SimpleLayout'; diff --git a/packages/checkout/widgets-lib/src/widgets/wallet/views/WalletBalances.cy.tsx b/packages/checkout/widgets-lib/src/widgets/wallet/views/WalletBalances.cy.tsx index 0fd0dd47cc..e887a6f78b 100644 --- a/packages/checkout/widgets-lib/src/widgets/wallet/views/WalletBalances.cy.tsx +++ b/packages/checkout/widgets-lib/src/widgets/wallet/views/WalletBalances.cy.tsx @@ -7,7 +7,7 @@ import { mount } from 'cypress/react18'; import { BigNumber } from 'ethers'; import { Web3Provider } from '@ethersproject/providers'; import { Environment } from '@imtbl/config'; -import { ViewContextTestComponent } from 'context/view-context/test-components/ViewContextTestComponent'; +import { ViewContextTestComponent } from '../../../context/view-context/test-components/ViewContextTestComponent'; import { WalletBalances } from './WalletBalances'; import { WalletContext, WalletState } from '../context/WalletContext'; import { cyIntercept, cySmartGet } from '../../../lib/testUtils'; diff --git a/packages/checkout/widgets-lib/src/widgets/wallet/views/WalletBalances.tsx b/packages/checkout/widgets-lib/src/widgets/wallet/views/WalletBalances.tsx index 1d96a417ea..2660653203 100644 --- a/packages/checkout/widgets-lib/src/widgets/wallet/views/WalletBalances.tsx +++ b/packages/checkout/widgets-lib/src/widgets/wallet/views/WalletBalances.tsx @@ -2,11 +2,11 @@ import { Box, ButtCon, MenuItem } from '@biom3/react'; import { useContext, useEffect, useMemo, useState, } from 'react'; -import { IMTBLWidgetEvents, WidgetTheme } from '@imtbl/checkout-sdk'; -import { fetchTokenSymbols } from 'lib/fetchTokenSymbols'; -import { CryptoFiatActions, CryptoFiatContext } from 'context/crypto-fiat-context/CryptoFiatContext'; -import { ButtonNavigationStyles } from 'components/Header/HeaderStyles'; import { useTranslation } from 'react-i18next'; +import { IMTBLWidgetEvents, WidgetTheme } from '@imtbl/checkout-sdk'; +import { fetchTokenSymbols } from '../../../lib/fetchTokenSymbols'; +import { CryptoFiatActions, CryptoFiatContext } from '../../../context/crypto-fiat-context/CryptoFiatContext'; +import { ButtonNavigationStyles } from '../../../components/Header/HeaderStyles'; import { FooterLogo } from '../../../components/Footer/FooterLogo'; import { HeaderNavigation } from '../../../components/Header/HeaderNavigation'; import { SimpleLayout } from '../../../components/SimpleLayout/SimpleLayout'; diff --git a/packages/internal/bridge/sdk/src/config/index.ts b/packages/internal/bridge/sdk/src/config/index.ts index e8a39052e2..9fd0454a2c 100644 --- a/packages/internal/bridge/sdk/src/config/index.ts +++ b/packages/internal/bridge/sdk/src/config/index.ts @@ -2,7 +2,7 @@ import { ETH_MAINNET_TO_ZKEVM_MAINNET, ETH_SEPOLIA_TO_ZKEVM_DEVNET, ETH_SEPOLIA_TO_ZKEVM_TESTNET, -} from 'constants/bridges'; +} from '../constants/bridges'; import { Environment, ImmutableConfiguration } from '@imtbl/config'; import { ethers } from 'ethers'; import { diff --git a/packages/internal/bridge/sdk/src/contracts/createContract.ts b/packages/internal/bridge/sdk/src/contracts/createContract.ts index 7f892a7d8e..ffac837070 100644 --- a/packages/internal/bridge/sdk/src/contracts/createContract.ts +++ b/packages/internal/bridge/sdk/src/contracts/createContract.ts @@ -1,5 +1,5 @@ import { Provider } from '@ethersproject/providers'; -import { BridgeErrorType, withBridgeError } from 'errors'; +import { BridgeErrorType, withBridgeError } from '../errors'; import { Contract } from 'ethers'; export async function createContract(address: string, iface: any, provider: Provider) { diff --git a/packages/internal/bridge/sdk/src/lib/axelarUtils.ts b/packages/internal/bridge/sdk/src/lib/axelarUtils.ts index 903f37412e..b861954731 100644 --- a/packages/internal/bridge/sdk/src/lib/axelarUtils.ts +++ b/packages/internal/bridge/sdk/src/lib/axelarUtils.ts @@ -1,11 +1,11 @@ import { Provider } from '@ethersproject/providers'; -import { Address } from 'types'; -import { WITHDRAW_SIG, NATIVE } from 'constants/bridges'; -import { CHILD_ERC20 } from 'contracts/ABIs/ChildERC20'; -import { withBridgeError, BridgeErrorType } from 'errors'; +import { Address } from '../types'; +import { WITHDRAW_SIG, NATIVE } from '../constants/bridges'; +import { CHILD_ERC20 } from '../contracts/ABIs/ChildERC20'; +import { withBridgeError, BridgeErrorType } from '../errors'; import { ethers } from 'ethers'; import { keccak256, defaultAbiCoder } from 'ethers/lib/utils'; -import { createContract } from 'contracts/createContract'; +import { createContract } from '../contracts/createContract'; import { isWrappedIMX, getRootIMX } from './utils'; /** diff --git a/packages/internal/bridge/sdk/src/lib/gmpRecovery.ts b/packages/internal/bridge/sdk/src/lib/gmpRecovery.ts index 189329bc23..61ee27db1e 100644 --- a/packages/internal/bridge/sdk/src/lib/gmpRecovery.ts +++ b/packages/internal/bridge/sdk/src/lib/gmpRecovery.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ import { GMPError, GMPStatus, GMPStatusResponse, GasPaidInfo, -} from 'types/axelar'; +} from '../types/axelar'; const parseGMPStatus = (response: any): GMPStatus | string => { const { error, status } = response; @@ -78,10 +78,10 @@ export const queryTransactionStatus = async ( const timeSpent: Record = txDetails.time_spent; if (timeSpent) { timeSpent.total = timeSpent.total - || Object.values(timeSpent).reduce( - (accumulator: number, value: number) => accumulator + value, - 0, - ); + || Object.values(timeSpent).reduce( + (accumulator: number, value: number) => accumulator + value, + 0, + ); } return { diff --git a/packages/internal/bridge/sdk/src/lib/tenderly.ts b/packages/internal/bridge/sdk/src/lib/tenderly.ts index ce9f7682b5..33f4bcd315 100644 --- a/packages/internal/bridge/sdk/src/lib/tenderly.ts +++ b/packages/internal/bridge/sdk/src/lib/tenderly.ts @@ -1,8 +1,8 @@ /* eslint-disable @typescript-eslint/naming-convention */ import axios, { AxiosResponse } from 'axios'; -import { BridgeError, BridgeErrorType } from 'errors'; -import { TenderlySimulation } from 'types/tenderly'; +import { BridgeError, BridgeErrorType } from '../errors'; +import { TenderlySimulation } from '../types/tenderly'; import { getTenderlyEndpoint } from './utils'; // TODO generate a type for these state objects. Readability could be improved from the double nested Record @@ -27,7 +27,7 @@ export async function submitTenderlySimulations( simulations: Array, state_objects?: Record>>, ): Promise> { - let axiosResponse:AxiosResponse; + let axiosResponse: AxiosResponse; const tenderlyAPI = getTenderlyEndpoint(chainId); try { axiosResponse = await axios.post( diff --git a/packages/internal/bridge/sdk/src/lib/utils.ts b/packages/internal/bridge/sdk/src/lib/utils.ts index 8f2560dd01..b7564c3073 100644 --- a/packages/internal/bridge/sdk/src/lib/utils.ts +++ b/packages/internal/bridge/sdk/src/lib/utils.ts @@ -8,14 +8,14 @@ import { tenderlyAPIEndpoints, childWIMXs, NATIVE, -} from 'constants/bridges'; +} from '../constants/bridges'; import { BridgeDirection, BridgeFeeActions, BridgeFeeRequest, BridgeInstance, FungibleToken, -} from 'types'; +} from '../types'; -function getAddresses(source:string, addresses:Record) { - let address:string; +function getAddresses(source: string, addresses: Record) { + let address: string; if (source === ETH_MAINNET_TO_ZKEVM_MAINNET.rootChainID || source === ETH_MAINNET_TO_ZKEVM_MAINNET.childChainID) { address = addresses.mainnet; @@ -60,11 +60,11 @@ export function getAxelarGateway(source: string) { return getAddresses(source, axelarGateways); } -export function getAxelarEndpoint(source:string) { +export function getAxelarEndpoint(source: string) { return getAddresses(source, axelarAPIEndpoints); } -export function getTenderlyEndpoint(source:string) { +export function getTenderlyEndpoint(source: string) { return getAddresses(source, tenderlyAPIEndpoints); } diff --git a/packages/internal/bridge/sdk/src/lib/validation.ts b/packages/internal/bridge/sdk/src/lib/validation.ts index f51d59e1ee..0821083231 100644 --- a/packages/internal/bridge/sdk/src/lib/validation.ts +++ b/packages/internal/bridge/sdk/src/lib/validation.ts @@ -1,9 +1,9 @@ import { ethers } from 'ethers'; import { BridgeBundledTxRequest, BridgeFeeActions, BridgeFeeRequest, FungibleToken, -} from 'types'; -import { NATIVE } from 'constants/bridges'; -import { createContract } from 'contracts/createContract'; +} from '../types'; +import { NATIVE } from '../constants/bridges'; +import { createContract } from '../contracts/createContract'; import { BridgeConfiguration } from '../config'; import { BridgeError, BridgeErrorType, withBridgeError } from '../errors'; import { diff --git a/packages/internal/bridge/sdk/src/tokenBridge.test.ts b/packages/internal/bridge/sdk/src/tokenBridge.test.ts index cc1b26c8a5..1aefde5f57 100644 --- a/packages/internal/bridge/sdk/src/tokenBridge.test.ts +++ b/packages/internal/bridge/sdk/src/tokenBridge.test.ts @@ -2,18 +2,17 @@ /* eslint-disable @typescript-eslint/dot-notation */ /* eslint-disable @typescript-eslint/naming-convention */ import { Environment, ImmutableConfiguration } from '@imtbl/config'; -import { TokenBridge } from 'tokenBridge'; -import { BridgeConfiguration } from 'config'; -import { ETH_SEPOLIA_TO_ZKEVM_TESTNET, NATIVE } from 'constants/bridges'; +import { BigNumber, ethers } from 'ethers'; +import { TokenBridge } from './tokenBridge'; +import { BridgeConfiguration } from './config'; +import { ETH_SEPOLIA_TO_ZKEVM_TESTNET, NATIVE } from './constants/bridges'; import { BridgeFeeActions, BridgeTxRequest, BridgeTxResponse, StatusResponse, -} from 'types'; -import { BigNumber, ethers } from 'ethers'; -import { BridgeError, BridgeErrorType } from 'errors'; -import { GMPStatus, GasPaidStatus } from 'types/axelar'; -import { queryTransactionStatus } from 'lib/gmpRecovery'; -import { ERC20 } from 'contracts/ABIs/ERC20'; -import { validateBridgeReqArgs, validateChainConfiguration, validateChainIds } from './lib/validation'; +} from './types'; +import { BridgeError, BridgeErrorType } from './errors'; +import { GMPStatus, GasPaidStatus } from './types/axelar'; +import { queryTransactionStatus } from './lib/gmpRecovery'; +import { ERC20 } from './contracts/ABIs/ERC20'; jest.mock('axios', () => ({ post: jest.fn().mockReturnValue({ @@ -21,13 +20,13 @@ jest.mock('axios', () => ({ }), })); -jest.mock('lib/gmpRecovery'); +jest.mock('./lib/gmpRecovery'); jest.mock('./lib/validation', () => ({ ...jest.requireActual('./lib/validation'), - validateChainConfiguration: async () => {}, - validateChainIds: async () => {}, - validateBridgeReqArgs: async () => {}, + validateChainConfiguration: async () => { }, + validateChainIds: async () => { }, + validateBridgeReqArgs: async () => { }, })); describe('Token Bridge', () => { @@ -387,11 +386,11 @@ describe('Token Bridge', () => { }, }; - const sourceChainGas:ethers.BigNumber = ethers.utils.parseUnits('0.000000000015', 18); - const approavalGas:ethers.BigNumber = ethers.utils.parseUnits('0.0000000000055', 18); - const bridgeFee:ethers.BigNumber = ethers.utils.parseUnits('0.0000000001', 18); - const imtblFee:ethers.BigNumber = ethers.BigNumber.from(0); - const totalFees:ethers.BigNumber = sourceChainGas.add(bridgeFee).add(imtblFee); + const sourceChainGas: ethers.BigNumber = ethers.utils.parseUnits('0.000000000015', 18); + const approavalGas: ethers.BigNumber = ethers.utils.parseUnits('0.0000000000055', 18); + const bridgeFee: ethers.BigNumber = ethers.utils.parseUnits('0.0000000001', 18); + const imtblFee: ethers.BigNumber = ethers.BigNumber.from(0); + const totalFees: ethers.BigNumber = sourceChainGas.add(bridgeFee).add(imtblFee); beforeEach(() => { const voidRootProvider = new ethers.providers.JsonRpcProvider('x'); diff --git a/packages/internal/bridge/sdk/src/tokenBridge.ts b/packages/internal/bridge/sdk/src/tokenBridge.ts index 0eefd16eb7..f252fd9c2c 100644 --- a/packages/internal/bridge/sdk/src/tokenBridge.ts +++ b/packages/internal/bridge/sdk/src/tokenBridge.ts @@ -5,11 +5,11 @@ import { ethers } from 'ethers'; import { concat, defaultAbiCoder, hexValue, hexlify, keccak256, zeroPad, } from 'ethers/lib/utils'; -import { ROOT_AXELAR_ADAPTOR } from 'contracts/ABIs/RootAxelarBridgeAdaptor'; +import { ROOT_AXELAR_ADAPTOR } from './contracts/ABIs/RootAxelarBridgeAdaptor'; import { checkReceiver, validateBridgeReqArgs, validateChainConfiguration, validateChainIds, validateGetFee, -} from 'lib/validation'; +} from './lib/validation'; import { getAxelarEndpoint, getAxelarGateway, getChildAdaptor, getChildchain, getRootAdaptor, isValidDeposit, @@ -19,12 +19,12 @@ import { isWithdrawWrappedIMX, isWrappedIMX, shouldBeDepositOrFinaliseWithdraw, -} from 'lib/utils'; -import { TenderlySimulation } from 'types/tenderly'; -import { calculateGasFee } from 'lib/gas'; -import { createContract } from 'contracts/createContract'; -import { getWithdrawRootToken, genAxelarWithdrawPayload, genUniqueAxelarCommandId } from 'lib/axelarUtils'; -import { submitTenderlySimulations } from 'lib/tenderly'; +} from './lib/utils'; +import { TenderlySimulation } from './types/tenderly'; +import { calculateGasFee } from './lib/gas'; +import { createContract } from './contracts/createContract'; +import { getWithdrawRootToken, genAxelarWithdrawPayload, genUniqueAxelarCommandId } from './lib/axelarUtils'; +import { submitTenderlySimulations } from './lib/tenderly'; import { NATIVE, ETHEREUM_NATIVE_TOKEN_ADDRESS, @@ -171,7 +171,7 @@ export class TokenBridge { } private async getDepositOrWithdrawFee(req: BridgeFeeRequest): - Promise<{ sourceChainFee: ethers.BigNumber, approvalFee: ethers.BigNumber, bridgeFee: ethers.BigNumber }> { + Promise<{ sourceChainFee: ethers.BigNumber, approvalFee: ethers.BigNumber, bridgeFee: ethers.BigNumber }> { let feeData; if (req.sourceChainId === this.config.bridgeInstance.rootChainID) { feeData = await this.config.rootProvider.getFeeData(); @@ -692,7 +692,7 @@ export class TokenBridge { ); const txValue = (token.toUpperCase() === NATIVE) ? amount.add(bridgeFee).toString() : bridgeFee.toString(); - const unsignedBridgeTx : ethers.providers.TransactionRequest = { + const unsignedBridgeTx: ethers.providers.TransactionRequest = { data: txData, to: this.config.bridgeContracts.rootERC20BridgeFlowRate, value: txValue, @@ -783,7 +783,7 @@ export class TokenBridge { ); const txValue = (token.toUpperCase() === NATIVE) ? amount.add(bridgeFee).toString() : bridgeFee.toString(); - const unsignedBridgeTx : ethers.providers.TransactionRequest = { + const unsignedBridgeTx: ethers.providers.TransactionRequest = { data: txData, to: this.config.bridgeContracts.rootERC20BridgeFlowRate, value: txValue, @@ -979,8 +979,8 @@ export class TokenBridge { destinationChainGaslimit: number, gasMultiplier: number | string = 'auto', ): Promise { - const sourceAxelar:AxelarChainDetails = axelarChains[sourceChainId]; - const destinationAxelar:AxelarChainDetails = axelarChains[destinationChainId]; + const sourceAxelar: AxelarChainDetails = axelarChains[sourceChainId]; + const destinationAxelar: AxelarChainDetails = axelarChains[destinationChainId]; if (!sourceAxelar) { throw new BridgeError( @@ -996,7 +996,7 @@ export class TokenBridge { ); } - const axelarAPIEndpoint:string = getAxelarEndpoint(sourceChainId); + const axelarAPIEndpoint: string = getAxelarEndpoint(sourceChainId); const estimateGasReq = { method: 'estimateGasFee', @@ -1007,7 +1007,7 @@ export class TokenBridge { gasMultiplier, }; - let axiosResponse:AxiosResponse; + let axiosResponse: AxiosResponse; try { axiosResponse = await axios.post(axelarAPIEndpoint, estimateGasReq); @@ -1040,7 +1040,7 @@ export class TokenBridge { * @throws {BridgeError} - If an error occurs during the query, a BridgeError will be thrown with a specific error type. */ public async getTransactionStatus(req: TxStatusRequest): Promise { - const txStatusResponse:TxStatusResponse = { + const txStatusResponse: TxStatusResponse = { transactions: [], }; @@ -1048,13 +1048,13 @@ export class TokenBridge { const uniqueReceivers = await this.getUniqueReceivers(txStatusItems, req.sourceChainId); - const pendingWithdrawalPromises:Array> = []; + const pendingWithdrawalPromises: Array> = []; for (const address of uniqueReceivers) { pendingWithdrawalPromises.push(this.getPendingWithdrawals({ recipient: address })); } - let pendingWithdrawalResponses:Array = []; + let pendingWithdrawalResponses: Array = []; try { pendingWithdrawalResponses = await Promise.all(pendingWithdrawalPromises); @@ -1098,10 +1098,10 @@ export class TokenBridge { } private async getUniqueReceivers( - txStatusItems:Array, + txStatusItems: Array, sourceChainId: string, ): Promise> { - const uniqueReceivers:Array = []; + const uniqueReceivers: Array = []; const isWithdraw = [ ZKEVM_DEVNET_CHAIN_ID, @@ -1122,12 +1122,12 @@ export class TokenBridge { } private async getAxelarStatus( - transactions:Array, - sourceChainId:string, + transactions: Array, + sourceChainId: string, ): Promise> { - const txStatusItems:Array = []; - const statusPromises:Array> = []; - const axelarAPIEndpoint:string = getAxelarEndpoint(sourceChainId); + const txStatusItems: Array = []; + const statusPromises: Array> = []; + const axelarAPIEndpoint: string = getAxelarEndpoint(sourceChainId); const unpaidGasStatus = [GasPaidStatus.GAS_UNPAID, GasPaidStatus.GAS_PAID_NOT_ENOUGH_GAS]; const abiCoder = new ethers.utils.AbiCoder(); @@ -1135,7 +1135,7 @@ export class TokenBridge { statusPromises.push(queryTransactionStatus(axelarAPIEndpoint, transaction.txHash)); } - let statusResponses:Array; + let statusResponses: Array; try { statusResponses = await Promise.all(statusPromises); } catch (err) { @@ -1238,7 +1238,7 @@ export class TokenBridge { contractPromises.push(rootBridge.flowRateBuckets(token)); contractPromises.push(rootBridge.largeTransferThresholds(token)); } - let contractPromisesRes:Array; + let contractPromisesRes: Array; try { contractPromisesRes = await Promise.all(contractPromises); } catch (err) { @@ -1312,11 +1312,11 @@ export class TokenBridge { indices.push(i); } - const pending:Array = await rootBridge.getPendingWithdrawals(req.recipient, indices); + const pending: Array = await rootBridge.getPendingWithdrawals(req.recipient, indices); const timestampNow = Math.floor(Date.now() / 1000); - const withdrawalDelay:ethers.BigNumber = await rootBridge.withdrawalDelay(); + const withdrawalDelay: ethers.BigNumber = await rootBridge.withdrawalDelay(); for (let i = 0, l = pending.length; i < l; i++) { const timeoutEnd = pending[i].timestamp.add(withdrawalDelay).toNumber(); @@ -1348,7 +1348,7 @@ export class TokenBridge { * @throws {BridgeError} - If an error occurs during the query, a BridgeError will be thrown with a specific error type. * @dev this SDK method is currently stubbed */ - public async getFlowRateWithdrawTx(req:FlowRateWithdrawRequest): Promise { + public async getFlowRateWithdrawTx(req: FlowRateWithdrawRequest): Promise { // eslint-disable-next-line no-console if (!req.recipient) { @@ -1368,8 +1368,8 @@ export class TokenBridge { const rootBridgeAddress = this.config.bridgeContracts.rootERC20BridgeFlowRate; const rootBridge = await createContract(rootBridgeAddress, ROOT_ERC20_BRIDGE_FLOW_RATE, this.config.rootProvider); - const pending:Array = await - rootBridge.getPendingWithdrawals(req.recipient, [req.index]); + const pending: Array = await + rootBridge.getPendingWithdrawals(req.recipient, [req.index]); if (pending[0].withdrawer === ethers.constants.AddressZero || pending[0].token === ethers.constants.AddressZero @@ -1381,7 +1381,7 @@ export class TokenBridge { ); } - const withdrawalDelay:ethers.BigNumber = await rootBridge.withdrawalDelay(); + const withdrawalDelay: ethers.BigNumber = await rootBridge.withdrawalDelay(); const timeoutEnd = pending[0].timestamp.add(withdrawalDelay).toNumber(); const timestampNow = Math.floor(Date.now() / 1000); @@ -1400,7 +1400,7 @@ export class TokenBridge { }; } - const data:string = await withBridgeError(async () => rootBridge.interface.encodeFunctionData( + const data: string = await withBridgeError(async () => rootBridge.interface.encodeFunctionData( 'finaliseQueuedWithdrawal', [req.recipient, req.index], ), BridgeErrorType.INTERNAL_ERROR); @@ -1438,7 +1438,7 @@ export class TokenBridge { // eslint-disable-next-line no-console if (req.rootToken.toUpperCase() === NATIVE - || req.rootToken === this.config.bridgeContracts.rootChainWrappedETH) { + || req.rootToken === this.config.bridgeContracts.rootChainWrappedETH) { const childBridgeAddress = this.config.bridgeContracts.childERC20Bridge; const childBridge = await createContract(childBridgeAddress, CHILD_ERC20_BRIDGE, this.config.childProvider); const childETHToken = await childBridge.childETHToken(); diff --git a/packages/internal/cryptofiat/src/config/index.ts b/packages/internal/cryptofiat/src/config/index.ts index b24f229b1b..c1990b85ab 100644 --- a/packages/internal/cryptofiat/src/config/index.ts +++ b/packages/internal/cryptofiat/src/config/index.ts @@ -1,5 +1,5 @@ import { ImmutableConfiguration } from '@imtbl/config'; -import { CryptoFiatModuleConfiguration } from 'types'; +import { CryptoFiatModuleConfiguration } from '../types'; /** * Class representing the configuration for the CryptoFiatModule. diff --git a/packages/internal/cryptofiat/src/cryptofiat.ts b/packages/internal/cryptofiat/src/cryptofiat.ts index 5349288efe..cc6889eb63 100644 --- a/packages/internal/cryptofiat/src/cryptofiat.ts +++ b/packages/internal/cryptofiat/src/cryptofiat.ts @@ -1,7 +1,7 @@ import { Environment, ImmutableConfiguration } from '@imtbl/config'; import axios from 'axios'; -import { CryptoFiatConfiguration } from 'config'; -import { CryptoFiatConvertParams, CryptoFiatConvertReturn } from 'types'; +import { CryptoFiatConfiguration } from './config'; +import { CryptoFiatConvertParams, CryptoFiatConvertReturn } from './types'; const CHECKOUT_API_BASE_URL = { [Environment.SANDBOX]: 'https://checkout-api.sandbox.immutable.com', diff --git a/packages/internal/dex/sdk/src/config/index.ts b/packages/internal/dex/sdk/src/config/index.ts index 5e5c0ba5b9..1573c1fc8e 100644 --- a/packages/internal/dex/sdk/src/config/index.ts +++ b/packages/internal/dex/sdk/src/config/index.ts @@ -1,6 +1,6 @@ import { Environment, ImmutableConfiguration } from '@imtbl/config'; -import { ChainNotSupportedError, InvalidConfigurationError } from 'errors'; -import { isValidNonZeroAddress } from 'lib'; +import { ChainNotSupportedError, InvalidConfigurationError } from '../errors'; +import { isValidNonZeroAddress } from '../lib'; import { ExchangeContracts, ExchangeModuleConfiguration, ExchangeOverrides, SecondaryFee, Chain } from '../types'; import { IMMUTABLE_TESTNET_CHAIN_ID, diff --git a/packages/internal/dex/sdk/src/constants/tokens/immutable-mainnet.ts b/packages/internal/dex/sdk/src/constants/tokens/immutable-mainnet.ts index 3bb380f975..f63c45046b 100644 --- a/packages/internal/dex/sdk/src/constants/tokens/immutable-mainnet.ts +++ b/packages/internal/dex/sdk/src/constants/tokens/immutable-mainnet.ts @@ -1,4 +1,4 @@ -import { IMMUTABLE_MAINNET_CHAIN_ID } from 'constants/chains'; +import { IMMUTABLE_MAINNET_CHAIN_ID } from '../chains'; import { ERC20, Native } from '../../types'; export const NATIVE_IMX_IMMUTABLE_MAINNET: Native = { diff --git a/packages/internal/dex/sdk/src/constants/tokens/immutable-testnet.ts b/packages/internal/dex/sdk/src/constants/tokens/immutable-testnet.ts index 592ce39142..fbb3fa2b58 100644 --- a/packages/internal/dex/sdk/src/constants/tokens/immutable-testnet.ts +++ b/packages/internal/dex/sdk/src/constants/tokens/immutable-testnet.ts @@ -1,4 +1,4 @@ -import { IMMUTABLE_TESTNET_CHAIN_ID } from 'constants/chains'; +import { IMMUTABLE_TESTNET_CHAIN_ID } from '../chains'; import { ERC20, Native } from '../../types'; export const NATIVE_IMX_IMMUTABLE_TESTNET: Native = { diff --git a/packages/internal/dex/sdk/src/exchange.getUnsignedSwapTxFromAmountIn.test.ts b/packages/internal/dex/sdk/src/exchange.getUnsignedSwapTxFromAmountIn.test.ts index 9328bb76e4..f3ed940151 100644 --- a/packages/internal/dex/sdk/src/exchange.getUnsignedSwapTxFromAmountIn.test.ts +++ b/packages/internal/dex/sdk/src/exchange.getUnsignedSwapTxFromAmountIn.test.ts @@ -6,7 +6,7 @@ import { ERC20__factory } from 'contracts/types/factories/ERC20__factory'; import { constants, utils } from 'ethers'; import { SecondaryFee } from 'types'; import { Environment } from '@imtbl/config'; -import { Router, addAmount, newAmount } from 'lib'; +import { Router, addAmount, newAmount } from './lib'; import { PaymentsExtended, SwapRouter } from '@uniswap/router-sdk'; import { WIMX__factory } from 'contracts/types'; import { AVERAGE_SECONDARY_FEE_EXTRA_GAS, IMMUTABLE_TESTNET_CHAIN_ID } from './constants'; diff --git a/packages/internal/dex/sdk/src/exchange.getUnsignedSwapTxFromAmountOut.test.ts b/packages/internal/dex/sdk/src/exchange.getUnsignedSwapTxFromAmountOut.test.ts index 28dcf83727..e8c9579164 100644 --- a/packages/internal/dex/sdk/src/exchange.getUnsignedSwapTxFromAmountOut.test.ts +++ b/packages/internal/dex/sdk/src/exchange.getUnsignedSwapTxFromAmountOut.test.ts @@ -4,7 +4,7 @@ import { BigNumber } from '@ethersproject/bignumber'; import { ethers } from 'ethers'; import { ERC20__factory, WIMX__factory } from 'contracts/types'; import { SwapRouter, PaymentsExtended } from '@uniswap/router-sdk'; -import { newAmount } from 'lib/utils'; +import { newAmount } from './lib/utils'; import { AVERAGE_SECONDARY_FEE_EXTRA_GAS } from './constants'; import { SecondaryFee } from './types'; import { Exchange } from './exchange'; diff --git a/packages/internal/dex/sdk/src/exchange.ts b/packages/internal/dex/sdk/src/exchange.ts index b0c4881175..de38a15202 100644 --- a/packages/internal/dex/sdk/src/exchange.ts +++ b/packages/internal/dex/sdk/src/exchange.ts @@ -1,14 +1,14 @@ import { BigNumber, ethers } from 'ethers'; import { TradeType } from '@uniswap/sdk-core'; import assert from 'assert'; -import { DuplicateAddressesError, InvalidAddressError, InvalidMaxHopsError, InvalidSlippageError } from 'errors'; -import { calculateGasFee, fetchGasPrice } from 'lib/transactionUtils/gas'; -import { getApproval, prepareApproval } from 'lib/transactionUtils/approval'; -import { getOurQuoteReqAmount, prepareUserQuote } from 'lib/transactionUtils/getQuote'; -import { Fees } from 'lib/fees'; -import { Multicall__factory, ImmutableSwapProxy__factory, WIMX__factory } from 'contracts/types'; -import { NativeTokenService } from 'lib/nativeTokenService'; -import { IMX_UNWRAP_GAS_COST, IMX_WRAP_GAS_COST } from 'constants/wrapping'; +import { DuplicateAddressesError, InvalidAddressError, InvalidMaxHopsError, InvalidSlippageError } from './errors'; +import { calculateGasFee, fetchGasPrice } from './lib/transactionUtils/gas'; +import { getApproval, prepareApproval } from './lib/transactionUtils/approval'; +import { getOurQuoteReqAmount, prepareUserQuote } from './lib/transactionUtils/getQuote'; +import { Fees } from './lib/fees'; +import { Multicall__factory, ImmutableSwapProxy__factory, WIMX__factory } from './contracts/types'; +import { NativeTokenService } from './lib/nativeTokenService'; +import { IMX_UNWRAP_GAS_COST, IMX_WRAP_GAS_COST } from './constants/wrapping'; import { DEFAULT_MAX_HOPS, DEFAULT_SLIPPAGE, MAX_MAX_HOPS, MIN_MAX_HOPS } from './constants'; import { Router } from './lib/router'; import { @@ -160,7 +160,7 @@ export class Exchange { tokenAmount: BigNumber, wimxInterface: ethers.utils.Interface, gasPrice: CoinAmount | null, - ) : Promise { + ): Promise { const calldata = wimxInterface.encodeFunctionData('withdraw', [tokenAmount]); const gasEstimate = ethers.BigNumber.from(IMX_UNWRAP_GAS_COST); @@ -186,7 +186,7 @@ export class Exchange { tokenAmount: BigNumber, wimxInterface: ethers.utils.Interface, gasPrice: CoinAmount | null, - ) : WrapUnwrapTransactionDetails { + ): WrapUnwrapTransactionDetails { const calldata = wimxInterface.encodeFunctionData('deposit'); const gasEstimate = ethers.BigNumber.from(IMX_WRAP_GAS_COST); diff --git a/packages/internal/dex/sdk/src/lib/fees.ts b/packages/internal/dex/sdk/src/lib/fees.ts index dcf659cfcb..37af63e214 100644 --- a/packages/internal/dex/sdk/src/lib/fees.ts +++ b/packages/internal/dex/sdk/src/lib/fees.ts @@ -1,6 +1,6 @@ -import { BASIS_POINT_PRECISION } from 'constants/router'; +import { BASIS_POINT_PRECISION } from '../constants/router'; import { BigNumber } from 'ethers'; -import { Coin, CoinAmount, SecondaryFee } from 'types'; +import { Coin, CoinAmount, SecondaryFee } from '../types'; import { addAmount, newAmount, subtractAmount } from './utils'; export class Fees { diff --git a/packages/internal/dex/sdk/src/lib/getQuotesForRoutes.ts b/packages/internal/dex/sdk/src/lib/getQuotesForRoutes.ts index 22a91e9670..5a93a12e6a 100644 --- a/packages/internal/dex/sdk/src/lib/getQuotesForRoutes.ts +++ b/packages/internal/dex/sdk/src/lib/getQuotesForRoutes.ts @@ -1,7 +1,7 @@ import { Route, SwapQuoter } from '@uniswap/v3-sdk'; import { TradeType, Token } from '@uniswap/sdk-core'; import { BigNumber, utils } from 'ethers'; -import { CoinAmount, ERC20 } from 'types'; +import { CoinAmount, ERC20 } from '../types'; import { newAmount, quoteReturnMapping, toCurrencyAmount, uniswapTokenToERC20, } from './utils'; diff --git a/packages/internal/dex/sdk/src/lib/nativeTokenService.ts b/packages/internal/dex/sdk/src/lib/nativeTokenService.ts index 159a12bc6f..8221e58dec 100644 --- a/packages/internal/dex/sdk/src/lib/nativeTokenService.ts +++ b/packages/internal/dex/sdk/src/lib/nativeTokenService.ts @@ -1,10 +1,10 @@ -import { Coin, CoinAmount, ERC20, Native } from 'types'; +import { Coin, CoinAmount, ERC20, Native } from '../types'; import { newAmount } from './utils'; export const canUnwrapToken = (token: Coin): token is Native => token.type === 'native'; export class NativeTokenService { - constructor(readonly nativeToken: Native, readonly wrappedToken: ERC20) {} + constructor(readonly nativeToken: Native, readonly wrappedToken: ERC20) { } wrapAmount(amount: CoinAmount): CoinAmount { return newAmount(amount.value, this.wrappedToken); diff --git a/packages/internal/dex/sdk/src/lib/poolUtils/fetchValidPools.ts b/packages/internal/dex/sdk/src/lib/poolUtils/fetchValidPools.ts index 5b2efb55ce..876ff23e48 100644 --- a/packages/internal/dex/sdk/src/lib/poolUtils/fetchValidPools.ts +++ b/packages/internal/dex/sdk/src/lib/poolUtils/fetchValidPools.ts @@ -1,8 +1,8 @@ import { Pool } from '@uniswap/v3-sdk'; import { BigNumber } from 'ethers'; -import { ProviderCallError } from 'errors'; -import { erc20ToUniswapToken } from 'lib/utils'; -import { ERC20 } from 'types'; +import { ProviderCallError } from '../../errors'; +import { erc20ToUniswapToken } from '../utils'; +import { ERC20 } from '../../types'; import { MulticallResponse, multicallSingleCallDataMultipleContracts } from '../multicall'; import { generatePossiblePoolsFromERC20Pair } from './generatePossiblePoolsFromERC20Pairs'; import { ERC20Pair } from './generateERC20Pairs'; diff --git a/packages/internal/dex/sdk/src/lib/poolUtils/generateAllAcyclicPaths.test.ts b/packages/internal/dex/sdk/src/lib/poolUtils/generateAllAcyclicPaths.test.ts index 655316c7c0..c8528d01e3 100644 --- a/packages/internal/dex/sdk/src/lib/poolUtils/generateAllAcyclicPaths.test.ts +++ b/packages/internal/dex/sdk/src/lib/poolUtils/generateAllAcyclicPaths.test.ts @@ -1,6 +1,6 @@ import { FeeAmount, Pool, TickMath } from '@uniswap/v3-sdk'; import { Token } from '@uniswap/sdk-core'; -import { uniswapTokenToERC20 } from 'lib/utils'; +import { uniswapTokenToERC20 } from '../utils'; import { generateAllAcyclicPaths } from '../router'; const token0 = new Token( @@ -255,8 +255,8 @@ describe('generateAllAcyclicPaths', () => { // token0 -> token1 -> token3 (2 pools) expect( route.pools.length === 4 - || route.pools.length === 3 - || route.pools.length === 2, + || route.pools.length === 3 + || route.pools.length === 2, ); if (route.pools.length === 4) { expect(route.pools[0].token0).toBe(token0); diff --git a/packages/internal/dex/sdk/src/lib/poolUtils/generateERC20Pairs.ts b/packages/internal/dex/sdk/src/lib/poolUtils/generateERC20Pairs.ts index 86e2980fb4..28661fd611 100644 --- a/packages/internal/dex/sdk/src/lib/poolUtils/generateERC20Pairs.ts +++ b/packages/internal/dex/sdk/src/lib/poolUtils/generateERC20Pairs.ts @@ -1,4 +1,4 @@ -import { ERC20 } from 'types'; +import { ERC20 } from '../../types'; export type Provider = { chainId: number; diff --git a/packages/internal/dex/sdk/src/lib/poolUtils/generatePossiblePoolsFromERC20Pairs.ts b/packages/internal/dex/sdk/src/lib/poolUtils/generatePossiblePoolsFromERC20Pairs.ts index a2610a70f8..b9707ec192 100644 --- a/packages/internal/dex/sdk/src/lib/poolUtils/generatePossiblePoolsFromERC20Pairs.ts +++ b/packages/internal/dex/sdk/src/lib/poolUtils/generatePossiblePoolsFromERC20Pairs.ts @@ -1,5 +1,5 @@ import { FeeAmount } from '@uniswap/v3-sdk'; -import { ERC20 } from 'types'; +import { ERC20 } from '../../types'; import { computePoolAddress } from './computePoolAddress'; import { generateERC20Pairs, diff --git a/packages/internal/dex/sdk/src/lib/router.ts b/packages/internal/dex/sdk/src/lib/router.ts index a92b3f63a9..16a3334c08 100644 --- a/packages/internal/dex/sdk/src/lib/router.ts +++ b/packages/internal/dex/sdk/src/lib/router.ts @@ -1,7 +1,7 @@ import { Token, TradeType } from '@uniswap/sdk-core'; import { Pool, Route } from '@uniswap/v3-sdk'; -import { NoRoutesAvailableError } from 'errors'; -import { CoinAmount, ERC20 } from 'types'; +import { NoRoutesAvailableError } from '../errors'; +import { CoinAmount, ERC20 } from '../types'; import { providers } from 'ethers'; import { erc20ToUniswapToken, poolEquals, uniswapTokenToERC20 } from './utils'; import { getQuotesForRoutes, QuoteResult } from './getQuotesForRoutes'; diff --git a/packages/internal/dex/sdk/src/lib/transactionUtils/approval.ts b/packages/internal/dex/sdk/src/lib/transactionUtils/approval.ts index e56377d050..986427b115 100644 --- a/packages/internal/dex/sdk/src/lib/transactionUtils/approval.ts +++ b/packages/internal/dex/sdk/src/lib/transactionUtils/approval.ts @@ -1,11 +1,11 @@ import { JsonRpcProvider, TransactionRequest } from '@ethersproject/providers'; import { BigNumber } from '@ethersproject/bignumber'; -import { ERC20__factory } from 'contracts/types/factories/ERC20__factory'; -import { ApproveError } from 'errors'; +import { ERC20__factory } from '../../contracts/types/factories/ERC20__factory'; +import { ApproveError } from '../../errors'; import { ethers } from 'ethers'; import { TradeType } from '@uniswap/sdk-core'; -import { isERC20Amount, toPublicAmount } from 'lib/utils'; -import { CoinAmount, Coin, ERC20, Native } from 'types'; +import { isERC20Amount, toPublicAmount } from '../utils'; +import { CoinAmount, Coin, ERC20, Native } from '../../types'; import { SecondaryFee, TransactionDetails } from '../../types'; import { calculateGasFee } from './gas'; diff --git a/packages/internal/dex/sdk/src/lib/transactionUtils/gas.test.ts b/packages/internal/dex/sdk/src/lib/transactionUtils/gas.test.ts index 074b650295..bc59b75a76 100644 --- a/packages/internal/dex/sdk/src/lib/transactionUtils/gas.test.ts +++ b/packages/internal/dex/sdk/src/lib/transactionUtils/gas.test.ts @@ -1,7 +1,7 @@ import { buildBlock, expectToBeDefined, formatAmount, NATIVE_TEST_TOKEN } from 'test/utils'; -import { newAmount } from 'lib/utils'; import { BigNumber, providers } from 'ethers'; -import { IMMUTABLE_TESTNET_RPC_URL, IMMUTABLE_TESTNET_CHAIN_ID } from 'constants/chains'; +import { newAmount } from '../utils'; +import { IMMUTABLE_TESTNET_RPC_URL, IMMUTABLE_TESTNET_CHAIN_ID } from '../../constants/chains'; import { calculateGasFee, fetchGasPrice } from './gas'; describe('calculateGasFee', () => { diff --git a/packages/internal/dex/sdk/src/lib/transactionUtils/gas.ts b/packages/internal/dex/sdk/src/lib/transactionUtils/gas.ts index 8a731d420a..7cddc9d9b8 100644 --- a/packages/internal/dex/sdk/src/lib/transactionUtils/gas.ts +++ b/packages/internal/dex/sdk/src/lib/transactionUtils/gas.ts @@ -1,6 +1,6 @@ import { BigNumber, providers } from 'ethers'; -import { newAmount } from 'lib'; -import { CoinAmount, Native } from 'types'; +import { newAmount } from '../utils'; +import { CoinAmount, Native } from '../../types'; import { AVERAGE_SECONDARY_FEE_EXTRA_GAS } from '../../constants'; type FeeData = { diff --git a/packages/internal/dex/sdk/src/lib/transactionUtils/getQuote.test.ts b/packages/internal/dex/sdk/src/lib/transactionUtils/getQuote.test.ts index 1deba4d923..37475c188e 100644 --- a/packages/internal/dex/sdk/src/lib/transactionUtils/getQuote.test.ts +++ b/packages/internal/dex/sdk/src/lib/transactionUtils/getQuote.test.ts @@ -1,7 +1,7 @@ import { BigNumber, ethers } from 'ethers'; import { TradeType } from '@uniswap/sdk-core'; import { Pool, Route } from '@uniswap/v3-sdk'; -import { Fees } from 'lib/fees'; +import { Fees } from '../fees'; import { newAmountFromString, expectERC20, @@ -11,9 +11,9 @@ import { makeAddr, WIMX_TEST_TOKEN, expectNative, -} from 'test/utils'; -import { QuoteResult } from 'lib/getQuotesForRoutes'; -import { erc20ToUniswapToken } from 'lib/utils'; +} from '../../test/utils'; +import { QuoteResult } from '../getQuotesForRoutes'; +import { erc20ToUniswapToken } from '../utils'; import { applySlippage, getOurQuoteReqAmount, prepareUserQuote } from './getQuote'; const DEFAULT_SLIPPAGE = 0.1; diff --git a/packages/internal/dex/sdk/src/lib/transactionUtils/getQuote.ts b/packages/internal/dex/sdk/src/lib/transactionUtils/getQuote.ts index ab4e202b19..0c2b9e55e1 100644 --- a/packages/internal/dex/sdk/src/lib/transactionUtils/getQuote.ts +++ b/packages/internal/dex/sdk/src/lib/transactionUtils/getQuote.ts @@ -1,10 +1,10 @@ import { TradeType } from '@uniswap/sdk-core'; import { ethers } from 'ethers'; -import { Fees } from 'lib/fees'; -import { QuoteResult } from 'lib/getQuotesForRoutes'; -import { NativeTokenService, canUnwrapToken } from 'lib/nativeTokenService'; -import { newAmount } from 'lib/utils'; -import { Coin, CoinAmount, ERC20 } from 'types'; +import { Fees } from '../fees'; +import { QuoteResult } from '../getQuotesForRoutes'; +import { NativeTokenService, canUnwrapToken } from '../nativeTokenService'; +import { newAmount } from '../utils'; +import { Coin, CoinAmount, ERC20 } from '../../types'; import { slippageToFraction } from './slippage'; export function getQuoteAmountFromTradeType(routerQuote: QuoteResult): CoinAmount { diff --git a/packages/internal/dex/sdk/src/lib/transactionUtils/swap.test.ts b/packages/internal/dex/sdk/src/lib/transactionUtils/swap.test.ts index e3af0af447..8975142fde 100644 --- a/packages/internal/dex/sdk/src/lib/transactionUtils/swap.test.ts +++ b/packages/internal/dex/sdk/src/lib/transactionUtils/swap.test.ts @@ -24,10 +24,10 @@ import { expectToBeString, } from 'test/utils'; import { Pool, Route } from '@uniswap/v3-sdk'; -import { Fees } from 'lib/fees'; -import { erc20ToUniswapToken, newAmount } from 'lib'; -import { QuoteResult } from 'lib/getQuotesForRoutes'; -import { Coin, ERC20 } from 'types'; +import { Fees } from '../fees'; +import { erc20ToUniswapToken, newAmount } from '../../lib'; +import { QuoteResult } from '../getQuotesForRoutes'; +import { Coin, ERC20 } from '../../types'; import { getSwap, adjustQuoteWithFees } from './swap'; const gasEstimate = BigNumber.from(0); diff --git a/packages/internal/dex/sdk/src/lib/transactionUtils/swap.ts b/packages/internal/dex/sdk/src/lib/transactionUtils/swap.ts index 4006b31b57..fda05ef087 100644 --- a/packages/internal/dex/sdk/src/lib/transactionUtils/swap.ts +++ b/packages/internal/dex/sdk/src/lib/transactionUtils/swap.ts @@ -1,14 +1,14 @@ import { Trade, toHex, encodeRouteToPath, Route } from '@uniswap/v3-sdk'; import { PaymentsExtended, SwapRouter } from '@uniswap/router-sdk'; import * as Uniswap from '@uniswap/sdk-core'; -import { Fees } from 'lib/fees'; -import { isNative, toCurrencyAmount, toPublicAmount } from 'lib/utils'; -import { QuoteResult } from 'lib/getQuotesForRoutes'; -import { NativeTokenService, canUnwrapToken } from 'lib/nativeTokenService'; -import { Coin, CoinAmount, Native } from 'types'; +import { Fees } from '../fees'; +import { isNative, toCurrencyAmount, toPublicAmount } from '../utils'; +import { QuoteResult } from '../getQuotesForRoutes'; +import { NativeTokenService, canUnwrapToken } from '../nativeTokenService'; +import { Coin, CoinAmount, Native } from '../../types'; import { Interface } from 'ethers/lib/utils'; -import { IImmutableSwapProxy, ImmutableSwapProxyInterface } from 'contracts/types/ImmutableSwapProxy'; -import { ImmutableSwapProxy__factory } from 'contracts/types'; +import { IImmutableSwapProxy, ImmutableSwapProxyInterface } from '../../contracts/types/ImmutableSwapProxy'; +import { ImmutableSwapProxy__factory } from '../../contracts/types'; import { SecondaryFee, TransactionDetails } from '../../types'; import { calculateGasFee } from './gas'; import { slippageToFraction } from './slippage'; diff --git a/packages/internal/dex/sdk/src/lib/utils.ts b/packages/internal/dex/sdk/src/lib/utils.ts index d5126b66bb..3e00a5da32 100644 --- a/packages/internal/dex/sdk/src/lib/utils.ts +++ b/packages/internal/dex/sdk/src/lib/utils.ts @@ -1,9 +1,9 @@ import { Pool } from '@uniswap/v3-sdk'; import * as Uniswap from '@uniswap/sdk-core'; import { ethers } from 'ethers'; -import { ProviderCallError } from 'errors'; -import { Amount, Coin, CoinAmount, ERC20, Native, Token } from 'types'; -import { DEFAULT_DEADLINE_SECONDS } from 'constants/router'; +import { ProviderCallError } from '../errors'; +import { Amount, Coin, CoinAmount, ERC20, Native, Token } from '../types'; +import { DEFAULT_DEADLINE_SECONDS } from '../constants/router'; export const quoteReturnMapping: { [signature: string]: string[] } = { // eslint-disable-next-line @typescript-eslint/naming-convention diff --git a/packages/internal/dex/sdk/src/test/utils.ts b/packages/internal/dex/sdk/src/test/utils.ts index ef2d4e1497..6506e95ea9 100644 --- a/packages/internal/dex/sdk/src/test/utils.ts +++ b/packages/internal/dex/sdk/src/test/utils.ts @@ -3,12 +3,12 @@ import { BigNumber, BigNumberish, utils, providers } from 'ethers'; import { Pool, Route, TickMath } from '@uniswap/v3-sdk'; import { SwapRouter } from '@uniswap/router-sdk'; import { Environment, ImmutableConfiguration } from '@imtbl/config'; -import { PromiseOrValue } from 'contracts/types/common'; -import { QuoteResult } from 'lib/getQuotesForRoutes'; -import { NativeTokenService } from 'lib/nativeTokenService'; -import { ExchangeModuleConfiguration, SecondaryFee, CoinAmount, Coin, ERC20, Native, Amount } from 'types'; -import { ImmutableSwapProxy__factory } from 'contracts/types'; -import { IV3SwapRouter } from 'contracts/types/ImmutableSwapProxy'; +import { PromiseOrValue } from '../contracts/types/common'; +import { QuoteResult } from '../lib/getQuotesForRoutes'; +import { NativeTokenService } from '../lib/nativeTokenService'; +import { ExchangeModuleConfiguration, SecondaryFee, CoinAmount, Coin, ERC20, Native, Amount } from '../types'; +import { ImmutableSwapProxy__factory } from '../contracts/types'; +import { IV3SwapRouter } from '../contracts/types/ImmutableSwapProxy'; import { erc20ToUniswapToken, newAmount, Router, RoutingContracts } from '../lib'; export const TEST_BASE_FEE = BigNumber.from('49'); // 49 wei @@ -481,7 +481,7 @@ export function expectToBeString(x: unknown): asserts x is string { // expectInstanceOf ensurance that a variable is an instance of a class, while // also narrowing its type. -export function expectInstanceOf(className: { new (...args: any[]): T }, x: unknown): asserts x is T { +export function expectInstanceOf(className: { new(...args: any[]): T }, x: unknown): asserts x is T { expect(x).toBeInstanceOf(className); } diff --git a/packages/internal/factory/sdk/src/config/index.ts b/packages/internal/factory/sdk/src/config/index.ts index ff165127e4..992ef6cab7 100644 --- a/packages/internal/factory/sdk/src/config/index.ts +++ b/packages/internal/factory/sdk/src/config/index.ts @@ -1,9 +1,9 @@ +import { Environment, ImmutableConfiguration } from '@imtbl/config'; +import { ethers } from 'ethers'; import { ZKEVM_DEVNET, ZKEVM_TESTNET, -} from 'constants/factory'; -import { Environment, ImmutableConfiguration } from '@imtbl/config'; -import { ethers } from 'ethers'; +} from '../constants/factory'; import { FactoryInstance, FactoryModuleConfiguration, } from '../types'; diff --git a/packages/internal/factory/sdk/src/constants/factory.ts b/packages/internal/factory/sdk/src/constants/factory.ts index ad94544bc8..26bb773b83 100644 --- a/packages/internal/factory/sdk/src/constants/factory.ts +++ b/packages/internal/factory/sdk/src/constants/factory.ts @@ -1,4 +1,4 @@ -import { FactoryInstance } from 'types'; +import { FactoryInstance } from '../types'; export const ZKEVM_DEVNET_CHAIN_ID = '13473'; export const ZKEVM_DEVNET_FACTORY_ADDRESS = '0xTODO'; diff --git a/packages/internal/factory/sdk/src/factory.ts b/packages/internal/factory/sdk/src/factory.ts index a8aa18d925..7641188091 100644 --- a/packages/internal/factory/sdk/src/factory.ts +++ b/packages/internal/factory/sdk/src/factory.ts @@ -1,8 +1,8 @@ -import { FactoryConfiguration } from 'config'; -import { PRESETS } from 'constants/presets'; -import { FactoryError, FactoryErrorType, withFactoryError } from 'errors'; import { ethers } from 'ethers'; -import { GetPresetsRequest, GetPresetsResponse } from 'types'; +import { FactoryConfiguration } from './config'; +import { PRESETS } from './constants/presets'; +import { FactoryError, FactoryErrorType, withFactoryError } from './errors'; +import { GetPresetsRequest, GetPresetsResponse } from './types'; /** * Represents a factory diff --git a/packages/internal/metrics/src/performance.ts b/packages/internal/metrics/src/performance.ts index e68bc542cb..138c5456d6 100644 --- a/packages/internal/metrics/src/performance.ts +++ b/packages/internal/metrics/src/performance.ts @@ -1,4 +1,4 @@ -import { errorBoundary } from 'utils/errorBoundary'; +import { errorBoundary } from './utils/errorBoundary'; import { track, TrackProperties } from './track'; type PerformanceEventProperties = diff --git a/packages/minting-backend/sdk/src/index.ts b/packages/minting-backend/sdk/src/index.ts index 4114e0eb51..31d818a251 100644 --- a/packages/minting-backend/sdk/src/index.ts +++ b/packages/minting-backend/sdk/src/index.ts @@ -2,7 +2,7 @@ import { ImmutableConfiguration, ModuleConfiguration } from '@imtbl/config'; import { BlockchainData } from '@imtbl/blockchain-data'; import { ZkevmMintRequestUpdated, handle } from '@imtbl/webhook'; import { setEnvironment, setPublishableApiKey } from '@imtbl/metrics'; -import { trackUncaughtException } from 'analytics'; +import { trackUncaughtException } from './analytics'; import { mintingPersistence as mintingPersistencePg } from './persistence/pg/postgres'; import { mintingPersistence as mintingPersistencePrismaSqlite } from './persistence/prismaSqlite/sqlite'; import { diff --git a/packages/orderbook/src/api-client/api-client.ts b/packages/orderbook/src/api-client/api-client.ts index 256f54b59b..80b6c911f1 100644 --- a/packages/orderbook/src/api-client/api-client.ts +++ b/packages/orderbook/src/api-client/api-client.ts @@ -7,7 +7,7 @@ import { ProtocolData, TradeResult, CancelOrdersResult, -} from 'openapi/sdk'; +} from '../openapi/sdk'; import { CreateListingParams, FeeType, @@ -24,16 +24,16 @@ export class ImmutableApiClient { private readonly orderbookService: OrdersService, private readonly chainName: string, private readonly seaportAddress: string, - ) {} + ) { } async fulfillmentData( requests: Array, ): Promise<{ - result: { - fulfillable_orders: Array; - unfulfillable_orders: Array; - }; - }> { + result: { + fulfillable_orders: Array; + unfulfillable_orders: Array; + }; + }> { return this.orderbookService.fulfillmentData({ chainName: this.chainName, requestBody: requests, @@ -98,7 +98,7 @@ export class ImmutableApiClient { } if (Number(orderComponents.offer[0].itemType) !== ItemType.ERC721 - && Number(orderComponents.offer[0].itemType) !== ItemType.ERC1155) { + && Number(orderComponents.offer[0].itemType) !== ItemType.ERC1155) { throw new Error('Only ERC721 / ERC1155 tokens can be listed'); } @@ -118,7 +118,7 @@ export class ImmutableApiClient { { type: Number(orderComponents.consideration[0].itemType) - === ItemType.NATIVE + === ItemType.NATIVE ? 'NATIVE' : 'ERC20', amount: orderComponents.consideration[0].startAmount, diff --git a/packages/orderbook/src/erc721/erc721-factory.ts b/packages/orderbook/src/erc721/erc721-factory.ts index 8b0bc7b734..ab332f12e9 100644 --- a/packages/orderbook/src/erc721/erc721-factory.ts +++ b/packages/orderbook/src/erc721/erc721-factory.ts @@ -1,5 +1,5 @@ import { providers } from 'ethers'; -import { ImmutableERC721Base__factory, ImmutableERC721Base } from 'typechain/types'; +import { ImmutableERC721Base__factory, ImmutableERC721Base } from '../typechain/types'; import { ERC721 } from './erc721'; export class ERC721Factory { diff --git a/packages/orderbook/src/seaport/seaport.ts b/packages/orderbook/src/seaport/seaport.ts index 0f2b22e377..f593d0646f 100644 --- a/packages/orderbook/src/seaport/seaport.ts +++ b/packages/orderbook/src/seaport/seaport.ts @@ -8,7 +8,7 @@ import { OrderUseCase, } from '@opensea/seaport-js/lib/types'; import { providers } from 'ethers'; -import { mapFromOpenApiOrder } from 'openapi/mapper'; +import { mapFromOpenApiOrder } from '../openapi/mapper'; import { Action, ActionType, @@ -42,7 +42,7 @@ export class Seaport { private seaportContractAddress: string, private zoneContractAddress: string, private rateLimitingKey?: string, - ) {} + ) { } async prepareSeaportOrder( offerer: string, @@ -176,9 +176,9 @@ export class Seaport { }[], account: string, ): Promise<{ - actions: Action[]; - expiration: string; - }> { + actions: Action[]; + expiration: string; + }> { const fulfillOrderDetails = fulfillingOrders.map((o) => { const { orderComponents, tips } = mapImmutableOrderToSeaportOrderComponents(o.order); diff --git a/packages/orderbook/src/seaport/transaction.ts b/packages/orderbook/src/seaport/transaction.ts index 4cf536bfbe..ce58f2b8ab 100644 --- a/packages/orderbook/src/seaport/transaction.ts +++ b/packages/orderbook/src/seaport/transaction.ts @@ -1,6 +1,6 @@ import { TransactionMethods } from '@opensea/seaport-js/lib/utils/usecase'; import { PopulatedTransaction, BigNumber } from 'ethers'; -import { TransactionBuilder } from 'types'; +import { TransactionBuilder } from '../types'; // Add 20% more gas than estimate to prevent out of gas errors // This can always be overwritten by the user signing the transaction diff --git a/packages/orderbook/src/test/cancel.e2e.ts b/packages/orderbook/src/test/cancel.e2e.ts index a357e38040..5ccea1020f 100644 --- a/packages/orderbook/src/test/cancel.e2e.ts +++ b/packages/orderbook/src/test/cancel.e2e.ts @@ -1,7 +1,7 @@ import { Wallet } from 'ethers'; import { Environment } from '@imtbl/config'; import { OrderStatusName } from 'openapi/sdk'; -import { Orderbook } from 'orderbook'; +import { Orderbook } from '../orderbook'; import { getLocalhostProvider } from './helpers/provider'; import { getOffererWallet } from './helpers/signers'; import { deployTestToken } from './helpers/erc721'; diff --git a/packages/passport/sdk/src/authManager.ts b/packages/passport/sdk/src/authManager.ts index 9fab622be1..5c1443ffe3 100644 --- a/packages/passport/sdk/src/authManager.ts +++ b/packages/passport/sdk/src/authManager.ts @@ -8,7 +8,7 @@ import { WebStorageStateStore, } from 'oidc-client-ts'; import axios from 'axios'; -import DeviceCredentialsManager from 'storage/device_credentials_manager'; +import DeviceCredentialsManager from './storage/device_credentials_manager'; import * as crypto from 'crypto'; import jwt_decode from 'jwt-decode'; import { getDetail, Detail } from '@imtbl/metrics'; diff --git a/packages/passport/sdk/src/guardian/index.ts b/packages/passport/sdk/src/guardian/index.ts index 01bd7c866d..7c050e942b 100644 --- a/packages/passport/sdk/src/guardian/index.ts +++ b/packages/passport/sdk/src/guardian/index.ts @@ -1,7 +1,7 @@ import * as guardian from '@imtbl/guardian'; import { TransactionApprovalRequestChainTypeEnum, TransactionEvaluationResponse } from '@imtbl/guardian'; import { BigNumber, ethers } from 'ethers'; -import { PassportError, PassportErrorType } from 'errors/passportError'; +import { PassportError, PassportErrorType } from '../errors/passportError'; import AuthManager from '../authManager'; import { ConfirmationScreen } from '../confirmation'; import { retryWithDelay } from '../network/retry'; @@ -229,7 +229,7 @@ export default class GuardianClient { } private async evaluateMessage( - { chainID, payload }:GuardianMessageValidationParams, + { chainID, payload }: GuardianMessageValidationParams, ): Promise { try { const user = await this.authManager.getUserZkEvm(); diff --git a/packages/passport/sdk/src/mocks/zkEvm/msw.ts b/packages/passport/sdk/src/mocks/zkEvm/msw.ts index 82db8b4ed7..d9628e2cd3 100644 --- a/packages/passport/sdk/src/mocks/zkEvm/msw.ts +++ b/packages/passport/sdk/src/mocks/zkEvm/msw.ts @@ -1,7 +1,7 @@ import 'cross-fetch/polyfill'; import { RequestHandler, rest } from 'msw'; import { SetupServer, setupServer } from 'msw/node'; -import { ChainName } from 'network/chains'; +import { ChainName } from '../../network/chains'; import { RelayerTransactionRequest } from '../../zkEvm/relayerClient'; import { JsonRpcRequestPayload } from '../../zkEvm/types'; import { chainId, chainIdHex, mockUserZkEvm } from '../../test/mocks'; diff --git a/packages/passport/sdk/src/overlay/index.ts b/packages/passport/sdk/src/overlay/index.ts index 4c8e3a857d..771d5cd4bf 100644 --- a/packages/passport/sdk/src/overlay/index.ts +++ b/packages/passport/sdk/src/overlay/index.ts @@ -1,4 +1,4 @@ -import { PopupOverlayOptions } from 'types'; +import { PopupOverlayOptions } from '../types'; import { PASSPORT_OVERLAY_CLOSE_ID, PASSPORT_OVERLAY_TRY_AGAIN_ID } from './constants'; import { addLink, getBlockedOverlay, getGenericOverlay } from './elements'; diff --git a/packages/passport/sdk/src/starkEx/workflows/order.ts b/packages/passport/sdk/src/starkEx/workflows/order.ts index d8381f7716..178fda2302 100644 --- a/packages/passport/sdk/src/starkEx/workflows/order.ts +++ b/packages/passport/sdk/src/starkEx/workflows/order.ts @@ -4,7 +4,7 @@ import { UnsignedOrderRequest, } from '@imtbl/x-client'; import { convertToSignableToken } from '@imtbl/toolkit'; -import { PassportErrorType, withPassportError } from 'errors/passportError'; +import { PassportErrorType, withPassportError } from '../../errors/passportError'; import { UserImx } from '../../types'; import GuardianClient from '../../guardian'; diff --git a/packages/passport/sdk/src/starkEx/workflows/registerOffchain.ts b/packages/passport/sdk/src/starkEx/workflows/registerOffchain.ts index 6ca4594976..486a2c5861 100644 --- a/packages/passport/sdk/src/starkEx/workflows/registerOffchain.ts +++ b/packages/passport/sdk/src/starkEx/workflows/registerOffchain.ts @@ -1,8 +1,8 @@ import { EthSigner, StarkSigner } from '@imtbl/x-client'; -import AuthManager from 'authManager'; -import { PassportErrorType, withPassportError } from 'errors/passportError'; -import { retryWithDelay } from 'network/retry'; -import { User } from 'types'; +import AuthManager from '../../authManager'; +import { PassportErrorType, withPassportError } from '../../errors/passportError'; +import { retryWithDelay } from '../../network/retry'; +import { User } from '../../types'; import axios from 'axios'; import { ImxApiClients, imx } from '@imtbl/generated-clients'; import registerPassportStarkEx from './registration'; diff --git a/packages/passport/sdk/src/starkEx/workflows/transfer.ts b/packages/passport/sdk/src/starkEx/workflows/transfer.ts index 8cd060b9dc..6934e66a4a 100644 --- a/packages/passport/sdk/src/starkEx/workflows/transfer.ts +++ b/packages/passport/sdk/src/starkEx/workflows/transfer.ts @@ -5,7 +5,7 @@ import { UnsignedTransferRequest, } from '@imtbl/x-client'; import { convertToSignableToken } from '@imtbl/toolkit'; -import { PassportErrorType, withPassportError } from 'errors/passportError'; +import { PassportErrorType, withPassportError } from '../../errors/passportError'; import { UserImx } from '../../types'; import GuardianClient from '../../guardian'; diff --git a/packages/passport/sdk/src/storage/device_credentials_manager.ts b/packages/passport/sdk/src/storage/device_credentials_manager.ts index 74303562e0..fabe553e7c 100644 --- a/packages/passport/sdk/src/storage/device_credentials_manager.ts +++ b/packages/passport/sdk/src/storage/device_credentials_manager.ts @@ -1,5 +1,5 @@ /* eslint-disable class-methods-use-this */ -import { DeviceTokenResponse, TokenPayload, PKCEData } from 'types'; +import { DeviceTokenResponse, TokenPayload, PKCEData } from '../types'; import jwt_decode from 'jwt-decode'; const KEY_PKCE_STATE = 'pkce_state'; diff --git a/packages/passport/sdk/src/utils/token.ts b/packages/passport/sdk/src/utils/token.ts index 34f6a77fad..68b8d4ff0e 100644 --- a/packages/passport/sdk/src/utils/token.ts +++ b/packages/passport/sdk/src/utils/token.ts @@ -1,4 +1,4 @@ -import { IdTokenPayload } from 'types'; +import { IdTokenPayload } from '../types'; import jwt_decode from 'jwt-decode'; import { User as OidcUser, diff --git a/packages/passport/sdk/src/zkEvm/index.ts b/packages/passport/sdk/src/zkEvm/index.ts index 1d987d5b6b..dc754ac16e 100644 --- a/packages/passport/sdk/src/zkEvm/index.ts +++ b/packages/passport/sdk/src/zkEvm/index.ts @@ -1,2 +1,2 @@ export * from './zkEvmProvider'; -export * from 'types'; +export * from './types'; diff --git a/packages/passport/sdk/src/zkEvm/relayerClient.ts b/packages/passport/sdk/src/zkEvm/relayerClient.ts index ddc998c5fa..00974cd9a0 100644 --- a/packages/passport/sdk/src/zkEvm/relayerClient.ts +++ b/packages/passport/sdk/src/zkEvm/relayerClient.ts @@ -1,6 +1,6 @@ import { BytesLike } from 'ethers'; import { StaticJsonRpcProvider } from '@ethersproject/providers'; -import AuthManager from 'authManager'; +import AuthManager from '../authManager'; import { trackDuration } from '@imtbl/metrics'; import { PassportConfiguration } from '../config'; import { FeeOption, RelayerTransaction, TypedDataPayload } from './types'; diff --git a/packages/passport/sdk/src/zkEvm/signTypedDataV4.ts b/packages/passport/sdk/src/zkEvm/signTypedDataV4.ts index 007f8a4183..a54f173a61 100644 --- a/packages/passport/sdk/src/zkEvm/signTypedDataV4.ts +++ b/packages/passport/sdk/src/zkEvm/signTypedDataV4.ts @@ -1,6 +1,6 @@ import { StaticJsonRpcProvider } from '@ethersproject/providers'; import { BigNumber } from 'ethers'; -import GuardianClient from 'guardian'; +import GuardianClient from '../guardian'; import { Signer } from '@ethersproject/abstract-signer'; import { Flow } from '@imtbl/metrics'; import { getSignedTypedData } from './walletHelpers'; diff --git a/packages/passport/sdk/src/zkEvm/user/registerZkEvmUser.ts b/packages/passport/sdk/src/zkEvm/user/registerZkEvmUser.ts index 3824d36f22..5a0564643b 100644 --- a/packages/passport/sdk/src/zkEvm/user/registerZkEvmUser.ts +++ b/packages/passport/sdk/src/zkEvm/user/registerZkEvmUser.ts @@ -1,7 +1,7 @@ import { StaticJsonRpcProvider } from '@ethersproject/providers'; import { MultiRollupApiClients } from '@imtbl/generated-clients'; import { signRaw } from '@imtbl/toolkit'; -import { getEip155ChainId } from 'zkEvm/walletHelpers'; +import { getEip155ChainId } from '../walletHelpers'; import { Signer } from '@ethersproject/abstract-signer'; import { Flow } from '@imtbl/metrics'; import AuthManager from '../../authManager'; diff --git a/packages/passport/sdk/tsconfig.json b/packages/passport/sdk/tsconfig.json index c6422d18fa..159608e1a8 100644 --- a/packages/passport/sdk/tsconfig.json +++ b/packages/passport/sdk/tsconfig.json @@ -25,3 +25,6 @@ "src/modules/checkout" ] } + +// check out these excludes +// remove all tsconfig.json files from the pacakges \ No newline at end of file From 989b0c9620f1d518caa4c88eb33fc927c47ad1b3 Mon Sep 17 00:00:00 2001 From: Shine Li Date: Wed, 19 Jun 2024 10:08:05 +1000 Subject: [PATCH 2/8] remove comments --- packages/passport/sdk/tsconfig.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/passport/sdk/tsconfig.json b/packages/passport/sdk/tsconfig.json index 159608e1a8..c6422d18fa 100644 --- a/packages/passport/sdk/tsconfig.json +++ b/packages/passport/sdk/tsconfig.json @@ -25,6 +25,3 @@ "src/modules/checkout" ] } - -// check out these excludes -// remove all tsconfig.json files from the pacakges \ No newline at end of file From 9f597159619b2656446a34db064bbe80fbfb6f14 Mon Sep 17 00:00:00 2001 From: Shine Li Date: Wed, 19 Jun 2024 16:54:21 +1000 Subject: [PATCH 3/8] fix type error --- .../context/crypto-fiat-context/CryptoFiatContext.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/checkout/widgets-lib/src/context/crypto-fiat-context/CryptoFiatContext.test.ts b/packages/checkout/widgets-lib/src/context/crypto-fiat-context/CryptoFiatContext.test.ts index 79f8a7a9e1..0ac4d86912 100644 --- a/packages/checkout/widgets-lib/src/context/crypto-fiat-context/CryptoFiatContext.test.ts +++ b/packages/checkout/widgets-lib/src/context/crypto-fiat-context/CryptoFiatContext.test.ts @@ -1,4 +1,5 @@ import { CryptoFiat, CryptoFiatConfiguration } from '@imtbl/cryptofiat'; +import { Environment } from '@imtbl/config'; import { CryptoFiatActions, FiatSymbols, @@ -14,7 +15,11 @@ describe('CryptoFiatContext', () => { it('should update state with cryptoFiat when reducer called with SET_CRYPTO_FIAT action', () => { const setCryptoFiatPayload: SetCryptoFiatPayload = { type: CryptoFiatActions.SET_CRYPTO_FIAT, - cryptoFiat: new CryptoFiat(new CryptoFiatConfiguration({})), + cryptoFiat: new CryptoFiat(new CryptoFiatConfiguration({ + baseConfig: { + environment: Environment.SANDBOX, + }, + })), }; expect(initialCryptoFiatState.cryptoFiat).toBeNull(); From 333a1204c44280bb3b11a55effedaa88ff672481 Mon Sep 17 00:00:00 2001 From: Shine Li Date: Wed, 19 Jun 2024 16:58:29 +1000 Subject: [PATCH 4/8] linting --- packages/internal/bridge/sdk/src/config/index.ts | 4 ++-- packages/internal/bridge/sdk/src/contracts/createContract.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/internal/bridge/sdk/src/config/index.ts b/packages/internal/bridge/sdk/src/config/index.ts index 9fd0454a2c..f2e0362901 100644 --- a/packages/internal/bridge/sdk/src/config/index.ts +++ b/packages/internal/bridge/sdk/src/config/index.ts @@ -1,10 +1,10 @@ +import { Environment, ImmutableConfiguration } from '@imtbl/config'; +import { ethers } from 'ethers'; import { ETH_MAINNET_TO_ZKEVM_MAINNET, ETH_SEPOLIA_TO_ZKEVM_DEVNET, ETH_SEPOLIA_TO_ZKEVM_TESTNET, } from '../constants/bridges'; -import { Environment, ImmutableConfiguration } from '@imtbl/config'; -import { ethers } from 'ethers'; import { BridgeContracts, BridgeInstance, diff --git a/packages/internal/bridge/sdk/src/contracts/createContract.ts b/packages/internal/bridge/sdk/src/contracts/createContract.ts index ffac837070..9888be1c83 100644 --- a/packages/internal/bridge/sdk/src/contracts/createContract.ts +++ b/packages/internal/bridge/sdk/src/contracts/createContract.ts @@ -1,6 +1,6 @@ import { Provider } from '@ethersproject/providers'; -import { BridgeErrorType, withBridgeError } from '../errors'; import { Contract } from 'ethers'; +import { BridgeErrorType, withBridgeError } from '../errors'; export async function createContract(address: string, iface: any, provider: Provider) { return await withBridgeError( From ffbc5f4199bc3a0ace0e3587acc1538514d56581 Mon Sep 17 00:00:00 2001 From: Shine Li Date: Thu, 20 Jun 2024 09:51:27 +1000 Subject: [PATCH 5/8] linting --- packages/passport/sdk/src/authManager.ts | 2 +- .../passport/sdk/src/starkEx/workflows/registerOffchain.ts | 4 ++-- .../passport/sdk/src/storage/device_credentials_manager.ts | 2 +- packages/passport/sdk/src/utils/token.ts | 2 +- packages/passport/sdk/src/zkEvm/relayerClient.ts | 2 +- packages/passport/sdk/src/zkEvm/signTypedDataV4.ts | 2 +- packages/passport/sdk/src/zkEvm/user/registerZkEvmUser.ts | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/passport/sdk/src/authManager.ts b/packages/passport/sdk/src/authManager.ts index 5c1443ffe3..0f94447b39 100644 --- a/packages/passport/sdk/src/authManager.ts +++ b/packages/passport/sdk/src/authManager.ts @@ -8,10 +8,10 @@ import { WebStorageStateStore, } from 'oidc-client-ts'; import axios from 'axios'; -import DeviceCredentialsManager from './storage/device_credentials_manager'; import * as crypto from 'crypto'; import jwt_decode from 'jwt-decode'; import { getDetail, Detail } from '@imtbl/metrics'; +import DeviceCredentialsManager from './storage/device_credentials_manager'; import logger from './utils/logger'; import { isTokenExpired } from './utils/token'; import { PassportError, PassportErrorType, withPassportError } from './errors/passportError'; diff --git a/packages/passport/sdk/src/starkEx/workflows/registerOffchain.ts b/packages/passport/sdk/src/starkEx/workflows/registerOffchain.ts index 486a2c5861..794efa0445 100644 --- a/packages/passport/sdk/src/starkEx/workflows/registerOffchain.ts +++ b/packages/passport/sdk/src/starkEx/workflows/registerOffchain.ts @@ -1,10 +1,10 @@ +import axios from 'axios'; +import { ImxApiClients, imx } from '@imtbl/generated-clients'; import { EthSigner, StarkSigner } from '@imtbl/x-client'; import AuthManager from '../../authManager'; import { PassportErrorType, withPassportError } from '../../errors/passportError'; import { retryWithDelay } from '../../network/retry'; import { User } from '../../types'; -import axios from 'axios'; -import { ImxApiClients, imx } from '@imtbl/generated-clients'; import registerPassportStarkEx from './registration'; async function forceUserRefresh(authManager: AuthManager) { diff --git a/packages/passport/sdk/src/storage/device_credentials_manager.ts b/packages/passport/sdk/src/storage/device_credentials_manager.ts index fabe553e7c..99977079f1 100644 --- a/packages/passport/sdk/src/storage/device_credentials_manager.ts +++ b/packages/passport/sdk/src/storage/device_credentials_manager.ts @@ -1,6 +1,6 @@ /* eslint-disable class-methods-use-this */ -import { DeviceTokenResponse, TokenPayload, PKCEData } from '../types'; import jwt_decode from 'jwt-decode'; +import { DeviceTokenResponse, TokenPayload, PKCEData } from '../types'; const KEY_PKCE_STATE = 'pkce_state'; const KEY_PKCE_VERIFIER = 'pkce_verifier'; diff --git a/packages/passport/sdk/src/utils/token.ts b/packages/passport/sdk/src/utils/token.ts index 68b8d4ff0e..2d39048764 100644 --- a/packages/passport/sdk/src/utils/token.ts +++ b/packages/passport/sdk/src/utils/token.ts @@ -1,8 +1,8 @@ -import { IdTokenPayload } from '../types'; import jwt_decode from 'jwt-decode'; import { User as OidcUser, } from 'oidc-client-ts'; +import { IdTokenPayload } from '../types'; export function isIdTokenExpired(idToken: string | undefined): boolean { if (!idToken) { diff --git a/packages/passport/sdk/src/zkEvm/relayerClient.ts b/packages/passport/sdk/src/zkEvm/relayerClient.ts index eb68793ce6..2a66400114 100644 --- a/packages/passport/sdk/src/zkEvm/relayerClient.ts +++ b/packages/passport/sdk/src/zkEvm/relayerClient.ts @@ -1,7 +1,7 @@ import { BytesLike } from 'ethers'; import { StaticJsonRpcProvider } from '@ethersproject/providers'; -import AuthManager from '../authManager'; import { trackDuration } from '@imtbl/metrics'; +import AuthManager from '../authManager'; import { PassportConfiguration } from '../config'; import { FeeOption, RelayerTransaction, TypedDataPayload } from './types'; import { getEip155ChainId } from './walletHelpers'; diff --git a/packages/passport/sdk/src/zkEvm/signTypedDataV4.ts b/packages/passport/sdk/src/zkEvm/signTypedDataV4.ts index 7007ea6bd3..92c4046a8b 100644 --- a/packages/passport/sdk/src/zkEvm/signTypedDataV4.ts +++ b/packages/passport/sdk/src/zkEvm/signTypedDataV4.ts @@ -1,8 +1,8 @@ import { StaticJsonRpcProvider } from '@ethersproject/providers'; import { BigNumber } from 'ethers'; -import GuardianClient from '../guardian'; import { Signer } from '@ethersproject/abstract-signer'; import { Flow } from '@imtbl/metrics'; +import GuardianClient from '../guardian'; import { signAndPackTypedData } from './walletHelpers'; import { TypedDataPayload } from './types'; import { JsonRpcError, RpcErrorCode } from './JsonRpcError'; diff --git a/packages/passport/sdk/src/zkEvm/user/registerZkEvmUser.ts b/packages/passport/sdk/src/zkEvm/user/registerZkEvmUser.ts index 5a0564643b..62f0ae0576 100644 --- a/packages/passport/sdk/src/zkEvm/user/registerZkEvmUser.ts +++ b/packages/passport/sdk/src/zkEvm/user/registerZkEvmUser.ts @@ -1,9 +1,9 @@ import { StaticJsonRpcProvider } from '@ethersproject/providers'; import { MultiRollupApiClients } from '@imtbl/generated-clients'; import { signRaw } from '@imtbl/toolkit'; -import { getEip155ChainId } from '../walletHelpers'; import { Signer } from '@ethersproject/abstract-signer'; import { Flow } from '@imtbl/metrics'; +import { getEip155ChainId } from '../walletHelpers'; import AuthManager from '../../authManager'; import { JsonRpcError, RpcErrorCode } from '../JsonRpcError'; From 780948b761b4ea5694f94ad75569d920caf668b5 Mon Sep 17 00:00:00 2001 From: Shine Li Date: Thu, 20 Jun 2024 10:35:01 +1000 Subject: [PATCH 6/8] linting --- .../sdk/src/exchange.getUnsignedSwapTxFromAmountIn.test.ts | 2 +- packages/internal/dex/sdk/src/lib/fees.ts | 2 +- packages/internal/dex/sdk/src/lib/router.ts | 2 +- .../internal/dex/sdk/src/lib/transactionUtils/approval.ts | 7 +++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/internal/dex/sdk/src/exchange.getUnsignedSwapTxFromAmountIn.test.ts b/packages/internal/dex/sdk/src/exchange.getUnsignedSwapTxFromAmountIn.test.ts index f3ed940151..f07261d718 100644 --- a/packages/internal/dex/sdk/src/exchange.getUnsignedSwapTxFromAmountIn.test.ts +++ b/packages/internal/dex/sdk/src/exchange.getUnsignedSwapTxFromAmountIn.test.ts @@ -6,9 +6,9 @@ import { ERC20__factory } from 'contracts/types/factories/ERC20__factory'; import { constants, utils } from 'ethers'; import { SecondaryFee } from 'types'; import { Environment } from '@imtbl/config'; -import { Router, addAmount, newAmount } from './lib'; import { PaymentsExtended, SwapRouter } from '@uniswap/router-sdk'; import { WIMX__factory } from 'contracts/types'; +import { Router, addAmount, newAmount } from './lib'; import { AVERAGE_SECONDARY_FEE_EXTRA_GAS, IMMUTABLE_TESTNET_CHAIN_ID } from './constants'; import { Exchange } from './exchange'; import { diff --git a/packages/internal/dex/sdk/src/lib/fees.ts b/packages/internal/dex/sdk/src/lib/fees.ts index 37af63e214..d1fcf46d81 100644 --- a/packages/internal/dex/sdk/src/lib/fees.ts +++ b/packages/internal/dex/sdk/src/lib/fees.ts @@ -1,5 +1,5 @@ -import { BASIS_POINT_PRECISION } from '../constants/router'; import { BigNumber } from 'ethers'; +import { BASIS_POINT_PRECISION } from '../constants/router'; import { Coin, CoinAmount, SecondaryFee } from '../types'; import { addAmount, newAmount, subtractAmount } from './utils'; diff --git a/packages/internal/dex/sdk/src/lib/router.ts b/packages/internal/dex/sdk/src/lib/router.ts index 16a3334c08..16f3d207cf 100644 --- a/packages/internal/dex/sdk/src/lib/router.ts +++ b/packages/internal/dex/sdk/src/lib/router.ts @@ -1,8 +1,8 @@ import { Token, TradeType } from '@uniswap/sdk-core'; import { Pool, Route } from '@uniswap/v3-sdk'; +import { providers } from 'ethers'; import { NoRoutesAvailableError } from '../errors'; import { CoinAmount, ERC20 } from '../types'; -import { providers } from 'ethers'; import { erc20ToUniswapToken, poolEquals, uniswapTokenToERC20 } from './utils'; import { getQuotesForRoutes, QuoteResult } from './getQuotesForRoutes'; import { fetchValidPools } from './poolUtils/fetchValidPools'; diff --git a/packages/internal/dex/sdk/src/lib/transactionUtils/approval.ts b/packages/internal/dex/sdk/src/lib/transactionUtils/approval.ts index 986427b115..8e158b0bcb 100644 --- a/packages/internal/dex/sdk/src/lib/transactionUtils/approval.ts +++ b/packages/internal/dex/sdk/src/lib/transactionUtils/approval.ts @@ -1,12 +1,11 @@ import { JsonRpcProvider, TransactionRequest } from '@ethersproject/providers'; import { BigNumber } from '@ethersproject/bignumber'; -import { ERC20__factory } from '../../contracts/types/factories/ERC20__factory'; -import { ApproveError } from '../../errors'; import { ethers } from 'ethers'; import { TradeType } from '@uniswap/sdk-core'; +import { ERC20__factory } from '../../contracts/types/factories/ERC20__factory'; +import { ApproveError } from '../../errors'; import { isERC20Amount, toPublicAmount } from '../utils'; -import { CoinAmount, Coin, ERC20, Native } from '../../types'; -import { SecondaryFee, TransactionDetails } from '../../types'; +import { CoinAmount, Coin, ERC20, Native, SecondaryFee, TransactionDetails } from '../../types'; import { calculateGasFee } from './gas'; type PreparedApproval = { From 1506fb0d92646b384191c29be5caad0173c61415 Mon Sep 17 00:00:00 2001 From: Shine Li Date: Thu, 20 Jun 2024 14:24:01 +1000 Subject: [PATCH 7/8] linting --- packages/internal/dex/sdk/src/lib/transactionUtils/swap.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/internal/dex/sdk/src/lib/transactionUtils/swap.test.ts b/packages/internal/dex/sdk/src/lib/transactionUtils/swap.test.ts index 8975142fde..9232d349df 100644 --- a/packages/internal/dex/sdk/src/lib/transactionUtils/swap.test.ts +++ b/packages/internal/dex/sdk/src/lib/transactionUtils/swap.test.ts @@ -25,7 +25,7 @@ import { } from 'test/utils'; import { Pool, Route } from '@uniswap/v3-sdk'; import { Fees } from '../fees'; -import { erc20ToUniswapToken, newAmount } from '../../lib'; +import { erc20ToUniswapToken, newAmount } from '../utils'; import { QuoteResult } from '../getQuotesForRoutes'; import { Coin, ERC20 } from '../../types'; import { getSwap, adjustQuoteWithFees } from './swap'; From a3354ca1c04cf70d1efae4f19fe474c55ad46697 Mon Sep 17 00:00:00 2001 From: Shine Li Date: Thu, 20 Jun 2024 15:46:52 +1000 Subject: [PATCH 8/8] formatting --- packages/orderbook/src/api-client/api-client.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/orderbook/src/api-client/api-client.ts b/packages/orderbook/src/api-client/api-client.ts index 80b6c911f1..0a4a26e1ed 100644 --- a/packages/orderbook/src/api-client/api-client.ts +++ b/packages/orderbook/src/api-client/api-client.ts @@ -29,11 +29,11 @@ export class ImmutableApiClient { async fulfillmentData( requests: Array, ): Promise<{ - result: { - fulfillable_orders: Array; - unfulfillable_orders: Array; - }; - }> { + result: { + fulfillable_orders: Array; + unfulfillable_orders: Array; + }; + }> { return this.orderbookService.fulfillmentData({ chainName: this.chainName, requestBody: requests,