@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.
- package/dist/ApplicationRegistry.abi-CLaa6E99.cjs +2 -0
- package/dist/ApplicationRegistry.abi-CLaa6E99.cjs.map +1 -0
- package/dist/{ApplicationRegistry.abi-Dn2qk6JG.js → ApplicationRegistry.abi-w5prf7Ig.js} +14 -1
- package/dist/ApplicationRegistry.abi-w5prf7Ig.js.map +1 -0
- package/dist/PayoutManager-1GWmbvI9.cjs +2 -0
- package/dist/PayoutManager-1GWmbvI9.cjs.map +1 -0
- package/dist/{PayoutManager-BwrV3xFW.js → PayoutManager-Ddo9_Ozc.js} +34 -32
- package/dist/PayoutManager-Ddo9_Ozc.js.map +1 -0
- package/dist/{PeginManager-BGWNJYPk.js → PeginManager-CTU0wgkJ.js} +37 -34
- package/dist/PeginManager-CTU0wgkJ.js.map +1 -0
- package/dist/PeginManager-De-eHl3v.cjs +2 -0
- package/dist/PeginManager-De-eHl3v.cjs.map +1 -0
- package/dist/buildAndBroadcastRefund-BnD2qUDW.cjs +2 -0
- package/dist/buildAndBroadcastRefund-BnD2qUDW.cjs.map +1 -0
- package/dist/{buildAndBroadcastRefund-BAT5A6MP.js → buildAndBroadcastRefund-DjS9nf87.js} +188 -177
- package/dist/buildAndBroadcastRefund-DjS9nf87.js.map +1 -0
- package/dist/{challengeAssert-HNbugpqL.cjs → challengeAssert-DLQfNcfU.cjs} +2 -2
- package/dist/{challengeAssert-HNbugpqL.cjs.map → challengeAssert-DLQfNcfU.cjs.map} +1 -1
- package/dist/{challengeAssert-csvYXBJB.js → challengeAssert-DvdbpEDY.js} +2 -2
- package/dist/{challengeAssert-csvYXBJB.js.map → challengeAssert-DvdbpEDY.js.map} +1 -1
- package/dist/constants-BhclpREj.js +19 -0
- package/dist/constants-BhclpREj.js.map +1 -0
- package/dist/constants-CvbARMl-.cjs +2 -0
- package/dist/constants-CvbARMl-.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +182 -181
- package/dist/index.js.map +1 -1
- package/dist/{mempoolApi-Dc1KSVNI.js → mempoolApi-CB7bHuwi.js} +106 -101
- package/dist/mempoolApi-CB7bHuwi.js.map +1 -0
- package/dist/mempoolApi-DqJByvqR.cjs +2 -0
- package/dist/mempoolApi-DqJByvqR.cjs.map +1 -0
- package/dist/noPayout-8dDKwi6n.cjs +2 -0
- package/dist/noPayout-8dDKwi6n.cjs.map +1 -0
- package/dist/{noPayout-DVx3zxUz.js → noPayout-tZFoNun3.js} +30 -30
- package/dist/noPayout-tZFoNun3.js.map +1 -0
- package/dist/{peginInput-B5XDDHpy.js → peginInput-BKD_b3gq.js} +10 -11
- package/dist/peginInput-BKD_b3gq.js.map +1 -0
- package/dist/{peginInput-De0C6aSj.cjs → peginInput-CAiiDZeO.cjs} +2 -2
- package/dist/peginInput-CAiiDZeO.cjs.map +1 -0
- package/dist/primeVpAuth-CF4cH5_e.cjs +2 -0
- package/dist/primeVpAuth-CF4cH5_e.cjs.map +1 -0
- package/dist/{primeVpAuth-DxMuWQCi.js → primeVpAuth-l-5x_2UV.js} +91 -85
- package/dist/{primeVpAuth-yTddDmGy.cjs.map → primeVpAuth-l-5x_2UV.js.map} +1 -1
- package/dist/tbv/core/clients/eth/protocol-params-reader.d.ts.map +1 -1
- package/dist/tbv/core/clients/eth/protocol-params-validation.d.ts.map +1 -1
- package/dist/tbv/core/clients/eth/types.d.ts +8 -0
- package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +2 -2
- package/dist/tbv/core/contracts/abis/ProtocolParams.abi.d.ts +10 -0
- package/dist/tbv/core/contracts/abis/ProtocolParams.abi.d.ts.map +1 -1
- package/dist/tbv/core/contracts/index.cjs +1 -1
- package/dist/tbv/core/contracts/index.js +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +177 -176
- package/dist/tbv/core/index.js.map +1 -1
- package/dist/tbv/core/managers/PayoutManager.d.ts +6 -0
- package/dist/tbv/core/managers/PayoutManager.d.ts.map +1 -1
- package/dist/tbv/core/managers/PeginManager.d.ts +7 -0
- package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
- package/dist/tbv/core/managers/index.cjs +1 -1
- package/dist/tbv/core/managers/index.js +2 -2
- package/dist/tbv/core/primitives/__tests__/vaultCoreVersion.test.d.ts +8 -0
- package/dist/tbv/core/primitives/__tests__/vaultCoreVersion.test.d.ts.map +1 -0
- package/dist/tbv/core/primitives/index.cjs +1 -1
- package/dist/tbv/core/primitives/index.d.ts +1 -1
- package/dist/tbv/core/primitives/index.d.ts.map +1 -1
- package/dist/tbv/core/primitives/index.js +37 -36
- package/dist/tbv/core/primitives/index.js.map +1 -1
- package/dist/tbv/core/primitives/psbt/assertWasmPeginSizing.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/payout.d.ts +6 -0
- package/dist/tbv/core/primitives/psbt/payout.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/pegin.d.ts +7 -0
- package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/peginInput.d.ts +6 -0
- package/dist/tbv/core/primitives/psbt/peginInput.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/refund.d.ts.map +1 -1
- package/dist/tbv/core/primitives/scripts/payout.d.ts +6 -0
- package/dist/tbv/core/primitives/scripts/payout.d.ts.map +1 -1
- package/dist/tbv/core/primitives/vaultCoreVersion.d.ts +26 -0
- package/dist/tbv/core/primitives/vaultCoreVersion.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/runDepositorPresignFlow.d.ts +7 -0
- package/dist/tbv/core/services/deposit/runDepositorPresignFlow.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts +6 -0
- package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/verifyRegisteredVaultVersions.d.ts +8 -0
- package/dist/tbv/core/services/deposit/verifyRegisteredVaultVersions.d.ts.map +1 -1
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +2 -2
- package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts +6 -0
- package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts.map +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +177 -176
- package/dist/tbv/index.js.map +1 -1
- package/dist/{verifyScriptPathSchnorrSignature-BKECXOpa.js → verifyScriptPathSchnorrSignature-DpWZx5J0.js} +125 -130
- package/dist/verifyScriptPathSchnorrSignature-DpWZx5J0.js.map +1 -0
- package/dist/verifyScriptPathSchnorrSignature-a4Us7D3e.cjs +2 -0
- package/dist/verifyScriptPathSchnorrSignature-a4Us7D3e.cjs.map +1 -0
- package/package.json +3 -3
- package/dist/ApplicationRegistry.abi-BAPhJch3.cjs +0 -2
- package/dist/ApplicationRegistry.abi-BAPhJch3.cjs.map +0 -1
- package/dist/ApplicationRegistry.abi-Dn2qk6JG.js.map +0 -1
- package/dist/PayoutManager-BwrV3xFW.js.map +0 -1
- package/dist/PayoutManager-CBfHfLfz.cjs +0 -2
- package/dist/PayoutManager-CBfHfLfz.cjs.map +0 -1
- package/dist/PeginManager-BGWNJYPk.js.map +0 -1
- package/dist/PeginManager-DDp-ZRIa.cjs +0 -2
- package/dist/PeginManager-DDp-ZRIa.cjs.map +0 -1
- package/dist/buildAndBroadcastRefund-3MLyCOtv.cjs +0 -2
- package/dist/buildAndBroadcastRefund-3MLyCOtv.cjs.map +0 -1
- package/dist/buildAndBroadcastRefund-BAT5A6MP.js.map +0 -1
- package/dist/constants-CSG2XeD8.cjs +0 -2
- package/dist/constants-CSG2XeD8.cjs.map +0 -1
- package/dist/constants-Cd_fN8VT.js +0 -12
- package/dist/constants-Cd_fN8VT.js.map +0 -1
- package/dist/mempoolApi-Dc1KSVNI.js.map +0 -1
- package/dist/mempoolApi-NMiYQAXI.cjs +0 -2
- package/dist/mempoolApi-NMiYQAXI.cjs.map +0 -1
- package/dist/noPayout-ChPNKTbm.cjs +0 -2
- package/dist/noPayout-ChPNKTbm.cjs.map +0 -1
- package/dist/noPayout-DVx3zxUz.js.map +0 -1
- package/dist/peginInput-B5XDDHpy.js.map +0 -1
- package/dist/peginInput-De0C6aSj.cjs.map +0 -1
- package/dist/primeVpAuth-DxMuWQCi.js.map +0 -1
- package/dist/primeVpAuth-yTddDmGy.cjs +0 -2
- package/dist/tbv/core/primitives/__tests__/txGraphVersion.test.d.ts +0 -7
- package/dist/tbv/core/primitives/__tests__/txGraphVersion.test.d.ts.map +0 -1
- package/dist/tbv/core/primitives/txGraphVersion.d.ts +0 -11
- package/dist/tbv/core/primitives/txGraphVersion.d.ts.map +0 -1
- package/dist/verifyScriptPathSchnorrSignature-BKECXOpa.js.map +0 -1
- package/dist/verifyScriptPathSchnorrSignature-CVPh04ZI.cjs +0 -2
- package/dist/verifyScriptPathSchnorrSignature-CVPh04ZI.cjs.map +0 -1
|
@@ -9,15 +9,15 @@ import { isAddressEqual as ft, encodeFunctionData as tt, zeroAddress as Jt } fro
|
|
|
9
9
|
import { B as A } from "./BTCVaultRegistry.abi-Chs4AFBj.js";
|
|
10
10
|
import { h as H } from "./errors-Blc-JWnI.js";
|
|
11
11
|
import { expandWotsSeed as te, expandHashlockSecret as ee, expandAuthAnchor as ne, deriveVaultId as pt } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
12
|
-
import { a as mt, b as se, d as Pt, f as oe } from "./verifyScriptPathSchnorrSignature-
|
|
13
|
-
import { b as re, e as ie, f as ae } from "./peginInput-
|
|
14
|
-
import { u as X, h as et, e as
|
|
12
|
+
import { a as mt, b as se, d as Pt, f as oe } from "./verifyScriptPathSchnorrSignature-DpWZx5J0.js";
|
|
13
|
+
import { b as re, e as ie, f as ae } from "./peginInput-BKD_b3gq.js";
|
|
14
|
+
import { u as X, h as et, e as v, p as ce, i as bt, s as T, j as wt, X as le } from "./bitcoin-B5aNKtsk.js";
|
|
15
15
|
import { c as ue } from "./signing-DaLvGwQe.js";
|
|
16
16
|
import { M as yt } from "./validation-CxqROCno.js";
|
|
17
|
-
import { c as he, a as de } from "./PayoutManager-
|
|
17
|
+
import { c as he, a as de } from "./PayoutManager-Ddo9_Ozc.js";
|
|
18
18
|
import { s as ge, f as q, i as fe, w as xt } from "./waitForTransactionReceiptSmartAware-Ckg_oZAo.js";
|
|
19
19
|
import { p as pe, f as me } from "./fundPeginTransaction-96FxwYYJ.js";
|
|
20
|
-
import { p as Pe, V as be, i as we } from "./mempoolApi-
|
|
20
|
+
import { p as Pe, V as be, i as we } from "./mempoolApi-CB7bHuwi.js";
|
|
21
21
|
const M = /* @__PURE__ */ BigInt(2 ** 32 - 1), kt = /* @__PURE__ */ BigInt(32);
|
|
22
22
|
function ye(n, t = !1) {
|
|
23
23
|
return t ? { h: Number(n & M), l: Number(n >> kt & M) } : { h: Number(n >> kt & M) | 0, l: Number(n & M) | 0 };
|
|
@@ -35,7 +35,7 @@ const ke = (n, t, e) => n << e | t >>> 32 - e, Ee = (n, t, e) => t << e | n >>>
|
|
|
35
35
|
function st(n, t, e) {
|
|
36
36
|
n[t] = e >>> 24 & 255, n[t + 1] = e >>> 16 & 255, n[t + 2] = e >>> 8 & 255, n[t + 3] = e & 255;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function ve(n) {
|
|
39
39
|
if (n.txid.length !== z)
|
|
40
40
|
throw new Error(
|
|
41
41
|
`outpoint.txid must be exactly ${z} bytes, got ${n.txid.length}`
|
|
@@ -51,12 +51,12 @@ function Et(n, t) {
|
|
|
51
51
|
if (n[s] !== t[s]) return n[s] - t[s];
|
|
52
52
|
return n.length - t.length;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function Se(n) {
|
|
55
55
|
if (n.length === 0)
|
|
56
56
|
throw new Error(
|
|
57
57
|
"buildFundingOutpointsCommitment: outpoints must be non-empty"
|
|
58
58
|
);
|
|
59
|
-
const t = n.map(
|
|
59
|
+
const t = n.map(ve);
|
|
60
60
|
t.sort(Et);
|
|
61
61
|
for (let s = 1; s < t.length; s++)
|
|
62
62
|
if (Et(t[s - 1], t[s]) === 0)
|
|
@@ -73,7 +73,7 @@ function Ie(n) {
|
|
|
73
73
|
throw new Error(
|
|
74
74
|
`vaultContext: depositorBtcPubkey must be exactly ${U} bytes, got ${n.depositorBtcPubkey.length}`
|
|
75
75
|
);
|
|
76
|
-
const t =
|
|
76
|
+
const t = Se(n.fundingOutpoints), e = new Uint8Array(Be);
|
|
77
77
|
let s = 0;
|
|
78
78
|
return st(e, s, U), s += K, e.set(n.depositorBtcPubkey, s), s += U, st(e, s, Ht), s += K, e.set(t, s), e;
|
|
79
79
|
}
|
|
@@ -161,13 +161,13 @@ class Ne extends Yt {
|
|
|
161
161
|
N[g] = e.getUint32(s, !0);
|
|
162
162
|
let o = this.h0 | 0, r = o, i = this.h1 | 0, a = i, c = this.h2 | 0, h = c, l = this.h3 | 0, m = l, P = this.h4 | 0, b = P;
|
|
163
163
|
for (let g = 0; g < 5; g++) {
|
|
164
|
-
const f = 4 - g, k = Ve[g],
|
|
164
|
+
const f = 4 - g, k = Ve[g], S = Me[g], E = Ut[g], p = Vt[g], w = $e[g], y = Ue[g];
|
|
165
165
|
for (let d = 0; d < 16; d++) {
|
|
166
166
|
const u = V(o + _t(g, i, c, l) + N[E[d]] + k, w[d]) + P | 0;
|
|
167
167
|
o = P, P = l, l = V(c, 10) | 0, c = i, i = u;
|
|
168
168
|
}
|
|
169
169
|
for (let d = 0; d < 16; d++) {
|
|
170
|
-
const u = V(r + _t(f, a, h, m) + N[p[d]] +
|
|
170
|
+
const u = V(r + _t(f, a, h, m) + N[p[d]] + S, y[d]) + b | 0;
|
|
171
171
|
r = b, b = m, m = V(h, 10) | 0, h = a, a = u;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
@@ -188,20 +188,20 @@ for (let n = 0, t = R, e = 1, s = 0; n < 24; n++) {
|
|
|
188
188
|
t = (t << R ^ (t >> Xe) * De) % Ke, t & We && (o ^= R << (R << BigInt(r)) - R);
|
|
189
189
|
Lt.push(o);
|
|
190
190
|
}
|
|
191
|
-
const Wt = xe(Lt, !0), Ge = Wt[0], qe = Wt[1], Bt = (n, t, e) => e > 32 ? Te(n, t, e) : ke(n, t, e),
|
|
191
|
+
const Wt = xe(Lt, !0), Ge = Wt[0], qe = Wt[1], Bt = (n, t, e) => e > 32 ? Te(n, t, e) : ke(n, t, e), vt = (n, t, e) => e > 32 ? _e(n, t, e) : Ee(n, t, e);
|
|
192
192
|
function ze(n, t = 24) {
|
|
193
193
|
const e = new Uint32Array(10);
|
|
194
194
|
for (let s = 24 - t; s < 24; s++) {
|
|
195
195
|
for (let i = 0; i < 10; i++)
|
|
196
196
|
e[i] = n[i] ^ n[i + 10] ^ n[i + 20] ^ n[i + 30] ^ n[i + 40];
|
|
197
197
|
for (let i = 0; i < 10; i += 2) {
|
|
198
|
-
const a = (i + 8) % 10, c = (i + 2) % 10, h = e[c], l = e[c + 1], m = Bt(h, l, 1) ^ e[a], P =
|
|
198
|
+
const a = (i + 8) % 10, c = (i + 2) % 10, h = e[c], l = e[c + 1], m = Bt(h, l, 1) ^ e[a], P = vt(h, l, 1) ^ e[a + 1];
|
|
199
199
|
for (let b = 0; b < 50; b += 10)
|
|
200
200
|
n[i + b] ^= m, n[i + b + 1] ^= P;
|
|
201
201
|
}
|
|
202
202
|
let o = n[2], r = n[3];
|
|
203
203
|
for (let i = 0; i < 24; i++) {
|
|
204
|
-
const a = Ft[i], c = Bt(o, r, a), h =
|
|
204
|
+
const a = Ft[i], c = Bt(o, r, a), h = vt(o, r, a), l = Nt[i];
|
|
205
205
|
o = n[l], r = n[l + 1], n[l] = c, n[l + 1] = h;
|
|
206
206
|
}
|
|
207
207
|
for (let i = 0; i < 50; i += 10) {
|
|
@@ -290,7 +290,7 @@ class at {
|
|
|
290
290
|
return t || (t = new at(e, s, o, i, r)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = s, t.outputLen = o, t.enableXOF = i, t.destroyed = this.destroyed, t;
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
const Ye = (n, t, e, s = {}) => At(() => new at(t, n, e), s), je = /* @__PURE__ */ Ye(1, 136, 32),
|
|
293
|
+
const Ye = (n, t, e, s = {}) => At(() => new at(t, n, e), s), je = /* @__PURE__ */ Ye(1, 136, 32), St = 64, _ = 20, ot = 4, Xt = 2, Ze = 0, Qe = 1, F = [64, 64], Je = (n) => Array.from(n).map((t) => t.toString(16).padStart(2, "0")).join("");
|
|
294
294
|
function ct(n) {
|
|
295
295
|
return Fe(it(n));
|
|
296
296
|
}
|
|
@@ -351,9 +351,9 @@ function nn(n, t) {
|
|
|
351
351
|
}
|
|
352
352
|
async function sn(n) {
|
|
353
353
|
try {
|
|
354
|
-
if (n.length !==
|
|
354
|
+
if (n.length !== St)
|
|
355
355
|
throw new Error(
|
|
356
|
-
`WOTS seed must be exactly ${
|
|
356
|
+
`WOTS seed must be exactly ${St} bytes, got ${n.length}`
|
|
357
357
|
);
|
|
358
358
|
const t = [];
|
|
359
359
|
for (let e = 0; e < F.length; e++) {
|
|
@@ -450,7 +450,7 @@ async function rn(n, t) {
|
|
|
450
450
|
const c = await ee(n, i);
|
|
451
451
|
try {
|
|
452
452
|
const h = X(c);
|
|
453
|
-
o.push(h), r.push(he(
|
|
453
|
+
o.push(h), r.push(he(v(h)).slice(2));
|
|
454
454
|
} finally {
|
|
455
455
|
c.fill(0);
|
|
456
456
|
}
|
|
@@ -631,6 +631,7 @@ class Vn {
|
|
|
631
631
|
const s = e.amounts.map(
|
|
632
632
|
() => Q
|
|
633
633
|
), o = e.vaultKeeperBtcPubkeys.length, r = await mt({
|
|
634
|
+
vaultCoreVersion: e.vaultCoreVersion,
|
|
634
635
|
depositorPubkey: t,
|
|
635
636
|
vaultProviderPubkey: T(e.vaultProviderBtcPubkey),
|
|
636
637
|
vaultKeeperPubkeys: e.vaultKeeperBtcPubkeys.map(T),
|
|
@@ -679,6 +680,7 @@ class Vn {
|
|
|
679
680
|
const h = T(
|
|
680
681
|
a.vaultProviderBtcPubkey
|
|
681
682
|
), l = a.vaultKeeperBtcPubkeys.map(T), m = a.universalChallengerBtcPubkeys.map(T), P = l.length, b = {
|
|
683
|
+
vaultCoreVersion: a.vaultCoreVersion,
|
|
682
684
|
depositorPubkey: s,
|
|
683
685
|
vaultProviderPubkey: h,
|
|
684
686
|
vaultKeeperPubkeys: l,
|
|
@@ -699,7 +701,7 @@ class Vn {
|
|
|
699
701
|
changeAddress: a.changeAddress,
|
|
700
702
|
changeAmount: i.changeAmount,
|
|
701
703
|
network: f
|
|
702
|
-
}),
|
|
704
|
+
}), S = T(
|
|
703
705
|
q(k)
|
|
704
706
|
), E = [], p = [], w = [];
|
|
705
707
|
for (let u = 0; u < o.length; u++) {
|
|
@@ -709,6 +711,7 @@ class Vn {
|
|
|
709
711
|
fundedPrePeginTxHex: k,
|
|
710
712
|
htlcVout: u
|
|
711
713
|
}), I = await re({
|
|
714
|
+
vaultCoreVersion: a.vaultCoreVersion,
|
|
712
715
|
peginTxHex: B.txHex,
|
|
713
716
|
fundedPrePeginTxHex: k,
|
|
714
717
|
depositorPubkey: s,
|
|
@@ -755,7 +758,7 @@ class Vn {
|
|
|
755
758
|
}
|
|
756
759
|
return {
|
|
757
760
|
fundedPrePeginTxHex: k,
|
|
758
|
-
prePeginTxid:
|
|
761
|
+
prePeginTxid: S,
|
|
759
762
|
perVault: d
|
|
760
763
|
};
|
|
761
764
|
}
|
|
@@ -840,8 +843,8 @@ class Vn {
|
|
|
840
843
|
`PSBT finalization failed and wallet did not auto-finalize: ${p}`
|
|
841
844
|
);
|
|
842
845
|
}
|
|
843
|
-
const
|
|
844
|
-
return await Pe(
|
|
846
|
+
const S = k.extractTransaction().toHex();
|
|
847
|
+
return await Pe(S, c);
|
|
845
848
|
}
|
|
846
849
|
/**
|
|
847
850
|
* Registers a peg-in on Ethereum by calling the BTCVaultRegistry contract.
|
|
@@ -885,15 +888,15 @@ class Vn {
|
|
|
885
888
|
throw new Error(
|
|
886
889
|
`Proof of possession was signed for ${h.depositorEthAddress} but the Ethereum wallet is currently connected to ${l}. Reconnect the original account or call signProofOfPossession() again.`
|
|
887
890
|
);
|
|
888
|
-
const m = await this.assertPopMatchesBtcWallet(h), P = h.btcPopSignature, b =
|
|
891
|
+
const m = await this.assertPopMatchesBtcWallet(h), P = h.btcPopSignature, b = v(
|
|
889
892
|
h.depositorBtcPubkey
|
|
890
|
-
), g =
|
|
893
|
+
), g = v(e), f = v(s), k = a ?? await this.config.btcWallet.getAddress(), S = this.resolvePayoutScriptPubKey(
|
|
891
894
|
m,
|
|
892
895
|
k
|
|
893
896
|
), E = q(f), p = await pt(
|
|
894
897
|
T(E),
|
|
895
898
|
T(l)
|
|
896
|
-
), w =
|
|
899
|
+
), w = v(p);
|
|
897
900
|
if (await this.checkVaultExists(w))
|
|
898
901
|
throw new Error(
|
|
899
902
|
`Vault already exists (ID: ${w}, peginTxHash: ${E}). Vault IDs are derived from the pegin transaction hash and depositor address. To create a new vault, use different UTXOs or a different amount to generate a unique transaction.`
|
|
@@ -929,7 +932,7 @@ class Vn {
|
|
|
929
932
|
B,
|
|
930
933
|
r,
|
|
931
934
|
i,
|
|
932
|
-
|
|
935
|
+
S,
|
|
933
936
|
c
|
|
934
937
|
]
|
|
935
938
|
});
|
|
@@ -1001,12 +1004,12 @@ class Vn {
|
|
|
1001
1004
|
)
|
|
1002
1005
|
), l = [];
|
|
1003
1006
|
for (const d of o) {
|
|
1004
|
-
const u =
|
|
1007
|
+
const u = v(
|
|
1005
1008
|
d.depositorSignedPeginTx
|
|
1006
1009
|
), B = q(u), I = await pt(
|
|
1007
1010
|
T(B),
|
|
1008
1011
|
T(i)
|
|
1009
|
-
), C =
|
|
1012
|
+
), C = v(I);
|
|
1010
1013
|
if (await this.checkVaultExists(C))
|
|
1011
1014
|
throw new Error(
|
|
1012
1015
|
`Vault already exists (ID: ${C}, peginTxHash: ${B}). To create a new vault, use different UTXOs or a different amount.`
|
|
@@ -1031,13 +1034,13 @@ class Vn {
|
|
|
1031
1034
|
const b = P * BigInt(o.length), g = await this.resolveMaxAcceptableCommissionBps(
|
|
1032
1035
|
e,
|
|
1033
1036
|
t.quotedCommissionBps
|
|
1034
|
-
), f =
|
|
1037
|
+
), f = v(
|
|
1035
1038
|
r.depositorBtcPubkey
|
|
1036
|
-
), k =
|
|
1039
|
+
), k = v(s), S = o.map((d, u) => ({
|
|
1037
1040
|
depositorBtcPubKey: f,
|
|
1038
1041
|
btcPopSignature: c,
|
|
1039
1042
|
unsignedPrePeginTx: k,
|
|
1040
|
-
depositorSignedPeginTx:
|
|
1043
|
+
depositorSignedPeginTx: v(
|
|
1041
1044
|
d.depositorSignedPeginTx
|
|
1042
1045
|
),
|
|
1043
1046
|
hashlock: d.hashlock,
|
|
@@ -1052,7 +1055,7 @@ class Vn {
|
|
|
1052
1055
|
i,
|
|
1053
1056
|
e,
|
|
1054
1057
|
g,
|
|
1055
|
-
|
|
1058
|
+
S
|
|
1056
1059
|
]
|
|
1057
1060
|
});
|
|
1058
1061
|
let p;
|
|
@@ -1298,10 +1301,10 @@ export {
|
|
|
1298
1301
|
Vn as P,
|
|
1299
1302
|
Ae as V,
|
|
1300
1303
|
Ie as a,
|
|
1301
|
-
|
|
1304
|
+
Se as b,
|
|
1302
1305
|
on as c,
|
|
1303
1306
|
sn as d,
|
|
1304
1307
|
Mn as e,
|
|
1305
1308
|
He as f
|
|
1306
1309
|
};
|
|
1307
|
-
//# sourceMappingURL=PeginManager-
|
|
1310
|
+
//# sourceMappingURL=PeginManager-CTU0wgkJ.js.map
|