diff --git a/app/scripts/controllers/bridge-status/utils.ts b/app/scripts/controllers/bridge-status/utils.ts index d68f0dfe8331..5447b483e34f 100644 --- a/app/scripts/controllers/bridge-status/utils.ts +++ b/app/scripts/controllers/bridge-status/utils.ts @@ -8,7 +8,7 @@ import { StatusRequestWithSrcTxHash, StatusRequestDto, } from '../../../../shared/types/bridge-status'; -import { Quote } from '../../../../shared/types/bridge'; +import type { Quote } from '../../../../shared/types/bridge'; import { validateResponse, validators } from './validators'; const CLIENT_ID_HEADER = { 'X-Client-Id': BRIDGE_CLIENT_ID }; diff --git a/app/scripts/controllers/bridge/bridge-controller.test.ts b/app/scripts/controllers/bridge/bridge-controller.test.ts index 2ee09b252f62..e35d3c41e67c 100644 --- a/app/scripts/controllers/bridge/bridge-controller.test.ts +++ b/app/scripts/controllers/bridge/bridge-controller.test.ts @@ -10,7 +10,10 @@ import * as balanceUtils from '../../../../shared/modules/bridge-utils/balance'; import mockBridgeQuotesErc20Native from '../../../../test/data/bridge/mock-quotes-erc20-native.json'; import mockBridgeQuotesNativeErc20 from '../../../../test/data/bridge/mock-quotes-native-erc20.json'; import mockBridgeQuotesNativeErc20Eth from '../../../../test/data/bridge/mock-quotes-native-erc20-eth.json'; -import { QuoteResponse, RequestStatus } from '../../../../shared/types/bridge'; +import { + type QuoteResponse, + RequestStatus, +} from '../../../../shared/types/bridge'; import { decimalToHex } from '../../../../shared/modules/conversion.utils'; import BridgeController from './bridge-controller'; import { BridgeControllerMessenger } from './types'; diff --git a/app/scripts/controllers/bridge/bridge-controller.ts b/app/scripts/controllers/bridge/bridge-controller.ts index 3b4fef9dbbd8..ba7a3e75905d 100644 --- a/app/scripts/controllers/bridge/bridge-controller.ts +++ b/app/scripts/controllers/bridge/bridge-controller.ts @@ -21,10 +21,10 @@ import { sumHexes, } from '../../../../shared/modules/conversion.utils'; import { - L1GasFees, - QuoteRequest, - QuoteResponse, - TxData, + type L1GasFees, + type QuoteRequest, + type QuoteResponse, + type TxData, BridgeFeatureFlagsKey, RequestStatus, } from '../../../../shared/types/bridge'; diff --git a/app/scripts/controllers/bridge/constants.ts b/app/scripts/controllers/bridge/constants.ts index 718f81de2f9f..daaf3dc056ce 100644 --- a/app/scripts/controllers/bridge/constants.ts +++ b/app/scripts/controllers/bridge/constants.ts @@ -8,7 +8,7 @@ import { } from '../../../../shared/constants/bridge'; import { CHAIN_IDS } from '../../../../shared/constants/network'; import { BridgeFeatureFlagsKey } from '../../../../shared/types/bridge'; -import { BridgeControllerState } from './types'; +import type { BridgeControllerState } from './types'; export const BRIDGE_CONTROLLER_NAME = 'BridgeController'; export const DEFAULT_BRIDGE_CONTROLLER_STATE: BridgeControllerState = { diff --git a/app/scripts/controllers/bridge/types.ts b/app/scripts/controllers/bridge/types.ts index 9502d2601fc2..cbced91248a6 100644 --- a/app/scripts/controllers/bridge/types.ts +++ b/app/scripts/controllers/bridge/types.ts @@ -8,7 +8,7 @@ import { NetworkControllerGetSelectedNetworkClientAction, } from '@metamask/network-controller'; import { SwapsTokenObject } from '../../../../shared/constants/swaps'; -import { +import type { BridgeBackgroundAction, BridgeFeatureFlags, BridgeUserAction, diff --git a/shared/modules/bridge-utils/quote.ts b/shared/modules/bridge-utils/quote.ts index 90bd312ca631..3fe4406fa333 100644 --- a/shared/modules/bridge-utils/quote.ts +++ b/shared/modules/bridge-utils/quote.ts @@ -1,4 +1,4 @@ -import { QuoteRequest } from '../../types/bridge'; +import type { QuoteRequest } from '../../types/bridge'; export const isValidQuoteRequest = ( partialRequest: Partial<QuoteRequest>, diff --git a/shared/types/bridge-status.ts b/shared/types/bridge-status.ts index 7574147aa4f6..3e81f6e74f1d 100644 --- a/shared/types/bridge-status.ts +++ b/shared/types/bridge-status.ts @@ -1,5 +1,5 @@ import { TransactionMeta } from '@metamask/transaction-controller'; -import { ChainId, Quote, QuoteMetadata, QuoteResponse } from './bridge'; +import type { ChainId, Quote, QuoteMetadata, QuoteResponse } from './bridge'; // All fields need to be types not interfaces, same with their children fields // o/w you get a type error diff --git a/shared/types/bridge.ts b/shared/types/bridge.ts index acffeba900ac..fc7110e49825 100644 --- a/shared/types/bridge.ts +++ b/shared/types/bridge.ts @@ -1,5 +1,5 @@ -import { Hex } from '@metamask/utils'; -import { BigNumber } from 'bignumber.js'; +import type { Hex } from '@metamask/utils'; +import type { BigNumber } from 'bignumber.js'; import type { AssetType } from '../constants/transaction'; export type ChainConfiguration = { diff --git a/test/e2e/tests/bridge/bridge-test-utils.ts b/test/e2e/tests/bridge/bridge-test-utils.ts index 1a814d73d0b4..842ff31fff39 100644 --- a/test/e2e/tests/bridge/bridge-test-utils.ts +++ b/test/e2e/tests/bridge/bridge-test-utils.ts @@ -12,7 +12,7 @@ import { SMART_CONTRACTS } from '../../seeder/smart-contracts'; import { CHAIN_IDS } from '../../../../shared/constants/network'; import { Driver } from '../../webdriver/driver'; import { isManifestV3 } from '../../../../shared/modules/mv3.utils'; -import { FeatureFlagResponse } from '../../../../shared/types/bridge'; +import type { FeatureFlagResponse } from '../../../../shared/types/bridge'; import { DEFAULT_FEATURE_FLAGS_RESPONSE, ETH_CONVERSION_RATE_USD, diff --git a/test/e2e/tests/bridge/constants.ts b/test/e2e/tests/bridge/constants.ts index 9f54563d2e9c..844cec673509 100644 --- a/test/e2e/tests/bridge/constants.ts +++ b/test/e2e/tests/bridge/constants.ts @@ -1,4 +1,4 @@ -import { FeatureFlagResponse } from '../../../../shared/types/bridge'; +import type { FeatureFlagResponse } from '../../../../shared/types/bridge'; export const DEFAULT_FEATURE_FLAGS_RESPONSE: FeatureFlagResponse = { 'extension-config': { diff --git a/ui/ducks/bridge/actions.ts b/ui/ducks/bridge/actions.ts index 2258832a01b7..e2ea02bad39d 100644 --- a/ui/ducks/bridge/actions.ts +++ b/ui/ducks/bridge/actions.ts @@ -1,4 +1,4 @@ -import { Hex } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { BridgeBackgroundAction, BridgeUserAction, @@ -6,7 +6,7 @@ import { } from '../../../shared/types/bridge'; import { forceUpdateMetamaskState } from '../../store/actions'; import { submitRequestToBackground } from '../../store/background-connection'; -import { MetaMaskReduxDispatch } from '../../store/store'; +import type { MetaMaskReduxDispatch } from '../../store/store'; import { bridgeSlice, setDestTokenExchangeRates, diff --git a/ui/ducks/bridge/bridge.ts b/ui/ducks/bridge/bridge.ts index 93379656bfdc..14786b51d4dd 100644 --- a/ui/ducks/bridge/bridge.ts +++ b/ui/ducks/bridge/bridge.ts @@ -1,9 +1,9 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit'; import { Hex } from '@metamask/utils'; import { - BridgeToken, - QuoteMetadata, - QuoteResponse, + type BridgeToken, + type QuoteMetadata, + type QuoteResponse, SortOrder, } from '../../../shared/types/bridge'; import { BRIDGE_DEFAULT_SLIPPAGE } from '../../../shared/constants/bridge'; diff --git a/ui/ducks/bridge/selectors.test.ts b/ui/ducks/bridge/selectors.test.ts index 552c3d70350e..bf0cefedeb4d 100644 --- a/ui/ducks/bridge/selectors.test.ts +++ b/ui/ducks/bridge/selectors.test.ts @@ -11,8 +11,8 @@ import { mockNetworkState } from '../../../test/stub/networks'; import mockErc20Erc20Quotes from '../../../test/data/bridge/mock-quotes-erc20-erc20.json'; import mockBridgeQuotesNativeErc20 from '../../../test/data/bridge/mock-quotes-native-erc20.json'; import { - QuoteMetadata, - QuoteResponse, + type QuoteMetadata, + type QuoteResponse, SortOrder, } from '../../../shared/types/bridge'; import { diff --git a/ui/ducks/bridge/selectors.ts b/ui/ducks/bridge/selectors.ts index ce2610aca4c7..dd111196d8fa 100644 --- a/ui/ducks/bridge/selectors.ts +++ b/ui/ducks/bridge/selectors.ts @@ -1,11 +1,11 @@ -import { +import type { AddNetworkFields, NetworkConfiguration, NetworkState, } from '@metamask/network-controller'; import { orderBy, uniqBy } from 'lodash'; import { createSelector } from 'reselect'; -import { GasFeeEstimates } from '@metamask/gas-fee-controller'; +import type { GasFeeEstimates } from '@metamask/gas-fee-controller'; import { BigNumber } from 'bignumber.js'; import { calcTokenAmount } from '@metamask/notification-services-controller/push-services'; import { @@ -22,7 +22,7 @@ import { } from '../../../shared/constants/bridge'; // TODO: Remove restricted import // eslint-disable-next-line import/no-restricted-paths -import { BridgeControllerState } from '../../../app/scripts/controllers/bridge/types'; +import type { BridgeControllerState } from '../../../app/scripts/controllers/bridge/types'; import { createDeepEqualSelector } from '../../../shared/modules/selectors/util'; import { SWAPS_CHAINID_DEFAULT_TOKEN_MAP } from '../../../shared/constants/swaps'; import { @@ -31,10 +31,10 @@ import { } from '../../../shared/modules/selectors/networks'; import { getConversionRate, getGasFeeEstimates } from '../metamask/metamask'; import { - L1GasFees, - BridgeToken, - QuoteMetadata, - QuoteResponse, + type L1GasFees, + type BridgeToken, + type QuoteMetadata, + type QuoteResponse, SortOrder, BridgeFeatureFlagsKey, RequestStatus, @@ -60,7 +60,7 @@ import { exchangeRateFromMarketData, tokenPriceInNativeAsset, } from './utils'; -import { BridgeState } from './bridge'; +import type { BridgeState } from './bridge'; type BridgeAppState = { metamask: { bridgeState: BridgeControllerState } & NetworkState & { diff --git a/ui/ducks/bridge/utils.ts b/ui/ducks/bridge/utils.ts index b39f51d14e92..050829d3ca65 100644 --- a/ui/ducks/bridge/utils.ts +++ b/ui/ducks/bridge/utils.ts @@ -1,14 +1,14 @@ -import { Hex } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { BigNumber } from 'bignumber.js'; import { getAddress } from 'ethers/lib/utils'; -import { ContractMarketData } from '@metamask/assets-controllers'; +import type { ContractMarketData } from '@metamask/assets-controllers'; import { AddNetworkFields, NetworkConfiguration, } from '@metamask/network-controller'; import { decGWEIToHexWEI } from '../../../shared/modules/conversion.utils'; import { Numeric } from '../../../shared/modules/Numeric'; -import { TxData } from '../../../shared/types/bridge'; +import type { TxData } from '../../../shared/types/bridge'; import { getTransaction1559GasFeeEstimates } from '../../pages/swaps/swaps.util'; import { fetchTokenExchangeRates as fetchTokenExchangeRatesUtil } from '../../helpers/utils/util'; diff --git a/ui/pages/bridge/hooks/useAddToken.ts b/ui/pages/bridge/hooks/useAddToken.ts index 7eeabc2e6701..f1a148ce7732 100644 --- a/ui/pages/bridge/hooks/useAddToken.ts +++ b/ui/pages/bridge/hooks/useAddToken.ts @@ -1,6 +1,6 @@ import { useDispatch, useSelector } from 'react-redux'; -import { NetworkConfiguration } from '@metamask/network-controller'; -import { QuoteResponse } from '../../../../shared/types/bridge'; +import type { NetworkConfiguration } from '@metamask/network-controller'; +import type { QuoteResponse } from '../../../../shared/types/bridge'; import { FEATURED_RPCS } from '../../../../shared/constants/network'; import { addToken, addNetwork } from '../../../store/actions'; import { diff --git a/ui/pages/bridge/hooks/useHandleApprovalTx.ts b/ui/pages/bridge/hooks/useHandleApprovalTx.ts index 929c4933cc41..7e469bc78ead 100644 --- a/ui/pages/bridge/hooks/useHandleApprovalTx.ts +++ b/ui/pages/bridge/hooks/useHandleApprovalTx.ts @@ -1,9 +1,9 @@ import { TransactionType } from '@metamask/transaction-controller'; -import { Hex } from '@metamask/utils'; +import type { Hex } from '@metamask/utils'; import { BigNumber } from 'bignumber.js'; import { - TxData, - QuoteResponse, + type TxData, + type QuoteResponse, FeeType, } from '../../../../shared/types/bridge'; import { diff --git a/ui/pages/bridge/hooks/useHandleBridgeTx.ts b/ui/pages/bridge/hooks/useHandleBridgeTx.ts index 6128750058d3..5d7e1a1b527c 100644 --- a/ui/pages/bridge/hooks/useHandleBridgeTx.ts +++ b/ui/pages/bridge/hooks/useHandleBridgeTx.ts @@ -1,7 +1,7 @@ import { BigNumber } from 'bignumber.js'; import { TransactionType } from '@metamask/transaction-controller'; import { Numeric } from '../../../../shared/modules/Numeric'; -import { FeeType, QuoteResponse } from '../../../../shared/types/bridge'; +import { FeeType, type QuoteResponse } from '../../../../shared/types/bridge'; import useHandleTx from './useHandleTx'; export default function useHandleBridgeTx() { diff --git a/ui/pages/bridge/hooks/useHandleTx.ts b/ui/pages/bridge/hooks/useHandleTx.ts index 36b8355b3ea4..59b6c7ee9c89 100644 --- a/ui/pages/bridge/hooks/useHandleTx.ts +++ b/ui/pages/bridge/hooks/useHandleTx.ts @@ -15,7 +15,7 @@ import { } from '../../../ducks/bridge/utils'; import { getGasFeeEstimates } from '../../../ducks/metamask/metamask'; import { checkNetworkAndAccountSupports1559 } from '../../../selectors'; -import { ChainId } from '../../../../shared/types/bridge'; +import type { ChainId } from '../../../../shared/types/bridge'; import { decimalToPrefixedHex } from '../../../../shared/modules/conversion.utils'; import { getIsSmartTransaction } from '../../../../shared/modules/selectors'; diff --git a/ui/pages/bridge/hooks/useSubmitBridgeTransaction.ts b/ui/pages/bridge/hooks/useSubmitBridgeTransaction.ts index 77fd20b7da26..e34c4e9400c6 100644 --- a/ui/pages/bridge/hooks/useSubmitBridgeTransaction.ts +++ b/ui/pages/bridge/hooks/useSubmitBridgeTransaction.ts @@ -3,7 +3,10 @@ import { zeroAddress } from 'ethereumjs-util'; import { useHistory } from 'react-router-dom'; import { TransactionMeta } from '@metamask/transaction-controller'; import { createProjectLogger, Hex } from '@metamask/utils'; -import { QuoteMetadata, QuoteResponse } from '../../../../shared/types/bridge'; +import type { + QuoteMetadata, + QuoteResponse, +} from '../../../../shared/types/bridge'; import { AWAITING_SIGNATURES_ROUTE, CROSS_CHAIN_SWAP_ROUTE, diff --git a/ui/pages/bridge/prepare/bridge-input-group.tsx b/ui/pages/bridge/prepare/bridge-input-group.tsx index dddc0840e85a..2aee658f7dc7 100644 --- a/ui/pages/bridge/prepare/bridge-input-group.tsx +++ b/ui/pages/bridge/prepare/bridge-input-group.tsx @@ -33,7 +33,7 @@ import { getValidationErrors, } from '../../../ducks/bridge/selectors'; import { shortenString } from '../../../helpers/utils/util'; -import { BridgeToken } from '../../../../shared/types/bridge'; +import type { BridgeToken } from '../../../../shared/types/bridge'; import { useCopyToClipboard } from '../../../hooks/useCopyToClipboard'; import { MINUTE } from '../../../../shared/constants/time'; import { BridgeAssetPickerButton } from './components/bridge-asset-picker-button'; diff --git a/ui/pages/bridge/prepare/prepare-bridge-page.tsx b/ui/pages/bridge/prepare/prepare-bridge-page.tsx index caf07d805224..bc18bea49930 100644 --- a/ui/pages/bridge/prepare/prepare-bridge-page.tsx +++ b/ui/pages/bridge/prepare/prepare-bridge-page.tsx @@ -64,7 +64,7 @@ import { SWAPS_CHAINID_DEFAULT_TOKEN_MAP } from '../../../../shared/constants/sw import { useTokensWithFiltering } from '../../../hooks/bridge/useTokensWithFiltering'; import { setActiveNetwork } from '../../../store/actions'; import { hexToDecimal } from '../../../../shared/modules/conversion.utils'; -import { QuoteRequest } from '../../../../shared/types/bridge'; +import type { QuoteRequest } from '../../../../shared/types/bridge'; import { calcTokenValue } from '../../../../shared/lib/swaps-utils'; import { BridgeQuoteCard } from '../quotes/bridge-quote-card'; import { formatTokenAmount } from '../utils/quote'; diff --git a/ui/pages/bridge/quotes/bridge-quotes-modal.tsx b/ui/pages/bridge/quotes/bridge-quotes-modal.tsx index 133fad39735d..bba17147a131 100644 --- a/ui/pages/bridge/quotes/bridge-quotes-modal.tsx +++ b/ui/pages/bridge/quotes/bridge-quotes-modal.tsx @@ -27,8 +27,8 @@ import { useI18nContext } from '../../../hooks/useI18nContext'; import { getCurrentCurrency, getLocale } from '../../../selectors'; import { setSelectedQuote, setSortOrder } from '../../../ducks/bridge/actions'; import { - QuoteMetadata, - QuoteResponse, + type QuoteMetadata, + type QuoteResponse, SortOrder, } from '../../../../shared/types/bridge'; import { diff --git a/ui/pages/bridge/utils/quote.ts b/ui/pages/bridge/utils/quote.ts index 5a6768768780..77ccfde595b6 100644 --- a/ui/pages/bridge/utils/quote.ts +++ b/ui/pages/bridge/utils/quote.ts @@ -1,7 +1,7 @@ import { zeroAddress } from 'ethereumjs-util'; import { BigNumber } from 'bignumber.js'; import { calcTokenAmount } from '../../../../shared/lib/transactions-controller-utils'; -import { +import type { QuoteResponse, Quote, L1GasFees,