@babylonlabs-io/ts-sdk 0.79.1 → 1.1.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.
Files changed (187) hide show
  1. package/README.md +11 -5
  2. package/dist/{signPsbtsWithFallback-f7QLp0q8.js → PayoutManager-CHTOwj0E.js} +26 -26
  3. package/dist/PayoutManager-CHTOwj0E.js.map +1 -0
  4. package/dist/PayoutManager-CpfQjtL0.cjs +2 -0
  5. package/dist/PayoutManager-CpfQjtL0.cjs.map +1 -0
  6. package/dist/PeginManager-6tjlGd0t.cjs +2 -0
  7. package/dist/PeginManager-6tjlGd0t.cjs.map +1 -0
  8. package/dist/{PeginManager-BXlh3ar0.js → PeginManager-DEldv_Ro.js} +23 -22
  9. package/dist/PeginManager-DEldv_Ro.js.map +1 -0
  10. package/dist/buildAndBroadcastReclaim-BwT6Jxp5.cjs +2 -0
  11. package/dist/buildAndBroadcastReclaim-BwT6Jxp5.cjs.map +1 -0
  12. package/dist/buildAndBroadcastReclaim-CqO2DoP8.js +1919 -0
  13. package/dist/buildAndBroadcastReclaim-CqO2DoP8.js.map +1 -0
  14. package/dist/challengeAssert-Cp_GeRg8.js.map +1 -1
  15. package/dist/challengeAssert-Z7_YULBb.cjs.map +1 -1
  16. package/dist/deriveVaultRoot-BwbXmN0x.js +79 -0
  17. package/dist/deriveVaultRoot-BwbXmN0x.js.map +1 -0
  18. package/dist/deriveVaultRoot-DvhkHzNb.cjs +2 -0
  19. package/dist/deriveVaultRoot-DvhkHzNb.cjs.map +1 -0
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.js +286 -268
  22. package/dist/index.js.map +1 -1
  23. package/dist/noPayout-DAWBQ0eG.cjs +2 -0
  24. package/dist/noPayout-DAWBQ0eG.cjs.map +1 -0
  25. package/dist/{noPayout-DiGr4eas.js → noPayout-qBXWKwav.js} +3 -3
  26. package/dist/noPayout-qBXWKwav.js.map +1 -0
  27. package/dist/onChainBtcPubkey-BXry_CM4.cjs +2 -0
  28. package/dist/onChainBtcPubkey-BXry_CM4.cjs.map +1 -0
  29. package/dist/onChainBtcPubkey-C1WqyxPM.js +159 -0
  30. package/dist/onChainBtcPubkey-C1WqyxPM.js.map +1 -0
  31. package/dist/parseFundingOutpoints-C_-PT9BT.cjs +2 -0
  32. package/dist/parseFundingOutpoints-C_-PT9BT.cjs.map +1 -0
  33. package/dist/parseFundingOutpoints-GSM-IaaK.js +17 -0
  34. package/dist/parseFundingOutpoints-GSM-IaaK.js.map +1 -0
  35. package/dist/{pegin-registration-client-pcczkzMg.js → pegin-registration-client-1sZ-74UC.js} +260 -383
  36. package/dist/pegin-registration-client-1sZ-74UC.js.map +1 -0
  37. package/dist/pegin-registration-client-BNV44jzw.cjs +2 -0
  38. package/dist/pegin-registration-client-BNV44jzw.cjs.map +1 -0
  39. package/dist/shared/index.cjs.map +1 -1
  40. package/dist/shared/index.js.map +1 -1
  41. package/dist/shared/wallets/interfaces/BitcoinWallet.d.ts +6 -3
  42. package/dist/shared/wallets/interfaces/BitcoinWallet.d.ts.map +1 -1
  43. package/dist/signing-3l5Aqd-H.cjs +2 -0
  44. package/dist/signing-3l5Aqd-H.cjs.map +1 -0
  45. package/dist/signing-Dhr2t0Z6.js +39 -0
  46. package/dist/signing-Dhr2t0Z6.js.map +1 -0
  47. package/dist/tbv/core/clients/eth/index.cjs +1 -1
  48. package/dist/tbv/core/clients/eth/index.js +8 -8
  49. package/dist/tbv/core/clients/index.cjs +1 -1
  50. package/dist/tbv/core/clients/index.js +8 -8
  51. package/dist/tbv/core/index.cjs +1 -1
  52. package/dist/tbv/core/index.d.ts +1 -1
  53. package/dist/tbv/core/index.js +284 -266
  54. package/dist/tbv/core/index.js.map +1 -1
  55. package/dist/tbv/core/managers/PayoutManager.d.ts +1 -1
  56. package/dist/tbv/core/managers/PeginManager.d.ts +1 -1
  57. package/dist/tbv/core/managers/index.cjs +1 -1
  58. package/dist/tbv/core/managers/index.js +2 -2
  59. package/dist/tbv/core/primitives/index.cjs +1 -1
  60. package/dist/tbv/core/primitives/index.d.ts +1 -1
  61. package/dist/tbv/core/primitives/index.js +3 -3
  62. package/dist/tbv/core/primitives/psbt/__tests__/assertPeginTxShape.test.d.ts +5 -3
  63. package/dist/tbv/core/primitives/psbt/__tests__/assertPeginTxShape.test.d.ts.map +1 -1
  64. package/dist/tbv/core/primitives/psbt/__tests__/deriveExpectedPeginPayoutScriptPubKey.test.d.ts +8 -0
  65. package/dist/tbv/core/primitives/psbt/__tests__/deriveExpectedPeginPayoutScriptPubKey.test.d.ts.map +1 -0
  66. package/dist/tbv/core/primitives/psbt/assertWasmPeginSizing.d.ts +6 -0
  67. package/dist/tbv/core/primitives/psbt/assertWasmPeginSizing.d.ts.map +1 -1
  68. package/dist/tbv/core/primitives/psbt/challengeAssert.d.ts +2 -2
  69. package/dist/tbv/core/primitives/psbt/challengeAssert.d.ts.map +1 -1
  70. package/dist/tbv/core/primitives/psbt/noPayout.d.ts +1 -1
  71. package/dist/tbv/core/primitives/psbt/noPayout.d.ts.map +1 -1
  72. package/dist/tbv/core/primitives/psbt/payout.d.ts +13 -7
  73. package/dist/tbv/core/primitives/psbt/payout.d.ts.map +1 -1
  74. package/dist/tbv/core/primitives/psbt/pegin.d.ts +4 -1
  75. package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
  76. package/dist/tbv/core/recovery/recoveryErrors.d.ts +1 -1
  77. package/dist/tbv/core/services/delegated-claim/__tests__/assembleWatchtowerArtifacts.test.d.ts +15 -0
  78. package/dist/tbv/core/services/delegated-claim/__tests__/assembleWatchtowerArtifacts.test.d.ts.map +1 -0
  79. package/dist/tbv/core/services/delegated-claim/__tests__/deriveClaimerWotsKeypair.test.d.ts +11 -0
  80. package/dist/tbv/core/services/delegated-claim/__tests__/deriveClaimerWotsKeypair.test.d.ts.map +1 -0
  81. package/dist/tbv/core/services/delegated-claim/__tests__/readWatchtowerArtifacts.test.d.ts +10 -0
  82. package/dist/tbv/core/services/delegated-claim/__tests__/readWatchtowerArtifacts.test.d.ts.map +1 -0
  83. package/dist/tbv/core/services/delegated-claim/__tests__/vaultIdBinding.test.d.ts +10 -0
  84. package/dist/tbv/core/services/delegated-claim/__tests__/vaultIdBinding.test.d.ts.map +1 -0
  85. package/dist/tbv/core/services/delegated-claim/__tests__/wotsKeypair.golden.test.d.ts +11 -0
  86. package/dist/tbv/core/services/delegated-claim/__tests__/wotsKeypair.golden.test.d.ts.map +1 -0
  87. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts +46 -0
  88. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts.map +1 -0
  89. package/dist/tbv/core/services/delegated-claim/challengerBinding.d.ts +72 -0
  90. package/dist/tbv/core/services/delegated-claim/challengerBinding.d.ts.map +1 -0
  91. package/dist/tbv/core/services/delegated-claim/deriveClaimerWotsKeypair.d.ts +63 -0
  92. package/dist/tbv/core/services/delegated-claim/deriveClaimerWotsKeypair.d.ts.map +1 -0
  93. package/dist/tbv/core/services/delegated-claim/index.d.ts +55 -0
  94. package/dist/tbv/core/services/delegated-claim/index.d.ts.map +1 -0
  95. package/dist/tbv/core/services/delegated-claim/payoutBinding.d.ts +65 -0
  96. package/dist/tbv/core/services/delegated-claim/payoutBinding.d.ts.map +1 -0
  97. package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts +70 -0
  98. package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts.map +1 -0
  99. package/dist/tbv/core/services/delegated-claim/types.d.ts +105 -0
  100. package/dist/tbv/core/services/delegated-claim/types.d.ts.map +1 -0
  101. package/dist/tbv/core/services/delegated-claim/vaultIdBinding.d.ts +44 -0
  102. package/dist/tbv/core/services/delegated-claim/vaultIdBinding.d.ts.map +1 -0
  103. package/dist/tbv/core/services/index.cjs +1 -1
  104. package/dist/tbv/core/services/index.d.ts +1 -0
  105. package/dist/tbv/core/services/index.d.ts.map +1 -1
  106. package/dist/tbv/core/services/index.js +73 -56
  107. package/dist/tbv/core/services/index.js.map +1 -1
  108. package/dist/tbv/core/utils/index.cjs +1 -1
  109. package/dist/tbv/core/utils/index.js +44 -43
  110. package/dist/tbv/core/utils/signing.d.ts +24 -0
  111. package/dist/tbv/core/utils/signing.d.ts.map +1 -1
  112. package/dist/tbv/core/vault-secrets/__tests__/context.golden.test.d.ts +4 -4
  113. package/dist/tbv/core/vault-secrets/__tests__/context.test.d.ts +1 -2
  114. package/dist/tbv/core/vault-secrets/__tests__/context.test.d.ts.map +1 -1
  115. package/dist/tbv/core/vault-secrets/__tests__/deriveContextHash.vectors.test.d.ts +40 -0
  116. package/dist/tbv/core/vault-secrets/__tests__/deriveContextHash.vectors.test.d.ts.map +1 -0
  117. package/dist/tbv/core/vault-secrets/context.d.ts +2 -2
  118. package/dist/tbv/core/vault-secrets/deriveVaultRoot.d.ts +5 -6
  119. package/dist/tbv/core/vault-secrets/deriveVaultRoot.d.ts.map +1 -1
  120. package/dist/tbv/core/vault-secrets/index.cjs +1 -1
  121. package/dist/tbv/core/vault-secrets/index.d.ts +2 -2
  122. package/dist/tbv/core/vault-secrets/index.js +9 -8
  123. package/dist/tbv/core/vault-secrets/index.js.map +1 -1
  124. package/dist/tbv/core/wasm/index.cjs +1 -1
  125. package/dist/tbv/core/wasm/index.cjs.map +1 -1
  126. package/dist/tbv/core/wasm/index.d.ts +113 -14
  127. package/dist/tbv/core/wasm/index.d.ts.map +1 -1
  128. package/dist/tbv/core/wasm/index.js +180 -94
  129. package/dist/tbv/core/wasm/index.js.map +1 -1
  130. package/dist/tbv/index.cjs +1 -1
  131. package/dist/tbv/index.js +284 -266
  132. package/dist/tbv/index.js.map +1 -1
  133. package/dist/tbv/integrations/aave/types.d.ts +1 -1
  134. package/dist/testing/MockBitcoinWallet.d.ts +1 -1
  135. package/dist/testing/index.cjs.map +1 -1
  136. package/dist/testing/index.js.map +1 -1
  137. package/dist/toRefundInputs-BaN9XluU.cjs +2 -0
  138. package/dist/toRefundInputs-BaN9XluU.cjs.map +1 -0
  139. package/dist/{toRefundInputs-9inv4Ai4.js → toRefundInputs-mtuuYezp.js} +24 -23
  140. package/dist/toRefundInputs-mtuuYezp.js.map +1 -0
  141. package/dist/{types-B9YhlXe8.js → types-BdCEoANP.js} +2 -2
  142. package/dist/{types-B9YhlXe8.js.map → types-BdCEoANP.js.map} +1 -1
  143. package/dist/{types-C1tpDycc.cjs → types-BuxreSq4.cjs} +2 -2
  144. package/dist/{types-C1tpDycc.cjs.map → types-BuxreSq4.cjs.map} +1 -1
  145. package/dist/{verifyKeyPathSchnorrSignature-BVtNwgK6.js → verifyKeyPathSchnorrSignature-BQHNhRj6.js} +2 -2
  146. package/dist/{verifyKeyPathSchnorrSignature-BVtNwgK6.js.map → verifyKeyPathSchnorrSignature-BQHNhRj6.js.map} +1 -1
  147. package/dist/{verifyKeyPathSchnorrSignature-BjB8Znly.cjs → verifyKeyPathSchnorrSignature-Gm9EmZkx.cjs} +2 -2
  148. package/dist/{verifyKeyPathSchnorrSignature-BjB8Znly.cjs.map → verifyKeyPathSchnorrSignature-Gm9EmZkx.cjs.map} +1 -1
  149. package/dist/verifyScriptPathSchnorrSignature-BKZihCjk.cjs +2 -0
  150. package/dist/verifyScriptPathSchnorrSignature-BKZihCjk.cjs.map +1 -0
  151. package/dist/{verifyScriptPathSchnorrSignature-D_epga4j.js → verifyScriptPathSchnorrSignature-CpjSTfMj.js} +371 -330
  152. package/dist/verifyScriptPathSchnorrSignature-CpjSTfMj.js.map +1 -0
  153. package/package.json +3 -3
  154. package/dist/PeginManager-BXlh3ar0.js.map +0 -1
  155. package/dist/PeginManager-BuVSknB0.cjs +0 -2
  156. package/dist/PeginManager-BuVSknB0.cjs.map +0 -1
  157. package/dist/buildAndBroadcastReclaim-N9dXH9dm.cjs +0 -2
  158. package/dist/buildAndBroadcastReclaim-N9dXH9dm.cjs.map +0 -1
  159. package/dist/buildAndBroadcastReclaim-O6z9kvc4.js +0 -1545
  160. package/dist/buildAndBroadcastReclaim-O6z9kvc4.js.map +0 -1
  161. package/dist/noPayout-4RZB2g1e.cjs +0 -2
  162. package/dist/noPayout-4RZB2g1e.cjs.map +0 -1
  163. package/dist/noPayout-DiGr4eas.js.map +0 -1
  164. package/dist/onChainBtcPubkey-BbxRrbvg.cjs +0 -2
  165. package/dist/onChainBtcPubkey-BbxRrbvg.cjs.map +0 -1
  166. package/dist/onChainBtcPubkey-C-6UWpD8.js +0 -34
  167. package/dist/onChainBtcPubkey-C-6UWpD8.js.map +0 -1
  168. package/dist/parseFundingOutpoints-B4iQeX6q.cjs +0 -2
  169. package/dist/parseFundingOutpoints-B4iQeX6q.cjs.map +0 -1
  170. package/dist/parseFundingOutpoints-BQWvINfm.js +0 -93
  171. package/dist/parseFundingOutpoints-BQWvINfm.js.map +0 -1
  172. package/dist/pegin-registration-client-CZgcU2_0.cjs +0 -2
  173. package/dist/pegin-registration-client-CZgcU2_0.cjs.map +0 -1
  174. package/dist/pegin-registration-client-pcczkzMg.js.map +0 -1
  175. package/dist/signPsbtsWithFallback-DtwzL5AA.cjs +0 -2
  176. package/dist/signPsbtsWithFallback-DtwzL5AA.cjs.map +0 -1
  177. package/dist/signPsbtsWithFallback-f7QLp0q8.js.map +0 -1
  178. package/dist/signing-BJ3X66b-.cjs +0 -2
  179. package/dist/signing-BJ3X66b-.cjs.map +0 -1
  180. package/dist/signing-Cm-McVR2.js +0 -22
  181. package/dist/signing-Cm-McVR2.js.map +0 -1
  182. package/dist/toRefundInputs-9inv4Ai4.js.map +0 -1
  183. package/dist/toRefundInputs-DitGWAnz.cjs +0 -2
  184. package/dist/toRefundInputs-DitGWAnz.cjs.map +0 -1
  185. package/dist/verifyScriptPathSchnorrSignature-D_epga4j.js.map +0 -1
  186. package/dist/verifyScriptPathSchnorrSignature-DaRqvEgW.cjs +0 -2
  187. package/dist/verifyScriptPathSchnorrSignature-DaRqvEgW.cjs.map +0 -1
