From 8bb2a9398b22150df544d251f71ecb2ee5e6bb15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Coffee=E2=98=95=EF=B8=8F?= Date: Thu, 21 Nov 2024 09:23:36 -0500 Subject: [PATCH] fix: use defined L1 network for hyperchain --- data/networks.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/networks.ts b/data/networks.ts index a788e7ca2..492ad89b6 100644 --- a/data/networks.ts +++ b/data/networks.ts @@ -1,7 +1,7 @@ import { mainnet, sepolia } from "@wagmi/core/chains"; import Hyperchains from "@/hyperchains/config.json"; -import { PUBLIC_L1_CHAINS, type Config } from "@/scripts/hyperchains/common"; +import { type Config } from "@/scripts/hyperchains/common"; import type { Token } from "@/types"; import type { Chain } from "@wagmi/core/chains"; @@ -36,6 +36,7 @@ export const l1Networks = { }, }, } as const; + export type L1Network = Chain; export type ZkSyncNetwork = { @@ -127,7 +128,7 @@ const getHyperchains = (): ZkSyncNetwork[] => { getTokens: () => e.tokens, }; if (e.network.publicL1NetworkId) { - network.l1Network = PUBLIC_L1_CHAINS.find((chain) => chain.id === e.network.publicL1NetworkId); + network.l1Network = Object.entries(l1Networks).find(([, chain]) => chain.id === e.network.publicL1NetworkId)?.[1]; if (!network.l1Network) { throw new Error( `L1 network with ID ${e.network.publicL1NetworkId} from ${network.name} config wasn't found in the list of public L1 networks.`