@babylonlabs-io/ts-sdk 0.70.0 → 0.71.0

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