@babylonlabs-io/ts-sdk 0.52.0 → 0.53.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 (132) hide show
  1. package/dist/ApplicationRegistry.abi-CLaa6E99.cjs +2 -0
  2. package/dist/ApplicationRegistry.abi-CLaa6E99.cjs.map +1 -0
  3. package/dist/{ApplicationRegistry.abi-Dn2qk6JG.js → ApplicationRegistry.abi-w5prf7Ig.js} +14 -1
  4. package/dist/ApplicationRegistry.abi-w5prf7Ig.js.map +1 -0
  5. package/dist/PayoutManager-1GWmbvI9.cjs +2 -0
  6. package/dist/PayoutManager-1GWmbvI9.cjs.map +1 -0
  7. package/dist/{PayoutManager-BwrV3xFW.js → PayoutManager-Ddo9_Ozc.js} +34 -32
  8. package/dist/PayoutManager-Ddo9_Ozc.js.map +1 -0
  9. package/dist/{PeginManager-BGWNJYPk.js → PeginManager-CTU0wgkJ.js} +37 -34
  10. package/dist/PeginManager-CTU0wgkJ.js.map +1 -0
  11. package/dist/PeginManager-De-eHl3v.cjs +2 -0
  12. package/dist/PeginManager-De-eHl3v.cjs.map +1 -0
  13. package/dist/buildAndBroadcastRefund-BnD2qUDW.cjs +2 -0
  14. package/dist/buildAndBroadcastRefund-BnD2qUDW.cjs.map +1 -0
  15. package/dist/{buildAndBroadcastRefund-BAT5A6MP.js → buildAndBroadcastRefund-DjS9nf87.js} +188 -177
  16. package/dist/buildAndBroadcastRefund-DjS9nf87.js.map +1 -0
  17. package/dist/{challengeAssert-HNbugpqL.cjs → challengeAssert-DLQfNcfU.cjs} +2 -2
  18. package/dist/{challengeAssert-HNbugpqL.cjs.map → challengeAssert-DLQfNcfU.cjs.map} +1 -1
  19. package/dist/{challengeAssert-csvYXBJB.js → challengeAssert-DvdbpEDY.js} +2 -2
  20. package/dist/{challengeAssert-csvYXBJB.js.map → challengeAssert-DvdbpEDY.js.map} +1 -1
  21. package/dist/constants-BhclpREj.js +19 -0
  22. package/dist/constants-BhclpREj.js.map +1 -0
  23. package/dist/constants-CvbARMl-.cjs +2 -0
  24. package/dist/constants-CvbARMl-.cjs.map +1 -0
  25. package/dist/index.cjs +1 -1
  26. package/dist/index.js +182 -181
  27. package/dist/index.js.map +1 -1
  28. package/dist/{mempoolApi-Dc1KSVNI.js → mempoolApi-CB7bHuwi.js} +106 -101
  29. package/dist/mempoolApi-CB7bHuwi.js.map +1 -0
  30. package/dist/mempoolApi-DqJByvqR.cjs +2 -0
  31. package/dist/mempoolApi-DqJByvqR.cjs.map +1 -0
  32. package/dist/noPayout-8dDKwi6n.cjs +2 -0
  33. package/dist/noPayout-8dDKwi6n.cjs.map +1 -0
  34. package/dist/{noPayout-DVx3zxUz.js → noPayout-tZFoNun3.js} +30 -30
  35. package/dist/noPayout-tZFoNun3.js.map +1 -0
  36. package/dist/{peginInput-B5XDDHpy.js → peginInput-BKD_b3gq.js} +10 -11
  37. package/dist/peginInput-BKD_b3gq.js.map +1 -0
  38. package/dist/{peginInput-De0C6aSj.cjs → peginInput-CAiiDZeO.cjs} +2 -2
  39. package/dist/peginInput-CAiiDZeO.cjs.map +1 -0
  40. package/dist/primeVpAuth-CF4cH5_e.cjs +2 -0
  41. package/dist/primeVpAuth-CF4cH5_e.cjs.map +1 -0
  42. package/dist/{primeVpAuth-DxMuWQCi.js → primeVpAuth-l-5x_2UV.js} +91 -85
  43. package/dist/{primeVpAuth-yTddDmGy.cjs.map → primeVpAuth-l-5x_2UV.js.map} +1 -1
  44. package/dist/tbv/core/clients/eth/protocol-params-reader.d.ts.map +1 -1
  45. package/dist/tbv/core/clients/eth/protocol-params-validation.d.ts.map +1 -1
  46. package/dist/tbv/core/clients/eth/types.d.ts +8 -0
  47. package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
  48. package/dist/tbv/core/clients/index.cjs +1 -1
  49. package/dist/tbv/core/clients/index.js +2 -2
  50. package/dist/tbv/core/contracts/abis/ProtocolParams.abi.d.ts +10 -0
  51. package/dist/tbv/core/contracts/abis/ProtocolParams.abi.d.ts.map +1 -1
  52. package/dist/tbv/core/contracts/index.cjs +1 -1
  53. package/dist/tbv/core/contracts/index.js +1 -1
  54. package/dist/tbv/core/index.cjs +1 -1
  55. package/dist/tbv/core/index.js +177 -176
  56. package/dist/tbv/core/index.js.map +1 -1
  57. package/dist/tbv/core/managers/PayoutManager.d.ts +6 -0
  58. package/dist/tbv/core/managers/PayoutManager.d.ts.map +1 -1
  59. package/dist/tbv/core/managers/PeginManager.d.ts +7 -0
  60. package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
  61. package/dist/tbv/core/managers/index.cjs +1 -1
  62. package/dist/tbv/core/managers/index.js +2 -2
  63. package/dist/tbv/core/primitives/__tests__/vaultCoreVersion.test.d.ts +8 -0
  64. package/dist/tbv/core/primitives/__tests__/vaultCoreVersion.test.d.ts.map +1 -0
  65. package/dist/tbv/core/primitives/index.cjs +1 -1
  66. package/dist/tbv/core/primitives/index.d.ts +1 -1
  67. package/dist/tbv/core/primitives/index.d.ts.map +1 -1
  68. package/dist/tbv/core/primitives/index.js +37 -36
  69. package/dist/tbv/core/primitives/index.js.map +1 -1
  70. package/dist/tbv/core/primitives/psbt/assertWasmPeginSizing.d.ts.map +1 -1
  71. package/dist/tbv/core/primitives/psbt/payout.d.ts +6 -0
  72. package/dist/tbv/core/primitives/psbt/payout.d.ts.map +1 -1
  73. package/dist/tbv/core/primitives/psbt/pegin.d.ts +7 -0
  74. package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
  75. package/dist/tbv/core/primitives/psbt/peginInput.d.ts +6 -0
  76. package/dist/tbv/core/primitives/psbt/peginInput.d.ts.map +1 -1
  77. package/dist/tbv/core/primitives/psbt/refund.d.ts.map +1 -1
  78. package/dist/tbv/core/primitives/scripts/payout.d.ts +6 -0
  79. package/dist/tbv/core/primitives/scripts/payout.d.ts.map +1 -1
  80. package/dist/tbv/core/primitives/vaultCoreVersion.d.ts +26 -0
  81. package/dist/tbv/core/primitives/vaultCoreVersion.d.ts.map +1 -0
  82. package/dist/tbv/core/services/deposit/runDepositorPresignFlow.d.ts +7 -0
  83. package/dist/tbv/core/services/deposit/runDepositorPresignFlow.d.ts.map +1 -1
  84. package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts +6 -0
  85. package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts.map +1 -1
  86. package/dist/tbv/core/services/deposit/verifyRegisteredVaultVersions.d.ts +8 -0
  87. package/dist/tbv/core/services/deposit/verifyRegisteredVaultVersions.d.ts.map +1 -1
  88. package/dist/tbv/core/services/index.cjs +1 -1
  89. package/dist/tbv/core/services/index.js +2 -2
  90. package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts +6 -0
  91. package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts.map +1 -1
  92. package/dist/tbv/index.cjs +1 -1
  93. package/dist/tbv/index.js +177 -176
  94. package/dist/tbv/index.js.map +1 -1
  95. package/dist/{verifyScriptPathSchnorrSignature-BKECXOpa.js → verifyScriptPathSchnorrSignature-DpWZx5J0.js} +125 -130
  96. package/dist/verifyScriptPathSchnorrSignature-DpWZx5J0.js.map +1 -0
  97. package/dist/verifyScriptPathSchnorrSignature-a4Us7D3e.cjs +2 -0
  98. package/dist/verifyScriptPathSchnorrSignature-a4Us7D3e.cjs.map +1 -0
  99. package/package.json +3 -3
  100. package/dist/ApplicationRegistry.abi-BAPhJch3.cjs +0 -2
  101. package/dist/ApplicationRegistry.abi-BAPhJch3.cjs.map +0 -1
  102. package/dist/ApplicationRegistry.abi-Dn2qk6JG.js.map +0 -1
  103. package/dist/PayoutManager-BwrV3xFW.js.map +0 -1
  104. package/dist/PayoutManager-CBfHfLfz.cjs +0 -2
  105. package/dist/PayoutManager-CBfHfLfz.cjs.map +0 -1
  106. package/dist/PeginManager-BGWNJYPk.js.map +0 -1
  107. package/dist/PeginManager-DDp-ZRIa.cjs +0 -2
  108. package/dist/PeginManager-DDp-ZRIa.cjs.map +0 -1
  109. package/dist/buildAndBroadcastRefund-3MLyCOtv.cjs +0 -2
  110. package/dist/buildAndBroadcastRefund-3MLyCOtv.cjs.map +0 -1
  111. package/dist/buildAndBroadcastRefund-BAT5A6MP.js.map +0 -1
  112. package/dist/constants-CSG2XeD8.cjs +0 -2
  113. package/dist/constants-CSG2XeD8.cjs.map +0 -1
  114. package/dist/constants-Cd_fN8VT.js +0 -12
  115. package/dist/constants-Cd_fN8VT.js.map +0 -1
  116. package/dist/mempoolApi-Dc1KSVNI.js.map +0 -1
  117. package/dist/mempoolApi-NMiYQAXI.cjs +0 -2
  118. package/dist/mempoolApi-NMiYQAXI.cjs.map +0 -1
  119. package/dist/noPayout-ChPNKTbm.cjs +0 -2
  120. package/dist/noPayout-ChPNKTbm.cjs.map +0 -1
  121. package/dist/noPayout-DVx3zxUz.js.map +0 -1
  122. package/dist/peginInput-B5XDDHpy.js.map +0 -1
  123. package/dist/peginInput-De0C6aSj.cjs.map +0 -1
  124. package/dist/primeVpAuth-DxMuWQCi.js.map +0 -1
  125. package/dist/primeVpAuth-yTddDmGy.cjs +0 -2
  126. package/dist/tbv/core/primitives/__tests__/txGraphVersion.test.d.ts +0 -7
  127. package/dist/tbv/core/primitives/__tests__/txGraphVersion.test.d.ts.map +0 -1
  128. package/dist/tbv/core/primitives/txGraphVersion.d.ts +0 -11
  129. package/dist/tbv/core/primitives/txGraphVersion.d.ts.map +0 -1
  130. package/dist/verifyScriptPathSchnorrSignature-BKECXOpa.js.map +0 -1
  131. package/dist/verifyScriptPathSchnorrSignature-CVPh04ZI.cjs +0 -2
  132. package/dist/verifyScriptPathSchnorrSignature-CVPh04ZI.cjs.map +0 -1
