@babylonlabs-io/ts-sdk 0.70.0 → 0.71.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/PeginManager-BIKAnZ-X.cjs +2 -0
- package/dist/PeginManager-BIKAnZ-X.cjs.map +1 -0
- package/dist/{PeginManager-erlaJqpN.js → PeginManager-Byvmccdd.js} +10 -10
- package/dist/PeginManager-Byvmccdd.js.map +1 -0
- package/dist/abortSignals-BPpAUL1Z.js +18 -0
- package/dist/abortSignals-BPpAUL1Z.js.map +1 -0
- package/dist/abortSignals-msbmbqFe.cjs +2 -0
- package/dist/abortSignals-msbmbqFe.cjs.map +1 -0
- package/dist/{bitcoin-Ch_jxnDa.js → bitcoin-C-TuHb-v.js} +21 -22
- package/dist/bitcoin-C-TuHb-v.js.map +1 -0
- package/dist/bitcoin-D-O2GjbC.cjs +2 -0
- package/dist/bitcoin-D-O2GjbC.cjs.map +1 -0
- package/dist/{buildAndBroadcastReclaim-CBPDgfj7.js → buildAndBroadcastReclaim-C0TdwO2M.js} +62 -61
- package/dist/buildAndBroadcastReclaim-C0TdwO2M.js.map +1 -0
- package/dist/buildAndBroadcastReclaim-kRx7-o2y.cjs +2 -0
- package/dist/buildAndBroadcastReclaim-kRx7-o2y.cjs.map +1 -0
- package/dist/{challengeAssert-BNQ8sToz.js → challengeAssert-Cp_GeRg8.js} +3 -3
- package/dist/challengeAssert-Cp_GeRg8.js.map +1 -0
- package/dist/challengeAssert-Z7_YULBb.cjs +2 -0
- package/dist/challengeAssert-Z7_YULBb.cjs.map +1 -0
- package/dist/constants-Bh38W9mq.cjs +2 -0
- package/dist/constants-Bh38W9mq.cjs.map +1 -0
- package/dist/constants-CPzppOdq.js +17 -0
- package/dist/constants-CPzppOdq.js.map +1 -0
- package/dist/index-Cs7_Evtk.cjs +2 -0
- package/dist/index-Cs7_Evtk.cjs.map +1 -0
- package/dist/index-LgmJhdEN.js +505 -0
- package/dist/index-LgmJhdEN.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +230 -226
- package/dist/index.js.map +1 -1
- package/dist/mempoolApi-BQllf-ji.cjs +2 -0
- package/dist/{mempoolApi-BJN9fGEd.cjs.map → mempoolApi-BQllf-ji.cjs.map} +1 -1
- package/dist/{mempoolApi-71R_CNZa.js → mempoolApi-CRNMOsbC.js} +36 -35
- package/dist/{mempoolApi-71R_CNZa.js.map → mempoolApi-CRNMOsbC.js.map} +1 -1
- package/dist/noPayout--lxo7qe4.js +300 -0
- package/dist/noPayout--lxo7qe4.js.map +1 -0
- package/dist/noPayout-CegnEwfp.cjs +2 -0
- package/dist/noPayout-CegnEwfp.cjs.map +1 -0
- package/dist/{onChainBtcPubkey-C_a2L3kL.cjs → onChainBtcPubkey-B5ZvWCCF.cjs} +2 -2
- package/dist/{onChainBtcPubkey-C_a2L3kL.cjs.map → onChainBtcPubkey-B5ZvWCCF.cjs.map} +1 -1
- package/dist/{onChainBtcPubkey-BAHZyKQL.js → onChainBtcPubkey-DATNfAAl.js} +2 -2
- package/dist/{onChainBtcPubkey-BAHZyKQL.js.map → onChainBtcPubkey-DATNfAAl.js.map} +1 -1
- package/dist/parseFundingOutpoints-BkgGihaY.cjs +2 -0
- package/dist/parseFundingOutpoints-BkgGihaY.cjs.map +1 -0
- package/dist/{parseFundingOutpoints-CO-f6IHK.js → parseFundingOutpoints-DlINgQ3X.js} +30 -29
- package/dist/parseFundingOutpoints-DlINgQ3X.js.map +1 -0
- package/dist/{batchPoll-Bc_UKaTz.js → primeVpAuth-D1qbOkhb.js} +311 -803
- package/dist/primeVpAuth-D1qbOkhb.js.map +1 -0
- package/dist/primeVpAuth-tEXx9TGx.cjs +2 -0
- package/dist/primeVpAuth-tEXx9TGx.cjs.map +1 -0
- package/dist/{reservation-CBAvoF3U.js → reservation-Cj9F0rP9.js} +2 -2
- package/dist/{reservation-CBAvoF3U.js.map → reservation-Cj9F0rP9.js.map} +1 -1
- package/dist/{reservation-CDbInVw0.cjs → reservation-Dr2HLCxx.cjs} +2 -2
- package/dist/{reservation-CDbInVw0.cjs.map → reservation-Dr2HLCxx.cjs.map} +1 -1
- package/dist/{signPsbtsWithFallback-DVyK-9A-.js → signPsbtsWithFallback-BjXdnI0X.js} +56 -48
- package/dist/signPsbtsWithFallback-BjXdnI0X.js.map +1 -0
- package/dist/signPsbtsWithFallback-zOQWokmk.cjs +2 -0
- package/dist/signPsbtsWithFallback-zOQWokmk.cjs.map +1 -0
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +36 -35
- package/dist/tbv/core/clients/index.js.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/serverIdentity.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/verifyDepositorCwt.d.ts.map +1 -1
- package/dist/tbv/core/clients/vault-provider/status/index.cjs +2 -0
- package/dist/tbv/core/clients/vault-provider/status/index.cjs.map +1 -0
- package/dist/tbv/core/clients/vault-provider/status/index.d.ts +18 -0
- package/dist/tbv/core/clients/vault-provider/status/index.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/status/index.js +17 -0
- package/dist/tbv/core/clients/vault-provider/status/index.js.map +1 -0
- package/dist/tbv/core/clients/vault-provider/validators.d.ts.map +1 -1
- package/dist/tbv/core/deposit-terms/rebuildDepositTermsCore.d.ts +1 -1
- package/dist/tbv/core/deposit-terms/rebuildDepositTermsCore.d.ts.map +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +224 -220
- package/dist/tbv/core/index.js.map +1 -1
- package/dist/tbv/core/managers/PayoutManager.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/index.cjs +1 -1
- package/dist/tbv/core/primitives/index.d.ts +2 -2
- package/dist/tbv/core/primitives/index.d.ts.map +1 -1
- package/dist/tbv/core/primitives/index.js +7 -7
- package/dist/tbv/core/primitives/psbt/assertWasmPeginSizing.d.ts +1 -1
- package/dist/tbv/core/primitives/psbt/assertWasmPeginSizing.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/challengeAssert.d.ts +1 -1
- package/dist/tbv/core/primitives/psbt/challengeAssert.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/constants.d.ts +7 -0
- package/dist/tbv/core/primitives/psbt/constants.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/noPayout.d.ts +1 -1
- package/dist/tbv/core/primitives/psbt/noPayout.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/payout.d.ts +1 -1
- package/dist/tbv/core/primitives/psbt/payout.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/pegin.d.ts +1 -1
- package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/peginInput.d.ts +1 -1
- 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 +1 -1
- package/dist/tbv/core/primitives/scripts/payout.d.ts.map +1 -1
- package/dist/tbv/core/primitives/utils/bitcoin.d.ts +0 -10
- package/dist/tbv/core/primitives/utils/bitcoin.d.ts.map +1 -1
- package/dist/tbv/core/recovery/reconstructPeginParams.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/signDepositorGraph.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/utils/index.cjs +1 -1
- package/dist/tbv/core/utils/index.js +47 -44
- package/dist/tbv/core/utils/index.js.map +1 -1
- package/dist/tbv/core/utils/utxo/reservation.d.ts.map +1 -1
- package/dist/tbv/core/utils/validation.d.ts +4 -0
- package/dist/tbv/core/utils/validation.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/deriveVaultRoot.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/index.cjs +1 -1
- package/dist/tbv/core/vault-secrets/index.d.ts +1 -1
- package/dist/tbv/core/vault-secrets/index.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/index.js +2 -2
- package/dist/tbv/core/wasm/__tests__/constants.test.d.ts +2 -0
- package/dist/tbv/core/wasm/__tests__/constants.test.d.ts.map +1 -0
- package/dist/tbv/core/wasm/__tests__/loader.test.d.ts +2 -0
- package/dist/tbv/core/wasm/__tests__/loader.test.d.ts.map +1 -0
- package/dist/tbv/core/wasm/__tests__/value-guards.test.d.ts +2 -0
- package/dist/tbv/core/wasm/__tests__/value-guards.test.d.ts.map +1 -0
- package/dist/tbv/core/wasm/constants.d.ts +11 -0
- package/dist/tbv/core/wasm/constants.d.ts.map +1 -0
- package/dist/tbv/core/wasm/index.cjs +2 -0
- package/dist/tbv/core/wasm/index.cjs.map +1 -0
- package/dist/tbv/core/wasm/index.d.ts +191 -0
- package/dist/tbv/core/wasm/index.d.ts.map +1 -0
- package/dist/tbv/core/wasm/index.js +144 -0
- package/dist/tbv/core/wasm/index.js.map +1 -0
- package/dist/tbv/core/wasm/value-guards.d.ts +30 -0
- package/dist/tbv/core/wasm/value-guards.d.ts.map +1 -0
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +224 -220
- package/dist/tbv/index.js.map +1 -1
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/toRefundInputs-Bdtz8p27.cjs +2 -0
- package/dist/toRefundInputs-Bdtz8p27.cjs.map +1 -0
- package/dist/{toRefundInputs-ZkvoR5Df.js → toRefundInputs-CgXMcHrk.js} +7 -7
- package/dist/toRefundInputs-CgXMcHrk.js.map +1 -0
- package/dist/validation-C6XTfZak.cjs +2 -0
- package/dist/validation-C6XTfZak.cjs.map +1 -0
- package/dist/validation-OSC0xTHB.js +17 -0
- package/dist/validation-OSC0xTHB.js.map +1 -0
- package/dist/vaultCoreVersion-DYfw3qed.cjs +2 -0
- package/dist/vaultCoreVersion-DYfw3qed.cjs.map +1 -0
- package/dist/vaultCoreVersion-D_fP9P3C.js +10 -0
- package/dist/vaultCoreVersion-D_fP9P3C.js.map +1 -0
- package/dist/verifyKeyPathSchnorrSignature-BedSbH2D.cjs +2 -0
- package/dist/verifyKeyPathSchnorrSignature-BedSbH2D.cjs.map +1 -0
- package/dist/{verifyKeyPathSchnorrSignature-C6Cmk0R1.js → verifyKeyPathSchnorrSignature-BrgUJmV0.js} +3 -3
- package/dist/verifyKeyPathSchnorrSignature-BrgUJmV0.js.map +1 -0
- package/dist/{verifyScriptPathSchnorrSignature-B7MhJmhy.js → verifyScriptPathSchnorrSignature-ZAZfFJ6S.js} +35 -34
- package/dist/verifyScriptPathSchnorrSignature-ZAZfFJ6S.js.map +1 -0
- package/dist/verifyScriptPathSchnorrSignature-mzYCzaSy.cjs +2 -0
- package/dist/verifyScriptPathSchnorrSignature-mzYCzaSy.cjs.map +1 -0
- package/package.json +12 -2
- package/dist/PeginManager-BpouMHkS.cjs +0 -2
- package/dist/PeginManager-BpouMHkS.cjs.map +0 -1
- package/dist/PeginManager-erlaJqpN.js.map +0 -1
- package/dist/batchPoll-Bc_UKaTz.js.map +0 -1
- package/dist/batchPoll-C9cZ5usJ.cjs +0 -2
- package/dist/batchPoll-C9cZ5usJ.cjs.map +0 -1
- package/dist/bitcoin-Ch_jxnDa.js.map +0 -1
- package/dist/bitcoin-m84N5a8o.cjs +0 -2
- package/dist/bitcoin-m84N5a8o.cjs.map +0 -1
- package/dist/buildAndBroadcastReclaim-CBPDgfj7.js.map +0 -1
- package/dist/buildAndBroadcastReclaim-DsJ5CB_H.cjs +0 -2
- package/dist/buildAndBroadcastReclaim-DsJ5CB_H.cjs.map +0 -1
- package/dist/challengeAssert-BNQ8sToz.js.map +0 -1
- package/dist/challengeAssert-BrpC3-cQ.cjs +0 -2
- package/dist/challengeAssert-BrpC3-cQ.cjs.map +0 -1
- package/dist/constants-DU5CGcqO.cjs +0 -2
- package/dist/constants-DU5CGcqO.cjs.map +0 -1
- package/dist/constants-GjWXdaqV.js +0 -23
- package/dist/constants-GjWXdaqV.js.map +0 -1
- package/dist/mempoolApi-BJN9fGEd.cjs +0 -2
- package/dist/noPayout-CDi6f5-I.js +0 -280
- package/dist/noPayout-CDi6f5-I.js.map +0 -1
- package/dist/noPayout-Cbi9TCRz.cjs +0 -2
- package/dist/noPayout-Cbi9TCRz.cjs.map +0 -1
- package/dist/parseFundingOutpoints-CIO9Ok1L.cjs +0 -2
- package/dist/parseFundingOutpoints-CIO9Ok1L.cjs.map +0 -1
- package/dist/parseFundingOutpoints-CO-f6IHK.js.map +0 -1
- package/dist/signPsbtsWithFallback-DVyK-9A-.js.map +0 -1
- package/dist/signPsbtsWithFallback-DY2jBtNB.cjs +0 -2
- package/dist/signPsbtsWithFallback-DY2jBtNB.cjs.map +0 -1
- package/dist/toRefundInputs-Cn6z5_Ko.cjs +0 -2
- package/dist/toRefundInputs-Cn6z5_Ko.cjs.map +0 -1
- package/dist/toRefundInputs-ZkvoR5Df.js.map +0 -1
- package/dist/validation-CDbOaDj7.cjs +0 -2
- package/dist/validation-CDbOaDj7.cjs.map +0 -1
- package/dist/validation-Dj3dqYtl.js +0 -30
- package/dist/validation-Dj3dqYtl.js.map +0 -1
- package/dist/verifyKeyPathSchnorrSignature-C6Cmk0R1.js.map +0 -1
- package/dist/verifyKeyPathSchnorrSignature-Cr5T4Aym.cjs +0 -2
- package/dist/verifyKeyPathSchnorrSignature-Cr5T4Aym.cjs.map +0 -1
- package/dist/verifyScriptPathSchnorrSignature-B7MhJmhy.js.map +0 -1
- package/dist/verifyScriptPathSchnorrSignature-BBS9oCPO.cjs +0 -2
- package/dist/verifyScriptPathSchnorrSignature-BBS9oCPO.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,263 +1,267 @@
|
|
|
1
|
-
import { P as s, h as t, i as r, j as i, f as o, b as n, a as P, c as p, k as c, d as
|
|
2
|
-
import { a as A } from "./
|
|
3
|
-
import { computeMinClaimValue as
|
|
4
|
-
import { a as
|
|
5
|
-
import { c as F, a as y, b as D, e as U, r as B } from "./noPayout
|
|
6
|
-
import { b as L } from "./challengeAssert-
|
|
7
|
-
import { c as
|
|
8
|
-
import {
|
|
9
|
-
import { c as
|
|
10
|
-
import {
|
|
11
|
-
import { P as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { B as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { B as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { a as
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
1
|
+
import { P as s, h as t, i as r, j as i, f as o, b as n, a as P, c as p, k as c, d as E, e as u, g as d } from "./verifyScriptPathSchnorrSignature-ZAZfFJ6S.js";
|
|
2
|
+
import { a as A } from "./vaultCoreVersion-D_fP9P3C.js";
|
|
3
|
+
import { computeMinClaimValue as _, computeMinPeginFee as g, deriveVaultId as T, expandAuthAnchor as m, expandHashlockSecret as S, expandWotsSeed as C, peginP2aAnchorOutput as O, supportedTxGraphVersions as f, validatePeginP2aAnchor as I } from "./tbv/core/wasm/index.js";
|
|
4
|
+
import { a as b, c as h, b as V, e as v, f as N } from "./verifyKeyPathSchnorrSignature-BrgUJmV0.js";
|
|
5
|
+
import { c as F, a as y, b as D, e as U, r as B } from "./noPayout--lxo7qe4.js";
|
|
6
|
+
import { b as L } from "./challengeAssert-Cp_GeRg8.js";
|
|
7
|
+
import { c as X, d as k, a as w, b as W, e as G, f as j, k as Y, g as J, h as z, i as Z, j as q, p as Q, s as $, t as aa, u as ea, v as sa } from "./bitcoin-C-TuHb-v.js";
|
|
8
|
+
import { c as ra } from "./abortSignals-BPpAUL1Z.js";
|
|
9
|
+
import { c as oa } from "./signing-DaLvGwQe.js";
|
|
10
|
+
import { B as Pa, C as pa, H as ca, K as Ea, M as ua, T as da, X as la } from "./validation-OSC0xTHB.js";
|
|
11
|
+
import { C as Ra, M as _a, P as ga, b as Ta, a as ma, c as Sa, d as Ca, f as Oa, e as fa } from "./PeginManager-Byvmccdd.js";
|
|
12
|
+
import { P as xa, c as ba, f as ha, r as Va, s as va, v as Na } from "./signPsbtsWithFallback-BjXdnI0X.js";
|
|
13
|
+
import { A as Fa, P as ya } from "./ProtocolParams.abi-C0TSRaHV.js";
|
|
14
|
+
import { B as Ua } from "./BTCVaultRegistry.abi-CJwWI2EO.js";
|
|
15
|
+
import { B as Ha } from "./BTCVaultRegistryKeyEpochs.abi-CXjhRZbm.js";
|
|
16
|
+
import { C as Ka, e as Xa, g as ka, h as wa, i as Wa } from "./errors-Blc-JWnI.js";
|
|
17
|
+
import { V as ja, b as Ya, a as Ja, d as za, f as Za, p as qa } from "./parseFundingOutpoints-DlINgQ3X.js";
|
|
18
|
+
import { BitcoinNetworks as $a } from "./shared/index.js";
|
|
19
|
+
import { B as ee, a as se, f as te, c as re, b as ie, d as oe, g as ne, i as Pe, h as pe, s as ce, e as Ee, w as ue } from "./waitForTransactionReceiptSmartAware-B6oYRdFO.js";
|
|
20
|
+
import { B as le, D as Ae, L as Re, M as _e, c as ge, P as Te, b as me, a as Se, S as Ce, T as Oe, W as fe, f as Ie, d as xe, p as be, r as he } from "./fundPeginTransaction-B2wyjqp0.js";
|
|
21
|
+
import { U as ve, a as Ne, e as Me, f as Fe, v as ye } from "./reservation-Cj9F0rP9.js";
|
|
22
|
+
import { M as Ue, V as Be, g as He, a as Le, b as Ke, c as Xe, d as ke, e as we, f as We, h as Ge, i as je, p as Ye, v as Je, j as ze, k as Ze } from "./mempoolApi-CRNMOsbC.js";
|
|
23
|
+
import { V as Qe, a as $e, b as as, v as es } from "./index-LgmJhdEN.js";
|
|
24
|
+
import { A as ts, D as rs, J as is, a as os, b as ns, d as Ps, P as ps, R as cs, e as Es, c as us, V as ds, i as ls } from "./json-rpc-client-DuUARJvV.js";
|
|
25
|
+
import { O as Rs, S as _s, b as gs, d as Ts, e as ms, f as Ss, V as Cs, c as Os, p as fs, r as Is, v as xs, a as bs } from "./primeVpAuth-D1qbOkhb.js";
|
|
26
|
+
import { a as Vs } from "./onChainBtcPubkey-DATNfAAl.js";
|
|
27
|
+
import { D as Ns, a as Ms, h as Fs, j as ys, P as Ds, k as Us, U as Bs, V as Hs, c as Ls, d as Ks, f as Xs, e as ks, b as ws, i as Ws, r as Gs, g as js, t as Ys } from "./toRefundInputs-CgXMcHrk.js";
|
|
28
|
+
import { H as zs, E as Zs, P as qs, o as Qs, c as $s, d as at, S as et, T as st, U as tt, V as rt, K as it, L as ot, M as nt, N as Pt, O as pt, R as ct, a as Et, b as ut, y as dt, Q as lt, I as At, J as Rt, g as _t, z as gt, p as Tt, i as mt, e as St, G as Ct, F as Ot, t as ft, A as It, B as xt, C as bt, D as ht, r as Vt, s as vt, f as Nt, h as Mt, j as Ft, v as yt, k as Dt, l as Ut, m as Bt, n as Ht, q as Lt, u as Kt, w as Xt, x as kt } from "./buildAndBroadcastReclaim-C0TdwO2M.js";
|
|
29
|
+
import { C as Wt, P as Gt, c as jt, g as Yt, i as Jt } from "./peginState-CxDiaKuk.js";
|
|
28
30
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
31
|
+
ts as AUTH_REJECTED_RPC_CODE,
|
|
32
|
+
Fa as ApplicationRegistryABI,
|
|
33
|
+
zs as BIP68NotMatureError,
|
|
34
|
+
Pa as BITCOIN_ADDRESS_RE,
|
|
35
|
+
Ua as BTCVaultRegistryABI,
|
|
36
|
+
Ha as BTCVaultRegistryKeyEpochsABI,
|
|
37
|
+
le as BTC_DUST_SAT,
|
|
38
|
+
$a as BitcoinNetworks,
|
|
39
|
+
ee as BitcoinScriptType,
|
|
40
|
+
Ra as COMMISSION_BPS_HEADROOM,
|
|
41
|
+
pa as COMPRESSED_PUBKEY_HEX_LEN,
|
|
42
|
+
Ka as CONTRACT_ERRORS,
|
|
43
|
+
Zs as ClaimerPegoutStatusValue,
|
|
44
|
+
Wt as ContractStatus,
|
|
45
|
+
Ns as DEPOSIT_TERMS_REJECTED_ERROR_NAME,
|
|
46
|
+
Ae as DUST_THRESHOLD,
|
|
47
|
+
rs as DaemonStatus,
|
|
48
|
+
Ms as DepositTermsRejectedError,
|
|
49
|
+
ca as HEX_RE,
|
|
50
|
+
is as JSON_RPC_ERROR_CODES,
|
|
51
|
+
os as JsonRpcClient,
|
|
52
|
+
ns as JsonRpcError,
|
|
53
|
+
Ea as KNOWN_SCRIPT_PREFIXES,
|
|
54
|
+
Re as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
55
|
+
_a as MAX_ACCEPTABLE_COMMISSION_BPS_CAP,
|
|
56
|
+
_e as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
57
|
+
ua as MAX_REASONABLE_FEE_SATS,
|
|
58
|
+
ge as MAX_REASONABLE_PEGIN_VBYTES,
|
|
59
|
+
Ue as MEMPOOL_API_URLS,
|
|
60
|
+
Rs as OnChainBtcVaultStatus,
|
|
61
|
+
Te as P2TR_INPUT_SIZE,
|
|
62
|
+
me as PEGIN_AUTH_ANCHOR_OUTPUTS,
|
|
60
63
|
s as PEGIN_DEPOSITOR_CLAIM_VOUT,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
qs as PEGIN_ETH_CONFIRMATIONS,
|
|
65
|
+
Se as PEGIN_FIXED_OUTPUTS,
|
|
66
|
+
Ps as POST_WOTS_STATUSES,
|
|
67
|
+
ps as PRE_DEPOSITOR_SIGNATURES_STATES,
|
|
68
|
+
Qs as ParticipantKeyDriftError,
|
|
69
|
+
xa as PayoutManager,
|
|
70
|
+
Gt as PeginAction,
|
|
71
|
+
ga as PeginManager,
|
|
72
|
+
Fs as PeginParamsAmbiguousError,
|
|
73
|
+
ys as PeginParamsIncompleteSpaceError,
|
|
74
|
+
Ds as PeginParamsNotFoundError,
|
|
75
|
+
$s as PeginRegistrationMissingError,
|
|
76
|
+
at as PeginRegistrationNotFinalError,
|
|
77
|
+
Us as PeginSizingIntegrityError,
|
|
78
|
+
ya as ProtocolParamsABI,
|
|
76
79
|
t as PsbtSubstitutionError,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
80
|
+
et as RECLAIM_MAX_FEE_FRACTION_DENOMINATOR,
|
|
81
|
+
st as RECLAIM_MAX_FEE_FRACTION_NUMERATOR,
|
|
82
|
+
tt as RECLAIM_MAX_FEE_RATE_SATS_VB,
|
|
83
|
+
rt as RECLAIM_WARN_FEE_FRACTION_NUMERATOR,
|
|
84
|
+
it as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
|
|
85
|
+
ot as REFUND_MAX_FEE_FRACTION_NUMERATOR,
|
|
86
|
+
nt as REFUND_MAX_FEE_RATE_SATS_VB,
|
|
87
|
+
Pt as REFUND_VSIZE,
|
|
88
|
+
pt as ReclaimUneconomicalError,
|
|
89
|
+
ct as RegisteredVaultVersionMismatchError,
|
|
90
|
+
cs as RpcErrorCode,
|
|
91
|
+
Ce as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
92
|
+
_s as ServerIdentityError,
|
|
93
|
+
da as TXID_RE,
|
|
94
|
+
Oe as TX_BUFFER_SIZE_OVERHEAD,
|
|
95
|
+
Bs as UnanchoredPrePeginError,
|
|
96
|
+
ve as UtxoNotAvailableError,
|
|
97
|
+
ja as VAULT_APP_NAME,
|
|
98
|
+
Es as VP_BATCH_MAX_SIZE,
|
|
99
|
+
us as VP_TERMINAL_FAILURE_STATUSES,
|
|
100
|
+
ds as VP_TRANSIENT_STATUSES,
|
|
101
|
+
Qe as VaultProviderRpcClient,
|
|
102
|
+
Hs as VaultRootMismatchError,
|
|
103
|
+
gs as ViemOperationKeyReader,
|
|
104
|
+
Ts as ViemProtocolParamsReader,
|
|
105
|
+
ms as ViemUniversalChallengerReader,
|
|
106
|
+
Ss as ViemVaultKeeperReader,
|
|
107
|
+
Be as ViemVaultRegistryReader,
|
|
108
|
+
$e as VpResponseValidationError,
|
|
109
|
+
Cs as VpTokenRegistry,
|
|
110
|
+
fe as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
111
|
+
la as X_ONLY_PUBKEY_HEX_LEN,
|
|
112
|
+
Et as activateVault,
|
|
113
|
+
ut as activateVaultAndRedeem,
|
|
114
|
+
se as applyChangeOutputPolicy,
|
|
115
|
+
b as assertKeyPathSchnorrSignature,
|
|
116
|
+
Vs as assertOnChainBtcPubkey,
|
|
113
117
|
r as assertPsbtUnsignedTxMatches,
|
|
114
118
|
h as assertReturnedKeyPathSignatures,
|
|
115
119
|
i as assertScriptPathSchnorrSignature,
|
|
116
|
-
|
|
120
|
+
Ne as assertUtxosAvailable,
|
|
117
121
|
A as assertValidVaultCoreVersion,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
dt as assertVaultProviderHintAccepted,
|
|
123
|
+
as as batchPollByProvider,
|
|
124
|
+
lt as buildAndBroadcastReclaim,
|
|
125
|
+
At as buildAndBroadcastRefund,
|
|
122
126
|
L as buildChallengeAssertPsbt,
|
|
123
|
-
|
|
124
|
-
|
|
127
|
+
Ta as buildDepositTerms,
|
|
128
|
+
Ya as buildFundingOutpointsCommitment,
|
|
125
129
|
F as buildNoPayoutPsbt,
|
|
126
130
|
o as buildPayoutPsbt,
|
|
127
131
|
V as buildPeginInputPsbt,
|
|
128
|
-
|
|
132
|
+
Ls as buildPeginParamsCandidates,
|
|
129
133
|
n as buildPeginTxFromFundedPrePegin,
|
|
130
134
|
P as buildPrePeginPsbt,
|
|
131
135
|
y as buildReclaimPsbt,
|
|
132
136
|
D as buildRefundPsbt,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
137
|
+
Ja as buildVaultContext,
|
|
138
|
+
te as calculateBtcTxHash,
|
|
139
|
+
jt as canPerformAction,
|
|
140
|
+
X as canonicalizeBtcPubkey,
|
|
141
|
+
ma as capMaxAcceptableCommissionBps,
|
|
142
|
+
ra as combineAbortSignals,
|
|
143
|
+
re as computeChangeOutputFeeSats,
|
|
144
|
+
ba as computeHashlock,
|
|
145
|
+
ie as computeMaxDeposit,
|
|
146
|
+
_ as computeMinClaimValue,
|
|
147
|
+
g as computeMinPeginFee,
|
|
144
148
|
p as computeNumLocalChallengers,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
149
|
+
oe as computePeginBaseFeeSats,
|
|
150
|
+
Sa as computeWotsBlockPublicKeysHash,
|
|
151
|
+
Os as createAuthenticatedVpClient,
|
|
148
152
|
c as createPayoutScript,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
oa as createTaprootScriptPathSignOptions,
|
|
154
|
+
k as deriveBip86ScriptPubKeyHex,
|
|
155
|
+
E as deriveDepositorClaimDescriptor,
|
|
156
|
+
u as deriveDepositorClaimScriptPubKey,
|
|
157
|
+
Ks as deriveHashlocksFromPrePegin,
|
|
154
158
|
w as deriveNativeSegwitAddress,
|
|
155
159
|
W as deriveTaprootAddress,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
T as deriveVaultId,
|
|
161
|
+
za as deriveVaultRoot,
|
|
162
|
+
Ca as deriveWotsBlocksFromSeed,
|
|
163
|
+
Xs as describePeginParamsCandidate,
|
|
164
|
+
ks as describeUnresolvedVersion,
|
|
161
165
|
G as ensureHexPrefix,
|
|
162
|
-
|
|
166
|
+
Oa as ensurePrePeginTermsApproval,
|
|
163
167
|
U as estimateReclaimFeeSats,
|
|
164
|
-
|
|
165
|
-
|
|
168
|
+
Rt as estimateRefundFeeSats,
|
|
169
|
+
fa as estimateSubmitPeginRequestBatchGas,
|
|
166
170
|
m as expandAuthAnchor,
|
|
167
171
|
S as expandHashlockSecret,
|
|
168
172
|
C as expandWotsSeed,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
173
|
+
Xa as extractErrorData,
|
|
174
|
+
Me as extractInputsFromTransaction,
|
|
175
|
+
d as extractPayoutSignature,
|
|
172
176
|
v as extractPeginInputSignature,
|
|
173
|
-
|
|
174
|
-
|
|
177
|
+
N as finalizePeginInputPsbt,
|
|
178
|
+
Fe as findOverlappingPendingVaults,
|
|
175
179
|
j as formatSatoshisToBtc,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
180
|
+
ha as forwardDepositApproval,
|
|
181
|
+
Za as forwardDeriveContextHash,
|
|
182
|
+
Ie as fundPeginTransaction,
|
|
183
|
+
He as getAddressTxs,
|
|
184
|
+
Le as getAddressUtxos,
|
|
185
|
+
ka as getContractErrorMessage,
|
|
186
|
+
ne as getDustThreshold,
|
|
187
|
+
Ke as getMempoolApiUrl,
|
|
188
|
+
Y as getNetwork,
|
|
189
|
+
Xe as getNetworkFees,
|
|
190
|
+
ke as getOutspend,
|
|
191
|
+
Yt as getPeginProtocolState,
|
|
192
|
+
Pe as getPsbtInputFields,
|
|
193
|
+
pe as getScriptType,
|
|
194
|
+
J as getSortedXOnlyPubkeys,
|
|
195
|
+
we as getTipHeight,
|
|
196
|
+
We as getTxHex,
|
|
197
|
+
Ge as getTxInfo,
|
|
198
|
+
je as getUtxoInfo,
|
|
199
|
+
wa as handleContractError,
|
|
200
|
+
z as hexToUint8Array,
|
|
201
|
+
Jt as isActivationDeadlinePassedOnChain,
|
|
198
202
|
Z as isAddressFromPublicKey,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
203
|
+
ls as isAuthRejectedError,
|
|
204
|
+
_t as isDepositAmountValid,
|
|
205
|
+
ws as isDepositTermsRejectedError,
|
|
206
|
+
gt as isHintAccepted,
|
|
207
|
+
Wa as isKnownContractError,
|
|
208
|
+
Tt as isParticipantKeyDriftError,
|
|
209
|
+
mt as isPeginRegistrationMissingError,
|
|
210
|
+
St as isPeginRegistrationNotFinalError,
|
|
211
|
+
Ct as isPegoutTerminalStatus,
|
|
212
|
+
Ot as isRecognizedPegoutStatus,
|
|
213
|
+
ft as isRegisteredVaultVersionMismatchError,
|
|
210
214
|
q as isValidHex,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
Ws as isWotsMismatchError,
|
|
216
|
+
It as matchKeyHint,
|
|
217
|
+
xt as matchKeySetHint,
|
|
218
|
+
qa as parseFundingOutpointsFromTx,
|
|
219
|
+
xe as parseUnfundedWasmTransaction,
|
|
220
|
+
be as peginOutputCount,
|
|
217
221
|
O as peginP2aAnchorOutput,
|
|
218
|
-
|
|
222
|
+
fs as primeVpTokenRegistry,
|
|
219
223
|
Q as processPublicKeyToXOnly,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
224
|
+
Ye as pushTx,
|
|
225
|
+
he as rateBasedTxBufferFee,
|
|
226
|
+
Gs as rebuildDepositTermsCore,
|
|
223
227
|
B as reclaimVsize,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
228
|
+
js as reconstructPeginParams,
|
|
229
|
+
Va as requireChangeAddress,
|
|
230
|
+
bt as resolveCurrentParticipantKeys,
|
|
231
|
+
ht as resolveParticipantKeysAtEpochs,
|
|
232
|
+
Is as resolveProtocolAddresses,
|
|
233
|
+
Vt as runDepositorPresignFlow,
|
|
234
|
+
ce as selectUtxosForPegin,
|
|
235
|
+
Ee as shouldAddChangeOutput,
|
|
236
|
+
vt as signDepositorGraph,
|
|
233
237
|
$ as stripHexPrefix,
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
+
Nt as submitWotsPublicKey,
|
|
239
|
+
f as supportedTxGraphVersions,
|
|
240
|
+
va as supportsDepositApproval,
|
|
241
|
+
Ys as toRefundInputs,
|
|
238
242
|
aa as toXOnly,
|
|
239
243
|
ea as uint8ArrayToHex,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
244
|
+
Mt as validateDepositAmount,
|
|
245
|
+
Ft as validateMultiVaultDepositInputs,
|
|
246
|
+
Je as validateOffchainParams,
|
|
247
|
+
yt as validateOnChainParticipantKeys,
|
|
248
|
+
ze as validatePegInConfiguration,
|
|
249
|
+
I as validatePeginP2aAnchor,
|
|
250
|
+
Dt as validateProviderSelection,
|
|
251
|
+
Ut as validateRemainingCapacity,
|
|
252
|
+
es as validateRequestDepositorClaimerArtifactsResponse,
|
|
253
|
+
Na as validateSecretAgainstHashlock,
|
|
254
|
+
Ze as validateTBVProtocolParams,
|
|
255
|
+
ye as validateUtxosAvailable,
|
|
256
|
+
Bt as validateVaultAmounts,
|
|
257
|
+
Ht as validateVaultProviderPubkey,
|
|
254
258
|
sa as validateWalletPubkey,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
259
|
+
Lt as verifyRegisteredParticipantKeys,
|
|
260
|
+
Kt as verifyRegisteredVaultVersions,
|
|
261
|
+
xs as verifyServerIdentity,
|
|
262
|
+
bs as vpTokenRegistry,
|
|
263
|
+
Xt as waitForPeginRegistrationDepth,
|
|
264
|
+
kt as waitForPeginStatus,
|
|
265
|
+
ue as waitForTransactionReceiptSmartAware
|
|
262
266
|
};
|
|
263
267
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const Q=require("@bitcoin-js/tiny-secp256k1-asmjs"),a=require("bitcoinjs-lib"),E=require("./sha2-DsrLC4NM.cjs"),u=require("buffer"),c=require("./BTCVaultRegistry.abi-z7d_eP22.cjs"),$=require("./BTCVaultRegistryKeyEpochs.abi-_NERAdc5.cjs"),A=require("./onChainBtcPubkey-B5ZvWCCF.cjs"),Y=require("./vaultCoreVersion-DYfw3qed.cjs"),Z=require("./abortSignals-msbmbqFe.cjs"),p=require("./validation-C6XTfZak.cjs");function J(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const m=J(Q),tt="BIP0322-signed-message",et="TapTweak",K=32,nt=64,ot=33,k=71,R=72,d=0,V=0,B=0,C=0,rt=32,it=4294967295,st=0,at=0,ct=32,ut=106;function U(t,e){const n=new TextEncoder().encode(t),o=E.sha256(n),i=new Uint8Array(o.length*2+e.length);return i.set(o,0),i.set(o,o.length),i.set(e,o.length*2),E.sha256(i)}function lt(t){if(t.length!==K)return null;const e=U(et,t),n=m.xOnlyPointAddTweak(t,e);return n?n.xOnlyPubkey:null}function H(t,e){const n=U(tt,t),o=new a.Transaction;o.version=V,o.locktime=B;const i=u.Buffer.concat([u.Buffer.from([at,ct]),u.Buffer.from(n)]);o.addInput(u.Buffer.alloc(rt,0),it,C,i),o.addOutput(e,d);const r=new a.Transaction;return r.version=V,r.locktime=B,r.addInput(o.getHash(),st,C),r.addOutput(u.Buffer.from([ut]),d),r}function ft(t,e,n,o=a.Transaction.SIGHASH_DEFAULT){if(e.length!==K||n.length!==nt||o!==a.Transaction.SIGHASH_DEFAULT&&o!==a.Transaction.SIGHASH_ALL)return!1;try{const i=a.payments.p2tr({internalPubkey:u.Buffer.from(e)});if(!i.output)return!1;const r=i.output,h=H(t,r).hashForWitnessV1(0,[r],[d],o),g=lt(e);return g?m.verifySchnorr(h,g,n):!1}catch{return!1}}function ht(t,e,n){if(e.length!==ot||n.length<k||n.length>R)return!1;try{if(!m.isPointCompressed(e))return!1;const{signature:o,hashType:i}=a.script.signature.decode(u.Buffer.from(n));if(!a.script.signature.encode(o,i).equals(u.Buffer.from(n))||i!==a.Transaction.SIGHASH_ALL)return!1;const r=a.payments.p2wpkh({pubkey:u.Buffer.from(e)});if(!r.output||!r.hash)return!1;const s=H(t,r.output),h=a.payments.p2pkh({hash:r.hash}).output;if(!h)return!1;const g=s.hashForWitnessV0(0,h,d,i);return m.verify(g,e,o,!0)}catch{return!1}}const w=65535,_=1e4,P=4294967295,v=255;function M(t){if(!Number.isInteger(t)||t<0||t>P)throw new Error(`Invalid offchainParamsVersion from contract: must be a uint32, got ${t}`)}function D(t){const e=[];if(t.timelockAssert<=0n&&e.push(`timelockAssert must be positive, got ${t.timelockAssert}`),t.timelockAssert>BigInt(w)&&e.push(`timelockAssert ${t.timelockAssert} exceeds uint16 max (${w})`),t.timelockChallengeAssert<=0n&&e.push(`timelockChallengeAssert must be positive, got ${t.timelockChallengeAssert}`),t.tRefund<=0&&e.push(`tRefund must be positive, got ${t.tRefund}`),t.tStale<=0&&e.push(`tStale must be positive, got ${t.tStale}`),t.securityCouncilKeys.length===0&&e.push("securityCouncilKeys must not be empty"),t.councilQuorum<=0&&e.push(`councilQuorum must be positive, got ${t.councilQuorum}`),t.councilQuorum>t.securityCouncilKeys.length&&e.push(`councilQuorum (${t.councilQuorum}) exceeds securityCouncilKeys count (${t.securityCouncilKeys.length})`),t.feeRate<=0n&&e.push(`feeRate must be positive, got ${t.feeRate}`),t.minPeginFeeRate<=0n&&e.push(`minPeginFeeRate must be positive, got ${t.minPeginFeeRate}`),(!Number.isInteger(t.proverCircuitVersion)||t.proverCircuitVersion<0||t.proverCircuitVersion>w)&&e.push(`proverCircuitVersion must be a uint16, got ${t.proverCircuitVersion}`),(!Number.isInteger(t.minPrepeginDepth)||t.minPrepeginDepth<=0||t.minPrepeginDepth>P)&&e.push(`minPrepeginDepth must be a uint32 in [1, ${P}], got ${t.minPrepeginDepth}`),t.babeTotalInstances<=0&&e.push(`babeTotalInstances must be positive, got ${t.babeTotalInstances}`),t.babeInstancesToFinalize<=0&&e.push(`babeInstancesToFinalize must be positive, got ${t.babeInstancesToFinalize}`),t.babeInstancesToFinalize>t.babeTotalInstances&&e.push(`babeInstancesToFinalize (${t.babeInstancesToFinalize}) exceeds babeTotalInstances (${t.babeTotalInstances})`),(t.minVpCommissionBps<0||t.minVpCommissionBps>_)&&e.push(`minVpCommissionBps must be in [0, ${_}], got ${t.minVpCommissionBps}`),e.length>0)throw new Error(`Invalid offchain protocol parameters: ${e.join("; ")}`)}function X(t){const e=[];if(t.minimumPegInAmount<=0n&&e.push(`minimumPegInAmount must be positive, got ${t.minimumPegInAmount}`),t.maxPegInAmount<t.minimumPegInAmount&&e.push(`maxPegInAmount (${t.maxPegInAmount}) must be >= minimumPegInAmount (${t.minimumPegInAmount})`),t.pegInAckTimeout<=0n&&e.push(`pegInAckTimeout must be positive, got ${t.pegInAckTimeout}`),t.pegInActivationTimeout<=0n&&e.push(`pegInActivationTimeout must be positive, got ${t.pegInActivationTimeout}`),(!Number.isInteger(t.maxHtlcOutputCount)||t.maxHtlcOutputCount<=0||t.maxHtlcOutputCount>v)&&e.push(`maxHtlcOutputCount must be an integer in [1, ${v}], got ${t.maxHtlcOutputCount}`),(typeof t.expiredPegInGraceBlocks!="bigint"||t.expiredPegInGraceBlocks<=0n)&&e.push(`expiredPegInGraceBlocks must be a positive bigint, got ${t.expiredPegInGraceBlocks}`),e.length>0)throw new Error(`Invalid TBV protocol parameters: ${e.join("; ")}`)}function gt(t){if(X(t),D(t.offchainParams),!Number.isInteger(t.offchainParamsVersion)||t.offchainParamsVersion<0||t.offchainParamsVersion>P)throw new Error(`Invalid peg-in configuration: offchainParamsVersion must be a uint32, got ${t.offchainParamsVersion}`);Y.assertValidVaultCoreVersion(t.activeVaultCoreVersion,"ProtocolParams.activeVaultCoreVersion()")}const S=9999;function O(t){return{depositor:t.depositor,depositorBtcPubKey:t.depositorBtcPubKey,amount:t.amount,vaultProvider:t.vaultProvider,status:t.status,applicationEntryPoint:t.applicationEntryPoint,createdAt:t.createdAt}}function b(t){const e=Number(t.offchainParamsVersion);return M(e),{depositorSignedPeginTx:t.depositorSignedPeginTx,universalChallengersVersion:t.universalChallengersVersion,appVaultKeepersVersion:t.appVaultKeepersVersion,offchainParamsVersion:e,verifiedAt:t.verifiedAt,depositorWotsPkHash:t.depositorWotsPkHash,hashlock:t.hashlock,htlcVout:t.htlcVout,depositorPopSignature:t.depositorPopSignature,prePeginTxHash:t.prePeginTxHash,vaultProviderCommissionBps:t.vaultProviderCommissionBps,claimExpiredUntil:t.claimExpiredUntil,vaultCoreVersion:t.vaultCoreVersion}}const pt=1n<<64n,x=0n;function T(t,e,n){if(t<0n||t>=pt)throw new Error(`getBtcVaultProtocolInfo returned ${e}=${t} for vault ${n}, outside the uint64 range — the registry may predate RFC-006`);return t}function F(t,e){return{vpKeyEpoch:T(t.vpKeyEpoch,"vpKeyEpoch",e),appKeeperKeyEpoch:T(t.appKeeperKeyEpoch,"appKeeperKeyEpoch",e),ucKeyEpoch:T(t.ucKeyEpoch,"ucKeyEpoch",e)}}class mt{constructor(e,n){this.publicClient=e,this.contractAddress=n}async getVaultProviderGenesisBtcPubKey(e){const n=await this.publicClient.readContract({address:this.contractAddress,abi:c.BTCVaultRegistryABI,functionName:"getOperationBtcKeyAtEpoch",args:[e,x]});return A.assertOnChainBtcPubkey(n,`getOperationBtcKeyAtEpoch (vp=${e}, epoch=${x})`)}async getCurrentVaultProviderOperationBtcKey(e){const n=await this.publicClient.readContract({address:this.contractAddress,abi:c.BTCVaultRegistryABI,functionName:"getCurrentOperationBtcKey",args:[e]});return A.assertOnChainBtcPubkey(n,`getCurrentOperationBtcKey (vp=${e})`)}async getVaultKeyEpochs(e){const n=await this.publicClient.readContract({address:this.contractAddress,abi:$.BTCVaultRegistryKeyEpochsABI,functionName:"getBtcVaultProtocolInfo",args:[e]});return F(n,e)}async getVaultKeyEpochsBatch(e){return e.length===0?[]:(await this.publicClient.multicall({contracts:e.map(o=>({address:this.contractAddress,abi:$.BTCVaultRegistryKeyEpochsABI,functionName:"getBtcVaultProtocolInfo",args:[o]})),allowFailure:!1})).map((o,i)=>F(o,e[i]))}async getVaultBasicInfo(e){const n=await this.publicClient.readContract({address:this.contractAddress,abi:c.BTCVaultRegistryABI,functionName:"getBtcVaultBasicInfo",args:[e]});return O(n)}async getVaultProtocolInfo(e){const n=await this.publicClient.readContract({address:this.contractAddress,abi:c.BTCVaultRegistryABI,functionName:"getBtcVaultProtocolInfo",args:[e]});return b(n)}async getProtocolInfoBatch(e){return e.length===0?[]:(await this.publicClient.multicall({contracts:e.map(o=>({address:this.contractAddress,abi:c.BTCVaultRegistryABI,functionName:"getBtcVaultProtocolInfo",args:[o]})),allowFailure:!1})).map((o,i)=>{const r=o;if(!r.depositorSignedPeginTx||r.depositorSignedPeginTx==="0x")throw new Error(`Vault ${e[i]} not found on-chain or has no pegin transaction`);return b(r)})}async getPegInFee(e){return await this.publicClient.readContract({address:this.contractAddress,abi:c.BTCVaultRegistryABI,functionName:"getPegInFee",args:[e]})}async getVaultProviderCommission(e){const n=await this.publicClient.readContract({address:this.contractAddress,abi:c.BTCVaultRegistryABI,functionName:"getVaultProviderCommission",args:[e]});if(!Number.isInteger(n)||n<0||n>S)throw new Error(`getVaultProviderCommission returned ${n} bps for ${e}, outside the protocol range [0, ${S}]`);return n}async getVaultData(e){const[n,o]=await this.publicClient.multicall({contracts:[{address:this.contractAddress,abi:c.BTCVaultRegistryABI,functionName:"getBtcVaultBasicInfo",args:[e]},{address:this.contractAddress,abi:c.BTCVaultRegistryABI,functionName:"getBtcVaultProtocolInfo",args:[e]}],allowFailure:!1}),i=O(n),r=b(o);if(!r.depositorSignedPeginTx||r.depositorSignedPeginTx==="0x")throw new Error(`Vault ${e} not found on-chain or has no pegin transaction`);return{basic:i,protocol:r}}}const dt=21e6*1e8,N=3e4;async function I(t,e){const n=new AbortController,o=setTimeout(()=>n.abort(),N),i=[n.signal,e==null?void 0:e.signal].filter(Boolean),r=Z.combineAbortSignals(i);try{return await fetch(t,{...e,signal:r.signal})}catch(s){throw clearTimeout(o),r.cleanup(),s!=null&&typeof s=="object"&&"name"in s&&s.name==="AbortError"?new Error(`Mempool API request timed out after ${N}ms: ${t}`):s}}const G=1e4;function L(t){return Number.isInteger(t)&&t>0&&t<=dt}function Pt(t){return Number.isInteger(t)&&t>0&&t<=G}function y(t,e){return!Number.isInteger(t)||t<0?!1:e===void 0||t<e}function f(t){if(!p.TXID_RE.test(t))throw new Error(`Invalid transaction ID format: ${t}`)}function q(t){if(!p.BITCOIN_ADDRESS_RE.test(t))throw new Error(`Invalid Bitcoin address format: ${t}`)}function W(t,e){if(!p.HEX_RE.test(t))throw new Error(`Invalid scriptPubKey: not valid hex for ${e}`);if(!p.KNOWN_SCRIPT_PREFIXES.some(o=>t.toLowerCase().startsWith(o)))throw new Error(`Unrecognized scriptPubKey type for ${e}: prefix ${t.slice(0,6)} does not match any known Bitcoin script type`)}const j={mainnet:"https://mempool.space/api",testnet:"https://mempool.space/testnet/api",signet:"https://mempool.space/signet/api"};async function l(t,e){try{const n=await I(t,e);if(!n.ok){const i=await n.text();throw new Error(`Mempool API error (${n.status}): ${i||n.statusText}`)}const o=n.headers.get("content-type");return o!=null&&o.includes("application/json")?await n.json():await n.text()}catch(n){throw n instanceof Error?new Error(`Failed to fetch from mempool API: ${n.message}`):new Error("Failed to fetch from mempool API: Unknown error")}}async function It(t,e){try{const n=await I(`${e}/tx`,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}});if(!n.ok){const i=await n.text();let r;try{const s=JSON.parse(i);r=s.message??s.error}catch{r=i}throw new Error(r||`Failed to broadcast transaction: ${n.statusText}`)}return await n.text()}catch(n){throw n instanceof Error?new Error(`Failed to broadcast BTC transaction: ${n.message}`):new Error("Failed to broadcast BTC transaction: Unknown error")}}async function z(t,e){return f(t),l(`${e}/tx/${t}`)}async function wt(t){const e=await l(`${t}/blocks/tip/height`),n=e.trim();if(!/^\d+$/.test(n))throw new Error(`Mempool API returned an invalid block tip height: "${e}"`);return Number.parseInt(n,10)}async function bt(t,e,n){if(f(t),!y(e))throw new Error(`Invalid vout ${e} for transaction ${t}`);return l(`${n}/tx/${t}/outspend/${e}`)}async function Tt(t,e){f(t);try{const n=await I(`${e}/tx/${t}/hex`);if(!n.ok){const o=await n.text();throw new Error(`Mempool API error (${n.status}): ${o||n.statusText}`)}return await n.text()}catch(n){throw n instanceof Error?new Error(`Failed to get transaction hex for ${t}: ${n.message}`):new Error(`Failed to get transaction hex for ${t}: Unknown error`)}}async function yt(t,e,n){f(t);const o=await z(t,n);if(!y(e,o.vout.length))throw new Error(`Invalid vout ${e} for transaction ${t} (has ${o.vout.length} outputs)`);const i=o.vout[e];if(!L(i.value))throw new Error(`Invalid UTXO value ${i.value} for ${t}:${e}`);return W(i.scriptpubkey,`${t}:${e}`),{txid:t,vout:e,value:i.value,scriptPubKey:i.scriptpubkey}}async function Et(t,e){q(t);try{const n=await l(`${e}/address/${t}/utxo`),o=await l(`${e}/v1/validate-address/${t}`);if(!o.isvalid)throw new Error(`Invalid Bitcoin address: ${t}. Mempool API validation failed.`);W(o.scriptPubKey,t);for(const r of n){if(f(r.txid),!y(r.vout))throw new Error(`Invalid vout ${r.vout} for ${r.txid}`);if(!L(r.value))throw new Error(`Invalid UTXO value ${r.value} for ${r.txid}:${r.vout}`)}return n.sort((r,s)=>s.value-r.value).map(r=>({txid:r.txid,vout:r.vout,value:r.value,scriptPubKey:o.scriptPubKey,confirmed:r.status.confirmed}))}catch(n){throw n instanceof Error?new Error(`Failed to get UTXOs for address ${t}: ${n.message}`):new Error(`Failed to get UTXOs for address ${t}: Unknown error`)}}function $t(t){return j[t]}async function At(t,e){return q(t),l(`${e}/address/${t}/txs`)}async function Vt(t){const e=await I(`${t}/v1/fees/recommended`);if(!e.ok)throw new Error(`Failed to fetch network fees: ${e.status} ${e.statusText}`);const n=await e.json(),o=["fastestFee","halfHourFee","hourFee","economyFee","minimumFee"];for(const i of o)if(!Pt(n[i]))throw new Error(`Invalid fee rate ${i}=${n[i]} from mempool API: expected a positive number ≤ ${G}`);if(n.minimumFee>n.economyFee||n.economyFee>n.hourFee||n.hourFee>n.halfHourFee||n.halfHourFee>n.fastestFee)throw new Error(`Fee rate ordering violation from mempool API: expected minimumFee (${n.minimumFee}) <= economyFee (${n.economyFee}) <= hourFee (${n.hourFee}) <= halfHourFee (${n.halfHourFee}) <= fastestFee (${n.fastestFee}).`);return n}exports.MEMPOOL_API_URLS=j;exports.P2WPKH_ENCODED_SIG_MAX=R;exports.P2WPKH_ENCODED_SIG_MIN=k;exports.ViemVaultRegistryReader=mt;exports.assertValidOffchainParamsVersion=M;exports.getAddressTxs=At;exports.getAddressUtxos=Et;exports.getMempoolApiUrl=$t;exports.getNetworkFees=Vt;exports.getOutspend=bt;exports.getTipHeight=wt;exports.getTxHex=Tt;exports.getTxInfo=z;exports.getUtxoInfo=yt;exports.pushTx=It;exports.validateOffchainParams=D;exports.validatePegInConfiguration=gt;exports.validateTBVProtocolParams=X;exports.verifyBip322P2wpkhSimple=ht;exports.verifyBip322Simple=ft;
|
|
2
|
+
//# sourceMappingURL=mempoolApi-BQllf-ji.cjs.map
|