Skip to content

Commit bf88465

Browse files
fix: respect bundlerUrl in waitForUserReceipt
1 parent 322e449 commit bf88465

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Respect bundlerUrl in waitForUserReceipt

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Chain } from "../../../chains/types.js";
2+
import { getChainMetadata } from "../../../chains/utils.js";
23

34
export async function isZkSyncChain(chain: Chain) {
45
if (chain.id === 1337 || chain.id === 31337) {
@@ -16,10 +17,19 @@ export async function isZkSyncChain(chain: Chain) {
1617
chain.id === 4654 ||
1718
chain.id === 333271 ||
1819
chain.id === 37111 ||
19-
chain.id === 978658
20+
chain.id === 978658 ||
21+
chain.id === 531050104 ||
22+
chain.id === 4457845
2023
) {
2124
return true;
2225
}
2326

24-
return false;
27+
// fallback to checking the stack on rpc
28+
try {
29+
const chainMetadata = await getChainMetadata(chain);
30+
return chainMetadata.stackType === "zksync_stack";
31+
} catch {
32+
// If the network check fails, assume it's not a ZkSync chain
33+
return false;
34+
}
2535
}

packages/thirdweb/src/wallets/smart/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ async function _sendUserOp(args: {
624624
});
625625
// wait for tx receipt rather than return the userOp hash
626626
const receipt = await waitForUserOpReceipt({
627-
...options,
627+
...bundlerOptions,
628628
userOpHash,
629629
});
630630

0 commit comments

Comments
 (0)