@@ -1,16 +1,17 @@
1
1
  var J = Object.defineProperty;
2
2
  var Z = (e, r, t) => r in e ? J(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
- var R = (e, r, t) => Z(e, typeof r != "symbol" ? r + "" : r, t);
3
+ var $ = (e, r, t) => Z(e, typeof r != "symbol" ? r + "" : r, t);
4
4
  import { B as ee } from "./BTCVaultRegistry.abi-Chs4AFBj.js";
5
5
  import { e as te, v as re, s as p, u as X, p as A, f as E } from "./bitcoin-B5aNKtsk.js";
6
- import { v as ne, P as oe, f as ae } from "./PayoutManager-BwrV3xFW.js";
6
+ import { v as ne, P as oe, f as ae } from "./PayoutManager-Ddo9_Ozc.js";
7
7
  import { D as w, c as se, a as ie, R as ue, d as z } from "./types-CQDRQvV-.js";
8
- import { Transaction as C, Psbt as le } from "bitcoinjs-lib";
9
- import { c as ce, d as V, e as N, f as H, T as he } from "./verifyScriptPathSchnorrSignature-BKECXOpa.js";
10
- import { c as de, a as pe, b as ge } from "./noPayout-DVx3zxUz.js";
8
+ import { Transaction as S, Psbt as le } from "bitcoinjs-lib";
9
+ import { c as ce, d as I, e as N, f as H } from "./verifyScriptPathSchnorrSignature-DpWZx5J0.js";
10
+ import { c as he, a as de, b as pe } from "./noPayout-tZFoNun3.js";
11
11
  import { c as O } from "./signing-DaLvGwQe.js";
12
+ import { a as ge } from "./constants-BhclpREj.js";
12
13
  const fe = /^0x[0-9a-fA-F]{64}$/, me = /^0x[0-9a-fA-F]{40}$/, Pe = /^0x([0-9a-fA-F]{2})*$/;
13
- function $(e, r) {
14
+ function V(e, r) {
14
15
  if (e.length !== 66)
15
16
  throw new Error(
16
17
  `${r} must be 32 bytes (66 hex chars with 0x prefix), got length ${e.length}`
@@ -32,22 +33,22 @@ function ye(e, r) {
32
33
  `${r} must be a 0x-prefixed hex string with an even number of hex chars`
33
34
  );
34
35
  }
35
- async function it(e) {
36
+ async function ut(e) {
36
37
  const {
37
38
  btcVaultRegistryAddress: r,
38
39
  vaultId: t,
39
40
  hashlock: n,
40
41
  activationMetadata: s,
41
- writeContract: u,
42
+ writeContract: l,
42
43
  signal: a
43
44
  } = e;
44
- a == null || a.throwIfAborted(), be(r, "btcVaultRegistryAddress"), $(t, "vaultId");
45
+ a == null || a.throwIfAborted(), be(r, "btcVaultRegistryAddress"), V(t, "vaultId");
45
46
  const i = te(e.secret);
46
- if ($(i, "secret"), n !== void 0 && ($(n, "hashlock"), !ne(i, n)))
47
+ if (V(i, "secret"), n !== void 0 && (V(n, "hashlock"), !ne(i, n)))
47
48
  throw new Error(
48
49
  "Invalid secret: SHA256(secret) does not match the provided hashlock"
49
50
  );
50
- return ye(s, "activationMetadata"), u({
51
+ return ye(s, "activationMetadata"), l({
51
52
  address: r,
52
53
  abi: ee,
53
54
  functionName: "activateVaultWithSecret",
@@ -61,7 +62,7 @@ async function G(e) {
61
62
  peginTxid: t,
62
63
  targetStatuses: n,
63
64
  timeoutMs: s,
64
- pollIntervalMs: u = we,
65
+ pollIntervalMs: l = we,
65
66
  signal: a
66
67
  } = e, i = Date.now();
67
68
  for (; ; ) {
@@ -82,27 +83,27 @@ async function G(e) {
82
83
  throw new Error(
83
84
  `getPeginStatus returned status for pegin ${o.pegin_txid.slice(0, 8)}…, requested ${t.slice(0, 8)}…`
84
85
  );
85
- const l = o.status;
86
- if (n.has(l) || l === w.ACTIVATED)
87
- return l;
88
- if (l === w.EXPIRED || se.has(l))
86
+ const u = o.status;
87
+ if (n.has(u) || u === w.ACTIVATED)
88
+ return u;
89
+ if (u === w.EXPIRED || se.has(u))
89
90
  throw new Error(
90
- `Pegin ${t.slice(0, 8)}… reached terminal status "${l}" while waiting for ${[...n].join(", ")}`
91
+ `Pegin ${t.slice(0, 8)}… reached terminal status "${u}" while waiting for ${[...n].join(", ")}`
91
92
  );
92
93
  } catch (o) {
93
94
  if (!(o instanceof ie && o.code === ue.PEGIN_NOT_FOUND))
94
95
  throw o;
95
96
  }
96
- await new Promise((o, l) => {
97
+ await new Promise((o, u) => {
97
98
  const h = () => {
98
- clearTimeout(c), l(
99
+ clearTimeout(c), u(
99
100
  new Error(
100
101
  `Polling aborted for pegin ${t.slice(0, 8)}… (target: ${[...n].join(", ")})`
101
102
  )
102
103
  );
103
104
  }, c = setTimeout(() => {
104
105
  a == null || a.removeEventListener("abort", h), o();
105
- }, u);
106
+ }, l);
106
107
  a == null || a.addEventListener("abort", h, { once: !0 });
107
108
  });
108
109
  }
@@ -111,13 +112,13 @@ const xe = 300 * 1e3, ve = /* @__PURE__ */ new Set([
111
112
  w.PENDING_DEPOSITOR_WOTS_PK,
112
113
  ...z
113
114
  ]);
114
- async function ut(e) {
115
+ async function lt(e) {
115
116
  const {
116
117
  statusReader: r,
117
118
  wotsSubmitter: t,
118
119
  peginTxid: n,
119
120
  depositorPk: s,
120
- wotsPublicKeys: u,
121
+ wotsPublicKeys: l,
121
122
  timeoutMs: a = xe,
122
123
  signal: i
123
124
  } = e;
@@ -133,14 +134,14 @@ async function ut(e) {
133
134
  {
134
135
  pegin_txid: n,
135
136
  depositor_pk: s,
136
- wots_public_keys: u
137
+ wots_public_keys: l
137
138
  },
138
139
  i
139
140
  ));
140
141
  }
141
142
  const K = 1, Ee = 1;
142
143
  function Te(e, r) {
143
- const t = p(r).toLowerCase(), s = e.map((u) => p(u).toLowerCase()).filter((u) => u !== t);
144
+ const t = p(r).toLowerCase(), s = e.map((l) => p(l).toLowerCase()).filter((l) => l !== t);
144
145
  if (s.length === 0)
145
146
  throw new Error(
146
147
  "Cannot derive localChallengers: vault keeper set is empty (or contains only the depositor)"
@@ -159,28 +160,28 @@ function ke(e, r, t) {
159
160
  throw new Error(
160
161
  `Cannot validate challenger set: vault keepers and universal challengers overlap (${s.join(", ")})`
161
162
  );
162
- const u = [...r, ...n], a = e.map(
163
+ const l = [...r, ...n], a = e.map(
163
164
  (c) => p(c.challenger_pubkey).toLowerCase()
164
165
  ), i = new Set(a);
165
166
  if (i.size !== a.length)
166
167
  throw new Error(
167
168
  "Depositor graph contains duplicate challenger entries in challenger_presign_data"
168
169
  );
169
- const o = new Set(u), l = u.filter((c) => !i.has(c)), h = a.filter((c) => !o.has(c));
170
- if (l.length > 0 || h.length > 0)
170
+ const o = new Set(l), u = l.filter((c) => !i.has(c)), h = a.filter((c) => !o.has(c));
171
+ if (u.length > 0 || h.length > 0)
171
172
  throw new Error(
172
- "Depositor graph challenger set does not match expected (local ∪ universal)" + (l.length > 0 ? ` (missing: ${l.join(", ")})` : "") + (h.length > 0 ? ` (unexpected: ${h.join(", ")})` : "")
173
+ "Depositor graph challenger set does not match expected (local ∪ universal)" + (u.length > 0 ? ` (missing: ${u.join(", ")})` : "") + (h.length > 0 ? ` (unexpected: ${h.join(", ")})` : "")
173
174
  );
174
175
  }
175
176
  function _e(e, r) {
176
177
  const t = e.ins[r];
177
178
  return X(new Uint8Array(t.hash).slice().reverse());
178
179
  }
179
- function B(e, r, t, n, s) {
180
- const u = e.ins[r];
181
- if (u.index !== 0)
180
+ function R(e, r, t, n, s) {
181
+ const l = e.ins[r];
182
+ if (l.index !== 0)
182
183
  throw new Error(
183
- `NoPayout (challenger ${s}) input ${r} expected to spend ${n} vout 0, got vout ${u.index}`
184
+ `NoPayout (challenger ${s}) input ${r} expected to spend ${n} vout 0, got vout ${l.index}`
184
185
  );
185
186
  const a = t.getId(), i = _e(e, r);
186
187
  if (i !== a)
@@ -188,8 +189,8 @@ function B(e, r, t, n, s) {
188
189
  `NoPayout (challenger ${s}) input ${r} does not reference ${n} (expected txid ${a}, got ${i})`
189
190
  );
190
191
  }
191
- async function Se(e, r, t) {
192
- const n = [], s = [], u = [], a = Te(
192
+ async function Ce(e, r, t) {
193
+ const n = [], s = [], l = [], a = Te(
193
194
  t.vaultKeeperBtcPubkeys,
194
195
  t.depositorBtcPubkey
195
196
  );
@@ -199,6 +200,7 @@ async function Se(e, r, t) {
199
200
  t.universalChallengerBtcPubkeys
200
201
  );
201
202
  const i = await ce({
203
+ vaultCoreVersion: t.vaultCoreVersion,
202
204
  payoutTxHex: e.payout_tx.tx_hex,
203
205
  peginTxHex: t.peginTxHex,
204
206
  assertTxHex: e.assert_tx.tx_hex,
@@ -218,16 +220,16 @@ async function Se(e, r, t) {
218
220
  K
219
221
  )
220
222
  );
221
- const o = p(t.depositorBtcPubkey), l = C.fromHex(
223
+ const o = p(t.depositorBtcPubkey), u = S.fromHex(
222
224
  p(e.assert_tx.tx_hex)
223
225
  );
224
226
  for (const h of e.challenger_presign_data) {
225
- const c = p(h.challenger_pubkey), d = n.length, P = await Ce({
227
+ const c = p(h.challenger_pubkey), d = n.length, P = await Se({
226
228
  challenger: h,
227
229
  challengerPubkey: c,
228
230
  claimerPubkey: o,
229
231
  localChallengers: a,
230
- assertTxParsed: l,
232
+ assertTxParsed: u,
231
233
  ctx: t
232
234
  });
233
235
  n.push(P), s.push(
@@ -235,71 +237,71 @@ async function Se(e, r, t) {
235
237
  r,
236
238
  K
237
239
  )
238
- ), u.push({
240
+ ), l.push({
239
241
  challengerPubkey: c,
240
242
  noPayoutIdx: d
241
243
  });
242
244
  }
243
- return { psbtHexes: n, signOptions: s, challengerEntries: u };
245
+ return { psbtHexes: n, signOptions: s, challengerEntries: l };
244
246
  }
245
- async function Ce(e) {
247
+ async function Se(e) {
246
248
  const {
247
249
  challenger: r,
248
250
  challengerPubkey: t,
249
251
  claimerPubkey: n,
250
252
  localChallengers: s,
251
- assertTxParsed: u,
253
+ assertTxParsed: l,
252
254
  ctx: a
253
255
  } = e;
254
- de(
256
+ he(
255
257
  r.nopayout_tx.tx_hex,
256
258
  t,
257
259
  a.network
258
260
  );
259
- const i = C.fromHex(
261
+ const i = S.fromHex(
260
262
  p(r.nopayout_tx.tx_hex)
261
- ), o = C.fromHex(
263
+ ), o = S.fromHex(
262
264
  p(r.challenge_assert_x_tx.tx_hex)
263
- ), l = C.fromHex(
265
+ ), u = S.fromHex(
264
266
  p(r.challenge_assert_y_tx.tx_hex)
265
267
  );
266
268
  if (i.ins.length !== 3)
267
269
  throw new Error(
268
270
  `NoPayout (challenger ${t}) must have exactly 3 inputs, got ${i.ins.length}`
269
271
  );
270
- B(
272
+ R(
271
273
  i,
272
274
  0,
273
- u,
275
+ l,
274
276
  "Assert",
275
277
  t
276
- ), B(
278
+ ), R(
277
279
  i,
278
280
  1,
279
281
  o,
280
282
  "ChallengeAssertX",
281
283
  t
282
- ), B(
284
+ ), R(
283
285
  i,
284
286
  2,
285
- l,
287
+ u,
286
288
  "ChallengeAssertY",
287
289
  t
288
290
  );
289
291
  const h = [
290
- u.outs[0],
292
+ l.outs[0],
291
293
  o.outs[0],
292
- l.outs[0]
294
+ u.outs[0]
293
295
  ].map((c) => ({
294
296
  script_pubkey: X(new Uint8Array(c.script)),
295
297
  value: c.value
296
298
  }));
297
- return pe({
299
+ return de({
298
300
  noPayoutTxHex: r.nopayout_tx.tx_hex,
299
301
  challengerPubkey: t,
300
302
  prevouts: h,
301
303
  connectorParams: {
302
- txGraphVersion: he,
304
+ txGraphVersion: a.vaultCoreVersion,
303
305
  claimer: n,
304
306
  localChallengers: s,
305
307
  universalChallengers: a.universalChallengerBtcPubkeys,
@@ -310,7 +312,7 @@ async function Ce(e) {
310
312
  });
311
313
  }
312
314
  function Ae(e, r, t) {
313
- V(e[0]);
315
+ I(e[0]);
314
316
  const s = N(
315
317
  e[0].returnedPsbtHex,
316
318
  t
@@ -321,9 +323,9 @@ function Ae(e, r, t) {
321
323
  signerXOnlyPubkeyHex: t,
322
324
  inputIndex: 0
323
325
  });
324
- const u = {};
326
+ const l = {};
325
327
  for (const a of r) {
326
- V(e[a.noPayoutIdx]);
328
+ I(e[a.noPayoutIdx]);
327
329
  const i = N(
328
330
  e[a.noPayoutIdx].returnedPsbtHex,
329
331
  t
@@ -333,7 +335,7 @@ function Ae(e, r, t) {
333
335
  signatureHex: i,
334
336
  signerXOnlyPubkeyHex: t,
335
337
  inputIndex: 0
336
- }), u[a.challengerPubkey] = {
338
+ }), l[a.challengerPubkey] = {
337
339
  nopayout_signature: i
338
340
  };
339
341
  }
@@ -341,10 +343,10 @@ function Ae(e, r, t) {
341
343
  payout_signatures: {
342
344
  payout_signature: s
343
345
  },
344
- per_challenger: u
346
+ per_challenger: l
345
347
  };
346
348
  }
347
- async function Re(e, r, t) {
349
+ async function $e(e, r, t) {
348
350
  if (typeof e.signPsbts == "function")
349
351
  return e.signPsbts(r, t);
350
352
  const n = [];
@@ -352,43 +354,43 @@ async function Re(e, r, t) {
352
354
  n.push(await e.signPsbt(r[s], t == null ? void 0 : t[s]));
353
355
  return n;
354
356
  }
355
- async function $e(e) {
356
- const { depositorGraph: r, btcWallet: t, signingContext: n } = e, s = await t.getPublicKeyHex(), { depositorPubkey: u } = re(
357
+ async function Ve(e) {
358
+ const { depositorGraph: r, btcWallet: t, signingContext: n } = e, s = await t.getPublicKeyHex(), { depositorPubkey: l } = re(
357
359
  s,
358
360
  p(n.depositorBtcPubkey)
359
- ), { psbtHexes: a, signOptions: i, challengerEntries: o } = await Se(
361
+ ), { psbtHexes: a, signOptions: i, challengerEntries: o } = await Ce(
360
362
  r,
361
363
  s,
362
364
  n
363
- ), l = await Re(
365
+ ), u = await $e(
364
366
  t,
365
367
  a,
366
368
  i
367
369
  );
368
- if (l.length !== a.length)
370
+ if (u.length !== a.length)
369
371
  throw new Error(
370
- `Wallet returned ${l.length} signed PSBTs, expected ${a.length}`
372
+ `Wallet returned ${u.length} signed PSBTs, expected ${a.length}`
371
373
  );
372
374
  const h = a.map((c, d) => ({
373
375
  requestedPsbtHex: c,
374
- returnedPsbtHex: l[d]
376
+ returnedPsbtHex: u[d]
375
377
  }));
376
378
  return Ae(
377
379
  h,
378
380
  o,
379
- u
381
+ l
380
382
  );
381
383
  }
382
- const Be = 1200 * 1e3, q = /* @__PURE__ */ new Set([
384
+ const Re = 1200 * 1e3, q = /* @__PURE__ */ new Set([
383
385
  w.PENDING_ACKS,
384
386
  w.PENDING_ACTIVATION,
385
387
  w.ACTIVATED_PENDING_BROADCAST,
386
388
  w.ACTIVATED
387
- ]), Ie = /* @__PURE__ */ new Set([
389
+ ]), Be = /* @__PURE__ */ new Set([
388
390
  w.PENDING_DEPOSITOR_SIGNATURES,
389
391
  ...q
390
392
  ]);
391
- function Ve(e) {
393
+ function Ie(e) {
392
394
  return e.map((r) => ({
393
395
  claimerPubkeyXOnly: A(r.claimer_pubkey),
394
396
  payoutTxHex: r.payout_tx.tx_hex,
@@ -399,11 +401,11 @@ function _(e) {
399
401
  return A(e).toLowerCase();
400
402
  }
401
403
  function Ne(e, r, t, n) {
402
- const s = _(n), u = [
404
+ const s = _(n), l = [
403
405
  _(r),
404
406
  ...t.map(_)
405
- ], a = new Set(u);
406
- if (a.size !== u.length)
407
+ ], a = new Set(l);
408
+ if (a.size !== l.length)
407
409
  throw new Error(
408
410
  "Cannot validate claimer set: signing context contains duplicate vault provider or vault keeper key"
409
411
  );
@@ -418,7 +420,7 @@ function Ne(e, r, t, n) {
418
420
  throw new Error(
419
421
  "Presign response contains duplicate claimer entries"
420
422
  );
421
- const o = i.filter((d) => d !== s), l = new Set(o), h = u.filter((d) => !l.has(d)), c = o.filter((d) => !a.has(d));
423
+ const o = i.filter((d) => d !== s), u = new Set(o), h = l.filter((d) => !u.has(d)), c = o.filter((d) => !a.has(d));
422
424
  if (h.length > 0 || c.length > 0)
423
425
  throw new Error(
424
426
  "Presign response claimer set does not match expected (vault provider ∪ vault keepers)" + (h.length > 0 ? ` (missing: ${h.join(", ")})` : "") + (c.length > 0 ? ` (unexpected: ${c.join(", ")})` : "")
@@ -426,6 +428,7 @@ function Ne(e, r, t, n) {
426
428
  }
427
429
  function U(e, r) {
428
430
  return {
431
+ vaultCoreVersion: r.vaultCoreVersion,
429
432
  payoutTxHex: e.payoutTxHex,
430
433
  peginTxHex: r.peginTxHex,
431
434
  assertTxHex: e.assertTxHex,
@@ -443,21 +446,21 @@ async function He(e, r, t, n) {
443
446
  const s = new oe({
444
447
  network: r.network,
445
448
  btcWallet: e
446
- }), u = t.length;
447
- n == null || n(0, u);
449
+ }), l = t.length;
450
+ n == null || n(0, l);
448
451
  let a;
449
452
  if (s.supportsBatchSigning())
450
453
  a = (await s.signPayoutTransactionsBatch(
451
- t.map((l) => U(l, r))
452
- )).map((l) => l.payoutSignature);
454
+ t.map((u) => U(u, r))
455
+ )).map((u) => u.payoutSignature);
453
456
  else {
454
457
  a = [];
455
458
  for (let o = 0; o < t.length; o++) {
456
- n == null || n(o, u);
457
- const l = await s.signPayoutTransaction(
459
+ n == null || n(o, l);
460
+ const u = await s.signPayoutTransaction(
458
461
  U(t[o], r)
459
462
  );
460
- a.push(l.signature);
463
+ a.push(u.signature);
461
464
  }
462
465
  }
463
466
  const i = {};
@@ -465,23 +468,23 @@ async function He(e, r, t, n) {
465
468
  i[t[o].claimerPubkeyXOnly] = {
466
469
  payout_signature: a[o]
467
470
  };
468
- return n == null || n(u, u), i;
471
+ return n == null || n(l, l), i;
469
472
  }
470
- async function lt(e) {
473
+ async function ct(e) {
471
474
  const {
472
475
  statusReader: r,
473
476
  presignClient: t,
474
477
  btcWallet: n,
475
478
  peginTxid: s,
476
- depositorPk: u,
479
+ depositorPk: l,
477
480
  signingContext: a,
478
- timeoutMs: i = Be,
481
+ timeoutMs: i = Re,
479
482
  signal: o,
480
- onProgress: l
483
+ onProgress: u
481
484
  } = e, h = await G({
482
485
  statusReader: r,
483
486
  peginTxid: s,
484
- targetStatuses: Ie,
487
+ targetStatuses: Be,
485
488
  timeoutMs: i,
486
489
  signal: o
487
490
  });
@@ -491,33 +494,34 @@ async function lt(e) {
491
494
  const c = await t.requestDepositorPresignTransactions(
492
495
  {
493
496
  pegin_txid: s,
494
- depositor_pk: u
497
+ depositor_pk: l
495
498
  },
496
499
  o
497
500
  );
498
501
  o == null || o.throwIfAborted();
499
- const d = _(u);
502
+ const d = _(l);
500
503
  Ne(
501
504
  c.txs,
502
505
  a.vaultProviderBtcPubkey,
503
506
  a.vaultKeeperBtcPubkeys,
504
- u
507
+ l
505
508
  );
506
509
  const P = c.txs.filter(
507
510
  (v) => _(v.claimer_pubkey) !== d
508
- ), m = Ve(P), y = await He(
511
+ ), m = Ie(P), y = await He(
509
512
  n,
510
513
  a,
511
514
  m,
512
- l
515
+ u
513
516
  );
514
517
  o == null || o.throwIfAborted();
515
- const x = await $e({
518
+ const x = await Ve({
516
519
  depositorGraph: c.depositor_graph,
517
520
  btcWallet: n,
518
521
  signingContext: {
522
+ vaultCoreVersion: a.vaultCoreVersion,
519
523
  peginTxHex: a.peginTxHex,
520
- depositorBtcPubkey: u,
524
+ depositorBtcPubkey: l,
521
525
  vaultProviderBtcPubkey: a.vaultProviderBtcPubkey,
522
526
  vaultKeeperBtcPubkeys: a.vaultKeeperBtcPubkeys,
523
527
  universalChallengerBtcPubkeys: a.universalChallengerBtcPubkeys,
@@ -531,10 +535,10 @@ async function lt(e) {
531
535
  });
532
536
  o == null || o.throwIfAborted();
533
537
  const b = { ...y };
534
- b[p(u)] = x.payout_signatures, await t.submitDepositorPresignatures(
538
+ b[p(l)] = x.payout_signatures, await t.submitDepositorPresignatures(
535
539
  {
536
540
  pegin_txid: s,
537
- depositor_pk: u,
541
+ depositor_pk: l,
538
542
  signatures: b,
539
543
  depositor_claimer_presignatures: x
540
544
  },
@@ -544,18 +548,18 @@ async function lt(e) {
544
548
  function Oe(e) {
545
549
  return /^[0-9a-fA-F]{64}$/.test(e);
546
550
  }
547
- function ct(e) {
551
+ function ht(e) {
548
552
  const {
549
553
  amountSats: r,
550
554
  minDeposit: t,
551
555
  maxDeposit: n,
552
556
  btcBalance: s,
553
- estimatedFeeSats: u,
557
+ estimatedFeeSats: l,
554
558
  depositorClaimValue: a
555
559
  } = e;
556
- return !(r <= 0n || r < t || n && n > 0n && r > n || u == null || a == null || r + u + a > s);
560
+ return !(r <= 0n || r < t || n && n > 0n && r > n || l == null || a == null || r + l + a > s);
557
561
  }
558
- function ht(e, r, t) {
562
+ function dt(e, r, t) {
559
563
  return e <= 0n ? {
560
564
  valid: !1,
561
565
  error: "Deposit amount must be greater than zero"
@@ -567,7 +571,7 @@ function ht(e, r, t) {
567
571
  error: `Maximum deposit is ${E(t)} BTC`
568
572
  } : { valid: !0 };
569
573
  }
570
- function dt(e) {
574
+ function pt(e) {
571
575
  const { amount: r, effectiveRemaining: t } = e;
572
576
  return t === null ? { valid: !0 } : t === 0n ? {
573
577
  valid: !1,
@@ -577,7 +581,7 @@ function dt(e) {
577
581
  error: `Vault size exceeds remaining capacity (${E(t)} BTC)`
578
582
  } : { valid: !0 };
579
583
  }
580
- function pt(e, r) {
584
+ function gt(e, r) {
581
585
  if (!e || e.length === 0)
582
586
  return {
583
587
  valid: !1,
@@ -642,13 +646,13 @@ function Me(e) {
642
646
  if (e.length === 0)
643
647
  throw new Error("No spendable UTXOs available");
644
648
  }
645
- function gt(e) {
649
+ function ft(e) {
646
650
  const {
647
651
  vaultAmounts: r,
648
652
  confirmedUTXOs: t,
649
653
  vaultProviderBtcPubkey: n,
650
654
  vaultKeeperBtcPubkeys: s,
651
- universalChallengerBtcPubkeys: u,
655
+ universalChallengerBtcPubkeys: l,
652
656
  minDeposit: a,
653
657
  maxDeposit: i
654
658
  } = e, o = De(
@@ -658,58 +662,58 @@ function gt(e) {
658
662
  );
659
663
  if (!o.valid)
660
664
  throw new Error(o.error);
661
- const l = Ke(n);
662
- if (!l.valid)
663
- throw new Error(l.error);
664
- Ue(s), Fe(u), Me(t);
665
+ const u = Ke(n);
666
+ if (!u.valid)
667
+ throw new Error(u.error);
668
+ Ue(s), Fe(l), Me(t);
665
669
  }
666
- async function ft(e) {
670
+ async function mt(e) {
667
671
  const {
668
672
  vaultRegistryReader: r,
669
673
  vaultKeeperReader: t,
670
674
  universalChallengerReader: n,
671
675
  vaultProviderEthAddress: s,
672
- applicationEntryPoint: u,
676
+ applicationEntryPoint: l,
673
677
  expectedVaultProviderBtcPubkey: a,
674
678
  expectedVaultKeeperBtcPubkeys: i,
675
679
  expectedUniversalChallengerBtcPubkeys: o
676
680
  } = e, [
677
- l,
681
+ u,
678
682
  h,
679
683
  c
680
684
  ] = await Promise.all([
681
685
  r.getVaultProviderBtcPubKey(s),
682
- t.getCurrentVaultKeepersVersion(u),
686
+ t.getCurrentVaultKeepersVersion(l),
683
687
  n.getLatestUniversalChallengersVersion()
684
688
  ]), [d, P] = await Promise.all([
685
689
  t.getVaultKeepersByVersion(
686
- u,
690
+ l,
687
691
  h
688
692
  ),
689
693
  n.getUniversalChallengersByVersion(
690
694
  c
691
695
  )
692
696
  ]), m = (g) => A(g).toLowerCase(), y = (g) => g.map(m).sort();
693
- if (m(a) !== l)
697
+ if (m(a) !== u)
694
698
  throw new Error(
695
699
  `Vault provider BTC pubkey indexer hint does not match BTCVaultRegistry for ${s}. Refresh and try again.`
696
700
  );
697
701
  const b = y(i), v = y(
698
702
  d.map((g) => g.btcPubKey)
699
703
  );
700
- if (b.length !== v.length || b.some((g, S) => g !== v[S]))
704
+ if (b.length !== v.length || b.some((g, C) => g !== v[C]))
701
705
  throw new Error(
702
706
  `Vault keeper BTC pubkeys (v${h}) indexer set does not match ApplicationRegistry on-chain set. Refresh and try again.`
703
707
  );
704
708
  const T = y(o), k = y(
705
709
  P.map((g) => g.btcPubKey)
706
710
  );
707
- if (T.length !== k.length || T.some((g, S) => g !== k[S]))
711
+ if (T.length !== k.length || T.some((g, C) => g !== k[C]))
708
712
  throw new Error(
709
713
  `Universal challenger BTC pubkeys (v${c}) indexer set does not match ProtocolParams on-chain set. Refresh and try again.`
710
714
  );
711
715
  return {
712
- vaultProviderBtcPubkeyXOnly: l,
716
+ vaultProviderBtcPubkeyXOnly: u,
713
717
  vaultKeeperBtcPubkeysSorted: v,
714
718
  universalChallengerBtcPubkeysSorted: k,
715
719
  expectedAppVaultKeepersVersion: h,
@@ -721,29 +725,32 @@ class j extends Error {
721
725
  super(r), this.name = "RegisteredVaultVersionMismatchError";
722
726
  }
723
727
  }
724
- function mt(e) {
728
+ function Pt(e) {
725
729
  return e instanceof j || e instanceof Error && e.name === "RegisteredVaultVersionMismatchError";
726
730
  }
727
- async function Pt(e) {
731
+ async function bt(e) {
728
732
  const {
729
733
  vaultRegistryReader: r,
730
734
  vaultIds: t,
731
735
  expectedOffchainParamsVersion: n,
732
736
  expectedAppVaultKeepersVersion: s,
733
- expectedUniversalChallengersVersion: u
734
- } = e, a = await r.getProtocolInfoBatch(t), i = [];
735
- if (a.forEach((o, l) => {
736
- const h = t[l];
737
- o.offchainParamsVersion !== n && i.push(
738
- `vault ${h}: offchainParams expected v${n}, got v${o.offchainParamsVersion}`
739
- ), o.appVaultKeepersVersion !== s && i.push(
740
- `vault ${h}: appVaultKeepers expected v${s}, got v${o.appVaultKeepersVersion}`
741
- ), o.universalChallengersVersion !== u && i.push(
742
- `vault ${h}: universalChallengers expected v${u}, got v${o.universalChallengersVersion}`
743
- );
744
- }), i.length > 0)
737
+ expectedUniversalChallengersVersion: l,
738
+ expectedVaultCoreVersion: a
739
+ } = e, i = await r.getProtocolInfoBatch(t), o = [];
740
+ if (i.forEach((u, h) => {
741
+ const c = t[h];
742
+ u.offchainParamsVersion !== n && o.push(
743
+ `vault ${c}: offchainParams expected v${n}, got v${u.offchainParamsVersion}`
744
+ ), u.appVaultKeepersVersion !== s && o.push(
745
+ `vault ${c}: appVaultKeepers expected v${s}, got v${u.appVaultKeepersVersion}`
746
+ ), u.universalChallengersVersion !== l && o.push(
747
+ `vault ${c}: universalChallengers expected v${l}, got v${u.universalChallengersVersion}`
748
+ ), u.vaultCoreVersion !== a && o.push(
749
+ `vault ${c}: vaultCoreVersion expected v${a} (build-time active), got v${u.vaultCoreVersion}`
750
+ );
751
+ }), o.length > 0)
745
752
  throw new j(
746
- `Aborting BTC broadcast: signer-set or offchain-params versions changed during registration (${i.join("; ")}). The Pre-PegIn was not broadcast; the registered ETH vault will time out per protocol rules.`
753
+ `Aborting BTC broadcast: signer-set or offchain-params versions changed during registration (${o.join("; ")}). The Pre-PegIn was not broadcast; the registered ETH vault will time out per protocol rules.`
747
754
  );
748
755
  }
749
756
  var Q = /* @__PURE__ */ ((e) => (e.CLAIM_EVENT_RECEIVED = "ClaimEventReceived", e.CLAIM_BROADCAST = "ClaimBroadcast", e.ASSERT_BROADCAST = "AssertBroadcast", e.PAYOUT_BROADCAST = "PayoutBroadcast", e.PAYOUT_BLOCKED = "PayoutBlocked", e))(Q || {});
@@ -752,24 +759,24 @@ const Le = /* @__PURE__ */ new Set([
752
759
  "PayoutBlocked"
753
760
  /* PAYOUT_BLOCKED */
754
761
  ]);
755
- function bt(e) {
762
+ function yt(e) {
756
763
  return Object.values(Q).includes(
757
764
  e
758
765
  );
759
766
  }
760
- function yt(e) {
767
+ function wt(e) {
761
768
  return !!e && Le.has(e);
762
769
  }
763
770
  class Xe extends Error {
764
771
  constructor(t, n) {
765
772
  super(`Refund not yet mature (BIP68 not final): ${n.message}`);
766
- R(this, "vaultId");
767
- R(this, "cause");
773
+ $(this, "vaultId");
774
+ $(this, "cause");
768
775
  this.name = "BIP68NotMatureError", this.vaultId = t, this.cause = n;
769
776
  }
770
777
  }
771
778
  const ze = /^0x[0-9a-fA-F]{64}$/, Ge = /^(?:0x)?(?:[0-9a-fA-F]{2})+$/, W = /^(?:0x)?(?:[0-9a-fA-F]{64}|[0-9a-fA-F]{66})$/, Y = 160, F = 2e3, M = 10n, L = 100n;
772
- function wt(e) {
779
+ function xt(e) {
773
780
  if (!Number.isFinite(e) || e <= 0)
774
781
  throw new Error(
775
782
  `feeRateSatsVb must be a positive finite number, got ${e}`
@@ -787,7 +794,7 @@ function D(e, r) {
787
794
  `${r} must contain only hex characters after the 0x prefix`
788
795
  );
789
796
  }
790
- function I(e, r) {
797
+ function B(e, r) {
791
798
  if (!Number.isInteger(e) || e < 0)
792
799
  throw new Error(`${r} must be a non-negative integer, got ${e}`);
793
800
  }
@@ -822,9 +829,12 @@ function Qe(e) {
822
829
  throw new Error(
823
830
  `batch[${e.htlcVout}].amount (${r.amount}) does not match target amount (${e.amount})`
824
831
  );
825
- if (I(e.offchainParamsVersion, "offchainParamsVersion"), I(e.appVaultKeepersVersion, "appVaultKeepersVersion"), I(
832
+ if (B(e.offchainParamsVersion, "offchainParamsVersion"), B(e.appVaultKeepersVersion, "appVaultKeepersVersion"), B(
826
833
  e.universalChallengersVersion,
827
834
  "universalChallengersVersion"
835
+ ), ge(
836
+ e.vaultCoreVersion,
837
+ "VaultRefundData.vaultCoreVersion"
828
838
  ), typeof e.unsignedPrePeginTxHex != "string" || e.unsignedPrePeginTxHex.length === 0)
829
839
  throw new Error("unsignedPrePeginTxHex must be a non-empty hex string");
830
840
  if (!Ge.test(e.unsignedPrePeginTxHex))
@@ -875,21 +885,21 @@ function Ye(e) {
875
885
  }
876
886
  return r.extractTransaction().toHex();
877
887
  }
878
- async function xt(e) {
888
+ async function vt(e) {
879
889
  const {
880
890
  vaultId: r,
881
891
  readVault: t,
882
892
  readPrePeginContext: n,
883
893
  feeRate: s,
884
- signPsbt: u,
894
+ signPsbt: l,
885
895
  broadcastTx: a,
886
896
  signal: i
887
897
  } = e;
888
898
  i == null || i.throwIfAborted(), D(r, "vaultId");
889
899
  const o = await t();
890
900
  Qe(o), i == null || i.throwIfAborted();
891
- const l = await n(o);
892
- if (We(l), i == null || i.throwIfAborted(), !Number.isFinite(s) || s <= 0)
901
+ const u = await n(o);
902
+ if (We(u), i == null || i.throwIfAborted(), !Number.isFinite(s) || s <= 0)
893
903
  throw new Error(`feeRate must be a positive number, got ${s}`);
894
904
  if (s > F)
895
905
  throw new Error(
@@ -911,7 +921,7 @@ async function xt(e) {
911
921
  const y = m == null ? void 0 : m.hash;
912
922
  let x;
913
923
  try {
914
- x = C.fromHex(P);
924
+ x = S.fromHex(P);
915
925
  } catch (f) {
916
926
  throw new Error(
917
927
  `Failed to parse funded Pre-PegIn transaction hex: ${f instanceof Error ? f.message : String(f)}`
@@ -921,14 +931,15 @@ async function xt(e) {
921
931
  throw new Error(
922
932
  `Funded Pre-PegIn tx has ${x.outs.length} outputs but batch requires at least ${o.batch.length} HTLC outputs. Refund refused — funded tx shape disagrees with sibling vector.`
923
933
  );
924
- const { psbtHex: b } = await ge({
934
+ const { psbtHex: b } = await pe({
925
935
  prePeginParams: {
936
+ vaultCoreVersion: o.vaultCoreVersion,
926
937
  depositorPubkey: d,
927
- vaultProviderPubkey: p(l.vaultProviderPubkey),
928
- vaultKeeperPubkeys: l.vaultKeeperPubkeys.map(p),
929
- universalChallengerPubkeys: l.universalChallengerPubkeys.map(p),
938
+ vaultProviderPubkey: p(u.vaultProviderPubkey),
939
+ vaultKeeperPubkeys: u.vaultKeeperPubkeys.map(p),
940
+ universalChallengerPubkeys: u.universalChallengerPubkeys.map(p),
930
941
  hashlocks: o.batch.map((f) => p(f.hashlock)),
931
- timelockRefund: l.timelockRefund,
942
+ timelockRefund: u.timelockRefund,
932
943
  // `batch[i].amount` is the on-chain vault deposit (peg-in) amount, which
933
944
  // is exactly what WASM's `pegInAmounts` expects — it re-adds the protocol
934
945
  // reserve (`depositorClaimValue + minPeginFee`) internally when sizing the
@@ -936,12 +947,12 @@ async function xt(e) {
936
947
  // to the funded tx bytes, refusing the refund if the template's HTLC value
937
948
  // disagrees with the on-chain commitment.
938
949
  pegInAmounts: o.batch.map((f) => f.amount),
939
- feeRate: l.feeRate,
940
- minPeginFeeRate: l.minPeginFeeRate,
941
- numLocalChallengers: l.numLocalChallengers,
942
- councilQuorum: l.councilQuorum,
943
- councilSize: l.councilSize,
944
- network: l.network,
950
+ feeRate: u.feeRate,
951
+ minPeginFeeRate: u.minPeginFeeRate,
952
+ numLocalChallengers: u.numLocalChallengers,
953
+ councilQuorum: u.councilQuorum,
954
+ councilSize: u.councilSize,
955
+ network: u.network,
945
956
  authAnchorHash: y
946
957
  },
947
958
  fundedPrePeginTxHex: P,
@@ -957,8 +968,8 @@ async function xt(e) {
957
968
  const v = O(
958
969
  o.depositorBtcPubkey,
959
970
  qe
960
- ), T = await u(b, v);
961
- V({
971
+ ), T = await l(b, v);
972
+ I({
962
973
  requestedPsbtHex: b,
963
974
  returnedPsbtHex: T
964
975
  });
@@ -973,10 +984,10 @@ async function xt(e) {
973
984
  signerXOnlyPubkeyHex: d,
974
985
  inputIndex: k
975
986
  });
976
- const S = Ye(T);
987
+ const C = Ye(T);
977
988
  i == null || i.throwIfAborted();
978
989
  try {
979
- return await a(S);
990
+ return await a(C);
980
991
  } catch (f) {
981
992
  throw f instanceof Error && je.test(f.message) ? new Xe(r, f) : f;
982
993
  }
@@ -985,28 +996,28 @@ export {
985
996
  Xe as B,
986
997
  Q as C,
987
998
  j as R,
988
- it as a,
989
- $e as b,
990
- dt as c,
991
- pt as d,
999
+ ut as a,
1000
+ Ve as b,
1001
+ pt as c,
1002
+ gt as d,
992
1003
  De as e,
993
1004
  Ke as f,
994
- gt as g,
995
- ft as h,
996
- ct as i,
997
- mt as j,
998
- Pt as k,
999
- bt as l,
1000
- yt as m,
1001
- xt as n,
1002
- wt as o,
1005
+ ft as g,
1006
+ mt as h,
1007
+ ht as i,
1008
+ Pt as j,
1009
+ bt as k,
1010
+ yt as l,
1011
+ wt as m,
1012
+ vt as n,
1013
+ xt as o,
1003
1014
  L as p,
1004
1015
  M as q,
1005
- lt as r,
1006
- ut as s,
1016
+ ct as r,
1017
+ lt as s,
1007
1018
  F as t,
1008
1019
  Y as u,
1009
- ht as v,
1020
+ dt as v,
1010
1021
  G as w
1011
1022
  };
1012
- //# sourceMappingURL=buildAndBroadcastRefund-BAT5A6MP.js.map
1023
+ //# sourceMappingURL=buildAndBroadcastRefund-DjS9nf87.js.map