package/dist/index.js CHANGED
@@ -1,284 +1,302 @@
1
- import { P as s, h as r, i as t, j as i, f as o, b as n, a as P, c as p, k as E, d as c, e as l, g as d } from "./verifyScriptPathSchnorrSignature-D_epga4j.js";
1
+ import { P as s, h as r, i as t, j as i, f as o, b as n, a as P, c as p, k as E, d as l, e as c, g as u } from "./verifyScriptPathSchnorrSignature-CpjSTfMj.js";
2
2
  import { a as g } from "./secp256k1-D-H9jmd7.js";
3
- import { computeMinClaimValue as A, computeMinPeginFee as _, deriveVaultId as T, expandAuthAnchor as m, expandHashlockSecret as S, expandWotsSeed as I, peginP2aAnchorOutput as C, supportedTxGraphVersions as O, validatePeginP2aAnchor as N } from "./tbv/core/wasm/index.js";
4
- import { a as x, c as b, b as h, e as V, f as F } from "./verifyKeyPathSchnorrSignature-BVtNwgK6.js";
5
- import { c as M, a as y, b as D, e as U, f as B, r as H } from "./noPayout-DiGr4eas.js";
6
- import { b as K } from "./challengeAssert-Cp_GeRg8.js";
7
- import { c as k, d as G, a as W, b as w, e as Y, f as j, 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 ra } 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 Ea, C as ca, H as la, K as da, M as ua, T as ga, X as Ra } from "./validation-OSC0xTHB.js";
11
- import { waitForTransactionReceiptSmartAware as _a } from "./tbv/core/utils/eth/index.js";
12
- import { P as ma, b as Sa, c as Ia, d as Ca, e as Oa } from "./PeginManager-BXlh3ar0.js";
13
- import { P as fa, c as xa, f as ba, r as ha, s as Va, v as Fa } from "./signPsbtsWithFallback-f7QLp0q8.js";
14
- import { MEMPOOL_API_URLS as Ma, getAddressTxs as ya, getAddressUtxos as Da, getMempoolApiUrl as Ua, getNetworkFees as Ba, getOutspend as Ha, getTipHeight as La, getTxHex as Ka, getTxInfo as Xa, getUtxoInfo as ka, pushTx as Ga } from "./tbv/core/clients/mempool/index.js";
15
- import { O as wa, V as Ya, a as ja, b as za, c as Ja, r as Za } from "./types-B9YhlXe8.js";
16
- import { a as Qa } from "./onChainBtcPubkey-C-6UWpD8.js";
17
- import { C as ae, M as ee, R as se, V as re, c as te, e as ie, d as oe, i as ne, v as Pe, a as pe, b as Ee } from "./pegin-registration-client-pcczkzMg.js";
18
- import { A as le, P as de } from "./ProtocolParams.abi-q0AidvYX.js";
19
- import { B as ge } from "./BTCVaultRegistry.abi-B0x9_Bza.js";
20
- import { B as Ae, C as _e, P as Te, a as me, e as Se, g as Ie, h as Ce, i as Oe, b as Ne } from "./BTCVaultRegistryKeyEpochs.abi-BWoxwPQv.js";
21
- import { V as xe, b as be, a as he, d as Ve, f as Fe, p as ve } from "./parseFundingOutpoints-BQWvINfm.js";
22
- import { BitcoinNetworks as ye } from "./shared/index.js";
23
- import { B as Ue, a as Be, c as He, b as Le, d as Ke, g as Xe, h as ke, f as Ge, s as We, e as we } from "./psbtInputFields-CCVyaQMi.js";
24
- import { B as je, D as ze, L as Je, M as Ze, c as qe, P as Qe, b as $e, a as as, S as es, T as ss, W as rs, f as ts, d as is, p as os, r as ns } from "./fundPeginTransaction-CwhRbCQC.js";
25
- import { U as ps, a as Es, e as cs, f as ls, v as ds } from "./reservation-Cj9F0rP9.js";
26
- import { V as gs, a as Rs, b as As, v as _s } from "./index-DQ5bfoT3.js";
27
- import { A as ms, D as Ss, J as Is, a as Cs, b as Os, d as Ns, P as fs, R as xs, e as bs, c as hs, V as Vs, i as Fs } from "./json-rpc-client-DuUARJvV.js";
28
- import { S as Ms, V as ys, c as Ds, p as Us, v as Bs, a as Hs } from "./primeVpAuth-DdfHSC53.js";
29
- import { D as Ks, f as Xs, P as ks, a as Gs, b as Ws, o as ws, p as Ys, n as js, q as zs, U as Js, V as Zs, j as qs, c as Qs, h as $s, l as ar, k as er, e as sr, g as rr, d as tr, i as ir, r as or, m as nr, t as Pr } from "./toRefundInputs-9inv4Ai4.js";
30
- import { A as Er, J as cr, G as lr, P as dr, p as ur, c as gr, d as Rr, U as Ar, V as _r, W as Tr, X as mr, M as Sr, N as Ir, O as Cr, Q as Or, S as Nr, R as fr, a as xr, b as br, z as hr, T as Vr, K as Fr, L as vr, g as Mr, h as yr, B as Dr, q as Ur, i as Br, e as Hr, I as Lr, H as Kr, u as Xr, C as kr, D as Gr, E as Wr, F as wr, r as Yr, s as jr, f as zr, j as Jr, k as Zr, v as qr, l as Qr, m as $r, n as at, o as et, t as st, x as rt, w as tt, y as it } from "./buildAndBroadcastReclaim-O6z9kvc4.js";
31
- import { C as nt, P as Pt, c as pt, g as Et, i as ct } from "./peginState-CxDiaKuk.js";
3
+ import { attachFinalizedAssert as R, computeMinClaimValue as _, computeMinPeginFee as m, deriveVaultId as T, expandAuthAnchor as S, expandHashlockSecret as C, expandWotsSeed as I, finalizePayout as O, finalizeWronglyChallenged as f, peginP2aAnchorOutput as h, pinPegoutProof as N, supportedTxGraphVersions as b, validatePeginP2aAnchor as V } from "./tbv/core/wasm/index.js";
4
+ import { a as F, c as M, b as v, e as y, f as D } from "./verifyKeyPathSchnorrSignature-BQHNhRj6.js";
5
+ import { c as B, a as H, b as L, e as K, f as X, r as k } from "./noPayout-qBXWKwav.js";
6
+ import { b as W } from "./challengeAssert-Cp_GeRg8.js";
7
+ import { c as z, d as Y, a as j, b as J, e as Z, f as q, k as Q, g as $, h as aa, i as ea, j as sa, p as ra, s as ta, t as ia, u as oa, v as na } from "./bitcoin-C-TuHb-v.js";
8
+ import { c as pa } from "./abortSignals-BPpAUL1Z.js";
9
+ import { c as la, a as ca, b as ua } from "./signing-Dhr2t0Z6.js";
10
+ import { B as ga, C as Aa, H as Ra, K as _a, M as ma, T as Ta, X as Sa } from "./validation-OSC0xTHB.js";
11
+ import { waitForTransactionReceiptSmartAware as Ia } from "./tbv/core/utils/eth/index.js";
12
+ import { P as fa, b as ha, c as Na, d as ba, e as Va } from "./PeginManager-DEldv_Ro.js";
13
+ import { P as Fa, c as Ma, f as va, r as ya, s as Da, v as Ua } from "./PayoutManager-CHTOwj0E.js";
14
+ import { MEMPOOL_API_URLS as Ha, getAddressTxs as La, getAddressUtxos as Ka, getMempoolApiUrl as Xa, getNetworkFees as ka, getOutspend as Ga, getTipHeight as Wa, getTxHex as wa, getTxInfo as za, getUtxoInfo as Ya, pushTx as ja } from "./tbv/core/clients/mempool/index.js";
15
+ import { O as Za, V as qa, a as Qa, b as $a, c as ae, r as ee } from "./types-BdCEoANP.js";
16
+ import { a as re, d as te } from "./onChainBtcPubkey-C1WqyxPM.js";
17
+ import { C as oe, M as ne, R as Pe, V as pe, c as Ee, d as le, i as ce, v as ue, a as de, b as ge } from "./pegin-registration-client-1sZ-74UC.js";
18
+ import { A as Re, P as _e } from "./ProtocolParams.abi-q0AidvYX.js";
19
+ import { B as Te } from "./BTCVaultRegistry.abi-B0x9_Bza.js";
20
+ import { B as Ce, C as Ie, P as Oe, a as fe, e as he, g as Ne, h as be, i as Ve, b as xe } from "./BTCVaultRegistryKeyEpochs.abi-BWoxwPQv.js";
21
+ import { V as Me, b as ve, a as ye, d as De, f as Ue } from "./deriveVaultRoot-BwbXmN0x.js";
22
+ import { p as He } from "./parseFundingOutpoints-GSM-IaaK.js";
23
+ import { BitcoinNetworks as Ke } from "./shared/index.js";
24
+ import { B as ke, a as Ge, c as We, b as we, d as ze, g as Ye, h as je, f as Je, s as Ze, e as qe } from "./psbtInputFields-CCVyaQMi.js";
25
+ import { B as $e, D as as, L as es, M as ss, c as rs, P as ts, b as is, a as os, S as ns, T as Ps, W as ps, f as Es, d as ls, p as cs, r as us } from "./fundPeginTransaction-CwhRbCQC.js";
26
+ import { U as gs, a as As, e as Rs, f as _s, v as ms } from "./reservation-Cj9F0rP9.js";
27
+ import { V as Ss, a as Cs, b as Is, v as Os } from "./index-DQ5bfoT3.js";
28
+ import { A as hs, D as Ns, J as bs, a as Vs, b as xs, d as Fs, P as Ms, R as vs, e as ys, c as Ds, V as Us, i as Bs } from "./json-rpc-client-DuUARJvV.js";
29
+ import { S as Ls, V as Ks, c as Xs, p as ks, v as Gs, a as Ws } from "./primeVpAuth-DdfHSC53.js";
30
+ import { D as zs, f as Ys, P as js, a as Js, b as Zs, o as qs, p as Qs, n as $s, q as ar, U as er, V as sr, j as rr, c as tr, h as ir, l as or, k as nr, e as Pr, g as pr, d as Er, i as lr, r as cr, m as ur, t as dr } from "./toRefundInputs-mtuuYezp.js";
31
+ import { p as Ar, A as Rr, X as _r, C as mr, T as Tr, D as Sr, i as Cr, F as Ir, P as Or, j as fr, k as hr, a4 as Nr, a5 as br, a6 as Vr, a7 as xr, _ as Fr, $ as Mr, a0 as vr, a1 as yr, a2 as Dr, R as Ur, V as Br, a as Hr, b as Lr, c as Kr, e as Xr, f as kr, h as Gr, g as Wr, L as wr, a3 as zr, Y as Yr, d as jr, Z as Jr, q as Zr, t as qr, M as Qr, G as $r, l as at, m as et, W as st, U as rt, I as tt, N as it, O as ot, Q as nt, S as Pt, r as pt, n as Et, o as lt, s as ct, u as ut, x as dt, v as gt, y as At, z as Rt, B as _t, E as mt, H as Tt, J as St, w as Ct, K as It } from "./buildAndBroadcastReclaim-CqO2DoP8.js";
32
+ import { C as ft, P as ht, c as Nt, g as bt, i as Vt } from "./peginState-CxDiaKuk.js";
32
33
  export {
33
- ms as AUTH_REJECTED_RPC_CODE,
34
- Er as ApplicationEntryPointMismatchError,
35
- le as ApplicationRegistryABI,
36
- cr as BIP68NotMatureError,
37
- Ea as BITCOIN_ADDRESS_RE,
38
- ge as BTCVaultRegistryABI,
39
- Ae as BTCVaultRegistryKeyEpochsABI,
40
- je as BTC_DUST_SAT,
41
- ye as BitcoinNetworks,
42
- Ue as BitcoinScriptType,
43
- ae as COMMISSION_BPS_HEADROOM,
44
- ca as COMPRESSED_PUBKEY_HEX_LEN,
45
- _e as CONTRACT_ERRORS,
46
- lr as ClaimerPegoutStatusValue,
47
- nt as ContractStatus,
48
- Ks as DEPOSIT_TERMS_REJECTED_ERROR_NAME,
49
- ze as DUST_THRESHOLD,
50
- Ss as DaemonStatus,
51
- Xs as DepositTermsRejectedError,
52
- la as HEX_RE,
53
- Is as JSON_RPC_ERROR_CODES,
54
- Cs as JsonRpcClient,
55
- Os as JsonRpcError,
56
- da as KNOWN_SCRIPT_PREFIXES,
57
- Je as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
58
- ee as MAX_ACCEPTABLE_COMMISSION_BPS_CAP,
59
- Ze as MAX_NON_LEGACY_OUTPUT_SIZE,
60
- ua as MAX_REASONABLE_FEE_SATS,
61
- qe as MAX_REASONABLE_PEGIN_VBYTES,
62
- Ma as MEMPOOL_API_URLS,
63
- wa as OnChainBtcVaultStatus,
64
- Qe as P2TR_INPUT_SIZE,
65
- $e as PEGIN_AUTH_ANCHOR_OUTPUTS,
34
+ hs as AUTH_REJECTED_RPC_CODE,
35
+ Ar as ApplicationEntryPointMismatchError,
36
+ Re as ApplicationRegistryABI,
37
+ Rr as ArtifactsVaultMismatchError,
38
+ _r as BIP68NotMatureError,
39
+ ga as BITCOIN_ADDRESS_RE,
40
+ Te as BTCVaultRegistryABI,
41
+ Ce as BTCVaultRegistryKeyEpochsABI,
42
+ $e as BTC_DUST_SAT,
43
+ Ke as BitcoinNetworks,
44
+ ke as BitcoinScriptType,
45
+ oe as COMMISSION_BPS_HEADROOM,
46
+ Aa as COMPRESSED_PUBKEY_HEX_LEN,
47
+ Ie as CONTRACT_ERRORS,
48
+ mr as ChallengerSetMismatchError,
49
+ Tr as ClaimerPegoutStatusValue,
50
+ ft as ContractStatus,
51
+ Sr as DELEGATED_CLAIM_TX_GRAPH_VERSION,
52
+ zs as DEPOSIT_TERMS_REJECTED_ERROR_NAME,
53
+ as as DUST_THRESHOLD,
54
+ Ns as DaemonStatus,
55
+ Ys as DepositTermsRejectedError,
56
+ Ra as HEX_RE,
57
+ bs as JSON_RPC_ERROR_CODES,
58
+ Vs as JsonRpcClient,
59
+ xs as JsonRpcError,
60
+ _a as KNOWN_SCRIPT_PREFIXES,
61
+ es as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
62
+ ne as MAX_ACCEPTABLE_COMMISSION_BPS_CAP,
63
+ ss as MAX_NON_LEGACY_OUTPUT_SIZE,
64
+ ma as MAX_REASONABLE_FEE_SATS,
65
+ rs as MAX_REASONABLE_PEGIN_VBYTES,
66
+ Ha as MEMPOOL_API_URLS,
67
+ Za as OnChainBtcVaultStatus,
68
+ ts as P2TR_INPUT_SIZE,
69
+ is as PEGIN_AUTH_ANCHOR_OUTPUTS,
66
70
  s as PEGIN_DEPOSITOR_CLAIM_VOUT,
67
- dr as PEGIN_ETH_CONFIRMATIONS,
68
- Te as PEGIN_FINGERPRINT_CHANGED_SELECTOR,
69
- ks as PEGIN_FINGERPRINT_DOMAIN,
70
- Gs as PEGIN_FINGERPRINT_DOMAIN_PREIMAGE,
71
- as as PEGIN_FIXED_OUTPUTS,
72
- Ns as POST_WOTS_STATUSES,
73
- fs as PRE_DEPOSITOR_SIGNATURES_STATES,
74
- ur as ParticipantKeyDriftError,
75
- fa as PayoutManager,
76
- Pt as PeginAction,
77
- me as PeginFingerprintChangedError,
78
- Ws as PeginFingerprintInputError,
79
- ma as PeginManager,
80
- ws as PeginParamsAmbiguousError,
81
- Ys as PeginParamsIncompleteSpaceError,
82
- js as PeginParamsNotFoundError,
83
- gr as PeginRegistrationMissingError,
84
- Rr as PeginRegistrationNotFinalError,
85
- zs as PeginSizingIntegrityError,
86
- de as ProtocolParamsABI,
71
+ Cr as PEGIN_ETH_CONFIRMATIONS,
72
+ Oe as PEGIN_FINGERPRINT_CHANGED_SELECTOR,
73
+ js as PEGIN_FINGERPRINT_DOMAIN,
74
+ Js as PEGIN_FINGERPRINT_DOMAIN_PREIMAGE,
75
+ os as PEGIN_FIXED_OUTPUTS,
76
+ Fs as POST_WOTS_STATUSES,
77
+ Ms as PRE_DEPOSITOR_SIGNATURES_STATES,
78
+ Ir as ParticipantKeyDriftError,
79
+ Or as PayoutDestinationError,
80
+ Fa as PayoutManager,
81
+ ht as PeginAction,
82
+ fe as PeginFingerprintChangedError,
83
+ Zs as PeginFingerprintInputError,
84
+ fa as PeginManager,
85
+ qs as PeginParamsAmbiguousError,
86
+ Qs as PeginParamsIncompleteSpaceError,
87
+ $s as PeginParamsNotFoundError,
88
+ fr as PeginRegistrationMissingError,
89
+ hr as PeginRegistrationNotFinalError,
90
+ ar as PeginSizingIntegrityError,
91
+ _e as ProtocolParamsABI,
87
92
  r as PsbtSubstitutionError,
88
- Ar as RECLAIM_MAX_FEE_FRACTION_DENOMINATOR,
89
- _r as RECLAIM_MAX_FEE_FRACTION_NUMERATOR,
90
- Tr as RECLAIM_MAX_FEE_RATE_SATS_VB,
91
- mr as RECLAIM_WARN_FEE_FRACTION_NUMERATOR,
92
- Sr as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
93
- Ir as REFUND_MAX_FEE_FRACTION_NUMERATOR,
94
- Cr as REFUND_MAX_FEE_RATE_SATS_VB,
95
- Or as REFUND_VSIZE,
96
- Nr as ReclaimUneconomicalError,
97
- fr as RegisteredVaultVersionMismatchError,
98
- se as RegistrationLogsUnavailableError,
99
- xs as RpcErrorCode,
100
- es as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
101
- Ms as ServerIdentityError,
102
- ga as TXID_RE,
103
- ss as TX_BUFFER_SIZE_OVERHEAD,
104
- Js as UnanchoredPrePeginError,
105
- ps as UtxoNotAvailableError,
106
- xe as VAULT_APP_NAME,
107
- bs as VP_BATCH_MAX_SIZE,
108
- hs as VP_TERMINAL_FAILURE_STATUSES,
109
- Vs as VP_TRANSIENT_STATUSES,
110
- gs as VaultProviderRpcClient,
111
- Zs as VaultRootMismatchError,
112
- Ya as ViemOperationKeyReader,
113
- re as ViemPeginRegistrationClient,
114
- ja as ViemProtocolParamsReader,
115
- za as ViemUniversalChallengerReader,
116
- Ja as ViemVaultKeeperReader,
117
- te as ViemVaultRegistryReader,
118
- Rs as VpResponseValidationError,
119
- ys as VpTokenRegistry,
120
- rs as WALLET_RELAY_FEE_RATE_THRESHOLD,
121
- Ra as X_ONLY_PUBKEY_HEX_LEN,
122
- xr as activateVault,
123
- br as activateVaultAndRedeem,
124
- Be as applyChangeOutputPolicy,
125
- x as assertKeyPathSchnorrSignature,
126
- Qa as assertOnChainBtcPubkey,
93
+ Nr as RECLAIM_MAX_FEE_FRACTION_DENOMINATOR,
94
+ br as RECLAIM_MAX_FEE_FRACTION_NUMERATOR,
95
+ Vr as RECLAIM_MAX_FEE_RATE_SATS_VB,
96
+ xr as RECLAIM_WARN_FEE_FRACTION_NUMERATOR,
97
+ Fr as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
98
+ Mr as REFUND_MAX_FEE_FRACTION_NUMERATOR,
99
+ vr as REFUND_MAX_FEE_RATE_SATS_VB,
100
+ yr as REFUND_VSIZE,
101
+ Dr as ReclaimUneconomicalError,
102
+ Ur as RegisteredVaultVersionMismatchError,
103
+ Pe as RegistrationLogsUnavailableError,
104
+ vs as RpcErrorCode,
105
+ ns as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
106
+ Ls as ServerIdentityError,
107
+ Ta as TXID_RE,
108
+ Ps as TX_BUFFER_SIZE_OVERHEAD,
109
+ er as UnanchoredPrePeginError,
110
+ gs as UtxoNotAvailableError,
111
+ Me as VAULT_APP_NAME,
112
+ ys as VP_BATCH_MAX_SIZE,
113
+ Ds as VP_TERMINAL_FAILURE_STATUSES,
114
+ Us as VP_TRANSIENT_STATUSES,
115
+ Br as VaultIdBindingError,
116
+ Ss as VaultProviderRpcClient,
117
+ sr as VaultRootMismatchError,
118
+ qa as ViemOperationKeyReader,
119
+ pe as ViemPeginRegistrationClient,
120
+ Qa as ViemProtocolParamsReader,
121
+ $a as ViemUniversalChallengerReader,
122
+ ae as ViemVaultKeeperReader,
123
+ Ee as ViemVaultRegistryReader,
124
+ Cs as VpResponseValidationError,
125
+ Ks as VpTokenRegistry,
126
+ ps as WALLET_RELAY_FEE_RATE_THRESHOLD,
127
+ Sa as X_ONLY_PUBKEY_HEX_LEN,
128
+ Hr as activateVault,
129
+ Lr as activateVaultAndRedeem,
130
+ Ge as applyChangeOutputPolicy,
131
+ Kr as assembleWatchtowerArtifacts,
132
+ Xr as assertArtifactsUsableForVault,
133
+ kr as assertChallengerSetMatchesVault,
134
+ Gr as assertClaimSpendsVault,
135
+ F as assertKeyPathSchnorrSignature,
136
+ re as assertOnChainBtcPubkey,
137
+ Wr as assertPayoutPaysRegisteredScript,
127
138
  t as assertPsbtUnsignedTxMatches,
128
- b as assertReturnedKeyPathSignatures,
139
+ M as assertReturnedKeyPathSignatures,
129
140
  i as assertScriptPathSchnorrSignature,
130
- Es as assertUtxosAvailable,
141
+ As as assertUtxosAvailable,
131
142
  g as assertValidVaultCoreVersion,
132
- hr as assertVaultProviderHintAccepted,
133
- As as batchPollByProvider,
134
- Vr as buildAndBroadcastReclaim,
135
- Fr as buildAndBroadcastRefund,
136
- K as buildChallengeAssertPsbt,
137
- Sa as buildDepositTerms,
138
- be as buildFundingOutpointsCommitment,
139
- M as buildNoPayoutPsbt,
143
+ wr as assertVaultProviderHintAccepted,
144
+ R as attachFinalizedAssert,
145
+ Is as batchPollByProvider,
146
+ zr as buildAndBroadcastReclaim,
147
+ Yr as buildAndBroadcastRefund,
148
+ W as buildChallengeAssertPsbt,
149
+ ha as buildDepositTerms,
150
+ ve as buildFundingOutpointsCommitment,
151
+ B as buildNoPayoutPsbt,
140
152
  o as buildPayoutPsbt,
141
- h as buildPeginInputPsbt,
142
- qs as buildPeginParamsCandidates,
153
+ v as buildPeginInputPsbt,
154
+ rr as buildPeginParamsCandidates,
143
155
  n as buildPeginTxFromFundedPrePegin,
144
156
  P as buildPrePeginPsbt,
145
- y as buildReclaimPsbt,
146
- D as buildRefundPsbt,
147
- he as buildVaultContext,
148
- na as calculateBtcTxHash,
149
- pt as canPerformAction,
150
- k as canonicalizeBtcPubkey,
151
- ie as capMaxAcceptableCommissionBps,
152
- ia as combineAbortSignals,
153
- He as computeChangeOutputFeeSats,
154
- xa as computeHashlock,
155
- Le as computeMaxDeposit,
156
- A as computeMinClaimValue,
157
- _ as computeMinPeginFee,
157
+ H as buildReclaimPsbt,
158
+ L as buildRefundPsbt,
159
+ ye as buildVaultContext,
160
+ la as calculateBtcTxHash,
161
+ Nt as canPerformAction,
162
+ z as canonicalizeBtcPubkey,
163
+ le as capMaxAcceptableCommissionBps,
164
+ pa as combineAbortSignals,
165
+ We as computeChangeOutputFeeSats,
166
+ Ma as computeHashlock,
167
+ we as computeMaxDeposit,
168
+ _ as computeMinClaimValue,
169
+ m as computeMinPeginFee,
158
170
  p as computeNumLocalChallengers,
159
- Ke as computePeginBaseFeeSats,
160
- Qs as computePeginFingerprint,
161
- Ia as computeWotsBlockPublicKeysHash,
162
- Ds as createAuthenticatedVpClient,
171
+ ze as computePeginBaseFeeSats,
172
+ tr as computePeginFingerprint,
173
+ Na as computeWotsBlockPublicKeysHash,
174
+ Xs as createAuthenticatedVpClient,
163
175
  E as createPayoutScript,
164
- Pa as createTaprootScriptPathSignOptions,
165
- G as deriveBip86ScriptPubKeyHex,
166
- c as deriveDepositorClaimDescriptor,
167
- l as deriveDepositorClaimScriptPubKey,
168
- $s as deriveHashlocksFromPrePegin,
169
- W as deriveNativeSegwitAddress,
170
- oe as derivePeginVaultId,
171
- w as deriveTaprootAddress,
176
+ ca as createTaprootScriptPathSignOptions,
177
+ ua as createTaprootScriptPathSignOptionsForInput,
178
+ Y as deriveBip86ScriptPubKeyHex,
179
+ jr as deriveClaimerWotsKeypair,
180
+ l as deriveDepositorClaimDescriptor,
181
+ c as deriveDepositorClaimScriptPubKey,
182
+ ir as deriveHashlocksFromPrePegin,
183
+ j as deriveNativeSegwitAddress,
184
+ te as derivePeginVaultId,
185
+ J as deriveTaprootAddress,
172
186
  T as deriveVaultId,
173
- Ve as deriveVaultRoot,
174
- Ca as deriveWotsBlocksFromSeed,
175
- ar as describePeginParamsCandidate,
176
- er as describeUnresolvedVersion,
177
- sr as encodePeginFingerprintPreimage,
178
- Y as ensureHexPrefix,
179
- Oa as ensurePrePeginTermsApproval,
180
- U as estimateReclaimFeeSats,
181
- vr as estimateRefundFeeSats,
182
- m as expandAuthAnchor,
183
- S as expandHashlockSecret,
187
+ De as deriveVaultRoot,
188
+ ba as deriveWotsBlocksFromSeed,
189
+ or as describePeginParamsCandidate,
190
+ nr as describeUnresolvedVersion,
191
+ Pr as encodePeginFingerprintPreimage,
192
+ Z as ensureHexPrefix,
193
+ Va as ensurePrePeginTermsApproval,
194
+ K as estimateReclaimFeeSats,
195
+ Jr as estimateRefundFeeSats,
196
+ S as expandAuthAnchor,
197
+ C as expandHashlockSecret,
184
198
  I as expandWotsSeed,
185
- Se as extractErrorData,
186
- cs as extractInputsFromTransaction,
187
- d as extractPayoutSignature,
188
- V as extractPeginInputSignature,
189
- F as finalizePeginInputPsbt,
190
- B as finalizeScriptPathWithSignatures,
191
- ls as findOverlappingPendingVaults,
192
- j as formatSatoshisToBtc,
193
- ba as forwardDepositApproval,
194
- Fe as forwardDeriveContextHash,
195
- ts as fundPeginTransaction,
196
- ya as getAddressTxs,
197
- Da as getAddressUtxos,
198
- Ie as getContractErrorMessage,
199
- Xe as getDustThreshold,
200
- Ua as getMempoolApiUrl,
201
- z as getNetwork,
202
- Ba as getNetworkFees,
203
- Ha as getOutspend,
204
- Et as getPeginProtocolState,
205
- ke as getPsbtInputFields,
206
- Ge as getScriptType,
207
- J as getSortedXOnlyPubkeys,
208
- La as getTipHeight,
209
- Ka as getTxHex,
210
- Xa as getTxInfo,
211
- ka as getUtxoInfo,
212
- Ce as handleContractError,
213
- Z as hexToUint8Array,
214
- ct as isActivationDeadlinePassedOnChain,
215
- q as isAddressFromPublicKey,
216
- Mr as isApplicationEntryPointMismatchError,
217
- Fs as isAuthRejectedError,
218
- yr as isDepositAmountValid,
219
- rr as isDepositTermsRejectedError,
220
- Dr as isHintAccepted,
221
- Oe as isKnownContractError,
222
- Ur as isParticipantKeyDriftError,
223
- Ne as isPeginFingerprintChangedError,
224
- tr as isPeginFingerprintInputError,
225
- Br as isPeginRegistrationMissingError,
226
- Hr as isPeginRegistrationNotFinalError,
227
- Lr as isPegoutTerminalStatus,
228
- Kr as isRecognizedPegoutStatus,
229
- Xr as isRegisteredVaultVersionMismatchError,
230
- ne as isRegistrationLogsUnavailableError,
231
- Q as isValidHex,
232
- ir as isWotsMismatchError,
233
- kr as matchKeyHint,
234
- Gr as matchKeySetHint,
235
- ve as parseFundingOutpointsFromTx,
236
- is as parseUnfundedWasmTransaction,
237
- os as peginOutputCount,
238
- C as peginP2aAnchorOutput,
239
- Us as primeVpTokenRegistry,
240
- $ as processPublicKeyToXOnly,
241
- Ga as pushTx,
242
- ns as rateBasedTxBufferFee,
243
- or as rebuildDepositTermsCore,
244
- H as reclaimVsize,
245
- nr as reconstructPeginParams,
246
- ha as requireChangeAddress,
247
- Wr as resolveCurrentParticipantKeys,
248
- wr as resolveParticipantKeysAtEpochs,
249
- Za as resolveProtocolAddresses,
250
- Yr as runDepositorPresignFlow,
251
- We as selectUtxosForPegin,
252
- we as shouldAddChangeOutput,
253
- jr as signDepositorGraph,
254
- aa as stripHexPrefix,
255
- zr as submitWotsPublicKey,
256
- O as supportedTxGraphVersions,
257
- Va as supportsDepositApproval,
258
- Pr as toRefundInputs,
259
- ea as toXOnly,
260
- sa as uint8ArrayToHex,
261
- Jr as validateDepositAmount,
262
- Zr as validateMultiVaultDepositInputs,
263
- Pe as validateOffchainParams,
264
- qr as validateOnChainParticipantKeys,
265
- pe as validatePegInConfiguration,
266
- N as validatePeginP2aAnchor,
267
- Qr as validateProviderSelection,
268
- $r as validateRemainingCapacity,
269
- _s as validateRequestDepositorClaimerArtifactsResponse,
270
- Fa as validateSecretAgainstHashlock,
271
- Ee as validateTBVProtocolParams,
272
- ds as validateUtxosAvailable,
273
- at as validateVaultAmounts,
274
- et as validateVaultProviderPubkey,
275
- ra as validateWalletPubkey,
276
- st as verifyRegisteredParticipantKeys,
277
- rt as verifyRegisteredVaultVersions,
278
- Bs as verifyServerIdentity,
279
- Hs as vpTokenRegistry,
280
- tt as waitForPeginRegistrationDepth,
281
- it as waitForPeginStatus,
282
- _a as waitForTransactionReceiptSmartAware
199
+ he as extractErrorData,
200
+ Rs as extractInputsFromTransaction,
201
+ u as extractPayoutSignature,
202
+ y as extractPeginInputSignature,
203
+ O as finalizePayout,
204
+ D as finalizePeginInputPsbt,
205
+ X as finalizeScriptPathWithSignatures,
206
+ f as finalizeWronglyChallenged,
207
+ _s as findOverlappingPendingVaults,
208
+ q as formatSatoshisToBtc,
209
+ va as forwardDepositApproval,
210
+ Ue as forwardDeriveContextHash,
211
+ Es as fundPeginTransaction,
212
+ La as getAddressTxs,
213
+ Ka as getAddressUtxos,
214
+ Ne as getContractErrorMessage,
215
+ Ye as getDustThreshold,
216
+ Xa as getMempoolApiUrl,
217
+ Q as getNetwork,
218
+ ka as getNetworkFees,
219
+ Ga as getOutspend,
220
+ bt as getPeginProtocolState,
221
+ je as getPsbtInputFields,
222
+ Je as getScriptType,
223
+ $ as getSortedXOnlyPubkeys,
224
+ Wa as getTipHeight,
225
+ wa as getTxHex,
226
+ za as getTxInfo,
227
+ Ya as getUtxoInfo,
228
+ be as handleContractError,
229
+ aa as hexToUint8Array,
230
+ Vt as isActivationDeadlinePassedOnChain,
231
+ ea as isAddressFromPublicKey,
232
+ Zr as isApplicationEntryPointMismatchError,
233
+ Bs as isAuthRejectedError,
234
+ qr as isDepositAmountValid,
235
+ pr as isDepositTermsRejectedError,
236
+ Qr as isHintAccepted,
237
+ Ve as isKnownContractError,
238
+ $r as isParticipantKeyDriftError,
239
+ xe as isPeginFingerprintChangedError,
240
+ Er as isPeginFingerprintInputError,
241
+ at as isPeginRegistrationMissingError,
242
+ et as isPeginRegistrationNotFinalError,
243
+ st as isPegoutTerminalStatus,
244
+ rt as isRecognizedPegoutStatus,
245
+ tt as isRegisteredVaultVersionMismatchError,
246
+ ce as isRegistrationLogsUnavailableError,
247
+ sa as isValidHex,
248
+ lr as isWotsMismatchError,
249
+ it as matchKeyHint,
250
+ ot as matchKeySetHint,
251
+ He as parseFundingOutpointsFromTx,
252
+ ls as parseUnfundedWasmTransaction,
253
+ cs as peginOutputCount,
254
+ h as peginP2aAnchorOutput,
255
+ N as pinPegoutProof,
256
+ ks as primeVpTokenRegistry,
257
+ ra as processPublicKeyToXOnly,
258
+ ja as pushTx,
259
+ us as rateBasedTxBufferFee,
260
+ cr as rebuildDepositTermsCore,
261
+ k as reclaimVsize,
262
+ ur as reconstructPeginParams,
263
+ ya as requireChangeAddress,
264
+ nt as resolveCurrentParticipantKeys,
265
+ Pt as resolveParticipantKeysAtEpochs,
266
+ ee as resolveProtocolAddresses,
267
+ pt as runDepositorPresignFlow,
268
+ Ze as selectUtxosForPegin,
269
+ qe as shouldAddChangeOutput,
270
+ Et as signDepositorGraph,
271
+ ta as stripHexPrefix,
272
+ lt as submitWotsPublicKey,
273
+ ct as summarizeWatchtowerArtifacts,
274
+ b as supportedTxGraphVersions,
275
+ Da as supportsDepositApproval,
276
+ dr as toRefundInputs,
277
+ ia as toXOnly,
278
+ oa as uint8ArrayToHex,
279
+ ut as validateDepositAmount,
280
+ dt as validateMultiVaultDepositInputs,
281
+ ue as validateOffchainParams,
282
+ gt as validateOnChainParticipantKeys,
283
+ de as validatePegInConfiguration,
284
+ V as validatePeginP2aAnchor,
285
+ At as validateProviderSelection,
286
+ Rt as validateRemainingCapacity,
287
+ Os as validateRequestDepositorClaimerArtifactsResponse,
288
+ Ua as validateSecretAgainstHashlock,
289
+ ge as validateTBVProtocolParams,
290
+ ms as validateUtxosAvailable,
291
+ _t as validateVaultAmounts,
292
+ mt as validateVaultProviderPubkey,
293
+ na as validateWalletPubkey,
294
+ Tt as verifyRegisteredParticipantKeys,
295
+ St as verifyRegisteredVaultVersions,
296
+ Gs as verifyServerIdentity,
297
+ Ws as vpTokenRegistry,
298
+ Ct as waitForPeginRegistrationDepth,
299
+ It as waitForPeginStatus,
300
+ Ia as waitForTransactionReceiptSmartAware
283
301
  };
