@babylonlabs-io/ts-sdk 0.71.0 → 0.71.1
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-Bn8FxM35.cjs +2 -0
- package/dist/{PeginManager-BIKAnZ-X.cjs.map → PeginManager-Bn8FxM35.cjs.map} +1 -1
- package/dist/{PeginManager-Byvmccdd.js → PeginManager-C3ojNTlv.js} +6 -6
- package/dist/{PeginManager-Byvmccdd.js.map → PeginManager-C3ojNTlv.js.map} +1 -1
- package/dist/{buildAndBroadcastReclaim-C0TdwO2M.js → buildAndBroadcastReclaim-YvWDRAN8.js} +492 -489
- package/dist/{buildAndBroadcastReclaim-C0TdwO2M.js.map → buildAndBroadcastReclaim-YvWDRAN8.js.map} +1 -1
- package/dist/buildAndBroadcastReclaim-zfjDI5__.cjs +2 -0
- package/dist/{buildAndBroadcastReclaim-kRx7-o2y.cjs.map → buildAndBroadcastReclaim-zfjDI5__.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +227 -226
- package/dist/{mempoolApi-CRNMOsbC.js → mempoolApi-CKD_IbrM.js} +32 -33
- package/dist/mempoolApi-CKD_IbrM.js.map +1 -0
- package/dist/mempoolApi-DronQ5xn.cjs +2 -0
- package/dist/mempoolApi-DronQ5xn.cjs.map +1 -0
- package/dist/noPayout-DpGRzidi.js +353 -0
- package/dist/noPayout-DpGRzidi.js.map +1 -0
- package/dist/noPayout-zEifyecV.cjs +2 -0
- package/dist/noPayout-zEifyecV.cjs.map +1 -0
- package/dist/{primeVpAuth-tEXx9TGx.cjs → primeVpAuth-Cjq6qFHq.cjs} +2 -2
- package/dist/primeVpAuth-Cjq6qFHq.cjs.map +1 -0
- package/dist/{primeVpAuth-D1qbOkhb.js → primeVpAuth-tLRjdHwZ.js} +2 -2
- package/dist/primeVpAuth-tLRjdHwZ.js.map +1 -0
- package/dist/{signPsbtsWithFallback-BjXdnI0X.js → signPsbtsWithFallback-CCFTzE0o.js} +3 -3
- package/dist/{signPsbtsWithFallback-BjXdnI0X.js.map → signPsbtsWithFallback-CCFTzE0o.js.map} +1 -1
- package/dist/{signPsbtsWithFallback-zOQWokmk.cjs → signPsbtsWithFallback-CrkvpSJz.cjs} +2 -2
- package/dist/{signPsbtsWithFallback-zOQWokmk.cjs.map → signPsbtsWithFallback-CrkvpSJz.cjs.map} +1 -1
- package/dist/signing-BJ3X66b-.cjs +2 -0
- package/dist/signing-BJ3X66b-.cjs.map +1 -0
- package/dist/signing-Cm-McVR2.js +22 -0
- package/dist/signing-Cm-McVR2.js.map +1 -0
- package/dist/tbv/core/clients/eth/types.d.ts +0 -2
- package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
- 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/clients/mempool/mempoolApi.d.ts +9 -1
- package/dist/tbv/core/clients/mempool/mempoolApi.d.ts.map +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +222 -221
- 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 -0
- package/dist/tbv/core/primitives/index.d.ts.map +1 -1
- package/dist/tbv/core/primitives/index.js +23 -22
- package/dist/tbv/core/primitives/psbt/__tests__/finalizeScriptPathWithSignatures.test.d.ts +11 -0
- package/dist/tbv/core/primitives/psbt/__tests__/finalizeScriptPathWithSignatures.test.d.ts.map +1 -0
- package/dist/tbv/core/primitives/psbt/finalizeScriptPathWithSignatures.d.ts +52 -0
- package/dist/tbv/core/primitives/psbt/finalizeScriptPathWithSignatures.d.ts.map +1 -0
- package/dist/tbv/core/primitives/psbt/reclaim.d.ts +23 -1
- package/dist/tbv/core/primitives/psbt/reclaim.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/reclaim/__tests__/buildAndBroadcastReclaim.walletPsbt.test.d.ts +14 -0
- package/dist/tbv/core/services/reclaim/__tests__/buildAndBroadcastReclaim.walletPsbt.test.d.ts.map +1 -0
- package/dist/tbv/core/services/reclaim/buildAndBroadcastReclaim.d.ts +14 -2
- package/dist/tbv/core/services/reclaim/buildAndBroadcastReclaim.d.ts.map +1 -1
- package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts.map +1 -1
- package/dist/tbv/core/utils/index.cjs +1 -1
- package/dist/tbv/core/utils/index.js +13 -13
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +222 -221
- package/dist/toRefundInputs-CY9u84U9.cjs +2 -0
- package/dist/{toRefundInputs-Bdtz8p27.cjs.map → toRefundInputs-CY9u84U9.cjs.map} +1 -1
- package/dist/{toRefundInputs-CgXMcHrk.js → toRefundInputs-Df1vi23S.js} +5 -5
- package/dist/{toRefundInputs-CgXMcHrk.js.map → toRefundInputs-Df1vi23S.js.map} +1 -1
- package/dist/{verifyScriptPathSchnorrSignature-mzYCzaSy.cjs → verifyScriptPathSchnorrSignature-BfNUSgA7.cjs} +2 -2
- package/dist/{verifyScriptPathSchnorrSignature-mzYCzaSy.cjs.map → verifyScriptPathSchnorrSignature-BfNUSgA7.cjs.map} +1 -1
- package/dist/{verifyScriptPathSchnorrSignature-ZAZfFJ6S.js → verifyScriptPathSchnorrSignature-Ciq_xZhw.js} +5 -4
- package/dist/{verifyScriptPathSchnorrSignature-ZAZfFJ6S.js.map → verifyScriptPathSchnorrSignature-Ciq_xZhw.js.map} +1 -1
- package/dist/waitForTransactionReceiptSmartAware-DpQ69ySe.cjs +2 -0
- package/dist/waitForTransactionReceiptSmartAware-DpQ69ySe.cjs.map +1 -0
- package/dist/{waitForTransactionReceiptSmartAware-B6oYRdFO.js → waitForTransactionReceiptSmartAware-z3Xfmo44.js} +42 -47
- package/dist/waitForTransactionReceiptSmartAware-z3Xfmo44.js.map +1 -0
- package/package.json +1 -1
- package/dist/PeginManager-BIKAnZ-X.cjs +0 -2
- package/dist/buildAndBroadcastReclaim-kRx7-o2y.cjs +0 -2
- package/dist/mempoolApi-BQllf-ji.cjs +0 -2
- package/dist/mempoolApi-BQllf-ji.cjs.map +0 -1
- package/dist/mempoolApi-CRNMOsbC.js.map +0 -1
- package/dist/noPayout--lxo7qe4.js +0 -300
- package/dist/noPayout--lxo7qe4.js.map +0 -1
- package/dist/noPayout-CegnEwfp.cjs +0 -2
- package/dist/noPayout-CegnEwfp.cjs.map +0 -1
- package/dist/primeVpAuth-D1qbOkhb.js.map +0 -1
- package/dist/primeVpAuth-tEXx9TGx.cjs.map +0 -1
- package/dist/signing-Bnsro0hE.cjs +0 -2
- package/dist/signing-Bnsro0hE.cjs.map +0 -1
- package/dist/signing-DaLvGwQe.js +0 -16
- package/dist/signing-DaLvGwQe.js.map +0 -1
- package/dist/toRefundInputs-Bdtz8p27.cjs +0 -2
- package/dist/waitForTransactionReceiptSmartAware-B6oYRdFO.js.map +0 -1
- package/dist/waitForTransactionReceiptSmartAware-Ct7LPwPI.cjs +0 -2
- package/dist/waitForTransactionReceiptSmartAware-Ct7LPwPI.cjs.map +0 -1
package/dist/tbv/index.js
CHANGED
|
@@ -1,265 +1,266 @@
|
|
|
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
|
|
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 u, e as E, g as d } from "../verifyScriptPathSchnorrSignature-Ciq_xZhw.js";
|
|
2
2
|
import { a as A } from "../vaultCoreVersion-D_fP9P3C.js";
|
|
3
|
-
import { computeMinClaimValue as _, computeMinPeginFee as g, deriveVaultId as T, expandAuthAnchor as S, expandHashlockSecret as m, expandWotsSeed as C, peginP2aAnchorOutput as O, supportedTxGraphVersions as
|
|
3
|
+
import { computeMinClaimValue as _, computeMinPeginFee as g, deriveVaultId as T, expandAuthAnchor as S, expandHashlockSecret as m, expandWotsSeed as C, peginP2aAnchorOutput as O, supportedTxGraphVersions as f, validatePeginP2aAnchor as I } from "./core/wasm/index.js";
|
|
4
4
|
import { a as x, c as h, b as V, e as v, f as M } from "../verifyKeyPathSchnorrSignature-BrgUJmV0.js";
|
|
5
|
-
import { c as F, a as y, b as D, e as U,
|
|
6
|
-
import { b as
|
|
7
|
-
import { c as
|
|
8
|
-
import { c as
|
|
9
|
-
import { c as
|
|
10
|
-
import { B as
|
|
11
|
-
import { C as
|
|
12
|
-
import { P as
|
|
13
|
-
import { A as
|
|
14
|
-
import { B as
|
|
15
|
-
import { B as
|
|
16
|
-
import { C as
|
|
17
|
-
import { V as
|
|
18
|
-
import { B as
|
|
19
|
-
import { B as
|
|
20
|
-
import { U as
|
|
21
|
-
import { M as
|
|
22
|
-
import { V as
|
|
23
|
-
import { A as
|
|
24
|
-
import { O as
|
|
25
|
-
import { a as
|
|
26
|
-
import { D as
|
|
27
|
-
import { H as
|
|
28
|
-
import { C as
|
|
5
|
+
import { c as F, a as y, b as D, e as U, f as B, r as H } from "../noPayout-DpGRzidi.js";
|
|
6
|
+
import { b as K } from "../challengeAssert-Cp_GeRg8.js";
|
|
7
|
+
import { c as k, d as W, a as w, b as G, e as j, f as Y, k as z, g as J, h as Z, i as q, j as Q, p as $, s as aa, t as ea, u as sa, v as ta } from "../bitcoin-C-TuHb-v.js";
|
|
8
|
+
import { c as ia } from "../abortSignals-BPpAUL1Z.js";
|
|
9
|
+
import { c as na, a as Pa } from "../signing-Cm-McVR2.js";
|
|
10
|
+
import { B as ca, C as ua, H as Ea, K as da, M as la, T as Aa, X as Ra } from "../validation-OSC0xTHB.js";
|
|
11
|
+
import { C as ga, M as Ta, P as Sa, b as ma, a as Ca, c as Oa, d as fa, f as Ia, e as ba } from "../PeginManager-C3ojNTlv.js";
|
|
12
|
+
import { P as ha, c as Va, f as va, r as Ma, s as Na, v as Fa } from "../signPsbtsWithFallback-CCFTzE0o.js";
|
|
13
|
+
import { A as Da, P as Ua } from "../ProtocolParams.abi-C0TSRaHV.js";
|
|
14
|
+
import { B as Ha } from "../BTCVaultRegistry.abi-CJwWI2EO.js";
|
|
15
|
+
import { B as Ka } from "../BTCVaultRegistryKeyEpochs.abi-CXjhRZbm.js";
|
|
16
|
+
import { C as ka, e as Wa, g as wa, h as Ga, i as ja } from "../errors-Blc-JWnI.js";
|
|
17
|
+
import { V as za, b as Ja, a as Za, d as qa, f as Qa, p as $a } from "../parseFundingOutpoints-DlINgQ3X.js";
|
|
18
|
+
import { B as ee, a as se, c as te, b as re, d as ie, g as oe, h as ne, f as Pe, s as pe, e as ce, w as ue } from "../waitForTransactionReceiptSmartAware-z3Xfmo44.js";
|
|
19
|
+
import { B as de, D as le, L as Ae, M as Re, c as _e, P as ge, b as Te, a as Se, S as me, T as Ce, W as Oe, f as fe, d as Ie, p as be, r as xe } from "../fundPeginTransaction-B2wyjqp0.js";
|
|
20
|
+
import { U as Ve, a as ve, e as Me, f as Ne, v as Fe } from "../reservation-Cj9F0rP9.js";
|
|
21
|
+
import { M as De, V as Ue, g as Be, a as He, b as Le, c as Ke, d as Xe, e as ke, f as We, h as we, i as Ge, p as je, v as Ye, j as ze, k as Je } from "../mempoolApi-CKD_IbrM.js";
|
|
22
|
+
import { V as qe, a as Qe, b as $e, v as as } from "../index-LgmJhdEN.js";
|
|
23
|
+
import { A as ss, D as ts, J as rs, a as is, b as os, d as ns, P as Ps, R as ps, e as cs, c as us, V as Es, i as ds } from "../json-rpc-client-DuUARJvV.js";
|
|
24
|
+
import { O as As, S as Rs, b as _s, d as gs, e as Ts, f as Ss, V as ms, c as Cs, p as Os, r as fs, v as Is, a as bs } from "../primeVpAuth-tLRjdHwZ.js";
|
|
25
|
+
import { a as hs } from "../onChainBtcPubkey-DATNfAAl.js";
|
|
26
|
+
import { D as vs, a as Ms, h as Ns, j as Fs, P as ys, k as Ds, U as Us, V as Bs, c as Hs, d as Ls, f as Ks, e as Xs, b as ks, i as Ws, r as ws, g as Gs, t as js } from "../toRefundInputs-Df1vi23S.js";
|
|
27
|
+
import { H as zs, E as Js, P as Zs, o as qs, c as Qs, d as $s, S as at, T as et, U as st, V as tt, K as rt, L as it, M as ot, N as nt, O as Pt, R as pt, a as ct, b as ut, y as Et, Q as dt, I as lt, J as At, g as Rt, z as _t, p as gt, i as Tt, e as St, G as mt, F as Ct, t as Ot, A as ft, B as It, C as bt, D as xt, r as ht, s as Vt, f as vt, h as Mt, j as Nt, v as Ft, k as yt, l as Dt, m as Ut, n as Bt, q as Ht, u as Lt, w as Kt, x as Xt } from "../buildAndBroadcastReclaim-YvWDRAN8.js";
|
|
28
|
+
import { C as Wt, P as wt, c as Gt, g as jt, i as Yt } from "../peginState-CxDiaKuk.js";
|
|
29
29
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
ss as AUTH_REJECTED_RPC_CODE,
|
|
31
|
+
Da as ApplicationRegistryABI,
|
|
32
|
+
zs as BIP68NotMatureError,
|
|
33
|
+
ca as BITCOIN_ADDRESS_RE,
|
|
34
|
+
Ha as BTCVaultRegistryABI,
|
|
35
|
+
Ka as BTCVaultRegistryKeyEpochsABI,
|
|
36
|
+
de as BTC_DUST_SAT,
|
|
37
|
+
ee as BitcoinScriptType,
|
|
38
|
+
ga as COMMISSION_BPS_HEADROOM,
|
|
39
|
+
ua as COMPRESSED_PUBKEY_HEX_LEN,
|
|
40
|
+
ka as CONTRACT_ERRORS,
|
|
41
41
|
Js as ClaimerPegoutStatusValue,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
42
|
+
Wt as ContractStatus,
|
|
43
|
+
vs as DEPOSIT_TERMS_REJECTED_ERROR_NAME,
|
|
44
|
+
le as DUST_THRESHOLD,
|
|
45
|
+
ts as DaemonStatus,
|
|
46
|
+
Ms as DepositTermsRejectedError,
|
|
47
|
+
Ea as HEX_RE,
|
|
48
|
+
rs as JSON_RPC_ERROR_CODES,
|
|
49
|
+
is as JsonRpcClient,
|
|
50
|
+
os as JsonRpcError,
|
|
51
|
+
da as KNOWN_SCRIPT_PREFIXES,
|
|
52
|
+
Ae as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
53
|
+
Ta as MAX_ACCEPTABLE_COMMISSION_BPS_CAP,
|
|
54
|
+
Re as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
55
|
+
la as MAX_REASONABLE_FEE_SATS,
|
|
56
|
+
_e as MAX_REASONABLE_PEGIN_VBYTES,
|
|
57
|
+
De as MEMPOOL_API_URLS,
|
|
58
|
+
As as OnChainBtcVaultStatus,
|
|
59
|
+
ge as P2TR_INPUT_SIZE,
|
|
60
|
+
Te as PEGIN_AUTH_ANCHOR_OUTPUTS,
|
|
61
61
|
s as PEGIN_DEPOSITOR_CLAIM_VOUT,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
Zs as PEGIN_ETH_CONFIRMATIONS,
|
|
63
|
+
Se as PEGIN_FIXED_OUTPUTS,
|
|
64
|
+
ns as POST_WOTS_STATUSES,
|
|
65
|
+
Ps as PRE_DEPOSITOR_SIGNATURES_STATES,
|
|
66
|
+
qs as ParticipantKeyDriftError,
|
|
67
|
+
ha as PayoutManager,
|
|
68
68
|
wt as PeginAction,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
Sa as PeginManager,
|
|
70
|
+
Ns as PeginParamsAmbiguousError,
|
|
71
|
+
Fs as PeginParamsIncompleteSpaceError,
|
|
72
|
+
ys as PeginParamsNotFoundError,
|
|
73
|
+
Qs as PeginRegistrationMissingError,
|
|
74
|
+
$s as PeginRegistrationNotFinalError,
|
|
75
|
+
Ds as PeginSizingIntegrityError,
|
|
76
|
+
Ua as ProtocolParamsABI,
|
|
77
77
|
t as PsbtSubstitutionError,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
78
|
+
at as RECLAIM_MAX_FEE_FRACTION_DENOMINATOR,
|
|
79
|
+
et as RECLAIM_MAX_FEE_FRACTION_NUMERATOR,
|
|
80
|
+
st as RECLAIM_MAX_FEE_RATE_SATS_VB,
|
|
81
|
+
tt as RECLAIM_WARN_FEE_FRACTION_NUMERATOR,
|
|
82
|
+
rt as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
|
|
83
|
+
it as REFUND_MAX_FEE_FRACTION_NUMERATOR,
|
|
84
|
+
ot as REFUND_MAX_FEE_RATE_SATS_VB,
|
|
85
|
+
nt as REFUND_VSIZE,
|
|
86
|
+
Pt as ReclaimUneconomicalError,
|
|
87
|
+
pt as RegisteredVaultVersionMismatchError,
|
|
88
|
+
ps as RpcErrorCode,
|
|
89
|
+
me as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
90
|
+
Rs as ServerIdentityError,
|
|
91
|
+
Aa as TXID_RE,
|
|
92
|
+
Ce as TX_BUFFER_SIZE_OVERHEAD,
|
|
93
|
+
Us as UnanchoredPrePeginError,
|
|
94
|
+
Ve as UtxoNotAvailableError,
|
|
95
|
+
za as VAULT_APP_NAME,
|
|
96
|
+
cs as VP_BATCH_MAX_SIZE,
|
|
97
|
+
us as VP_TERMINAL_FAILURE_STATUSES,
|
|
98
98
|
Es as VP_TRANSIENT_STATUSES,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
99
|
+
qe as VaultProviderRpcClient,
|
|
100
|
+
Bs as VaultRootMismatchError,
|
|
101
|
+
_s as ViemOperationKeyReader,
|
|
102
|
+
gs as ViemProtocolParamsReader,
|
|
103
|
+
Ts as ViemUniversalChallengerReader,
|
|
104
|
+
Ss as ViemVaultKeeperReader,
|
|
105
|
+
Ue as ViemVaultRegistryReader,
|
|
106
|
+
Qe as VpResponseValidationError,
|
|
107
|
+
ms as VpTokenRegistry,
|
|
108
|
+
Oe as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
109
|
+
Ra as X_ONLY_PUBKEY_HEX_LEN,
|
|
110
|
+
ct as activateVault,
|
|
111
|
+
ut as activateVaultAndRedeem,
|
|
112
|
+
se as applyChangeOutputPolicy,
|
|
113
113
|
x as assertKeyPathSchnorrSignature,
|
|
114
|
-
|
|
114
|
+
hs as assertOnChainBtcPubkey,
|
|
115
115
|
r as assertPsbtUnsignedTxMatches,
|
|
116
116
|
h as assertReturnedKeyPathSignatures,
|
|
117
117
|
i as assertScriptPathSchnorrSignature,
|
|
118
|
-
|
|
118
|
+
ve as assertUtxosAvailable,
|
|
119
119
|
A as assertValidVaultCoreVersion,
|
|
120
120
|
Et as assertVaultProviderHintAccepted,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
$e as batchPollByProvider,
|
|
122
|
+
dt as buildAndBroadcastReclaim,
|
|
123
|
+
lt as buildAndBroadcastRefund,
|
|
124
|
+
K as buildChallengeAssertPsbt,
|
|
125
|
+
ma as buildDepositTerms,
|
|
126
|
+
Ja as buildFundingOutpointsCommitment,
|
|
127
127
|
F as buildNoPayoutPsbt,
|
|
128
128
|
o as buildPayoutPsbt,
|
|
129
129
|
V as buildPeginInputPsbt,
|
|
130
|
-
|
|
130
|
+
Hs as buildPeginParamsCandidates,
|
|
131
131
|
n as buildPeginTxFromFundedPrePegin,
|
|
132
132
|
P as buildPrePeginPsbt,
|
|
133
133
|
y as buildReclaimPsbt,
|
|
134
134
|
D as buildRefundPsbt,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
Za as buildVaultContext,
|
|
136
|
+
na as calculateBtcTxHash,
|
|
137
|
+
Gt as canPerformAction,
|
|
138
|
+
k as canonicalizeBtcPubkey,
|
|
139
|
+
Ca as capMaxAcceptableCommissionBps,
|
|
140
|
+
ia as combineAbortSignals,
|
|
141
|
+
te as computeChangeOutputFeeSats,
|
|
142
|
+
Va as computeHashlock,
|
|
143
|
+
re as computeMaxDeposit,
|
|
144
144
|
_ as computeMinClaimValue,
|
|
145
145
|
g as computeMinPeginFee,
|
|
146
146
|
p as computeNumLocalChallengers,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
ie as computePeginBaseFeeSats,
|
|
148
|
+
Oa as computeWotsBlockPublicKeysHash,
|
|
149
|
+
Cs as createAuthenticatedVpClient,
|
|
150
150
|
c as createPayoutScript,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
Pa as createTaprootScriptPathSignOptions,
|
|
152
|
+
W as deriveBip86ScriptPubKeyHex,
|
|
153
|
+
u as deriveDepositorClaimDescriptor,
|
|
154
|
+
E as deriveDepositorClaimScriptPubKey,
|
|
155
|
+
Ls as deriveHashlocksFromPrePegin,
|
|
156
156
|
w as deriveNativeSegwitAddress,
|
|
157
|
-
|
|
157
|
+
G as deriveTaprootAddress,
|
|
158
158
|
T as deriveVaultId,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
159
|
+
qa as deriveVaultRoot,
|
|
160
|
+
fa as deriveWotsBlocksFromSeed,
|
|
161
|
+
Ks as describePeginParamsCandidate,
|
|
162
|
+
Xs as describeUnresolvedVersion,
|
|
163
|
+
j as ensureHexPrefix,
|
|
164
|
+
Ia as ensurePrePeginTermsApproval,
|
|
165
165
|
U as estimateReclaimFeeSats,
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
At as estimateRefundFeeSats,
|
|
167
|
+
ba as estimateSubmitPeginRequestBatchGas,
|
|
168
168
|
S as expandAuthAnchor,
|
|
169
169
|
m as expandHashlockSecret,
|
|
170
170
|
C as expandWotsSeed,
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
Wa as extractErrorData,
|
|
172
|
+
Me as extractInputsFromTransaction,
|
|
173
173
|
d as extractPayoutSignature,
|
|
174
174
|
v as extractPeginInputSignature,
|
|
175
175
|
M as finalizePeginInputPsbt,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
Be as
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
Ke as
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
ne as
|
|
176
|
+
B as finalizeScriptPathWithSignatures,
|
|
177
|
+
Ne as findOverlappingPendingVaults,
|
|
178
|
+
Y as formatSatoshisToBtc,
|
|
179
|
+
va as forwardDepositApproval,
|
|
180
|
+
Qa as forwardDeriveContextHash,
|
|
181
|
+
fe as fundPeginTransaction,
|
|
182
|
+
Be as getAddressTxs,
|
|
183
|
+
He as getAddressUtxos,
|
|
184
|
+
wa as getContractErrorMessage,
|
|
185
|
+
oe as getDustThreshold,
|
|
186
|
+
Le as getMempoolApiUrl,
|
|
187
|
+
z as getNetwork,
|
|
188
|
+
Ke as getNetworkFees,
|
|
189
|
+
Xe as getOutspend,
|
|
190
|
+
jt as getPeginProtocolState,
|
|
191
|
+
ne as getPsbtInputFields,
|
|
192
|
+
Pe as getScriptType,
|
|
192
193
|
J as getSortedXOnlyPubkeys,
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
ke as getTipHeight,
|
|
195
|
+
We as getTxHex,
|
|
195
196
|
we as getTxInfo,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
197
|
+
Ge as getUtxoInfo,
|
|
198
|
+
Ga as handleContractError,
|
|
199
|
+
Z as hexToUint8Array,
|
|
200
|
+
Yt as isActivationDeadlinePassedOnChain,
|
|
201
|
+
q as isAddressFromPublicKey,
|
|
202
|
+
ds as isAuthRejectedError,
|
|
203
|
+
Rt as isDepositAmountValid,
|
|
204
|
+
ks as isDepositTermsRejectedError,
|
|
205
|
+
_t as isHintAccepted,
|
|
206
|
+
ja as isKnownContractError,
|
|
207
|
+
gt as isParticipantKeyDriftError,
|
|
208
|
+
Tt as isPeginRegistrationMissingError,
|
|
209
|
+
St as isPeginRegistrationNotFinalError,
|
|
210
|
+
mt as isPegoutTerminalStatus,
|
|
211
|
+
Ct as isRecognizedPegoutStatus,
|
|
212
|
+
Ot as isRegisteredVaultVersionMismatchError,
|
|
213
|
+
Q as isValidHex,
|
|
214
|
+
Ws as isWotsMismatchError,
|
|
215
|
+
ft as matchKeyHint,
|
|
215
216
|
It as matchKeySetHint,
|
|
216
|
-
|
|
217
|
+
$a as parseFundingOutpointsFromTx,
|
|
217
218
|
Ie as parseUnfundedWasmTransaction,
|
|
218
|
-
|
|
219
|
+
be as peginOutputCount,
|
|
219
220
|
O as peginP2aAnchorOutput,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
221
|
+
Os as primeVpTokenRegistry,
|
|
222
|
+
$ as processPublicKeyToXOnly,
|
|
223
|
+
je as pushTx,
|
|
224
|
+
xe as rateBasedTxBufferFee,
|
|
224
225
|
ws as rebuildDepositTermsCore,
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
226
|
+
H as reclaimVsize,
|
|
227
|
+
Gs as reconstructPeginParams,
|
|
228
|
+
Ma as requireChangeAddress,
|
|
229
|
+
bt as resolveCurrentParticipantKeys,
|
|
230
|
+
xt as resolveParticipantKeysAtEpochs,
|
|
231
|
+
fs as resolveProtocolAddresses,
|
|
232
|
+
ht as runDepositorPresignFlow,
|
|
233
|
+
pe as selectUtxosForPegin,
|
|
234
|
+
ce as shouldAddChangeOutput,
|
|
235
|
+
Vt as signDepositorGraph,
|
|
236
|
+
aa as stripHexPrefix,
|
|
237
|
+
vt as submitWotsPublicKey,
|
|
238
|
+
f as supportedTxGraphVersions,
|
|
239
|
+
Na as supportsDepositApproval,
|
|
240
|
+
js as toRefundInputs,
|
|
241
|
+
ea as toXOnly,
|
|
242
|
+
sa as uint8ArrayToHex,
|
|
243
|
+
Mt as validateDepositAmount,
|
|
244
|
+
Nt as validateMultiVaultDepositInputs,
|
|
245
|
+
Ye as validateOffchainParams,
|
|
246
|
+
Ft as validateOnChainParticipantKeys,
|
|
247
|
+
ze as validatePegInConfiguration,
|
|
248
|
+
I as validatePeginP2aAnchor,
|
|
249
|
+
yt as validateProviderSelection,
|
|
250
|
+
Dt as validateRemainingCapacity,
|
|
251
|
+
as as validateRequestDepositorClaimerArtifactsResponse,
|
|
252
|
+
Fa as validateSecretAgainstHashlock,
|
|
252
253
|
Je as validateTBVProtocolParams,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
254
|
+
Fe as validateUtxosAvailable,
|
|
255
|
+
Ut as validateVaultAmounts,
|
|
256
|
+
Bt as validateVaultProviderPubkey,
|
|
257
|
+
ta as validateWalletPubkey,
|
|
258
|
+
Ht as verifyRegisteredParticipantKeys,
|
|
259
|
+
Lt as verifyRegisteredVaultVersions,
|
|
259
260
|
Is as verifyServerIdentity,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
bs as vpTokenRegistry,
|
|
262
|
+
Kt as waitForPeginRegistrationDepth,
|
|
263
|
+
Xt as waitForPeginStatus,
|
|
264
|
+
ue as waitForTransactionReceiptSmartAware
|
|
264
265
|
};
|
|
265
266
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var te=Object.defineProperty;var re=(e,t,r)=>t in e?te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var K=(e,t,r)=>re(e,typeof t!="symbol"?t+"":t,r);const ne=require("./sha2-DsrLC4NM.cjs"),S=require("./signPsbtsWithFallback-CrkvpSJz.cjs"),q=require("./PeginManager-Bn8FxM35.cjs"),p=require("./bitcoin-D-O2GjbC.cjs"),f=require("./tbv/core/wasm/index.cjs"),N=require("./parseFundingOutpoints-BkgGihaY.cjs"),U=require("bitcoinjs-lib"),H=require("./verifyScriptPathSchnorrSignature-BfNUSgA7.cjs"),z=require("./fundPeginTransaction-BLD8FRL9.cjs"),j=require("./signing-BJ3X66b-.cjs"),M="DepositTermsRejectedError";class L extends Error{constructor(r,n="device-envelope"){super(r);K(this,"reason");this.name=M,this.reason=n}}function oe(e){if(e instanceof L)return!0;if(typeof e!="object"||e===null)return!1;const t=e;return t.name===M&&t.reason==="device-envelope"}async function W(e){const t=e.siblings.length;if(t===0)throw new Error("rebuildDepositTermsCore: at least one sibling is required");for(const[o,b]of e.siblings.entries())if(b.amount<=0n)throw new Error(`rebuildDepositTermsCore: sibling[${o}] has non-positive on-chain pegin amount ${b.amount}; the chain-read vault record is invalid. Resume refused.`);if(e.prepeginMaxFee<=0n)throw new Error(`rebuildDepositTermsCore: prepeginMaxFee must be > 0, got ${e.prepeginMaxFee}`);const r=p.stripHexPrefix(e.prepeginTxid).toLowerCase(),n=p.stripHexPrefix(j.calculateBtcTxHash(e.fundedPrePeginTxHex)).toLowerCase();if(n!==r)throw new Error(`Funded Pre-PegIn tx hashes to ${n}, expected ${r} (on-chain prepeginTxid). Resume refused.`);const h=S.findAuthAnchorOpReturn(p.stripHexPrefix(e.fundedPrePeginTxHex));if(h===void 0)throw new Error("Funded Pre-PegIn carries no single, unambiguous auth-anchor OP_RETURN commitment — it either predates auth anchoring or is malformed. The intent resume path requires the anchor to prove sibling completeness. Resume refused.");if(h.vout!==t)throw new Error(`Auth-anchor OP_RETURN at vout ${h.vout} does not match the discovered sibling count ${t}; the discovered sibling set does not cover this transaction's HTLC outputs (a lagging index can cause this — retry later). Resume refused.`);const c=e.vaultKeeperBtcPubkeys.length,u=e.universalChallengerBtcPubkeys.length,l=await f.computeMinClaimValue(e.vaultCoreVersion,c,u,e.councilQuorum,e.councilSize,e.protocolFeeRate),a=await f.computeMinPeginFee(e.vaultCoreVersion,c,u,e.minPeginFeeRate),d=await f.peginP2aAnchorOutput(e.vaultCoreVersion),s=(d==null?void 0:d.value)??0n;if(l<=0n)throw new Error(`WASM returned non-positive depositorClaimValue ${l}; expected > 0. Resume refused.`);if(a<=0n)throw new Error(`WASM returned non-positive peginMaxFee ${a}; expected > 0. Resume refused.`);if(s<0n)throw new Error(`WASM returned negative P2A anchor value ${s}. Resume refused.`);const i=a+s,v=e.minPeginFeeRate*z.MAX_REASONABLE_PEGIN_VBYTES;if(i<=0n||i>v)throw new Error(`WASM implied PegIn reserve ${i} sat is outside (0, ${v}] (minPeginFeeRate=${e.minPeginFeeRate} × ${z.MAX_REASONABLE_PEGIN_VBYTES} vbytes). Resume refused.`);const E=e.siblings.map(o=>o.amount+l+a+s),R=await Promise.all(e.siblings.map(async o=>(await f.getPrePeginHtlcConnectorInfo({txGraphVersion:e.vaultCoreVersion,depositorPubkey:e.depositorBtcPubkey,vaultProviderPubkey:e.vaultProviderBtcPubkey,vaultKeeperPubkeys:[...e.vaultKeeperBtcPubkeys],universalChallengerPubkeys:[...e.universalChallengerBtcPubkeys],hashlock:p.stripHexPrefix(o.hashlock),timelockRefund:e.timelockRefund,network:e.network})).scriptPubKey)),w=U.Transaction.fromHex(p.stripHexPrefix(e.fundedPrePeginTxHex)).outs.map(o=>({value:o.value,script:o.script}));return H.assertEncodedHtlcOutputsMatch(w,E,R),q.buildDepositTerms({vaultCoreVersion:e.vaultCoreVersion,protocolFeeRate:e.protocolFeeRate,timelockPegin:e.timelockPegin,timelockAssert:e.timelockAssert,timelockRefund:e.timelockRefund,prepeginTxid:e.prepeginTxid,prepeginMaxFee:e.prepeginMaxFee,vaultProviderBtcPubkey:e.vaultProviderBtcPubkey,vaultKeeperBtcPubkeys:e.vaultKeeperBtcPubkeys,universalChallengerBtcPubkeys:e.universalChallengerBtcPubkeys,maxAcceptableCommissionBps:e.maxAcceptableCommissionBps,peginAmounts:e.siblings.map(o=>o.amount),depositorClaimValue:l,peginMaxFee:a})}function se(e){const t=(e instanceof Error?e.message:typeof e=="string"?e:"").toLowerCase();return t.includes("wots")&&t.includes("hash")&&t.includes("does not match")}class Q extends Error{constructor(t,r){super(`Re-derived vault root does not match this Pre-PegIn: derived auth-anchor hash ${t}, transaction commits to ${r}. Connect the same wallet, on the same account and the same network, that created the deposit.`),this.derivedAuthAnchorHash=t,this.onChainAuthAnchorHash=r,this.name="VaultRootMismatchError"}}class A extends Error{constructor(t){super(t),this.name="UnanchoredPrePeginError"}}class X extends Error{constructor(t,r,n=[]){super(`No candidate parameter set reproduces this Pre-PegIn's HTLC outputs (${t} candidate(s) tried). `+(n.length>0?`${n.length} version(s) could not be resolved and may hold the answer: ${n.join(" | ")}. `:"")+`Sample rejections: ${r.join(" | ")}`),this.candidatesTried=t,this.sampleRejections=r,this.unresolvedLabels=n,this.name="PeginParamsNotFoundError"}}class J extends Error{constructor(t){super(`${t.length} candidate parameter sets reproduce this Pre-PegIn's HTLC outputs, so the vault's stamped versions cannot be determined: ${t.join(" | ")}. Reconstruction refused.`),this.survivorLabels=t,this.name="PeginParamsAmbiguousError"}}class G extends Error{constructor(t,r){super(`A candidate matched this Pre-PegIn (${t}), but ${r.length} version(s) could not be resolved, so the search space did not provably contain the true parameters: ${r.join(" | ")}. A version sharing the matched timelockRefund and participants is indistinguishable from the true one, so the match cannot be trusted. Reconstruction refused.`),this.matchedLabel=t,this.unresolvedLabels=r,this.name="PeginParamsIncompleteSpaceError"}}class T extends Error{constructor(t){super(`${t}. Reconstruction refused.`),this.name="PeginSizingIntegrityError"}}async function ie(e){const{wallet:t,depositorBtcPubkey:r,fundedPrePeginTxHex:n}=e,h=p.stripHexPrefix(n),c=S.findAuthAnchorOpReturn(h);if(c===void 0)throw new A("Pre-PegIn carries no single, unambiguous auth-anchor OP_RETURN, so the number of HTLC outputs it funds cannot be determined. Legacy pre-anchor deposits are not recoverable by this path.");const u=c.vout;if(u===0)throw new A("Pre-PegIn's auth-anchor OP_RETURN is at vout 0, implying zero HTLC outputs; there is nothing to recover.");const l=N.parseFundingOutpointsFromTx(h),a=await N.deriveVaultRoot(t,{depositorBtcPubkey:p.hexToUint8Array(p.processPublicKeyToXOnly(r)),fundingOutpoints:l});try{const s=await f.expandAuthAnchor(a);let i;try{i=p.uint8ArrayToHex(ne.sha256(s))}finally{s.fill(0)}if(i!==c.hash)throw new Q(i,c.hash)}catch(s){throw a.fill(0),s}const{hashlocks:d}=await q.expandPerVaultSecrets(a,u);return{vaultCount:u,hashlocks:d,authAnchorHash:c.hash}}function ae(e){const{vaultCoreVersion:t,offchainParams:r,participantKeySets:n}=e;if(!Number.isInteger(t)||t<1)throw new Error(`buildPeginParamsCandidates: vaultCoreVersion must be a positive integer, got ${t}`);if(r.length===0)throw new Error("buildPeginParamsCandidates: at least one offchain-params version is required");if(n.length===0)throw new Error("buildPeginParamsCandidates: at least one participant key set is required");const h=[];for(const c of r)for(const u of n)h.push({vaultCoreVersion:t,offchainParams:c,participants:u});return h}function Y(e){return`${e.axis} v${e.version} (${e.reason})`}function $(e){const{participants:t}=e;return`core=${e.vaultCoreVersion} offchain=${e.offchainParams.version} keepers=${t.appVaultKeepersVersion} challengers=${t.universalChallengersVersion} vp=${t.vaultProvider}`}const D=5;function ce(e,t){return JSON.stringify({terms:e,peginAmounts:t},(r,n)=>typeof n=="bigint"?`${n}`:n)}function ue(e){const{offchainParams:t,participants:r}=e;return[e.vaultCoreVersion,r.vaultKeeperBtcPubkeys.length,r.universalChallengerBtcPubkeys.length,t.councilQuorum,t.councilSize,t.protocolFeeRate,t.minPeginFeeRate].join("|")}async function le(e){const{offchainParams:t,participants:r}=e,n=r.vaultKeeperBtcPubkeys.length,h=r.universalChallengerBtcPubkeys.length,[c,u,l]=await Promise.all([f.computeMinClaimValue(e.vaultCoreVersion,n,h,t.councilQuorum,t.councilSize,t.protocolFeeRate),f.computeMinPeginFee(e.vaultCoreVersion,n,h,t.minPeginFeeRate),f.peginP2aAnchorOutput(e.vaultCoreVersion)]),a=(l==null?void 0:l.value)??0n;if(c<=0n)throw new T(`WASM returned non-positive depositorClaimValue ${c} for graph version ${e.vaultCoreVersion}`);if(u<=0n)throw new T(`WASM returned non-positive peginMaxFee ${u} for graph version ${e.vaultCoreVersion}`);if(a<0n)throw new T(`WASM returned negative P2A anchor value ${a} for graph version ${e.vaultCoreVersion}`);return{depositorClaimValue:c,peginMaxFee:u,p2aAnchorValue:a}}async function he(e){const{hashlocks:t,fundedPrePeginTxHex:r,depositorBtcPubkey:n,prepeginMaxFee:h,maxAcceptableCommissionBps:c,network:u,candidates:l,unresolvedVersions:a}=e;if(t.length===0)throw new Error("reconstructPeginParams: at least one hashlock is required");if(l.length===0)throw new Error("reconstructPeginParams: candidate space is empty");const d=p.processPublicKeyToXOnly(n),s=p.stripHexPrefix(r),i=S.findAuthAnchorOpReturn(s);if(i===void 0)throw new A("Pre-PegIn carries no single, unambiguous auth-anchor OP_RETURN; the sibling set cannot be proven complete. Reconstruction refused.");if(i.vout!==t.length)throw new Error(`reconstructPeginParams: ${t.length} hashlock(s) supplied but the auth-anchor OP_RETURN sits at vout ${i.vout}, so the transaction funds ${i.vout} HTLC output(s). Reconstruction refused.`);const v=U.Transaction.fromHex(s).outs,E=t.map((m,g)=>BigInt(v[g].value)),R=p.stripHexPrefix(j.calculateBtcTxHash(s)).toLowerCase(),w=new Map,o=[],b=[],B=[];let I=0;for(const m of l)try{const g=ue(m);let P=w.get(g);P===void 0&&(P=await le(m),w.set(g,P));const k=P.depositorClaimValue+P.peginMaxFee+P.p2aAnchorValue,C=E.map(y=>y-k),V=C.findIndex(y=>y<=0n);if(V!==-1)throw new H.HtlcOutputMismatchError(`HTLC output[${V}] value ${E[V]} is not above this candidate's reserve ${k}, so it implies a non-positive pegin amount ${C[V]}.`);const{offchainParams:x,participants:F}=m,_=await W({vaultCoreVersion:m.vaultCoreVersion,siblings:t.map((y,ee)=>({hashlock:y,amount:C[ee]})),fundedPrePeginTxHex:s,depositorBtcPubkey:d,vaultProviderBtcPubkey:F.vaultProviderBtcPubkey,vaultKeeperBtcPubkeys:F.vaultKeeperBtcPubkeys,universalChallengerBtcPubkeys:F.universalChallengerBtcPubkeys,protocolFeeRate:x.protocolFeeRate,minPeginFeeRate:x.minPeginFeeRate,councilQuorum:x.councilQuorum,councilSize:x.councilSize,timelockPegin:x.timelockPegin,timelockAssert:x.timelockAssert,timelockRefund:x.timelockRefund,prepeginTxid:R,prepeginMaxFee:h,maxAcceptableCommissionBps:c,network:u});o.push({candidate:m,terms:_,peginAmounts:C,fingerprint:ce(_,C)})}catch(g){if(g instanceof T)throw g;const P=$(m),k=g instanceof Error?g.message:String(g);g instanceof H.HtlcOutputMismatchError?b.length<D&&b.push(`[${P}] ${k}`):(I++,B.length<D&&B.push(`${P} (${k})`))}const Z=a.length+I,O=[...a.map(Y),...B];if(o.length===0)throw new X(l.length,b,O);if(new Set(o.map(m=>m.fingerprint)).size>1)throw new J(o.map(m=>$(m.candidate)));if(Z>0)throw new G($(o[0].candidate),O);return{candidate:o[0].candidate,terms:o[0].terms,peginAmounts:o[0].peginAmounts,authAnchorHash:i.hash,candidatesTried:l.length,matchedCandidates:o.map(m=>m.candidate)}}function de(e,t){const{htlcVout:r,depositorBtcPubkey:n,applicationEntryPoint:h,fundedPrePeginTxHex:c,hashlocks:u,network:l}=t,{candidate:a,peginAmounts:d}=e,{offchainParams:s,participants:i}=a;if(u.length!==d.length)throw new Error(`toRefundInputs: ${u.length} hashlock(s) but ${d.length} reconstructed amount(s); the reconstruction and the hashlock vector describe different transactions.`);if(!Number.isInteger(r)||r<0||r>=d.length)throw new Error(`toRefundInputs: htlcVout ${r} is outside the reconstructed batch of ${d.length} vault(s).`);const v=d.map((w,o)=>({hashlock:p.ensureHexPrefix(u[o]),amount:w,htlcVout:o})),E={vaultCoreVersion:a.vaultCoreVersion,hashlock:v[r].hashlock,htlcVout:r,offchainParamsVersion:s.version,appVaultKeepersVersion:i.appVaultKeepersVersion,universalChallengersVersion:i.universalChallengersVersion,vaultProvider:i.vaultProvider,applicationEntryPoint:h,amount:d[r],unsignedPrePeginTxHex:c,depositorBtcPubkey:n,batch:v},R={vaultProviderPubkey:i.vaultProviderBtcPubkey,vaultKeeperPubkeys:i.vaultKeeperBtcPubkeys,universalChallengerPubkeys:i.universalChallengerBtcPubkeys,timelockRefund:s.timelockRefund,feeRate:s.protocolFeeRate,minPeginFeeRate:s.minPeginFeeRate,numLocalChallengers:i.vaultKeeperBtcPubkeys.length,councilQuorum:s.councilQuorum,councilSize:s.councilSize,network:l};return{vault:E,context:R}}exports.DEPOSIT_TERMS_REJECTED_ERROR_NAME=M;exports.DepositTermsRejectedError=L;exports.PeginParamsAmbiguousError=J;exports.PeginParamsIncompleteSpaceError=G;exports.PeginParamsNotFoundError=X;exports.PeginSizingIntegrityError=T;exports.UnanchoredPrePeginError=A;exports.VaultRootMismatchError=Q;exports.buildPeginParamsCandidates=ae;exports.deriveHashlocksFromPrePegin=ie;exports.describePeginParamsCandidate=$;exports.describeUnresolvedVersion=Y;exports.isDepositTermsRejectedError=oe;exports.isWotsMismatchError=se;exports.rebuildDepositTermsCore=W;exports.reconstructPeginParams=he;exports.toRefundInputs=de;
|
|
2
|
+
//# sourceMappingURL=toRefundInputs-CY9u84U9.cjs.map
|