@babylonlabs-io/ts-sdk 0.37.2 → 0.38.0

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.
Files changed (109) hide show
  1. package/dist/BTCVaultRegistry.abi-CHFGevwa.cjs +2 -0
  2. package/dist/BTCVaultRegistry.abi-CHFGevwa.cjs.map +1 -0
  3. package/dist/{BTCVaultRegistry.abi-DbJ5lsFJ.js → BTCVaultRegistry.abi-Cq9-JlqT.js} +38 -2
  4. package/dist/BTCVaultRegistry.abi-Cq9-JlqT.js.map +1 -0
  5. package/dist/{PayoutManager-BxAY2x0g.cjs → PayoutManager-BfT0V-tm.cjs} +2 -2
  6. package/dist/{PayoutManager-BxAY2x0g.cjs.map → PayoutManager-BfT0V-tm.cjs.map} +1 -1
  7. package/dist/{PayoutManager-sfxuOBGq.js → PayoutManager-Cf51DBcu.js} +2 -2
  8. package/dist/{PayoutManager-sfxuOBGq.js.map → PayoutManager-Cf51DBcu.js.map} +1 -1
  9. package/dist/PeginManager-BRHJZYmE.cjs +2 -0
  10. package/dist/PeginManager-BRHJZYmE.cjs.map +1 -0
  11. package/dist/{PeginManager-B1Mh8dJ3.js → PeginManager-C1en2vwr.js} +431 -371
  12. package/dist/PeginManager-C1en2vwr.js.map +1 -0
  13. package/dist/{ProtocolParams.abi-DXu8L0Fn.js → ProtocolParams.abi-C2brDWTI.js} +8 -3
  14. package/dist/ProtocolParams.abi-C2brDWTI.js.map +1 -0
  15. package/dist/ProtocolParams.abi-DQhcqsNr.cjs +2 -0
  16. package/dist/ProtocolParams.abi-DQhcqsNr.cjs.map +1 -0
  17. package/dist/assertPsbtUnsignedTxMatches-CagW7XqW.cjs +2 -0
  18. package/dist/assertPsbtUnsignedTxMatches-CagW7XqW.cjs.map +1 -0
  19. package/dist/{assertPsbtUnsignedTxMatches-D7RxpR4A.js → assertPsbtUnsignedTxMatches-Dry5dTfl.js} +84 -81
  20. package/dist/assertPsbtUnsignedTxMatches-Dry5dTfl.js.map +1 -0
  21. package/dist/buildAndBroadcastRefund-CEKwFY8l.cjs +2 -0
  22. package/dist/buildAndBroadcastRefund-CEKwFY8l.cjs.map +1 -0
  23. package/dist/{buildAndBroadcastRefund-Ck_ddlLk.js → buildAndBroadcastRefund-vwfVgJeA.js} +202 -201
  24. package/dist/buildAndBroadcastRefund-vwfVgJeA.js.map +1 -0
  25. package/dist/challengeAssert-CMb7r-je.cjs +2 -0
  26. package/dist/challengeAssert-CMb7r-je.cjs.map +1 -0
  27. package/dist/{challengeAssert-BXESW00N.js → challengeAssert-D7OCrDIc.js} +29 -29
  28. package/dist/challengeAssert-D7OCrDIc.js.map +1 -0
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.js +19 -19
  31. package/dist/tbv/core/clients/eth/protocol-params-reader.d.ts.map +1 -1
  32. package/dist/tbv/core/clients/eth/protocol-params-validation.d.ts.map +1 -1
  33. package/dist/tbv/core/clients/eth/types.d.ts +12 -1
  34. package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
  35. package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts.map +1 -1
  36. package/dist/tbv/core/clients/index.cjs +1 -1
  37. package/dist/tbv/core/clients/index.js +9 -9
  38. package/dist/tbv/core/clients/vault-provider/json-rpc-client.d.ts +0 -9
  39. package/dist/tbv/core/clients/vault-provider/json-rpc-client.d.ts.map +1 -1
  40. package/dist/tbv/core/clients/vault-provider/types.d.ts +38 -21
  41. package/dist/tbv/core/clients/vault-provider/types.d.ts.map +1 -1
  42. package/dist/tbv/core/clients/vault-provider/validators.d.ts.map +1 -1
  43. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +36 -2
  44. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
  45. package/dist/tbv/core/contracts/abis/ProtocolParams.abi.d.ts +6 -2
  46. package/dist/tbv/core/contracts/abis/ProtocolParams.abi.d.ts.map +1 -1
  47. package/dist/tbv/core/contracts/index.cjs +1 -1
  48. package/dist/tbv/core/contracts/index.js +2 -2
  49. package/dist/tbv/core/index.cjs +1 -1
  50. package/dist/tbv/core/index.js +10 -10
  51. package/dist/tbv/core/managers/PeginManager.d.ts +5 -0
  52. package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
  53. package/dist/tbv/core/managers/index.cjs +1 -1
  54. package/dist/tbv/core/managers/index.js +2 -2
  55. package/dist/tbv/core/primitives/index.cjs +1 -1
  56. package/dist/tbv/core/primitives/index.js +2 -2
  57. package/dist/tbv/core/primitives/psbt/payout.d.ts +2 -2
  58. package/dist/tbv/core/primitives/psbt/payout.d.ts.map +1 -1
  59. package/dist/tbv/core/services/deposit/runDepositorPresignFlow.d.ts.map +1 -1
  60. package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts.map +1 -1
  61. package/dist/tbv/core/services/deposit/waitForPeginStatus.d.ts +4 -2
  62. package/dist/tbv/core/services/deposit/waitForPeginStatus.d.ts.map +1 -1
  63. package/dist/tbv/core/services/index.cjs +1 -1
  64. package/dist/tbv/core/services/index.js +2 -2
  65. package/dist/tbv/core/services/pegout/state.d.ts +5 -8
  66. package/dist/tbv/core/services/pegout/state.d.ts.map +1 -1
  67. package/dist/tbv/index.cjs +1 -1
  68. package/dist/tbv/index.js +10 -10
  69. package/dist/tbv/integrations/aave/clients/query.d.ts.map +1 -1
  70. package/dist/tbv/integrations/aave/index.cjs +1 -1
  71. package/dist/tbv/integrations/aave/index.cjs.map +1 -1
  72. package/dist/tbv/integrations/aave/index.js +23 -22
  73. package/dist/tbv/integrations/aave/index.js.map +1 -1
  74. package/dist/tbv/integrations/aave/types.d.ts +6 -0
  75. package/dist/tbv/integrations/aave/types.d.ts.map +1 -1
  76. package/dist/types-D2jcXfm7.cjs +2 -0
  77. package/dist/types-D2jcXfm7.cjs.map +1 -0
  78. package/dist/types-TOmEvvRy.js +322 -0
  79. package/dist/types-TOmEvvRy.js.map +1 -0
  80. package/dist/{vault-registry-reader-Blhu9FW2.js → vault-registry-reader-BrARgFre.js} +207 -202
  81. package/dist/vault-registry-reader-BrARgFre.js.map +1 -0
  82. package/dist/vault-registry-reader-CbJHSxVe.cjs +2 -0
  83. package/dist/vault-registry-reader-CbJHSxVe.cjs.map +1 -0
  84. package/package.json +3 -3
  85. package/dist/BTCVaultRegistry.abi-DbJ5lsFJ.js.map +0 -1
  86. package/dist/BTCVaultRegistry.abi-ZdPpION2.cjs +0 -2
  87. package/dist/BTCVaultRegistry.abi-ZdPpION2.cjs.map +0 -1
  88. package/dist/PeginManager-B1Mh8dJ3.js.map +0 -1
  89. package/dist/PeginManager-BbHPyz-G.cjs +0 -2
  90. package/dist/PeginManager-BbHPyz-G.cjs.map +0 -1
  91. package/dist/ProtocolParams.abi-BmvHwQJV.cjs +0 -2
  92. package/dist/ProtocolParams.abi-BmvHwQJV.cjs.map +0 -1
  93. package/dist/ProtocolParams.abi-DXu8L0Fn.js.map +0 -1
  94. package/dist/assertPsbtUnsignedTxMatches-BoHwgW30.cjs +0 -2
  95. package/dist/assertPsbtUnsignedTxMatches-BoHwgW30.cjs.map +0 -1
  96. package/dist/assertPsbtUnsignedTxMatches-D7RxpR4A.js.map +0 -1
  97. package/dist/buildAndBroadcastRefund-Ck_ddlLk.js.map +0 -1
  98. package/dist/buildAndBroadcastRefund-DyPQyghx.cjs +0 -2
  99. package/dist/buildAndBroadcastRefund-DyPQyghx.cjs.map +0 -1
  100. package/dist/challengeAssert-BKDS_ADt.cjs +0 -2
  101. package/dist/challengeAssert-BKDS_ADt.cjs.map +0 -1
  102. package/dist/challengeAssert-BXESW00N.js.map +0 -1
  103. package/dist/types-DnyyBNcC.cjs +0 -2
  104. package/dist/types-DnyyBNcC.cjs.map +0 -1
  105. package/dist/types-TiIjyo2b.js +0 -320
  106. package/dist/types-TiIjyo2b.js.map +0 -1
  107. package/dist/vault-registry-reader-7gOYnrQD.cjs +0 -2
  108. package/dist/vault-registry-reader-7gOYnrQD.cjs.map +0 -1
  109. package/dist/vault-registry-reader-Blhu9FW2.js.map +0 -1
