@babylonlabs-io/ts-sdk 0.62.0 → 0.63.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/{BTCVaultRegistry.abi-B3BLhpJ4.js → BTCVaultRegistry.abi-CJwWI2EO.js} +5 -1
- package/dist/{BTCVaultRegistry.abi-B3BLhpJ4.js.map → BTCVaultRegistry.abi-CJwWI2EO.js.map} +1 -1
- package/dist/{BTCVaultRegistry.abi-3VLWva2x.cjs → BTCVaultRegistry.abi-z7d_eP22.cjs} +2 -2
- package/dist/{BTCVaultRegistry.abi-3VLWva2x.cjs.map → BTCVaultRegistry.abi-z7d_eP22.cjs.map} +1 -1
- package/dist/{PeginManager-BLBB_vMl.cjs → PeginManager-n__EsW8a.cjs} +2 -2
- package/dist/{PeginManager-BLBB_vMl.cjs.map → PeginManager-n__EsW8a.cjs.map} +1 -1
- package/dist/{PeginManager-Dj6_tWRA.js → PeginManager-ozwQaRwj.js} +3 -3
- package/dist/{PeginManager-Dj6_tWRA.js.map → PeginManager-ozwQaRwj.js.map} +1 -1
- package/dist/{ProtocolParams.abi-CV938AYZ.js → ProtocolParams.abi-C0TSRaHV.js} +17 -1
- package/dist/{ProtocolParams.abi-CV938AYZ.js.map → ProtocolParams.abi-C0TSRaHV.js.map} +1 -1
- package/dist/{ProtocolParams.abi-C8U7BHCS.cjs → ProtocolParams.abi-CYZoV2EI.cjs} +2 -2
- package/dist/{ProtocolParams.abi-C8U7BHCS.cjs.map → ProtocolParams.abi-CYZoV2EI.cjs.map} +1 -1
- package/dist/batchPoll-6L5oToGr.cjs +2 -0
- package/dist/batchPoll-6L5oToGr.cjs.map +1 -0
- package/dist/{batchPoll-C3eKPYOC.js → batchPoll-cIxrSLLJ.js} +43 -21
- package/dist/batchPoll-cIxrSLLJ.js.map +1 -0
- package/dist/{buildAndBroadcastRefund-CH2awK6h.js → buildAndBroadcastRefund-DpfBZfLw.js} +2 -2
- package/dist/{buildAndBroadcastRefund-CH2awK6h.js.map → buildAndBroadcastRefund-DpfBZfLw.js.map} +1 -1
- package/dist/{buildAndBroadcastRefund-CYzhA_B8.cjs → buildAndBroadcastRefund-DsCd90qJ.cjs} +2 -2
- package/dist/{buildAndBroadcastRefund-CYzhA_B8.cjs.map → buildAndBroadcastRefund-DsCd90qJ.cjs.map} +1 -1
- package/dist/{errors-lMX8Q6zb.js → errors-BXzrXswV.js} +2 -2
- package/dist/{errors-lMX8Q6zb.js.map → errors-BXzrXswV.js.map} +1 -1
- package/dist/{errors-D2zp7Vzk.cjs → errors-BzBVottO.cjs} +2 -2
- package/dist/{errors-D2zp7Vzk.cjs.map → errors-BzBVottO.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +7 -7
- package/dist/{mempoolApi-DC7pID6B.js → mempoolApi-BxSINXIB.js} +30 -54
- package/dist/mempoolApi-BxSINXIB.js.map +1 -0
- package/dist/mempoolApi-CXfr-L6x.cjs +2 -0
- package/dist/mempoolApi-CXfr-L6x.cjs.map +1 -0
- package/dist/tbv/core/clients/eth/protocol-params-reader.d.ts +11 -0
- package/dist/tbv/core/clients/eth/protocol-params-reader.d.ts.map +1 -1
- package/dist/tbv/core/clients/eth/types.d.ts +18 -6
- package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts +0 -6
- 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 +2 -2
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +4 -0
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
- 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 +2 -2
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +7 -7
- package/dist/tbv/core/managers/index.cjs +1 -1
- package/dist/tbv/core/managers/index.js +1 -1
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +7 -7
- package/package.json +1 -1
- package/dist/batchPoll-C3eKPYOC.js.map +0 -1
- package/dist/batchPoll-CbbCcNZP.cjs +0 -2
- package/dist/batchPoll-CbbCcNZP.cjs.map +0 -1
- package/dist/mempoolApi-BxhMqJ4f.cjs +0 -2
- package/dist/mempoolApi-BxhMqJ4f.cjs.map +0 -1
- package/dist/mempoolApi-DC7pID6B.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var Ce = Object.defineProperty;
|
|
2
2
|
var Te = (r, e, t) => e in r ? Ce(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var f = (r, e, t) => Te(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { B } from "./BTCVaultRegistry.abi-
|
|
5
|
-
import { A as R, P as y } from "./ProtocolParams.abi-
|
|
6
|
-
import { k as $e, v as U, l as Ve, j as Ie } from "./mempoolApi-
|
|
4
|
+
import { B } from "./BTCVaultRegistry.abi-CJwWI2EO.js";
|
|
5
|
+
import { A as R, P as y } from "./ProtocolParams.abi-C0TSRaHV.js";
|
|
6
|
+
import { k as $e, v as U, l as Ve, j as Ie } from "./mempoolApi-BxSINXIB.js";
|
|
7
7
|
import { X as O, C as j, s as I, S as Re, h as Oe, p as fe } from "./bitcoin-d9eaaZB_.js";
|
|
8
8
|
import { D as Ne, a as _e, e as Be } from "./json-rpc-client-DuUARJvV.js";
|
|
9
9
|
import { C as ee } from "./constants-GjWXdaqV.js";
|
|
10
10
|
import { H as k } from "./validation-Dj3dqYtl.js";
|
|
11
11
|
import * as K from "@bitcoin-js/tiny-secp256k1-asmjs";
|
|
12
|
-
import { payments as
|
|
12
|
+
import { payments as De, Transaction as X } from "bitcoinjs-lib";
|
|
13
13
|
import { Buffer as V } from "buffer";
|
|
14
14
|
import { s as Y } from "./sha2-BYVxyZzX.js";
|
|
15
15
|
async function cr(r, e) {
|
|
@@ -39,7 +39,7 @@ function te(r, e, t) {
|
|
|
39
39
|
`${t}: multicall returned ${r} results for ${e} calls, so the results are not roster-aligned; refusing to use them`
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function Ge(r, e) {
|
|
43
43
|
return {
|
|
44
44
|
vaultProvider: r[0],
|
|
45
45
|
vaultKeepers: r.slice(1, 1 + e),
|
|
@@ -65,7 +65,7 @@ class lr {
|
|
|
65
65
|
s.length,
|
|
66
66
|
1 + t + n,
|
|
67
67
|
i
|
|
68
|
-
),
|
|
68
|
+
), Ge(s, t);
|
|
69
69
|
}
|
|
70
70
|
async getCurrentOperationKeys(e) {
|
|
71
71
|
const t = [
|
|
@@ -169,7 +169,7 @@ class lr {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
const re = 65535;
|
|
172
|
-
function
|
|
172
|
+
function D(r) {
|
|
173
173
|
return {
|
|
174
174
|
timelockAssert: r.timelockAssert,
|
|
175
175
|
timelockChallengeAssert: r.timelockChallengeAssert,
|
|
@@ -220,7 +220,7 @@ class ur {
|
|
|
220
220
|
address: this.contractAddress,
|
|
221
221
|
abi: y,
|
|
222
222
|
functionName: "getLatestOffchainParams"
|
|
223
|
-
}), t =
|
|
223
|
+
}), t = D(e);
|
|
224
224
|
return U(t), t;
|
|
225
225
|
}
|
|
226
226
|
async getOffchainParamsByVersion(e) {
|
|
@@ -229,7 +229,7 @@ class ur {
|
|
|
229
229
|
abi: y,
|
|
230
230
|
functionName: "getOffchainParamsByVersion",
|
|
231
231
|
args: [e]
|
|
232
|
-
}), n =
|
|
232
|
+
}), n = D(t);
|
|
233
233
|
return U(n), n;
|
|
234
234
|
}
|
|
235
235
|
async getLatestOffchainParamsVersion() {
|
|
@@ -244,6 +244,28 @@ class ur {
|
|
|
244
244
|
const t = await this.getOffchainParamsByVersion(e);
|
|
245
245
|
return se(t.timelockAssert);
|
|
246
246
|
}
|
|
247
|
+
/**
|
|
248
|
+
* Returned as `bigint` with no `Number` narrowing: the registry compares it
|
|
249
|
+
* against `block.number`, so callers must do the same arithmetic the
|
|
250
|
+
* contract does. `0` is the documented "disabled" case and is returned as
|
|
251
|
+
* `0n`. A missing getter or a non-bigint payload throws — never coerced to
|
|
252
|
+
* `0`, which would fail open and skip the observation window.
|
|
253
|
+
*
|
|
254
|
+
* @throws If the deployment does not expose `peginActivationDelay()`, or
|
|
255
|
+
* the decoded payload is not a `bigint`.
|
|
256
|
+
*/
|
|
257
|
+
async getPeginActivationDelay() {
|
|
258
|
+
const e = await this.publicClient.readContract({
|
|
259
|
+
address: this.contractAddress,
|
|
260
|
+
abi: y,
|
|
261
|
+
functionName: "peginActivationDelay"
|
|
262
|
+
});
|
|
263
|
+
if (typeof e != "bigint")
|
|
264
|
+
throw new Error(
|
|
265
|
+
`Invalid peginActivationDelay from contract: must be a bigint, got ${typeof e}`
|
|
266
|
+
);
|
|
267
|
+
return e;
|
|
268
|
+
}
|
|
247
269
|
/**
|
|
248
270
|
* Read TBV protocol params, latest offchain params, and the latest version
|
|
249
271
|
* label atomically via multicall. The version is paired with the params so
|
|
@@ -276,7 +298,7 @@ class ur {
|
|
|
276
298
|
}
|
|
277
299
|
],
|
|
278
300
|
allowFailure: !1
|
|
279
|
-
}), t = ne(e[0]), n =
|
|
301
|
+
}), t = ne(e[0]), n = D(e[1]), i = Number(e[2]), s = Number(e[3]), a = {
|
|
280
302
|
minimumPegInAmount: t.minimumPegInAmount,
|
|
281
303
|
maxPegInAmount: t.maxPegInAmount,
|
|
282
304
|
pegInAckTimeout: t.pegInAckTimeout,
|
|
@@ -316,7 +338,7 @@ class ur {
|
|
|
316
338
|
allowFailure: !1
|
|
317
339
|
}), a = /* @__PURE__ */ new Map();
|
|
318
340
|
for (let c = 0; c < n.length; c++) {
|
|
319
|
-
const d =
|
|
341
|
+
const d = D(s[c]);
|
|
320
342
|
try {
|
|
321
343
|
U(d), a.set(n[c], d);
|
|
322
344
|
} catch (l) {
|
|
@@ -649,13 +671,13 @@ function ze(r, e) {
|
|
|
649
671
|
`VP response validation failed: "challengers[${e}]" must be an object, got ${h(r)}`
|
|
650
672
|
);
|
|
651
673
|
const t = r;
|
|
652
|
-
if (w(t.status, `challengers[${e}].status`), w(t.claim_txid, `challengers[${e}].claim_txid`), w(t.claimer_pubkey, `challengers[${e}].claimer_pubkey`),
|
|
674
|
+
if (w(t.status, `challengers[${e}].status`), w(t.claim_txid, `challengers[${e}].claim_txid`), w(t.claimer_pubkey, `challengers[${e}].claimer_pubkey`), G(t.assert_txid, `challengers[${e}].assert_txid`), G(
|
|
653
675
|
t.challenge_assert_x_txid,
|
|
654
676
|
`challengers[${e}].challenge_assert_x_txid`
|
|
655
|
-
),
|
|
677
|
+
), G(
|
|
656
678
|
t.challenge_assert_y_txid,
|
|
657
679
|
`challengers[${e}].challenge_assert_y_txid`
|
|
658
|
-
),
|
|
680
|
+
), G(t.nopayout_txid, `challengers[${e}].nopayout_txid`), typeof t.created_at != "number")
|
|
659
681
|
throw new o(
|
|
660
682
|
`VP response validation failed: "challengers[${e}].created_at" must be a number, got ${h(t.created_at)}`
|
|
661
683
|
);
|
|
@@ -664,7 +686,7 @@ function ze(r, e) {
|
|
|
664
686
|
`VP response validation failed: "challengers[${e}].updated_at" must be a number, got ${h(t.updated_at)}`
|
|
665
687
|
);
|
|
666
688
|
}
|
|
667
|
-
function
|
|
689
|
+
function G(r, e) {
|
|
668
690
|
if (r !== null && typeof r != "string")
|
|
669
691
|
throw new o(
|
|
670
692
|
`VP response validation failed: "${e}" must be a string or null, got ${h(r)}`
|
|
@@ -826,7 +848,7 @@ function it(r) {
|
|
|
826
848
|
function at(r, e, t) {
|
|
827
849
|
if (e.length !== xe || t.length !== st) return !1;
|
|
828
850
|
try {
|
|
829
|
-
const n = Pe(rt, r), i =
|
|
851
|
+
const n = Pe(rt, r), i = De.p2tr({
|
|
830
852
|
internalPubkey: V.from(e)
|
|
831
853
|
});
|
|
832
854
|
if (!i.output) return !1;
|
|
@@ -1130,13 +1152,13 @@ function Se(r) {
|
|
|
1130
1152
|
throw new v("trailing bytes after top-level item");
|
|
1131
1153
|
return t;
|
|
1132
1154
|
}
|
|
1133
|
-
const Et = "vaultd-jsonrpc", St = "vaultd-grpc", le = 18, Z = 4, ue = -47, kt = 1, de = 64, Ct = 128, Tt = 96, $t = 64, Vt = 1, It = 2, Rt = 3, Ot = 4, Nt = 5, Bt = 6,
|
|
1155
|
+
const Et = "vaultd-jsonrpc", St = "vaultd-grpc", le = 18, Z = 4, ue = -47, kt = 1, de = 64, Ct = 128, Tt = 96, $t = 64, Vt = 1, It = 2, Rt = 3, Ot = 4, Nt = 5, Bt = 6, Dt = 7, pe = new TextEncoder().encode("Signature1");
|
|
1134
1156
|
class p extends Error {
|
|
1135
1157
|
constructor(e, t) {
|
|
1136
1158
|
super(e), this.reason = t, this.name = "CwtVerificationError";
|
|
1137
1159
|
}
|
|
1138
1160
|
}
|
|
1139
|
-
function
|
|
1161
|
+
function Gt(r) {
|
|
1140
1162
|
const e = he(
|
|
1141
1163
|
r.expectedIssuerXOnlyPubkey,
|
|
1142
1164
|
"expectedIssuerXOnlyPubkey"
|
|
@@ -1267,7 +1289,7 @@ function Ht(r) {
|
|
|
1267
1289
|
"CWT claims root is not a map",
|
|
1268
1290
|
"invalid_claims"
|
|
1269
1291
|
);
|
|
1270
|
-
if (Lt(e,
|
|
1292
|
+
if (Lt(e, Dt, "cti").length === 0)
|
|
1271
1293
|
throw new p("token cti is empty", "invalid_claims");
|
|
1272
1294
|
return {
|
|
1273
1295
|
issuer: J(e, Vt, "iss"),
|
|
@@ -1460,7 +1482,7 @@ class Wt {
|
|
|
1460
1482
|
throw new Error(
|
|
1461
1483
|
`VpTokenProvider: invalid expires_at in acquire response (got ${JSON.stringify(s.expires_at)}; must be a safe integer in (${a}, ${ge}])`
|
|
1462
1484
|
);
|
|
1463
|
-
|
|
1485
|
+
Gt({
|
|
1464
1486
|
token: s.token,
|
|
1465
1487
|
ephemeralPubkeyHex: s.server_identity.ephemeral_pubkey,
|
|
1466
1488
|
expectedIssuerXOnlyPubkey: this.pinnedServerPubkey,
|
|
@@ -1675,4 +1697,4 @@ export {
|
|
|
1675
1697
|
cr as r,
|
|
1676
1698
|
Je as v
|
|
1677
1699
|
};
|
|
1678
|
-
//# sourceMappingURL=batchPoll-
|
|
1700
|
+
//# sourceMappingURL=batchPoll-cIxrSLLJ.js.map
|