284
302
  //# 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 m=require("bitcoinjs-lib"),x=require("buffer"),S=require("./tbv/core/wasm/index.cjs"),t=require("./bitcoin-D-O2GjbC.cjs"),h=require("./verifyScriptPathSchnorrSignature-BKZihCjk.cjs"),v=require("./constants-BTZdyOuk.cjs"),N=require("./fundPeginTransaction-54-Rwb2k.cjs"),k=require("./validation-C6XTfZak.cjs"),V=(1n<<64n)-1n;function B(r,u){if(!Array.isArray(r))throw new Error(`${u} must be an array of positive bigints (got ${typeof r}).`);if(r.length===0)throw new Error(`${u} must not be empty.`);return r.forEach((e,n)=>{if(typeof e!="bigint")throw new Error(`${u}[${n}] must be a bigint (got ${typeof e}); refusing to feed it into satoshi math.`);if(e<=0n)throw new Error(`${u}[${n}] must be > 0 (got ${e}).`);if(e>V)throw new Error(`${u}[${n}] must fit in a u64 (got ${e}); refusing to feed it into satoshi math.`)}),r}async function K(r){const{WasmPrePeginTx:u}=await S.loadTbvWasm(),{prePeginParams:e,fundedPrePeginTxHex:n,htlcVout:s,refundFee:f,hashlock:c}=r,l=h.normalizeAuthAnchorHash(e.authAnchorHash),o=new u(e.vaultCoreVersion,e.depositorPubkey,e.vaultProviderPubkey,e.vaultKeeperPubkeys,e.universalChallengerPubkeys,[...e.hashlocks],new BigUint64Array(B(e.pegInAmounts,"pegInAmounts")),e.timelockRefund,e.feeRate,e.minPeginFeeRate,e.numLocalChallengers,e.councilQuorum,e.councilSize,e.network,l);let a=null;try{const d=o.getHtlcScriptPubKey(s).toLowerCase(),i=h.deriveExpectedPrePeginHtlc(e,c),P=i.scriptPubKey.toString("hex");if(d!==P)throw new Error(`WASM HTLC scriptPubKey ${d} does not match the independently derived scriptPubKey ${P}.`);const T=o.getHtlcValue(s);a=o.fromFundedTransaction(n);const w=a.buildRefundTx(f,s),b=n.startsWith("0x")?n.slice(2):n,$=m.Transaction.fromHex(b),E=$.outs[s];if(!E)throw new Error(`HTLC output at vout ${s} not found in funded Pre-PegIn tx (tx has ${$.outs.length} outputs)`);const I=t.uint8ArrayToHex(new Uint8Array(E.script)).toLowerCase();if(I!==P)throw new Error(`HTLC scriptPubKey mismatch at vout ${s}: reconstructed template expects ${P}, funded tx carries ${I}. Refund refused — the (hashlocks, pegInAmounts) vector does not match the on-chain commitment.`);const g=BigInt(E.value);if(g!==T)throw new Error(`HTLC value mismatch at vout ${s}: reconstructed template expects ${T} sat, funded tx carries ${g} sat. Refund refused — the pegInAmounts vector does not match the on-chain commitment.`);const p=m.Transaction.fromHex(w);if(p.version!==v.REFUND_TX_VERSION)throw new Error(`Refund transaction version ${p.version} does not match protocol version ${v.REFUND_TX_VERSION}.`);if(p.locktime!==v.REFUND_TX_LOCKTIME)throw new Error(`Refund transaction locktime ${p.locktime} does not match protocol locktime ${v.REFUND_TX_LOCKTIME}.`);if(p.ins.length!==1)throw new Error(`Refund transaction must have exactly 1 input, got ${p.ins.length}`);const y=p.ins[0],H=$.getId(),O=t.uint8ArrayToHex(new Uint8Array(y.hash).slice().reverse());if(O!==H)throw new Error(`Refund input does not reference the Pre-PegIn transaction. Expected ${H}, got ${O}`);if(y.index!==s)throw new Error(`Refund input index ${y.index} does not match expected htlcVout ${s}`);if(y.sequence!==e.timelockRefund)throw new Error(`Refund input sequence ${y.sequence} does not match timelockRefund ${e.timelockRefund}.`);const R=new m.Psbt;if(R.setVersion(p.version),R.setLocktime(p.locktime),R.addInput({hash:y.hash,index:y.index,sequence:y.sequence,witnessUtxo:{script:E.script,value:E.value},tapLeafScript:[{leafVersion:t.TAPSCRIPT_LEAF_VERSION,script:i.refundScript,controlBlock:i.refundControlBlock}],tapInternalKey:x.Buffer.from(S.tapInternalPubkey),tapMerkleRoot:i.tapMerkleRoot}),p.outs.length!==1)throw new Error(`Refund transaction must have exactly 1 output, got ${p.outs.length}`);const _=p.outs[0],A=t.stripHexPrefix(t.deriveBip86ScriptPubKeyHex(e.depositorPubkey)).toLowerCase(),L=t.uint8ArrayToHex(new Uint8Array(_.script)).toLowerCase();if(L!==A)throw new Error(`Refund output scriptPubKey ${L} does not match the depositor's BIP-86 address ${A}. Refund refused — the reclaimed funds would not return to the depositor.`);const C=g-f;if(BigInt(_.value)!==C)throw new Error(`Refund output value ${BigInt(_.value)} sat does not equal the HTLC value ${g} sat minus the requested fee ${f} sat (expected ${C} sat). Refund refused — the reclaimed amount would be burned as excess fee.`);return R.addOutput({script:_.script,value:_.value}),{psbtHex:R.toHex()}}finally{a==null||a.free(),o.free()}}const M=2,D=4294967293,q=214,X=299,F=4;function U(r){if(!Number.isInteger(r)||r<1)throw new Error(`Reclaim input count must be a positive integer, got ${r}.`);return Math.ceil((q+X*r)/F)}function G(r,u){if(!Number.isFinite(r)||r<=0)throw new Error(`Reclaim fee rate must be a positive number, got ${r}.`);return BigInt(Math.ceil(r*U(u)))}function z(r){const{depositorPubkey:u,inputs:e,feeSats:n}=r;if(e.length===0)throw new Error("Reclaim requires at least one input; got none.");if(n<=0n)throw new Error(`Reclaim fee must be positive, got ${n} sat. Refusing to build a transaction that would not relay.`);const s=h.deriveDepositorClaimDescriptor(u),f=t.uint8ArrayToHex(new Uint8Array(s.scriptPubKey)).toLowerCase(),c=new m.Psbt;c.setVersion(M),c.setLocktime(0);let l=0n;const o=new Set;if(e.forEach((i,P)=>{const T=m.Transaction.fromHex(t.stripHexPrefix(i.depositorSignedPeginTxHex)),w=T.getId(),b=T.outs[h.PEGIN_DEPOSITOR_CLAIM_VOUT];if(!b)throw new Error(`PegIn ${w} has no output at vout ${h.PEGIN_DEPOSITOR_CLAIM_VOUT} (tx has ${T.outs.length}); there is no depositor-claim reserve to reclaim.`);const $=t.stripHexPrefix(i.observed.txid).toLowerCase();if($!==w)throw new Error(`Input ${P}: the observation is of ${$}, but this input spends PegIn ${w}. Reclaim refused — the reserve that was looked up is not the one being swept.`);if(i.observed.vout!==h.PEGIN_DEPOSITOR_CLAIM_VOUT)throw new Error(`Input ${P}: the observation is of vout ${i.observed.vout}, but the depositor-claim reserve is at vout ${h.PEGIN_DEPOSITOR_CLAIM_VOUT}. Reclaim refused.`);const E=t.uint8ArrayToHex(new Uint8Array(b.script)).toLowerCase();if(E!==f)throw new Error(`Input ${P}: PegIn ${w} vout ${h.PEGIN_DEPOSITOR_CLAIM_VOUT} pays ${E}, but the connected wallet's depositor-claim script is ${f}. Reclaim refused — this reserve belongs to a different wallet.`);const I=t.stripHexPrefix(i.observed.scriptPubKey).toLowerCase();if(I!==f)throw new Error(`Input ${P}: the observed UTXO ${w}:${h.PEGIN_DEPOSITOR_CLAIM_VOUT} pays ${I}, expected ${f}. Reclaim refused — chain state disagrees with the contract's PegIn.`);const g=BigInt(b.value);if(g!==i.observed.value)throw new Error(`Input ${P}: PegIn ${w} vout ${h.PEGIN_DEPOSITOR_CLAIM_VOUT} carries ${g} sat, but the observed UTXO carries ${i.observed.value} sat. Reclaim refused.`);if(g!==i.expectedValue)throw new Error(`Input ${P}: PegIn ${w} vout ${h.PEGIN_DEPOSITOR_CLAIM_VOUT} carries ${g} sat, but this vault's parameters compute a depositor-claim value of ${i.expectedValue} sat. Reclaim refused.`);const p=`${w}:${h.PEGIN_DEPOSITOR_CLAIM_VOUT}`;if(o.has(p))throw new Error(`Input ${P} repeats outpoint ${p}, which is already being swept by an earlier input. Reclaim refused.`);o.add(p),l+=g,c.addInput({hash:w,index:h.PEGIN_DEPOSITOR_CLAIM_VOUT,sequence:D,witnessUtxo:{script:b.script,value:b.value},tapLeafScript:[{leafVersion:t.TAPSCRIPT_LEAF_VERSION,script:s.leafScript,controlBlock:s.controlBlock}],tapInternalKey:s.internalKey})}),n>=l)throw new Error(`Reclaim fee ${n} sat is not less than the swept total ${l} sat. Refusing to build a transaction with no output.`);const a=l-n;if(a<=N.DUST_THRESHOLD)throw new Error(`Reclaim output ${a} sat is at or below the dust threshold ${N.DUST_THRESHOLD} sat. The reserve is not at risk — it stays where it is until fee rates fall.`);const d=t.stripHexPrefix(t.deriveBip86ScriptPubKeyHex(u));return c.addOutput({script:x.Buffer.from(t.hexToUint8Array(d)),value:Number(a)}),{psbtHex:c.toHex(),outputValue:a,totalInputValue:l}}function W(r){const{requestedPsbtHex:u,signaturesHex:e,signerXOnlyPubkeyHex:n}=r,s=t.stripHexPrefix(n);if(s.length!==k.X_ONLY_PUBKEY_HEX_LEN)throw new Error(`Signer x-only pubkey must be ${k.X_ONLY_PUBKEY_HEX_LEN} hex chars (32 bytes), got ${s.length}.`);const f=x.Buffer.from(t.hexToUint8Array(s)),c=m.Psbt.fromHex(u);if(e.length!==c.data.inputs.length)throw new Error(`Cannot finalize: got ${e.length} signature(s) for ${c.data.inputs.length} input(s). Every input must be signed — refusing to broadcast a partially signed transaction.`);return c.data.inputs.forEach((l,o)=>{if(l.tapKeySig)throw new Error(`Cannot finalize: input ${o} of the locally built PSBT carries a key-path signature. These outputs are script-path only.`);const a=l.tapLeafScript;if(!a||a.length!==1)throw new Error(`Cannot finalize: input ${o} must have exactly one tapLeafScript, got ${(a==null?void 0:a.length)??0}.`);const d=a[0];if(d.leafVersion!==t.TAPSCRIPT_LEAF_VERSION)throw new Error(`Cannot finalize: input ${o} tapLeafScript has leaf version 0x${d.leafVersion.toString(16)}, expected 0x${t.TAPSCRIPT_LEAF_VERSION.toString(16)}.`);const i=t.stripHexPrefix(e[o]);if(i.length!==t.SCHNORR_SIG_HEX_LEN)throw new Error(`Signature for input ${o} must be ${t.SCHNORR_SIG_HEX_LEN} hex chars (64 bytes), got ${i.length}.`);c.updateInput(o,{tapScriptSig:[{pubkey:f,leafHash:h.computeTapLeafHash(d.leafVersion,d.script),signature:x.Buffer.from(t.hexToUint8Array(i))}]})}),c.finalizeAllInputs(),c.extractTransaction().toHex()}async function Y(r){const u=t.stripHexPrefix(r.noPayoutTxHex),e=m.Transaction.fromHex(u),{noPayoutScript:n,noPayoutControlBlock:s}=await S.getAssertNoPayoutScriptInfo(r.connectorParams,r.challengerPubkey),f=t.hexToUint8Array(n),c=t.hexToUint8Array(s),l=new m.Psbt;l.setVersion(e.version),l.setLocktime(e.locktime);for(let o=0;o<e.ins.length;o++){const a=e.ins[o],d=r.prevouts[o];if(!d)throw new Error(`Missing prevout data for input ${o}`);const i={hash:a.hash,index:a.index,sequence:a.sequence,witnessUtxo:{script:x.Buffer.from(t.hexToUint8Array(t.stripHexPrefix(d.script_pubkey))),value:d.value}};o===0&&(i.tapLeafScript=[{leafVersion:t.TAPSCRIPT_LEAF_VERSION,script:x.Buffer.from(f),controlBlock:x.Buffer.from(c)}],i.tapInternalKey=x.Buffer.from(S.tapInternalPubkey)),l.addInput(i)}for(const o of e.outs)l.addOutput({script:o.script,value:o.value});return l.toHex()}function Q(r,u,e){const n=m.Transaction.fromHex(t.stripHexPrefix(r));if(n.outs.length!==1)throw new Error(`NoPayout transaction must have exactly 1 output, got ${n.outs.length}`);const s=t.hexToUint8Array(t.processPublicKeyToXOnly(u)),{output:f}=m.payments.p2tr({internalPubkey:x.Buffer.from(s),network:t.getNetwork(e)});if(!f)throw new Error("Failed to derive challenger BIP-86 P2TR scriptPubKey for NoPayout output validation");if(!n.outs[0].script.equals(f))throw new Error("NoPayout transaction does not pay to the expected challenger BIP-86 P2TR address")}exports.assertNoPayoutOutputMatchesChallenger=Q;exports.buildNoPayoutPsbt=Y;exports.buildReclaimPsbt=z;exports.buildRefundPsbt=K;exports.estimateReclaimFeeSats=G;exports.finalizeScriptPathWithSignatures=W;exports.reclaimVsize=U;
2
+ //# sourceMappingURL=noPayout-DAWBQ0eG.cjs.map