@matterlabs/zksync-js 0.0.3 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- export { createEthersSdk } from '../../chunk-5YWP4CZP.js';
1
+ export { createEthersSdk } from '../../chunk-WU2LOG2A.js';
2
+ import '../../chunk-XRE7H466.js';
2
3
  import '../../chunk-LL3WKCFJ.js';
3
4
  import '../../chunk-NEC2ZKHI.js';
4
- import '../../chunk-XRE7H466.js';
5
5
  import '../../chunk-NCAIVYBR.js';
6
6
  import '../../chunk-M5J2MM2U.js';
7
7
  import '../../chunk-F2ENUV3A.js';
@@ -8212,6 +8212,27 @@ function createWithdrawalsResource(client, tokens, contracts) {
8212
8212
  message: "Internal error while attempting to tryFinalize withdrawal.",
8213
8213
  ctx: { l2TxHash, where: "withdrawals.tryFinalize" }
8214
8214
  });
8215
+ const tryWait = (h, opts) => toResult2(
8216
+ OP_WITHDRAWALS.tryWait,
8217
+ async () => {
8218
+ const v = await wait(h, opts);
8219
+ if (v) return v;
8220
+ throw createError("STATE", {
8221
+ resource: "withdrawals",
8222
+ operation: "withdrawals.tryWait",
8223
+ message: opts.for === "l2" ? "No L2 receipt yet; the withdrawal has not executed on L2." : "No L1 receipt yet; the withdrawal has not been included on L1.",
8224
+ context: {
8225
+ for: opts.for,
8226
+ l2TxHash: typeof h === "string" ? h : "l2TxHash" in h ? h.l2TxHash : void 0,
8227
+ where: "withdrawals.tryWait"
8228
+ }
8229
+ });
8230
+ },
8231
+ {
8232
+ message: "Internal error while waiting for withdrawal.",
8233
+ ctx: { input: h, for: opts?.for, where: "withdrawals.tryWait" }
8234
+ }
8235
+ );
8215
8236
  return {
8216
8237
  quote,
8217
8238
  tryQuote,
@@ -8222,7 +8243,8 @@ function createWithdrawalsResource(client, tokens, contracts) {
8222
8243
  status,
8223
8244
  wait,
8224
8245
  finalize,
8225
- tryFinalize
8246
+ tryFinalize,
8247
+ tryWait
8226
8248
  };
8227
8249
  }
8228
8250