@babylonlabs-io/ts-sdk 5.0.1 → 5.1.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 (63) hide show
  1. package/dist/{PayoutManager-C3p_cNHQ.cjs → PayoutManager-B5nR0x1t.cjs} +2 -2
  2. package/dist/{PayoutManager-C3p_cNHQ.cjs.map → PayoutManager-B5nR0x1t.cjs.map} +1 -1
  3. package/dist/{PayoutManager-CkZ3mGXB.js → PayoutManager-BHeiLQ1j.js} +2 -2
  4. package/dist/{PayoutManager-CkZ3mGXB.js.map → PayoutManager-BHeiLQ1j.js.map} +1 -1
  5. package/dist/{PeginManager-tP0Y-UCv.cjs → PeginManager-6ghglb4r.cjs} +2 -2
  6. package/dist/{PeginManager-tP0Y-UCv.cjs.map → PeginManager-6ghglb4r.cjs.map} +1 -1
  7. package/dist/{PeginManager-BvDlBR13.js → PeginManager-CXNqbgA4.js} +4 -4
  8. package/dist/{PeginManager-BvDlBR13.js.map → PeginManager-CXNqbgA4.js.map} +1 -1
  9. package/dist/{buildAndBroadcastReclaim-rUsFRC5H.js → buildAndBroadcastReclaim-Acz637Vf.js} +634 -576
  10. package/dist/{buildAndBroadcastReclaim-rUsFRC5H.js.map → buildAndBroadcastReclaim-Acz637Vf.js.map} +1 -1
  11. package/dist/{buildAndBroadcastReclaim-DtmMg096.cjs → buildAndBroadcastReclaim-Cf05JFP-.cjs} +2 -2
  12. package/dist/{buildAndBroadcastReclaim-DtmMg096.cjs.map → buildAndBroadcastReclaim-Cf05JFP-.cjs.map} +1 -1
  13. package/dist/{challengeAssert-ea0EmRKe.cjs → challengeAssert-CuX_8Twt.cjs} +2 -2
  14. package/dist/{challengeAssert-ea0EmRKe.cjs.map → challengeAssert-CuX_8Twt.cjs.map} +1 -1
  15. package/dist/{challengeAssert-CVxCGwBH.js → challengeAssert-D_lRvsO0.js} +2 -2
  16. package/dist/{challengeAssert-CVxCGwBH.js.map → challengeAssert-D_lRvsO0.js.map} +1 -1
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.js +90 -87
  19. package/dist/peginState-B4t_PDgj.cjs +2 -0
  20. package/dist/peginState-B4t_PDgj.cjs.map +1 -0
  21. package/dist/{peginState-CIibG9S_.js → peginState-CXdbSit3.js} +7 -7
  22. package/dist/peginState-CXdbSit3.js.map +1 -0
  23. package/dist/{reservation-BZQABu4g.js → reservation-BAj5n-H_.js} +2 -2
  24. package/dist/{reservation-BZQABu4g.js.map → reservation-BAj5n-H_.js.map} +1 -1
  25. package/dist/{reservation-CA5knoQ0.cjs → reservation-D9ftyiwP.cjs} +2 -2
  26. package/dist/{reservation-CA5knoQ0.cjs.map → reservation-D9ftyiwP.cjs.map} +1 -1
  27. package/dist/tbv/core/clients/eth/types.d.ts +1 -1
  28. package/dist/tbv/core/index.cjs +1 -1
  29. package/dist/tbv/core/index.js +92 -89
  30. package/dist/tbv/core/managers/index.cjs +1 -1
  31. package/dist/tbv/core/managers/index.js +2 -2
  32. package/dist/tbv/core/primitives/index.cjs +1 -1
  33. package/dist/tbv/core/primitives/index.js +3 -3
  34. package/dist/tbv/core/services/deposit/index.d.ts +1 -1
  35. package/dist/tbv/core/services/deposit/index.d.ts.map +1 -1
  36. package/dist/tbv/core/services/deposit/peginState.d.ts +9 -2
  37. package/dist/tbv/core/services/deposit/peginState.d.ts.map +1 -1
  38. package/dist/tbv/core/services/deposit/verifyRegisteredParticipantKeys.d.ts +27 -1
  39. package/dist/tbv/core/services/deposit/verifyRegisteredParticipantKeys.d.ts.map +1 -1
  40. package/dist/tbv/core/services/index.cjs +1 -1
  41. package/dist/tbv/core/services/index.js +85 -82
  42. package/dist/tbv/core/utils/index.cjs +1 -1
  43. package/dist/tbv/core/utils/index.js +1 -1
  44. package/dist/tbv/index.cjs +1 -1
  45. package/dist/tbv/index.js +92 -89
  46. package/dist/{toRefundInputs-4W8aNM6b.cjs → toRefundInputs-BzyN0zvj.cjs} +2 -2
  47. package/dist/{toRefundInputs-4W8aNM6b.cjs.map → toRefundInputs-BzyN0zvj.cjs.map} +1 -1
  48. package/dist/{toRefundInputs-M4IbYwZU.js → toRefundInputs-DwXpKQxN.js} +4 -4
  49. package/dist/{toRefundInputs-M4IbYwZU.js.map → toRefundInputs-DwXpKQxN.js.map} +1 -1
  50. package/dist/types-BnZIbDHb.cjs.map +1 -1
  51. package/dist/types-K_aM5GZO.js.map +1 -1
  52. package/dist/{verifyKeyPathSchnorrSignature-DDi3B6EL.cjs → verifyKeyPathSchnorrSignature-BVrAmVL3.cjs} +2 -2
  53. package/dist/{verifyKeyPathSchnorrSignature-DDi3B6EL.cjs.map → verifyKeyPathSchnorrSignature-BVrAmVL3.cjs.map} +1 -1
  54. package/dist/{verifyKeyPathSchnorrSignature-CAp5zOTX.js → verifyKeyPathSchnorrSignature-CIE3jlVt.js} +2 -2
  55. package/dist/{verifyKeyPathSchnorrSignature-CAp5zOTX.js.map → verifyKeyPathSchnorrSignature-CIE3jlVt.js.map} +1 -1
  56. package/dist/{verifyScriptPathSchnorrSignature-cpUVCwU3.cjs → verifyScriptPathSchnorrSignature-BHskbJJx.cjs} +2 -2
  57. package/dist/{verifyScriptPathSchnorrSignature-cpUVCwU3.cjs.map → verifyScriptPathSchnorrSignature-BHskbJJx.cjs.map} +1 -1
  58. package/dist/{verifyScriptPathSchnorrSignature-BK-bd6w5.js → verifyScriptPathSchnorrSignature-DLNGgm4j.js} +3 -2
  59. package/dist/{verifyScriptPathSchnorrSignature-BK-bd6w5.js.map → verifyScriptPathSchnorrSignature-DLNGgm4j.js.map} +1 -1
  60. package/package.json +1 -1
  61. package/dist/peginState-CIibG9S_.js.map +0 -1
  62. package/dist/peginState-IyE22wWh.cjs +0 -2
  63. package/dist/peginState-IyE22wWh.cjs.map +0 -1
