@babylonlabs-io/ts-sdk 0.59.1 → 0.59.2

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,18 +1,18 @@
1
- var ke = Object.defineProperty;
2
- var Ce = (r, e, t) => e in r ? ke(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var f = (r, e, t) => Ce(r, typeof e != "symbol" ? e + "" : e, t);
1
+ var Ce = Object.defineProperty;
2
+ var Te = (r, e, t) => e in r ? Ce(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var f = (r, e, t) => Te(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { B } from "./BTCVaultRegistry.abi-B3BLhpJ4.js";
5
5
  import { A as R, P as y } from "./ProtocolParams.abi-CV938AYZ.js";
6
- import { k as Te, v as K, l as $e, j as Ve } from "./mempoolApi-BQKF5MTr.js";
7
- import { X as O, C as j, s as I, S as Ie, h as Re, p as ge } from "./bitcoin-d9eaaZB_.js";
8
- import { D as Oe, a as fe, e as Ne } from "./json-rpc-client-DuUARJvV.js";
6
+ import { k as $e, v as U, l as Ve, j as Ie } from "./mempoolApi-BQKF5MTr.js";
7
+ import { X as O, C as j, s as I, S as Re, h as Oe, p as fe } from "./bitcoin-d9eaaZB_.js";
8
+ import { D as Ne, a as _e, e as Be } from "./json-rpc-client-DuUARJvV.js";
9
9
  import { C as ee } from "./constants-GjWXdaqV.js";
10
10
  import { H as k } from "./validation-Dj3dqYtl.js";
11
- import * as U from "@bitcoin-js/tiny-secp256k1-asmjs";
12
- import { payments as Be, Transaction as X } from "bitcoinjs-lib";
11
+ import * as K from "@bitcoin-js/tiny-secp256k1-asmjs";
12
+ import { payments as Ge, Transaction as X } from "bitcoinjs-lib";
13
13
  import { Buffer as V } from "buffer";
14
14
  import { s as Y } from "./sha2-BYVxyZzX.js";
15
- async function or(r, e) {
15
+ async function cr(r, e) {
16
16
  const [t, n] = await r.multicall({
17
17
  contracts: [
18
18
  {
@@ -33,14 +33,20 @@ async function or(r, e) {
33
33
  applicationRegistry: n
34
34
  };
35
35
  }
36
- function Ge(r, e) {
36
+ function te(r, e, t) {
37
+ if (r !== e)
38
+ throw new Error(
39
+ `${t}: multicall returned ${r} results for ${e} calls, so the results are not roster-aligned; refusing to use them`
40
+ );
41
+ }
42
+ function De(r, e) {
37
43
  return {
38
44
  vaultProvider: r[0],
39
45
  vaultKeepers: r.slice(1, 1 + e),
40
46
  universalChallengers: r.slice(1 + e)
41
47
  };
42
48
  }
43
- class cr {
49
+ class lr {
44
50
  constructor(e, t) {
45
51
  this.publicClient = e, this.contracts = t;
46
52
  }
@@ -50,12 +56,16 @@ class cr {
50
56
  * otherwise produce a mixed-epoch key set and a lock no counterparty agrees
51
57
  * with.
52
58
  */
53
- async readAll(e, t) {
54
- const n = await this.publicClient.multicall({
59
+ async readAll(e, t, n, i) {
60
+ const s = await this.publicClient.multicall({
55
61
  contracts: e,
56
62
  allowFailure: !1
57
63
  });
58
- return Ge(n, t);
64
+ return te(
65
+ s.length,
66
+ 1 + t + n,
67
+ i
68
+ ), De(s, t);
59
69
  }
60
70
  async getCurrentOperationKeys(e) {
61
71
  const t = [
@@ -78,7 +88,12 @@ class cr {
78
88
  args: [n.ethAddress]
79
89
  }))
80
90
  ];
81
- return this.readAll(t, e.vaultKeepers.length);
91
+ return this.readAll(
92
+ t,
93
+ e.vaultKeepers.length,
94
+ e.universalChallengers.length,
95
+ "getCurrentOperationKeys"
96
+ );
82
97
  }
83
98
  async getOperationKeysAtEpochs(e, t) {
84
99
  const n = [
@@ -114,7 +129,12 @@ class cr {
114
129
  args: [i.ethAddress, t.ucKeyEpoch, i.btcPubKey]
115
130
  }))
116
131
  ];
117
- return this.readAll(n, e.vaultKeepers.length);
132
+ return this.readAll(
133
+ n,
134
+ e.vaultKeepers.length,
135
+ e.universalChallengers.length,
136
+ "getOperationKeysAtEpochs"
137
+ );
118
138
  }
119
139
  async getPayoutScriptsAtEpochs(e, t) {
120
140
  const n = await this.publicClient.multicall({
@@ -138,13 +158,17 @@ class cr {
138
158
  ],
139
159
  allowFailure: !1
140
160
  });
141
- return {
161
+ return te(
162
+ n.length,
163
+ 1 + e.vaultKeepers.length,
164
+ "getPayoutScriptsAtEpochs"
165
+ ), {
142
166
  vaultProvider: n[0],
143
167
  vaultKeepers: [...n.slice(1)]
144
168
  };
145
169
  }
146
170
  }
147
- const te = 65535;
171
+ const re = 65535;
148
172
  function G(r) {
149
173
  return {
150
174
  timelockAssert: r.timelockAssert,
@@ -162,7 +186,7 @@ function G(r) {
162
186
  minPrepeginDepth: r.minPrepeginDepth
163
187
  };
164
188
  }
165
- function re(r) {
189
+ function ne(r) {
166
190
  return {
167
191
  minimumPegInAmount: r.minimumPegInAmount,
168
192
  maxPegInAmount: r.maxPegInAmount,
@@ -172,14 +196,14 @@ function re(r) {
172
196
  expiredPegInGraceBlocks: r.expiredPegInGraceBlocks
173
197
  };
174
198
  }
175
- function ne(r) {
176
- if (r > BigInt(te))
199
+ function se(r) {
200
+ if (r > BigInt(re))
177
201
  throw new Error(
178
- `timelockAssert value ${r} exceeds uint16 max (${te})`
202
+ `timelockAssert value ${r} exceeds uint16 max (${re})`
179
203
  );
180
204
  return Number(r);
181
205
  }
182
- class lr {
206
+ class ur {
183
207
  constructor(e, t) {
184
208
  this.publicClient = e, this.contractAddress = t;
185
209
  }
@@ -188,8 +212,8 @@ class lr {
188
212
  address: this.contractAddress,
189
213
  abi: y,
190
214
  functionName: "getTBVProtocolParams"
191
- }), t = re(e);
192
- return Te(t), t;
215
+ }), t = ne(e);
216
+ return $e(t), t;
193
217
  }
194
218
  async getLatestOffchainParams() {
195
219
  const e = await this.publicClient.readContract({
@@ -197,7 +221,7 @@ class lr {
197
221
  abi: y,
198
222
  functionName: "getLatestOffchainParams"
199
223
  }), t = G(e);
200
- return K(t), t;
224
+ return U(t), t;
201
225
  }
202
226
  async getOffchainParamsByVersion(e) {
203
227
  const t = await this.publicClient.readContract({
@@ -206,7 +230,7 @@ class lr {
206
230
  functionName: "getOffchainParamsByVersion",
207
231
  args: [e]
208
232
  }), n = G(t);
209
- return K(n), n;
233
+ return U(n), n;
210
234
  }
211
235
  async getLatestOffchainParamsVersion() {
212
236
  const e = await this.publicClient.readContract({
@@ -214,11 +238,11 @@ class lr {
214
238
  abi: y,
215
239
  functionName: "latestOffchainParamsVersion"
216
240
  }), t = Number(e);
217
- return $e(t), t;
241
+ return Ve(t), t;
218
242
  }
219
243
  async getTimelockPeginByVersion(e) {
220
244
  const t = await this.getOffchainParamsByVersion(e);
221
- return ne(t.timelockAssert);
245
+ return se(t.timelockAssert);
222
246
  }
223
247
  /**
224
248
  * Read TBV protocol params, latest offchain params, and the latest version
@@ -252,21 +276,21 @@ class lr {
252
276
  }
253
277
  ],
254
278
  allowFailure: !1
255
- }), t = re(e[0]), n = G(e[1]), i = Number(e[2]), s = Number(e[3]), a = {
279
+ }), t = ne(e[0]), n = G(e[1]), i = Number(e[2]), s = Number(e[3]), a = {
256
280
  minimumPegInAmount: t.minimumPegInAmount,
257
281
  maxPegInAmount: t.maxPegInAmount,
258
282
  pegInAckTimeout: t.pegInAckTimeout,
259
283
  pegInActivationTimeout: t.pegInActivationTimeout,
260
284
  maxHtlcOutputCount: t.maxHtlcOutputCount,
261
285
  expiredPegInGraceBlocks: t.expiredPegInGraceBlocks,
262
- timelockPegin: ne(n.timelockAssert),
286
+ timelockPegin: se(n.timelockAssert),
263
287
  timelockRefund: n.tRefund,
264
288
  minVpCommissionBps: n.minVpCommissionBps,
265
289
  offchainParams: n,
266
290
  offchainParamsVersion: i,
267
291
  activeVaultCoreVersion: s
268
292
  };
269
- return Ve(a), a;
293
+ return Ie(a), a;
270
294
  }
271
295
  /**
272
296
  * Fetch every historical offchain params version in a single multicall.
@@ -294,7 +318,7 @@ class lr {
294
318
  for (let c = 0; c < n.length; c++) {
295
319
  const d = G(s[c]);
296
320
  try {
297
- K(d), a.set(n[c], d);
321
+ U(d), a.set(n[c], d);
298
322
  } catch (l) {
299
323
  e == null || e(
300
324
  n[c],
@@ -311,7 +335,7 @@ function H(r) {
311
335
  btcPubKey: e.btcPubKey
312
336
  }));
313
337
  }
314
- class ur {
338
+ class dr {
315
339
  constructor(e, t) {
316
340
  this.publicClient = e, this.contractAddress = t;
317
341
  }
@@ -342,7 +366,7 @@ class ur {
342
366
  });
343
367
  }
344
368
  }
345
- class dr {
369
+ class pr {
346
370
  constructor(e, t) {
347
371
  this.publicClient = e, this.contractAddress = t;
348
372
  }
@@ -371,16 +395,16 @@ class dr {
371
395
  });
372
396
  }
373
397
  }
374
- var De = /* @__PURE__ */ ((r) => (r[r.PENDING = 0] = "PENDING", r[r.VERIFIED = 1] = "VERIFIED", r[r.ACTIVE = 2] = "ACTIVE", r[r.REDEEMED = 3] = "REDEEMED", r[r.EXPIRED = 4] = "EXPIRED", r))(De || {});
375
- const se = new Set(Object.values(Oe)), Me = 200;
398
+ var Me = /* @__PURE__ */ ((r) => (r[r.PENDING = 0] = "PENDING", r[r.VERIFIED = 1] = "VERIFIED", r[r.ACTIVE = 2] = "ACTIVE", r[r.REDEEMED = 3] = "REDEEMED", r[r.EXPIRED = 4] = "EXPIRED", r))(Me || {});
399
+ const ie = new Set(Object.values(Ne)), je = 200;
376
400
  function h(r) {
377
401
  var e;
378
- return ((e = JSON.stringify(r)) == null ? void 0 : e.slice(0, Me)) ?? "undefined";
402
+ return ((e = JSON.stringify(r)) == null ? void 0 : e.slice(0, je)) ?? "undefined";
379
403
  }
380
- const je = "The vault provider returned an unexpected response. Please try again or contact support.";
404
+ const He = "The vault provider returned an unexpected response. Please try again or contact support.";
381
405
  class o extends Error {
382
406
  constructor(t) {
383
- super(je);
407
+ super(He);
384
408
  f(this, "detail");
385
409
  this.name = "VpResponseValidationError", this.detail = t;
386
410
  }
@@ -389,17 +413,17 @@ const N = 64;
389
413
  function T(r) {
390
414
  return typeof r == "string" && r.length > 0 && k.test(r);
391
415
  }
392
- function _e(r) {
416
+ function me(r) {
393
417
  return typeof r == "string" && r.length > 0;
394
418
  }
395
- function me(r, e) {
419
+ function ye(r, e) {
396
420
  if (!T(r))
397
421
  throw new o(
398
422
  `VP response validation failed: "${e}" must be a non-empty hex string, got ${h(r)}`
399
423
  );
400
424
  }
401
425
  function w(r, e) {
402
- if (!_e(r))
426
+ if (!me(r))
403
427
  throw new o(
404
428
  `VP response validation failed: "${e}" must be a non-empty string, got ${h(r)}`
405
429
  );
@@ -410,7 +434,7 @@ function Q(r, e) {
410
434
  `VP response validation failed: "${e}" must be a ${O} or ${j}-char hex string (BTC pubkey), got ${h(r)}`
411
435
  );
412
436
  }
413
- function He(r) {
437
+ function Le(r) {
414
438
  const e = r.presigning;
415
439
  if (e == null) return;
416
440
  if (typeof e != "object" || Array.isArray(e))
@@ -431,7 +455,7 @@ function He(r) {
431
455
  `VP response validation failed: "progress.presigning.vk_challenger_presigning_total" must be a number if present, got ${h(t.vk_challenger_presigning_total)}`
432
456
  );
433
457
  }
434
- function ye(r) {
458
+ function be(r) {
435
459
  if (r === null || typeof r != "object")
436
460
  throw new o(
437
461
  "VP response validation failed: getPeginStatus response is not an object"
@@ -445,15 +469,15 @@ function ye(r) {
445
469
  throw new o(
446
470
  'VP response validation failed: "status" must be a string'
447
471
  );
448
- if (!se.has(e.status))
472
+ if (!ie.has(e.status))
449
473
  throw new o(
450
- `VP response validation failed: unrecognized status "${e.status}". Expected one of: ${[...se].join(", ")}`
474
+ `VP response validation failed: unrecognized status "${e.status}". Expected one of: ${[...ie].join(", ")}`
451
475
  );
452
476
  if (e.progress === null || typeof e.progress != "object" || Array.isArray(e.progress))
453
477
  throw new o(
454
478
  'VP response validation failed: "progress" must be an object'
455
479
  );
456
- if (He(e.progress), typeof e.health_info != "string")
480
+ if (Le(e.progress), typeof e.health_info != "string")
457
481
  throw new o(
458
482
  'VP response validation failed: "health_info" must be a string'
459
483
  );
@@ -462,7 +486,7 @@ function ye(r) {
462
486
  `VP response validation failed: "last_error" must be a string if present, got ${h(e.last_error)}`
463
487
  );
464
488
  }
465
- function Le(r) {
489
+ function Ke(r) {
466
490
  if (r === null || typeof r != "object")
467
491
  throw new o(
468
492
  "VP response validation failed: requestDepositorPresignTransactions response is not an object"
@@ -478,7 +502,7 @@ function Le(r) {
478
502
  throw new o(
479
503
  'VP response validation failed: "depositor_graph" must be an object'
480
504
  );
481
- Ze(
505
+ Qe(
482
506
  e.depositor_graph
483
507
  );
484
508
  }
@@ -487,7 +511,7 @@ function A(r, e) {
487
511
  throw new o(
488
512
  `VP response validation failed: "${e}" must be an object`
489
513
  );
490
- me(r.tx_hex, `${e}.tx_hex`);
514
+ ye(r.tx_hex, `${e}.tx_hex`);
491
515
  }
492
516
  function Ue(r, e) {
493
517
  if (r === null || typeof r != "object")
@@ -497,7 +521,7 @@ function Ue(r, e) {
497
521
  const t = r;
498
522
  Q(t.claimer_pubkey, `${e}.claimer_pubkey`), A(t.claim_tx, `${e}.claim_tx`), A(t.assert_tx, `${e}.assert_tx`), A(t.payout_tx, `${e}.payout_tx`), w(t.payout_psbt, `${e}.payout_psbt`);
499
523
  }
500
- function Ke(r, e) {
524
+ function Xe(r, e) {
501
525
  if (r === null || typeof r != "object")
502
526
  throw new o(
503
527
  `VP response validation failed: "${e}" must be an object`
@@ -505,7 +529,7 @@ function Ke(r, e) {
505
529
  const t = r;
506
530
  w(t.wots_pks_json, `${e}.wots_pks_json`), w(t.gc_wots_keys_json, `${e}.gc_wots_keys_json`);
507
531
  }
508
- function Xe(r, e) {
532
+ function Fe(r, e) {
509
533
  if (r === null || typeof r != "object")
510
534
  throw new o(
511
535
  `VP response validation failed: "${e}" must be an object`
@@ -526,7 +550,7 @@ function Xe(r, e) {
526
550
  `VP response validation failed: "${e}.challenge_assert_connectors" must have exactly ${ee} entries, got ${t.challenge_assert_connectors.length}`
527
551
  );
528
552
  for (let n = 0; n < t.challenge_assert_connectors.length; n++)
529
- Ke(
553
+ Xe(
530
554
  t.challenge_assert_connectors[n],
531
555
  `${e}.challenge_assert_connectors[${n}]`
532
556
  );
@@ -535,18 +559,18 @@ function Xe(r, e) {
535
559
  `VP response validation failed: "${e}.output_label_hashes" must be an array`
536
560
  );
537
561
  for (let n = 0; n < t.output_label_hashes.length; n++)
538
- me(
562
+ ye(
539
563
  t.output_label_hashes[n],
540
564
  `${e}.output_label_hashes[${n}]`
541
565
  );
542
566
  }
543
- function Fe(r) {
567
+ function Je(r) {
544
568
  if (r === null || typeof r != "object")
545
569
  throw new o(
546
570
  "VP response validation failed: requestDepositorClaimerArtifacts response is not an object"
547
571
  );
548
572
  const e = r;
549
- if (!_e(e.tx_graph_json))
573
+ if (!me(e.tx_graph_json))
550
574
  throw new o(
551
575
  `VP response validation failed: "tx_graph_json" must be a non-empty string, got ${h(e.tx_graph_json)}`
552
576
  );
@@ -577,7 +601,7 @@ function Fe(r) {
577
601
  );
578
602
  }
579
603
  }
580
- function Je(r) {
604
+ function We(r) {
581
605
  if (r === null || typeof r != "object")
582
606
  throw new o(
583
607
  "VP response validation failed: pegout status payload is not an object"
@@ -596,16 +620,16 @@ function Je(r) {
596
620
  throw new o(
597
621
  `VP response validation failed: "claimer" must be an object or null, got ${h(e.claimer)}`
598
622
  );
599
- We(e.claimer);
623
+ Ye(e.claimer);
600
624
  }
601
625
  if (!Array.isArray(e.challengers))
602
626
  throw new o(
603
627
  `VP response validation failed: "challengers" must be an array, got ${h(e.challengers)}`
604
628
  );
605
629
  for (let t = 0; t < e.challengers.length; t++)
606
- Ye(e.challengers[t], t);
630
+ ze(e.challengers[t], t);
607
631
  }
608
- function We(r) {
632
+ function Ye(r) {
609
633
  if (w(r.status, "claimer.status"), typeof r.failed != "boolean")
610
634
  throw new o(
611
635
  `VP response validation failed: "claimer.failed" must be a boolean, got ${h(r.failed)}`
@@ -619,7 +643,7 @@ function We(r) {
619
643
  `VP response validation failed: "claimer.updated_at" must be a number, got ${h(r.updated_at)}`
620
644
  );
621
645
  }
622
- function Ye(r, e) {
646
+ function ze(r, e) {
623
647
  if (r === null || typeof r != "object")
624
648
  throw new o(
625
649
  `VP response validation failed: "challengers[${e}]" must be an object, got ${h(r)}`
@@ -646,17 +670,17 @@ function D(r, e) {
646
670
  `VP response validation failed: "${e}" must be a string or null, got ${h(r)}`
647
671
  );
648
672
  }
649
- function ze(r) {
650
- be(r, "batchGetPeginStatus", (e) => {
651
- e.result !== null && ye(e.result);
673
+ function qe(r) {
674
+ we(r, "batchGetPeginStatus", (e) => {
675
+ e.result !== null && be(e.result);
652
676
  });
653
677
  }
654
- function qe(r) {
655
- be(r, "batchGetPegoutStatus", (e) => {
656
- e.result !== null && Je(e.result);
678
+ function Ze(r) {
679
+ we(r, "batchGetPegoutStatus", (e) => {
680
+ e.result !== null && We(e.result);
657
681
  });
658
682
  }
659
- function be(r, e, t) {
683
+ function we(r, e, t) {
660
684
  if (r === null || typeof r != "object")
661
685
  throw new o(
662
686
  `VP response validation failed: ${e} response is not an object`
@@ -692,13 +716,13 @@ function be(r, e, t) {
692
716
  t(a, i);
693
717
  }
694
718
  }
695
- function Ze(r) {
719
+ function Qe(r) {
696
720
  if (A(r.claim_tx, "depositor_graph.claim_tx"), A(r.assert_tx, "depositor_graph.assert_tx"), A(r.payout_tx, "depositor_graph.payout_tx"), w(r.payout_psbt, "depositor_graph.payout_psbt"), !Array.isArray(r.challenger_presign_data))
697
721
  throw new o(
698
722
  'VP response validation failed: "depositor_graph.challenger_presign_data" must be an array'
699
723
  );
700
724
  for (let e = 0; e < r.challenger_presign_data.length; e++)
701
- Xe(
725
+ Fe(
702
726
  r.challenger_presign_data[e],
703
727
  `depositor_graph.challenger_presign_data[${e}]`
704
728
  );
@@ -707,13 +731,13 @@ function Ze(r) {
707
731
  'VP response validation failed: "depositor_graph.offchain_params_version" must be a number'
708
732
  );
709
733
  }
710
- const Qe = 6e4;
711
- class et {
734
+ const et = 6e4;
735
+ class tt {
712
736
  constructor(e, t) {
713
737
  f(this, "client");
714
738
  const n = {
715
739
  baseUrl: e,
716
- timeout: (t == null ? void 0 : t.timeout) ?? Qe,
740
+ timeout: (t == null ? void 0 : t.timeout) ?? et,
717
741
  retries: t == null ? void 0 : t.retries,
718
742
  retryDelay: t == null ? void 0 : t.retryDelay,
719
743
  retryableFor: t == null ? void 0 : t.retryableFor,
@@ -721,7 +745,7 @@ class et {
721
745
  tokenProvider: t == null ? void 0 : t.tokenProvider,
722
746
  maxResponseBytes: t == null ? void 0 : t.maxResponseBytes
723
747
  };
724
- this.client = new fe(n);
748
+ this.client = new _e(n);
725
749
  }
726
750
  /**
727
751
  * Request the payout/claim/assert transactions that the depositor
@@ -729,7 +753,7 @@ class et {
729
753
  */
730
754
  async requestDepositorPresignTransactions(e, t) {
731
755
  const n = await this.client.call("vaultProvider_requestDepositorPresignTransactions", e, t);
732
- return Le(n), n;
756
+ return Ke(n), n;
733
757
  }
734
758
  /**
735
759
  * Submit the depositor's pre-signatures for the payout transactions
@@ -760,7 +784,7 @@ class et {
760
784
  */
761
785
  async requestDepositorClaimerArtifacts(e, t) {
762
786
  const n = await this.client.call("vaultProvider_requestDepositorClaimerArtifacts", e, t);
763
- return Fe(n), n;
787
+ return Je(n), n;
764
788
  }
765
789
  /** Get the current pegin status from the vault provider daemon. */
766
790
  async getPeginStatus(e, t) {
@@ -769,7 +793,7 @@ class et {
769
793
  e,
770
794
  t
771
795
  );
772
- return ye(n), n;
796
+ return be(n), n;
773
797
  }
774
798
  /**
775
799
  * Get pegin status for many txids in one round trip. Per-result envelope
@@ -778,7 +802,7 @@ class et {
778
802
  */
779
803
  async batchGetPeginStatus(e, t) {
780
804
  const n = await this.client.call("vaultProvider_batchGetPeginStatus", e, t);
781
- return ze(n), n;
805
+ return qe(n), n;
782
806
  }
783
807
  /**
784
808
  * Get pegout status for many txids in one round trip. Same per-result
@@ -786,23 +810,23 @@ class et {
786
810
  */
787
811
  async batchGetPegoutStatus(e, t) {
788
812
  const n = await this.client.call("vaultProvider_batchGetPegoutStatus", e, t);
789
- return qe(n), n;
813
+ return Ze(n), n;
790
814
  }
791
815
  }
792
- const tt = "BIP0322-signed-message", rt = "TapTweak", we = 32, nt = 64;
793
- function xe(r, e) {
816
+ const rt = "BIP0322-signed-message", nt = "TapTweak", xe = 32, st = 64;
817
+ function Pe(r, e) {
794
818
  const t = new TextEncoder().encode(r), n = Y(t), i = new Uint8Array(n.length * 2 + e.length);
795
819
  return i.set(n, 0), i.set(n, n.length), i.set(e, n.length * 2), Y(i);
796
820
  }
797
- function st(r) {
798
- if (r.length !== we) return null;
799
- const e = xe(rt, r), t = U.xOnlyPointAddTweak(r, e);
821
+ function it(r) {
822
+ if (r.length !== xe) return null;
823
+ const e = Pe(nt, r), t = K.xOnlyPointAddTweak(r, e);
800
824
  return t ? t.xOnlyPubkey : null;
801
825
  }
802
- function it(r, e, t) {
803
- if (e.length !== we || t.length !== nt) return !1;
826
+ function at(r, e, t) {
827
+ if (e.length !== xe || t.length !== st) return !1;
804
828
  try {
805
- const n = xe(tt, r), i = Be.p2tr({
829
+ const n = Pe(rt, r), i = Ge.p2tr({
806
830
  internalPubkey: V.from(e)
807
831
  });
808
832
  if (!i.output) return !1;
@@ -830,8 +854,8 @@ function it(r, e, t) {
830
854
  [s],
831
855
  [a],
832
856
  X.SIGHASH_DEFAULT
833
- ), x = st(e);
834
- return x ? U.verifySchnorr(m, x, t) : !1;
857
+ ), x = it(e);
858
+ return x ? K.verifySchnorr(m, x, t) : !1;
835
859
  } catch {
836
860
  return !1;
837
861
  }
@@ -861,30 +885,30 @@ function L(r, e) {
861
885
  i[1 + s] = Number(n >> BigInt((7 - s) * 8)) & 255;
862
886
  return i;
863
887
  }
864
- function Pe(...r) {
888
+ function ve(...r) {
865
889
  const e = r.reduce((i, s) => i + s.length, 0), t = new Uint8Array(e);
866
890
  let n = 0;
867
891
  for (const i of r)
868
892
  t.set(i, n), n += i.length;
869
893
  return t;
870
894
  }
871
- function ie(r) {
895
+ function ae(r) {
872
896
  const t = [L(4, r.length)];
873
897
  for (const n of r)
874
898
  t.push(L(0, n));
875
- return Pe(...t);
899
+ return ve(...t);
876
900
  }
877
- function at(r, e, t) {
901
+ function ot(r, e, t) {
878
902
  if (!Number.isSafeInteger(t) || t < 0)
879
903
  throw new Error(
880
904
  `encodeServerIdentityPayload: expires_at must be a non-negative safe integer, got ${t}`
881
905
  );
882
- const n = L(4, 3), i = ie(r), s = ie(e), a = L(0, t);
883
- return Pe(n, i, s, a);
906
+ const n = L(4, 3), i = ae(r), s = ae(e), a = L(0, t);
907
+ return ve(n, i, s, a);
884
908
  }
885
- const ot = new TextEncoder().encode(
909
+ const ct = new TextEncoder().encode(
886
910
  "btc-auth.server-identity.v1"
887
- ), ct = 2 * 3600;
911
+ ), lt = 2 * 3600;
888
912
  class b extends Error {
889
913
  constructor(e, t) {
890
914
  super(e), this.reason = t, this.name = "ServerIdentityError";
@@ -896,8 +920,8 @@ function M(r) {
896
920
  e[t] = parseInt(r.slice(t * 2, t * 2 + 2), 16);
897
921
  return e;
898
922
  }
899
- function lt(r) {
900
- const { proof: e, pinnedServerPubkey: t, now: n } = r, i = r.maxLifetimeSecs ?? ct, s = I(t).toLowerCase();
923
+ function ut(r) {
924
+ const { proof: e, pinnedServerPubkey: t, now: n } = r, i = r.maxLifetimeSecs ?? lt, s = I(t).toLowerCase();
901
925
  if (s.length !== O || !k.test(s))
902
926
  throw new b(
903
927
  `pinnedServerPubkey must be 32-byte hex; got ${s.length} chars`,
@@ -952,50 +976,50 @@ function lt(r) {
952
976
  "invalid_ephemeral_pubkey"
953
977
  );
954
978
  const l = M(c);
955
- if (!U.isPoint(l))
979
+ if (!K.isPoint(l))
956
980
  throw new b(
957
981
  "ephemeral_pubkey is not a valid secp256k1 point",
958
982
  "invalid_ephemeral_pubkey"
959
983
  );
960
984
  const g = I(e.signature).toLowerCase();
961
- if (g.length !== Ie || !k.test(g))
985
+ if (g.length !== Re || !k.test(g))
962
986
  throw new b(
963
987
  `signature must be 64-byte Schnorr hex; got ${g.length} chars`,
964
988
  "invalid_signature_encoding"
965
989
  );
966
- const m = at(
967
- ot,
990
+ const m = ot(
991
+ ct,
968
992
  M(c),
969
993
  e.expires_at
970
994
  );
971
- if (!it(m, M(a), M(g)))
995
+ if (!at(m, M(a), M(g)))
972
996
  throw new b(
973
997
  "BIP-322 signature verification failed — ephemeral key is not attested by pinned server pubkey",
974
998
  "signature_verification_failed"
975
999
  );
976
1000
  }
977
- const ut = /* @__PURE__ */ new Set([
1001
+ const dt = /* @__PURE__ */ new Set([
978
1002
  "vaultProvider_submitDepositorWotsKey",
979
1003
  "vaultProvider_submitDepositorPresignatures",
980
1004
  "vaultProvider_requestDepositorPresignTransactions"
981
- ]), dt = /* @__PURE__ */ new Set([
1005
+ ]), pt = /* @__PURE__ */ new Set([
982
1006
  "vaultProvider_requestDepositorClaimerArtifacts"
983
- ]), pt = 6e4, z = "auth_createDepositorToken", q = "auth_createDepositorTokenGrpc";
984
- function ve(r, e) {
985
- return new fe({
1007
+ ]), ht = 6e4, z = "auth_createDepositorToken", q = "auth_createDepositorTokenGrpc";
1008
+ function Ae(r, e) {
1009
+ return new _e({
986
1010
  baseUrl: r,
987
- timeout: pt,
1011
+ timeout: ht,
988
1012
  headers: e,
989
1013
  retryableFor: (t) => t === z || t === q
990
1014
  });
991
1015
  }
992
- const ht = 0, gt = 1, F = 2, ft = 3, _t = 4, mt = 5, yt = 6, bt = 7, ae = 24, wt = 28, xt = 20, Pt = 21, vt = 22, oe = 256;
1016
+ const gt = 0, ft = 1, F = 2, _t = 3, mt = 4, yt = 5, bt = 6, wt = 7, oe = 24, xt = 28, Pt = 20, vt = 21, At = 22, ce = 256;
993
1017
  class v extends Error {
994
1018
  constructor(e) {
995
1019
  super(`CBOR decode: ${e}`), this.name = "CborDecodeError";
996
1020
  }
997
1021
  }
998
- class Ae {
1022
+ class Ee {
999
1023
  constructor(e) {
1000
1024
  f(this, "buf");
1001
1025
  /** Current read offset. Public so callers can slice encoded sub-ranges. */
@@ -1015,13 +1039,13 @@ class Ae {
1015
1039
  */
1016
1040
  readHead() {
1017
1041
  const e = this.nextByte(), t = e >> 5, n = e & 31;
1018
- if (n < ae)
1042
+ if (n < oe)
1019
1043
  return { major: t, arg: n };
1020
- if (n >= wt)
1044
+ if (n >= xt)
1021
1045
  throw new v(
1022
1046
  `unsupported additional info ${n} (indefinite-length or reserved)`
1023
1047
  );
1024
- const i = 1 << n - ae;
1048
+ const i = 1 << n - oe;
1025
1049
  let s = 0n;
1026
1050
  for (let a = 0; a < i; a++)
1027
1051
  s = s << 8n | BigInt(this.nextByte());
@@ -1056,29 +1080,29 @@ class Ae {
1056
1080
  * native call stack (see {@link MAX_NESTING_DEPTH}).
1057
1081
  */
1058
1082
  readValue(e = 0) {
1059
- if (e > oe)
1083
+ if (e > ce)
1060
1084
  throw new v(
1061
- `nesting exceeds maximum depth ${oe}`
1085
+ `nesting exceeds maximum depth ${ce}`
1062
1086
  );
1063
1087
  const t = this.readHead();
1064
1088
  switch (t.major) {
1065
- case ht:
1066
- return t.arg;
1067
1089
  case gt:
1090
+ return t.arg;
1091
+ case ft:
1068
1092
  return -1 - t.arg;
1069
1093
  case F:
1070
1094
  return this.readBytes(t.arg);
1071
- case ft:
1095
+ case _t:
1072
1096
  return new TextDecoder("utf-8", { fatal: !0 }).decode(
1073
1097
  this.readBytes(t.arg)
1074
1098
  );
1075
- case _t: {
1099
+ case mt: {
1076
1100
  const n = [];
1077
1101
  for (let i = 0; i < t.arg; i++)
1078
1102
  n.push(this.readValue(e + 1));
1079
1103
  return n;
1080
1104
  }
1081
- case mt: {
1105
+ case yt: {
1082
1106
  const n = /* @__PURE__ */ new Map();
1083
1107
  for (let i = 0; i < t.arg; i++) {
1084
1108
  const s = this.readValue(e + 1), a = this.readValue(e + 1);
@@ -1086,12 +1110,12 @@ class Ae {
1086
1110
  }
1087
1111
  return n;
1088
1112
  }
1089
- case yt:
1090
- return { tag: t.arg, value: this.readValue(e + 1) };
1091
1113
  case bt:
1092
- if (t.arg === xt) return !1;
1093
- if (t.arg === Pt) return !0;
1094
- if (t.arg === vt) return null;
1114
+ return { tag: t.arg, value: this.readValue(e + 1) };
1115
+ case wt:
1116
+ if (t.arg === Pt) return !1;
1117
+ if (t.arg === vt) return !0;
1118
+ if (t.arg === At) return null;
1095
1119
  throw new v(
1096
1120
  `unsupported simple/float value ${t.arg}`
1097
1121
  );
@@ -1100,29 +1124,29 @@ class Ae {
1100
1124
  }
1101
1125
  }
1102
1126
  }
1103
- function Ee(r) {
1104
- const e = new Ae(r), t = e.readValue();
1127
+ function Se(r) {
1128
+ const e = new Ee(r), t = e.readValue();
1105
1129
  if (e.pos !== r.length)
1106
1130
  throw new v("trailing bytes after top-level item");
1107
1131
  return t;
1108
1132
  }
1109
- const At = "vaultd-jsonrpc", Et = "vaultd-grpc", ce = 18, Z = 4, le = -47, St = 1, ue = 64, kt = 128, Ct = 96, Tt = 64, $t = 1, Vt = 2, It = 3, Rt = 4, Ot = 5, Nt = 6, Bt = 7, de = new TextEncoder().encode("Signature1");
1133
+ const Et = "vaultd-jsonrpc", St = "vaultd-grpc", le = 18, Z = 4, ue = -47, kt = 1, de = 64, Ct = 128, Tt = 96, $t = 64, Vt = 1, It = 2, Rt = 3, Ot = 4, Nt = 5, Bt = 6, Gt = 7, pe = new TextEncoder().encode("Signature1");
1110
1134
  class p extends Error {
1111
1135
  constructor(e, t) {
1112
1136
  super(e), this.reason = t, this.name = "CwtVerificationError";
1113
1137
  }
1114
1138
  }
1115
- function Gt(r) {
1116
- const e = pe(
1139
+ function Dt(r) {
1140
+ const e = he(
1117
1141
  r.expectedIssuerXOnlyPubkey,
1118
1142
  "expectedIssuerXOnlyPubkey"
1119
- ), t = pe(
1143
+ ), t = he(
1120
1144
  r.expectedAudienceXOnlyPubkey,
1121
1145
  "expectedAudienceXOnlyPubkey"
1122
- ), n = Lt(r.ephemeralPubkeyHex), i = Kt(r.token), s = new Ae(i), a = s.readHead();
1123
- if (a.major !== 6 || a.arg !== ce)
1146
+ ), n = Kt(r.ephemeralPubkeyHex), i = Xt(r.token), s = new Ee(i), a = s.readHead();
1147
+ if (a.major !== 6 || a.arg !== le)
1124
1148
  throw new p(
1125
- `token is not a COSE Sign1 tagged value (tag ${ce})`,
1149
+ `token is not a COSE Sign1 tagged value (tag ${le})`,
1126
1150
  "invalid_token_structure"
1127
1151
  );
1128
1152
  const c = s.readHead();
@@ -1134,9 +1158,9 @@ function Gt(r) {
1134
1158
  const d = s.pos, l = s.readByteString(), g = i.subarray(d, s.pos);
1135
1159
  s.readValue();
1136
1160
  const m = s.pos, x = s.readByteString(), E = i.subarray(m, s.pos), C = s.readByteString();
1137
- if (C.length !== ue)
1161
+ if (C.length !== de)
1138
1162
  throw new p(
1139
- `COSE signature must be ${ue} bytes, got ${C.length}`,
1163
+ `COSE signature must be ${de} bytes, got ${C.length}`,
1140
1164
  "invalid_token_structure"
1141
1165
  );
1142
1166
  if (s.pos !== i.length)
@@ -1144,19 +1168,19 @@ function Gt(r) {
1144
1168
  "COSE Sign1 token has trailing bytes after the signature",
1145
1169
  "invalid_token_structure"
1146
1170
  );
1147
- const P = Dt(l);
1148
- if (P !== le)
1171
+ const P = Mt(l);
1172
+ if (P !== ue)
1149
1173
  throw new p(
1150
- `unexpected COSE algorithm ${P} (expected ES256K ${le})`,
1174
+ `unexpected COSE algorithm ${P} (expected ES256K ${ue})`,
1151
1175
  "unexpected_algorithm"
1152
1176
  );
1153
- const $ = Mt(g, E), _ = Y($);
1154
- if (!U.verify(_, n, C, !0))
1177
+ const $ = jt(g, E), _ = Y($);
1178
+ if (!K.verify(_, n, C, !0))
1155
1179
  throw new p(
1156
1180
  "COSE signature does not verify against the server's ephemeral key",
1157
1181
  "signature_verification_failed"
1158
1182
  );
1159
- const u = jt(x), S = u.audience.toLowerCase();
1183
+ const u = Ht(x), S = u.audience.toLowerCase();
1160
1184
  if (S.length !== O || !k.test(S))
1161
1185
  throw new p(
1162
1186
  "token `aud` is not a 32-byte x-only pubkey hex",
@@ -1206,19 +1230,19 @@ function Gt(r) {
1206
1230
  issuedAt: u.issuedAt
1207
1231
  };
1208
1232
  }
1209
- function Dt(r) {
1233
+ function Mt(r) {
1210
1234
  if (r.length === 0)
1211
1235
  throw new p(
1212
1236
  "empty COSE protected header (no algorithm)",
1213
1237
  "unexpected_algorithm"
1214
1238
  );
1215
- const e = Ee(r);
1239
+ const e = Se(r);
1216
1240
  if (!(e instanceof Map))
1217
1241
  throw new p(
1218
1242
  "COSE protected header is not a map",
1219
1243
  "invalid_token_structure"
1220
1244
  );
1221
- const t = e.get(St);
1245
+ const t = e.get(kt);
1222
1246
  if (typeof t != "number")
1223
1247
  throw new p(
1224
1248
  "COSE protected header missing integer algorithm label",
@@ -1226,32 +1250,32 @@ function Dt(r) {
1226
1250
  );
1227
1251
  return t;
1228
1252
  }
1229
- function Mt(r, e) {
1230
- return Xt(
1231
- Uint8Array.of(kt | Z),
1232
- Uint8Array.of(Ct | de.length),
1233
- de,
1253
+ function jt(r, e) {
1254
+ return Ft(
1255
+ Uint8Array.of(Ct | Z),
1256
+ Uint8Array.of(Tt | pe.length),
1257
+ pe,
1234
1258
  r,
1235
- Uint8Array.of(Tt),
1259
+ Uint8Array.of($t),
1236
1260
  e
1237
1261
  );
1238
1262
  }
1239
- function jt(r) {
1240
- const e = Ee(r);
1263
+ function Ht(r) {
1264
+ const e = Se(r);
1241
1265
  if (!(e instanceof Map))
1242
1266
  throw new p(
1243
1267
  "CWT claims root is not a map",
1244
1268
  "invalid_claims"
1245
1269
  );
1246
- if (Ht(e, Bt, "cti").length === 0)
1270
+ if (Lt(e, Gt, "cti").length === 0)
1247
1271
  throw new p("token cti is empty", "invalid_claims");
1248
1272
  return {
1249
- issuer: J(e, $t, "iss"),
1250
- subject: J(e, Vt, "sub"),
1251
- audience: J(e, It, "aud"),
1252
- expiresAt: W(e, Rt, "exp"),
1253
- notBefore: W(e, Ot, "nbf"),
1254
- issuedAt: W(e, Nt, "iat")
1273
+ issuer: J(e, Vt, "iss"),
1274
+ subject: J(e, It, "sub"),
1275
+ audience: J(e, Rt, "aud"),
1276
+ expiresAt: W(e, Ot, "exp"),
1277
+ notBefore: W(e, Nt, "nbf"),
1278
+ issuedAt: W(e, Bt, "iat")
1255
1279
  };
1256
1280
  }
1257
1281
  function J(r, e, t) {
@@ -1263,7 +1287,7 @@ function J(r, e, t) {
1263
1287
  );
1264
1288
  return n;
1265
1289
  }
1266
- function Ht(r, e, t) {
1290
+ function Lt(r, e, t) {
1267
1291
  const n = r.get(e);
1268
1292
  if (!(n instanceof Uint8Array))
1269
1293
  throw new p(
@@ -1281,7 +1305,7 @@ function W(r, e, t) {
1281
1305
  );
1282
1306
  return n;
1283
1307
  }
1284
- function pe(r, e) {
1308
+ function he(r, e) {
1285
1309
  const t = I(r).toLowerCase();
1286
1310
  if (t.length !== O || !k.test(t))
1287
1311
  throw new p(
@@ -1290,14 +1314,14 @@ function pe(r, e) {
1290
1314
  );
1291
1315
  return t;
1292
1316
  }
1293
- function Lt(r) {
1317
+ function Kt(r) {
1294
1318
  const e = I(r).toLowerCase(), t = e.slice(0, 2);
1295
1319
  if (e.length !== j || !k.test(e) || t !== "02" && t !== "03")
1296
1320
  throw new p(
1297
1321
  "ephemeralPubkeyHex must be 33-byte compressed pubkey hex (prefix 02/03)",
1298
1322
  "invalid_input"
1299
1323
  );
1300
- return Re(e);
1324
+ return Oe(e);
1301
1325
  }
1302
1326
  const Ut = (() => {
1303
1327
  const r = new Int16Array(128).fill(-1), e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
@@ -1305,7 +1329,7 @@ const Ut = (() => {
1305
1329
  r[e.charCodeAt(t)] = t;
1306
1330
  return r;
1307
1331
  })();
1308
- function Kt(r) {
1332
+ function Xt(r) {
1309
1333
  const e = r.length, t = Math.floor(e / 4), n = e % 4;
1310
1334
  if (n === 1)
1311
1335
  throw new p(
@@ -1335,15 +1359,15 @@ function Kt(r) {
1335
1359
  }
1336
1360
  return s;
1337
1361
  }
1338
- function Xt(...r) {
1362
+ function Ft(...r) {
1339
1363
  const e = r.reduce((i, s) => i + s.length, 0), t = new Uint8Array(e);
1340
1364
  let n = 0;
1341
1365
  for (const i of r)
1342
1366
  t.set(i, n), n += i.length;
1343
1367
  return t;
1344
1368
  }
1345
- const he = 4102444800, Ft = 30;
1346
- class Jt {
1369
+ const ge = 4102444800, Jt = 30;
1370
+ class Wt {
1347
1371
  constructor(e) {
1348
1372
  // `client` is the only mutable field — see `setClient`. The
1349
1373
  // identity-bearing fields (peginTxid/authAnchorHex/pinnedServerPubkey)
@@ -1364,7 +1388,7 @@ class Jt {
1364
1388
  /** Cached gRPC-subject bearer (auth_createDepositorTokenGrpc). */
1365
1389
  f(this, "cachedGrpc", null);
1366
1390
  f(this, "inFlightGrpc", null);
1367
- this.client = e.client, this.peginTxid = e.peginTxid, this.authAnchorHex = e.authAnchorHex, this.pinnedServerPubkey = e.pinnedServerPubkey, this.expectedAudienceXOnlyPubkey = e.expectedAudienceXOnlyPubkey, this.authGatedMethods = e.authGatedMethods, this.grpcGatedMethods = e.grpcGatedMethods, this.refreshSkewSecs = e.refreshSkewSecs ?? Ft, this.now = e.now ?? (() => Math.floor(Date.now() / 1e3));
1391
+ this.client = e.client, this.peginTxid = e.peginTxid, this.authAnchorHex = e.authAnchorHex, this.pinnedServerPubkey = e.pinnedServerPubkey, this.expectedAudienceXOnlyPubkey = e.expectedAudienceXOnlyPubkey, this.authGatedMethods = e.authGatedMethods, this.grpcGatedMethods = e.grpcGatedMethods, this.refreshSkewSecs = e.refreshSkewSecs ?? Jt, this.now = e.now ?? (() => Math.floor(Date.now() / 1e3));
1368
1392
  }
1369
1393
  /**
1370
1394
  * Return a bearer token for `method`, or `null` if `method` is not
@@ -1423,7 +1447,7 @@ class Jt {
1423
1447
  pegin_txid: this.peginTxid,
1424
1448
  auth_anchor: this.authAnchorHex
1425
1449
  });
1426
- if (lt({
1450
+ if (ut({
1427
1451
  proof: s.server_identity,
1428
1452
  pinnedServerPubkey: this.pinnedServerPubkey,
1429
1453
  now: this.now()
@@ -1432,15 +1456,15 @@ class Jt {
1432
1456
  `VpTokenProvider: invalid token in acquire response (expected non-empty string, got ${typeof s.token})`
1433
1457
  );
1434
1458
  const a = this.now();
1435
- if (!Number.isSafeInteger(s.expires_at) || s.expires_at <= a || s.expires_at > he)
1459
+ if (!Number.isSafeInteger(s.expires_at) || s.expires_at <= a || s.expires_at > ge)
1436
1460
  throw new Error(
1437
- `VpTokenProvider: invalid expires_at in acquire response (got ${JSON.stringify(s.expires_at)}; must be a safe integer in (${a}, ${he}])`
1461
+ `VpTokenProvider: invalid expires_at in acquire response (got ${JSON.stringify(s.expires_at)}; must be a safe integer in (${a}, ${ge}])`
1438
1462
  );
1439
- Gt({
1463
+ Dt({
1440
1464
  token: s.token,
1441
1465
  ephemeralPubkeyHex: s.server_identity.ephemeral_pubkey,
1442
1466
  expectedIssuerXOnlyPubkey: this.pinnedServerPubkey,
1443
- expectedSubject: e === "grpc" ? Et : At,
1467
+ expectedSubject: e === "grpc" ? St : Et,
1444
1468
  expectedAudienceXOnlyPubkey: this.expectedAudienceXOnlyPubkey,
1445
1469
  responseExpiresAt: s.expires_at,
1446
1470
  serverIdentityExpiresAt: s.server_identity.expires_at,
@@ -1458,7 +1482,7 @@ class Jt {
1458
1482
  return e === "grpc" ? this.inFlightGrpc = i : this.inFlightJsonRpc = i, i;
1459
1483
  }
1460
1484
  }
1461
- class Wt {
1485
+ class Yt {
1462
1486
  constructor() {
1463
1487
  f(this, "entries", /* @__PURE__ */ new Map());
1464
1488
  }
@@ -1485,14 +1509,14 @@ class Wt {
1485
1509
  );
1486
1510
  return t.provider.setClient(e.client), t.provider;
1487
1511
  }
1488
- const n = new Jt({
1512
+ const n = new Wt({
1489
1513
  client: e.client,
1490
1514
  peginTxid: e.peginTxid,
1491
1515
  authAnchorHex: e.authAnchorHex,
1492
1516
  pinnedServerPubkey: e.pinnedServerPubkey,
1493
1517
  expectedAudienceXOnlyPubkey: e.expectedAudienceXOnlyPubkey,
1494
- authGatedMethods: ut,
1495
- grpcGatedMethods: dt
1518
+ authGatedMethods: dt,
1519
+ grpcGatedMethods: pt
1496
1520
  });
1497
1521
  return this.entries.set(e.peginTxid, {
1498
1522
  provider: n,
@@ -1527,38 +1551,38 @@ class Wt {
1527
1551
  return this.entries.size;
1528
1552
  }
1529
1553
  }
1530
- const Se = new Wt();
1531
- function pr(r) {
1554
+ const ke = new Yt();
1555
+ function hr(r) {
1532
1556
  var n;
1533
- const e = ve(
1557
+ const e = Ae(
1534
1558
  r.baseUrl,
1535
1559
  (n = r.options) == null ? void 0 : n.headers
1536
- ), t = Se.getOrCreate({
1560
+ ), t = ke.getOrCreate({
1537
1561
  client: e,
1538
1562
  peginTxid: r.peginTxid,
1539
1563
  authAnchorHex: r.authAnchorHex,
1540
1564
  pinnedServerPubkey: r.pinnedServerPubkey,
1541
- expectedAudienceXOnlyPubkey: ge(
1565
+ expectedAudienceXOnlyPubkey: fe(
1542
1566
  r.depositorBtcPubkey
1543
1567
  )
1544
1568
  });
1545
- return new et(r.baseUrl, {
1569
+ return new tt(r.baseUrl, {
1546
1570
  ...r.options,
1547
1571
  tokenProvider: t
1548
1572
  });
1549
1573
  }
1550
- function hr(r) {
1551
- Se.getOrCreate({
1552
- client: ve(r.baseUrl, r.headers),
1574
+ function gr(r) {
1575
+ ke.getOrCreate({
1576
+ client: Ae(r.baseUrl, r.headers),
1553
1577
  peginTxid: r.peginTxid,
1554
1578
  authAnchorHex: r.authAnchorHex,
1555
1579
  pinnedServerPubkey: r.pinnedServerPubkey,
1556
- expectedAudienceXOnlyPubkey: ge(
1580
+ expectedAudienceXOnlyPubkey: fe(
1557
1581
  r.depositorBtcPubkey
1558
1582
  )
1559
1583
  });
1560
1584
  }
1561
- function Yt(r, e) {
1585
+ function zt(r, e) {
1562
1586
  const t = /* @__PURE__ */ new Set();
1563
1587
  for (const d of r)
1564
1588
  t.add(d.toLowerCase());
@@ -1580,7 +1604,7 @@ function Yt(r, e) {
1580
1604
  i.has(d) || c.push(d);
1581
1605
  return { byTxid: n, missing: c, unexpected: a, duplicate: s };
1582
1606
  }
1583
- async function gr(r) {
1607
+ async function fr(r) {
1584
1608
  const {
1585
1609
  items: e,
1586
1610
  getTxid: t,
@@ -1591,7 +1615,7 @@ async function gr(r) {
1591
1615
  onDuplicateBatch: c,
1592
1616
  onWholeBatchError: d,
1593
1617
  onUnexpected: l,
1594
- batchSize: g = Ne
1618
+ batchSize: g = Be
1595
1619
  } = r;
1596
1620
  if (!Number.isInteger(g) || g <= 0)
1597
1621
  throw new Error(
@@ -1606,7 +1630,7 @@ async function gr(r) {
1606
1630
  let P;
1607
1631
  try {
1608
1632
  const _ = await n(C);
1609
- P = Yt(C, _.results);
1633
+ P = zt(C, _.results);
1610
1634
  } catch (_) {
1611
1635
  d(x, _);
1612
1636
  continue;
@@ -1634,21 +1658,21 @@ async function gr(r) {
1634
1658
  }
1635
1659
  }
1636
1660
  export {
1637
- De as O,
1661
+ Me as O,
1638
1662
  b as S,
1639
- et as V,
1663
+ tt as V,
1640
1664
  o as a,
1641
- gr as b,
1642
- lt as c,
1643
- Wt as d,
1644
- Se as e,
1645
- pr as f,
1646
- cr as g,
1647
- lr as h,
1648
- dr as i,
1649
- ur as j,
1650
- hr as p,
1651
- or as r,
1652
- Fe as v
1665
+ fr as b,
1666
+ ut as c,
1667
+ Yt as d,
1668
+ ke as e,
1669
+ hr as f,
1670
+ lr as g,
1671
+ ur as h,
1672
+ pr as i,
1673
+ dr as j,
1674
+ gr as p,
1675
+ cr as r,
1676
+ Je as v
1653
1677
  };
1654
- //# sourceMappingURL=batchPoll-L9LzMl1E.js.map
1678
+ //# sourceMappingURL=batchPoll-BotUFjtF.js.map