Skip to content

Commit

Permalink
tweak main chains logic more
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat committed Feb 12, 2025
1 parent 6a2d1e5 commit dfd7129
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/core/utils/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,9 @@ const getMainChainsHelper = (
!(chain.id === ChainId.hardhat || chain.id === ChainId.hardhatOptimism),
);

const customChainsIncludingTestnets = customMainChains.filter(
(chain) =>
!chain.testnet || (chain.testnet && mainnetSuportedChains[chain.id]),
);

return Object.values(mainnetSuportedChains)
.map(mergedChainToViemChain)
.concat(customChainsIncludingTestnets);
.concat(customMainChains);
};

export const useMainChains = () => {
Expand Down Expand Up @@ -72,7 +67,6 @@ export const getSupportedChains = ({ testnets }: { testnets?: boolean }) => {
};

// Chain helpers

export function getChain({ chainId }: { chainId?: ChainId }) {
const { chains } = wagmiConfig;
const chain = chains.find((chain) => chain.id === chainId);
Expand Down

0 comments on commit dfd7129

Please sign in to comment.