@babylonlabs-io/ts-sdk 0.38.1 → 0.39.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PeginManager-Cp2Tn5sH.js → PeginManager-DXrfY4d6.js} +388 -334
- package/dist/{PeginManager-Cp2Tn5sH.js.map → PeginManager-DXrfY4d6.js.map} +1 -1
- package/dist/PeginManager-zkTJOy_U.cjs +2 -0
- package/dist/{PeginManager-DaDs-bGr.cjs.map → PeginManager-zkTJOy_U.cjs.map} +1 -1
- package/dist/{buildAndBroadcastRefund-B5cOyUzj.js → buildAndBroadcastRefund-CjWAle7m.js} +278 -231
- package/dist/buildAndBroadcastRefund-CjWAle7m.js.map +1 -0
- package/dist/buildAndBroadcastRefund-CzKOUR75.cjs +2 -0
- package/dist/buildAndBroadcastRefund-CzKOUR75.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +152 -146
- package/dist/tbv/core/clients/eth/index.d.ts +1 -0
- package/dist/tbv/core/clients/eth/index.d.ts.map +1 -1
- package/dist/tbv/core/clients/eth/types.d.ts +20 -0
- package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts +5 -0
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts.map +1 -1
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +29 -27
- package/dist/tbv/core/clients/vault-provider/index.d.ts +1 -1
- package/dist/tbv/core/clients/vault-provider/index.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/json-rpc-client.d.ts +11 -0
- package/dist/tbv/core/clients/vault-provider/json-rpc-client.d.ts.map +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +151 -145
- package/dist/tbv/core/managers/PeginManager.d.ts +25 -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.d.ts +2 -2
- package/dist/tbv/core/managers/index.d.ts.map +1 -1
- package/dist/tbv/core/managers/index.js +5 -4
- package/dist/tbv/core/services/deposit/runDepositorPresignFlow.d.ts.map +1 -1
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +26 -23
- package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts +3 -0
- package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts.map +1 -1
- package/dist/tbv/core/services/refund/index.d.ts +1 -1
- package/dist/tbv/core/services/refund/index.d.ts.map +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +151 -145
- package/dist/{vault-registry-reader-BrARgFre.js → types-0bvDGR4x.js} +88 -74
- package/dist/types-0bvDGR4x.js.map +1 -0
- package/dist/{vault-registry-reader-CbJHSxVe.cjs → types-Be3sAYzr.cjs} +2 -2
- package/dist/types-Be3sAYzr.cjs.map +1 -0
- package/dist/{types-TOmEvvRy.js → types-BqGAMOZM.js} +2 -1
- package/dist/types-BqGAMOZM.js.map +1 -0
- package/dist/{types-D2jcXfm7.cjs → types-eYlq0p1o.cjs} +2 -2
- package/dist/types-eYlq0p1o.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/PeginManager-DaDs-bGr.cjs +0 -2
- package/dist/buildAndBroadcastRefund-B5cOyUzj.js.map +0 -1
- package/dist/buildAndBroadcastRefund-DVMT-pXQ.cjs +0 -2
- package/dist/buildAndBroadcastRefund-DVMT-pXQ.cjs.map +0 -1
- package/dist/types-D2jcXfm7.cjs.map +0 -1
- package/dist/types-TOmEvvRy.js.map +0 -1
- package/dist/vault-registry-reader-BrARgFre.js.map +0 -1
- package/dist/vault-registry-reader-CbJHSxVe.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var fe = Object.defineProperty;
|
|
2
2
|
var me = (t, e, n) => e in t ? fe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var p = (t, e, n) => me(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { D as be, J as ie, e as _e } from "./types-
|
|
5
|
-
import { X as
|
|
4
|
+
import { D as be, J as ie, e as _e } from "./types-BqGAMOZM.js";
|
|
5
|
+
import { X as D, C as L, s as I, S as ye, h as Pe } from "./bitcoin-B5aNKtsk.js";
|
|
6
6
|
import { H as T } from "./validation-CxqROCno.js";
|
|
7
7
|
import * as U from "@bitcoin-js/tiny-secp256k1-asmjs";
|
|
8
|
-
import { payments as we, Transaction as
|
|
8
|
+
import { payments as we, Transaction as K } from "bitcoinjs-lib";
|
|
9
9
|
import { Buffer as A } from "buffer";
|
|
10
10
|
import { s as W } from "./sha2-BYVxyZzX.js";
|
|
11
11
|
import { B as w } from "./BTCVaultRegistry.abi-Cq9-JlqT.js";
|
|
@@ -43,9 +43,9 @@ function m(t, e) {
|
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
function q(t, e) {
|
|
46
|
-
if (!v(t) || t.length !==
|
|
46
|
+
if (!v(t) || t.length !== D && t.length !== L)
|
|
47
47
|
throw new o(
|
|
48
|
-
`VP response validation failed: "${e}" must be a ${
|
|
48
|
+
`VP response validation failed: "${e}" must be a ${D} or ${L}-char hex string (BTC pubkey), got ${l(t)}`
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
function Ve(t) {
|
|
@@ -143,7 +143,7 @@ function Te(t, e) {
|
|
|
143
143
|
const n = t;
|
|
144
144
|
m(n.wots_pks_json, `${e}.wots_pks_json`), m(n.gc_wots_keys_json, `${e}.gc_wots_keys_json`);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function ke(t, e) {
|
|
147
147
|
if (t === null || typeof t != "object")
|
|
148
148
|
throw new o(
|
|
149
149
|
`VP response validation failed: "${e}" must be an object`
|
|
@@ -174,7 +174,7 @@ function Ce(t, e) {
|
|
|
174
174
|
`${e}.output_label_hashes[${r}]`
|
|
175
175
|
);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function Ce(t) {
|
|
178
178
|
if (t === null || typeof t != "object")
|
|
179
179
|
throw new o(
|
|
180
180
|
"VP response validation failed: requestDepositorClaimerArtifacts response is not an object"
|
|
@@ -211,7 +211,7 @@ function ke(t) {
|
|
|
211
211
|
);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function Ie(t) {
|
|
215
215
|
if (t === null || typeof t != "object")
|
|
216
216
|
throw new o(
|
|
217
217
|
"VP response validation failed: pegout status payload is not an object"
|
|
@@ -230,7 +230,7 @@ function Se(t) {
|
|
|
230
230
|
throw new o(
|
|
231
231
|
`VP response validation failed: "claimer" must be an object or null, got ${l(e.claimer)}`
|
|
232
232
|
);
|
|
233
|
-
|
|
233
|
+
Se(e.claimer);
|
|
234
234
|
}
|
|
235
235
|
if (!Array.isArray(e.challengers))
|
|
236
236
|
throw new o(
|
|
@@ -239,7 +239,7 @@ function Se(t) {
|
|
|
239
239
|
for (let n = 0; n < e.challengers.length; n++)
|
|
240
240
|
Ee(e.challengers[n], n);
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function Se(t) {
|
|
243
243
|
if (m(t.status, "claimer.status"), typeof t.failed != "boolean")
|
|
244
244
|
throw new o(
|
|
245
245
|
`VP response validation failed: "claimer.failed" must be a boolean, got ${l(t.failed)}`
|
|
@@ -259,13 +259,13 @@ function Ee(t, e) {
|
|
|
259
259
|
`VP response validation failed: "challengers[${e}]" must be an object, got ${l(t)}`
|
|
260
260
|
);
|
|
261
261
|
const n = t;
|
|
262
|
-
if (m(n.status, `challengers[${e}].status`), m(n.claim_txid, `challengers[${e}].claim_txid`), m(n.claimer_pubkey, `challengers[${e}].claimer_pubkey`),
|
|
262
|
+
if (m(n.status, `challengers[${e}].status`), m(n.claim_txid, `challengers[${e}].claim_txid`), m(n.claimer_pubkey, `challengers[${e}].claimer_pubkey`), S(n.assert_txid, `challengers[${e}].assert_txid`), S(
|
|
263
263
|
n.challenge_assert_x_txid,
|
|
264
264
|
`challengers[${e}].challenge_assert_x_txid`
|
|
265
|
-
),
|
|
265
|
+
), S(
|
|
266
266
|
n.challenge_assert_y_txid,
|
|
267
267
|
`challengers[${e}].challenge_assert_y_txid`
|
|
268
|
-
),
|
|
268
|
+
), S(n.nopayout_txid, `challengers[${e}].nopayout_txid`), typeof n.created_at != "number")
|
|
269
269
|
throw new o(
|
|
270
270
|
`VP response validation failed: "challengers[${e}].created_at" must be a number, got ${l(n.created_at)}`
|
|
271
271
|
);
|
|
@@ -274,7 +274,7 @@ function Ee(t, e) {
|
|
|
274
274
|
`VP response validation failed: "challengers[${e}].updated_at" must be a number, got ${l(n.updated_at)}`
|
|
275
275
|
);
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function S(t, e) {
|
|
278
278
|
if (t !== null && typeof t != "string")
|
|
279
279
|
throw new o(
|
|
280
280
|
`VP response validation failed: "${e}" must be a string or null, got ${l(t)}`
|
|
@@ -287,7 +287,7 @@ function Be(t) {
|
|
|
287
287
|
}
|
|
288
288
|
function Ne(t) {
|
|
289
289
|
ce(t, "batchGetPegoutStatus", (e) => {
|
|
290
|
-
e.result !== null &&
|
|
290
|
+
e.result !== null && Ie(e.result);
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
293
|
function ce(t, e, n) {
|
|
@@ -332,7 +332,7 @@ function Re(t) {
|
|
|
332
332
|
'VP response validation failed: "depositor_graph.challenger_presign_data" must be an array'
|
|
333
333
|
);
|
|
334
334
|
for (let e = 0; e < t.challenger_presign_data.length; e++)
|
|
335
|
-
|
|
335
|
+
ke(
|
|
336
336
|
t.challenger_presign_data[e],
|
|
337
337
|
`depositor_graph.challenger_presign_data[${e}]`
|
|
338
338
|
);
|
|
@@ -341,13 +341,13 @@ function Re(t) {
|
|
|
341
341
|
'VP response validation failed: "depositor_graph.offchain_params_version" must be a number'
|
|
342
342
|
);
|
|
343
343
|
}
|
|
344
|
-
const
|
|
345
|
-
class
|
|
344
|
+
const De = 6e4;
|
|
345
|
+
class He {
|
|
346
346
|
constructor(e, n) {
|
|
347
347
|
p(this, "client");
|
|
348
348
|
const r = {
|
|
349
349
|
baseUrl: e,
|
|
350
|
-
timeout: (n == null ? void 0 : n.timeout) ??
|
|
350
|
+
timeout: (n == null ? void 0 : n.timeout) ?? De,
|
|
351
351
|
retries: n == null ? void 0 : n.retries,
|
|
352
352
|
retryDelay: n == null ? void 0 : n.retryDelay,
|
|
353
353
|
retryableFor: n == null ? void 0 : n.retryableFor,
|
|
@@ -394,7 +394,7 @@ class Oe {
|
|
|
394
394
|
*/
|
|
395
395
|
async requestDepositorClaimerArtifacts(e, n) {
|
|
396
396
|
const r = await this.client.call("vaultProvider_requestDepositorClaimerArtifacts", e, n);
|
|
397
|
-
return
|
|
397
|
+
return Ce(r), r;
|
|
398
398
|
}
|
|
399
399
|
/** Get the current pegin status from the vault provider daemon. */
|
|
400
400
|
async getPeginStatus(e, n) {
|
|
@@ -423,7 +423,7 @@ class Oe {
|
|
|
423
423
|
return Ne(r), r;
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Oe(t, e) {
|
|
427
427
|
const n = /* @__PURE__ */ new Set();
|
|
428
428
|
for (const u of t)
|
|
429
429
|
n.add(u.toLowerCase());
|
|
@@ -445,7 +445,7 @@ function De(t, e) {
|
|
|
445
445
|
s.has(u) || c.push(u);
|
|
446
446
|
return { byTxid: r, missing: c, unexpected: a, duplicate: i };
|
|
447
447
|
}
|
|
448
|
-
async function
|
|
448
|
+
async function ut(t) {
|
|
449
449
|
const {
|
|
450
450
|
items: e,
|
|
451
451
|
getTxid: n,
|
|
@@ -463,33 +463,33 @@ async function lt(t) {
|
|
|
463
463
|
`batchPollByProvider: batchSize must be a positive integer, got ${f}`
|
|
464
464
|
);
|
|
465
465
|
for (let P = 0; P < e.length; P += f) {
|
|
466
|
-
const x = e.slice(P, P + f),
|
|
466
|
+
const x = e.slice(P, P + f), k = /* @__PURE__ */ new Map(), F = [];
|
|
467
467
|
for (const h of x) {
|
|
468
468
|
const b = n(h).toLowerCase();
|
|
469
|
-
|
|
469
|
+
k.set(b, h), F.push(b);
|
|
470
470
|
}
|
|
471
471
|
let V;
|
|
472
472
|
try {
|
|
473
|
-
const h = await r(
|
|
474
|
-
V =
|
|
473
|
+
const h = await r(F);
|
|
474
|
+
V = Oe(F, h.results);
|
|
475
475
|
} catch (h) {
|
|
476
476
|
u(x, h);
|
|
477
477
|
continue;
|
|
478
478
|
}
|
|
479
479
|
d && V.unexpected.length > 0 && d(V.unexpected);
|
|
480
|
-
const
|
|
481
|
-
for (const h of
|
|
482
|
-
const b =
|
|
480
|
+
const C = new Set(V.duplicate);
|
|
481
|
+
for (const h of C) {
|
|
482
|
+
const b = k.get(h);
|
|
483
483
|
b && a(b);
|
|
484
484
|
}
|
|
485
|
-
c &&
|
|
485
|
+
c && C.size > 0 && c(C.size);
|
|
486
486
|
for (const h of V.missing) {
|
|
487
|
-
const b =
|
|
487
|
+
const b = k.get(h);
|
|
488
488
|
b && i(b);
|
|
489
489
|
}
|
|
490
490
|
for (const [h, b] of V.byTxid) {
|
|
491
|
-
if (
|
|
492
|
-
const z =
|
|
491
|
+
if (C.has(h)) continue;
|
|
492
|
+
const z = k.get(h);
|
|
493
493
|
z && s(z, {
|
|
494
494
|
pegin_txid: h,
|
|
495
495
|
result: b.result,
|
|
@@ -498,24 +498,24 @@ async function lt(t) {
|
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
const je = "BIP0322-signed-message", Ue = "TapTweak", le = 32,
|
|
501
|
+
const je = "BIP0322-signed-message", Ue = "TapTweak", le = 32, Fe = 64;
|
|
502
502
|
function ue(t, e) {
|
|
503
503
|
const n = new TextEncoder().encode(t), r = W(n), s = new Uint8Array(r.length * 2 + e.length);
|
|
504
504
|
return s.set(r, 0), s.set(r, r.length), s.set(e, r.length * 2), W(s);
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function Ke(t) {
|
|
507
507
|
if (t.length !== le) return null;
|
|
508
508
|
const e = ue(Ue, t), n = U.xOnlyPointAddTweak(t, e);
|
|
509
509
|
return n ? n.xOnlyPubkey : null;
|
|
510
510
|
}
|
|
511
511
|
function Me(t, e, n) {
|
|
512
|
-
if (e.length !== le || n.length !==
|
|
512
|
+
if (e.length !== le || n.length !== Fe) return !1;
|
|
513
513
|
try {
|
|
514
514
|
const r = ue(je, t), s = we.p2tr({
|
|
515
515
|
internalPubkey: A.from(e)
|
|
516
516
|
});
|
|
517
517
|
if (!s.output) return !1;
|
|
518
|
-
const i = s.output, a = 0, c = new
|
|
518
|
+
const i = s.output, a = 0, c = new K();
|
|
519
519
|
c.version = 0, c.locktime = 0;
|
|
520
520
|
const u = A.concat([
|
|
521
521
|
A.from([0, 32]),
|
|
@@ -530,7 +530,7 @@ function Me(t, e, n) {
|
|
|
530
530
|
// sequence = 0
|
|
531
531
|
u
|
|
532
532
|
), c.addOutput(i, a);
|
|
533
|
-
const d = new
|
|
533
|
+
const d = new K();
|
|
534
534
|
d.version = 0, d.locktime = 0;
|
|
535
535
|
const f = c.getHash();
|
|
536
536
|
d.addInput(f, 0, 0), d.addOutput(A.from([106]), a);
|
|
@@ -538,14 +538,14 @@ function Me(t, e, n) {
|
|
|
538
538
|
0,
|
|
539
539
|
[i],
|
|
540
540
|
[a],
|
|
541
|
-
|
|
542
|
-
), x =
|
|
541
|
+
K.SIGHASH_DEFAULT
|
|
542
|
+
), x = Ke(e);
|
|
543
543
|
return x ? U.verifySchnorr(P, x, n) : !1;
|
|
544
544
|
} catch {
|
|
545
545
|
return !1;
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function H(t, e) {
|
|
549
549
|
const n = (t & 7) << 5, r = typeof e == "bigint" ? e : BigInt(e);
|
|
550
550
|
if (r < 0n) throw new Error("cborHead: negative argument");
|
|
551
551
|
if (r < 24n) return new Uint8Array([n | Number(r)]);
|
|
@@ -578,9 +578,9 @@ function de(...t) {
|
|
|
578
578
|
return n;
|
|
579
579
|
}
|
|
580
580
|
function J(t) {
|
|
581
|
-
const n = [
|
|
581
|
+
const n = [H(4, t.length)];
|
|
582
582
|
for (const r of t)
|
|
583
|
-
n.push(
|
|
583
|
+
n.push(H(0, r));
|
|
584
584
|
return de(...n);
|
|
585
585
|
}
|
|
586
586
|
function Ge(t, e, n) {
|
|
@@ -588,7 +588,7 @@ function Ge(t, e, n) {
|
|
|
588
588
|
throw new Error(
|
|
589
589
|
`encodeServerIdentityPayload: expires_at must be a non-negative safe integer, got ${n}`
|
|
590
590
|
);
|
|
591
|
-
const r =
|
|
591
|
+
const r = H(4, 3), s = J(t), i = J(e), a = H(0, n);
|
|
592
592
|
return de(r, s, i, a);
|
|
593
593
|
}
|
|
594
594
|
const Le = new TextEncoder().encode(
|
|
@@ -606,14 +606,14 @@ function E(t) {
|
|
|
606
606
|
return e;
|
|
607
607
|
}
|
|
608
608
|
function qe(t) {
|
|
609
|
-
const { proof: e, pinnedServerPubkey: n, now: r } = t, s = t.maxLifetimeSecs ?? Xe, i =
|
|
610
|
-
if (i.length !==
|
|
609
|
+
const { proof: e, pinnedServerPubkey: n, now: r } = t, s = t.maxLifetimeSecs ?? Xe, i = I(n).toLowerCase();
|
|
610
|
+
if (i.length !== D || !T.test(i))
|
|
611
611
|
throw new g(
|
|
612
612
|
`pinnedServerPubkey must be 32-byte hex; got ${i.length} chars`,
|
|
613
613
|
"invalid_pubkey_encoding"
|
|
614
614
|
);
|
|
615
|
-
const a =
|
|
616
|
-
if (a.length !==
|
|
615
|
+
const a = I(e.server_pubkey).toLowerCase();
|
|
616
|
+
if (a.length !== D || !T.test(a))
|
|
617
617
|
throw new g(
|
|
618
618
|
`server_pubkey must be 32-byte hex; got ${a.length} chars`,
|
|
619
619
|
"invalid_pubkey_encoding"
|
|
@@ -648,7 +648,7 @@ function qe(t) {
|
|
|
648
648
|
`server identity proof expires too far in the future: expires_at=${e.expires_at}, now=${r}, max lifetime=${s}s`,
|
|
649
649
|
"expires_too_far"
|
|
650
650
|
);
|
|
651
|
-
const c =
|
|
651
|
+
const c = I(e.ephemeral_pubkey).toLowerCase();
|
|
652
652
|
if (c.length !== L || !T.test(c))
|
|
653
653
|
throw new g(
|
|
654
654
|
`ephemeral_pubkey must be 33-byte compressed hex; got ${c.length} chars`,
|
|
@@ -666,7 +666,7 @@ function qe(t) {
|
|
|
666
666
|
"ephemeral_pubkey is not a valid secp256k1 point",
|
|
667
667
|
"invalid_ephemeral_pubkey"
|
|
668
668
|
);
|
|
669
|
-
const f =
|
|
669
|
+
const f = I(e.signature).toLowerCase();
|
|
670
670
|
if (f.length !== ye || !T.test(f))
|
|
671
671
|
throw new g(
|
|
672
672
|
`signature must be 64-byte Schnorr hex; got ${f.length} chars`,
|
|
@@ -848,7 +848,7 @@ class Ye {
|
|
|
848
848
|
}
|
|
849
849
|
}
|
|
850
850
|
const pe = new Ye();
|
|
851
|
-
function
|
|
851
|
+
function dt(t) {
|
|
852
852
|
var r;
|
|
853
853
|
const e = he(
|
|
854
854
|
t.baseUrl,
|
|
@@ -859,12 +859,12 @@ function ut(t) {
|
|
|
859
859
|
authAnchorHex: t.authAnchorHex,
|
|
860
860
|
pinnedServerPubkey: t.pinnedServerPubkey
|
|
861
861
|
});
|
|
862
|
-
return new
|
|
862
|
+
return new He(t.baseUrl, {
|
|
863
863
|
...t.options,
|
|
864
864
|
tokenProvider: n
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function ht(t) {
|
|
868
868
|
pe.getOrCreate({
|
|
869
869
|
client: he(t.baseUrl, t.headers),
|
|
870
870
|
peginTxid: t.peginTxid,
|
|
@@ -872,7 +872,7 @@ function dt(t) {
|
|
|
872
872
|
pinnedServerPubkey: t.pinnedServerPubkey
|
|
873
873
|
});
|
|
874
874
|
}
|
|
875
|
-
async function
|
|
875
|
+
async function pt(t, e) {
|
|
876
876
|
const [n, r] = await t.multicall({
|
|
877
877
|
contracts: [
|
|
878
878
|
{
|
|
@@ -893,9 +893,9 @@ async function ht(t, e) {
|
|
|
893
893
|
applicationRegistry: r
|
|
894
894
|
};
|
|
895
895
|
}
|
|
896
|
-
const G = 65535, Z = 1e4,
|
|
896
|
+
const G = 65535, Z = 1e4, O = 4294967295, ee = 255;
|
|
897
897
|
function N(t) {
|
|
898
|
-
if (!Number.isInteger(t) || t < 0 || t >
|
|
898
|
+
if (!Number.isInteger(t) || t < 0 || t > O)
|
|
899
899
|
throw new Error(
|
|
900
900
|
`Invalid offchainParamsVersion from contract: must be a uint32, got ${t}`
|
|
901
901
|
);
|
|
@@ -914,8 +914,8 @@ function R(t) {
|
|
|
914
914
|
`minPeginFeeRate must be positive, got ${t.minPeginFeeRate}`
|
|
915
915
|
), (!Number.isInteger(t.proverCircuitVersion) || t.proverCircuitVersion < 0 || t.proverCircuitVersion > G) && e.push(
|
|
916
916
|
`proverCircuitVersion must be a uint16, got ${t.proverCircuitVersion}`
|
|
917
|
-
), (!Number.isInteger(t.minPrepeginDepth) || t.minPrepeginDepth <= 0 || t.minPrepeginDepth >
|
|
918
|
-
`minPrepeginDepth must be a uint32 in [1, ${
|
|
917
|
+
), (!Number.isInteger(t.minPrepeginDepth) || t.minPrepeginDepth <= 0 || t.minPrepeginDepth > O) && e.push(
|
|
918
|
+
`minPrepeginDepth must be a uint32 in [1, ${O}], got ${t.minPrepeginDepth}`
|
|
919
919
|
), t.babeTotalInstances <= 0 && e.push(
|
|
920
920
|
`babeTotalInstances must be positive, got ${t.babeTotalInstances}`
|
|
921
921
|
), t.babeInstancesToFinalize <= 0 && e.push(
|
|
@@ -947,7 +947,7 @@ function ge(t) {
|
|
|
947
947
|
throw new Error(`Invalid TBV protocol parameters: ${e.join("; ")}`);
|
|
948
948
|
}
|
|
949
949
|
function Ze(t) {
|
|
950
|
-
if (ge(t), R(t.offchainParams), !Number.isInteger(t.offchainParamsVersion) || t.offchainParamsVersion < 0 || t.offchainParamsVersion >
|
|
950
|
+
if (ge(t), R(t.offchainParams), !Number.isInteger(t.offchainParamsVersion) || t.offchainParamsVersion < 0 || t.offchainParamsVersion > O)
|
|
951
951
|
throw new Error(
|
|
952
952
|
`Invalid peg-in configuration: offchainParamsVersion must be a uint32, got ${t.offchainParamsVersion}`
|
|
953
953
|
);
|
|
@@ -987,7 +987,7 @@ function re(t) {
|
|
|
987
987
|
);
|
|
988
988
|
return Number(t);
|
|
989
989
|
}
|
|
990
|
-
class
|
|
990
|
+
class gt {
|
|
991
991
|
constructor(e, n) {
|
|
992
992
|
this.publicClient = e, this.contractAddress = n;
|
|
993
993
|
}
|
|
@@ -1113,7 +1113,7 @@ function j(t) {
|
|
|
1113
1113
|
btcPubKey: e.btcPubKey
|
|
1114
1114
|
}));
|
|
1115
1115
|
}
|
|
1116
|
-
class
|
|
1116
|
+
class ft {
|
|
1117
1117
|
constructor(e, n) {
|
|
1118
1118
|
this.publicClient = e, this.contractAddress = n;
|
|
1119
1119
|
}
|
|
@@ -1144,7 +1144,7 @@ class gt {
|
|
|
1144
1144
|
});
|
|
1145
1145
|
}
|
|
1146
1146
|
}
|
|
1147
|
-
class
|
|
1147
|
+
class mt {
|
|
1148
1148
|
constructor(e, n) {
|
|
1149
1149
|
this.publicClient = e, this.contractAddress = n;
|
|
1150
1150
|
}
|
|
@@ -1173,7 +1173,7 @@ class ft {
|
|
|
1173
1173
|
});
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
|
-
class
|
|
1176
|
+
class bt {
|
|
1177
1177
|
constructor(e, n) {
|
|
1178
1178
|
this.publicClient = e, this.contractAddress = n;
|
|
1179
1179
|
}
|
|
@@ -1274,6 +1274,18 @@ class mt {
|
|
|
1274
1274
|
};
|
|
1275
1275
|
});
|
|
1276
1276
|
}
|
|
1277
|
+
/**
|
|
1278
|
+
* Read the protocol pegin fee (in wei) for a given vault provider.
|
|
1279
|
+
* Mirrors the `getPegInFee(address)` view on BTCVaultRegistry.
|
|
1280
|
+
*/
|
|
1281
|
+
async getPegInFee(e) {
|
|
1282
|
+
return await this.publicClient.readContract({
|
|
1283
|
+
address: this.contractAddress,
|
|
1284
|
+
abi: w,
|
|
1285
|
+
functionName: "getPegInFee",
|
|
1286
|
+
args: [e]
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1277
1289
|
async getVaultData(e) {
|
|
1278
1290
|
const [n, r] = await Promise.all([
|
|
1279
1291
|
this.getVaultBasicInfo(e),
|
|
@@ -1310,24 +1322,26 @@ class mt {
|
|
|
1310
1322
|
});
|
|
1311
1323
|
}
|
|
1312
1324
|
}
|
|
1325
|
+
var et = /* @__PURE__ */ ((t) => (t[t.PENDING = 0] = "PENDING", t[t.VERIFIED = 1] = "VERIFIED", t[t.ACTIVE = 2] = "ACTIVE", t[t.REDEEMED = 3] = "REDEEMED", t[t.EXPIRED = 4] = "EXPIRED", t))(et || {});
|
|
1313
1326
|
export {
|
|
1327
|
+
et as O,
|
|
1314
1328
|
g as S,
|
|
1315
|
-
|
|
1329
|
+
He as V,
|
|
1316
1330
|
o as a,
|
|
1317
|
-
|
|
1331
|
+
ut as b,
|
|
1318
1332
|
qe as c,
|
|
1319
1333
|
Ye as d,
|
|
1320
1334
|
pe as e,
|
|
1321
|
-
|
|
1335
|
+
dt as f,
|
|
1322
1336
|
R as g,
|
|
1323
1337
|
Ze as h,
|
|
1324
1338
|
ge as i,
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1339
|
+
gt as j,
|
|
1340
|
+
mt as k,
|
|
1341
|
+
ft as l,
|
|
1342
|
+
bt as m,
|
|
1343
|
+
ht as p,
|
|
1344
|
+
pt as r,
|
|
1345
|
+
Ce as v
|
|
1332
1346
|
};
|
|
1333
|
-
//# sourceMappingURL=
|
|
1347
|
+
//# sourceMappingURL=types-0bvDGR4x.js.map
|