@babylonlabs-io/ts-sdk 0.65.0 → 0.66.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.
@@ -1,42 +1,42 @@
1
1
  import { b as s, c as t } from "../../challengeAssert-C7PzyJ7g.js";
2
2
  import { a as i } from "../../constants-GjWXdaqV.js";
3
- import { computeMinClaimValue as n, computeMinPeginFee as P, deriveVaultId as p, expandAuthAnchor as u, expandHashlockSecret as c, expandWotsSeed as d, peginP2aAnchorOutput as l, supportedTxGraphVersions as E, validatePeginP2aAnchor as g } from "@babylonlabs-io/babylon-tbv-rust-wasm";
3
+ import { computeMinClaimValue as n, computeMinPeginFee as p, deriveVaultId as P, expandAuthAnchor as u, expandHashlockSecret as c, expandWotsSeed as d, peginP2aAnchorOutput as l, supportedTxGraphVersions as E, validatePeginP2aAnchor as g } from "@babylonlabs-io/babylon-tbv-rust-wasm";
4
4
  import { P as T, d as R, f as S, c as m, b as _, a as f, g as C, e as x } from "../../verifyScriptPathSchnorrSignature-i-koT139.js";
5
- import { b, e as h, f as I } from "../../peginInput-HQPWZfly.js";
5
+ import { b, e as I, f as h } from "../../peginInput-HQPWZfly.js";
6
6
  import { a as V, b as y } from "../../noPayout-BaZGRLD2.js";
7
7
  import { c as F, d as M, a as N, b as B, e as U, f as H, k as L, g as k, h as K, i as X, j as w, p as W, s as G, t as j, u as J, v as z } from "../../bitcoin-d9eaaZB_.js";
8
8
  import { B as Z, H as q, K as Q, M as $, T as aa, c as ea } from "../../validation-Dj3dqYtl.js";
9
9
  import { c as ta } from "../../signing-DaLvGwQe.js";
10
- import { C as ia, M as oa, P as na, b as Pa, a as pa, c as ua, d as ca, f as da, e as la } from "../../PeginManager-BBl4xkWz.js";
10
+ import { C as ia, M as oa, P as na, b as pa, a as Pa, c as ua, d as ca, f as da, e as la } from "../../PeginManager-BBl4xkWz.js";
11
11
  import { P as ga, c as Aa, f as Ta, s as Ra, v as Sa } from "../../signPsbtsWithFallback-Bb66DfY5.js";
12
12
  import { A as _a, P as fa } from "../../ProtocolParams.abi-C0TSRaHV.js";
13
13
  import { B as xa } from "../../BTCVaultRegistry.abi-CJwWI2EO.js";
14
14
  import { B as ba } from "../../BTCVaultRegistryKeyEpochs.abi-CXjhRZbm.js";
15
- import { C as Ia, e as va, g as Va, h as ya, i as Da } from "../../errors-Blc-JWnI.js";
15
+ import { C as ha, e as va, g as Va, h as ya, i as Da } from "../../errors-Blc-JWnI.js";
16
16
  import { V as Ma, b as Na, a as Ba, d as Ua, f as Ha, p as La } from "../../parseFundingOutpoints-pBRE11Hr.js";
17
17
  import { B as Ka, a as Xa, f as wa, c as Wa, b as Ga, d as ja, g as Ja, i as za, h as Ya, s as Za, e as qa, w as Qa } from "../../waitForTransactionReceiptSmartAware-lobLm0q0.js";
18
- import { B as ae, D as ee, L as se, M as te, c as re, P as ie, b as oe, a as ne, S as Pe, T as pe, W as ue, f as ce, d as de, p as le, r as Ee } from "../../fundPeginTransaction-B2wyjqp0.js";
18
+ import { B as ae, D as ee, L as se, M as te, c as re, P as ie, b as oe, a as ne, S as pe, T as Pe, W as ue, f as ce, d as de, p as le, r as Ee } from "../../fundPeginTransaction-B2wyjqp0.js";
19
19
  import { U as Ae, a as Te, e as Re, f as Se, v as me } from "../../reservation-B4i_PQhY.js";
20
- import { M as fe, V as Ce, g as xe, a as Oe, b as be, c as he, d as Ie, e as ve, f as Ve, h as ye, i as De, p as Fe, v as Me, j as Ne, k as Be } from "../../mempoolApi-BxSINXIB.js";
20
+ import { M as fe, V as Ce, g as xe, a as Oe, b as be, c as Ie, d as he, e as ve, f as Ve, h as ye, i as De, p as Fe, v as Me, j as Ne, k as Be } from "../../mempoolApi-BxSINXIB.js";
21
21
  import { O as He, S as Le, V as ke, g as Ke, h as Xe, i as we, j as We, a as Ge, d as je, b as Je, f as ze, p as Ye, r as Ze, v as qe, c as Qe, e as $e } from "../../batchPoll-cIxrSLLJ.js";
22
- import { A as es, D as ss, J as ts, a as rs, b as is, d as os, P as ns, R as Ps, e as ps, c as us, V as cs, i as ds } from "../../json-rpc-client-DuUARJvV.js";
22
+ import { A as es, D as ss, J as ts, a as rs, b as is, d as os, P as ns, R as ps, e as Ps, c as us, V as cs, i as ds } from "../../json-rpc-client-DuUARJvV.js";
23
23
  import { a as Es } from "../../onChainBtcPubkey-DeF4cKoO.js";
