We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47404e1 commit 9817aadCopy full SHA for 9817aad
packages/thirdweb/src/utils/any-evm/zksync/isZkSyncChain.ts
@@ -19,12 +19,13 @@ export async function isZkSyncChain(chain: Chain) {
19
}
20
21
// 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
-
27
- return stack === "zksync-stack";
+ try {
+ const stack = await getChainStack(chain.id);
+ return stack === "zksync-stack";
+ } catch {
+ // If the network check fails, assume it's not a ZkSync chain
+ return false;
28
+ }
29
30
31
async function getChainStack(chainId: number): Promise<string> {
0 commit comments