@@ -1,15 +1,15 @@
1
1
  var fe = Object.defineProperty;
2
2
  var me = (t, e, n) => e in t ? fe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var p = (t, e, n) => me(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { D as be, J as se, e as _e } from "./types-TiIjyo2b.js";
5
- import { X as R, C as L, s as C, S as ye, h as Pe } from "./bitcoin-B5aNKtsk.js";
4
+ import { D as be, J as ie, e as _e } from "./types-TOmEvvRy.js";
5
+ import { X as H, C as L, s as S, S as ye, h as Pe } from "./bitcoin-B5aNKtsk.js";
6
6
  import { H as T } from "./validation-CxqROCno.js";
7
- import * as j from "@bitcoin-js/tiny-secp256k1-asmjs";
8
- import { payments as we, Transaction as U } from "bitcoinjs-lib";
7
+ import * as U from "@bitcoin-js/tiny-secp256k1-asmjs";
8
+ import { payments as we, Transaction as F } from "bitcoinjs-lib";
9
9
  import { Buffer as A } from "buffer";
10
10
  import { s as W } from "./sha2-BYVxyZzX.js";
11
- import { B as w } from "./BTCVaultRegistry.abi-DbJ5lsFJ.js";
12
- import { P as _, A as F } from "./ProtocolParams.abi-DXu8L0Fn.js";
11
+ import { B as w } from "./BTCVaultRegistry.abi-Cq9-JlqT.js";
12
+ import { P as _, A as M } from "./ProtocolParams.abi-C2brDWTI.js";
13
13
  const Q = new Set(Object.values(be)), ve = 200;
14
14
  function l(t) {
15
15
  var e;
@@ -27,7 +27,7 @@ const $ = 64;
27
27
  function v(t) {
28
28
  return typeof t == "string" && t.length > 0 && T.test(t);
29
29
  }
30
- function ie(t) {
30
+ function se(t) {
31
31
  return typeof t == "string" && t.length > 0;
32
32
  }
33
33
  function oe(t, e) {
@@ -37,15 +37,15 @@ function oe(t, e) {
37
37
  );
38
38
  }
39
39
  function m(t, e) {
40
- if (!ie(t))
40
+ if (!se(t))
41
41
  throw new o(
42
42
  `VP response validation failed: "${e}" must be a non-empty string, got ${l(t)}`
43
43
  );
44
44
  }
45
45
  function q(t, e) {
46
- if (!v(t) || t.length !== R && t.length !== L)
46
+ if (!v(t) || t.length !== H && t.length !== L)
47
47
  throw new o(
48
- `VP response validation failed: "${e}" must be a ${R} or ${L}-char hex string (BTC pubkey), got ${l(t)}`
48
+ `VP response validation failed: "${e}" must be a ${H} or ${L}-char hex string (BTC pubkey), got ${l(t)}`
49
49
  );
50
50
  }
51
51
  function Ve(t) {
@@ -143,7 +143,7 @@ function Te(t, e) {
143
143
  const n = t;
144
144
  m(n.wots_pks_json, `${e}.wots_pks_json`), m(n.gc_wots_keys_json, `${e}.gc_wots_keys_json`);
145
145
  }
146
- function Se(t, e) {
146
+ function Ce(t, e) {
147
147
  if (t === null || typeof t != "object")
148
148
  throw new o(
149
149
  `VP response validation failed: "${e}" must be an object`
@@ -180,7 +180,7 @@ function ke(t) {
180
180
  "VP response validation failed: requestDepositorClaimerArtifacts response is not an object"
181
181
  );
182
182
  const e = t;
183
- if (!ie(e.tx_graph_json))
183
+ if (!se(e.tx_graph_json))
184
184
  throw new o(
185
185
  `VP response validation failed: "tx_graph_json" must be a non-empty string, got ${l(e.tx_graph_json)}`
186
186
  );
@@ -199,19 +199,19 @@ function ke(t) {
199
199
  throw new o(
200
200
  'VP response validation failed: "babe_sessions" must contain at least one challenger entry'
201
201
  );
202
- for (const [r, i] of n) {
203
- if (q(r, `babe_sessions["${r}"]`), i === null || typeof i != "object")
202
+ for (const [r, s] of n) {
203
+ if (q(r, `babe_sessions["${r}"]`), s === null || typeof s != "object")
204
204
  throw new o(
205
205
  `VP response validation failed: "babe_sessions.${r}" must be an object`
206
206
  );
207
- const s = i;
208
- if (!v(s.decryptor_artifacts_hex))
207
+ const i = s;
208
+ if (!v(i.decryptor_artifacts_hex))
209
209
  throw new o(
210
- `VP response validation failed: "babe_sessions.${r}.decryptor_artifacts_hex" must be a non-empty hex string, got ${l(s.decryptor_artifacts_hex)}`
210
+ `VP response validation failed: "babe_sessions.${r}.decryptor_artifacts_hex" must be a non-empty hex string, got ${l(i.decryptor_artifacts_hex)}`
211
211
  );
212
212
  }
213
213
  }
214
- function Ce(t) {
214
+ function Se(t) {
215
215
  if (t === null || typeof t != "object")
216
216
  throw new o(
217
217
  "VP response validation failed: pegout status payload is not an object"
@@ -244,11 +244,7 @@ function Ie(t) {
244
244
  throw new o(
245
245
  `VP response validation failed: "claimer.failed" must be a boolean, got ${l(t.failed)}`
246
246
  );
247
- if (m(t.claim_txid, "claimer.claim_txid"), m(t.claimer_pubkey, "claimer.claimer_pubkey"), m(t.assert_txid, "claimer.assert_txid"), t.challenger_pubkey !== null && typeof t.challenger_pubkey != "string")
248
- throw new o(
249
- `VP response validation failed: "claimer.challenger_pubkey" must be a string or null, got ${l(t.challenger_pubkey)}`
250
- );
251
- if (typeof t.created_at != "number")
247
+ if (m(t.claim_txid, "claimer.claim_txid"), m(t.claimer_pubkey, "claimer.claimer_pubkey"), m(t.assert_txid, "claimer.assert_txid"), typeof t.created_at != "number")
252
248
  throw new o(
253
249
  `VP response validation failed: "claimer.created_at" must be a number, got ${l(t.created_at)}`
254
250
  );
@@ -291,7 +287,7 @@ function Be(t) {
291
287
  }
292
288
  function Ne(t) {
293
289
  ce(t, "batchGetPegoutStatus", (e) => {
294
- e.result !== null && Ce(e.result);
290
+ e.result !== null && Se(e.result);
295
291
  });
296
292
  }
297
293
  function ce(t, e, n) {
@@ -304,30 +300,30 @@ function ce(t, e, n) {
304
300
  throw new o(
305
301
  `VP response validation failed: "${e}.results" must be an array, got ${l(r.results)}`
306
302
  );
307
- for (let i = 0; i < r.results.length; i++) {
308
- const s = r.results[i];
309
- if (s === null || typeof s != "object")
303
+ for (let s = 0; s < r.results.length; s++) {
304
+ const i = r.results[s];
305
+ if (i === null || typeof i != "object")
310
306
  throw new o(
311
- `VP response validation failed: "${e}.results[${i}]" must be an object, got ${l(s)}`
307
+ `VP response validation failed: "${e}.results[${s}]" must be an object, got ${l(i)}`
312
308
  );
313
- const a = s;
309
+ const a = i;
314
310
  if (!v(a.pegin_txid) || a.pegin_txid.length !== $)
315
311
  throw new o(
316
- `VP response validation failed: "${e}.results[${i}].pegin_txid" must be a ${$}-char hex string, got ${l(a.pegin_txid)}`
312
+ `VP response validation failed: "${e}.results[${s}].pegin_txid" must be a ${$}-char hex string, got ${l(a.pegin_txid)}`
317
313
  );
318
314
  if (a.error !== null && typeof a.error != "string")
319
315
  throw new o(
320
- `VP response validation failed: "${e}.results[${i}].error" must be a string or null, got ${l(a.error)}`
316
+ `VP response validation failed: "${e}.results[${s}].error" must be a string or null, got ${l(a.error)}`
321
317
  );
322
318
  if (a.result === null && a.error === null)
323
319
  throw new o(
324
- `VP response validation failed: "${e}.results[${i}]" has neither "result" nor "error" populated`
320
+ `VP response validation failed: "${e}.results[${s}]" has neither "result" nor "error" populated`
325
321
  );
326
322
  if (a.result !== null && a.error !== null)
327
323
  throw new o(
328
- `VP response validation failed: "${e}.results[${i}]" has both "result" and "error" populated`
324
+ `VP response validation failed: "${e}.results[${s}]" has both "result" and "error" populated`
329
325
  );
330
- n(a, i);
326
+ n(a, s);
331
327
  }
332
328
  }
333
329
  function Re(t) {
@@ -336,7 +332,7 @@ function Re(t) {
336
332
  'VP response validation failed: "depositor_graph.challenger_presign_data" must be an array'
337
333
  );
338
334
  for (let e = 0; e < t.challenger_presign_data.length; e++)
339
- Se(
335
+ Ce(
340
336
  t.challenger_presign_data[e],
341
337
  `depositor_graph.challenger_presign_data[${e}]`
342
338
  );
@@ -359,7 +355,7 @@ class Oe {
359
355
  tokenProvider: n == null ? void 0 : n.tokenProvider,
360
356
  maxResponseBytes: n == null ? void 0 : n.maxResponseBytes
361
357
  };
362
- this.client = new se(r);
358
+ this.client = new ie(r);
363
359
  }
364
360
  /**
365
361
  * Request the payout/claim/assert transactions that the depositor
@@ -431,35 +427,35 @@ function De(t, e) {
431
427
  const n = /* @__PURE__ */ new Set();
432
428
  for (const u of t)
433
429
  n.add(u.toLowerCase());
434
- const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), s = [], a = [];
430
+ const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), i = [], a = [];
435
431
  for (const u of e) {
436
- const h = u.pegin_txid.toLowerCase();
437
- if (!n.has(h)) {
438
- a.push(h);
432
+ const d = u.pegin_txid.toLowerCase();
433
+ if (!n.has(d)) {
434
+ a.push(d);
439
435
  continue;
440
436
  }
441
- if (i.has(h)) {
442
- s.push(h);
437
+ if (s.has(d)) {
438
+ i.push(d);
443
439
  continue;
444
440
  }
445
- i.add(h), r.set(h, { result: u.result, error: u.error });
441
+ s.add(d), r.set(d, { result: u.result, error: u.error });
446
442
  }
447
443
  const c = [];
448
444
  for (const u of n)
449
- i.has(u) || c.push(u);
450
- return { byTxid: r, missing: c, unexpected: a, duplicate: s };
445
+ s.has(u) || c.push(u);
446
+ return { byTxid: r, missing: c, unexpected: a, duplicate: i };
451
447
  }
452
448
  async function lt(t) {
453
449
  const {
454
450
  items: e,
455
451
  getTxid: n,
456
452
  batchCall: r,
457
- onItem: i,
458
- onMissing: s,
453
+ onItem: s,
454
+ onMissing: i,
459
455
  onDuplicate: a,
460
456
  onDuplicateBatch: c,
461
457
  onWholeBatchError: u,
462
- onUnexpected: h,
458
+ onUnexpected: d,
463
459
  batchSize: f = _e
464
460
  } = t;
465
461
  if (!Number.isInteger(f) || f <= 0)
@@ -467,59 +463,59 @@ async function lt(t) {
467
463
  `batchPollByProvider: batchSize must be a positive integer, got ${f}`
468
464
  );
469
465
  for (let P = 0; P < e.length; P += f) {
470
- const x = e.slice(P, P + f), S = /* @__PURE__ */ new Map(), K = [];
471
- for (const d of x) {
472
- const b = n(d).toLowerCase();
473
- S.set(b, d), K.push(b);
466
+ const x = e.slice(P, P + f), C = /* @__PURE__ */ new Map(), K = [];
467
+ for (const h of x) {
468
+ const b = n(h).toLowerCase();
469
+ C.set(b, h), K.push(b);
474
470
  }
475
471
  let V;
476
472
  try {
477
- const d = await r(K);
478
- V = De(K, d.results);
479
- } catch (d) {
480
- u(x, d);
473
+ const h = await r(K);
474
+ V = De(K, h.results);
475
+ } catch (h) {
476
+ u(x, h);
481
477
  continue;
482
478
  }
483
- h && V.unexpected.length > 0 && h(V.unexpected);
479
+ d && V.unexpected.length > 0 && d(V.unexpected);
484
480
  const k = new Set(V.duplicate);
485
- for (const d of k) {
486
- const b = S.get(d);
481
+ for (const h of k) {
482
+ const b = C.get(h);
487
483
  b && a(b);
488
484
  }
489
485
  c && k.size > 0 && c(k.size);
490
- for (const d of V.missing) {
491
- const b = S.get(d);
492
- b && s(b);
486
+ for (const h of V.missing) {
487
+ const b = C.get(h);
488
+ b && i(b);
493
489
  }
494
- for (const [d, b] of V.byTxid) {
495
- if (k.has(d)) continue;
496
- const z = S.get(d);
497
- z && i(z, {
498
- pegin_txid: d,
490
+ for (const [h, b] of V.byTxid) {
491
+ if (k.has(h)) continue;
492
+ const z = C.get(h);
493
+ z && s(z, {
494
+ pegin_txid: h,
499
495
  result: b.result,
500
496
  error: b.error
501
497
  });
502
498
  }
503
499
  }
504
500
  }
505
- const je = "BIP0322-signed-message", Ke = "TapTweak", le = 32, Ue = 64;
501
+ const je = "BIP0322-signed-message", Ue = "TapTweak", le = 32, Ke = 64;
506
502
  function ue(t, e) {
507
- const n = new TextEncoder().encode(t), r = W(n), i = new Uint8Array(r.length * 2 + e.length);
508
- return i.set(r, 0), i.set(r, r.length), i.set(e, r.length * 2), W(i);
503
+ const n = new TextEncoder().encode(t), r = W(n), s = new Uint8Array(r.length * 2 + e.length);
504
+ return s.set(r, 0), s.set(r, r.length), s.set(e, r.length * 2), W(s);
509
505
  }
510
506
  function Fe(t) {
511
507
  if (t.length !== le) return null;
512
- const e = ue(Ke, t), n = j.xOnlyPointAddTweak(t, e);
508
+ const e = ue(Ue, t), n = U.xOnlyPointAddTweak(t, e);
513
509
  return n ? n.xOnlyPubkey : null;
514
510
  }
515
511
  function Me(t, e, n) {
516
- if (e.length !== le || n.length !== Ue) return !1;
512
+ if (e.length !== le || n.length !== Ke) return !1;
517
513
  try {
518
- const r = ue(je, t), i = we.p2tr({
514
+ const r = ue(je, t), s = we.p2tr({
519
515
  internalPubkey: A.from(e)
520
516
  });
521
- if (!i.output) return !1;
522
- const s = i.output, a = 0, c = new U();
517
+ if (!s.output) return !1;
518
+ const i = s.output, a = 0, c = new F();
523
519
  c.version = 0, c.locktime = 0;
524
520
  const u = A.concat([
525
521
  A.from([0, 32]),
@@ -533,69 +529,69 @@ function Me(t, e, n) {
533
529
  0,
534
530
  // sequence = 0
535
531
  u
536
- ), c.addOutput(s, a);
537
- const h = new U();
538
- h.version = 0, h.locktime = 0;
532
+ ), c.addOutput(i, a);
533
+ const d = new F();
534
+ d.version = 0, d.locktime = 0;
539
535
  const f = c.getHash();
540
- h.addInput(f, 0, 0), h.addOutput(A.from([106]), a);
541
- const P = h.hashForWitnessV1(
536
+ d.addInput(f, 0, 0), d.addOutput(A.from([106]), a);
537
+ const P = d.hashForWitnessV1(
542
538
  0,
543
- [s],
539
+ [i],
544
540
  [a],
545
- U.SIGHASH_DEFAULT
541
+ F.SIGHASH_DEFAULT
546
542
  ), x = Fe(e);
547
- return x ? j.verifySchnorr(P, x, n) : !1;
543
+ return x ? U.verifySchnorr(P, x, n) : !1;
548
544
  } catch {
549
545
  return !1;
550
546
  }
551
547
  }
552
- function H(t, e) {
548
+ function O(t, e) {
553
549
  const n = (t & 7) << 5, r = typeof e == "bigint" ? e : BigInt(e);
554
550
  if (r < 0n) throw new Error("cborHead: negative argument");
555
551
  if (r < 24n) return new Uint8Array([n | Number(r)]);
556
552
  if (r < 0x100n) return new Uint8Array([n | 24, Number(r)]);
557
553
  if (r < 0x10000n) {
558
- const s = Number(r);
559
- return new Uint8Array([n | 25, s >>> 8 & 255, s & 255]);
554
+ const i = Number(r);
555
+ return new Uint8Array([n | 25, i >>> 8 & 255, i & 255]);
560
556
  }
561
557
  if (r < 0x100000000n) {
562
- const s = Number(r);
558
+ const i = Number(r);
563
559
  return new Uint8Array([
564
560
  n | 26,
565
- s >>> 24 & 255,
566
- s >>> 16 & 255,
567
- s >>> 8 & 255,
568
- s & 255
561
+ i >>> 24 & 255,
562
+ i >>> 16 & 255,
563
+ i >>> 8 & 255,
564
+ i & 255
569
565
  ]);
570
566
  }
571
- const i = new Uint8Array(9);
572
- i[0] = n | 27;
573
- for (let s = 7; s >= 0; s--)
574
- i[1 + s] = Number(r >> BigInt((7 - s) * 8)) & 255;
575
- return i;
567
+ const s = new Uint8Array(9);
568
+ s[0] = n | 27;
569
+ for (let i = 7; i >= 0; i--)
570
+ s[1 + i] = Number(r >> BigInt((7 - i) * 8)) & 255;
571
+ return s;
576
572
  }
577
- function he(...t) {
578
- const e = t.reduce((i, s) => i + s.length, 0), n = new Uint8Array(e);
573
+ function de(...t) {
574
+ const e = t.reduce((s, i) => s + i.length, 0), n = new Uint8Array(e);
579
575
  let r = 0;
580
- for (const i of t)
581
- n.set(i, r), r += i.length;
576
+ for (const s of t)
577
+ n.set(s, r), r += s.length;
582
578
  return n;
583
579
  }
584
580
  function J(t) {
585
- const n = [H(4, t.length)];
581
+ const n = [O(4, t.length)];
586
582
  for (const r of t)
587
- n.push(H(0, r));
588
- return he(...n);
583
+ n.push(O(0, r));
584
+ return de(...n);
589
585
  }
590
- function Le(t, e, n) {
586
+ function Ge(t, e, n) {
591
587
  if (!Number.isSafeInteger(n) || n < 0)
592
588
  throw new Error(
593
589
  `encodeServerIdentityPayload: expires_at must be a non-negative safe integer, got ${n}`
594
590
  );
595
- const r = H(4, 3), i = J(t), s = J(e), a = H(0, n);
596
- return he(r, i, s, a);
591
+ const r = O(4, 3), s = J(t), i = J(e), a = O(0, n);
592
+ return de(r, s, i, a);
597
593
  }
598
- const Ge = new TextEncoder().encode(
594
+ const Le = new TextEncoder().encode(
599
595
  "btc-auth.server-identity.v1"
600
596
  ), Xe = 2 * 3600;
601
597
  class g extends Error {
@@ -610,21 +606,21 @@ function E(t) {
610
606
  return e;
611
607
  }
612
608
  function qe(t) {
613
- const { proof: e, pinnedServerPubkey: n, now: r } = t, i = t.maxLifetimeSecs ?? Xe, s = C(n).toLowerCase();
614
- if (s.length !== R || !T.test(s))
609
+ const { proof: e, pinnedServerPubkey: n, now: r } = t, s = t.maxLifetimeSecs ?? Xe, i = S(n).toLowerCase();
610
+ if (i.length !== H || !T.test(i))
615
611
  throw new g(
616
- `pinnedServerPubkey must be 32-byte hex; got ${s.length} chars`,
612
+ `pinnedServerPubkey must be 32-byte hex; got ${i.length} chars`,
617
613
  "invalid_pubkey_encoding"
618
614
  );
619
- const a = C(e.server_pubkey).toLowerCase();
620
- if (a.length !== R || !T.test(a))
615
+ const a = S(e.server_pubkey).toLowerCase();
616
+ if (a.length !== H || !T.test(a))
621
617
  throw new g(
622
618
  `server_pubkey must be 32-byte hex; got ${a.length} chars`,
623
619
  "invalid_pubkey_encoding"
624
620
  );
625
- if (a !== s)
621
+ if (a !== i)
626
622
  throw new g(
627
- `server_pubkey does not match pinned value: expected ${s}, got ${a}`,
623
+ `server_pubkey does not match pinned value: expected ${i}, got ${a}`,
628
624
  "pinned_pubkey_mismatch"
629
625
  );
630
626
  if (!Number.isSafeInteger(e.expires_at))
@@ -642,17 +638,17 @@ function qe(t) {
642
638
  `server identity proof expired at ${e.expires_at}, now ${r}`,
643
639
  "expired"
644
640
  );
645
- if (!Number.isSafeInteger(i) || i <= 0)
641
+ if (!Number.isSafeInteger(s) || s <= 0)
646
642
  throw new g(
647
- `maxLifetimeSecs must be a positive safe integer; got ${JSON.stringify(i)}`,
643
+ `maxLifetimeSecs must be a positive safe integer; got ${JSON.stringify(s)}`,
648
644
  "invalid_max_lifetime"
649
645
  );
650
- if (e.expires_at - r > i)
646
+ if (e.expires_at - r > s)
651
647
  throw new g(
652
- `server identity proof expires too far in the future: expires_at=${e.expires_at}, now=${r}, max lifetime=${i}s`,
648
+ `server identity proof expires too far in the future: expires_at=${e.expires_at}, now=${r}, max lifetime=${s}s`,
653
649
  "expires_too_far"
654
650
  );
655
- const c = C(e.ephemeral_pubkey).toLowerCase();
651
+ const c = S(e.ephemeral_pubkey).toLowerCase();
656
652
  if (c.length !== L || !T.test(c))
657
653
  throw new g(
658
654
  `ephemeral_pubkey must be 33-byte compressed hex; got ${c.length} chars`,
@@ -664,20 +660,20 @@ function qe(t) {
664
660
  `ephemeral_pubkey must be compressed (prefix 02/03); got ${u}`,
665
661
  "invalid_ephemeral_pubkey"
666
662
  );
667
- const h = E(c);
668
- if (!j.isPoint(h))
663
+ const d = E(c);
664
+ if (!U.isPoint(d))
669
665
  throw new g(
670
666
  "ephemeral_pubkey is not a valid secp256k1 point",
671
667
  "invalid_ephemeral_pubkey"
672
668
  );
673
- const f = C(e.signature).toLowerCase();
669
+ const f = S(e.signature).toLowerCase();
674
670
  if (f.length !== ye || !T.test(f))
675
671
  throw new g(
676
672
  `signature must be 64-byte Schnorr hex; got ${f.length} chars`,
677
673
  "invalid_signature_encoding"
678
674
  );
679
- const P = Le(
680
- Ge,
675
+ const P = Ge(
676
+ Le,
681
677
  E(c),
682
678
  e.expires_at
683
679
  );
@@ -692,13 +688,13 @@ const ze = /* @__PURE__ */ new Set([
692
688
  "vaultProvider_submitDepositorPresignatures",
693
689
  "vaultProvider_requestDepositorPresignTransactions",
694
690
  "vaultProvider_requestDepositorClaimerArtifacts"
695
- ]), We = 6e4, G = "auth_createDepositorToken";
696
- function de(t, e) {
697
- return new se({
691
+ ]), We = 6e4, X = "auth_createDepositorToken";
692
+ function he(t, e) {
693
+ return new ie({
698
694
  baseUrl: t,
699
695
  timeout: We,
700
696
  headers: e,
701
- retryableFor: (n) => n === G
697
+ retryableFor: (n) => n === X
702
698
  });
703
699
  }
704
700
  const Y = 4102444800, Qe = 30;
@@ -732,7 +728,7 @@ class Je {
732
728
  * guard. Returning `null` here breaks that recursion deterministically.
733
729
  */
734
730
  async getToken(e) {
735
- if (e === G || !this.authGatedMethods.has(e)) return null;
731
+ if (e === X || !this.authGatedMethods.has(e)) return null;
736
732
  const n = this.cached;
737
733
  return n && this.now() + this.refreshSkewSecs < n.expiresAt ? n.token : (await this.acquireSingleFlight()).token;
738
734
  }
@@ -759,7 +755,7 @@ class Je {
759
755
  if (e) return e;
760
756
  const n = (async () => {
761
757
  try {
762
- const r = await this.client.call(G, {
758
+ const r = await this.client.call(X, {
763
759
  pegin_txid: this.peginTxid,
764
760
  auth_anchor: this.authAnchorHex
765
761
  });
@@ -771,16 +767,16 @@ class Je {
771
767
  throw new Error(
772
768
  `VpTokenProvider: invalid token in acquire response (expected non-empty string, got ${typeof r.token})`
773
769
  );
774
- const i = this.now();
775
- if (!Number.isSafeInteger(r.expires_at) || r.expires_at <= i || r.expires_at > Y)
770
+ const s = this.now();
771
+ if (!Number.isSafeInteger(r.expires_at) || r.expires_at <= s || r.expires_at > Y)
776
772
  throw new Error(
777
- `VpTokenProvider: invalid expires_at in acquire response (got ${JSON.stringify(r.expires_at)}; must be a safe integer in (${i}, ${Y}])`
773
+ `VpTokenProvider: invalid expires_at in acquire response (got ${JSON.stringify(r.expires_at)}; must be a safe integer in (${s}, ${Y}])`
778
774
  );
779
- const s = {
775
+ const i = {
780
776
  token: r.token,
781
777
  expiresAt: r.expires_at
782
778
  };
783
- return this.cached = s, s;
779
+ return this.cached = i, i;
784
780
  } finally {
785
781
  this.inFlight = null;
786
782
  }
@@ -854,7 +850,7 @@ class Ye {
854
850
  const pe = new Ye();
855
851
  function ut(t) {
856
852
  var r;
857
- const e = de(
853
+ const e = he(
858
854
  t.baseUrl,
859
855
  (r = t.options) == null ? void 0 : r.headers
860
856
  ), n = pe.getOrCreate({
@@ -868,15 +864,15 @@ function ut(t) {
868
864
  tokenProvider: n
869
865
  });
870
866
  }
871
- function ht(t) {
867
+ function dt(t) {
872
868
  pe.getOrCreate({
873
- client: de(t.baseUrl, t.headers),
869
+ client: he(t.baseUrl, t.headers),
874
870
  peginTxid: t.peginTxid,
875
871
  authAnchorHex: t.authAnchorHex,
876
872
  pinnedServerPubkey: t.pinnedServerPubkey
877
873
  });
878
874
  }
879
- async function dt(t, e) {
875
+ async function ht(t, e) {
880
876
  const [n, r] = await t.multicall({
881
877
  contracts: [
882
878
  {
@@ -897,29 +893,29 @@ async function dt(t, e) {
897
893
  applicationRegistry: r
898
894
  };
899
895
  }
900
- const M = 65535, Z = 1e4, O = 4294967295, ee = 255;
901
- function X(t) {
902
- if (!Number.isInteger(t) || t < 0 || t > O)
896
+ const G = 65535, Z = 1e4, D = 4294967295, ee = 255;
897
+ function N(t) {
898
+ if (!Number.isInteger(t) || t < 0 || t > D)
903
899
  throw new Error(
904
900
  `Invalid offchainParamsVersion from contract: must be a uint32, got ${t}`
905
901
  );
906
902
  }
907
- function N(t) {
903
+ function R(t) {
908
904
  const e = [];
909
905
  if (t.timelockAssert <= 0n && e.push(
910
906
  `timelockAssert must be positive, got ${t.timelockAssert}`
911
- ), t.timelockAssert > BigInt(M) && e.push(
912
- `timelockAssert ${t.timelockAssert} exceeds uint16 max (${M})`
907
+ ), t.timelockAssert > BigInt(G) && e.push(
908
+ `timelockAssert ${t.timelockAssert} exceeds uint16 max (${G})`
913
909
  ), t.timelockChallengeAssert <= 0n && e.push(
914
910
  `timelockChallengeAssert must be positive, got ${t.timelockChallengeAssert}`
915
911
  ), t.tRefund <= 0 && e.push(`tRefund must be positive, got ${t.tRefund}`), t.tStale <= 0 && e.push(`tStale must be positive, got ${t.tStale}`), t.securityCouncilKeys.length === 0 && e.push("securityCouncilKeys must not be empty"), t.councilQuorum <= 0 && e.push(`councilQuorum must be positive, got ${t.councilQuorum}`), t.councilQuorum > t.securityCouncilKeys.length && e.push(
916
912
  `councilQuorum (${t.councilQuorum}) exceeds securityCouncilKeys count (${t.securityCouncilKeys.length})`
917
913
  ), t.feeRate <= 0n && e.push(`feeRate must be positive, got ${t.feeRate}`), t.minPeginFeeRate <= 0n && e.push(
918
914
  `minPeginFeeRate must be positive, got ${t.minPeginFeeRate}`
919
- ), (!Number.isInteger(t.proverProgramVersion) || t.proverProgramVersion < 0 || t.proverProgramVersion > M) && e.push(
920
- `proverProgramVersion must be a uint16, got ${t.proverProgramVersion}`
921
- ), (!Number.isInteger(t.minPrepeginDepth) || t.minPrepeginDepth <= 0 || t.minPrepeginDepth > O) && e.push(
922
- `minPrepeginDepth must be a uint32 in [1, ${O}], got ${t.minPrepeginDepth}`
915
+ ), (!Number.isInteger(t.proverCircuitVersion) || t.proverCircuitVersion < 0 || t.proverCircuitVersion > G) && e.push(
916
+ `proverCircuitVersion must be a uint16, got ${t.proverCircuitVersion}`
917
+ ), (!Number.isInteger(t.minPrepeginDepth) || t.minPrepeginDepth <= 0 || t.minPrepeginDepth > D) && e.push(
918
+ `minPrepeginDepth must be a uint32 in [1, ${D}], got ${t.minPrepeginDepth}`
923
919
  ), t.babeTotalInstances <= 0 && e.push(
924
920
  `babeTotalInstances must be positive, got ${t.babeTotalInstances}`
925
921
  ), t.babeInstancesToFinalize <= 0 && e.push(
@@ -945,11 +941,13 @@ function ge(t) {
945
941
  `pegInActivationTimeout must be positive, got ${t.pegInActivationTimeout}`
946
942
  ), (!Number.isInteger(t.maxHtlcOutputCount) || t.maxHtlcOutputCount <= 0 || t.maxHtlcOutputCount > ee) && e.push(
947
943
  `maxHtlcOutputCount must be an integer in [1, ${ee}], got ${t.maxHtlcOutputCount}`
944
+ ), (typeof t.expiredPegInGraceBlocks != "bigint" || t.expiredPegInGraceBlocks <= 0n) && e.push(
945
+ `expiredPegInGraceBlocks must be a positive bigint, got ${t.expiredPegInGraceBlocks}`
948
946
  ), e.length > 0)
949
947
  throw new Error(`Invalid TBV protocol parameters: ${e.join("; ")}`);
950
948
  }
951
949
  function Ze(t) {
952
- if (ge(t), N(t.offchainParams), !Number.isInteger(t.offchainParamsVersion) || t.offchainParamsVersion < 0 || t.offchainParamsVersion > O)
950
+ if (ge(t), R(t.offchainParams), !Number.isInteger(t.offchainParamsVersion) || t.offchainParamsVersion < 0 || t.offchainParamsVersion > D)
953
951
  throw new Error(
954
952
  `Invalid peg-in configuration: offchainParamsVersion must be a uint32, got ${t.offchainParamsVersion}`
955
953
  );
@@ -968,7 +966,7 @@ function B(t) {
968
966
  tRefund: t.tRefund,
969
967
  tStale: t.tStale,
970
968
  minPeginFeeRate: t.minPeginFeeRate,
971
- proverProgramVersion: t.proverProgramVersion,
969
+ proverCircuitVersion: t.proverCircuitVersion,
972
970
  minPrepeginDepth: t.minPrepeginDepth
973
971
  };
974
972
  }
@@ -978,7 +976,8 @@ function ne(t) {
978
976
  maxPegInAmount: t.maxPegInAmount,
979
977
  pegInAckTimeout: t.pegInAckTimeout,
980
978
  pegInActivationTimeout: t.pegInActivationTimeout,
981
- maxHtlcOutputCount: t.maxHtlcOutputCount
979
+ maxHtlcOutputCount: t.maxHtlcOutputCount,
980
+ expiredPegInGraceBlocks: t.expiredPegInGraceBlocks
982
981
  };
983
982
  }
984
983
  function re(t) {
@@ -1006,7 +1005,7 @@ class pt {
1006
1005
  abi: _,
1007
1006
  functionName: "getLatestOffchainParams"
1008
1007
  }), n = B(e);
1009
- return N(n), n;
1008
+ return R(n), n;
1010
1009
  }
1011
1010
  async getOffchainParamsByVersion(e) {
1012
1011
  const n = await this.publicClient.readContract({
@@ -1015,7 +1014,7 @@ class pt {
1015
1014
  functionName: "getOffchainParamsByVersion",
1016
1015
  args: [e]
1017
1016
  }), r = B(n);
1018
- return N(r), r;
1017
+ return R(r), r;
1019
1018
  }
1020
1019
  async getLatestOffchainParamsVersion() {
1021
1020
  const e = await this.publicClient.readContract({
@@ -1023,7 +1022,7 @@ class pt {
1023
1022
  abi: _,
1024
1023
  functionName: "latestOffchainParamsVersion"
1025
1024
  }), n = Number(e);
1026
- return X(n), n;
1025
+ return N(n), n;
1027
1026
  }
1028
1027
  async getTimelockPeginByVersion(e) {
1029
1028
  const n = await this.getOffchainParamsByVersion(e);
@@ -1056,19 +1055,20 @@ class pt {
1056
1055
  }
1057
1056
  ],
1058
1057
  allowFailure: !1
1059
- }), n = ne(e[0]), r = B(e[1]), i = Number(e[2]), s = {
1058
+ }), n = ne(e[0]), r = B(e[1]), s = Number(e[2]), i = {
1060
1059
  minimumPegInAmount: n.minimumPegInAmount,
1061
1060
  maxPegInAmount: n.maxPegInAmount,
1062
1061
  pegInAckTimeout: n.pegInAckTimeout,
1063
1062
  pegInActivationTimeout: n.pegInActivationTimeout,
1064
1063
  maxHtlcOutputCount: n.maxHtlcOutputCount,
1064
+ expiredPegInGraceBlocks: n.expiredPegInGraceBlocks,
1065
1065
  timelockPegin: re(r.timelockAssert),
1066
1066
  timelockRefund: r.tRefund,
1067
1067
  minVpCommissionBps: r.minVpCommissionBps,
1068
1068
  offchainParams: r,
1069
- offchainParamsVersion: i
1069
+ offchainParamsVersion: s
1070
1070
  };
1071
- return Ze(s), s;
1071
+ return Ze(i), i;
1072
1072
  }
1073
1073
  /**
1074
1074
  * Fetch every historical offchain params version in a single multicall.
@@ -1084,30 +1084,30 @@ class pt {
1084
1084
  const n = await this.getLatestOffchainParamsVersion();
1085
1085
  if (n === 0)
1086
1086
  return { byVersion: /* @__PURE__ */ new Map(), latestVersion: 0 };
1087
- const r = Array.from({ length: n }, (c, u) => u + 1), i = r.map((c) => ({
1087
+ const r = Array.from({ length: n }, (c, u) => u + 1), s = r.map((c) => ({
1088
1088
  address: this.contractAddress,
1089
1089
  abi: _,
1090
1090
  functionName: "getOffchainParamsByVersion",
1091
1091
  args: [c]
1092
- })), s = await this.publicClient.multicall({
1093
- contracts: i,
1092
+ })), i = await this.publicClient.multicall({
1093
+ contracts: s,
1094
1094
  allowFailure: !1
1095
1095
  }), a = /* @__PURE__ */ new Map();
1096
1096
  for (let c = 0; c < r.length; c++) {
1097
- const u = B(s[c]);
1097
+ const u = B(i[c]);
1098
1098
  try {
1099
- N(u), a.set(r[c], u);
1100
- } catch (h) {
1099
+ R(u), a.set(r[c], u);
1100
+ } catch (d) {
1101
1101
  e == null || e(
1102
1102
  r[c],
1103
- h instanceof Error ? h : new Error(String(h))
1103
+ d instanceof Error ? d : new Error(String(d))
1104
1104
  );
1105
1105
  }
1106
1106
  }
1107
1107
  return { byVersion: a, latestVersion: n };
1108
1108
  }
1109
1109
  }
1110
- function D(t) {
1110
+ function j(t) {
1111
1111
  return t.map((e) => ({
1112
1112
  ethAddress: e.ethAddress,
1113
1113
  btcPubKey: e.btcPubKey
@@ -1120,25 +1120,25 @@ class gt {
1120
1120
  async getVaultKeepersByVersion(e, n) {
1121
1121
  const r = await this.publicClient.readContract({
1122
1122
  address: this.contractAddress,
1123
- abi: F,
1123
+ abi: M,
1124
1124
  functionName: "getVaultKeepersByVersion",
1125
1125
  args: [e, n]
1126
1126
  });
1127
- return D(r);
1127
+ return j(r);
1128
1128
  }
1129
1129
  async getCurrentVaultKeepers(e) {
1130
1130
  const n = await this.publicClient.readContract({
1131
1131
  address: this.contractAddress,
1132
- abi: F,
1132
+ abi: M,
1133
1133
  functionName: "getCurrentVaultKeepers",
1134
1134
  args: [e]
1135
1135
  });
1136
- return D(n);
1136
+ return j(n);
1137
1137
  }
1138
1138
  async getCurrentVaultKeepersVersion(e) {
1139
1139
  return await this.publicClient.readContract({
1140
1140
  address: this.contractAddress,
1141
- abi: F,
1141
+ abi: M,
1142
1142
  functionName: "getCurrentVaultKeepersVersion",
1143
1143
  args: [e]
1144
1144
  });
@@ -1155,7 +1155,7 @@ class ft {
1155
1155
  functionName: "getUniversalChallengersByVersion",
1156
1156
  args: [e]
1157
1157
  });
1158
- return D(n);
1158
+ return j(n);
1159
1159
  }
1160
1160
  async getCurrentUniversalChallengers() {
1161
1161
  const e = await this.publicClient.readContract({
@@ -1163,7 +1163,7 @@ class ft {
1163
1163
  abi: _,
1164
1164
  functionName: "getCurrentUniversalChallengers"
1165
1165
  });
1166
- return D(e);
1166
+ return j(e);
1167
1167
  }
1168
1168
  async getLatestUniversalChallengersVersion() {
1169
1169
  return await this.publicClient.readContract({
@@ -1194,12 +1194,12 @@ class mt {
1194
1194
  throw new Error(
1195
1195
  `getVaultProviderBTCKey returned an unexpected value (vp=${e}, length ${r.length}, prefix "${r.slice(0, 2)}")`
1196
1196
  );
1197
- const i = r.slice(2);
1198
- if (!j.isXOnlyPoint(Pe(i)))
1197
+ const s = r.slice(2);
1198
+ if (!U.isXOnlyPoint(Pe(s)))
1199
1199
  throw new Error(
1200
1200
  `getVaultProviderBTCKey returned a value that is not on the secp256k1 curve (vp=${e})`
1201
1201
  );
1202
- return i;
1202
+ return s;
1203
1203
  }
1204
1204
  async getVaultBasicInfo(e) {
1205
1205
  const n = await this.publicClient.readContract({
@@ -1225,7 +1225,7 @@ class mt {
1225
1225
  functionName: "getBtcVaultProtocolInfo",
1226
1226
  args: [e]
1227
1227
  }), r = Number(n.offchainParamsVersion);
1228
- return X(r), {
1228
+ return N(r), {
1229
1229
  depositorSignedPeginTx: n.depositorSignedPeginTx,
1230
1230
  universalChallengersVersion: n.universalChallengersVersion,
1231
1231
  appVaultKeepersVersion: n.appVaultKeepersVersion,
@@ -1236,7 +1236,9 @@ class mt {
1236
1236
  htlcVout: n.htlcVout,
1237
1237
  depositorPopSignature: n.depositorPopSignature,
1238
1238
  prePeginTxHash: n.prePeginTxHash,
1239
- vaultProviderCommissionBps: n.vaultProviderCommissionBps
1239
+ vaultProviderCommissionBps: n.vaultProviderCommissionBps,
1240
+ claimExpiredUntil: n.claimExpiredUntil,
1241
+ vaultCoreVersion: n.vaultCoreVersion
1240
1242
  };
1241
1243
  }
1242
1244
  async getProtocolInfoBatch(e) {
@@ -1248,24 +1250,27 @@ class mt {
1248
1250
  args: [r]
1249
1251
  })),
1250
1252
  allowFailure: !1
1251
- })).map((r, i) => {
1252
- const s = r;
1253
- if (!s.depositorSignedPeginTx || s.depositorSignedPeginTx === "0x")
1253
+ })).map((r, s) => {
1254
+ const i = r;
1255
+ if (!i.depositorSignedPeginTx || i.depositorSignedPeginTx === "0x")
1254
1256
  throw new Error(
1255
- `Vault ${e[i]} not found on-chain or has no pegin transaction`
1257
+ `Vault ${e[s]} not found on-chain or has no pegin transaction`
1256
1258
  );
1257
- return {
1258
- depositorSignedPeginTx: s.depositorSignedPeginTx,
1259
- universalChallengersVersion: s.universalChallengersVersion,
1260
- appVaultKeepersVersion: s.appVaultKeepersVersion,
1261
- offchainParamsVersion: s.offchainParamsVersion,
1262
- verifiedAt: s.verifiedAt,
1263
- depositorWotsPkHash: s.depositorWotsPkHash,
1264
- hashlock: s.hashlock,
1265
- htlcVout: s.htlcVout,
1266
- depositorPopSignature: s.depositorPopSignature,
1267
- prePeginTxHash: s.prePeginTxHash,
1268
- vaultProviderCommissionBps: s.vaultProviderCommissionBps
1259
+ const a = Number(i.offchainParamsVersion);
1260
+ return N(a), {
1261
+ depositorSignedPeginTx: i.depositorSignedPeginTx,
1262
+ universalChallengersVersion: i.universalChallengersVersion,
1263
+ appVaultKeepersVersion: i.appVaultKeepersVersion,
1264
+ offchainParamsVersion: a,
1265
+ verifiedAt: i.verifiedAt,
1266
+ depositorWotsPkHash: i.depositorWotsPkHash,
1267
+ hashlock: i.hashlock,
1268
+ htlcVout: i.htlcVout,
1269
+ depositorPopSignature: i.depositorPopSignature,
1270
+ prePeginTxHash: i.prePeginTxHash,
1271
+ vaultProviderCommissionBps: i.vaultProviderCommissionBps,
1272
+ claimExpiredUntil: i.claimExpiredUntil,
1273
+ vaultCoreVersion: i.vaultCoreVersion
1269
1274
  };
1270
1275
  });
1271
1276
  }
@@ -1295,13 +1300,13 @@ class mt {
1295
1300
  })),
1296
1301
  allowFailure: !1
1297
1302
  })).map((r) => {
1298
- const i = r;
1299
- if (!i.depositorSignedPeginTx || i.depositorSignedPeginTx === "0x")
1303
+ const s = r;
1304
+ if (!s.depositorSignedPeginTx || s.depositorSignedPeginTx === "0x")
1300
1305
  throw new Error(
1301
1306
  "Vault not found on-chain or has no pegin transaction while reading offchain params version"
1302
1307
  );
1303
- const s = Number(i.offchainParamsVersion);
1304
- return X(s), s;
1308
+ const i = Number(s.offchainParamsVersion);
1309
+ return N(i), i;
1305
1310
  });
1306
1311
  }
1307
1312
  }
@@ -1314,15 +1319,15 @@ export {
1314
1319
  Ye as d,
1315
1320
  pe as e,
1316
1321
  ut as f,
1317
- N as g,
1322
+ R as g,
1318
1323
  Ze as h,
1319
1324
  ge as i,
1320
1325
  pt as j,
1321
1326
  ft as k,
1322
1327
  gt as l,
1323
1328
  mt as m,
1324
- ht as p,
1325
- dt as r,
1329
+ dt as p,
1330
+ ht as r,
1326
1331
  ke as v
1327
1332
  };
1328
- //# sourceMappingURL=vault-registry-reader-Blhu9FW2.js.map
1333
+ //# sourceMappingURL=vault-registry-reader-BrARgFre.js.map