@@ -1,58 +1,58 @@
1
- var er = Object.defineProperty;
2
- var tr = (e, t, r) => t in e ? er(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var W = (e, t, r) => tr(e, typeof t != "symbol" ? t + "" : t, r);
1
+ var tr = Object.defineProperty;
2
+ var rr = (e, t, r) => t in e ? tr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var W = (e, t, r) => rr(e, typeof t != "symbol" ? t + "" : t, r);
4
4
  import { B as Be } from "./BTCVaultRegistry.abi-DnP4UkB5.js";
5
- import { e as Ie, s as P, i as rr, u as yt, c as _, v as or, g as sr, p as pe, f as N } from "./bitcoin-C-TuHb-v.js";
6
- import { v as nr, s as vt, b as Pt, P as ir, d as ar } from "./PayoutManager-CkZ3mGXB.js";
7
- import { verifyWatchtowerArtifacts as ur, buildClaimPsbt as cr, buildAssertClaimerPsbt as lr, buildPayoutClaimerPsbt as dr, buildWronglyChallengedPsbts as hr, buildPayoutDepositorPsbt as pr, finalizeClaimTx as gr, buildWatchtowerArtifacts as fr, extractTapScriptSig as bt, expandWotsSeed as yr, wotsKeypairFromSeed as vr, validateWotsKeypairAgainstGraph as Pr, getChallengeAssertOutputScriptPubKey as br, deriveVaultId as mr } from "./tbv/core/wasm/index.js";
8
- import { m as wr, d as mt, k as xr, a as _e, V as Le, i as Er, g as kr, f as $r, r as Cr, h as Tr } from "./registration-records-D39ApuHS.js";
5
+ import { e as Ie, s as P, i as or, u as yt, c as _, v as sr, g as nr, p as he, f as N } from "./bitcoin-C-TuHb-v.js";
6
+ import { v as ir, s as vt, b as Pt, P as ar, d as ur } from "./PayoutManager-BHeiLQ1j.js";
7
+ import { verifyWatchtowerArtifacts as cr, buildClaimPsbt as lr, buildAssertClaimerPsbt as pr, buildPayoutClaimerPsbt as dr, buildWronglyChallengedPsbts as hr, buildPayoutDepositorPsbt as gr, finalizeClaimTx as fr, buildWatchtowerArtifacts as yr, extractTapScriptSig as mt, expandWotsSeed as vr, wotsKeypairFromSeed as Pr, validateWotsKeypairAgainstGraph as mr, getChallengeAssertOutputScriptPubKey as br, deriveVaultId as wr } from "./tbv/core/wasm/index.js";
8
+ import { m as xr, d as bt, k as Er, a as _e, V as Le, i as kr, g as $r, f as Cr, r as Tr, h as _r } from "./registration-records-D39ApuHS.js";
9
9
  import { Psbt as q, Transaction as S } from "bitcoinjs-lib";
10
- import { F, G as A, H as re, I as J, A as G, z as Z, J as ge, v as Me, E as ee, K as Ve, w as Fe, x as Ue, y as qe, W as _r, D as Ge, C as Xe, L as Sr, O as Ar, Q as Br } from "./constants-CmDDuM3L.js";
11
- import { p as Ir, q as Vr, r as wt, P as X, j as oe, f as Rr, i as ae, g as ue } from "./verifyScriptPathSchnorrSignature-BK-bd6w5.js";
10
+ import { F as U, G as A, H as re, I as J, A as G, z as Z, J as ge, v as Me, E as ee, K as Ve, w as Ue, x as Fe, y as qe, W as Sr, D as Ge, C as Xe, L as Ar, O as Br, Q as Ir } from "./constants-CmDDuM3L.js";
11
+ import { p as Vr, q as Rr, r as wt, P as X, j as oe, f as Kr, i as ae, g as ue, s as Hr } from "./verifyScriptPathSchnorrSignature-DLNGgm4j.js";
12
12
  import { Buffer as H } from "buffer";
13
13
  import { C as xt, X as Et } from "./validation-OSC0xTHB.js";
14
14
  import { a as kt, c as ce } from "./signing-C1rR4tqs.js";
15
15
  import { d as $t } from "./deriveVaultRoot-BcvmER1E.js";
16
- import { O as ze, d as Kr } from "./types-K_aM5GZO.js";
17
- import { zeroAddress as Hr, isAddress as Or, isAddressEqual as Nr } from "viem";
18
- import { v as je, D as R, c as Dr, b as Lr, R as Mr, d as Ct } from "./state-CFn1rT74.js";
19
- import { h as We, b as Fr, s as Ur, j as qr } from "./sha2-YqVHJiFj.js";
20
- import { c as Gr, g as Xr, h as zr, i as jr, b as Wr, f as Tt, e as Yr, a as Qr } from "./challengeAssert-CVxCGwBH.js";
21
- import { a as Jr } from "./secp256k1-BuxBFUHm.js";
22
- import { c as Zr } from "./btcTxHash-BRZ8_EZq.js";
23
- const eo = /^0x[0-9a-fA-F]{64}$/, to = /^0x[0-9a-fA-F]{40}$/, ro = /^0x([0-9a-fA-F]{2})*$/;
16
+ import { O as ze, d as Or } from "./types-K_aM5GZO.js";
17
+ import { zeroAddress as Nr, isAddress as Dr, isAddressEqual as Lr } from "viem";
18
+ import { v as je, D as R, c as Mr, b as Ur, R as Fr, d as Ct } from "./state-CFn1rT74.js";
19
+ import { h as We, b as qr, s as Gr, j as Xr } from "./sha2-YqVHJiFj.js";
20
+ import { c as zr, g as jr, h as Wr, i as Yr, b as Qr, f as Tt, e as Jr, a as Zr } from "./challengeAssert-D_lRvsO0.js";
21
+ import { a as eo } from "./secp256k1-BuxBFUHm.js";
22
+ import { c as to } from "./btcTxHash-BRZ8_EZq.js";
23
+ const ro = /^0x[0-9a-fA-F]{64}$/, oo = /^0x[0-9a-fA-F]{40}$/, so = /^0x([0-9a-fA-F]{2})*$/;
24
24
  function ye(e, t) {
25
25
  if (e.length !== 66)
26
26
  throw new Error(
27
27
  `${t} must be 32 bytes (66 hex chars with 0x prefix), got length ${e.length}`
28
28
  );
29
- if (!eo.test(e))
29
+ if (!ro.test(e))
30
30
  throw new Error(
31
31
  `${t} must contain only hex characters after the 0x prefix`
32
32
  );
33
33
  }
34
- function oo(e, t) {
35
- if (!to.test(e))
34
+ function no(e, t) {
35
+ if (!oo.test(e))
36
36
  throw new Error(
37
37
  `${t} must be a 20-byte 0x-prefixed hex address (42 chars)`
38
38
  );
39
39
  }
40
- function so(e, t) {
41
- if (!ro.test(e))
40
+ function io(e, t) {
41
+ if (!so.test(e))
42
42
  throw new Error(
43
43
  `${t} must be a 0x-prefixed hex string with an even number of hex chars`
44
44
  );
45
45
  }
46
46
  function Re(e) {
47
- oo(e.btcVaultRegistryAddress, "btcVaultRegistryAddress"), ye(e.vaultId, "vaultId");
47
+ no(e.btcVaultRegistryAddress, "btcVaultRegistryAddress"), ye(e.vaultId, "vaultId");
48
48
  const t = Ie(e.secret);
49
- if (ye(t, "secret"), e.hashlock !== void 0 && (ye(e.hashlock, "hashlock"), !nr(t, e.hashlock)))
49
+ if (ye(t, "secret"), e.hashlock !== void 0 && (ye(e.hashlock, "hashlock"), !ir(t, e.hashlock)))
50
50
  throw new Error(
51
51
  "Invalid secret: SHA256(secret) does not match the provided hashlock"
52
52
  );
53
53
  return t;
54
54
  }
55
- async function nn(e) {
55
+ async function cn(e) {
56
56
  const {
57
57
  btcVaultRegistryAddress: t,
58
58
  vaultId: r,
@@ -68,14 +68,14 @@ async function nn(e) {
68
68
  secret: e.secret,
69
69
  hashlock: o
70
70
  });
71
- return so(s, "activationMetadata"), n({
71
+ return io(s, "activationMetadata"), n({
72
72
  address: t,
73
73
  abi: Be,
74
74
  functionName: "activateVaultWithSecret",
75
75
  args: [r, i, s]
76
76
  });
77
77
  }
78
- async function an(e) {
78
+ async function ln(e) {
79
79
  const { btcVaultRegistryAddress: t, vaultId: r, hashlock: o, writeContract: s, signal: n } = e;
80
80
  n == null || n.throwIfAborted();
81
81
  const a = Re({
@@ -91,7 +91,7 @@ async function an(e) {
91
91
  args: [r, a]
92
92
  });
93
93
  }
94
- async function un(e) {
94
+ async function pn(e) {
95
95
  const { btcVaultRegistryAddress: t, vaultId: r, hashlock: o, writeContract: s, signal: n } = e;
96
96
  if (n == null || n.throwIfAborted(), typeof o != "string")
97
97
  throw new Error("hashlock is required to claim an expired vault");
@@ -120,7 +120,7 @@ function ve(e, t) {
120
120
  throw new K(`${e} PSBT cannot be parsed.`, { cause: r });
121
121
  }
122
122
  }
123
- function no(e, t, r) {
123
+ function ao(e, t, r) {
124
124
  const o = t.txInputs[r];
125
125
  if (!o)
126
126
  throw new K(`${e} PSBT has no input ${r}.`);
@@ -140,12 +140,12 @@ function Pe(e, t, r, o, s, n) {
140
140
  `${e} input ${r} does not spend ${n}: the graph pairs this ${e} with a different transaction.`
141
141
  );
142
142
  }
143
- function io(e, t) {
143
+ function uo(e, t) {
144
144
  var s;
145
- const r = (s = e.data.inputs[F]) == null ? void 0 : s.witnessUtxo;
145
+ const r = (s = e.data.inputs[U]) == null ? void 0 : s.witnessUtxo;
146
146
  if (r === void 0)
147
147
  throw new K(
148
- `Assert input ${F} carries no witnessUtxo, so the amount and script its signature commits to cannot be checked; refusing to sign assert.`
148
+ `Assert input ${U} carries no witnessUtxo, so the amount and script its signature commits to cannot be checked; refusing to sign assert.`
149
149
  );
150
150
  const o = t.txOutputs[J];
151
151
  if (!o)
@@ -154,23 +154,23 @@ function io(e, t) {
154
154
  );
155
155
  if (r.value !== o.value)
156
156
  throw new K(
157
- `Assert input ${F} declares a prevout of ${r.value} sats but the Claim's output ${J} is worth ${o.value}; refusing to sign assert.`
157
+ `Assert input ${U} declares a prevout of ${r.value} sats but the Claim's output ${J} is worth ${o.value}; refusing to sign assert.`
158
158
  );
159
159
  if (!r.script.equals(o.script))
160
160
  throw new K(
161
- `Assert input ${F} declares a prevout script that is not the Claim's output ${J} script; refusing to sign assert.`
161
+ `Assert input ${U} declares a prevout script that is not the Claim's output ${J} script; refusing to sign assert.`
162
162
  );
163
163
  }
164
- function ao(e) {
164
+ function co(e) {
165
165
  const t = ve("Claim", e.claimPsbtBase64), r = ve("Assert", e.assertPsbtBase64), o = ve("Payout", e.payoutClaimerPsbtBase64);
166
166
  Pe(
167
167
  "Assert",
168
168
  r,
169
- F,
169
+ U,
170
170
  Ye(t),
171
171
  J,
172
172
  "Claim:0"
173
- ), io(r, t), Pe(
173
+ ), uo(r, t), Pe(
174
174
  "Payout",
175
175
  o,
176
176
  A,
@@ -181,12 +181,12 @@ function ao(e) {
181
181
  "Payout",
182
182
  o,
183
183
  re,
184
- no("Claim", t, ge),
184
+ ao("Claim", t, ge),
185
185
  Z,
186
186
  "this vault's PegIn:0"
187
187
  );
188
188
  }
189
- function be(e, t) {
189
+ function me(e, t) {
190
190
  try {
191
191
  return q.fromBase64(t);
192
192
  } catch (r) {
@@ -224,7 +224,7 @@ function Qe(e, t, r, o) {
224
224
  `${e} Payout input ${A} declares a prevout script that is not the Assert's output ${G} script; refusing to sign payout.`
225
225
  );
226
226
  }
227
- async function uo(e) {
227
+ async function lo(e) {
228
228
  const { vault: t } = e, r = {
229
229
  vaultCoreVersion: t.vaultCoreVersion,
230
230
  numVaultKeepers: t.vaultKeeperBtcPubkeys.length,
@@ -232,11 +232,11 @@ async function uo(e) {
232
232
  councilSize: t.councilSize,
233
233
  protocolFeeRate: t.protocolFeeRate
234
234
  };
235
- Ir(r);
236
- const o = be("Claimer Payout", e.payoutClaimerPsbtBase64), s = be(
235
+ Vr(r);
236
+ const o = me("Claimer Payout", e.payoutClaimerPsbtBase64), s = me(
237
237
  "Depositor Payout",
238
238
  e.payoutDepositorPsbtBase64
239
- ), n = be("Assert", e.assertPsbtBase64);
239
+ ), n = me("Assert", e.assertPsbtBase64);
240
240
  if (!s.data.globalMap.unsignedTx.toBuffer().equals(o.data.globalMap.unsignedTx.toBuffer()))
241
241
  throw new Error(
242
242
  "Depositor and claimer Payout PSBTs describe different transactions; refusing to sign payout."
@@ -276,26 +276,26 @@ async function uo(e) {
276
276
  throw new Error(
277
277
  `Payout transaction has ${c.length} output(s), expected exactly ${ee} for a depositor-as-claimer payout.`
278
278
  );
279
- let h = 0;
280
- for (const d of c) h += d.value;
281
- if (h > l)
279
+ let d = 0;
280
+ for (const p of c) d += p.value;
281
+ if (d > l)
282
282
  throw new Error(
283
- `Payout outputs (${h} sats) exceed inputs (${l} sats); invalid transaction.`
283
+ `Payout outputs (${d} sats) exceed inputs (${l} sats); invalid transaction.`
284
284
  );
285
- await Vr(r, {
286
- implicitFeeSats: l - h,
285
+ await Rr(r, {
286
+ implicitFeeSats: l - d,
287
287
  out0Len: c[Ve].script.length,
288
288
  out1Len: void 0
289
289
  });
290
290
  }
291
- class co extends Error {
291
+ class po extends Error {
292
292
  constructor(t, r) {
293
293
  super(
294
294
  "Transaction graph's challenger set does not match the vault's (local ∪ universal)" + (t.length > 0 ? ` (missing: ${t.join(", ")})` : "") + (r.length > 0 ? ` (unexpected: ${r.join(", ")})` : "") + ". Refusing to sign an incomplete or padded challenger set."
295
295
  ), this.missing = t, this.unexpected = r, this.name = "ChallengerSetMismatchError";
296
296
  }
297
297
  }
298
- function lo(e) {
298
+ function ho(e) {
299
299
  const t = wt({
300
300
  claimerBtcPubkey: e.depositorBtcPubkey,
301
301
  depositorBtcPubkey: e.depositorBtcPubkey,
@@ -313,29 +313,29 @@ function lo(e) {
313
313
  );
314
314
  const a = [...t, ...r], i = new Set(a), u = a.filter((c) => !n.has(c)), l = s.filter((c) => !i.has(c));
315
315
  if (u.length > 0 || l.length > 0)
316
- throw new co(u, l);
316
+ throw new po(u, l);
317
317
  }
318
318
  function Je(e) {
319
319
  return P(e).toLowerCase();
320
320
  }
321
- class ho extends Error {
321
+ class go extends Error {
322
322
  constructor(t, r) {
323
323
  super(
324
324
  `Payout transaction output ${Ve} pays ${r}, not the vault's registered payout script ${t}. Refusing to sign a payout to another destination.`
325
325
  ), this.expectedScriptHex = t, this.actualScriptHex = r, this.name = "PayoutDestinationError";
326
326
  }
327
327
  }
328
- function po(e) {
328
+ function fo(e) {
329
329
  let t;
330
330
  try {
331
331
  t = q.fromBase64(e.payoutPsbtBase64);
332
332
  } catch (c) {
333
333
  throw new Error("Payout PSBT cannot be parsed.", { cause: c });
334
334
  }
335
- const { version: r, locktime: o, outs: s } = go(t);
336
- if (r !== Fe || o !== Ue)
335
+ const { version: r, locktime: o, outs: s } = yo(t);
336
+ if (r !== Ue || o !== Fe)
337
337
  throw new Error(
338
- `Payout transaction has version ${r} and locktime ${o}, expected ${Fe} and ${Ue}.`
338
+ `Payout transaction has version ${r} and locktime ${o}, expected ${Ue} and ${Fe}.`
339
339
  );
340
340
  if (s.length !== ee)
341
341
  throw new Error(
@@ -350,21 +350,21 @@ function po(e) {
350
350
  );
351
351
  const a = s[Ve].script.toString("hex").toLowerCase();
352
352
  if (a !== n)
353
- throw new ho(n, a);
353
+ throw new go(n, a);
354
354
  const i = s[ee - 1];
355
355
  if (i.value !== qe)
356
356
  throw new Error(
357
357
  `Payout CPFP anchor value ${i.value} sats must equal ${qe} sats.`
358
358
  );
359
359
  const u = P(
360
- wr(P(e.depositorBtcPubkey).toLowerCase())
360
+ xr(P(e.depositorBtcPubkey).toLowerCase())
361
361
  ), l = i.script.toString("hex").toLowerCase();
362
362
  if (l !== u)
363
363
  throw new Error(
364
364
  `Payout CPFP anchor pays ${l}, not the depositor's BIP-86 P2TR ${u}. Refusing to sign a payout whose fee-bump output is spendable by somebody else.`
365
365
  );
366
366
  }
367
- function go(e) {
367
+ function yo(e) {
368
368
  return {
369
369
  version: e.version,
370
370
  locktime: e.locktime,
@@ -379,7 +379,7 @@ class ne extends Error {
379
379
  super(t), this.name = "PayoutInputLeafError";
380
380
  }
381
381
  }
382
- function fo(e) {
382
+ function vo(e) {
383
383
  const t = q.fromBase64(e.payoutDepositorPsbtBase64), r = q.fromBase64(e.payoutClaimerPsbtBase64), o = t.data.globalMap.unsignedTx.toBuffer(), s = r.data.globalMap.unsignedTx.toBuffer();
384
384
  if (!o.equals(s))
385
385
  throw new ne(
@@ -404,14 +404,14 @@ function fo(e) {
404
404
  ...n.tapMerkleRoot ? { tapMerkleRoot: n.tapMerkleRoot } : {}
405
405
  }), t.toBase64();
406
406
  }
407
- class yo extends Error {
407
+ class Po extends Error {
408
408
  constructor(t, r, o) {
409
409
  super(
410
410
  `Transaction graph does not belong to vault ${t}: its Claim spends PegIn ${o}, which derives vault ${r}. Refusing to sign for a graph served for another vault.`
411
411
  ), this.expectedVaultId = t, this.derivedVaultId = r, this.peginTxid = o, this.name = "VaultIdBindingError";
412
412
  }
413
413
  }
414
- function vo(e) {
414
+ function mo(e) {
415
415
  let t;
416
416
  try {
417
417
  t = q.fromBase64(e);
@@ -427,7 +427,7 @@ function vo(e) {
427
427
  r.index
428
428
  ), Ke(r.hash);
429
429
  }
430
- function Po(e) {
430
+ function bo(e) {
431
431
  const t = e.ins[ge];
432
432
  if (!t)
433
433
  throw new Error(
@@ -447,10 +447,10 @@ function _t(e, t, r) {
447
447
  }
448
448
  function St(e) {
449
449
  const t = z(
450
- mt(e.peginTxid, e.depositorEthAddress)
450
+ bt(e.peginTxid, e.depositorEthAddress)
451
451
  ), r = z(e.expectedVaultId);
452
452
  if (t !== r)
453
- throw new yo(r, t, e.peginTxid);
453
+ throw new Po(r, t, e.peginTxid);
454
454
  }
455
455
  function z(e) {
456
456
  return `0x${(e.startsWith("0x") ? e.slice(2) : e).toLowerCase()}`;
@@ -477,36 +477,36 @@ function At(e) {
477
477
  `Vault provider served Groth16 verifying key ${t} but the trusted key for prover circuit version ${e.proverCircuitVersion} is ${r}; refusing to sign a claim whose proof would verify under a substituted key.`
478
478
  );
479
479
  }
480
- const U = 1;
481
- class bo extends Error {
480
+ const F = 1;
481
+ class wo extends Error {
482
482
  constructor(t, r) {
483
483
  super(
484
484
  `Artifacts belong to vault ${r}, not ${t}. Select the artifacts file saved for this vault.`
485
485
  ), this.expectedVaultId = t, this.actualVaultId = r, this.name = "ArtifactsVaultMismatchError";
486
486
  }
487
487
  }
488
- const mo = /^(?:[0-9a-fA-F]{2})+$/;
489
- function wo(e) {
490
- const t = ko(e, "babe_sessions"), r = Object.keys(t);
488
+ const xo = /^(?:[0-9a-fA-F]{2})+$/;
489
+ function Eo(e) {
490
+ const t = Co(e, "babe_sessions"), r = Object.keys(t);
491
491
  if (r.length === 0)
492
492
  return { joined: !1 };
493
493
  for (const [o, s] of Object.entries(t)) {
494
494
  const n = typeof s == "object" && s !== null ? s.decryptor_artifacts_hex : void 0;
495
- if (typeof n != "string" || !mo.test(n))
495
+ if (typeof n != "string" || !xo.test(n))
496
496
  throw new Error(
497
497
  `Artifacts file is missing a usable "babe_sessions": the entry for ${o} carries no non-empty hex "decryptor_artifacts_hex".`
498
498
  );
499
499
  }
500
500
  return { joined: !0, challengerPubkeys: r };
501
501
  }
502
- function xo(e) {
502
+ function ko(e) {
503
503
  let t;
504
504
  try {
505
505
  t = JSON.parse(e);
506
506
  } catch (a) {
507
507
  throw new Error("Artifacts file is not valid JSON.", { cause: a });
508
508
  }
509
- const r = me(t.vault_id, "vault_id"), o = Eo(me(t.claim_tx, "claim_tx")), s = we(
509
+ const r = be(t.vault_id, "vault_id"), o = $o(be(t.claim_tx, "claim_tx")), s = we(
510
510
  t.prover_circuit_version,
511
511
  "prover_circuit_version"
512
512
  ), n = BigInt(
@@ -522,26 +522,26 @@ function xo(e) {
522
522
  ),
523
523
  vaultId: r,
524
524
  claimTxid: o.getId(),
525
- peginTxid: Po(o),
525
+ peginTxid: bo(o),
526
526
  proverCircuitVersion: s,
527
527
  claimableEventBlockNumber: n,
528
528
  // Required: btc-vault's builder always writes it
529
529
  // (`delegated_claim.rs:874` @ b534ff9e), so an absent one is not a file
530
530
  // this SDK or the CLI produced.
531
- verifyingKeyHex: me(t.verifying_key, "verifying_key"),
532
- babeSessions: wo(t.babe_sessions)
531
+ verifyingKeyHex: be(t.verifying_key, "verifying_key"),
532
+ babeSessions: Eo(t.babe_sessions)
533
533
  };
534
534
  }
535
- async function cn(e) {
536
- const t = xo(e.artifactsJson), r = z(e.expectedVaultId), o = z(t.vaultId);
535
+ async function dn(e) {
536
+ const t = ko(e.artifactsJson), r = z(e.expectedVaultId), o = z(t.vaultId);
537
537
  if (r !== o)
538
- throw new bo(r, o);
538
+ throw new wo(r, o);
539
539
  St({
540
540
  peginTxid: t.peginTxid,
541
541
  depositorEthAddress: e.depositorEthAddress,
542
542
  expectedVaultId: r
543
543
  });
544
- const s = e.txGraphVersion ?? U;
544
+ const s = e.txGraphVersion ?? F;
545
545
  if (t.vaultCoreVersion !== s)
546
546
  throw new Error(
547
547
  `Artifacts record vault core version ${t.vaultCoreVersion}, but verification was asked for version ${s}.`
@@ -569,9 +569,9 @@ async function cn(e) {
569
569
  throw new Error(
570
570
  `Artifacts carry Groth16 verifying key ${n} but the trusted key for prover circuit version ${e.expectedProverCircuitVersion} is ${a}; refusing a file whose proof would verify under a substituted key.`
571
571
  );
572
- return await ur(s, e.artifactsJson), t;
572
+ return await cr(s, e.artifactsJson), t;
573
573
  }
574
- function Eo(e) {
574
+ function $o(e) {
575
575
  try {
576
576
  return S.fromHex(e);
577
577
  } catch (t) {
@@ -580,7 +580,7 @@ function Eo(e) {
580
580
  });
581
581
  }
582
582
  }
583
- function me(e, t) {
583
+ function be(e, t) {
584
584
  if (typeof e != "string" || e.length === 0)
585
585
  throw new Error(`Artifacts file is missing a usable "${t}".`);
586
586
  return e;
@@ -590,7 +590,7 @@ function we(e, t) {
590
590
  throw new Error(`Artifacts file is missing a usable "${t}".`);
591
591
  return e;
592
592
  }
593
- function ko(e, t) {
593
+ function Co(e, t) {
594
594
  if (typeof e != "object" || e === null || Array.isArray(e))
595
595
  throw new Error(`Artifacts file is missing a usable "${t}".`);
596
596
  return e;
@@ -610,7 +610,7 @@ function It(e) {
610
610
  id: "assert",
611
611
  kind: "assert",
612
612
  psbtBase64: e.assert,
613
- inputIndex: F
613
+ inputIndex: U
614
614
  },
615
615
  {
616
616
  id: "payoutClaimer",
@@ -631,16 +631,16 @@ function It(e) {
631
631
  id: Bt(r, s),
632
632
  kind: "wronglyChallenged",
633
633
  psbtBase64: o,
634
- inputIndex: _r
634
+ inputIndex: Sr
635
635
  });
636
636
  });
637
637
  return t;
638
638
  }
639
- const $o = "{}", Co = xt - Et;
639
+ const To = "{}", _o = xt - Et;
640
640
  function V(e) {
641
641
  const t = e.replace(/^0x/, "").toLowerCase();
642
642
  if (t.length === xt)
643
- return t.slice(Co);
643
+ return t.slice(_o);
644
644
  if (t.length === Et) return t;
645
645
  throw new Error(
646
646
  `Public key must be 33-byte compressed or 32-byte x-only hex, got ${t.length / 2} bytes.`
@@ -653,7 +653,7 @@ async function Ze(e, t, r) {
653
653
  "Connected wallet does not hold the vault's depositor key. Select the account that made the deposit, then try again."
654
654
  );
655
655
  const s = await e.getAddress();
656
- if (!rr(s, o, r))
656
+ if (!or(s, o, r))
657
657
  throw new Error(
658
658
  `Connected wallet reports address "${s}", which is not derived from the vault's depositor key. Select the account that made the deposit, then try again.`
659
659
  );
@@ -666,57 +666,57 @@ async function Vt(e, t, r, o) {
666
666
  `Depositor key ${s} is not the vault's registered depositor key ${r.depositorBtcPubkey}; refusing to plan a claim for another key.`
667
667
  );
668
668
  try {
669
- xr(
669
+ Er(
670
670
  Ie(r.registeredPayoutScriptPubKey),
671
671
  r.depositorBtcPubkey,
672
672
  o
673
673
  );
674
- } catch (h) {
674
+ } catch (d) {
675
675
  throw new Error(
676
- `Registered payout script ${r.registeredPayoutScriptPubKey} failed the depositor-key derivation check: ${h instanceof Error ? h.message : String(h)}. This SDK registers only P2TR of the depositor's x-only key or P2WPKH of the compressed key (the contract bounds the script's length alone, PeginLogic.sol:237-240 @ c559f5c2); refusing to sign a claim that pays it.`,
677
- { cause: h }
676
+ `Registered payout script ${r.registeredPayoutScriptPubKey} failed the depositor-key derivation check: ${d instanceof Error ? d.message : String(d)}. This SDK registers only P2TR of the depositor's x-only key or P2WPKH of the compressed key (the contract bounds the script's length alone, PeginLogic.sol:237-240 @ c559f5c2); refusing to sign a claim that pays it.`,
677
+ { cause: d }
678
678
  );
679
679
  }
680
- if (e !== U)
680
+ if (e !== F)
681
681
  throw new Error(
682
- `Graph version ${e} is not the delegated-claim graph version ${U}; vaults on other graphs have no delegated-claim path.`
682
+ `Graph version ${e} is not the delegated-claim graph version ${F}; vaults on other graphs have no delegated-claim path.`
683
683
  );
684
684
  if (e !== r.vaultCoreVersion)
685
685
  throw new Error(
686
686
  `Graph version ${e} does not match the vault context's vault core version ${r.vaultCoreVersion}; they are one axis and must agree.`
687
687
  );
688
688
  const [n, a, i, u, l] = await Promise.all([
689
- cr(e, t),
690
689
  lr(e, t),
690
+ pr(e, t),
691
691
  dr(e, t),
692
692
  hr(e, t),
693
- pr(e, t)
693
+ gr(e, t)
694
694
  ]);
695
695
  St({
696
- peginTxid: vo(n),
696
+ peginTxid: mo(n),
697
697
  depositorEthAddress: r.depositorEthAddress,
698
698
  expectedVaultId: r.vaultId
699
- }), ao({
699
+ }), co({
700
700
  claimPsbtBase64: n,
701
701
  assertPsbtBase64: a,
702
702
  payoutClaimerPsbtBase64: i
703
703
  });
704
- for (const h of [i, l])
705
- po({
706
- payoutPsbtBase64: h,
704
+ for (const d of [i, l])
705
+ fo({
706
+ payoutPsbtBase64: d,
707
707
  registeredPayoutScriptPubKey: r.registeredPayoutScriptPubKey,
708
708
  depositorBtcPubkey: r.depositorBtcPubkey
709
709
  });
710
- const c = fo({
710
+ const c = vo({
711
711
  payoutDepositorPsbtBase64: l,
712
712
  payoutClaimerPsbtBase64: i
713
713
  });
714
- return await uo({
714
+ return await lo({
715
715
  payoutClaimerPsbtBase64: i,
716
716
  payoutDepositorPsbtBase64: c,
717
717
  assertPsbtBase64: a,
718
718
  vault: r
719
- }), lo({
719
+ }), ho({
720
720
  graphChallengerPubkeys: Object.keys(u),
721
721
  depositorBtcPubkey: o,
722
722
  vaultProviderBtcPubkey: r.vaultProviderBtcPubkey,
@@ -724,7 +724,7 @@ async function Vt(e, t, r, o) {
724
724
  universalChallengerBtcPubkeys: r.universalChallengerBtcPubkeys
725
725
  }), { claim: n, assert: a, payoutClaimer: i, payoutDepositor: c, wronglyChallenged: u };
726
726
  }
727
- async function To(e) {
727
+ async function So(e) {
728
728
  At({
729
729
  servedVerifyingKeyHex: e.source.verifyingKeyHex,
730
730
  trustedVerifyingKeyHex: e.trustedVerifyingKeyHex,
@@ -743,7 +743,7 @@ async function To(e) {
743
743
  source: e.source,
744
744
  vault: e.vault,
745
745
  // Omitted means unjoined: the browser cannot hold the real sessions.
746
- babeSessionsJson: e.babeSessionsJson === void 0 ? $o : e.babeSessionsJson,
746
+ babeSessionsJson: e.babeSessionsJson === void 0 ? To : e.babeSessionsJson,
747
747
  requests: It(t)
748
748
  };
749
749
  }
@@ -766,7 +766,7 @@ class Y extends Error {
766
766
  super(t), this.name = "SigningPlanMismatchError";
767
767
  }
768
768
  }
769
- function _o(e, t) {
769
+ function Ao(e, t) {
770
770
  if (e.length !== t.length)
771
771
  throw new Y(
772
772
  `Plan has ${e.length} requests but the graph builds ${t.length}; the plan was altered after planning.`
@@ -791,7 +791,7 @@ function _o(e, t) {
791
791
  );
792
792
  }
793
793
  }
794
- function So(e, t) {
794
+ function Bo(e, t) {
795
795
  const r = new Set(e.map((a) => a.id)), o = [...r].filter((a) => !t.has(a)), s = [...t.keys()].filter((a) => !r.has(a));
796
796
  if (o.length === 0 && s.length === 0) return;
797
797
  const n = (a) => a.map((i) => `"${i}"`).join(", ");
@@ -807,7 +807,7 @@ function L(e, t) {
807
807
  );
808
808
  return r;
809
809
  }
810
- async function Ao(e) {
810
+ async function Io(e) {
811
811
  const { plan: t, signatures: r } = e, { txGraphVersion: o } = t.vault, s = t.source.txGraphJson, n = At({
812
812
  servedVerifyingKeyHex: t.source.verifyingKeyHex,
813
813
  trustedVerifyingKeyHex: t.trustedVerifyingKeyHex,
@@ -818,7 +818,7 @@ async function Ao(e) {
818
818
  t.vault,
819
819
  t.depositorPublicKey
820
820
  ), i = It(a);
821
- _o(t.requests, i), So(i, r);
821
+ Ao(t.requests, i), Bo(i, r);
822
822
  for (const c of i)
823
823
  fe(
824
824
  t,
@@ -828,17 +828,17 @@ async function Ao(e) {
828
828
  const u = {};
829
829
  for (const c of Object.keys(a.wronglyChallenged))
830
830
  u[c] = a.wronglyChallenged[c].map(
831
- (h, d) => L(
831
+ (d, p) => L(
832
832
  r,
833
- Bt(c, d)
833
+ Bt(c, p)
834
834
  )
835
835
  );
836
- const l = await gr(
836
+ const l = await fr(
837
837
  o,
838
838
  s,
839
839
  L(r, "claim")
840
840
  );
841
- return fr({
841
+ return yr({
842
842
  txGraphVersion: o,
843
843
  graphJson: s,
844
844
  signedClaimTxHex: l,
@@ -854,10 +854,10 @@ async function Ao(e) {
854
854
  expectedVaultCoreVersion: t.vault.vaultCoreVersion
855
855
  });
856
856
  }
857
- function Bo(e) {
857
+ function Vo(e) {
858
858
  return typeof e.signDelegatedClaimPsbt == "function";
859
859
  }
860
- class Io extends Error {
860
+ class Ro extends Error {
861
861
  constructor(t, r, o, s) {
862
862
  super(t, s), this.signatures = r, this.failedRequestId = o, this.name = "DelegatedClaimSigningIncompleteError";
863
863
  }
@@ -868,30 +868,30 @@ const Kt = {
868
868
  payoutClaimer: "standalone",
869
869
  claim: "standalone",
870
870
  wronglyChallenged: "standalone"
871
- }, Vo = [
871
+ }, Ko = [
872
872
  "payoutClaimer",
873
873
  "claim",
874
874
  "wronglyChallenged"
875
875
  ];
876
- async function Ro(e, t, r = {}) {
876
+ async function Ho(e, t, r = {}) {
877
877
  var s;
878
- if ((s = r.signal) == null || s.throwIfAborted(), Ko(e), V(e.depositorPublicKey) !== e.vault.depositorBtcPubkey)
878
+ if ((s = r.signal) == null || s.throwIfAborted(), Oo(e), V(e.depositorPublicKey) !== e.vault.depositorBtcPubkey)
879
879
  throw new Error(
880
880
  `Plan depositor key ${V(e.depositorPublicKey)} is not the vault's registered depositor key ${e.vault.depositorBtcPubkey}; the plan was not built for this vault.`
881
881
  );
882
882
  if (vt(t)) {
883
- if (!Bo(t))
883
+ if (!Vo(t))
884
884
  throw new Error(
885
885
  "Approval wallet does not implement signDelegatedClaimPsbt; the claim ceremony needs it because the device signs some claim PSBTs with no loaded intent and needs its own derivation fields on them."
886
886
  );
887
- const n = Oo(r, e);
888
- No(n.depositTerms, e.vault);
889
- const a = Ho(e), i = await Ze(
887
+ const n = Do(r, e);
888
+ Lo(n.depositTerms, e.vault);
889
+ const a = No(e), i = await Ze(
890
890
  t,
891
891
  e.depositorPublicKey,
892
892
  e.btcNetwork
893
893
  );
894
- return Do(
894
+ return Mo(
895
895
  e,
896
896
  t,
897
897
  i,
@@ -905,9 +905,9 @@ async function Ro(e, t, r = {}) {
905
905
  e.depositorPublicKey,
906
906
  e.btcNetwork
907
907
  );
908
- return Mo(e, t, o, r.signal);
908
+ return Fo(e, t, o, r.signal);
909
909
  }
910
- function Ko(e) {
910
+ function Oo(e) {
911
911
  const t = /* @__PURE__ */ new Set();
912
912
  for (const r of e.requests) {
913
913
  if (t.has(r.id))
@@ -917,10 +917,10 @@ function Ko(e) {
917
917
  t.add(r.id);
918
918
  }
919
919
  }
920
- function Ho(e) {
920
+ function No(e) {
921
921
  const t = e.requests.filter(
922
922
  (s) => Kt[s.kind] === "intentBound"
923
- ), r = Vo.flatMap(
923
+ ), r = Ko.flatMap(
924
924
  (s) => e.requests.filter((n) => n.kind === s)
925
925
  ), o = t.length + r.length;
926
926
  if (o !== e.requests.length)
@@ -935,7 +935,7 @@ function Ht(e, t) {
935
935
  `Delegated-claim signing ended with ${t.size} signatures for ${e.requests.length} requests; the set is incomplete and must not be treated as signed.`
936
936
  );
937
937
  }
938
- function Oo(e, t) {
938
+ function Do(e, t) {
939
939
  if (e.depositTerms === void 0)
940
940
  throw new Error(
941
941
  "An approval wallet signs Assert and the depositor Payout only under this vault's loaded intent; pass depositTerms (rebuilt from on-chain state) so it can be approved."
@@ -951,7 +951,7 @@ function Oo(e, t) {
951
951
  );
952
952
  return { depositTerms: e.depositTerms, vaultContext: e.vaultContext };
953
953
  }
954
- function No(e, t) {
954
+ function Lo(e, t) {
955
955
  const r = (s) => s.map((n) => V(n)).sort().join(",");
956
956
  if (r(e.vaultKeeperBtcPubkeys) !== r(t.vaultKeeperBtcPubkeys) || r(e.universalChallengerBtcPubkeys) !== r(t.universalChallengerBtcPubkeys))
957
957
  throw new Error(
@@ -984,53 +984,53 @@ function No(e, t) {
984
984
  `Deposit terms group at htlcVout ${s.htlcVout} names a different vault provider than the vault context this claim signs for; the device would bind the Assert to the wrong intent.`
985
985
  );
986
986
  }
987
- async function Do(e, t, r, o, { intentBound: s, standalone: n }, a) {
987
+ async function Mo(e, t, r, o, { intentBound: s, standalone: n }, a) {
988
988
  var g;
989
- const i = Lo(e, a.resume), u = [...s, ...n];
989
+ const i = Uo(e, a.resume), u = [...s, ...n];
990
990
  let l = 0;
991
991
  const c = {
992
992
  phase: "clearing any loaded intent"
993
- }, h = async (p) => {
994
- var b;
995
- c.phase = "signing", (b = a.signal) == null || b.throwIfAborted();
993
+ }, d = async (h) => {
994
+ var m;
995
+ c.phase = "signing", (m = a.signal) == null || m.throwIfAborted();
996
996
  const y = await t.signDelegatedClaimPsbt(
997
- He(p.psbtBase64),
997
+ He(h.psbtBase64),
998
998
  kt(
999
999
  e.depositorPublicKey,
1000
- p.inputIndex,
1000
+ h.inputIndex,
1001
1001
  r
1002
1002
  )
1003
- ), f = await bt(
1003
+ ), f = await mt(
1004
1004
  Rt(y),
1005
- p.inputIndex
1005
+ h.inputIndex
1006
1006
  );
1007
- fe(e, p, f), i.set(p.id, f);
1008
- }, d = async (p) => {
1007
+ fe(e, h, f), i.set(h.id, f);
1008
+ }, p = async (h) => {
1009
1009
  var f;
1010
- c.phase = p, (f = a.signal) == null || f.throwIfAborted(), (await $t(t, o.vaultContext)).fill(0);
1010
+ c.phase = h, (f = a.signal) == null || f.throwIfAborted(), (await $t(t, o.vaultContext)).fill(0);
1011
1011
  };
1012
1012
  typeof t.validateDepositTerms == "function" && await t.validateDepositTerms(o.depositTerms);
1013
1013
  try {
1014
- await d("clearing any loaded intent"), c.phase = "approving the deposit terms", (g = a.signal) == null || g.throwIfAborted(), await t.approveDepositTerms(o.depositTerms);
1015
- for (const p of s)
1016
- await h(p), l++;
1017
- await d("releasing the loaded intent");
1018
- for (const p of n)
1019
- i.has(p.id) || await h(p), l++;
1020
- } catch (p) {
1014
+ await p("clearing any loaded intent"), c.phase = "approving the deposit terms", (g = a.signal) == null || g.throwIfAborted(), await t.approveDepositTerms(o.depositTerms);
1015
+ for (const h of s)
1016
+ await d(h), l++;
1017
+ await p("releasing the loaded intent");
1018
+ for (const h of n)
1019
+ i.has(h.id) || await d(h), l++;
1020
+ } catch (h) {
1021
1021
  const y = u[l];
1022
- if (i.size === 0 || y === void 0) throw p;
1022
+ if (i.size === 0 || y === void 0) throw h;
1023
1023
  const f = c.phase === "signing" ? `stopped at "${y.id}"` : `stopped before "${y.id}" while ${c.phase}`;
1024
- throw new Io(
1024
+ throw new Ro(
1025
1025
  `Delegated-claim signing ${f}; ${i.size} of ${e.requests.length} signatures were collected.`,
1026
1026
  i,
1027
1027
  y.id,
1028
- { cause: p }
1028
+ { cause: h }
1029
1029
  );
1030
1030
  }
1031
1031
  return Ht(e, i), i;
1032
1032
  }
1033
- function Lo(e, t) {
1033
+ function Uo(e, t) {
1034
1034
  const r = /* @__PURE__ */ new Map();
1035
1035
  if (!t) return r;
1036
1036
  for (const o of e.requests) {
@@ -1046,7 +1046,7 @@ function Lo(e, t) {
1046
1046
  }
1047
1047
  return r;
1048
1048
  }
1049
- async function Mo(e, t, r, o) {
1049
+ async function Fo(e, t, r, o) {
1050
1050
  const s = e.requests, n = await Pt(
1051
1051
  t,
1052
1052
  s.map((i) => He(i.psbtBase64)),
@@ -1060,7 +1060,7 @@ async function Mo(e, t, r, o) {
1060
1060
  o
1061
1061
  ), a = /* @__PURE__ */ new Map();
1062
1062
  for (let i = 0; i < s.length; i++) {
1063
- const u = await bt(
1063
+ const u = await mt(
1064
1064
  Rt(n[i]),
1065
1065
  s[i].inputIndex
1066
1066
  );
@@ -1068,35 +1068,35 @@ async function Mo(e, t, r, o) {
1068
1068
  }
1069
1069
  return Ht(e, a), a;
1070
1070
  }
1071
- async function ln(e) {
1072
- const t = await To({
1071
+ async function hn(e) {
1072
+ const t = await So({
1073
1073
  depositorPublicKey: e.depositorPublicKey,
1074
1074
  btcNetwork: e.btcNetwork,
1075
1075
  source: e.source,
1076
1076
  trustedVerifyingKeyHex: e.trustedVerifyingKeyHex,
1077
1077
  vault: e.vault,
1078
1078
  babeSessionsJson: e.babeSessionsJson
1079
- }), r = await Ro(t, e.btcWallet, {
1079
+ }), r = await Ho(t, e.btcWallet, {
1080
1080
  depositTerms: e.depositTerms,
1081
1081
  vaultContext: e.vaultContext
1082
1082
  });
1083
- return Ao({ plan: t, signatures: r });
1083
+ return Io({ plan: t, signatures: r });
1084
1084
  }
1085
- async function dn(e) {
1085
+ async function gn(e) {
1086
1086
  const t = await $t(e.btcWallet, e.vaultContext);
1087
1087
  let r;
1088
1088
  try {
1089
- r = await yr(t, e.htlcVout);
1089
+ r = await vr(t, e.htlcVout);
1090
1090
  } finally {
1091
1091
  t.fill(0);
1092
1092
  }
1093
1093
  let o;
1094
1094
  try {
1095
- o = await vr(r);
1095
+ o = await Pr(r);
1096
1096
  } finally {
1097
1097
  r.fill(0);
1098
1098
  }
1099
- return Fo(o.pk_hash, e.expectedWotsPkHash), await Pr(
1099
+ return qo(o.pk_hash, e.expectedWotsPkHash), await mr(
1100
1100
  e.txGraphVersion,
1101
1101
  o.keypair,
1102
1102
  e.txGraphJson
@@ -1105,7 +1105,7 @@ async function dn(e) {
1105
1105
  pkHash: o.pk_hash
1106
1106
  };
1107
1107
  }
1108
- function Fo(e, t) {
1108
+ function qo(e, t) {
1109
1109
  if (ie(e) !== ie(t))
1110
1110
  throw new Error(
1111
1111
  `Derived WOTS public-key hash ${ie(e)} does not match the vault's on-chain depositorWotsPkHash ${ie(t)}. The wallet, the HTLC output index, or the derivation itself is not the one this vault was created with.`
@@ -1126,7 +1126,7 @@ function xe(e, t, r) {
1126
1126
  rotated: n !== s
1127
1127
  };
1128
1128
  }
1129
- function Uo(e) {
1129
+ function Go(e) {
1130
1130
  const t = /* @__PURE__ */ new Map();
1131
1131
  for (const r of e) {
1132
1132
  const o = t.get(r.operationBtcPubkey);
@@ -1154,7 +1154,7 @@ function Ot(e, t, r) {
1154
1154
  ), n = e.universalChallengers.map(
1155
1155
  (a, i) => xe("universal challenger", a, t.universalChallengers[i])
1156
1156
  );
1157
- return Uo([
1157
+ return Go([
1158
1158
  o,
1159
1159
  ...s,
1160
1160
  ...n
@@ -1169,7 +1169,7 @@ function Ot(e, t, r) {
1169
1169
  query: e
1170
1170
  };
1171
1171
  }
1172
- async function qo(e) {
1172
+ async function Xo(e) {
1173
1173
  const t = await e.operationKeyReader.getCurrentOperationKeys(
1174
1174
  e.query,
1175
1175
  e.blockNumber
@@ -1228,11 +1228,11 @@ async function Dt(e) {
1228
1228
  epochs: c
1229
1229
  });
1230
1230
  }
1231
- async function hn(e) {
1231
+ async function fn(e) {
1232
1232
  const { vaultId: t, readers: r } = e, o = await r.registryReader.getVaultData(t), { basic: s, protocol: n } = o;
1233
- if (n.vaultCoreVersion !== U)
1233
+ if (n.vaultCoreVersion !== F)
1234
1234
  throw new Error(
1235
- `Vault ${t} is stamped vault core version ${n.vaultCoreVersion}; delegated claim requires ${U}.`
1235
+ `Vault ${t} is stamped vault core version ${n.vaultCoreVersion}; delegated claim requires ${F}.`
1236
1236
  );
1237
1237
  const a = _e(
1238
1238
  s.depositorBtcPubKey,
@@ -1250,7 +1250,7 @@ async function hn(e) {
1250
1250
  Dt({ vaultId: t, vault: o, readers: r }),
1251
1251
  r.registryReader.getRegistrationRecordsAtBlock(s.createdAt),
1252
1252
  r.registryReader.getVaultClaimableBy(t, s.depositorBtcPubKey, s.createdAt).catch((v) => {
1253
- throw Er(v) ? new Le(
1253
+ throw kr(v) ? new Le(
1254
1254
  t,
1255
1255
  s.depositorBtcPubKey,
1256
1256
  v.fromBlock,
@@ -1262,52 +1262,52 @@ async function hn(e) {
1262
1262
  r.protocolParamsReader.getOffchainParamsByVersion(
1263
1263
  n.offchainParamsVersion
1264
1264
  )
1265
- ]), h = Kr(c.timelockAssert), d = kr(u, t, s.createdAt);
1266
- $r(d);
1267
- const g = Cr(d);
1265
+ ]), d = Or(c.timelockAssert), p = $r(u, t, s.createdAt);
1266
+ Cr(p);
1267
+ const g = Tr(p);
1268
1268
  if (g.toLowerCase() !== n.prePeginTxHash.toLowerCase())
1269
1269
  throw new Error(
1270
1270
  `Registration log of vault ${t} records prePeginTxHash ${g} but the vault record says ${n.prePeginTxHash}; refusing an inconsistent node.`
1271
1271
  );
1272
- if (d.vaultCoreVersion !== n.vaultCoreVersion)
1272
+ if (p.vaultCoreVersion !== n.vaultCoreVersion)
1273
1273
  throw new Error(
1274
- `Registration log of vault ${t} records vault core version ${d.vaultCoreVersion} but the vault record says ${n.vaultCoreVersion}; refusing an inconsistent node.`
1274
+ `Registration log of vault ${t} records vault core version ${p.vaultCoreVersion} but the vault record says ${n.vaultCoreVersion}; refusing an inconsistent node.`
1275
1275
  );
1276
- if (d.amount !== s.amount)
1276
+ if (p.amount !== s.amount)
1277
1277
  throw new Error(
1278
- `Registration log of vault ${t} records amount ${d.amount} sats but the vault record says ${s.amount}; refusing an inconsistent node.`
1278
+ `Registration log of vault ${t} records amount ${p.amount} sats but the vault record says ${s.amount}; refusing an inconsistent node.`
1279
1279
  );
1280
- if (d.depositor.toLowerCase() !== s.depositor.toLowerCase())
1280
+ if (p.depositor.toLowerCase() !== s.depositor.toLowerCase())
1281
1281
  throw new Error(
1282
- `Registration log of vault ${t} records depositor ${d.depositor} but the vault record says ${s.depositor}; refusing an inconsistent node.`
1282
+ `Registration log of vault ${t} records depositor ${p.depositor} but the vault record says ${s.depositor}; refusing an inconsistent node.`
1283
1283
  );
1284
- if (d.vaultProvider.toLowerCase() !== s.vaultProvider.toLowerCase())
1284
+ if (p.vaultProvider.toLowerCase() !== s.vaultProvider.toLowerCase())
1285
1285
  throw new Error(
1286
- `Registration log of vault ${t} records vaultProvider ${d.vaultProvider} but the vault record says ${s.vaultProvider}; refusing an inconsistent node.`
1286
+ `Registration log of vault ${t} records vaultProvider ${p.vaultProvider} but the vault record says ${s.vaultProvider}; refusing an inconsistent node.`
1287
1287
  );
1288
1288
  if (l.vaultCoreVersion !== n.vaultCoreVersion)
1289
1289
  throw new Error(
1290
1290
  `Redemption log of vault ${t} records vault core version ${l.vaultCoreVersion} but the vault record says ${n.vaultCoreVersion}; refusing an inconsistent node.`
1291
1291
  );
1292
- if (l.proverCircuitVersion !== d.proverCircuitVersion)
1292
+ if (l.proverCircuitVersion !== p.proverCircuitVersion)
1293
1293
  throw new Error(
1294
- `Redemption log of vault ${t} records proverCircuitVersion ${l.proverCircuitVersion} but the registration log says ${d.proverCircuitVersion}; refusing an inconsistent node.`
1294
+ `Redemption log of vault ${t} records proverCircuitVersion ${l.proverCircuitVersion} but the registration log says ${p.proverCircuitVersion}; refusing an inconsistent node.`
1295
1295
  );
1296
- if (d.proverCircuitVersion !== c.proverCircuitVersion)
1296
+ if (p.proverCircuitVersion !== c.proverCircuitVersion)
1297
1297
  throw new Error(
1298
- `Registration log of vault ${t} records proverCircuitVersion ${d.proverCircuitVersion} but the stamped offchain params say ${c.proverCircuitVersion}; refusing an inconsistent node.`
1298
+ `Registration log of vault ${t} records proverCircuitVersion ${p.proverCircuitVersion} but the stamped offchain params say ${c.proverCircuitVersion}; refusing an inconsistent node.`
1299
1299
  );
1300
- const p = Tr(n.depositorSignedPeginTx);
1300
+ const h = _r(n.depositorSignedPeginTx);
1301
1301
  for (const [v, E] of [
1302
- ["Registration", d.peginTxHash],
1302
+ ["Registration", p.peginTxHash],
1303
1303
  ["Redemption", l.peginTxHash]
1304
1304
  ])
1305
- if (E.toLowerCase() !== p.toLowerCase())
1305
+ if (E.toLowerCase() !== h.toLowerCase())
1306
1306
  throw new Error(
1307
- `${v} log of vault ${t} records peginTxHash ${E} but the vault's depositor-signed PegIn hashes to ${p}; refusing an inconsistent node.`
1307
+ `${v} log of vault ${t} records peginTxHash ${E} but the vault's depositor-signed PegIn hashes to ${h}; refusing an inconsistent node.`
1308
1308
  );
1309
1309
  const y = z(
1310
- mt(p, s.depositor)
1310
+ bt(h, s.depositor)
1311
1311
  );
1312
1312
  if (y !== z(t))
1313
1313
  throw new Error(
@@ -1318,9 +1318,9 @@ async function hn(e) {
1318
1318
  "universalChallengersVersion",
1319
1319
  "appVaultKeepersVersion"
1320
1320
  ]) {
1321
- if (d[v] !== n[v])
1321
+ if (p[v] !== n[v])
1322
1322
  throw new Error(
1323
- `Registration log of vault ${t} records ${v} ${d[v]} but the vault record says ${n[v]}; refusing an inconsistent node.`
1323
+ `Registration log of vault ${t} records ${v} ${p[v]} but the vault record says ${n[v]}; refusing an inconsistent node.`
1324
1324
  );
1325
1325
  if (l[v] !== n[v])
1326
1326
  throw new Error(
@@ -1334,10 +1334,10 @@ async function hn(e) {
1334
1334
  throw new Error(
1335
1335
  `Depositor-signed PegIn of vault ${t} has ${f.ins.length} inputs; it spends Pre-PegIn ${n.prePeginTxHash} output ${n.htlcVout} with exactly one; refusing an inconsistent node.`
1336
1336
  );
1337
- const b = Ke(f.ins[0].hash), $ = f.ins[0].index;
1338
- if (b !== P(n.prePeginTxHash).toLowerCase() || $ !== n.htlcVout)
1337
+ const m = Ke(f.ins[0].hash), $ = f.ins[0].index;
1338
+ if (m !== P(n.prePeginTxHash).toLowerCase() || $ !== n.htlcVout)
1339
1339
  throw new Error(
1340
- `Depositor-signed PegIn of vault ${t} spends ${b}:${$} but the vault record says Pre-PegIn ${n.prePeginTxHash} output ${n.htlcVout}; refusing an inconsistent node.`
1340
+ `Depositor-signed PegIn of vault ${t} spends ${m}:${$} but the vault record says Pre-PegIn ${n.prePeginTxHash} output ${n.htlcVout}; refusing an inconsistent node.`
1341
1341
  );
1342
1342
  const x = f.outs[Z];
1343
1343
  if (x === void 0)
@@ -1354,7 +1354,7 @@ async function hn(e) {
1354
1354
  depositorEthAddress: s.depositor,
1355
1355
  depositorBtcPubkey: a,
1356
1356
  registeredPayoutScriptPubKey: P(
1357
- d.depositorPayoutScriptPubKey
1357
+ p.depositorPayoutScriptPubKey
1358
1358
  ),
1359
1359
  vaultProviderBtcPubkey: i.vaultProvider.operationBtcPubkey,
1360
1360
  vaultKeeperBtcPubkeys: [
@@ -1363,30 +1363,30 @@ async function hn(e) {
1363
1363
  universalChallengerBtcPubkeys: [
1364
1364
  ...i.universalChallengerOperationKeysSorted
1365
1365
  ],
1366
- txGraphVersion: U,
1366
+ txGraphVersion: F,
1367
1367
  proverCircuitVersion: c.proverCircuitVersion,
1368
1368
  vaultCoreVersion: n.vaultCoreVersion,
1369
1369
  claimableEventBlockNumber: l.blockNumber,
1370
1370
  peginVaultOutputValueSats: x.value,
1371
1371
  protocolFeeRate: c.feeRate,
1372
1372
  councilSize: c.securityCouncilKeys.length,
1373
- timelockPegin: h,
1373
+ timelockPegin: d,
1374
1374
  timelockAssert: Number(c.timelockAssert)
1375
1375
  },
1376
1376
  vault: o,
1377
- registrationRecord: d,
1377
+ registrationRecord: p,
1378
1378
  registrationRecords: u,
1379
1379
  participantKeys: i,
1380
1380
  offchainParams: c,
1381
1381
  depositorBtcPubKeyBytes32: s.depositorBtcPubKey,
1382
1382
  depositorWotsPkHash: n.depositorWotsPkHash,
1383
1383
  prePeginTxHash: n.prePeginTxHash,
1384
- peginTxHash: p,
1384
+ peginTxHash: h,
1385
1385
  vaultProvider: s.vaultProvider,
1386
1386
  htlcVout: n.htlcVout
1387
1387
  };
1388
1388
  }
1389
- const Go = 8, Xo = 6e3, zo = 10 * 6e4, jo = 10;
1389
+ const zo = 8, jo = 6e3, Wo = 10 * 6e4, Yo = 10;
1390
1390
  class Lt extends Error {
1391
1391
  constructor(t) {
1392
1392
  super(t), this.name = "PeginRegistrationMissingError";
@@ -1397,24 +1397,24 @@ class Mt extends Error {
1397
1397
  super(t), this.name = "PeginRegistrationNotFinalError";
1398
1398
  }
1399
1399
  }
1400
- function Wo(e) {
1400
+ function Qo(e) {
1401
1401
  return e instanceof Lt || e instanceof Error && e.name === "PeginRegistrationMissingError";
1402
1402
  }
1403
- function pn(e) {
1403
+ function yn(e) {
1404
1404
  return e instanceof Mt || e instanceof Error && e.name === "PeginRegistrationNotFinalError";
1405
1405
  }
1406
1406
  function et(e) {
1407
1407
  const { currentBlock: t, createdAtBlock: r } = e, o = t - r + 1n;
1408
1408
  return o < 0n ? 0 : Number(o);
1409
1409
  }
1410
- async function gn(e) {
1410
+ async function vn(e) {
1411
1411
  const {
1412
1412
  vaultRegistryReader: t,
1413
1413
  getBlockNumber: r,
1414
1414
  vaultIds: o,
1415
- required: s = Go,
1416
- pollIntervalMs: n = Xo,
1417
- timeoutMs: a = zo,
1415
+ required: s = zo,
1416
+ pollIntervalMs: n = jo,
1417
+ timeoutMs: a = Wo,
1418
1418
  signal: i,
1419
1419
  onProgress: u
1420
1420
  } = e;
@@ -1423,7 +1423,7 @@ async function gn(e) {
1423
1423
  "waitForPeginRegistrationDepth requires at least one vault ID"
1424
1424
  );
1425
1425
  const l = Date.now();
1426
- let c = !1, h = 0, d;
1426
+ let c = !1, d = 0, p;
1427
1427
  for (; ; ) {
1428
1428
  if (i != null && i.aborted)
1429
1429
  throw new Error(
@@ -1431,48 +1431,48 @@ async function gn(e) {
1431
1431
  );
1432
1432
  if (Date.now() - l >= a)
1433
1433
  throw new Mt(
1434
- `Peg-in registration did not reach ${s} Ethereum confirmations within ${a}ms. The registration transaction was submitted but is not yet final, so the Pre-PegIn Bitcoin transaction was never sent and no funds are at risk. Resume this deposit from the dashboard once the network settles.` + (d instanceof Error ? ` Last read error: ${d.message}` : "")
1434
+ `Peg-in registration did not reach ${s} Ethereum confirmations within ${a}ms. The registration transaction was submitted but is not yet final, so the Pre-PegIn Bitcoin transaction was never sent and no funds are at risk. Resume this deposit from the dashboard once the network settles.` + (p instanceof Error ? ` Last read error: ${p.message}` : "")
1435
1435
  );
1436
1436
  try {
1437
- const g = await r(), p = await Promise.all(
1437
+ const g = await r(), h = await Promise.all(
1438
1438
  o.map((f) => t.getVaultBasicInfo(f))
1439
- ), y = p.findIndex(
1440
- (f) => f.depositor === Hr || f.createdAt === 0n
1439
+ ), y = h.findIndex(
1440
+ (f) => f.depositor === Nr || f.createdAt === 0n
1441
1441
  );
1442
1442
  if (y !== -1) {
1443
- if (h += 1, !c && h > jo)
1443
+ if (d += 1, !c && d > Yo)
1444
1444
  throw new Lt(
1445
- `Vault ${o[y]} is still not visible on-chain after ${h} reads — the registration does not exist.`
1445
+ `Vault ${o[y]} is still not visible on-chain after ${d} reads — the registration does not exist.`
1446
1446
  );
1447
1447
  console.warn(
1448
1448
  `Peg-in registration for vault ${o[y]} is not visible in chain state at block ${g} — a lagging RPC backend or an Ethereum reorg. Still polling.`
1449
1449
  ), u == null || u({ confirmations: 0, required: s });
1450
1450
  } else {
1451
- c = !0, h = 0, d = void 0;
1452
- let f = p[0], b = et({
1451
+ c = !0, d = 0, p = void 0;
1452
+ let f = h[0], m = et({
1453
1453
  currentBlock: g,
1454
- createdAtBlock: p[0].createdAt
1454
+ createdAtBlock: h[0].createdAt
1455
1455
  });
1456
- for (const $ of p.slice(1)) {
1456
+ for (const $ of h.slice(1)) {
1457
1457
  const x = et({
1458
1458
  currentBlock: g,
1459
1459
  createdAtBlock: $.createdAt
1460
1460
  });
1461
- x < b && (b = x, f = $);
1461
+ x < m && (m = x, f = $);
1462
1462
  }
1463
- if (u == null || u({ confirmations: b, required: s }), b >= s)
1464
- return { confirmations: b, basicInfo: f };
1463
+ if (u == null || u({ confirmations: m, required: s }), m >= s)
1464
+ return { confirmations: m, basicInfo: f };
1465
1465
  }
1466
1466
  } catch (g) {
1467
- if (Wo(g))
1467
+ if (Qo(g))
1468
1468
  throw g;
1469
1469
  console.warn(
1470
1470
  `Registration-depth read failed (retrying in ${n}ms): ` + (g instanceof Error ? g.message : String(g))
1471
- ), d = g;
1471
+ ), p = g;
1472
1472
  }
1473
- await new Promise((g, p) => {
1473
+ await new Promise((g, h) => {
1474
1474
  const y = () => {
1475
- clearTimeout(f), p(
1475
+ clearTimeout(f), h(
1476
1476
  new Error(
1477
1477
  `Aborted while waiting for peg-in registration depth (${o.length} vault(s))`
1478
1478
  )
@@ -1484,8 +1484,8 @@ async function gn(e) {
1484
1484
  });
1485
1485
  }
1486
1486
  }
1487
- const Yo = /^(?:[0-9a-f]{2})*$/, Qo = /^[0-9a-f]{64}$/, Jo = /^([0-9a-f]{64}):(0|[1-9][0-9]*)$/, Zo = -2147483648, es = 2147483647, Ee = 4294967295, tt = 2, rt = 2, de = 0;
1488
- class m extends Error {
1487
+ const Jo = /^(?:[0-9a-f]{2})*$/, Zo = /^[0-9a-f]{64}$/, es = /^([0-9a-f]{64}):(0|[1-9][0-9]*)$/, ts = -2147483648, rs = 2147483647, Ee = 4294967295, tt = 2, rt = 2, pe = 0;
1488
+ class b extends Error {
1489
1489
  constructor(t) {
1490
1490
  super(t), this.name = "GraphFingerprintError";
1491
1491
  }
@@ -1493,36 +1493,36 @@ class m extends Error {
1493
1493
  function k(e, t, r) {
1494
1494
  const o = e[t];
1495
1495
  if (o === void 0)
1496
- throw new m(`Graph tx ${r} is missing "${t}"`);
1496
+ throw new b(`Graph tx ${r} is missing "${t}"`);
1497
1497
  return o;
1498
1498
  }
1499
1499
  function te(e, t) {
1500
1500
  if (!Array.isArray(e))
1501
- throw new m(`Graph tx ${t} is not an array`);
1501
+ throw new b(`Graph tx ${t} is not an array`);
1502
1502
  return e;
1503
1503
  }
1504
1504
  function B(e, t) {
1505
1505
  if (e === null || typeof e != "object" || Array.isArray(e))
1506
- throw new m(`Graph tx ${t} is not an object`);
1506
+ throw new b(`Graph tx ${t} is not an object`);
1507
1507
  return e;
1508
1508
  }
1509
1509
  function Q(e, t, r, o) {
1510
1510
  if (typeof e != "number" || !Number.isSafeInteger(e) || e < r || e > o)
1511
- throw new m(
1511
+ throw new b(
1512
1512
  `Graph tx ${t} is not an integer in [${r}, ${o}]`
1513
1513
  );
1514
1514
  return e;
1515
1515
  }
1516
1516
  function ke(e, t) {
1517
- if (typeof e != "string" || !Yo.test(e))
1518
- throw new m(
1517
+ if (typeof e != "string" || !Jo.test(e))
1518
+ throw new b(
1519
1519
  `Graph tx ${t} is not lowercase hex without a prefix`
1520
1520
  );
1521
1521
  return H.from(e, "hex");
1522
1522
  }
1523
- function he(e, t) {
1524
- if (typeof e != "string" || !Qo.test(e))
1525
- throw new m(
1523
+ function de(e, t) {
1524
+ if (typeof e != "string" || !Zo.test(e))
1525
+ throw new b(
1526
1526
  `Graph ${t} is not 32 bytes of lowercase hex`
1527
1527
  );
1528
1528
  return e;
@@ -1532,17 +1532,17 @@ function ot(e, t) {
1532
1532
  return o.version = Q(
1533
1533
  k(r, "version", t),
1534
1534
  `${t}.version`,
1535
- Zo,
1536
- es
1535
+ ts,
1536
+ rs
1537
1537
  ), o.locktime = Q(
1538
1538
  k(r, "lock_time", t),
1539
1539
  `${t}.lock_time`,
1540
1540
  0,
1541
1541
  Ee
1542
1542
  ), te(k(r, "input", t), `${t}.input`).forEach((s, n) => {
1543
- const a = `${t}.input[${n}]`, i = B(s, a), u = k(i, "previous_output", a), l = typeof u == "string" && Jo.exec(u);
1543
+ const a = `${t}.input[${n}]`, i = B(s, a), u = k(i, "previous_output", a), l = typeof u == "string" && es.exec(u);
1544
1544
  if (!l)
1545
- throw new m(
1545
+ throw new b(
1546
1546
  `Graph tx ${a}.previous_output is not "<txid>:<vout>"`
1547
1547
  );
1548
1548
  const c = Q(Number(l[2]), `${a}.previous_output vout`, 0, Ee);
@@ -1554,7 +1554,7 @@ function ot(e, t) {
1554
1554
  ), o.ins[n].witness = te(
1555
1555
  k(i, "witness", a),
1556
1556
  `${a}.witness`
1557
- ).map((h, d) => ke(h, `${a}.witness[${d}]`));
1557
+ ).map((d, p) => ke(d, `${a}.witness[${p}]`));
1558
1558
  }), te(k(r, "output", t), `${t}.output`).forEach((s, n) => {
1559
1559
  const a = `${t}.output[${n}]`, i = B(s, a);
1560
1560
  o.addOutput(
@@ -1569,17 +1569,17 @@ function D(e, t) {
1569
1569
  try {
1570
1570
  o = S.fromHex(r);
1571
1571
  } catch (s) {
1572
- throw new m(
1572
+ throw new b(
1573
1573
  `Presign ${t} is not one transaction: ${s instanceof Error ? s.message : String(s)}`
1574
1574
  );
1575
1575
  }
1576
1576
  if (o.toHex() !== r)
1577
- throw new m(
1577
+ throw new b(
1578
1578
  `Presign ${t} is not a canonical transaction encoding`
1579
1579
  );
1580
1580
  return o;
1581
1581
  }
1582
- function Ft(e, t) {
1582
+ function Ut(e, t) {
1583
1583
  const r = e.ins[t];
1584
1584
  if (r)
1585
1585
  return {
@@ -1587,32 +1587,32 @@ function Ft(e, t) {
1587
1587
  vout: r.index
1588
1588
  };
1589
1589
  }
1590
- function Ut(e, t) {
1591
- if (!e.outs[de])
1592
- throw new m(
1593
- `Presign ${t}.claim_tx must have output ${de}`
1590
+ function Ft(e, t) {
1591
+ if (!e.outs[pe])
1592
+ throw new b(
1593
+ `Presign ${t}.claim_tx must have output ${pe}`
1594
1594
  );
1595
1595
  }
1596
- function ts(e, t, r) {
1596
+ function os(e, t, r) {
1597
1597
  if (e.ins.length !== 1)
1598
- throw new m(
1598
+ throw new b(
1599
1599
  `Presign ${r}.claim_tx must have exactly one input, got ${e.ins.length}`
1600
1600
  );
1601
- Ut(e, r);
1602
- const o = Ft(e, 0);
1601
+ Ft(e, r);
1602
+ const o = Ut(e, 0);
1603
1603
  if ((o == null ? void 0 : o.txid) !== t || o.vout !== X) {
1604
1604
  const s = o ? `${o.txid}:${o.vout}` : "no input";
1605
- throw new m(
1605
+ throw new b(
1606
1606
  `Presign ${r}.claim_tx must spend ${t}:${X}, got ${s}`
1607
1607
  );
1608
1608
  }
1609
1609
  }
1610
1610
  function Oe(e, t, r) {
1611
- const o = Ft(e, 0);
1612
- if ((o == null ? void 0 : o.txid) !== t || o.vout !== de) {
1611
+ const o = Ut(e, 0);
1612
+ if ((o == null ? void 0 : o.txid) !== t || o.vout !== pe) {
1613
1613
  const s = o ? `${o.txid}:${o.vout}` : "no input";
1614
- throw new m(
1615
- `Presign ${r}.assert_tx input 0 must spend ${t}:${de}, got ${s}`
1614
+ throw new b(
1615
+ `Presign ${r}.assert_tx input 0 must spend ${t}:${pe}, got ${s}`
1616
1616
  );
1617
1617
  }
1618
1618
  }
@@ -1620,35 +1620,35 @@ function qt(e) {
1620
1620
  const t = D(e.peginTxHex, `${e.path}.pegin_tx`), r = D(e.claimTxHex, `${e.path}.claim_tx`), o = D(e.assertTxHex, `${e.path}.assert_tx`);
1621
1621
  return { peginTx: t, claimTx: r, assertTx: o };
1622
1622
  }
1623
- function rs(e) {
1623
+ function ss(e) {
1624
1624
  const t = D(e.claimTxHex, `${e.path}.claim_tx`), r = D(e.assertTxHex, `${e.path}.assert_tx`);
1625
- Ut(t, e.path), Oe(r, t.getId(), e.path);
1625
+ Ft(t, e.path), Oe(r, t.getId(), e.path);
1626
1626
  }
1627
- function os(e) {
1627
+ function ns(e) {
1628
1628
  const { peginTx: t, claimTx: r, assertTx: o } = qt(e);
1629
- ts(r, t.getId(), e.path), Oe(o, r.getId(), e.path);
1629
+ os(r, t.getId(), e.path), Oe(o, r.getId(), e.path);
1630
1630
  }
1631
- function ss(e, t) {
1631
+ function is(e, t) {
1632
1632
  const [r, ...o] = e.ins;
1633
1633
  if (!r || o.length > 0)
1634
- throw new m(
1634
+ throw new b(
1635
1635
  `Presign claim_tx must have exactly one input, got ${e.ins.length}`
1636
1636
  );
1637
1637
  const s = H.from(r.hash).reverse().toString("hex");
1638
1638
  if (s !== t || r.index !== X)
1639
- throw new m(
1639
+ throw new b(
1640
1640
  `Presign claim_tx must spend ${t}:${X}, got ${s}:${r.index}`
1641
1641
  );
1642
1642
  if (e.version !== tt)
1643
- throw new m(
1643
+ throw new b(
1644
1644
  `Presign claim_tx version must be ${tt}, got ${e.version}`
1645
1645
  );
1646
1646
  if (r.witness.length > 0)
1647
- throw new m(
1647
+ throw new b(
1648
1648
  `Presign claim_tx input must have an empty witness, got ${r.witness.length} item(s)`
1649
1649
  );
1650
1650
  if (e.outs.length !== rt)
1651
- throw new m(
1651
+ throw new b(
1652
1652
  `Presign claim_tx must have exactly ${rt} outputs, got ${e.outs.length}`
1653
1653
  );
1654
1654
  }
@@ -1657,15 +1657,15 @@ function Gt(e) {
1657
1657
  (o, s) => o.pubkey < s.pubkey ? -1 : o.pubkey > s.pubkey ? 1 : 0
1658
1658
  ), r = [e.peginTx, e.claimTx, e.assertTx, e.payoutTx];
1659
1659
  return t.forEach((o, s) => {
1660
- const n = he(o.pubkey, "challenger pubkey");
1660
+ const n = de(o.pubkey, "challenger pubkey");
1661
1661
  if (s > 0 && t[s - 1].pubkey === n)
1662
- throw new m(`Graph lists challenger ${n} twice`);
1662
+ throw new b(`Graph lists challenger ${n} twice`);
1663
1663
  r.push(We(n), o.nopayoutTx);
1664
1664
  for (const a of o.outputLabelHashes)
1665
- r.push(We(he(a, "output_label_hashes entry")));
1666
- }), Fr(Ur(qr(...r)));
1665
+ r.push(We(de(a, "output_label_hashes entry")));
1666
+ }), qr(Gr(Xr(...r)));
1667
1667
  }
1668
- function ns(e) {
1668
+ function as(e) {
1669
1669
  const t = P(e.peginTxid).toLowerCase(), { peginTx: r, claimTx: o, assertTx: s } = qt({
1670
1670
  peginTxHex: e.peginTxHex,
1671
1671
  claimTxHex: e.claimTxHex,
@@ -1673,10 +1673,10 @@ function ns(e) {
1673
1673
  path: "depositor_graph"
1674
1674
  });
1675
1675
  if (r.getId() !== t)
1676
- throw new m(
1676
+ throw new b(
1677
1677
  `Presign pegin_tx hashes to ${r.getId()}, expected ${t}`
1678
1678
  );
1679
- ss(o, t), Oe(s, o.getId(), "depositor_graph");
1679
+ is(o, t), Oe(s, o.getId(), "depositor_graph");
1680
1680
  const n = (a) => new Uint8Array(a.toBuffer());
1681
1681
  return Gt({
1682
1682
  peginTx: n(r),
@@ -1692,7 +1692,7 @@ function ns(e) {
1692
1692
  }))
1693
1693
  });
1694
1694
  }
1695
- function is(e) {
1695
+ function us(e) {
1696
1696
  const t = (o) => ot(B(k(e, o, "graph"), o).tx, o), r = B(
1697
1697
  k(e, "challenger_subgraphs", "graph"),
1698
1698
  "challenger_subgraphs"
@@ -1714,13 +1714,13 @@ function is(e) {
1714
1714
  k(a, "output_label_hashes", n),
1715
1715
  `${n}.output_label_hashes`
1716
1716
  ).map(
1717
- (i, u) => he(i, `${n}.output_label_hashes[${u}]`)
1717
+ (i, u) => de(i, `${n}.output_label_hashes[${u}]`)
1718
1718
  )
1719
1719
  };
1720
1720
  })
1721
1721
  });
1722
1722
  }
1723
- function as(e) {
1723
+ function cs(e) {
1724
1724
  const t = B(
1725
1725
  k(e, "challenger_pubkeys", "graph"),
1726
1726
  "challenger_pubkeys"
@@ -1730,54 +1730,54 @@ function as(e) {
1730
1730
  k(t, o, "challenger_pubkeys"),
1731
1731
  `challenger_pubkeys.${o}`
1732
1732
  ).forEach((s, n) => {
1733
- const a = he(s, `challenger_pubkeys.${o}[${n}]`);
1733
+ const a = de(s, `challenger_pubkeys.${o}[${n}]`);
1734
1734
  if (r.has(a))
1735
- throw new m(
1735
+ throw new b(
1736
1736
  `Graph declares challenger ${a} more than once`
1737
1737
  );
1738
1738
  r.add(a);
1739
1739
  });
1740
1740
  return r;
1741
1741
  }
1742
- function fn(e, t) {
1743
- const r = is(e);
1742
+ function Pn(e, t) {
1743
+ const r = us(e);
1744
1744
  if (r !== t)
1745
- throw new m(
1745
+ throw new b(
1746
1746
  `Graph fingerprint ${r} does not match the presign fingerprint ${t}`
1747
1747
  );
1748
1748
  const o = Object.keys(
1749
1749
  B(e.challenger_subgraphs, "challenger_subgraphs")
1750
- ), s = as(e);
1750
+ ), s = cs(e);
1751
1751
  if (o.length !== s.size || o.some((n) => !s.has(n)))
1752
- throw new m(
1752
+ throw new b(
1753
1753
  `Graph challenger_subgraphs keys ${o.join(", ")} do not match challenger_pubkeys ${[...s].join(", ")}`
1754
1754
  );
1755
1755
  }
1756
- const us = 1;
1757
- function cs(e, t, r) {
1756
+ const ls = 1;
1757
+ function ps(e, t, r) {
1758
1758
  const o = r.map(
1759
- (h) => P(h).toLowerCase()
1760
- ), s = t.filter((h) => o.includes(h));
1759
+ (d) => P(d).toLowerCase()
1760
+ ), s = t.filter((d) => o.includes(d));
1761
1761
  if (s.length > 0)
1762
1762
  throw new Error(
1763
1763
  `Cannot validate challenger set: vault keepers and universal challengers overlap (${s.join(", ")})`
1764
1764
  );
1765
1765
  const n = [...t, ...o], a = e.map(
1766
- (h) => P(h.challenger_pubkey).toLowerCase()
1766
+ (d) => P(d.challenger_pubkey).toLowerCase()
1767
1767
  ), i = new Set(a);
1768
1768
  if (i.size !== a.length)
1769
1769
  throw new Error(
1770
1770
  "Depositor graph contains duplicate challenger entries in challenger_presign_data"
1771
1771
  );
1772
- const u = new Set(n), l = n.filter((h) => !i.has(h)), c = a.filter((h) => !u.has(h));
1772
+ const u = new Set(n), l = n.filter((d) => !i.has(d)), c = a.filter((d) => !u.has(d));
1773
1773
  if (l.length > 0 || c.length > 0)
1774
1774
  throw new Error(
1775
1775
  "Depositor graph challenger set does not match expected (local ∪ universal)" + (l.length > 0 ? ` (missing: ${l.join(", ")})` : "") + (c.length > 0 ? ` (unexpected: ${c.join(", ")})` : "")
1776
1776
  );
1777
- return sr(n);
1777
+ return nr(n);
1778
1778
  }
1779
- function ls(e, t) {
1780
- const r = Sr + Ar * t + Br;
1779
+ function ds(e, t) {
1780
+ const r = Ar + Br * t + Ir;
1781
1781
  if (e.outs.length !== r)
1782
1782
  throw new Error(
1783
1783
  `Assert must have ${r} outputs for ${t} challengers, got ${e.outs.length}`
@@ -1789,19 +1789,19 @@ async function Xt(e, t) {
1789
1789
  depositorBtcPubkey: t.depositorBtcPubkey,
1790
1790
  vaultProviderBtcPubkey: t.vaultProviderBtcPubkey,
1791
1791
  vaultKeeperBtcPubkeys: t.vaultKeeperBtcPubkeys
1792
- }), o = cs(
1792
+ }), o = ps(
1793
1793
  e.challenger_presign_data,
1794
1794
  r,
1795
1795
  t.universalChallengerBtcPubkeys
1796
1796
  ), s = P(t.depositorBtcPubkey), n = S.fromHex(
1797
1797
  P(e.assert_tx.tx_hex)
1798
1798
  );
1799
- ls(n, o.length);
1799
+ ds(n, o.length);
1800
1800
  const a = [];
1801
1801
  for (const i of e.challenger_presign_data) {
1802
1802
  const u = P(i.challenger_pubkey), l = o.indexOf(
1803
1803
  u.toLowerCase()
1804
- ), c = await ds({
1804
+ ), c = await hs({
1805
1805
  challenger: i,
1806
1806
  challengerPubkey: u,
1807
1807
  challengerIndex: l,
@@ -1814,7 +1814,7 @@ async function Xt(e, t) {
1814
1814
  }
1815
1815
  return { localChallengers: r, noPayouts: a };
1816
1816
  }
1817
- async function ds(e) {
1817
+ async function hs(e) {
1818
1818
  const {
1819
1819
  challenger: t,
1820
1820
  challengerPubkey: r,
@@ -1824,7 +1824,7 @@ async function ds(e) {
1824
1824
  assertTx: a,
1825
1825
  ctx: i
1826
1826
  } = e;
1827
- Xr(
1827
+ jr(
1828
1828
  t.nopayout_tx.tx_hex,
1829
1829
  r,
1830
1830
  i.network
@@ -1835,7 +1835,7 @@ async function ds(e) {
1835
1835
  P(t.challenge_assert_x_tx.tx_hex)
1836
1836
  ), c = S.fromHex(
1837
1837
  P(t.challenge_assert_y_tx.tx_hex)
1838
- ), h = await br({
1838
+ ), d = await br({
1839
1839
  txGraphVersion: i.vaultCoreVersion,
1840
1840
  claimer: n,
1841
1841
  challenger: r,
@@ -1845,42 +1845,42 @@ async function ds(e) {
1845
1845
  ),
1846
1846
  network: i.network
1847
1847
  });
1848
- for (const [g, p] of [
1848
+ for (const [g, h] of [
1849
1849
  ["X", l],
1850
1850
  ["Y", c]
1851
1851
  ])
1852
- zr({
1853
- challengeAssertTx: p,
1852
+ Wr({
1853
+ challengeAssertTx: h,
1854
1854
  assertTx: a,
1855
1855
  half: g,
1856
1856
  challengerIndex: o,
1857
1857
  challengerCount: s,
1858
1858
  challengerPubkey: r,
1859
- outputConnectorScriptPubKey: h
1859
+ outputConnectorScriptPubKey: d
1860
1860
  });
1861
- const d = [
1861
+ const p = [
1862
1862
  a.outs[G],
1863
1863
  l.outs[Xe],
1864
1864
  c.outs[Xe]
1865
1865
  ];
1866
- return jr({
1866
+ return Yr({
1867
1867
  noPayoutTx: u,
1868
1868
  assertTxid: a.getId(),
1869
1869
  challengeAssertXTxid: l.getId(),
1870
1870
  challengeAssertYTxid: c.getId(),
1871
1871
  timelockChallengeAssert: i.timelockChallengeAssert,
1872
1872
  prevoutValues: [
1873
- d[0].value,
1874
- d[1].value,
1875
- d[2].value
1873
+ p[0].value,
1874
+ p[1].value,
1875
+ p[2].value
1876
1876
  ]
1877
- }), d.map((g) => ({
1877
+ }), p.map((g) => ({
1878
1878
  script_pubkey: yt(new Uint8Array(g.script)),
1879
1879
  value: g.value
1880
1880
  }));
1881
1881
  }
1882
- async function hs(e, t, r) {
1883
- const o = [], s = [], n = [], { localChallengers: a, noPayouts: i } = await Xt(e, r), u = await Rr({
1882
+ async function gs(e, t, r) {
1883
+ const o = [], s = [], n = [], { localChallengers: a, noPayouts: i } = await Xt(e, r), u = await Kr({
1884
1884
  vaultCoreVersion: r.vaultCoreVersion,
1885
1885
  vkClaimerPayoutScriptPubKeys: r.vkClaimerPayoutScriptPubKeys,
1886
1886
  vpCommissionScriptPubKey: r.vpCommissionScriptPubKey,
@@ -1896,7 +1896,7 @@ async function hs(e, t, r) {
1896
1896
  network: r.network,
1897
1897
  claimerBtcPubkey: r.depositorBtcPubkey,
1898
1898
  registeredPayoutScriptPubKey: r.registeredPayoutScriptPubKey,
1899
- commissionBps: us,
1899
+ commissionBps: ls,
1900
1900
  protocolFeeRate: r.protocolFeeRate,
1901
1901
  councilMembers: r.councilMembers,
1902
1902
  councilQuorum: r.councilQuorum
@@ -1908,11 +1908,11 @@ async function hs(e, t, r) {
1908
1908
  )
1909
1909
  );
1910
1910
  const l = P(r.depositorBtcPubkey);
1911
- for (const { challenger: c, challengerPubkey: h, prevouts: d } of i) {
1912
- const g = o.length, p = await Gr({
1911
+ for (const { challenger: c, challengerPubkey: d, prevouts: p } of i) {
1912
+ const g = o.length, h = await zr({
1913
1913
  noPayoutTxHex: c.nopayout_tx.tx_hex,
1914
- challengerPubkey: h,
1915
- prevouts: d,
1914
+ challengerPubkey: d,
1915
+ prevouts: p,
1916
1916
  connectorParams: {
1917
1917
  txGraphVersion: r.vaultCoreVersion,
1918
1918
  claimer: l,
@@ -1923,19 +1923,19 @@ async function hs(e, t, r) {
1923
1923
  councilQuorum: r.councilQuorum
1924
1924
  }
1925
1925
  });
1926
- o.push(p), s.push(
1926
+ o.push(h), s.push(
1927
1927
  ce(
1928
1928
  t,
1929
1929
  Ge
1930
1930
  )
1931
1931
  ), n.push({
1932
- challengerPubkey: h,
1932
+ challengerPubkey: d,
1933
1933
  noPayoutIdx: g
1934
1934
  });
1935
1935
  }
1936
1936
  return { psbtHexes: o, signOptions: s, challengerEntries: n };
1937
1937
  }
1938
- function ps(e, t, r) {
1938
+ function fs(e, t, r) {
1939
1939
  ae(e[0]);
1940
1940
  const s = ue(
1941
1941
  e[0].returnedPsbtHex,
@@ -1970,18 +1970,18 @@ function ps(e, t, r) {
1970
1970
  per_challenger: n
1971
1971
  };
1972
1972
  }
1973
- async function gs(e) {
1973
+ async function ys(e) {
1974
1974
  const { depositorGraph: t, btcWallet: r, signingContext: o } = e;
1975
- os({
1975
+ ns({
1976
1976
  peginTxHex: o.peginTxHex,
1977
1977
  claimTxHex: t.claim_tx.tx_hex,
1978
1978
  assertTxHex: t.assert_tx.tx_hex,
1979
1979
  path: "depositor_graph"
1980
1980
  });
1981
- const s = await r.getPublicKeyHex(), { depositorPubkey: n } = or(
1981
+ const s = await r.getPublicKeyHex(), { depositorPubkey: n } = sr(
1982
1982
  s,
1983
1983
  P(o.depositorBtcPubkey)
1984
- ), { psbtHexes: a, signOptions: i, challengerEntries: u } = await hs(
1984
+ ), { psbtHexes: a, signOptions: i, challengerEntries: u } = await gs(
1985
1985
  t,
1986
1986
  s,
1987
1987
  o
@@ -1989,17 +1989,17 @@ async function gs(e) {
1989
1989
  r,
1990
1990
  a,
1991
1991
  i
1992
- ), c = a.map((h, d) => ({
1993
- requestedPsbtHex: h,
1994
- returnedPsbtHex: l[d]
1992
+ ), c = a.map((d, p) => ({
1993
+ requestedPsbtHex: d,
1994
+ returnedPsbtHex: l[p]
1995
1995
  }));
1996
- return ps(
1996
+ return fs(
1997
1997
  c,
1998
1998
  u,
1999
1999
  n
2000
2000
  );
2001
2001
  }
2002
- const fs = 1e4, M = 10;
2002
+ const vs = 1e4, M = 10;
2003
2003
  async function zt(e) {
2004
2004
  const {
2005
2005
  statusReader: t,
@@ -2007,7 +2007,7 @@ async function zt(e) {
2007
2007
  peginTxid: o,
2008
2008
  targetStatuses: s,
2009
2009
  timeoutMs: n,
2010
- pollIntervalMs: a = fs,
2010
+ pollIntervalMs: a = vs,
2011
2011
  signal: i
2012
2012
  } = e, u = Date.now();
2013
2013
  for (; ; ) {
@@ -2035,48 +2035,48 @@ async function zt(e) {
2035
2035
  const c = l.status;
2036
2036
  if (s.has(c) || c === R.ACTIVATED)
2037
2037
  return c;
2038
- if (c === R.EXPIRED || Dr.has(c))
2038
+ if (c === R.EXPIRED || Mr.has(c))
2039
2039
  throw new Error(
2040
2040
  `Vault ${r.slice(0, M)}… reached terminal status "${c}" while waiting for ${[...s].join(", ")}`
2041
2041
  );
2042
2042
  } catch (l) {
2043
- if (!(l instanceof Lr && l.code === Mr.PEGIN_NOT_FOUND))
2043
+ if (!(l instanceof Ur && l.code === Fr.PEGIN_NOT_FOUND))
2044
2044
  throw l;
2045
2045
  }
2046
2046
  await new Promise((l, c) => {
2047
- const h = () => {
2048
- clearTimeout(d), c(
2047
+ const d = () => {
2048
+ clearTimeout(p), c(
2049
2049
  new Error(
2050
2050
  `Polling aborted for vault ${r.slice(0, M)}… (target: ${[...s].join(", ")})`
2051
2051
  )
2052
2052
  );
2053
- }, d = setTimeout(() => {
2054
- i == null || i.removeEventListener("abort", h), l();
2053
+ }, p = setTimeout(() => {
2054
+ i == null || i.removeEventListener("abort", d), l();
2055
2055
  }, a);
2056
- i == null || i.addEventListener("abort", h, { once: !0 });
2056
+ i == null || i.addEventListener("abort", d, { once: !0 });
2057
2057
  });
2058
2058
  }
2059
2059
  }
2060
- const ys = 1200 * 1e3, jt = /* @__PURE__ */ new Set([
2060
+ const Ps = 1200 * 1e3, jt = /* @__PURE__ */ new Set([
2061
2061
  R.PENDING_ACKS,
2062
2062
  R.PENDING_ACTIVATION,
2063
2063
  R.ACTIVATED_PENDING_BROADCAST,
2064
2064
  R.ACTIVATED
2065
- ]), vs = /* @__PURE__ */ new Set([
2065
+ ]), ms = /* @__PURE__ */ new Set([
2066
2066
  R.PENDING_DEPOSITOR_SIGNATURES,
2067
2067
  ...jt
2068
2068
  ]);
2069
- function Ps(e) {
2069
+ function bs(e) {
2070
2070
  return e.map((t) => ({
2071
- claimerPubkeyXOnly: pe(t.claimer_pubkey),
2071
+ claimerPubkeyXOnly: he(t.claimer_pubkey),
2072
2072
  payoutTxHex: t.payout_tx.tx_hex,
2073
2073
  assertTxHex: t.assert_tx.tx_hex
2074
2074
  }));
2075
2075
  }
2076
2076
  function I(e) {
2077
- return pe(e).toLowerCase();
2077
+ return he(e).toLowerCase();
2078
2078
  }
2079
- function bs(e, t) {
2079
+ function ws(e, t) {
2080
2080
  const r = (u, l, c) => {
2081
2081
  throw new Error(
2082
2082
  `Deposit terms ${u} (${String(l)}) does not match the vault's version-locked signing context (${String(c)}); refusing to sign payouts against terms that describe a different graph.`
@@ -2090,8 +2090,8 @@ function bs(e, t) {
2090
2090
  for (const [u, l, c] of o)
2091
2091
  l !== c && r(u, l, c);
2092
2092
  const s = (u) => u.map(I).sort(), n = (u, l) => {
2093
- const c = s(u), h = s(l);
2094
- return c.length === h.length && c.every((d, g) => d === h[g]);
2093
+ const c = s(u), d = s(l);
2094
+ return c.length === d.length && c.every((p, g) => p === d[g]);
2095
2095
  };
2096
2096
  n(e.vaultKeeperBtcPubkeys, t.vaultKeeperBtcPubkeys) || r(
2097
2097
  "vaultKeeperBtcPubkeys",
@@ -2114,7 +2114,7 @@ function bs(e, t) {
2114
2114
  t.vaultProviderBtcPubkey
2115
2115
  );
2116
2116
  }
2117
- function ms(e, t, r, o) {
2117
+ function xs(e, t, r, o) {
2118
2118
  const s = I(o), n = [
2119
2119
  I(t),
2120
2120
  ...r.map(I)
@@ -2128,14 +2128,14 @@ function ms(e, t, r, o) {
2128
2128
  "Cannot validate claimer set: depositor key overlaps with vault provider or vault keeper set"
2129
2129
  );
2130
2130
  const i = e.map(
2131
- (d) => I(d.claimer_pubkey)
2131
+ (p) => I(p.claimer_pubkey)
2132
2132
  );
2133
2133
  if (new Set(i).size !== i.length)
2134
2134
  throw new Error("Presign response contains duplicate claimer entries");
2135
- const u = i.filter((d) => d !== s), l = new Set(u), c = n.filter((d) => !l.has(d)), h = u.filter((d) => !a.has(d));
2136
- if (c.length > 0 || h.length > 0)
2135
+ const u = i.filter((p) => p !== s), l = new Set(u), c = n.filter((p) => !l.has(p)), d = u.filter((p) => !a.has(p));
2136
+ if (c.length > 0 || d.length > 0)
2137
2137
  throw new Error(
2138
- "Presign response claimer set does not match expected (vault provider ∪ vault keepers)" + (c.length > 0 ? ` (missing: ${c.join(", ")})` : "") + (h.length > 0 ? ` (unexpected: ${h.join(", ")})` : "")
2138
+ "Presign response claimer set does not match expected (vault provider ∪ vault keepers)" + (c.length > 0 ? ` (missing: ${c.join(", ")})` : "") + (d.length > 0 ? ` (unexpected: ${d.join(", ")})` : "")
2139
2139
  );
2140
2140
  }
2141
2141
  function st(e, t) {
@@ -2160,8 +2160,8 @@ function st(e, t) {
2160
2160
  vpCommissionScriptPubKey: t.vpCommissionScriptPubKey
2161
2161
  };
2162
2162
  }
2163
- async function ws(e, t, r, o) {
2164
- const s = new ir({
2163
+ async function Es(e, t, r, o) {
2164
+ const s = new ar({
2165
2165
  network: t.network,
2166
2166
  btcWallet: e
2167
2167
  }), n = r.length;
@@ -2188,7 +2188,7 @@ async function ws(e, t, r, o) {
2188
2188
  };
2189
2189
  return o == null || o(n, n), i;
2190
2190
  }
2191
- async function yn(e) {
2191
+ async function mn(e) {
2192
2192
  const {
2193
2193
  statusReader: t,
2194
2194
  presignClient: r,
@@ -2198,24 +2198,24 @@ async function yn(e) {
2198
2198
  depositorPk: a,
2199
2199
  signingContext: i,
2200
2200
  depositTerms: u,
2201
- timeoutMs: l = ys,
2201
+ timeoutMs: l = Ps,
2202
2202
  signal: c,
2203
- onProgress: h,
2204
- recordGraphFingerprint: d
2203
+ onProgress: d,
2204
+ recordGraphFingerprint: p
2205
2205
  } = e, g = await zt({
2206
2206
  statusReader: t,
2207
2207
  vaultId: s,
2208
2208
  peginTxid: n,
2209
- targetStatuses: vs,
2209
+ targetStatuses: ms,
2210
2210
  timeoutMs: l,
2211
2211
  signal: c
2212
2212
  });
2213
2213
  if (jt.has(g))
2214
2214
  return;
2215
- c == null || c.throwIfAborted(), u !== void 0 && bs(u, i);
2216
- const p = vt(o) ? o : void 0;
2215
+ c == null || c.throwIfAborted(), u !== void 0 && ws(u, i);
2216
+ const h = vt(o) ? o : void 0;
2217
2217
  let y;
2218
- if (p) {
2218
+ if (h) {
2219
2219
  if (!u)
2220
2220
  throw new Error(
2221
2221
  "runDepositorPresignFlow: this wallet requires approved deposit terms but none were provided. Fresh deposits must pass PreparePeginResult.depositTerms; resume flows must rebuild them from on-chain state (the vault app's rebuildDepositTerms)."
@@ -2230,13 +2230,13 @@ async function yn(e) {
2230
2230
  c
2231
2231
  );
2232
2232
  c == null || c.throwIfAborted(), f.txs.forEach((O, se) => {
2233
- rs({
2233
+ ss({
2234
2234
  claimTxHex: O.claim_tx.tx_hex,
2235
2235
  assertTxHex: O.assert_tx.tx_hex,
2236
2236
  path: `txs[${se}]`
2237
2237
  });
2238
2238
  });
2239
- const b = ns({
2239
+ const m = as({
2240
2240
  peginTxid: n,
2241
2241
  peginTxHex: i.peginTxHex,
2242
2242
  claimTxHex: f.depositor_graph.claim_tx.tx_hex,
@@ -2266,7 +2266,7 @@ async function yn(e) {
2266
2266
  $
2267
2267
  ), c == null || c.throwIfAborted();
2268
2268
  const x = I(a);
2269
- ms(
2269
+ xs(
2270
2270
  f.txs,
2271
2271
  i.vaultProviderBtcPubkey,
2272
2272
  i.vaultKeeperBtcPubkeys,
@@ -2274,21 +2274,21 @@ async function yn(e) {
2274
2274
  );
2275
2275
  const v = f.txs.filter(
2276
2276
  (O) => I(O.claimer_pubkey) !== x
2277
- ), E = Ps(v);
2278
- p && y && (typeof p.validateDepositTerms == "function" && await p.validateDepositTerms(y), await p.approveDepositTerms(y)), c == null || c.throwIfAborted();
2279
- const T = await ws(
2277
+ ), E = bs(v);
2278
+ h && y && (typeof h.validateDepositTerms == "function" && await h.validateDepositTerms(y), await h.approveDepositTerms(y)), c == null || c.throwIfAborted();
2279
+ const T = await Es(
2280
2280
  o,
2281
2281
  i,
2282
2282
  E,
2283
- h
2283
+ d
2284
2284
  );
2285
2285
  c == null || c.throwIfAborted();
2286
- const w = await gs({
2286
+ const w = await ys({
2287
2287
  depositorGraph: f.depositor_graph,
2288
2288
  btcWallet: o,
2289
2289
  signingContext: $
2290
2290
  });
2291
- c == null || c.throwIfAborted(), await d(b), c == null || c.throwIfAborted();
2291
+ c == null || c.throwIfAborted(), await p(m), c == null || c.throwIfAborted();
2292
2292
  const j = { ...T };
2293
2293
  j[P(a)] = w.payout_signatures, await r.submitDepositorPresignatures(
2294
2294
  {
@@ -2300,11 +2300,11 @@ async function yn(e) {
2300
2300
  c
2301
2301
  );
2302
2302
  }
2303
- const xs = 300 * 1e3, Es = /* @__PURE__ */ new Set([
2303
+ const ks = 300 * 1e3, $s = /* @__PURE__ */ new Set([
2304
2304
  R.PENDING_DEPOSITOR_WOTS_PK,
2305
2305
  ...Ct
2306
2306
  ]);
2307
- async function vn(e) {
2307
+ async function bn(e) {
2308
2308
  const {
2309
2309
  statusReader: t,
2310
2310
  wotsSubmitter: r,
@@ -2312,7 +2312,7 @@ async function vn(e) {
2312
2312
  peginTxid: s,
2313
2313
  depositorPk: n,
2314
2314
  wotsPublicKeys: a,
2315
- timeoutMs: i = xs,
2315
+ timeoutMs: i = ks,
2316
2316
  signal: u
2317
2317
  } = e;
2318
2318
  u == null || u.throwIfAborted();
@@ -2320,7 +2320,7 @@ async function vn(e) {
2320
2320
  statusReader: t,
2321
2321
  vaultId: o,
2322
2322
  peginTxid: s,
2323
- targetStatuses: Es,
2323
+ targetStatuses: $s,
2324
2324
  timeoutMs: i,
2325
2325
  signal: u
2326
2326
  });
@@ -2336,7 +2336,7 @@ async function vn(e) {
2336
2336
  function $e(e) {
2337
2337
  return e.registration || e.operation;
2338
2338
  }
2339
- function ks(e, t, r) {
2339
+ function Cs(e, t, r) {
2340
2340
  const o = _(e);
2341
2341
  return {
2342
2342
  registration: o === _(t),
@@ -2356,7 +2356,7 @@ function Ce(e) {
2356
2356
  function it(e, t) {
2357
2357
  return e.length === t.length && e.every((r, o) => r === t[o]);
2358
2358
  }
2359
- async function Pn(e) {
2359
+ async function wn(e) {
2360
2360
  const {
2361
2361
  vaultProviderEthAddress: t,
2362
2362
  hintBtcPubkey: r,
@@ -2380,11 +2380,11 @@ class Se extends Error {
2380
2380
  super(t), this.name = "ApplicationEntryPointMismatchError";
2381
2381
  }
2382
2382
  }
2383
- function bn(e) {
2383
+ function xn(e) {
2384
2384
  return e instanceof Se || e instanceof Error && e.name === "ApplicationEntryPointMismatchError";
2385
2385
  }
2386
2386
  const at = (e) => e.map(_).sort();
2387
- async function mn(e) {
2387
+ async function En(e) {
2388
2388
  const {
2389
2389
  vaultRegistryReader: t,
2390
2390
  vaultKeeperReader: r,
@@ -2396,75 +2396,75 @@ async function mn(e) {
2396
2396
  expectedUniversalChallengerBtcPubkeys: u,
2397
2397
  operationKeyReader: l,
2398
2398
  onIndexerServingOperationKeys: c,
2399
- onIndexerHintsInconsistent: h,
2400
- blockNumber: d
2399
+ onIndexerHintsInconsistent: d,
2400
+ blockNumber: p
2401
2401
  } = e, [
2402
2402
  g,
2403
- p,
2403
+ h,
2404
2404
  y,
2405
2405
  f
2406
2406
  ] = await Promise.all([
2407
2407
  t.getVaultProviderApplication(
2408
2408
  s,
2409
- d
2409
+ p
2410
2410
  ),
2411
2411
  t.getVaultProviderGenesisBtcPubKey(
2412
2412
  s,
2413
- d
2413
+ p
2414
2414
  ),
2415
- o.getLatestUniversalChallengersVersion(d),
2416
- o.getCurrentUcKeyEpoch(d)
2415
+ o.getLatestUniversalChallengersVersion(p),
2416
+ o.getCurrentUcKeyEpoch(p)
2417
2417
  ]);
2418
- if (!Or(n, { strict: !1 }))
2418
+ if (!Dr(n, { strict: !1 }))
2419
2419
  throw new Se(
2420
2420
  `The application entry point this deposit was prepared for is not a valid address: ${n}`
2421
2421
  );
2422
- if (!Nr(g, n))
2422
+ if (!Lr(g, n))
2423
2423
  throw new Se(
2424
2424
  `Vault provider ${s} is registered to application ${g}, but this deposit was prepared for ${n}. Refusing to build: the vault keeper roster, its version, and the keeper key epoch would all resolve against a different application than the one selected.`
2425
2425
  );
2426
- const [b, $] = await Promise.all(
2426
+ const [m, $] = await Promise.all(
2427
2427
  [
2428
2428
  r.getCurrentVaultKeepersVersion(
2429
2429
  g,
2430
- d
2430
+ p
2431
2431
  ),
2432
2432
  r.getCurrentAppKeeperKeyEpoch(
2433
2433
  g,
2434
- d
2434
+ p
2435
2435
  )
2436
2436
  ]
2437
2437
  ), [x, v] = await Promise.all([
2438
2438
  r.getVaultKeepersByVersion(
2439
2439
  g,
2440
- b,
2441
- d
2440
+ m,
2441
+ p
2442
2442
  ),
2443
2443
  o.getUniversalChallengersByVersion(
2444
2444
  y,
2445
- d
2445
+ p
2446
2446
  )
2447
2447
  ]), E = {
2448
- vaultProvider: _(p),
2448
+ vaultProvider: _(h),
2449
2449
  vaultKeepers: at(x.map((C) => C.btcPubKey)),
2450
2450
  universalChallengers: at(v.map((C) => C.btcPubKey))
2451
- }, T = await qo({
2451
+ }, T = await Xo({
2452
2452
  operationKeyReader: l,
2453
2453
  query: {
2454
2454
  vaultProviderEthAddress: s,
2455
- vaultProviderGenesisBtcPubkey: `0x${p}`,
2455
+ vaultProviderGenesisBtcPubkey: `0x${h}`,
2456
2456
  applicationEntryPoint: g,
2457
2457
  vaultKeepers: x,
2458
2458
  universalChallengers: v
2459
2459
  },
2460
- blockNumber: d
2460
+ blockNumber: p
2461
2461
  }), w = {
2462
2462
  vaultProvider: T.vaultProvider.operationBtcPubkey,
2463
2463
  vaultKeepers: [...T.vaultKeeperOperationKeysSorted],
2464
2464
  universalChallengers: [
2465
2465
  ...T.universalChallengerOperationKeysSorted
2466
2466
  ]
2467
- }, j = ks(
2467
+ }, j = Cs(
2468
2468
  a,
2469
2469
  E.vaultProvider,
2470
2470
  w.vaultProvider
@@ -2483,16 +2483,16 @@ async function mn(e) {
2483
2483
  );
2484
2484
  if (!$e(O))
2485
2485
  throw new Error(
2486
- `Vault keeper BTC pubkeys (v${b}) indexer set does not match ApplicationRegistry on-chain set. Refresh and try again.`
2486
+ `Vault keeper BTC pubkeys (v${m}) indexer set does not match ApplicationRegistry on-chain set. Refresh and try again.`
2487
2487
  );
2488
2488
  if (!$e(se))
2489
2489
  throw new Error(
2490
2490
  `Universal challenger BTC pubkeys (v${y}) indexer set does not match ProtocolParams on-chain set. Refresh and try again.`
2491
2491
  );
2492
- const Ne = [j, O, se], Zt = Ne.some((C) => C.registration && !C.operation), De = Ne.some((C) => C.operation && !C.registration);
2493
- if (Zt && De) {
2492
+ const Ne = [j, O, se], er = Ne.some((C) => C.registration && !C.operation), De = Ne.some((C) => C.operation && !C.registration);
2493
+ if (er && De) {
2494
2494
  const C = `Indexer participant hints are internally inconsistent for vault provider ${s}: some roles match the registration keys while others match the rotated operation keys.`;
2495
- throw h == null || h(C), new Error(`${C} Refresh and try again.`);
2495
+ throw d == null || d(C), new Error(`${C} Refresh and try again.`);
2496
2496
  }
2497
2497
  return De && (c == null || c(
2498
2498
  `Indexer is serving rotated operation keys for vault provider ${s}`
@@ -2500,7 +2500,7 @@ async function mn(e) {
2500
2500
  vaultProviderBtcPubkeyXOnly: w.vaultProvider,
2501
2501
  vaultKeeperBtcPubkeysSorted: w.vaultKeepers,
2502
2502
  universalChallengerBtcPubkeysSorted: w.universalChallengers,
2503
- expectedAppVaultKeepersVersion: b,
2503
+ expectedAppVaultKeepersVersion: m,
2504
2504
  expectedUniversalChallengersVersion: y,
2505
2505
  appKeeperKeyEpoch: $,
2506
2506
  ucKeyEpoch: f,
@@ -2508,10 +2508,10 @@ async function mn(e) {
2508
2508
  participantKeys: T
2509
2509
  };
2510
2510
  }
2511
- function $s(e) {
2511
+ function Ts(e) {
2512
2512
  return /^[0-9a-fA-F]{64}$/.test(e);
2513
2513
  }
2514
- function wn(e) {
2514
+ function kn(e) {
2515
2515
  const {
2516
2516
  amountSats: t,
2517
2517
  minDeposit: r,
@@ -2522,7 +2522,7 @@ function wn(e) {
2522
2522
  } = e;
2523
2523
  return !(t <= 0n || t < r || o && o > 0n && t > o || n == null || a == null || t + n + a > s);
2524
2524
  }
2525
- function xn(e, t, r) {
2525
+ function $n(e, t, r) {
2526
2526
  return e <= 0n ? {
2527
2527
  valid: !1,
2528
2528
  error: "Deposit amount must be greater than zero"
@@ -2534,7 +2534,7 @@ function xn(e, t, r) {
2534
2534
  error: `Maximum deposit is ${N(r)} BTC`
2535
2535
  } : { valid: !0 };
2536
2536
  }
2537
- function En(e) {
2537
+ function Cn(e) {
2538
2538
  const { amount: t, effectiveRemaining: r } = e;
2539
2539
  return r === null ? { valid: !0 } : r === 0n ? {
2540
2540
  valid: !1,
@@ -2544,7 +2544,7 @@ function En(e) {
2544
2544
  error: `Vault size exceeds remaining capacity (${N(r)} BTC)`
2545
2545
  } : { valid: !0 };
2546
2546
  }
2547
- function kn(e, t) {
2547
+ function Tn(e, t) {
2548
2548
  if (!e || e.length === 0)
2549
2549
  return {
2550
2550
  valid: !1,
@@ -2560,7 +2560,7 @@ function kn(e, t) {
2560
2560
  error: "Invalid vault provider selected"
2561
2561
  } : { valid: !0 };
2562
2562
  }
2563
- function Cs(e, t, r) {
2563
+ function _s(e, t, r) {
2564
2564
  if (!e || e.length === 0)
2565
2565
  return {
2566
2566
  valid: !1,
@@ -2586,30 +2586,30 @@ function Cs(e, t, r) {
2586
2586
  }
2587
2587
  return { valid: !0 };
2588
2588
  }
2589
- function Ts(e) {
2589
+ function Ss(e) {
2590
2590
  const t = P(e);
2591
- return $s(t) ? { valid: !0 } : {
2591
+ return Ts(t) ? { valid: !0 } : {
2592
2592
  valid: !1,
2593
2593
  error: "Invalid pubkey format: must be 64 hex characters (32-byte x-only public key, no 0x prefix)"
2594
2594
  };
2595
2595
  }
2596
- function _s(e) {
2596
+ function As(e) {
2597
2597
  if (!e || e.length === 0)
2598
2598
  throw new Error(
2599
2599
  "No vault keepers available. The system requires at least one vault keeper to create a deposit."
2600
2600
  );
2601
2601
  }
2602
- function Ss(e) {
2602
+ function Bs(e) {
2603
2603
  if (!e || e.length === 0)
2604
2604
  throw new Error(
2605
2605
  "No universal challengers available. The system requires at least one universal challenger to create a deposit."
2606
2606
  );
2607
2607
  }
2608
- function As(e) {
2608
+ function Is(e) {
2609
2609
  if (e.length === 0)
2610
2610
  throw new Error("No spendable UTXOs available");
2611
2611
  }
2612
- function $n(e) {
2612
+ function _n(e) {
2613
2613
  const {
2614
2614
  vaultAmounts: t,
2615
2615
  confirmedUTXOs: r,
@@ -2618,78 +2618,133 @@ function $n(e) {
2618
2618
  universalChallengerBtcPubkeys: n,
2619
2619
  minDeposit: a,
2620
2620
  maxDeposit: i
2621
- } = e, u = Cs(
2621
+ } = e, u = _s(
2622
2622
  t,
2623
2623
  a,
2624
2624
  i
2625
2625
  );
2626
2626
  if (!u.valid)
2627
2627
  throw new Error(u.error);
2628
- const l = Ts(o);
2628
+ const l = Ss(o);
2629
2629
  if (!l.valid)
2630
2630
  throw new Error(l.error);
2631
- _s(s), Ss(n), As(r);
2631
+ As(s), Bs(n), Is(r);
2632
2632
  }
2633
2633
  class Wt extends Error {
2634
2634
  constructor(t) {
2635
2635
  super(t), this.name = "ParticipantKeyDriftError";
2636
2636
  }
2637
2637
  }
2638
- function Cn(e) {
2638
+ function Sn(e) {
2639
2639
  return e instanceof Wt || e instanceof Error && e.name === "ParticipantKeyDriftError";
2640
2640
  }
2641
+ class Yt extends Error {
2642
+ constructor(t) {
2643
+ super(t), this.name = "UnsupportedPayoutScriptError";
2644
+ }
2645
+ }
2646
+ function An(e) {
2647
+ return e instanceof Yt || e instanceof Error && e.name === "UnsupportedPayoutScriptError";
2648
+ }
2641
2649
  function ut(e, t, r) {
2642
2650
  return t.length === r.length && t.every((o, s) => o === r[s]) ? null : `${e} expected [${t.join(", ")}], got [${r.join(", ")}]`;
2643
2651
  }
2644
- async function Tn(e) {
2652
+ async function Vs(e) {
2653
+ const { operationKeyReader: t, query: r, epochs: o, vaultIds: s } = e, n = await t.getPayoutScriptsAtEpochs(
2654
+ r,
2655
+ o
2656
+ );
2657
+ if (n.vaultKeepers.length !== r.vaultKeepers.length)
2658
+ throw new Error(
2659
+ `vaults ${s.join(", ")}: expected ${r.vaultKeepers.length} vault keeper payout scripts, got ${n.vaultKeepers.length}`
2660
+ );
2661
+ const a = [], i = (u, l) => {
2662
+ try {
2663
+ Hr(u, l);
2664
+ } catch (c) {
2665
+ a.push(
2666
+ `vaults ${s.join(", ")}: ${c.message}`
2667
+ );
2668
+ }
2669
+ };
2670
+ i(
2671
+ n.vaultProvider,
2672
+ `Vault provider ${r.vaultProviderEthAddress} commission payout script`
2673
+ );
2674
+ for (const [u, l] of r.vaultKeepers.entries())
2675
+ i(
2676
+ n.vaultKeepers[u],
2677
+ `Vault keeper ${l.ethAddress} payout script`
2678
+ );
2679
+ if (a.length > 0)
2680
+ throw new Yt(
2681
+ `Aborting Pre-PegIn broadcast: an operator payout script registered for this vault is not a standard output type this app can verify (${a.join("; ")}). The Pre-PegIn was not broadcast; the registered ETH vault will time out per protocol rules.`
2682
+ );
2683
+ }
2684
+ async function Bn(e) {
2645
2685
  const { vaultRegistryReader: t, operationKeyReader: r, vaultIds: o, expected: s } = e, n = s.query;
2646
2686
  if (o.length === 0) return;
2647
2687
  const a = await t.getVaultKeyEpochsBatch(o), i = [];
2648
- for (const [u, l] of a.entries()) {
2649
- const c = o[u];
2650
- let h;
2688
+ for (const [l, c] of a.entries()) {
2689
+ const d = o[l];
2690
+ let p;
2651
2691
  try {
2652
- h = await Nt({
2692
+ p = await Nt({
2653
2693
  operationKeyReader: r,
2654
2694
  query: n,
2655
- epochs: l
2695
+ epochs: c
2656
2696
  });
2657
- } catch (p) {
2697
+ } catch (y) {
2658
2698
  i.push(
2659
- `vault ${c}: could not resolve participants at frozen epochs (vp=${l.vpKeyEpoch}, keeper=${l.appKeeperKeyEpoch}, uc=${l.ucKeyEpoch}): ${p.message}`
2699
+ `vault ${d}: could not resolve participants at frozen epochs (vp=${c.vpKeyEpoch}, keeper=${c.appKeeperKeyEpoch}, uc=${c.ucKeyEpoch}): ${y.message}`
2660
2700
  );
2661
2701
  continue;
2662
2702
  }
2663
- h.vaultProvider.operationBtcPubkey !== s.vaultProvider.operationBtcPubkey && i.push(
2664
- `vault ${c}: vault provider key expected ${s.vaultProvider.operationBtcPubkey}, got ${h.vaultProvider.operationBtcPubkey}`
2703
+ p.vaultProvider.operationBtcPubkey !== s.vaultProvider.operationBtcPubkey && i.push(
2704
+ `vault ${d}: vault provider key expected ${s.vaultProvider.operationBtcPubkey}, got ${p.vaultProvider.operationBtcPubkey}`
2665
2705
  );
2666
- const d = ut(
2667
- `vault ${c}: vault keeper keys`,
2706
+ const g = ut(
2707
+ `vault ${d}: vault keeper keys`,
2668
2708
  s.vaultKeeperOperationKeysSorted,
2669
- h.vaultKeeperOperationKeysSorted
2709
+ p.vaultKeeperOperationKeysSorted
2670
2710
  );
2671
- d && i.push(d);
2672
- const g = ut(
2673
- `vault ${c}: universal challenger keys`,
2711
+ g && i.push(g);
2712
+ const h = ut(
2713
+ `vault ${d}: universal challenger keys`,
2674
2714
  s.universalChallengerOperationKeysSorted,
2675
- h.universalChallengerOperationKeysSorted
2715
+ p.universalChallengerOperationKeysSorted
2676
2716
  );
2677
- g && i.push(g);
2717
+ h && i.push(h);
2678
2718
  }
2679
2719
  if (i.length > 0)
2680
2720
  throw new Wt(
2681
2721
  `Aborting BTC broadcast: participant operation keys changed during registration (${i.join("; ")}). The Pre-PegIn was not broadcast; the registered ETH vault will time out per protocol rules.`
2682
2722
  );
2723
+ const u = /* @__PURE__ */ new Map();
2724
+ for (const [l, c] of a.entries()) {
2725
+ const d = `${c.vpKeyEpoch}:${c.appKeeperKeyEpoch}:${c.ucKeyEpoch}`, p = u.get(d);
2726
+ p ? p.vaultIds.push(o[l]) : u.set(d, { epochs: c, vaultIds: [o[l]] });
2727
+ }
2728
+ await Promise.all(
2729
+ [...u.values()].map(
2730
+ ({ epochs: l, vaultIds: c }) => Vs({
2731
+ operationKeyReader: r,
2732
+ query: n,
2733
+ epochs: l,
2734
+ vaultIds: c
2735
+ })
2736
+ )
2737
+ );
2683
2738
  }
2684
- class Yt extends Error {
2739
+ class Qt extends Error {
2685
2740
  constructor(t) {
2686
2741
  super(t), this.name = "RegisteredVaultVersionMismatchError";
2687
2742
  }
2688
2743
  }
2689
- function _n(e) {
2690
- return e instanceof Yt || e instanceof Error && e.name === "RegisteredVaultVersionMismatchError";
2744
+ function In(e) {
2745
+ return e instanceof Qt || e instanceof Error && e.name === "RegisteredVaultVersionMismatchError";
2691
2746
  }
2692
- async function Sn(e) {
2747
+ async function Vn(e) {
2693
2748
  const {
2694
2749
  vaultRegistryReader: t,
2695
2750
  vaultIds: r,
@@ -2699,22 +2754,22 @@ async function Sn(e) {
2699
2754
  expectedVaultCoreVersion: a
2700
2755
  } = e, i = await t.getProtocolInfoBatch(r), u = [];
2701
2756
  if (i.forEach((l, c) => {
2702
- const h = r[c];
2757
+ const d = r[c];
2703
2758
  l.offchainParamsVersion !== o && u.push(
2704
- `vault ${h}: offchainParams expected v${o}, got v${l.offchainParamsVersion}`
2759
+ `vault ${d}: offchainParams expected v${o}, got v${l.offchainParamsVersion}`
2705
2760
  ), l.appVaultKeepersVersion !== s && u.push(
2706
- `vault ${h}: appVaultKeepers expected v${s}, got v${l.appVaultKeepersVersion}`
2761
+ `vault ${d}: appVaultKeepers expected v${s}, got v${l.appVaultKeepersVersion}`
2707
2762
  ), l.universalChallengersVersion !== n && u.push(
2708
- `vault ${h}: universalChallengers expected v${n}, got v${l.universalChallengersVersion}`
2763
+ `vault ${d}: universalChallengers expected v${n}, got v${l.universalChallengersVersion}`
2709
2764
  ), l.vaultCoreVersion !== a && u.push(
2710
- `vault ${h}: vaultCoreVersion expected v${a} (build-time active), got v${l.vaultCoreVersion}`
2765
+ `vault ${d}: vaultCoreVersion expected v${a} (build-time active), got v${l.vaultCoreVersion}`
2711
2766
  );
2712
2767
  }), u.length > 0)
2713
- throw new Yt(
2768
+ throw new Qt(
2714
2769
  `Aborting BTC broadcast: signer-set or offchain-params versions changed during registration (${u.join("; ")}). The Pre-PegIn was not broadcast; the registered ETH vault will time out per protocol rules.`
2715
2770
  );
2716
2771
  }
2717
- class Bs extends Error {
2772
+ class Rs extends Error {
2718
2773
  constructor(r, o) {
2719
2774
  super(`Refund not yet mature (BIP68 not final): ${o.message}`);
2720
2775
  W(this, "vaultId");
@@ -2722,21 +2777,21 @@ class Bs extends Error {
2722
2777
  this.name = "BIP68NotMatureError", this.vaultId = r, this.cause = o;
2723
2778
  }
2724
2779
  }
2725
- const Is = /^0x[0-9a-fA-F]{64}$/, Vs = /^(?:0x)?(?:[0-9a-fA-F]{2})+$/, Qt = /^(?:0x)?(?:[0-9a-fA-F]{64}|[0-9a-fA-F]{66})$/, Jt = 160, ct = 2e3, lt = 10n, dt = 100n;
2726
- function An(e) {
2780
+ const Ks = /^0x[0-9a-fA-F]{64}$/, Hs = /^(?:0x)?(?:[0-9a-fA-F]{2})+$/, Jt = /^(?:0x)?(?:[0-9a-fA-F]{64}|[0-9a-fA-F]{66})$/, Zt = 160, ct = 2e3, lt = 10n, pt = 100n;
2781
+ function Rn(e) {
2727
2782
  if (!Number.isFinite(e) || e <= 0)
2728
2783
  throw new Error(
2729
2784
  `feeRateSatsVb must be a positive finite number, got ${e}`
2730
2785
  );
2731
- return BigInt(Math.ceil(e * Jt));
2786
+ return BigInt(Math.ceil(e * Zt));
2732
2787
  }
2733
- const Rs = 1, Ks = /non-BIP68-final/i;
2788
+ const Os = 1, Ns = /non-BIP68-final/i;
2734
2789
  function Ae(e, t) {
2735
2790
  if (e.length !== 66)
2736
2791
  throw new Error(
2737
2792
  `${t} must be 32 bytes (66 hex chars with 0x prefix), got length ${e.length}`
2738
2793
  );
2739
- if (!Is.test(e))
2794
+ if (!Ks.test(e))
2740
2795
  throw new Error(
2741
2796
  `${t} must contain only hex characters after the 0x prefix`
2742
2797
  );
@@ -2745,7 +2800,7 @@ function Te(e, t) {
2745
2800
  if (!Number.isInteger(e) || e < 0)
2746
2801
  throw new Error(`${t} must be a non-negative integer, got ${e}`);
2747
2802
  }
2748
- function Hs(e) {
2803
+ function Ds(e) {
2749
2804
  if (Ae(e.hashlock, "hashlock"), !Number.isInteger(e.htlcVout) || e.htlcVout < 0)
2750
2805
  throw new Error(
2751
2806
  `htlcVout must be a non-negative integer, got ${e.htlcVout}`
@@ -2779,24 +2834,24 @@ function Hs(e) {
2779
2834
  if (Te(e.offchainParamsVersion, "offchainParamsVersion"), Te(e.appVaultKeepersVersion, "appVaultKeepersVersion"), Te(
2780
2835
  e.universalChallengersVersion,
2781
2836
  "universalChallengersVersion"
2782
- ), Jr(
2837
+ ), eo(
2783
2838
  e.vaultCoreVersion,
2784
2839
  "VaultRefundData.vaultCoreVersion"
2785
2840
  ), typeof e.unsignedPrePeginTxHex != "string" || e.unsignedPrePeginTxHex.length === 0)
2786
2841
  throw new Error("unsignedPrePeginTxHex must be a non-empty hex string");
2787
- if (!Vs.test(e.unsignedPrePeginTxHex))
2842
+ if (!Hs.test(e.unsignedPrePeginTxHex))
2788
2843
  throw new Error(
2789
2844
  "unsignedPrePeginTxHex must be a hex byte string (optional 0x prefix, even length)"
2790
2845
  );
2791
- if (!e.depositorBtcPubkey || !Qt.test(e.depositorBtcPubkey))
2846
+ if (!e.depositorBtcPubkey || !Jt.test(e.depositorBtcPubkey))
2792
2847
  throw new Error(
2793
2848
  "depositorBtcPubkey must be 32 or 33 bytes of hex (optional 0x prefix)"
2794
2849
  );
2795
2850
  if (typeof e.amount != "bigint" || e.amount <= 0n)
2796
2851
  throw new Error(`amount must be a positive bigint, got ${e.amount}`);
2797
2852
  }
2798
- function Os(e) {
2799
- if (!e.vaultProviderPubkey || !Qt.test(e.vaultProviderPubkey))
2853
+ function Ls(e) {
2854
+ if (!e.vaultProviderPubkey || !Jt.test(e.vaultProviderPubkey))
2800
2855
  throw new Error("vaultProviderPubkey must be 32 or 33 bytes of hex");
2801
2856
  if (e.vaultKeeperPubkeys.length === 0)
2802
2857
  throw new Error("vaultKeeperPubkeys must be non-empty");
@@ -2821,7 +2876,7 @@ function Os(e) {
2821
2876
  `councilQuorum (${e.councilQuorum}) must be in [1, councilSize=${e.councilSize}]`
2822
2877
  );
2823
2878
  }
2824
- async function Bn(e) {
2879
+ async function Kn(e) {
2825
2880
  const {
2826
2881
  vaultId: t,
2827
2882
  readVault: r,
@@ -2833,28 +2888,28 @@ async function Bn(e) {
2833
2888
  } = e;
2834
2889
  i == null || i.throwIfAborted(), Ae(t, "vaultId");
2835
2890
  const u = await r();
2836
- Hs(u), i == null || i.throwIfAborted();
2891
+ Ds(u), i == null || i.throwIfAborted();
2837
2892
  const l = await o(u);
2838
- if (Os(l), i == null || i.throwIfAborted(), !Number.isFinite(s) || s <= 0)
2893
+ if (Ls(l), i == null || i.throwIfAborted(), !Number.isFinite(s) || s <= 0)
2839
2894
  throw new Error(`feeRate must be a positive number, got ${s}`);
2840
2895
  if (s > ct)
2841
2896
  throw new Error(
2842
2897
  `feeRate ${s} sat/vB exceeds refund safety cap ${ct} sat/vB; refusing to sign refund.`
2843
2898
  );
2844
- const c = BigInt(Math.ceil(s * Jt)), h = u.amount * lt / dt;
2845
- if (c > h)
2899
+ const c = BigInt(Math.ceil(s * Zt)), d = u.amount * lt / pt;
2900
+ if (c > d)
2846
2901
  throw new Error(
2847
- `Refund fee ${c} sats exceeds the per-vault safety cap of ${h} sats (${lt}/${dt} of vault.amount=${u.amount}); refusing to sign refund.`
2902
+ `Refund fee ${c} sats exceeds the per-vault safety cap of ${d} sats (${lt}/${pt} of vault.amount=${u.amount}); refusing to sign refund.`
2848
2903
  );
2849
2904
  i == null || i.throwIfAborted();
2850
- const d = pe(
2905
+ const p = he(
2851
2906
  u.depositorBtcPubkey
2852
- ), g = P(u.unsignedPrePeginTxHex), p = ar(g);
2853
- if (p !== void 0 && p.vout !== u.batch.length)
2907
+ ), g = P(u.unsignedPrePeginTxHex), h = ur(g);
2908
+ if (h !== void 0 && h.vout !== u.batch.length)
2854
2909
  throw new Error(
2855
- `Auth-anchor OP_RETURN at vout ${p.vout} does not match batch size (${u.batch.length} HTLC outputs expect the anchor at vout ${u.batch.length}). Refund refused — sibling HTLC vector is incomplete.`
2910
+ `Auth-anchor OP_RETURN at vout ${h.vout} does not match batch size (${u.batch.length} HTLC outputs expect the anchor at vout ${u.batch.length}). Refund refused — sibling HTLC vector is incomplete.`
2856
2911
  );
2857
- const y = p == null ? void 0 : p.hash;
2912
+ const y = h == null ? void 0 : h.hash;
2858
2913
  let f;
2859
2914
  try {
2860
2915
  f = S.fromHex(g);
@@ -2867,10 +2922,10 @@ async function Bn(e) {
2867
2922
  throw new Error(
2868
2923
  `Funded Pre-PegIn tx has ${f.outs.length} outputs but batch requires at least ${u.batch.length} HTLC outputs. Refund refused — funded tx shape disagrees with sibling vector.`
2869
2924
  );
2870
- const { psbtHex: b } = await Wr({
2925
+ const { psbtHex: m } = await Qr({
2871
2926
  prePeginParams: {
2872
2927
  vaultCoreVersion: u.vaultCoreVersion,
2873
- depositorPubkey: d,
2928
+ depositorPubkey: p,
2874
2929
  vaultProviderPubkey: P(l.vaultProviderPubkey),
2875
2930
  vaultKeeperPubkeys: l.vaultKeeperPubkeys.map(P),
2876
2931
  universalChallengerPubkeys: l.universalChallengerPubkeys.map(P),
@@ -2903,36 +2958,36 @@ async function Bn(e) {
2903
2958
  i == null || i.throwIfAborted();
2904
2959
  const $ = ce(
2905
2960
  u.depositorBtcPubkey,
2906
- Rs
2907
- ), x = await n(b, $);
2961
+ Os
2962
+ ), x = await n(m, $);
2908
2963
  ae({
2909
- requestedPsbtHex: b,
2964
+ requestedPsbtHex: m,
2910
2965
  returnedPsbtHex: x
2911
2966
  });
2912
2967
  const v = 0, E = ue(
2913
2968
  x,
2914
- d,
2969
+ p,
2915
2970
  v
2916
2971
  );
2917
2972
  oe({
2918
- requestedPsbtHex: b,
2973
+ requestedPsbtHex: m,
2919
2974
  signatureHex: E,
2920
- signerXOnlyPubkeyHex: d,
2975
+ signerXOnlyPubkeyHex: p,
2921
2976
  inputIndex: v
2922
2977
  });
2923
2978
  const T = Tt({
2924
- requestedPsbtHex: b,
2979
+ requestedPsbtHex: m,
2925
2980
  signaturesHex: [E],
2926
- signerXOnlyPubkeyHex: d
2981
+ signerXOnlyPubkeyHex: p
2927
2982
  });
2928
2983
  i == null || i.throwIfAborted();
2929
2984
  try {
2930
2985
  return await a(T);
2931
2986
  } catch (w) {
2932
- throw w instanceof Error && Ks.test(w.message) ? new Bs(t, w) : w;
2987
+ throw w instanceof Error && Ns.test(w.message) ? new Rs(t, w) : w;
2933
2988
  }
2934
2989
  }
2935
- async function In(e) {
2990
+ async function Hn(e) {
2936
2991
  const { vaultId: t, vault: r, readers: o, network: s } = e, [n, a] = await Promise.all([
2937
2992
  Dt({
2938
2993
  vaultId: t,
@@ -2968,7 +3023,7 @@ async function In(e) {
2968
3023
  network: s
2969
3024
  };
2970
3025
  }
2971
- class ht extends Error {
3026
+ class dt extends Error {
2972
3027
  constructor(r, o, s) {
2973
3028
  super(r);
2974
3029
  /** Fee the reclaim would have paid, in satoshis. */
@@ -2978,11 +3033,11 @@ class ht extends Error {
2978
3033
  this.name = "ReclaimUneconomicalError", this.feeSats = o, this.sweptTotalSats = s;
2979
3034
  }
2980
3035
  }
2981
- const pt = 2e3, gt = 25n, ft = 100n, Vn = 10n;
2982
- async function Ns(e, t, r) {
3036
+ const ht = 2e3, gt = 25n, ft = 100n, On = 10n;
3037
+ async function Ms(e, t, r) {
2983
3038
  for (let o = 0; o < e.length; o++) {
2984
- const s = Zr(e[o].depositorSignedPeginTxHex), n = Ie(
2985
- await mr(
3039
+ const s = to(e[o].depositorSignedPeginTxHex), n = Ie(
3040
+ await wr(
2986
3041
  P(s),
2987
3042
  P(r)
2988
3043
  )
@@ -2993,7 +3048,7 @@ async function Ns(e, t, r) {
2993
3048
  );
2994
3049
  }
2995
3050
  }
2996
- async function Rn(e) {
3051
+ async function Nn(e) {
2997
3052
  const {
2998
3053
  vaultIds: t,
2999
3054
  depositorEthAddress: r,
@@ -3008,9 +3063,9 @@ async function Rn(e) {
3008
3063
  throw new Error("Reclaim requires at least one vault id; got none.");
3009
3064
  if (!Number.isFinite(n) || n <= 0)
3010
3065
  throw new Error(`feeRate must be a positive number, got ${n}`);
3011
- if (n > pt)
3012
- throw new ht(
3013
- `Fee rate ${n} sat/vB exceeds the reclaim safety cap of ${pt} sat/vB; refusing to sign.`,
3066
+ if (n > ht)
3067
+ throw new dt(
3068
+ `Fee rate ${n} sat/vB exceeds the reclaim safety cap of ${ht} sat/vB; refusing to sign.`,
3014
3069
  0n,
3015
3070
  0n
3016
3071
  );
@@ -3019,36 +3074,36 @@ async function Rn(e) {
3019
3074
  throw new Error(
3020
3075
  `readVaults returned ${l.length} reserves for ${t.length} vault id(s); refusing to sweep a set that does not match the request.`
3021
3076
  );
3022
- await Ns(l, t, r), u == null || u.throwIfAborted();
3023
- const c = pe(o), h = l.map((v) => ({
3077
+ await Ms(l, t, r), u == null || u.throwIfAborted();
3078
+ const c = he(o), d = l.map((v) => ({
3024
3079
  depositorSignedPeginTxHex: v.depositorSignedPeginTxHex,
3025
3080
  observed: v.observed,
3026
3081
  expectedValue: v.expectedClaimValue
3027
- })), d = Yr(n, h.length), g = h.reduce((v, E) => v + E.expectedValue, 0n), p = g * gt / ft;
3028
- if (d > p)
3029
- throw new ht(
3030
- `Reclaim fee ${d} sats exceeds ${gt}/${ft} of the swept total (${g} sats, cap ${p} sats). The reserve is not at risk — it stays where it is until fee rates fall.`,
3031
- d,
3082
+ })), p = Jr(n, d.length), g = d.reduce((v, E) => v + E.expectedValue, 0n), h = g * gt / ft;
3083
+ if (p > h)
3084
+ throw new dt(
3085
+ `Reclaim fee ${p} sats exceeds ${gt}/${ft} of the swept total (${g} sats, cap ${h} sats). The reserve is not at risk — it stays where it is until fee rates fall.`,
3086
+ p,
3032
3087
  g
3033
3088
  );
3034
3089
  u == null || u.throwIfAborted();
3035
- const { psbtHex: y } = Qr({
3090
+ const { psbtHex: y } = Zr({
3036
3091
  depositorPubkey: c,
3037
- inputs: h,
3038
- feeSats: d
3092
+ inputs: d,
3093
+ feeSats: p
3039
3094
  });
3040
3095
  u == null || u.throwIfAborted();
3041
3096
  const f = ce(
3042
3097
  o,
3043
- h.length
3044
- ), b = await a(y, f);
3098
+ d.length
3099
+ ), m = await a(y, f);
3045
3100
  ae({
3046
3101
  requestedPsbtHex: y,
3047
- returnedPsbtHex: b
3102
+ returnedPsbtHex: m
3048
3103
  });
3049
- const $ = h.map((v, E) => {
3104
+ const $ = d.map((v, E) => {
3050
3105
  const T = ue(
3051
- b,
3106
+ m,
3052
3107
  c,
3053
3108
  E
3054
3109
  );
@@ -3066,81 +3121,84 @@ async function Rn(e) {
3066
3121
  return u == null || u.throwIfAborted(), i(x);
3067
3122
  }
3068
3123
  export {
3069
- Sn as $,
3124
+ Bn as $,
3070
3125
  K as A,
3071
- fn as B,
3072
- co as C,
3073
- U as D,
3074
- is as E,
3075
- yn as F,
3076
- m as G,
3077
- gs as H,
3078
- vn as I,
3126
+ Pn as B,
3127
+ po as C,
3128
+ F as D,
3129
+ us as E,
3130
+ mn as F,
3131
+ b as G,
3132
+ ys as H,
3133
+ bn as I,
3079
3134
  Se as J,
3080
- bn as K,
3081
- mn as L,
3082
- wn as M,
3083
- xn as N,
3084
- $n as O,
3085
- ho as P,
3086
- kn as Q,
3087
- En as R,
3135
+ xn as K,
3136
+ En as L,
3137
+ kn as M,
3138
+ $n as N,
3139
+ _n as O,
3140
+ go as P,
3141
+ Tn as Q,
3142
+ Cn as R,
3088
3143
  Y as S,
3089
- Cs as T,
3090
- Ts as U,
3091
- yo as V,
3144
+ _s as T,
3145
+ Ss as U,
3146
+ Po as V,
3092
3147
  Wt as W,
3093
- Cn as X,
3094
- Tn as Y,
3095
- Yt as Z,
3096
- _n as _,
3097
- nn as a,
3098
- zt as a0,
3099
- Pn as a1,
3100
- $e as a2,
3101
- ks as a3,
3102
- nt as a4,
3103
- Dt as a5,
3104
- qo as a6,
3105
- Nt as a7,
3106
- Bs as a8,
3107
- Bn as a9,
3108
- An as aa,
3109
- dt as ab,
3110
- lt as ac,
3111
- ct as ad,
3112
- Jt as ae,
3113
- In as af,
3114
- ht as ag,
3115
- Rn as ah,
3116
- ft as ai,
3117
- gt as aj,
3118
- pt as ak,
3119
- Vn as al,
3120
- an as b,
3121
- un as c,
3122
- ln as d,
3123
- Ao as e,
3124
- ao as f,
3125
- lo as g,
3126
- dn as h,
3127
- po as i,
3148
+ Yt as X,
3149
+ Vs as Y,
3150
+ Sn as Z,
3151
+ An as _,
3152
+ cn as a,
3153
+ Qt as a0,
3154
+ In as a1,
3155
+ Vn as a2,
3156
+ zt as a3,
3157
+ wn as a4,
3158
+ $e as a5,
3159
+ Cs as a6,
3160
+ nt as a7,
3161
+ Dt as a8,
3162
+ Xo as a9,
3163
+ Nt as aa,
3164
+ Rs as ab,
3165
+ Kn as ac,
3166
+ Rn as ad,
3167
+ pt as ae,
3168
+ lt as af,
3169
+ ct as ag,
3170
+ Zt as ah,
3171
+ Hn as ai,
3172
+ dt as aj,
3173
+ Nn as ak,
3174
+ ft as al,
3175
+ gt as am,
3176
+ ht as an,
3177
+ On as ao,
3178
+ ln as b,
3179
+ pn as c,
3180
+ hn as d,
3181
+ Io as e,
3182
+ co as f,
3183
+ ho as g,
3184
+ gn as h,
3185
+ fo as i,
3128
3186
  ne as j,
3129
- fo as k,
3130
- bo as l,
3131
- cn as m,
3132
- Io as n,
3133
- No as o,
3134
- To as p,
3135
- Ro as q,
3136
- hn as r,
3137
- xo as s,
3187
+ vo as k,
3188
+ wo as l,
3189
+ dn as m,
3190
+ Ro as n,
3191
+ Lo as o,
3192
+ So as p,
3193
+ Ho as q,
3194
+ fn as r,
3195
+ ko as s,
3138
3196
  St as t,
3139
- Go as u,
3197
+ zo as u,
3140
3198
  Lt as v,
3141
3199
  Mt as w,
3142
- Wo as x,
3143
- pn as y,
3144
- gn as z
3200
+ Qo as x,
3201
+ yn as y,
3202
+ vn as z
3145
3203
  };
3146
- //# sourceMappingURL=buildAndBroadcastReclaim-rUsFRC5H.js.map
3204
+ //# sourceMappingURL=buildAndBroadcastReclaim-Acz637Vf.js.map