Skip to content

Commit 9817aad

Browse files
committed
Update isZkSyncChain.ts
1 parent 47404e1 commit 9817aad

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +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-
27-
return stack === "zksync-stack";
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+
}
2829
}
2930

3031
async function getChainStack(chainId: number): Promise<string> {

0 commit comments

Comments
 (0)