24
- import { D as As, a as Ts, h as Rs, j as Ss, P as ms, k as _s, U as fs, V as Cs, c as xs, d as Os, f as bs, e as hs, b as Is, i as vs, r as Vs, g as ys } from "../../reconstructPeginParams-BVA67Iv8.js";
25
- import { H as Fs, E as Ms, P as Ns, o as Bs, c as Us, d as Hs, K as Ls, L as ks, M as Ks, N as Xs, R as ws, a as Ws, b as Gs, y as js, I as Js, J as zs, g as Ys, z as Zs, p as qs, i as Qs, e as $s, G as at, F as et, t as st, A as tt, B as rt, C as it, D as ot, r as nt, s as Pt, f as pt, h as ut, j as ct, v as dt, k as lt, l as Et, m as gt, n as At, q as Tt, u as Rt, w as St, x as mt } from "../../buildAndBroadcastRefund-C4LiPATK.js";
26
- import { C as ft, P as Ct, c as xt, g as Ot, i as bt } from "../../peginState-CxDiaKuk.js";
24
+ import { D as As, a as Ts, h as Rs, j as Ss, P as ms, k as _s, U as fs, V as Cs, c as xs, d as Os, f as bs, e as Is, b as hs, i as vs, r as Vs, g as ys, t as Ds } from "../../toRefundInputs-BY_fcvrv.js";
25
+ import { H as Ms, E as Ns, P as Bs, o as Us, c as Hs, d as Ls, K as ks, L as Ks, M as Xs, N as ws, R as Ws, a as Gs, b as js, y as Js, I as zs, J as Ys, g as Zs, z as qs, p as Qs, i as $s, e as at, G as et, F as st, t as tt, A as rt, B as it, C as ot, D as nt, r as pt, s as Pt, f as ut, h as ct, j as dt, v as lt, k as Et, l as gt, m as At, n as Tt, q as Rt, u as St, w as mt, x as _t } from "../../buildAndBroadcastRefund-C4LiPATK.js";
26
+ import { C as Ct, P as xt, c as Ot, g as bt, i as It } from "../../peginState-CxDiaKuk.js";
27
27
  export {
28
28
  es as AUTH_REJECTED_RPC_CODE,
29
29
  _a as ApplicationRegistryABI,
30
- Fs as BIP68NotMatureError,
30
+ Ms as BIP68NotMatureError,
31
31
  Z as BITCOIN_ADDRESS_RE,
32
32
  xa as BTCVaultRegistryABI,
33
33
  ba as BTCVaultRegistryKeyEpochsABI,
34
34
  ae as BTC_DUST_SAT,
35
35
  Ka as BitcoinScriptType,
36
36
  ia as COMMISSION_BPS_HEADROOM,
37
- Ia as CONTRACT_ERRORS,
38
- Ms as ClaimerPegoutStatusValue,
39
- ft as ContractStatus,
37
+ ha as CONTRACT_ERRORS,
38
+ Ns as ClaimerPegoutStatusValue,
39
+ Ct as ContractStatus,
40
40
  As as DEPOSIT_TERMS_REJECTED_ERROR_NAME,
41
41
  ee as DUST_THRESHOLD,
42
42
  ss as DaemonStatus,
@@ -55,36 +55,36 @@ export {
55
55
  He as OnChainBtcVaultStatus,
56
56
  ie as P2TR_INPUT_SIZE,
57
57
  oe as PEGIN_AUTH_ANCHOR_OUTPUTS,
58
- Ns as PEGIN_ETH_CONFIRMATIONS,
58
+ Bs as PEGIN_ETH_CONFIRMATIONS,
59
59
  ne as PEGIN_FIXED_OUTPUTS,
60
60
  os as POST_WOTS_STATUSES,
61
61
  ns as PRE_DEPOSITOR_SIGNATURES_STATES,
62
- Bs as ParticipantKeyDriftError,
62
+ Us as ParticipantKeyDriftError,
63
63
  ga as PayoutManager,
64
- Ct as PeginAction,
64
+ xt as PeginAction,
65
65
  na as PeginManager,
66
66
  Rs as PeginParamsAmbiguousError,
67
67
  Ss as PeginParamsIncompleteSpaceError,
68
68
  ms as PeginParamsNotFoundError,
69
- Us as PeginRegistrationMissingError,
70
- Hs as PeginRegistrationNotFinalError,
69
+ Hs as PeginRegistrationMissingError,
70
+ Ls as PeginRegistrationNotFinalError,
71
71
  _s as PeginSizingIntegrityError,
72
72
  fa as ProtocolParamsABI,
73
73
  T as PsbtSubstitutionError,
74
- Ls as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
75
- ks as REFUND_MAX_FEE_FRACTION_NUMERATOR,
76
- Ks as REFUND_MAX_FEE_RATE_SATS_VB,
77
- Xs as REFUND_VSIZE,
78
- ws as RegisteredVaultVersionMismatchError,
79
- Ps as RpcErrorCode,
80
- Pe as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
74
+ ks as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
75
+ Ks as REFUND_MAX_FEE_FRACTION_NUMERATOR,
76
+ Xs as REFUND_MAX_FEE_RATE_SATS_VB,
77
+ ws as REFUND_VSIZE,
78
+ Ws as RegisteredVaultVersionMismatchError,
79
+ ps as RpcErrorCode,
80
+ pe as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
81
81
  Le as ServerIdentityError,
82
82
  aa as TXID_RE,
83
- pe as TX_BUFFER_SIZE_OVERHEAD,
83
+ Pe as TX_BUFFER_SIZE_OVERHEAD,
84
84
  fs as UnanchoredPrePeginError,
85
85
  Ae as UtxoNotAvailableError,
86
86
  Ma as VAULT_APP_NAME,
87
- ps as VP_BATCH_MAX_SIZE,
87
+ Ps as VP_BATCH_MAX_SIZE,
88
88
  us as VP_TERMINAL_FAILURE_STATUSES,
89
89
  cs as VP_TRANSIENT_STATUSES,
90
90
  ke as VaultProviderRpcClient,
@@ -97,19 +97,19 @@ export {
97
97
  Ge as VpResponseValidationError,
98
98
  je as VpTokenRegistry,
99
99
  ue as WALLET_RELAY_FEE_RATE_THRESHOLD,
100
- Ws as activateVault,
101
- Gs as activateVaultAndRedeem,
100
+ Gs as activateVault,
101
+ js as activateVaultAndRedeem,
102
102
  Xa as applyChangeOutputPolicy,
103
103
  Es as assertOnChainBtcPubkey,
104
104
  R as assertPsbtUnsignedTxMatches,
105
105
  S as assertScriptPathSchnorrSignature,
106
106
  Te as assertUtxosAvailable,
107
107
  i as assertValidVaultCoreVersion,
108
- js as assertVaultProviderHintAccepted,
108
+ Js as assertVaultProviderHintAccepted,
109
109
  Je as batchPollByProvider,
110
- Js as buildAndBroadcastRefund,
110
+ zs as buildAndBroadcastRefund,
111
111
  s as buildChallengeAssertPsbt,
112
- Pa as buildDepositTerms,
112
+ pa as buildDepositTerms,
113
113
  Na as buildFundingOutpointsCommitment,
114
114
  V as buildNoPayoutPsbt,
115
115
  m as buildPayoutPsbt,
@@ -120,15 +120,15 @@ export {
120
120
  y as buildRefundPsbt,
121
121
  Ba as buildVaultContext,
122
122
  wa as calculateBtcTxHash,
123
- xt as canPerformAction,
123
+ Ot as canPerformAction,
124
124
  F as canonicalizeBtcPubkey,
125
- pa as capMaxAcceptableCommissionBps,
125
+ Pa as capMaxAcceptableCommissionBps,
126
126
  ea as combineAbortSignals,
127
127
  Wa as computeChangeOutputFeeSats,
128
128
  Aa as computeHashlock,
129
129
  Ga as computeMaxDeposit,
130
130
  n as computeMinClaimValue,
131
- P as computeMinPeginFee,
131
+ p as computeMinPeginFee,
132
132
  t as computeNumLocalChallengers,
133
133
  ja as computePeginBaseFeeSats,
134
134
  ua as computeWotsBlockPublicKeysHash,
@@ -139,14 +139,14 @@ export {
139
139
  Os as deriveHashlocksFromPrePegin,
140
140
  N as deriveNativeSegwitAddress,
141
141
  B as deriveTaprootAddress,
142
- p as deriveVaultId,
142
+ P as deriveVaultId,
143
143
  Ua as deriveVaultRoot,
144
144
  ca as deriveWotsBlocksFromSeed,
145
145
  bs as describePeginParamsCandidate,
146
- hs as describeUnresolvedVersion,
146
+ Is as describeUnresolvedVersion,
147
147
  U as ensureHexPrefix,
148
148
  da as ensurePrePeginTermsApproval,
149
- zs as estimateRefundFeeSats,
149
+ Ys as estimateRefundFeeSats,
150
150
  la as estimateSubmitPeginRequestBatchGas,
151
151
  u as expandAuthAnchor,
152
152
  c as expandHashlockSecret,
@@ -154,8 +154,8 @@ export {
154
154
  va as extractErrorData,
155
155
  Re as extractInputsFromTransaction,
156
156
  x as extractPayoutSignature,
157
- h as extractPeginInputSignature,
158
- I as finalizePeginInputPsbt,
157
+ I as extractPeginInputSignature,
158
+ h as finalizePeginInputPsbt,
159
159
  Se as findOverlappingPendingVaults,
160
160
  H as formatSatoshisToBtc,
161
161
  Ta as forwardDepositApproval,
@@ -167,9 +167,9 @@ export {
167
167
  Ja as getDustThreshold,
168
168
  be as getMempoolApiUrl,
169
169
  L as getNetwork,
170
- he as getNetworkFees,
171
- Ie as getOutspend,
172
- Ot as getPeginProtocolState,
170
+ Ie as getNetworkFees,
171
+ he as getOutspend,
172
+ bt as getPeginProtocolState,
173
173
  za as getPsbtInputFields,
174
174
  Ya as getScriptType,
175
175
  k as getSortedXOnlyPubkeys,
@@ -179,23 +179,23 @@ export {
179
179
  De as getUtxoInfo,
180
180
  ya as handleContractError,
181
181
  K as hexToUint8Array,
182
- bt as isActivationDeadlinePassedOnChain,
182
+ It as isActivationDeadlinePassedOnChain,
183
183
  X as isAddressFromPublicKey,
184
184
  ds as isAuthRejectedError,
185
- Ys as isDepositAmountValid,
186
- Is as isDepositTermsRejectedError,
187
- Zs as isHintAccepted,
185
+ Zs as isDepositAmountValid,
186
+ hs as isDepositTermsRejectedError,
187
+ qs as isHintAccepted,
188
188
  Da as isKnownContractError,
189
- qs as isParticipantKeyDriftError,
190
- Qs as isPeginRegistrationMissingError,
191
- $s as isPeginRegistrationNotFinalError,
192
- at as isPegoutTerminalStatus,
193
- et as isRecognizedPegoutStatus,
194
- st as isRegisteredVaultVersionMismatchError,
189
+ Qs as isParticipantKeyDriftError,
190
+ $s as isPeginRegistrationMissingError,
191
+ at as isPeginRegistrationNotFinalError,
192
+ et as isPegoutTerminalStatus,
193
+ st as isRecognizedPegoutStatus,
194
+ tt as isRegisteredVaultVersionMismatchError,
195
195
  w as isValidHex,
196
196
  vs as isWotsMismatchError,
197
- tt as matchKeyHint,
198
- rt as matchKeySetHint,
197
+ rt as matchKeyHint,
198
+ it as matchKeySetHint,
199
199
  La as parseFundingOutpointsFromTx,
200
200
  de as parseUnfundedWasmTransaction,
201
201
  le as peginOutputCount,
@@ -206,40 +206,41 @@ export {
206
206
  Ee as rateBasedTxBufferFee,
207
207
  Vs as rebuildDepositTermsCore,
208
208
  ys as reconstructPeginParams,
209
- it as resolveCurrentParticipantKeys,
210
- ot as resolveParticipantKeysAtEpochs,
209
+ ot as resolveCurrentParticipantKeys,
210
+ nt as resolveParticipantKeysAtEpochs,
211
211
  Ze as resolveProtocolAddresses,
212
- nt as runDepositorPresignFlow,
212
+ pt as runDepositorPresignFlow,
213
213
  Za as selectUtxosForPegin,
214
214
  qa as shouldAddChangeOutput,
215
215
  Pt as signDepositorGraph,
216
216
  G as stripHexPrefix,
217
- pt as submitWotsPublicKey,
217
+ ut as submitWotsPublicKey,
218
218
  E as supportedTxGraphVersions,
219
219
  Ra as supportsDepositApproval,
220
+ Ds as toRefundInputs,
220
221
  j as toXOnly,
221
222
  J as uint8ArrayToHex,
222
- ut as validateDepositAmount,
223
- ct as validateMultiVaultDepositInputs,
223
+ ct as validateDepositAmount,
224
+ dt as validateMultiVaultDepositInputs,
224
225
  Me as validateOffchainParams,
225
- dt as validateOnChainParticipantKeys,
226
+ lt as validateOnChainParticipantKeys,
226
227
  Ne as validatePegInConfiguration,
227
228
  g as validatePeginP2aAnchor,
228
- lt as validateProviderSelection,
229
- Et as validateRemainingCapacity,
229
+ Et as validateProviderSelection,
230
+ gt as validateRemainingCapacity,
230
231
  qe as validateRequestDepositorClaimerArtifactsResponse,
231
232
  Sa as validateSecretAgainstHashlock,
232
233
  Be as validateTBVProtocolParams,
233
234
  me as validateUtxosAvailable,
234
- gt as validateVaultAmounts,
235
- At as validateVaultProviderPubkey,
235
+ At as validateVaultAmounts,
236
+ Tt as validateVaultProviderPubkey,
236
237
  z as validateWalletPubkey,
237
- Tt as verifyRegisteredParticipantKeys,
238
- Rt as verifyRegisteredVaultVersions,
238
+ Rt as verifyRegisteredParticipantKeys,
239
+ St as verifyRegisteredVaultVersions,
239
240
  Qe as verifyServerIdentity,
240
241
  $e as vpTokenRegistry,
241
- St as waitForPeginRegistrationDepth,
242
- mt as waitForPeginStatus,
242
+ mt as waitForPeginRegistrationDepth,
243
+ _t as waitForPeginStatus,
243
244
  Qa as waitForTransactionReceiptSmartAware
244
245
  };
245
246
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Tests that recovery reaches the same refund the ordinary path would.
3
+ *
4
+ * The one that carries the weight is the byte-identity check: a refund PSBT
5
+ * built from parameters recovered blind must equal, byte for byte, the PSBT
6
+ * built from the parameters the deposit was actually made with. That is the
7
+ * safety property the whole reconstruction exists to provide, and it can be
8
+ * proven here — headless, against the real WASM engine — because
9
+ * `buildRefundPsbt` takes parameters directly rather than reading a vault row.
10
+ *
11
+ * The plan for this work assumed that proof needed a wallet and a signet run.
12
+ * It does not: no signing is involved in building the PSBT.
13
+ */
14
+ export {};
15
+ //# sourceMappingURL=toRefundInputs.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toRefundInputs.test.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/recovery/__tests__/toRefundInputs.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
@@ -3,9 +3,14 @@ export interface DeriveHashlocksFromPrePeginInput {
3
3
  /** Any wallet implementing `deriveContextHash` — the depositor's own. */
4
4
  wallet: DeriveContextHashCapableWallet;
5
5
  /**
6
- * Depositor x-only BTC public key (32-byte hex, `0x` optional), read from
7
- * the CONNECTED WALLET. The reorg destroyed the row that would normally
8
- * supply it, and taking it from any chain read would defeat the recovery.
6
+ * Depositor BTC public key, read from the CONNECTED WALLET. The reorg
7
+ * destroyed the row that would normally supply it, and taking it from any
8
+ * chain read would defeat the recovery.
9
+ *
10
+ * Accepted in whatever form the wallet hands back — x-only, 33-byte
11
+ * compressed or 65-byte uncompressed, `0x` optional — and narrowed to x-only
12
+ * here. Wallets return the compressed form from `getPublicKey`, so requiring
13
+ * x-only would make the common case an error.
9
14
  */
10
15
  depositorBtcPubkey: string;
11
16
  /** Funded (broadcast) Pre-PegIn transaction hex, `0x` optional. */
@@ -1 +1 @@
1
- {"version":3,"file":"deriveHashlocksFromPrePegin.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/recovery/deriveHashlocksFromPrePegin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAWH,OAAO,EAIL,KAAK,8BAA8B,EACpC,MAAM,kBAAkB,CAAC;AAO1B,MAAM,WAAW,gCAAgC;IAC/C,yEAAyE;IACzE,MAAM,EAAE,8BAA8B,CAAC;IACvC;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mEAAmE;IACnE,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,iCAAiC;IAChD,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,6EAA6E;IAC7E,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,gCAAgC,GACtC,OAAO,CAAC,iCAAiC,CAAC,CAsD5C"}
1
+ {"version":3,"file":"deriveHashlocksFromPrePegin.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/recovery/deriveHashlocksFromPrePegin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAYH,OAAO,EAIL,KAAK,8BAA8B,EACpC,MAAM,kBAAkB,CAAC;AAO1B,MAAM,WAAW,gCAAgC;IAC/C,yEAAyE;IACzE,MAAM,EAAE,8BAA8B,CAAC;IACvC;;;;;;;;;OASG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mEAAmE;IACnE,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,iCAAiC;IAChD,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,6EAA6E;IAC7E,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,gCAAgC,GACtC,OAAO,CAAC,iCAAiC,CAAC,CA2D5C"}
@@ -15,4 +15,5 @@ export * from './deriveHashlocksFromPrePegin';
15
15
  export * from './peginParamsCandidates';
16
16
  export * from './reconstructPeginParams';
17
17
  export * from './recoveryErrors';
18
+ export * from './toRefundInputs';
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/recovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/recovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { Network } from '@babylonlabs-io/babylon-tbv-rust-wasm';
2
+ import { Address } from 'viem';
3
+ import { RefundPrePeginContext, VaultRefundData } from '../services/refund/buildAndBroadcastRefund';
4
+ import { ReconstructPeginParamsResult } from './reconstructPeginParams';
5
+ export interface ToRefundInputsOptions {
6
+ /**
7
+ * Which sibling of the Pre-PegIn to refund, as an index into the
8
+ * reconstruction's hashlocks and amounts. Equal to the vault's `htlcVout`
9
+ * by construction — `PeginManager` asserts `perVault[i].htlcVout === i`.
10
+ */
11
+ htlcVout: number;
12
+ /**
13
+ * Depositor BTC pubkey, the same value the reconstruction was run with.
14
+ * Passed through rather than re-derived so the refund is built against the
15
+ * key that was actually verified.
16
+ *
17
+ * Deliberately NOT narrowed to x-only here. `VaultRefundData.depositorBtcPubkey`
18
+ * accepts "32 or 33 bytes of hex", and `buildAndBroadcastRefund` narrows it
19
+ * with `processPublicKeyToXOnly` before it reaches the PSBT builder — so a
20
+ * wallet's compressed key flows through unchanged, which is what wallets
21
+ * actually return. Narrowing early would discard the parity byte the
22
+ * orchestrator's own validation accepts.
23
+ */
24
+ depositorBtcPubkey: string;
25
+ /**
26
+ * The vault provider's application entry point. Not recoverable from the
27
+ * Bitcoin transaction and not part of the verified parameter set — it is a
28
+ * field of the vault-provider registry row, which is address-keyed and
29
+ * survives the reorg untouched.
30
+ */
31
+ applicationEntryPoint: Address;
32
+ /** Funded Pre-PegIn transaction hex, `0x` optional. */
33
+ fundedPrePeginTxHex: string;
34
+ /** Hashlocks indexed by `htlcVout`, as passed to the reconstruction. */
35
+ hashlocks: readonly string[];
36
+ /**
37
+ * The Bitcoin network the reconstruction was verified against. An input to
38
+ * the search rather than an output of it, so it is restated here; passing a
39
+ * different one would build the refund against a different script tree than
40
+ * the one that was proven to match.
41
+ */
42
+ network: Network;
43
+ }
44
+ export interface RefundInputsFromRecovery {
45
+ vault: VaultRefundData;
46
+ context: RefundPrePeginContext;
47
+ }
48
+ /**
49
+ * Project a verified reconstruction into the two shapes
50
+ * `buildAndBroadcastRefund` injects.
51
+ *
52
+ * Every value here comes from a parameter set that has already been
53
+ * byte-matched against the funded transaction's HTLC outputs, so this is a
54
+ * projection and not a second validation pass. The orchestrator re-checks the
55
+ * parts it owns regardless.
56
+ *
57
+ * @throws If `htlcVout` does not index the reconstructed batch, or the
58
+ * hashlock vector disagrees with the reconstructed amounts.
59
+ */
60
+ export declare function toRefundInputs(result: ReconstructPeginParamsResult, options: ToRefundInputsOptions): RefundInputsFromRecovery;
61
+ //# sourceMappingURL=toRefundInputs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toRefundInputs.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/recovery/toRefundInputs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,MAAM,CAAC;AAGzC,OAAO,KAAK,EACV,qBAAqB,EACrB,eAAe,EAChB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAE7E,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;OAWG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,qBAAqB,EAAE,OAAO,CAAC;IAC/B,uDAAuD;IACvD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,eAAe,CAAC;IACvB,OAAO,EAAE,qBAAqB,CAAC;CAChC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,4BAA4B,EACpC,OAAO,EAAE,qBAAqB,GAC7B,wBAAwB,CAuE1B"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../challengeAssert-BFRE2DM-.cjs"),m=require("../constants-DU5CGcqO.cjs"),u=require("@babylonlabs-io/babylon-tbv-rust-wasm"),P=require("../verifyScriptPathSchnorrSignature-DPAd_qke.cjs"),A=require("../peginInput-Ci921gTl.cjs"),R=require("../noPayout-CnQ1WLtr.cjs"),t=require("../bitcoin-m84N5a8o.cjs"),l=require("../validation-CDbOaDj7.cjs"),O=require("../signing-Bnsro0hE.cjs"),c=require("../PeginManager-p-ajwSxG.cjs"),p=require("../signPsbtsWithFallback-PTgWxsG3.cjs"),_=require("../ProtocolParams.abi-CYZoV2EI.cjs"),b=require("../BTCVaultRegistry.abi-z7d_eP22.cjs"),C=require("../BTCVaultRegistryKeyEpochs.abi-_NERAdc5.cjs"),E=require("../errors-CGcNP0rV.cjs"),d=require("../parseFundingOutpoints-CIO9Ok1L.cjs"),s=require("../waitForTransactionReceiptSmartAware-AgZ-3WV_.cjs"),a=require("../fundPeginTransaction-BLD8FRL9.cjs"),g=require("../reservation-CDbInVw0.cjs"),o=require("../mempoolApi-CXfr-L6x.cjs"),r=require("../batchPoll-6L5oToGr.cjs"),n=require("../json-rpc-client-BiAmg_ho.cjs"),y=require("../onChainBtcPubkey-C_a2L3kL.cjs"),i=require("../reconstructPeginParams-BmUVK7F_.cjs"),e=require("../buildAndBroadcastRefund-Daw5ZUKR.cjs"),T=require("../peginState-eaQ4IO_R.cjs");exports.buildChallengeAssertPsbt=S.buildChallengeAssertPsbt;exports.computeNumLocalChallengers=S.computeNumLocalChallengers;exports.assertValidVaultCoreVersion=m.assertValidVaultCoreVersion;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>u.computeMinClaimValue});Object.defineProperty(exports,"computeMinPeginFee",{enumerable:!0,get:()=>u.computeMinPeginFee});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>u.deriveVaultId});Object.defineProperty(exports,"expandAuthAnchor",{enumerable:!0,get:()=>u.expandAuthAnchor});Object.defineProperty(exports,"expandHashlockSecret",{enumerable:!0,get:()=>u.expandHashlockSecret});Object.defineProperty(exports,"expandWotsSeed",{enumerable:!0,get:()=>u.expandWotsSeed});Object.defineProperty(exports,"peginP2aAnchorOutput",{enumerable:!0,get:()=>u.peginP2aAnchorOutput});Object.defineProperty(exports,"supportedTxGraphVersions",{enumerable:!0,get:()=>u.supportedTxGraphVersions});Object.defineProperty(exports,"validatePeginP2aAnchor",{enumerable:!0,get:()=>u.validatePeginP2aAnchor});exports.PsbtSubstitutionError=P.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=P.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=P.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=P.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=P.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=P.buildPrePeginPsbt;exports.createPayoutScript=P.createPayoutScript;exports.extractPayoutSignature=P.extractPayoutSignature;exports.buildPeginInputPsbt=A.buildPeginInputPsbt;exports.extractPeginInputSignature=A.extractPeginInputSignature;exports.finalizePeginInputPsbt=A.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=R.buildNoPayoutPsbt;exports.buildRefundPsbt=R.buildRefundPsbt;exports.canonicalizeBtcPubkey=t.canonicalizeBtcPubkey;exports.deriveBip86ScriptPubKeyHex=t.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=t.deriveNativeSegwitAddress;exports.deriveTaprootAddress=t.deriveTaprootAddress;exports.ensureHexPrefix=t.ensureHexPrefix;exports.formatSatoshisToBtc=t.formatSatoshisToBtc;exports.getNetwork=t.getNetwork;exports.getSortedXOnlyPubkeys=t.getSortedXOnlyPubkeys;exports.hexToUint8Array=t.hexToUint8Array;exports.isAddressFromPublicKey=t.isAddressFromPublicKey;exports.isValidHex=t.isValidHex;exports.processPublicKeyToXOnly=t.processPublicKeyToXOnly;exports.stripHexPrefix=t.stripHexPrefix;exports.toXOnly=t.toXOnly;exports.uint8ArrayToHex=t.uint8ArrayToHex;exports.validateWalletPubkey=t.validateWalletPubkey;exports.BITCOIN_ADDRESS_RE=l.BITCOIN_ADDRESS_RE;exports.HEX_RE=l.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=l.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=l.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=l.TXID_RE;exports.combineAbortSignals=l.combineAbortSignals;exports.createTaprootScriptPathSignOptions=O.createTaprootScriptPathSignOptions;exports.COMMISSION_BPS_HEADROOM=c.COMMISSION_BPS_HEADROOM;exports.MAX_ACCEPTABLE_COMMISSION_BPS_CAP=c.MAX_ACCEPTABLE_COMMISSION_BPS_CAP;exports.PeginManager=c.PeginManager;exports.buildDepositTerms=c.buildDepositTerms;exports.capMaxAcceptableCommissionBps=c.capMaxAcceptableCommissionBps;exports.computeWotsBlockPublicKeysHash=c.computeWotsBlockPublicKeysHash;exports.deriveWotsBlocksFromSeed=c.deriveWotsBlocksFromSeed;exports.ensurePrePeginTermsApproval=c.ensurePrePeginTermsApproval;exports.estimateSubmitPeginRequestBatchGas=c.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=p.PayoutManager;exports.computeHashlock=p.computeHashlock;exports.forwardDepositApproval=p.forwardDepositApproval;exports.supportsDepositApproval=p.supportsDepositApproval;exports.validateSecretAgainstHashlock=p.validateSecretAgainstHashlock;exports.ApplicationRegistryABI=_.ApplicationRegistryABI;exports.ProtocolParamsABI=_.ProtocolParamsABI;exports.BTCVaultRegistryABI=b.BTCVaultRegistryABI;exports.BTCVaultRegistryKeyEpochsABI=C.BTCVaultRegistryKeyEpochsABI;exports.CONTRACT_ERRORS=E.CONTRACT_ERRORS;exports.extractErrorData=E.extractErrorData;exports.getContractErrorMessage=E.getContractErrorMessage;exports.handleContractError=E.handleContractError;exports.isKnownContractError=E.isKnownContractError;exports.VAULT_APP_NAME=d.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=d.buildFundingOutpointsCommitment;exports.buildVaultContext=d.buildVaultContext;exports.deriveVaultRoot=d.deriveVaultRoot;exports.forwardDeriveContextHash=d.forwardDeriveContextHash;exports.parseFundingOutpointsFromTx=d.parseFundingOutpointsFromTx;exports.BitcoinScriptType=s.BitcoinScriptType;exports.applyChangeOutputPolicy=s.applyChangeOutputPolicy;exports.calculateBtcTxHash=s.calculateBtcTxHash;exports.computeChangeOutputFeeSats=s.computeChangeOutputFeeSats;exports.computeMaxDeposit=s.computeMaxDeposit;exports.computePeginBaseFeeSats=s.computePeginBaseFeeSats;exports.getDustThreshold=s.getDustThreshold;exports.getPsbtInputFields=s.getPsbtInputFields;exports.getScriptType=s.getScriptType;exports.selectUtxosForPegin=s.selectUtxosForPegin;exports.shouldAddChangeOutput=s.shouldAddChangeOutput;exports.waitForTransactionReceiptSmartAware=s.waitForTransactionReceiptSmartAware;exports.BTC_DUST_SAT=a.BTC_DUST_SAT;exports.DUST_THRESHOLD=a.DUST_THRESHOLD;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=a.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=a.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=a.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=a.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=a.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=a.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=a.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=a.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=a.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=a.fundPeginTransaction;exports.parseUnfundedWasmTransaction=a.parseUnfundedWasmTransaction;exports.peginOutputCount=a.peginOutputCount;exports.rateBasedTxBufferFee=a.rateBasedTxBufferFee;exports.UtxoNotAvailableError=g.UtxoNotAvailableError;exports.assertUtxosAvailable=g.assertUtxosAvailable;exports.extractInputsFromTransaction=g.extractInputsFromTransaction;exports.findOverlappingPendingVaults=g.findOverlappingPendingVaults;exports.validateUtxosAvailable=g.validateUtxosAvailable;exports.MEMPOOL_API_URLS=o.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=o.ViemVaultRegistryReader;exports.getAddressTxs=o.getAddressTxs;exports.getAddressUtxos=o.getAddressUtxos;exports.getMempoolApiUrl=o.getMempoolApiUrl;exports.getNetworkFees=o.getNetworkFees;exports.getOutspend=o.getOutspend;exports.getTipHeight=o.getTipHeight;exports.getTxHex=o.getTxHex;exports.getTxInfo=o.getTxInfo;exports.getUtxoInfo=o.getUtxoInfo;exports.pushTx=o.pushTx;exports.validateOffchainParams=o.validateOffchainParams;exports.validatePegInConfiguration=o.validatePegInConfiguration;exports.validateTBVProtocolParams=o.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=r.OnChainBtcVaultStatus;exports.ServerIdentityError=r.ServerIdentityError;exports.VaultProviderRpcClient=r.VaultProviderRpcClient;exports.ViemOperationKeyReader=r.ViemOperationKeyReader;exports.ViemProtocolParamsReader=r.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=r.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=r.ViemVaultKeeperReader;exports.VpResponseValidationError=r.VpResponseValidationError;exports.VpTokenRegistry=r.VpTokenRegistry;exports.batchPollByProvider=r.batchPollByProvider;exports.createAuthenticatedVpClient=r.createAuthenticatedVpClient;exports.primeVpTokenRegistry=r.primeVpTokenRegistry;exports.resolveProtocolAddresses=r.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=r.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=r.verifyServerIdentity;exports.vpTokenRegistry=r.vpTokenRegistry;exports.AUTH_REJECTED_RPC_CODE=n.AUTH_REJECTED_RPC_CODE;exports.DaemonStatus=n.DaemonStatus;exports.JSON_RPC_ERROR_CODES=n.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=n.JsonRpcClient;exports.JsonRpcError=n.JsonRpcError;exports.POST_WOTS_STATUSES=n.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=n.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=n.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=n.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=n.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=n.VP_TRANSIENT_STATUSES;exports.isAuthRejectedError=n.isAuthRejectedError;exports.assertOnChainBtcPubkey=y.assertOnChainBtcPubkey;exports.DEPOSIT_TERMS_REJECTED_ERROR_NAME=i.DEPOSIT_TERMS_REJECTED_ERROR_NAME;exports.DepositTermsRejectedError=i.DepositTermsRejectedError;exports.PeginParamsAmbiguousError=i.PeginParamsAmbiguousError;exports.PeginParamsIncompleteSpaceError=i.PeginParamsIncompleteSpaceError;exports.PeginParamsNotFoundError=i.PeginParamsNotFoundError;exports.PeginSizingIntegrityError=i.PeginSizingIntegrityError;exports.UnanchoredPrePeginError=i.UnanchoredPrePeginError;exports.VaultRootMismatchError=i.VaultRootMismatchError;exports.buildPeginParamsCandidates=i.buildPeginParamsCandidates;exports.deriveHashlocksFromPrePegin=i.deriveHashlocksFromPrePegin;exports.describePeginParamsCandidate=i.describePeginParamsCandidate;exports.describeUnresolvedVersion=i.describeUnresolvedVersion;exports.isDepositTermsRejectedError=i.isDepositTermsRejectedError;exports.isWotsMismatchError=i.isWotsMismatchError;exports.rebuildDepositTermsCore=i.rebuildDepositTermsCore;exports.reconstructPeginParams=i.reconstructPeginParams;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.PEGIN_ETH_CONFIRMATIONS=e.PEGIN_ETH_CONFIRMATIONS;exports.ParticipantKeyDriftError=e.ParticipantKeyDriftError;exports.PeginRegistrationMissingError=e.PeginRegistrationMissingError;exports.PeginRegistrationNotFinalError=e.PeginRegistrationNotFinalError;exports.REFUND_MAX_FEE_FRACTION_DENOMINATOR=e.REFUND_MAX_FEE_FRACTION_DENOMINATOR;exports.REFUND_MAX_FEE_FRACTION_NUMERATOR=e.REFUND_MAX_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_RATE_SATS_VB=e.REFUND_MAX_FEE_RATE_SATS_VB;exports.REFUND_VSIZE=e.REFUND_VSIZE;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.activateVault=e.activateVault;exports.activateVaultAndRedeem=e.activateVaultAndRedeem;exports.assertVaultProviderHintAccepted=e.assertVaultProviderHintAccepted;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isHintAccepted=e.isHintAccepted;exports.isParticipantKeyDriftError=e.isParticipantKeyDriftError;exports.isPeginRegistrationMissingError=e.isPeginRegistrationMissingError;exports.isPeginRegistrationNotFinalError=e.isPeginRegistrationNotFinalError;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.matchKeyHint=e.matchKeyHint;exports.matchKeySetHint=e.matchKeySetHint;exports.resolveCurrentParticipantKeys=e.resolveCurrentParticipantKeys;exports.resolveParticipantKeysAtEpochs=e.resolveParticipantKeysAtEpochs;exports.runDepositorPresignFlow=e.runDepositorPresignFlow;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.validateDepositAmount=e.validateDepositAmount;exports.validateMultiVaultDepositInputs=e.validateMultiVaultDepositInputs;exports.validateOnChainParticipantKeys=e.validateOnChainParticipantKeys;exports.validateProviderSelection=e.validateProviderSelection;exports.validateRemainingCapacity=e.validateRemainingCapacity;exports.validateVaultAmounts=e.validateVaultAmounts;exports.validateVaultProviderPubkey=e.validateVaultProviderPubkey;exports.verifyRegisteredParticipantKeys=e.verifyRegisteredParticipantKeys;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginRegistrationDepth=e.waitForPeginRegistrationDepth;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=T.ContractStatus;exports.PeginAction=T.PeginAction;exports.canPerformAction=T.canPerformAction;exports.getPeginProtocolState=T.getPeginProtocolState;exports.isActivationDeadlinePassedOnChain=T.isActivationDeadlinePassedOnChain;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("../challengeAssert-BFRE2DM-.cjs"),m=require("../constants-DU5CGcqO.cjs"),u=require("@babylonlabs-io/babylon-tbv-rust-wasm"),P=require("../verifyScriptPathSchnorrSignature-DPAd_qke.cjs"),A=require("../peginInput-Ci921gTl.cjs"),S=require("../noPayout-CnQ1WLtr.cjs"),r=require("../bitcoin-m84N5a8o.cjs"),l=require("../validation-CDbOaDj7.cjs"),O=require("../signing-Bnsro0hE.cjs"),c=require("../PeginManager-p-ajwSxG.cjs"),p=require("../signPsbtsWithFallback-PTgWxsG3.cjs"),_=require("../ProtocolParams.abi-CYZoV2EI.cjs"),b=require("../BTCVaultRegistry.abi-z7d_eP22.cjs"),C=require("../BTCVaultRegistryKeyEpochs.abi-_NERAdc5.cjs"),E=require("../errors-CGcNP0rV.cjs"),d=require("../parseFundingOutpoints-CIO9Ok1L.cjs"),s=require("../waitForTransactionReceiptSmartAware-AgZ-3WV_.cjs"),a=require("../fundPeginTransaction-BLD8FRL9.cjs"),g=require("../reservation-CDbInVw0.cjs"),o=require("../mempoolApi-CXfr-L6x.cjs"),i=require("../batchPoll-6L5oToGr.cjs"),n=require("../json-rpc-client-BiAmg_ho.cjs"),y=require("../onChainBtcPubkey-C_a2L3kL.cjs"),t=require("../toRefundInputs-DYL9C-aG.cjs"),e=require("../buildAndBroadcastRefund-Daw5ZUKR.cjs"),T=require("../peginState-eaQ4IO_R.cjs");exports.buildChallengeAssertPsbt=R.buildChallengeAssertPsbt;exports.computeNumLocalChallengers=R.computeNumLocalChallengers;exports.assertValidVaultCoreVersion=m.assertValidVaultCoreVersion;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>u.computeMinClaimValue});Object.defineProperty(exports,"computeMinPeginFee",{enumerable:!0,get:()=>u.computeMinPeginFee});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>u.deriveVaultId});Object.defineProperty(exports,"expandAuthAnchor",{enumerable:!0,get:()=>u.expandAuthAnchor});Object.defineProperty(exports,"expandHashlockSecret",{enumerable:!0,get:()=>u.expandHashlockSecret});Object.defineProperty(exports,"expandWotsSeed",{enumerable:!0,get:()=>u.expandWotsSeed});Object.defineProperty(exports,"peginP2aAnchorOutput",{enumerable:!0,get:()=>u.peginP2aAnchorOutput});Object.defineProperty(exports,"supportedTxGraphVersions",{enumerable:!0,get:()=>u.supportedTxGraphVersions});Object.defineProperty(exports,"validatePeginP2aAnchor",{enumerable:!0,get:()=>u.validatePeginP2aAnchor});exports.PsbtSubstitutionError=P.PsbtSubstitutionError;exports.assertPsbtUnsignedTxMatches=P.assertPsbtUnsignedTxMatches;exports.assertScriptPathSchnorrSignature=P.assertScriptPathSchnorrSignature;exports.buildPayoutPsbt=P.buildPayoutPsbt;exports.buildPeginTxFromFundedPrePegin=P.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=P.buildPrePeginPsbt;exports.createPayoutScript=P.createPayoutScript;exports.extractPayoutSignature=P.extractPayoutSignature;exports.buildPeginInputPsbt=A.buildPeginInputPsbt;exports.extractPeginInputSignature=A.extractPeginInputSignature;exports.finalizePeginInputPsbt=A.finalizePeginInputPsbt;exports.buildNoPayoutPsbt=S.buildNoPayoutPsbt;exports.buildRefundPsbt=S.buildRefundPsbt;exports.canonicalizeBtcPubkey=r.canonicalizeBtcPubkey;exports.deriveBip86ScriptPubKeyHex=r.deriveBip86ScriptPubKeyHex;exports.deriveNativeSegwitAddress=r.deriveNativeSegwitAddress;exports.deriveTaprootAddress=r.deriveTaprootAddress;exports.ensureHexPrefix=r.ensureHexPrefix;exports.formatSatoshisToBtc=r.formatSatoshisToBtc;exports.getNetwork=r.getNetwork;exports.getSortedXOnlyPubkeys=r.getSortedXOnlyPubkeys;exports.hexToUint8Array=r.hexToUint8Array;exports.isAddressFromPublicKey=r.isAddressFromPublicKey;exports.isValidHex=r.isValidHex;exports.processPublicKeyToXOnly=r.processPublicKeyToXOnly;exports.stripHexPrefix=r.stripHexPrefix;exports.toXOnly=r.toXOnly;exports.uint8ArrayToHex=r.uint8ArrayToHex;exports.validateWalletPubkey=r.validateWalletPubkey;exports.BITCOIN_ADDRESS_RE=l.BITCOIN_ADDRESS_RE;exports.HEX_RE=l.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=l.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=l.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=l.TXID_RE;exports.combineAbortSignals=l.combineAbortSignals;exports.createTaprootScriptPathSignOptions=O.createTaprootScriptPathSignOptions;exports.COMMISSION_BPS_HEADROOM=c.COMMISSION_BPS_HEADROOM;exports.MAX_ACCEPTABLE_COMMISSION_BPS_CAP=c.MAX_ACCEPTABLE_COMMISSION_BPS_CAP;exports.PeginManager=c.PeginManager;exports.buildDepositTerms=c.buildDepositTerms;exports.capMaxAcceptableCommissionBps=c.capMaxAcceptableCommissionBps;exports.computeWotsBlockPublicKeysHash=c.computeWotsBlockPublicKeysHash;exports.deriveWotsBlocksFromSeed=c.deriveWotsBlocksFromSeed;exports.ensurePrePeginTermsApproval=c.ensurePrePeginTermsApproval;exports.estimateSubmitPeginRequestBatchGas=c.estimateSubmitPeginRequestBatchGas;exports.PayoutManager=p.PayoutManager;exports.computeHashlock=p.computeHashlock;exports.forwardDepositApproval=p.forwardDepositApproval;exports.supportsDepositApproval=p.supportsDepositApproval;exports.validateSecretAgainstHashlock=p.validateSecretAgainstHashlock;exports.ApplicationRegistryABI=_.ApplicationRegistryABI;exports.ProtocolParamsABI=_.ProtocolParamsABI;exports.BTCVaultRegistryABI=b.BTCVaultRegistryABI;exports.BTCVaultRegistryKeyEpochsABI=C.BTCVaultRegistryKeyEpochsABI;exports.CONTRACT_ERRORS=E.CONTRACT_ERRORS;exports.extractErrorData=E.extractErrorData;exports.getContractErrorMessage=E.getContractErrorMessage;exports.handleContractError=E.handleContractError;exports.isKnownContractError=E.isKnownContractError;exports.VAULT_APP_NAME=d.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=d.buildFundingOutpointsCommitment;exports.buildVaultContext=d.buildVaultContext;exports.deriveVaultRoot=d.deriveVaultRoot;exports.forwardDeriveContextHash=d.forwardDeriveContextHash;exports.parseFundingOutpointsFromTx=d.parseFundingOutpointsFromTx;exports.BitcoinScriptType=s.BitcoinScriptType;exports.applyChangeOutputPolicy=s.applyChangeOutputPolicy;exports.calculateBtcTxHash=s.calculateBtcTxHash;exports.computeChangeOutputFeeSats=s.computeChangeOutputFeeSats;exports.computeMaxDeposit=s.computeMaxDeposit;exports.computePeginBaseFeeSats=s.computePeginBaseFeeSats;exports.getDustThreshold=s.getDustThreshold;exports.getPsbtInputFields=s.getPsbtInputFields;exports.getScriptType=s.getScriptType;exports.selectUtxosForPegin=s.selectUtxosForPegin;exports.shouldAddChangeOutput=s.shouldAddChangeOutput;exports.waitForTransactionReceiptSmartAware=s.waitForTransactionReceiptSmartAware;exports.BTC_DUST_SAT=a.BTC_DUST_SAT;exports.DUST_THRESHOLD=a.DUST_THRESHOLD;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=a.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=a.MAX_NON_LEGACY_OUTPUT_SIZE;exports.MAX_REASONABLE_PEGIN_VBYTES=a.MAX_REASONABLE_PEGIN_VBYTES;exports.P2TR_INPUT_SIZE=a.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=a.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=a.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=a.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=a.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=a.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=a.fundPeginTransaction;exports.parseUnfundedWasmTransaction=a.parseUnfundedWasmTransaction;exports.peginOutputCount=a.peginOutputCount;exports.rateBasedTxBufferFee=a.rateBasedTxBufferFee;exports.UtxoNotAvailableError=g.UtxoNotAvailableError;exports.assertUtxosAvailable=g.assertUtxosAvailable;exports.extractInputsFromTransaction=g.extractInputsFromTransaction;exports.findOverlappingPendingVaults=g.findOverlappingPendingVaults;exports.validateUtxosAvailable=g.validateUtxosAvailable;exports.MEMPOOL_API_URLS=o.MEMPOOL_API_URLS;exports.ViemVaultRegistryReader=o.ViemVaultRegistryReader;exports.getAddressTxs=o.getAddressTxs;exports.getAddressUtxos=o.getAddressUtxos;exports.getMempoolApiUrl=o.getMempoolApiUrl;exports.getNetworkFees=o.getNetworkFees;exports.getOutspend=o.getOutspend;exports.getTipHeight=o.getTipHeight;exports.getTxHex=o.getTxHex;exports.getTxInfo=o.getTxInfo;exports.getUtxoInfo=o.getUtxoInfo;exports.pushTx=o.pushTx;exports.validateOffchainParams=o.validateOffchainParams;exports.validatePegInConfiguration=o.validatePegInConfiguration;exports.validateTBVProtocolParams=o.validateTBVProtocolParams;exports.OnChainBtcVaultStatus=i.OnChainBtcVaultStatus;exports.ServerIdentityError=i.ServerIdentityError;exports.VaultProviderRpcClient=i.VaultProviderRpcClient;exports.ViemOperationKeyReader=i.ViemOperationKeyReader;exports.ViemProtocolParamsReader=i.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=i.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=i.ViemVaultKeeperReader;exports.VpResponseValidationError=i.VpResponseValidationError;exports.VpTokenRegistry=i.VpTokenRegistry;exports.batchPollByProvider=i.batchPollByProvider;exports.createAuthenticatedVpClient=i.createAuthenticatedVpClient;exports.primeVpTokenRegistry=i.primeVpTokenRegistry;exports.resolveProtocolAddresses=i.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=i.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=i.verifyServerIdentity;exports.vpTokenRegistry=i.vpTokenRegistry;exports.AUTH_REJECTED_RPC_CODE=n.AUTH_REJECTED_RPC_CODE;exports.DaemonStatus=n.DaemonStatus;exports.JSON_RPC_ERROR_CODES=n.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=n.JsonRpcClient;exports.JsonRpcError=n.JsonRpcError;exports.POST_WOTS_STATUSES=n.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=n.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=n.RpcErrorCode;exports.VP_BATCH_MAX_SIZE=n.VP_BATCH_MAX_SIZE;exports.VP_TERMINAL_FAILURE_STATUSES=n.VP_TERMINAL_FAILURE_STATUSES;exports.VP_TRANSIENT_STATUSES=n.VP_TRANSIENT_STATUSES;exports.isAuthRejectedError=n.isAuthRejectedError;exports.assertOnChainBtcPubkey=y.assertOnChainBtcPubkey;exports.DEPOSIT_TERMS_REJECTED_ERROR_NAME=t.DEPOSIT_TERMS_REJECTED_ERROR_NAME;exports.DepositTermsRejectedError=t.DepositTermsRejectedError;exports.PeginParamsAmbiguousError=t.PeginParamsAmbiguousError;exports.PeginParamsIncompleteSpaceError=t.PeginParamsIncompleteSpaceError;exports.PeginParamsNotFoundError=t.PeginParamsNotFoundError;exports.PeginSizingIntegrityError=t.PeginSizingIntegrityError;exports.UnanchoredPrePeginError=t.UnanchoredPrePeginError;exports.VaultRootMismatchError=t.VaultRootMismatchError;exports.buildPeginParamsCandidates=t.buildPeginParamsCandidates;exports.deriveHashlocksFromPrePegin=t.deriveHashlocksFromPrePegin;exports.describePeginParamsCandidate=t.describePeginParamsCandidate;exports.describeUnresolvedVersion=t.describeUnresolvedVersion;exports.isDepositTermsRejectedError=t.isDepositTermsRejectedError;exports.isWotsMismatchError=t.isWotsMismatchError;exports.rebuildDepositTermsCore=t.rebuildDepositTermsCore;exports.reconstructPeginParams=t.reconstructPeginParams;exports.toRefundInputs=t.toRefundInputs;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.PEGIN_ETH_CONFIRMATIONS=e.PEGIN_ETH_CONFIRMATIONS;exports.ParticipantKeyDriftError=e.ParticipantKeyDriftError;exports.PeginRegistrationMissingError=e.PeginRegistrationMissingError;exports.PeginRegistrationNotFinalError=e.PeginRegistrationNotFinalError;exports.REFUND_MAX_FEE_FRACTION_DENOMINATOR=e.REFUND_MAX_FEE_FRACTION_DENOMINATOR;exports.REFUND_MAX_FEE_FRACTION_NUMERATOR=e.REFUND_MAX_FEE_FRACTION_NUMERATOR;exports.REFUND_MAX_FEE_RATE_SATS_VB=e.REFUND_MAX_FEE_RATE_SATS_VB;exports.REFUND_VSIZE=e.REFUND_VSIZE;exports.RegisteredVaultVersionMismatchError=e.RegisteredVaultVersionMismatchError;exports.activateVault=e.activateVault;exports.activateVaultAndRedeem=e.activateVaultAndRedeem;exports.assertVaultProviderHintAccepted=e.assertVaultProviderHintAccepted;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.estimateRefundFeeSats=e.estimateRefundFeeSats;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isHintAccepted=e.isHintAccepted;exports.isParticipantKeyDriftError=e.isParticipantKeyDriftError;exports.isPeginRegistrationMissingError=e.isPeginRegistrationMissingError;exports.isPeginRegistrationNotFinalError=e.isPeginRegistrationNotFinalError;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.isRegisteredVaultVersionMismatchError=e.isRegisteredVaultVersionMismatchError;exports.matchKeyHint=e.matchKeyHint;exports.matchKeySetHint=e.matchKeySetHint;exports.resolveCurrentParticipantKeys=e.resolveCurrentParticipantKeys;exports.resolveParticipantKeysAtEpochs=e.resolveParticipantKeysAtEpochs;exports.runDepositorPresignFlow=e.runDepositorPresignFlow;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.validateDepositAmount=e.validateDepositAmount;exports.validateMultiVaultDepositInputs=e.validateMultiVaultDepositInputs;exports.validateOnChainParticipantKeys=e.validateOnChainParticipantKeys;exports.validateProviderSelection=e.validateProviderSelection;exports.validateRemainingCapacity=e.validateRemainingCapacity;exports.validateVaultAmounts=e.validateVaultAmounts;exports.validateVaultProviderPubkey=e.validateVaultProviderPubkey;exports.verifyRegisteredParticipantKeys=e.verifyRegisteredParticipantKeys;exports.verifyRegisteredVaultVersions=e.verifyRegisteredVaultVersions;exports.waitForPeginRegistrationDepth=e.waitForPeginRegistrationDepth;exports.waitForPeginStatus=e.waitForPeginStatus;exports.ContractStatus=T.ContractStatus;exports.PeginAction=T.PeginAction;exports.canPerformAction=T.canPerformAction;exports.getPeginProtocolState=T.getPeginProtocolState;exports.isActivationDeadlinePassedOnChain=T.isActivationDeadlinePassedOnChain;
2
2
  //# sourceMappingURL=index.cjs.map