From 0f370c7e74a400d62f99ab3177209405205e507c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Mi=C3=B1o?= Date: Fri, 6 Sep 2024 12:34:47 -0400 Subject: [PATCH] import SUPPORTED_CHAIN_IDS correctly --- src/__swaps__/screens/Swap/resources/assets/userAssets.ts | 7 ++++--- src/resources/assets/hardhatAssets.ts | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/__swaps__/screens/Swap/resources/assets/userAssets.ts b/src/__swaps__/screens/Swap/resources/assets/userAssets.ts index b11832baf73..8fbe3f35a91 100644 --- a/src/__swaps__/screens/Swap/resources/assets/userAssets.ts +++ b/src/__swaps__/screens/Swap/resources/assets/userAssets.ts @@ -6,7 +6,7 @@ import { QueryConfigWithSelect, QueryFunctionArgs, QueryFunctionResult, createQu import { RainbowError, logger } from '@/logger'; import { RainbowFetchClient } from '@/rainbow-fetch'; -import { SupportedCurrencyKey, SUPPORTED_CHAIN_IDS } from '@/references'; +import { SupportedCurrencyKey } from '@/references'; import { ParsedAssetsDictByChain, ZerionAsset } from '@/__swaps__/types/assets'; import { ChainId } from '@/chains/types'; import { AddressAssetsReceivedMessage } from '@/__swaps__/types/refraction'; @@ -14,7 +14,8 @@ import { parseUserAsset } from '@/__swaps__/utils/assets'; import { greaterThan } from '@/__swaps__/utils/numbers'; import { fetchUserAssetsByChain } from './userAssetsByChain'; -import { fetchHardhatBalances, fetchHardhatBalancesByChainId } from '@/resources/assets/hardhatAssets'; +import { fetchHardhatBalancesByChainId } from '@/resources/assets/hardhatAssets'; +import { SUPPORTED_CHAIN_IDS } from '@/chains'; import { useConnectedToHardhatStore } from '@/state/connectedToHardhat'; const addysHttp = new RainbowFetchClient({ @@ -112,7 +113,7 @@ async function userAssetsQueryFunction({ const cachedUserAssets = (cache.find(userAssetsQueryKey({ address, currency, testnetMode }))?.state?.data || {}) as ParsedAssetsDictByChain; try { - const url = `/${SUPPORTED_CHAIN_IDS({ testnetMode }).join(',')}/${address}/assets`; + const url = `/${SUPPORTED_CHAIN_IDS.join(',')}/${address}/assets`; const res = await addysHttp.get(url, { params: { currency: currency.toLowerCase(), diff --git a/src/resources/assets/hardhatAssets.ts b/src/resources/assets/hardhatAssets.ts index bae0d03cba0..8945031038c 100644 --- a/src/resources/assets/hardhatAssets.ts +++ b/src/resources/assets/hardhatAssets.ts @@ -1,7 +1,7 @@ import { Contract } from '@ethersproject/contracts'; import { keyBy, mapValues } from 'lodash'; import { getProvider } from '@/handlers/web3'; -import { balanceCheckerContractAbi, chainAssets, ETH_ADDRESS, SUPPORTED_CHAIN_IDS } from '@/references'; +import { balanceCheckerContractAbi, chainAssets, ETH_ADDRESS } from '@/references'; import { parseAddressAsset } from './assets'; import { RainbowAddressAssets } from './types'; import { logger, RainbowError } from '@/logger'; @@ -9,6 +9,7 @@ import { AddressOrEth, UniqueId, ZerionAsset } from '@/__swaps__/types/assets'; import { AddressZero } from '@ethersproject/constants'; import chainAssetsByChainId from '@/references/testnet-assets-by-chain'; import { ChainId, ChainName, Network } from '@/chains/types'; +import { SUPPORTED_CHAIN_IDS } from '@/chains'; const MAINNET_BALANCE_CHECKER = '0x4dcf4562268dd384fe814c00fad239f06c2a0c2b'; @@ -124,6 +125,6 @@ export const fetchHardhatBalancesByChainId = async ( return { assets: updatedAssets, - chainIdsInResponse: SUPPORTED_CHAIN_IDS({ testnetMode: true }), + chainIdsInResponse: SUPPORTED_CHAIN_IDS, }; };