Skip to content

Commit b99cdec

Browse files
authored
Update isZkSyncChain.ts
1 parent 47404e1 commit b99cdec

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/thirdweb/src/utils/any-evm/zksync/isZkSyncChain.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ export async function isZkSyncChain(chain: Chain) {
1919
}
2020

2121
// fallback to checking the stack on rpc
22-
const stack = await getChainStack(chain.id).catch(() => {
23-
// dont throw if network check fails
24-
return "";
25-
});
26-
22+
try {
23+
const stack = await getChainStack(chain.id);
24+
return stack === "zksync-stack";
25+
} catch {
26+
// If the network check fails, assume it's not a ZkSync chain
27+
return false;
28+
}
2729
return stack === "zksync-stack";
2830
}
2931

0 commit comments

Comments
 (0)