@babylonlabs-io/ts-sdk 3.3.1 → 4.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 (197) hide show
  1. package/dist/{BTCVaultRegistry.abi-BzNTa_EU.js → BTCVaultRegistry.abi-DnP4UkB5.js} +9 -140
  2. package/dist/BTCVaultRegistry.abi-DnP4UkB5.js.map +1 -0
  3. package/dist/{BTCVaultRegistry.abi-BH2-LHxN.cjs → BTCVaultRegistry.abi-DzbfZ9_s.cjs} +2 -2
  4. package/dist/BTCVaultRegistry.abi-DzbfZ9_s.cjs.map +1 -0
  5. package/dist/{PayoutManager-xEGvTbhL.js → PayoutManager-BUWP-H-q.js} +3 -3
  6. package/dist/PayoutManager-BUWP-H-q.js.map +1 -0
  7. package/dist/{PayoutManager-B1Ev0r7o.cjs → PayoutManager-Dopxq_Jv.cjs} +2 -2
  8. package/dist/PayoutManager-Dopxq_Jv.cjs.map +1 -0
  9. package/dist/{PeginManager-D2R4Q1bN.cjs → PeginManager-CMbRRTnr.cjs} +2 -2
  10. package/dist/PeginManager-CMbRRTnr.cjs.map +1 -0
  11. package/dist/{PeginManager-CQ9bVPR3.js → PeginManager-Cas6_j7t.js} +7 -7
  12. package/dist/PeginManager-Cas6_j7t.js.map +1 -0
  13. package/dist/{ProtocolParams.abi-Cv77fsUe.js → ProtocolParams.abi-CuDl7AuC.js} +3 -3
  14. package/dist/{ProtocolParams.abi-Cv77fsUe.js.map → ProtocolParams.abi-CuDl7AuC.js.map} +1 -1
  15. package/dist/{ProtocolParams.abi-BgEZaQ2I.cjs → ProtocolParams.abi-DWfIh6VH.cjs} +2 -2
  16. package/dist/{ProtocolParams.abi-BgEZaQ2I.cjs.map → ProtocolParams.abi-DWfIh6VH.cjs.map} +1 -1
  17. package/dist/VaultErrors.abi-Dc3UnB_h.js +5 -0
  18. package/dist/{VaultErrors.abi-Boz4w97c.js.map → VaultErrors.abi-Dc3UnB_h.js.map} +1 -1
  19. package/dist/VaultErrors.abi-Hjn1CdLs.cjs +2 -0
  20. package/dist/{VaultErrors.abi-DQ18kM0L.cjs.map → VaultErrors.abi-Hjn1CdLs.cjs.map} +1 -1
  21. package/dist/{buildAndBroadcastReclaim-CQANDXVJ.js → buildAndBroadcastReclaim-ByXYSUwj.js} +372 -337
  22. package/dist/buildAndBroadcastReclaim-ByXYSUwj.js.map +1 -0
  23. package/dist/buildAndBroadcastReclaim-OBWjvzuC.cjs +2 -0
  24. package/dist/buildAndBroadcastReclaim-OBWjvzuC.cjs.map +1 -0
  25. package/dist/challengeAssert-eUMgmpMk.cjs +2 -0
  26. package/dist/challengeAssert-eUMgmpMk.cjs.map +1 -0
  27. package/dist/{challengeAssert-B2otuf7y.js → challengeAssert-pJP7MKhG.js} +164 -164
  28. package/dist/challengeAssert-pJP7MKhG.js.map +1 -0
  29. package/dist/constants-BCg6O0PX.cjs +2 -0
  30. package/dist/constants-BCg6O0PX.cjs.map +1 -0
  31. package/dist/constants-CmDDuM3L.js +50 -0
  32. package/dist/constants-CmDDuM3L.js.map +1 -0
  33. package/dist/{index-BRsWXDlv.js → index-B-9aXMxk.js} +6 -6
  34. package/dist/{index-BRsWXDlv.js.map → index-B-9aXMxk.js.map} +1 -1
  35. package/dist/{index-C6avwx1s.cjs → index-Dn7RlsKK.cjs} +2 -2
  36. package/dist/{index-C6avwx1s.cjs.map → index-Dn7RlsKK.cjs.map} +1 -1
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.js +68 -67
  39. package/dist/pegin-registration-client-DLlaZbsZ.cjs +2 -0
  40. package/dist/pegin-registration-client-DLlaZbsZ.cjs.map +1 -0
  41. package/dist/{pegin-registration-client-Cvjk4ILq.js → pegin-registration-client-ZI0k10_3.js} +90 -96
  42. package/dist/pegin-registration-client-ZI0k10_3.js.map +1 -0
  43. package/dist/{primeVpAuth-D4UWXQ76.js → primeVpAuth-C-ET0XF4.js} +2 -2
  44. package/dist/{primeVpAuth-D4UWXQ76.js.map → primeVpAuth-C-ET0XF4.js.map} +1 -1
  45. package/dist/{primeVpAuth-CXNXYKrh.cjs → primeVpAuth-Ch-ig2My.cjs} +2 -2
  46. package/dist/{primeVpAuth-CXNXYKrh.cjs.map → primeVpAuth-Ch-ig2My.cjs.map} +1 -1
  47. package/dist/registration-records-CKc0OVuK.cjs +2 -0
  48. package/dist/registration-records-CKc0OVuK.cjs.map +1 -0
  49. package/dist/{registration-records-DJJC2NiO.js → registration-records-D39ApuHS.js} +141 -141
  50. package/dist/registration-records-D39ApuHS.js.map +1 -0
  51. package/dist/{signer-set-reader-GrFe_rsW.cjs → signer-set-reader-CJfV-GDz.cjs} +2 -2
  52. package/dist/signer-set-reader-CJfV-GDz.cjs.map +1 -0
  53. package/dist/{signer-set-reader-CSUe92zE.js → signer-set-reader-DiwLeqik.js} +3 -3
  54. package/dist/signer-set-reader-DiwLeqik.js.map +1 -0
  55. package/dist/tbv/core/clients/eth/index.cjs +1 -1
  56. package/dist/tbv/core/clients/eth/index.js +4 -4
  57. package/dist/tbv/core/clients/eth/operation-key-reader.d.ts +5 -1
  58. package/dist/tbv/core/clients/eth/operation-key-reader.d.ts.map +1 -1
  59. package/dist/tbv/core/clients/eth/protocol-params-validation.d.ts.map +1 -1
  60. package/dist/tbv/core/clients/eth/registration-logs-error.d.ts +6 -6
  61. package/dist/tbv/core/clients/eth/registration-records.d.ts +1 -1
  62. package/dist/tbv/core/clients/eth/signer-set-reader.d.ts.map +1 -1
  63. package/dist/tbv/core/clients/eth/types.d.ts +32 -13
  64. package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
  65. package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts +1 -1
  66. package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts.map +1 -1
  67. package/dist/tbv/core/clients/index.cjs +1 -1
  68. package/dist/tbv/core/clients/index.d.ts +4 -2
  69. package/dist/tbv/core/clients/index.d.ts.map +1 -1
  70. package/dist/tbv/core/clients/index.js +6 -6
  71. package/dist/tbv/core/clients/vault-provider/status/index.cjs +1 -1
  72. package/dist/tbv/core/clients/vault-provider/status/index.js +1 -1
  73. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +5 -111
  74. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
  75. package/dist/tbv/core/contracts/abis/ProtocolParams.abi.d.ts +2 -2
  76. package/dist/tbv/core/contracts/abis/vaultErrors.abi.json.d.ts +1 -1
  77. package/dist/tbv/core/contracts/index.cjs +1 -1
  78. package/dist/tbv/core/contracts/index.js +3 -3
  79. package/dist/tbv/core/deposit-terms/__tests__/rebuildDepositTermsCore.test.d.ts +1 -1
  80. package/dist/tbv/core/deposit-terms/commissionCeiling.d.ts +1 -1
  81. package/dist/tbv/core/deposit-terms/depositTerms.d.ts +11 -9
  82. package/dist/tbv/core/deposit-terms/depositTerms.d.ts.map +1 -1
  83. package/dist/tbv/core/deposit-terms/rebuildDepositTermsCore.d.ts.map +1 -1
  84. package/dist/tbv/core/index.cjs +1 -1
  85. package/dist/tbv/core/index.js +69 -68
  86. package/dist/tbv/core/managers/PayoutManager.d.ts +9 -3
  87. package/dist/tbv/core/managers/PayoutManager.d.ts.map +1 -1
  88. package/dist/tbv/core/managers/PeginManager.d.ts +13 -3
  89. package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
  90. package/dist/tbv/core/managers/index.cjs +1 -1
  91. package/dist/tbv/core/managers/index.js +2 -2
  92. package/dist/tbv/core/primitives/__tests__/vaultCoreVersion.test.d.ts +1 -1
  93. package/dist/tbv/core/primitives/challengers.d.ts +12 -5
  94. package/dist/tbv/core/primitives/challengers.d.ts.map +1 -1
  95. package/dist/tbv/core/primitives/index.cjs +1 -1
  96. package/dist/tbv/core/primitives/index.d.ts +1 -1
  97. package/dist/tbv/core/primitives/index.js +3 -3
  98. package/dist/tbv/core/primitives/psbt/__tests__/deriveExpectedPeginPayoutScriptPubKey.test.d.ts +1 -1
  99. package/dist/tbv/core/primitives/psbt/assertWasmPeginSizing.d.ts.map +1 -1
  100. package/dist/tbv/core/primitives/psbt/constants.d.ts +38 -13
  101. package/dist/tbv/core/primitives/psbt/constants.d.ts.map +1 -1
  102. package/dist/tbv/core/primitives/psbt/depositorClaim.d.ts +3 -6
  103. package/dist/tbv/core/primitives/psbt/depositorClaim.d.ts.map +1 -1
  104. package/dist/tbv/core/primitives/psbt/pegin.d.ts +29 -9
  105. package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
  106. package/dist/tbv/core/primitives/psbt/refund.d.ts.map +1 -1
  107. package/dist/tbv/core/recovery/peginParamsCandidates.d.ts +1 -1
  108. package/dist/tbv/core/recovery/reconstructPeginParams.d.ts.map +1 -1
  109. package/dist/tbv/core/services/delegated-claim/__tests__/realWasmWatchtowerArtifacts.test.d.ts +2 -2
  110. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts +2 -1
  111. package/dist/tbv/core/services/delegated-claim/assembleWatchtowerArtifacts.d.ts.map +1 -1
  112. package/dist/tbv/core/services/delegated-claim/challengerBinding.d.ts +3 -3
  113. package/dist/tbv/core/services/delegated-claim/challengerBinding.d.ts.map +1 -1
  114. package/dist/tbv/core/services/delegated-claim/deriveClaimerWotsKeypair.d.ts +1 -1
  115. package/dist/tbv/core/services/delegated-claim/deriveClaimerWotsKeypair.d.ts.map +1 -1
  116. package/dist/tbv/core/services/delegated-claim/planDelegatedClaimSigning.d.ts +2 -1
  117. package/dist/tbv/core/services/delegated-claim/planDelegatedClaimSigning.d.ts.map +1 -1
  118. package/dist/tbv/core/services/delegated-claim/readDelegatedClaimVaultContext.d.ts +1 -1
  119. package/dist/tbv/core/services/delegated-claim/readDelegatedClaimVaultContext.d.ts.map +1 -1
  120. package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts +3 -3
  121. package/dist/tbv/core/services/delegated-claim/readWatchtowerArtifacts.d.ts.map +1 -1
  122. package/dist/tbv/core/services/delegated-claim/types.d.ts +8 -9
  123. package/dist/tbv/core/services/delegated-claim/types.d.ts.map +1 -1
  124. package/dist/tbv/core/services/deposit/__tests__/signDepositorGraph.realGraph.test.d.ts +3 -3
  125. package/dist/tbv/core/services/deposit/runDepositorPresignFlow.d.ts +19 -4
  126. package/dist/tbv/core/services/deposit/runDepositorPresignFlow.d.ts.map +1 -1
  127. package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts +17 -3
  128. package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts.map +1 -1
  129. package/dist/tbv/core/services/index.cjs +1 -1
  130. package/dist/tbv/core/services/index.js +44 -43
  131. package/dist/tbv/core/services/participants/readStampedParticipantKeys.d.ts +19 -7
  132. package/dist/tbv/core/services/participants/readStampedParticipantKeys.d.ts.map +1 -1
  133. package/dist/tbv/core/services/refund/__tests__/readRefundPrePeginContext.test.d.ts +12 -0
  134. package/dist/tbv/core/services/refund/__tests__/readRefundPrePeginContext.test.d.ts.map +1 -0
  135. package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts +41 -12
  136. package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts.map +1 -1
  137. package/dist/tbv/core/services/refund/index.d.ts +1 -0
  138. package/dist/tbv/core/services/refund/index.d.ts.map +1 -1
  139. package/dist/tbv/core/services/refund/readRefundPrePeginContext.d.ts +41 -0
  140. package/dist/tbv/core/services/refund/readRefundPrePeginContext.d.ts.map +1 -0
  141. package/dist/tbv/core/wasm/index.cjs.map +1 -1
  142. package/dist/tbv/core/wasm/index.d.ts +8 -11
  143. package/dist/tbv/core/wasm/index.d.ts.map +1 -1
  144. package/dist/tbv/core/wasm/index.js.map +1 -1
  145. package/dist/tbv/index.cjs +1 -1
  146. package/dist/tbv/index.js +69 -68
  147. package/dist/toRefundInputs-BSQjDOK9.cjs +2 -0
  148. package/dist/toRefundInputs-BSQjDOK9.cjs.map +1 -0
  149. package/dist/{toRefundInputs-DH-1bRNY.js → toRefundInputs-BbbvPb2A.js} +175 -173
  150. package/dist/toRefundInputs-BbbvPb2A.js.map +1 -0
  151. package/dist/{types-BC2TGzcp.cjs → types-BnZIbDHb.cjs} +2 -2
  152. package/dist/types-BnZIbDHb.cjs.map +1 -0
  153. package/dist/{types-24A9Qoxb.js → types-K_aM5GZO.js} +39 -39
  154. package/dist/types-K_aM5GZO.js.map +1 -0
  155. package/dist/{verifyKeyPathSchnorrSignature-IIj3Z2se.js → verifyKeyPathSchnorrSignature-DPXOFOol.js} +2 -2
  156. package/dist/{verifyKeyPathSchnorrSignature-IIj3Z2se.js.map → verifyKeyPathSchnorrSignature-DPXOFOol.js.map} +1 -1
  157. package/dist/{verifyKeyPathSchnorrSignature-BRTpEH9X.cjs → verifyKeyPathSchnorrSignature-DcxCojp0.cjs} +2 -2
  158. package/dist/{verifyKeyPathSchnorrSignature-BRTpEH9X.cjs.map → verifyKeyPathSchnorrSignature-DcxCojp0.cjs.map} +1 -1
  159. package/dist/verifyScriptPathSchnorrSignature-CgDa9Rcg.cjs +2 -0
  160. package/dist/verifyScriptPathSchnorrSignature-CgDa9Rcg.cjs.map +1 -0
  161. package/dist/{verifyScriptPathSchnorrSignature-owu3BfyT.js → verifyScriptPathSchnorrSignature-D-fdi-sG.js} +462 -459
  162. package/dist/verifyScriptPathSchnorrSignature-D-fdi-sG.js.map +1 -0
  163. package/package.json +3 -3
  164. package/dist/BTCVaultRegistry.abi-BH2-LHxN.cjs.map +0 -1
  165. package/dist/BTCVaultRegistry.abi-BzNTa_EU.js.map +0 -1
  166. package/dist/PayoutManager-B1Ev0r7o.cjs.map +0 -1
  167. package/dist/PayoutManager-xEGvTbhL.js.map +0 -1
  168. package/dist/PeginManager-CQ9bVPR3.js.map +0 -1
  169. package/dist/PeginManager-D2R4Q1bN.cjs.map +0 -1
  170. package/dist/VaultErrors.abi-Boz4w97c.js +0 -5
  171. package/dist/VaultErrors.abi-DQ18kM0L.cjs +0 -2
  172. package/dist/buildAndBroadcastReclaim-CQANDXVJ.js.map +0 -1
  173. package/dist/buildAndBroadcastReclaim-DPk36Uhp.cjs +0 -2
  174. package/dist/buildAndBroadcastReclaim-DPk36Uhp.cjs.map +0 -1
  175. package/dist/challengeAssert-B2otuf7y.js.map +0 -1
  176. package/dist/challengeAssert-C3eMcM5Y.cjs +0 -2
  177. package/dist/challengeAssert-C3eMcM5Y.cjs.map +0 -1
  178. package/dist/constants-CAm10Qwp.cjs +0 -2
  179. package/dist/constants-CAm10Qwp.cjs.map +0 -1
  180. package/dist/constants-CvQZuxKv.js +0 -48
  181. package/dist/constants-CvQZuxKv.js.map +0 -1
  182. package/dist/pegin-registration-client-CdRyXP3j.cjs +0 -2
  183. package/dist/pegin-registration-client-CdRyXP3j.cjs.map +0 -1
  184. package/dist/pegin-registration-client-Cvjk4ILq.js.map +0 -1
  185. package/dist/registration-records-DJJC2NiO.js.map +0 -1
  186. package/dist/registration-records-XQMIKjGV.cjs +0 -2
  187. package/dist/registration-records-XQMIKjGV.cjs.map +0 -1
  188. package/dist/signer-set-reader-CSUe92zE.js.map +0 -1
  189. package/dist/signer-set-reader-GrFe_rsW.cjs.map +0 -1
  190. package/dist/toRefundInputs-DH-1bRNY.js.map +0 -1
  191. package/dist/toRefundInputs-DRmK83fv.cjs +0 -2
  192. package/dist/toRefundInputs-DRmK83fv.cjs.map +0 -1
  193. package/dist/types-24A9Qoxb.js.map +0 -1
  194. package/dist/types-BC2TGzcp.cjs.map +0 -1
  195. package/dist/verifyScriptPathSchnorrSignature-CahYx5Td.cjs +0 -2
  196. package/dist/verifyScriptPathSchnorrSignature-CahYx5Td.cjs.map +0 -1
  197. package/dist/verifyScriptPathSchnorrSignature-owu3BfyT.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { c as s, v as e } from "../../../PayoutManager-xEGvTbhL.js";
2
- import { J as r, l as n, A as o, a8 as l, C as c, D as E, n as g, G as A, u as d, W as u, P as R, j as m, v as p, w as P, ah as _, ai as C, aj as M, ak as h, ab as F, ac as S, ad as V, ae as f, af as y, Z as N, S as D, V as I, a as v, b as T, d as O, e as K, m as b, f as B, g as U, t as H, i as L, B as x, o as G, a1 as W, ag as X, a9 as w, c as k, k as z, h as j, aa as Z, E as q, K as J, M as Q, a2 as Y, X as $, x as aa, y as ta, _ as sa, a3 as ea, a4 as ia, p as ra, r as na, a5 as oa, a6 as la, a7 as ca, F as Ea, q as ga, H as Aa, I as da, s as ua, N as Ra, O as ma, L as pa, Q as Pa, R as _a, T as Ca, U as Ma, Y as ha, $ as Fa, z as Sa, a0 as Va } from "../../../buildAndBroadcastReclaim-CQANDXVJ.js";
3
- import { attachFinalizedAssert as ya, finalizePayout as Na, finalizeWronglyChallenged as Da, pinPegoutProof as Ia } from "../wasm/index.js";
4
- import { C as Ta, P as Oa, a as Ka, c as ba, g as Ba, i as Ua } from "../../../peginState-CIibG9S_.js";
5
- import { C as La, g as xa, f as Ga } from "../../../state-CFn1rT74.js";
1
+ import { c as s, v as e } from "../../../PayoutManager-BUWP-H-q.js";
2
+ import { J as r, l as n, A as o, a8 as l, C as c, D as E, n as g, G as d, u, W as A, P as R, j as m, v as p, w as P, ai as _, aj as C, ak as M, al as h, ab as F, ac as f, ad as S, ae as V, ag as y, Z as N, S as D, V as I, a as v, b as T, d as O, e as K, m as b, f as B, g as U, t as x, i as H, B as L, o as G, a1 as W, ah as X, a9 as w, c as k, k as z, h as j, aa as Z, E as q, K as J, M as Q, a2 as Y, X as $, x as aa, y as ta, _ as sa, a3 as ea, a4 as ia, p as ra, r as na, af as oa, a5 as la, a6 as ca, a7 as Ea, F as ga, q as da, H as ua, I as Aa, s as Ra, N as ma, O as pa, L as Pa, Q as _a, R as Ca, T as Ma, U as ha, Y as Fa, $ as fa, z as Sa, a0 as Va } from "../../../buildAndBroadcastReclaim-ByXYSUwj.js";
3
+ import { attachFinalizedAssert as Na, finalizePayout as Da, finalizeWronglyChallenged as Ia, pinPegoutProof as va } from "../wasm/index.js";
4
+ import { C as Oa, P as Ka, a as ba, c as Ba, g as Ua, i as xa } from "../../../peginState-CIibG9S_.js";
5
+ import { C as La, g as Ga, f as Wa } from "../../../state-CFn1rT74.js";
6
6
  export {
7
7
  r as ApplicationEntryPointMismatchError,
8
8
  n as ArtifactsVaultMismatchError,
@@ -10,15 +10,15 @@ export {
10
10
  l as BIP68NotMatureError,
11
11
  c as ChallengerSetMismatchError,
12
12
  La as ClaimerPegoutStatusValue,
13
- Ta as ContractStatus,
13
+ Oa as ContractStatus,
14
14
  E as DELEGATED_CLAIM_TX_GRAPH_VERSION,
15
15
  g as DelegatedClaimSigningIncompleteError,
16
- A as GraphFingerprintError,
17
- d as PEGIN_ETH_CONFIRMATIONS,
18
- u as ParticipantKeyDriftError,
16
+ d as GraphFingerprintError,
17
+ u as PEGIN_ETH_CONFIRMATIONS,
18
+ A as ParticipantKeyDriftError,
19
19
  R as PayoutDestinationError,
20
20
  m as PayoutInputLeafError,
21
- Oa as PeginAction,
21
+ Ka as PeginAction,
22
22
  p as PeginRegistrationMissingError,
23
23
  P as PeginRegistrationNotFinalError,
24
24
  _ as RECLAIM_MAX_FEE_FRACTION_DENOMINATOR,
@@ -26,72 +26,73 @@ export {
26
26
  M as RECLAIM_MAX_FEE_RATE_SATS_VB,
27
27
  h as RECLAIM_WARN_FEE_FRACTION_NUMERATOR,
28
28
  F as REFUND_MAX_FEE_FRACTION_DENOMINATOR,
29
- S as REFUND_MAX_FEE_FRACTION_NUMERATOR,
30
- V as REFUND_MAX_FEE_RATE_SATS_VB,
31
- f as REFUND_VSIZE,
29
+ f as REFUND_MAX_FEE_FRACTION_NUMERATOR,
30
+ S as REFUND_MAX_FEE_RATE_SATS_VB,
31
+ V as REFUND_VSIZE,
32
32
  y as ReclaimUneconomicalError,
33
33
  N as RegisteredVaultVersionMismatchError,
34
34
  D as SigningPlanMismatchError,
35
35
  I as VaultIdBindingError,
36
36
  v as activateVault,
37
37
  T as activateVaultAndRedeem,
38
- Ka as activationDeadlineBlocksRemaining,
38
+ ba as activationDeadlineBlocksRemaining,
39
39
  O as assembleWatchtowerArtifacts,
40
40
  K as assembleWatchtowerArtifactsFromSignatures,
41
41
  b as assertArtifactsUsableForVault,
42
42
  B as assertAssertBindsClaimAndPayout,
43
43
  U as assertChallengerSetMatchesVault,
44
- H as assertClaimSpendsVault,
45
- L as assertPayoutPaysRegisteredScript,
46
- x as assertReturnedGraphMatchesFingerprint,
44
+ x as assertClaimSpendsVault,
45
+ H as assertPayoutPaysRegisteredScript,
46
+ L as assertReturnedGraphMatchesFingerprint,
47
47
  G as assertTermsMatchVault,
48
48
  W as assertVaultProviderHintAccepted,
49
- ya as attachFinalizedAssert,
49
+ Na as attachFinalizedAssert,
50
50
  X as buildAndBroadcastReclaim,
51
51
  w as buildAndBroadcastRefund,
52
- ba as canPerformAction,
52
+ Ba as canPerformAction,
53
53
  k as claimExpiredVault,
54
54
  s as computeHashlock,
55
55
  z as copyAssertConnectorLeaf,
56
56
  j as deriveClaimerWotsKeypair,
57
57
  Z as estimateRefundFeeSats,
58
- Na as finalizePayout,
59
- Da as finalizeWronglyChallenged,
58
+ Da as finalizePayout,
59
+ Ia as finalizeWronglyChallenged,
60
60
  q as fingerprintReturnedGraph,
61
- Ba as getPeginProtocolState,
62
- Ua as isActivationDeadlinePassedOnChain,
61
+ Ua as getPeginProtocolState,
62
+ xa as isActivationDeadlinePassedOnChain,
63
63
  J as isApplicationEntryPointMismatchError,
64
64
  Q as isDepositAmountValid,
65
65
  Y as isHintAccepted,
66
66
  $ as isParticipantKeyDriftError,
67
67
  aa as isPeginRegistrationMissingError,
68
68
  ta as isPeginRegistrationNotFinalError,
69
- xa as isPegoutTerminalStatus,
70
- Ga as isRecognizedPegoutStatus,
69
+ Ga as isPegoutTerminalStatus,
70
+ Wa as isRecognizedPegoutStatus,
71
71
  sa as isRegisteredVaultVersionMismatchError,
72
72
  ea as matchKeyHint,
73
73
  ia as matchKeySetHint,
74
- Ia as pinPegoutProof,
74
+ va as pinPegoutProof,
75
75
  ra as planDelegatedClaimSigning,
76
76
  na as readDelegatedClaimVaultContext,
77
- oa as readStampedParticipantKeys,
78
- la as resolveCurrentParticipantKeys,
79
- ca as resolveParticipantKeysAtEpochs,
80
- Ea as runDepositorPresignFlow,
81
- ga as signDelegatedClaimPlan,
82
- Aa as signDepositorGraph,
83
- da as submitWotsPublicKey,
84
- ua as summarizeWatchtowerArtifacts,
85
- Ra as validateDepositAmount,
86
- ma as validateMultiVaultDepositInputs,
87
- pa as validateOnChainParticipantKeys,
88
- Pa as validateProviderSelection,
89
- _a as validateRemainingCapacity,
77
+ oa as readRefundPrePeginContext,
78
+ la as readStampedParticipantKeys,
79
+ ca as resolveCurrentParticipantKeys,
80
+ Ea as resolveParticipantKeysAtEpochs,
81
+ ga as runDepositorPresignFlow,
82
+ da as signDelegatedClaimPlan,
83
+ ua as signDepositorGraph,
84
+ Aa as submitWotsPublicKey,
85
+ Ra as summarizeWatchtowerArtifacts,
86
+ ma as validateDepositAmount,
87
+ pa as validateMultiVaultDepositInputs,
88
+ Pa as validateOnChainParticipantKeys,
89
+ _a as validateProviderSelection,
90
+ Ca as validateRemainingCapacity,
90
91
  e as validateSecretAgainstHashlock,
91
- Ca as validateVaultAmounts,
92
- Ma as validateVaultProviderPubkey,
93
- ha as verifyRegisteredParticipantKeys,
94
- Fa as verifyRegisteredVaultVersions,
92
+ Ma as validateVaultAmounts,
93
+ ha as validateVaultProviderPubkey,
94
+ Fa as verifyRegisteredParticipantKeys,
95
+ fa as verifyRegisteredVaultVersions,
95
96
  Sa as waitForPeginRegistrationDepth,
96
97
  Va as waitForPeginStatus
97
98
  };
@@ -1,11 +1,9 @@
1
1
  import { Hex } from 'viem';
2
- import { OperationKeyReader, UniversalChallengerReader, VaultData, VaultKeeperReader, VaultRegistryReader } from '../../clients/eth/types';
2
+ import { OperationKeyReader, UniversalChallengerReader, VaultBasicInfo, VaultKeeperReader, VaultProtocolInfo, VaultRegistryReader } from '../../clients/eth/types';
3
3
  import { ParticipantKeySet } from './types';
4
4
  /**
5
5
  * The reads this needs, as `Pick`s so a caller can pass the SDK's viem readers
6
6
  * or a narrower implementation.
7
- *
8
- * @experimental
9
7
  */
10
8
  export interface StampedParticipantKeyReaders {
11
9
  registryReader: Pick<VaultRegistryReader, "getVaultProviderGenesisBtcPubKey" | "getVaultKeyEpochs">;
@@ -13,17 +11,31 @@ export interface StampedParticipantKeyReaders {
13
11
  universalChallengerReader: Pick<UniversalChallengerReader, "getUniversalChallengersByVersion">;
14
12
  operationKeyReader: Pick<OperationKeyReader, "getOperationKeysAtEpochs">;
15
13
  }
16
- /** @experimental */
14
+ /** Input to {@link readStampedParticipantKeys}. */
17
15
  export interface ReadStampedParticipantKeysParams {
16
+ /** The vault whose frozen key epochs to resolve at. */
18
17
  vaultId: Hex;
19
- /** The vault's on-chain record, as `VaultRegistryReader.getVaultData` returns it. */
20
- vault: VaultData;
18
+ /**
19
+ * The vault's stamped provider, application and membership versions, read
20
+ * from the registry. A full `VaultData` from `VaultRegistryReader.getVaultData`
21
+ * satisfies it; a caller holding only these four fields can pass them alone.
22
+ */
23
+ vault: {
24
+ /** The vault's provider and application entry point. */
25
+ basic: Pick<VaultBasicInfo, "vaultProvider" | "applicationEntryPoint">;
26
+ /** The membership versions the vault's rosters are read at. */
27
+ protocol: Pick<VaultProtocolInfo, "appVaultKeepersVersion" | "universalChallengersVersion">;
28
+ };
29
+ /** The on-chain reads; the SDK's viem readers satisfy every one. */
21
30
  readers: StampedParticipantKeyReaders;
22
31
  }
23
32
  /**
33
+ * Read the operation keys an existing vault's scripts were built with: the
34
+ * rosters at its stamped membership versions, resolved at its frozen key
35
+ * epochs.
36
+ *
24
37
  * @throws When either stamped roster is empty, or key resolution fails
25
38
  * (`resolveParticipantKeysAtEpochs`).
26
- * @experimental
27
39
  */
28
40
  export declare function readStampedParticipantKeys(params: ReadStampedParticipantKeysParams): Promise<ParticipantKeySet>;
29
41
  //# sourceMappingURL=readStampedParticipantKeys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"readStampedParticipantKeys.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/participants/readStampedParticipantKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,WAAW,4BAA4B;IAC3C,cAAc,EAAE,IAAI,CAClB,mBAAmB,EACnB,kCAAkC,GAAG,mBAAmB,CACzD,CAAC;IACF,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,0BAA0B,CAAC,CAAC;IACvE,yBAAyB,EAAE,IAAI,CAC7B,yBAAyB,EACzB,kCAAkC,CACnC,CAAC;IACF,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAAE,0BAA0B,CAAC,CAAC;CAC1E;AAED,oBAAoB;AACpB,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,GAAG,CAAC;IACb,qFAAqF;IACrF,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,4BAA4B,CAAC;CACvC;AAED;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,gCAAgC,GACvC,OAAO,CAAC,iBAAiB,CAAC,CAiD5B"}
1
+ {"version":3,"file":"readStampedParticipantKeys.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/participants/readStampedParticipantKeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,cAAc,EAAE,IAAI,CAClB,mBAAmB,EACnB,kCAAkC,GAAG,mBAAmB,CACzD,CAAC;IACF,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,0BAA0B,CAAC,CAAC;IACvE,yBAAyB,EAAE,IAAI,CAC7B,yBAAyB,EACzB,kCAAkC,CACnC,CAAC;IACF,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAAE,0BAA0B,CAAC,CAAC;CAC1E;AAED,mDAAmD;AACnD,MAAM,WAAW,gCAAgC;IAC/C,uDAAuD;IACvD,OAAO,EAAE,GAAG,CAAC;IACb;;;;OAIG;IACH,KAAK,EAAE;QACL,wDAAwD;QACxD,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,GAAG,uBAAuB,CAAC,CAAC;QACvE,+DAA+D;QAC/D,QAAQ,EAAE,IAAI,CACZ,iBAAiB,EACjB,wBAAwB,GAAG,6BAA6B,CACzD,CAAC;KACH,CAAC;IACF,oEAAoE;IACpE,OAAO,EAAE,4BAA4B,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,gCAAgC,GACvC,OAAO,CAAC,iBAAiB,CAAC,CAiD5B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Tests for readRefundPrePeginContext — the refund context for an existing
3
+ * vault, read at the vault's frozen RFC-006 key epochs.
4
+ *
5
+ * Every participant in this fixture rotated its operation key before the
6
+ * vault registered, so the vault's frozen epochs point at the rotated keys
7
+ * while the rosters still list the registration keys. That is the case this
8
+ * module exists for: a refund built from the roster keys is refused, and one
9
+ * built from the frozen-epoch keys spends the funded HTLC.
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=readRefundPrePeginContext.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readRefundPrePeginContext.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/services/refund/__tests__/readRefundPrePeginContext.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -77,27 +77,53 @@ export interface VaultRefundData {
77
77
  batch: ReadonlyArray<VaultBatchEntry>;
78
78
  }
79
79
  /**
80
- * Version-resolved protocol context that parameterises the HTLC's taproot
81
- * scripts. The *signer-set* fields (`vaultKeeperPubkeys`,
82
- * `universalChallengerPubkeys`) and the version-locked numeric protocol
83
- * params **must** be sourced from the on-chain contract at the version
84
- * pinned in {@link VaultRefundData} — this is the trust boundary.
85
- * `vaultProviderPubkey` today is sourced from the GraphQL indexer via
86
- * `fetchVaultProviderById`; the caller is responsible for any additional
87
- * cross-check it requires. Keeper and challenger pubkey arrays must be
88
- * pre-sorted the same way the Rust protocol sorts them (canonical for
89
- * script derivation).
80
+ * The protocol context the refund rebuilds the vault's Pre-PegIn HTLC from.
81
+ * This is the trust boundary: every field must come from the chain, and
82
+ * {@link readRefundPrePeginContext} reads all of it.
83
+ *
84
+ * The three key fields must be the RFC-006 *operation* keys at the vault's
85
+ * frozen epochs (`vpKeyEpoch`, `appKeeperKeyEpoch`, `ucKeyEpoch`), and the
86
+ * numeric fields must be the offchain params at the vault's
87
+ * `offchainParamsVersion`. The rosters (`getVaultKeepersByVersion`,
88
+ * `getUniversalChallengersByVersion`) hold *registration* keys, which differ
89
+ * from the keys committed by any vault registered after a participant had
90
+ * rotated; a refund rebuilt from them for such a vault no longer matches the
91
+ * funded output and is refused. The indexer's vault-provider key is only a
92
+ * hint (the registration key, or the current operation key once the indexer
93
+ * tracks rotations) and is never the key to build with. Current operation
94
+ * keys are no substitute either: they fail for any vault registered before a
95
+ * participant's latest rotation. A vault's frozen epochs never move, so
96
+ * rotations after it registered do not change its HTLC.
90
97
  */
91
98
  export interface RefundPrePeginContext {
99
+ /** The vault provider's operation key at the vault's `vpKeyEpoch` (x-only hex). */
92
100
  vaultProviderPubkey: string;
101
+ /** The vault keepers' operation keys at the vault's `appKeeperKeyEpoch`, sorted (x-only hex). */
93
102
  vaultKeeperPubkeys: readonly string[];
103
+ /** The universal challengers' operation keys at the vault's `ucKeyEpoch`, sorted (x-only hex). */
94
104
  universalChallengerPubkeys: readonly string[];
105
+ /** The refund CSV timelock in blocks: `tRefund` at the vault's `offchainParamsVersion`. */
95
106
  timelockRefund: number;
107
+ /**
108
+ * The protocol fee rate (sat/vB) at the vault's `offchainParamsVersion`. It
109
+ * sized the HTLC value; the refund transaction's own fee is
110
+ * `RefundInput.feeRate`.
111
+ */
96
112
  feeRate: bigint;
113
+ /** The minimum peg-in fee rate (sat/vB) at the vault's `offchainParamsVersion`. */
97
114
  minPeginFeeRate: bigint;
115
+ /**
116
+ * The number of local challengers in the depositor's own claim graph, which
117
+ * this value sizes: the vault keeper count. (A vault provider's or a
118
+ * keeper's claim graph uses a different rule: the vault provider and the
119
+ * keepers, minus the claimer.)
120
+ */
98
121
  numLocalChallengers: number;
122
+ /** The security council quorum at the vault's `offchainParamsVersion`. */
99
123
  councilQuorum: number;
124
+ /** The security council size: the number of `securityCouncilKeys` at the vault's `offchainParamsVersion`. */
100
125
  councilSize: number;
126
+ /** The Bitcoin network the vault lives on. */
101
127
  network: Network;
102
128
  }
103
129
  /** Minimum shape required from a broadcast result. */
@@ -115,8 +141,11 @@ export interface RefundInput<R extends BtcBroadcastResult = BtcBroadcastResult>
115
141
  */
116
142
  readVault: () => Promise<VaultRefundData>;
117
143
  /**
118
- * Fetch the version-pinned refund context (sorted pubkeys, timelock, etc.)
119
- * derived from the vault's locked versions.
144
+ * Fetch the protocol context the refund rebuilds the HTLC from. Use
145
+ * {@link readRefundPrePeginContext}, closing over `vaultId`:
146
+ * `(vault) => readRefundPrePeginContext({ vaultId, vault, readers, network })`.
147
+ * A hand-written implementation must return the operation keys at the
148
+ * vault's frozen epochs; see {@link RefundPrePeginContext}.
120
149
  */
121
150
  readPrePeginContext: (vault: VaultRefundData) => Promise<RefundPrePeginContext>;
122
151
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"buildAndBroadcastRefund.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/refund/buildAndBroadcastRefund.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAErE,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AA+B3F,eAAO,MAAM,YAAY,MAAM,CAAC;AAgBhC,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAQhD,eAAO,MAAM,iCAAiC,MAAM,CAAC;AACrD,eAAO,MAAM,mCAAmC,OAAO,CAAC;AAExD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAOnE;AAqBD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,QAAQ,EAAE,GAAG,CAAC;IACd;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,2BAA2B,EAAE,MAAM,CAAC;IACpC,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAC9B,iFAAiF;IACjF,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,KAAK,EAAE,aAAa,C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;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,uBAAuB,CAC3C,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,EACjD,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAqLnC"}
1
+ {"version":3,"file":"buildAndBroadcastRefund.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/refund/buildAndBroadcastRefund.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAErE,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AA+B3F,eAAO,MAAM,YAAY,MAAM,CAAC;AAgBhC,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAQhD,eAAO,MAAM,iCAAiC,MAAM,CAAC;AACrD,eAAO,MAAM,mCAAmC,OAAO,CAAC;AAExD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAOnE;AAqBD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,QAAQ,EAAE,GAAG,CAAC;IACd;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,GAAG,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,2BAA2B,EAAE,MAAM,CAAC;IACpC,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,EAAE,OAAO,CAAC;IAC/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Ae,CAAC,CAAC;IAC1C;;;;;;OAMG;IACH,mBAAmB,EAAE,CACnB,KAAK,EAAE,eAAe,KACnB,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACpC;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,oEAAoE;IACpE,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAC/B,uCAAuC;IACvC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAmID;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,uBAAuB,CAC3C,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,EACjD,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAqLnC"}
@@ -5,4 +5,5 @@
5
5
  */
6
6
  export { BIP68NotMatureError } from './errors';
7
7
  export { buildAndBroadcastRefund, estimateRefundFeeSats, REFUND_MAX_FEE_FRACTION_DENOMINATOR, REFUND_MAX_FEE_FRACTION_NUMERATOR, REFUND_MAX_FEE_RATE_SATS_VB, REFUND_VSIZE, type BtcBroadcastResult, type BtcBroadcaster, type RefundInput, type RefundPrePeginContext, type RefundPsbtSigner, type VaultBatchEntry, type VaultRefundData, } from './buildAndBroadcastRefund';
8
+ export { readRefundPrePeginContext, type ReadRefundPrePeginContextParams, type RefundPrePeginContextReaders, } from './readRefundPrePeginContext';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/refund/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,mCAAmC,EACnC,iCAAiC,EACjC,2BAA2B,EAC3B,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/refund/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,mCAAmC,EACnC,iCAAiC,EACjC,2BAA2B,EAC3B,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,yBAAyB,EACzB,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,GAClC,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { Network } from '@babylonlabs-io/babylon-tbv-rust-wasm';
2
+ import { Hex } from 'viem';
3
+ import { ProtocolParamsReader } from '../../clients/eth/types';
4
+ import { StampedParticipantKeyReaders } from '../participants/readStampedParticipantKeys';
5
+ import { RefundPrePeginContext, VaultRefundData } from './buildAndBroadcastRefund';
6
+ /**
7
+ * The reads {@link readRefundPrePeginContext} needs: the stamped participant
8
+ * key reads plus the versioned offchain params.
9
+ */
10
+ export interface RefundPrePeginContextReaders extends StampedParticipantKeyReaders {
11
+ /** Reads the offchain params at the vault's `offchainParamsVersion`. */
12
+ protocolParamsReader: Pick<ProtocolParamsReader, "getOffchainParamsByVersion">;
13
+ }
14
+ /** Input to {@link readRefundPrePeginContext}. */
15
+ export interface ReadRefundPrePeginContextParams {
16
+ /** The vault being refunded: the same id passed to `buildAndBroadcastRefund`. */
17
+ vaultId: Hex;
18
+ /** The record `readVault` returned. Its stamped versions select the rosters and the params. */
19
+ vault: VaultRefundData;
20
+ /** The on-chain reads; the SDK's viem readers satisfy every one. */
21
+ readers: RefundPrePeginContextReaders;
22
+ /** The Bitcoin network the vault lives on, passed through to the context. */
23
+ network: Network;
24
+ }
25
+ /**
26
+ * Read the {@link RefundPrePeginContext} for an existing vault: participant
27
+ * operation keys at the vault's frozen epochs, and numeric params at its
28
+ * `offchainParamsVersion`.
29
+ *
30
+ * Pass it to `buildAndBroadcastRefund`, closing over the vault id:
31
+ *
32
+ * ```ts
33
+ * readPrePeginContext: (vault) =>
34
+ * readRefundPrePeginContext({ vaultId, vault, readers, network }),
35
+ * ```
36
+ *
37
+ * @throws When either stamped roster is empty, key resolution fails
38
+ * (`readStampedParticipantKeys`), or the offchain params read fails.
39
+ */
40
+ export declare function readRefundPrePeginContext(params: ReadRefundPrePeginContextParams): Promise<RefundPrePeginContext>;
41
+ //# sourceMappingURL=readRefundPrePeginContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readRefundPrePeginContext.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/refund/readRefundPrePeginContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EACV,qBAAqB,EACrB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAEnC;;;GAGG;AACH,MAAM,WAAW,4BACf,SAAQ,4BAA4B;IACpC,wEAAwE;IACxE,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAAE,4BAA4B,CAAC,CAAC;CAChF;AAED,kDAAkD;AAClD,MAAM,WAAW,+BAA+B;IAC9C,iFAAiF;IACjF,OAAO,EAAE,GAAG,CAAC;IACb,+FAA+F;IAC/F,KAAK,EAAE,eAAe,CAAC;IACvB,oEAAoE;IACpE,OAAO,EAAE,4BAA4B,CAAC;IACtC,6EAA6E;IAC7E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,+BAA+B,GACtC,OAAO,CAAC,qBAAqB,CAAC,CAuChC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../src/tbv/core/wasm/constants.ts","../../../../src/tbv/core/wasm/index.ts"],"sourcesContent":["/**\n * Protocol constants that do not require loading the vault WASM module.\n *\n * Keeping these values local lets Bitcoin builders construct PSBT metadata\n * without resolving or evaluating the WASM engine at module-import\n * time. The hex value is the BIP-341 nothing-up-my-sleeve internal key and is\n * pinned by the vault protocol.\n */\nexport const TAP_INTERNAL_KEY =\n \"50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0\";\n\nconst HEX_CHARS_PER_BYTE = 2;\n\nexport const tapInternalPubkey = Uint8Array.from(\n { length: TAP_INTERNAL_KEY.length / HEX_CHARS_PER_BYTE },\n (_, index) =>\n Number.parseInt(\n TAP_INTERNAL_KEY.slice(\n index * HEX_CHARS_PER_BYTE,\n index * HEX_CHARS_PER_BYTE + HEX_CHARS_PER_BYTE,\n ),\n 16,\n ),\n);\n","/**\n * Explicit lazy boundary around the vault-WASM engine package.\n *\n * Importing the SDK (including its legacy root barrels) does not resolve the\n * WASM package or generated binary. The engine is loaded only when a caller\n * invokes an operation that actually needs the Bitcoin transaction graph.\n * ETH-only entry points never import this module.\n *\n * @module tbv/core/wasm\n */\n\nimport type {\n AssertNoPayoutScriptInfo,\n AssertPayoutNoPayoutConnectorParams,\n AssertPayoutScriptInfo,\n ChallengeAssertConnectorParams,\n ChallengeAssertOutputConnectorParams,\n ChallengeAssertScriptInfo,\n HtlcConnectorInfo,\n HtlcConnectorParams,\n Network,\n PayoutConnectorInfo,\n PayoutConnectorParams,\n PeginP2aAnchorInfo,\n PeginTxResult,\n PrePeginParams,\n PrePeginResult,\n WatchtowerArtifactsInputs,\n WotsKeypairDerivation,\n WronglyChallengedPsbts,\n WronglyChallengedSigs,\n} from \"@babylonlabs-io/babylon-tbv-rust-wasm\";\n\nexport { TAP_INTERNAL_KEY, tapInternalPubkey } from \"./constants\";\n\ntype TbvWasmModule = typeof import(\"@babylonlabs-io/babylon-tbv-rust-wasm\");\n\nlet wasmModulePromise: Promise<TbvWasmModule> | undefined;\n\n/**\n * Load and initialize the WASM engine on first use. Concurrent callers share\n * one load. The returned module is already initialized, so a caller does not\n * call `initWasm()`. A load or initialization failure rejects with an error\n * that names the engine package. The original error is its cause. A failure\n * clears this cache, so the next call loads again. The engine keeps a failed\n * binary initialization rejected, so only a failed import or binary read can\n * succeed on a later call.\n *\n * The module also contains the wasm-bindgen classes. The classes have no value\n * guards. A caller that uses a class must cross-check its output at the call\n * site.\n */\nexport function loadTbvWasm(): Promise<TbvWasmModule> {\n wasmModulePromise ??= import(\"@babylonlabs-io/babylon-tbv-rust-wasm\")\n .catch((error: unknown) => {\n wasmModulePromise = undefined;\n throw new Error(\n \"The vault-WASM engine @babylonlabs-io/babylon-tbv-rust-wasm failed \" +\n \"to load. The module could not be resolved, or it threw while \" +\n \"evaluating, commonly a missing or stale generated WASM build. \" +\n \"See the cause for the underlying error.\",\n { cause: error },\n );\n })\n .then(async (wasm) => {\n try {\n await wasm.initWasm();\n } catch (error: unknown) {\n wasmModulePromise = undefined;\n throw new Error(\n \"The vault-WASM engine @babylonlabs-io/babylon-tbv-rust-wasm \" +\n \"resolved, but its WebAssembly binary failed to initialize, \" +\n \"commonly a missing or stale generated WASM build. See the \" +\n \"cause for the underlying error.\",\n { cause: error },\n );\n }\n return wasm;\n });\n return wasmModulePromise;\n}\n\n/**\n * Creates an unfunded Pre-PegIn transaction with no inputs and HTLC output(s).\n *\n * The HTLC output value (htlcValue) covers the peg-in amount, depositor claim value,\n * and minimum pegin fee — all computed internally from the provided contract parameters.\n *\n * After building the Pre-PegIn transaction, the caller must:\n * 1. Select UTXOs covering htlcValue + network fees\n * 2. Fund the transaction (add inputs and change output)\n * 3. Call reconstructFromFundedTx() with the funded tx hex\n * 4. Call buildPeginTx() to derive the PegIn transaction\n * 5. Sign the PegIn input using the HTLC hashlock leaf (leaf 0)\n *\n * @param params - Pre-PegIn parameters from contract and depositor wallet\n * @returns Unfunded transaction details with HTLC output information\n */\nexport async function createPrePeginTransaction(\n params: PrePeginParams,\n): Promise<PrePeginResult> {\n return (await loadTbvWasm()).createPrePeginTransaction(params);\n}\n\n/**\n * Derives the PegIn transaction from a funded Pre-PegIn transaction.\n *\n * The PegIn transaction has a single input spending the Pre-PegIn HTLC output\n * at `htlcVout` via the hashlock + all-party script (leaf 0).\n *\n * @param params - Same PrePeginParams used to create the Pre-PegIn transaction\n * @param timelockPegin - CSV timelock in blocks for the PegIn vault output\n * @param fundedPrePeginTxHex - Hex-encoded funded Pre-PegIn transaction\n * @param htlcVout - Index of the HTLC output to spend\n * @returns PegIn transaction details including vault output information\n */\nexport async function buildPeginTxFromPrePegin(\n params: PrePeginParams,\n timelockPegin: number,\n fundedPrePeginTxHex: string,\n htlcVout: number,\n): Promise<PeginTxResult> {\n return (await loadTbvWasm()).buildPeginTxFromPrePegin(\n params,\n timelockPegin,\n fundedPrePeginTxHex,\n htlcVout,\n );\n}\n\n/**\n * Returns HTLC connector script info for signing the PegIn transaction input.\n *\n * The depositor signs PegIn input 0 using the hashlock leaf (leaf 0) of the\n * Pre-PegIn HTLC output. Use getHashlockScript() and getHashlockControlBlock()\n * to construct the tapLeafScript entry in the PSBT.\n *\n * @param params - HTLC connector parameters (subset of PrePeginParams)\n * @returns Hashlock and refund script info for PSBT construction\n */\nexport async function getPrePeginHtlcConnectorInfo(\n params: HtlcConnectorParams,\n): Promise<HtlcConnectorInfo> {\n return (await loadTbvWasm()).getPrePeginHtlcConnectorInfo(params);\n}\n\n/**\n * Compute the minimum depositor claim value (PegIn output 1) in satoshis.\n *\n * This covers the full downstream tx graph cost (Claim → Assert → Payout)\n * based on the protocol parameters.\n */\nexport async function computeMinClaimValue(\n txGraphVersion: number,\n numLocalChallengers: number,\n numUniversalChallengers: number,\n councilQuorum: number,\n councilSize: number,\n feeRate: bigint,\n): Promise<bigint> {\n return (await loadTbvWasm()).computeMinClaimValue(\n txGraphVersion,\n numLocalChallengers,\n numUniversalChallengers,\n councilQuorum,\n councilSize,\n feeRate,\n );\n}\n\n/**\n * Compute the minimum PegIn (activation) transaction fee in satoshis.\n *\n * `minPeginFee = peginTxVsize(numVks, numUcs) × minPeginFeeRate`. Each HTLC\n * the depositor funds in the Pre-PegIn tx must reserve at least this fee\n * inside its value (`htlcValue = peginAmount + depositorClaimValue +\n * p2aAnchorValue + minPeginFee`, anchor 0 on vault core 1), otherwise the VP\n * cannot afford to broadcast the PegIn at\n * activation. The vsize comes from a Taproot script-path-spend weight\n * prediction whose witness shape depends on the VK + UC signer count.\n */\nexport async function computeMinPeginFee(\n txGraphVersion: number,\n numVks: number,\n numUcs: number,\n minPeginFeeRate: bigint,\n): Promise<bigint> {\n return (await loadTbvWasm()).computeMinPeginFee(\n txGraphVersion,\n numVks,\n numUcs,\n minPeginFeeRate,\n );\n}\n\n/**\n * Floor of the Payout transaction fee under `txGraphVersion`: the minimum of\n * `estimatedVsize * feeRate` across every output-sizing model a deployed\n * vault provider is known to have used (fixed-34, intermediate,\n * script-aware). A VP-built payout paying less than this is provably not\n * produced by any known VP build. `out0Len` must be the TRUSTED length of the\n * pinned outs[0] script (1..=128); `out1Len` is the measured, UNTRUSTED\n * commission-script length — safe here because padding cannot raise the floor\n * (the fixed-34 model saturates the minimum) and shortening only lowers it.\n * Pass `undefined` for `out1Len` on 2-output (non-VP-claimer) payouts.\n * `feeRate` is the vault's version-locked `offchainParams.feeRate`.\n */\nexport async function computePayoutFeeFloor(\n txGraphVersion: number,\n numVaultKeepers: number,\n numUniversalChallengers: number,\n numLocalChallengers: number,\n councilSize: number,\n out0Len: number,\n out1Len: number | null | undefined,\n feeRate: bigint,\n): Promise<bigint> {\n return (await loadTbvWasm()).computePayoutFeeFloor(\n txGraphVersion,\n numVaultKeepers,\n numUniversalChallengers,\n numLocalChallengers,\n councilSize,\n out0Len,\n out1Len,\n feeRate,\n );\n}\n\n/**\n * Tx graph versions the shipped vault-wasm binary can build. Callers must\n * preflight the required version (fresh: active; resume: stamped) against\n * this list and fail closed instead of hitting per-call errors mid-flow.\n *\n * Note: the facade constructors themselves fail closed on unsupported\n * versions, and derived objects carry the version they were built with —\n * value-level cross-checks live in `assertWasmPeginSizing` and the golden\n * byte-parity tests, not in a per-call version echo.\n */\nexport async function supportedTxGraphVersions(): Promise<number[]> {\n return (await loadTbvWasm()).supportedTxGraphVersions();\n}\n\n/**\n * The PegIn transaction's P2A (pay-to-anchor) output for a graph version, or\n * `null` when that version's PegIn carries no anchor (v1). The facade returns\n * one record per version — never a zero-valued placeholder — so an absent\n * anchor can't be mistaken for a real output. For v2/v3: 240 sats at vout 2,\n * script `51024e73`.\n */\nexport async function peginP2aAnchorOutput(\n txGraphVersion: number,\n): Promise<PeginP2aAnchorInfo | null> {\n return (await loadTbvWasm()).peginP2aAnchorOutput(txGraphVersion);\n}\n\n/**\n * Validate a PegIn transaction's P2A anchor against a graph version's rules:\n * v2 and v3 require the exact anchor (240 sats, vout 2, P2A script) and v1\n * requires that NO output carries the P2A script. Throws on any mismatch — a\n * v2 PegIn checked as v1 fails closed, and vice versa.\n */\nexport async function validatePeginP2aAnchor(\n txGraphVersion: number,\n txHex: string,\n): Promise<void> {\n return (await loadTbvWasm()).validatePeginP2aAnchor(txGraphVersion, txHex);\n}\n\n/**\n * Creates a payout connector for vault transactions.\n *\n * The payout connector generates the necessary taproot scripts and information\n * required for signing payout transactions (both optimistic and regular payout paths).\n *\n * @param params - Parameters for creating the payout connector\n * @param network - Bitcoin network\n * @returns Payout connector information including scripts, hashes, and address\n */\nexport async function createPayoutConnector(\n params: PayoutConnectorParams,\n network: Network,\n): Promise<PayoutConnectorInfo> {\n return (await loadTbvWasm()).createPayoutConnector(params, network);\n}\n\n/**\n * Get the Payout script and control block for the depositor's Assert output.\n *\n * Used to build the depositor's Payout PSBT (depositor-as-claimer path).\n *\n * @param params - Assert Payout/NoPayout connector parameters\n * @returns Payout script and control block (hex encoded)\n */\nexport async function getAssertPayoutScriptInfo(\n params: AssertPayoutNoPayoutConnectorParams,\n): Promise<AssertPayoutScriptInfo> {\n return (await loadTbvWasm()).getAssertPayoutScriptInfo(params);\n}\n\n/**\n * Get the NoPayout script and control block for a specific challenger.\n *\n * Used to build the depositor's NoPayout PSBT (depositor-as-claimer path).\n * Each challenger has a distinct NoPayout script.\n *\n * @param params - Assert Payout/NoPayout connector parameters\n * @param challengerPubkey - The challenger's x-only public key (hex encoded)\n * @returns NoPayout script and control block (hex encoded)\n */\nexport async function getAssertNoPayoutScriptInfo(\n params: AssertPayoutNoPayoutConnectorParams,\n challengerPubkey: string,\n): Promise<AssertNoPayoutScriptInfo> {\n return (await loadTbvWasm()).getAssertNoPayoutScriptInfo(\n params,\n challengerPubkey,\n );\n}\n\n/**\n * Get the ChallengeAssert script and control block.\n *\n * Used to build ChallengeAssert PSBTs for the depositor-as-claimer path.\n * Each challenger has 2 ChallengeAssert transactions (X and Y), and this\n * connector generates the spending scripts using WOTS public keys from the VP.\n *\n * @param params - ChallengeAssert connector parameters\n * @returns Script and control block (hex encoded)\n */\nexport async function getChallengeAssertScriptInfo(\n params: ChallengeAssertConnectorParams,\n): Promise<ChallengeAssertScriptInfo> {\n return (await loadTbvWasm()).getChallengeAssertScriptInfo(params);\n}\n\n/**\n * Get the scriptPubKey that output 0 of every ChallengeAssertX/Y transaction\n * pays to for one challenger: the WronglyChallenged leaves plus the NoPayout\n * leaf carrying the ChallengeAssert timelock.\n *\n * Used to bind the VP-supplied ChallengeAssert parents of a NoPayout before\n * the depositor signs it. The engine rejects a non-P2TR return.\n *\n * @param params - ChallengeAssert output connector parameters\n * @returns P2TR scriptPubKey (hex encoded)\n */\nexport async function getChallengeAssertOutputScriptPubKey(\n params: ChallengeAssertOutputConnectorParams,\n): Promise<string> {\n return (await loadTbvWasm()).getChallengeAssertOutputScriptPubKey(params);\n}\n\n/**\n * Derive 32-byte `authAnchor` (OP_RETURN preimage → VP bearer token).\n * @stability frozen - btc-vault Rust owns this API through the vault-wasm pin (`VAULT_WASM_COMMIT`).\n * Changing the derived bytes breaks VP auth for existing deposits. See CLAUDE.md §4.\n */\nexport async function expandAuthAnchor(root: Uint8Array): Promise<Uint8Array> {\n return (await loadTbvWasm()).expandAuthAnchor(root);\n}\n\n/**\n * Derive 32-byte `hashlockSecret` for HTLC `htlcVout` (preimage → `activateVaultWithSecret`).\n * @stability frozen - btc-vault Rust owns this API.\n * Changing the derived bytes means affected vaults can never activate. See CLAUDE.md §4.\n */\nexport async function expandHashlockSecret(\n root: Uint8Array,\n htlcVout: number,\n): Promise<Uint8Array> {\n return (await loadTbvWasm()).expandHashlockSecret(root, htlcVout);\n}\n\n/**\n * Derive 64-byte `wotsSeed` for HTLC `htlcVout` (→ WOTS keys, hashed as `depositorWotsPkHash`).\n * @stability frozen - btc-vault Rust owns this API.\n * Changing the derived bytes breaks existing `depositorWotsPkHash` values. No claim path remains. See CLAUDE.md §4.\n */\nexport async function expandWotsSeed(\n root: Uint8Array,\n htlcVout: number,\n): Promise<Uint8Array> {\n return (await loadTbvWasm()).expandWotsSeed(root, htlcVout);\n}\n\n/**\n * Derives the vault ID from a PegIn transaction hash and depositor ETH address.\n *\n * Vault ID = keccak256(abi.encode(peginTxHash, depositor))\n * This matches the Solidity-side derivation in BTCVaultRegistry.\n *\n * @param peginTxHash - 32-byte PegIn tx hash in display order (big-endian), hex encoded\n * @param depositor - 20-byte Ethereum address of the depositor, hex encoded\n * @returns Hex-encoded vault ID (32 bytes)\n */\nexport async function deriveVaultId(\n peginTxHash: string,\n depositor: string,\n): Promise<string> {\n return (await loadTbvWasm()).deriveVaultId(peginTxHash, depositor);\n}\n\n// ============================================================================\n// Delegated claim (depositor-as-claimer) — assembly and claim-time surface\n// ============================================================================\n//\n// The forwarding hop for the WASM exports that assemble the two files the\n// `vaultd vp wt` watchtower CLI consumes, and for the claim-time exports\n// that run a claim from those files without the CLI.\n//\n// EXPERIMENTAL — under test, signet only. These names and signatures can\n// change in a minor release. See services/delegated-claim.\n\n/**\n * Depositor's Claim signing PSBT (base64) — spends PegIn:1, script path.\n *\n * @experimental\n */\nexport async function buildClaimPsbt(\n txGraphVersion: number,\n graphJson: string,\n): Promise<string> {\n return (await loadTbvWasm()).buildClaimPsbt(txGraphVersion, graphJson);\n}\n\n/**\n * Claimer's Assert signing PSBT (base64) — the single WOTS input.\n *\n * @experimental\n */\nexport async function buildAssertClaimerPsbt(\n txGraphVersion: number,\n graphJson: string,\n): Promise<string> {\n return (await loadTbvWasm()).buildAssertClaimerPsbt(\n txGraphVersion,\n graphJson,\n );\n}\n\n/**\n * Claimer's Payout signing PSBT (base64) — input 1, Assert connector path.\n *\n * @experimental\n */\nexport async function buildPayoutClaimerPsbt(\n txGraphVersion: number,\n graphJson: string,\n): Promise<string> {\n return (await loadTbvWasm()).buildPayoutClaimerPsbt(\n txGraphVersion,\n graphJson,\n );\n}\n\n/**\n * Depositor's Payout signing PSBT (base64) — input 0, the PegIn UTXO spend.\n *\n * @experimental\n */\nexport async function buildPayoutDepositorPsbt(\n txGraphVersion: number,\n graphJson: string,\n): Promise<string> {\n return (await loadTbvWasm()).buildPayoutDepositorPsbt(\n txGraphVersion,\n graphJson,\n );\n}\n\n/**\n * Claimer's WronglyChallenged signing PSBTs, per challenger and GC index.\n *\n * @experimental\n */\nexport async function buildWronglyChallengedPsbts(\n txGraphVersion: number,\n graphJson: string,\n): Promise<WronglyChallengedPsbts> {\n return (await loadTbvWasm()).buildWronglyChallengedPsbts(\n txGraphVersion,\n graphJson,\n );\n}\n\n/**\n * Verifies the Groth16 pegout proof and pins it into the artifacts, returning\n * the updated artifacts JSON. Persist that copy: the one-time WOTS keypair\n * signs exactly one proof, so a second, different one is refused.\n *\n * @experimental\n */\nexport async function pinPegoutProof(\n txGraphVersion: number,\n artifactsJson: string,\n proofHex: string,\n): Promise<string> {\n return (await loadTbvWasm()).pinPegoutProof(\n txGraphVersion,\n artifactsJson,\n proofHex,\n );\n}\n\n/**\n * Finalizes the Assert from the pinned proof and the WOTS keypair, writes it\n * into the artifacts and returns the updated artifacts JSON. The keypair\n * never leaves the caller.\n *\n * @experimental\n */\nexport async function attachFinalizedAssert(\n txGraphVersion: number,\n artifactsJson: string,\n keypairJson: string,\n): Promise<string> {\n return (await loadTbvWasm()).attachFinalizedAssert(\n txGraphVersion,\n artifactsJson,\n keypairJson,\n );\n}\n\n/**\n * Finalizes the Payout tx from the artifacts' signatures, consensus hex.\n *\n * @experimental\n */\nexport async function finalizePayout(\n txGraphVersion: number,\n artifactsJson: string,\n): Promise<string> {\n return (await loadTbvWasm()).finalizePayout(txGraphVersion, artifactsJson);\n}\n\n/**\n * Finalizes one WronglyChallenged tx — the answer to a ChallengeAssert.\n *\n * @experimental\n */\nexport async function finalizeWronglyChallenged(\n txGraphVersion: number,\n artifactsJson: string,\n challengerPkHex: string,\n gcIndex: number,\n preimageHex: string,\n): Promise<string> {\n return (await loadTbvWasm()).finalizeWronglyChallenged(\n txGraphVersion,\n artifactsJson,\n challengerPkHex,\n gcIndex,\n preimageHex,\n );\n}\n\n/**\n * Applies the depositor signature to the Claim tx, returning consensus hex.\n *\n * @experimental\n */\nexport async function finalizeClaimTx(\n txGraphVersion: number,\n graphJson: string,\n depositorSigHex: string,\n): Promise<string> {\n return (await loadTbvWasm()).finalizeClaimTx(\n txGraphVersion,\n graphJson,\n depositorSigHex,\n );\n}\n\n/**\n * Extracts a signed PSBT input's taproot script-path signature (hex).\n *\n * @experimental\n */\nexport async function extractTapScriptSig(\n psbtBase64: string,\n inputIndex: number,\n): Promise<string> {\n return (await loadTbvWasm()).extractTapScriptSig(psbtBase64, inputIndex);\n}\n\n/**\n * Derive the depositor's WOTS keypair from the 64-byte `wotsSeed`.\n * @stability frozen — `HASH160(seed || block index)` binds on-chain through\n * `depositorWotsPkHash`; see CLAUDE.md §4.\n *\n * @experimental\n */\nexport async function wotsKeypairFromSeed(\n wotsSeed: Uint8Array,\n): Promise<WotsKeypairDerivation> {\n return (await loadTbvWasm()).wotsKeypairFromSeed(wotsSeed);\n}\n\n/**\n * Throws unless the keypair matches the WOTS keys the graph's Claim commits to.\n *\n * @experimental\n */\nexport async function validateWotsKeypairAgainstGraph(\n txGraphVersion: number,\n keypair: unknown,\n graphJson: string,\n): Promise<void> {\n return (await loadTbvWasm()).validateWotsKeypairAgainstGraph(\n txGraphVersion,\n keypair,\n graphJson,\n );\n}\n\n/**\n * Assembles the watchtower `artifacts.json` content, verifying every signature.\n *\n * @experimental\n */\nexport async function buildWatchtowerArtifacts(\n inputs: WatchtowerArtifactsInputs,\n): Promise<string> {\n return (await loadTbvWasm()).buildWatchtowerArtifacts(inputs);\n}\n\n/**\n * Re-verifies every claimer-side signature in an `artifacts.json`.\n *\n * @experimental\n */\nexport async function verifyWatchtowerArtifacts(\n txGraphVersion: number,\n artifactsJson: string,\n): Promise<void> {\n return (await loadTbvWasm()).verifyWatchtowerArtifacts(\n txGraphVersion,\n artifactsJson,\n );\n}\n\nexport type {\n AssertNoPayoutScriptInfo,\n AssertPayoutNoPayoutConnectorParams,\n AssertPayoutScriptInfo,\n ChallengeAssertConnectorParams,\n ChallengeAssertOutputConnectorParams,\n ChallengeAssertScriptInfo,\n HtlcConnectorInfo,\n HtlcConnectorParams,\n Network,\n PayoutConnectorInfo,\n PayoutConnectorParams,\n PeginP2aAnchorInfo,\n PeginTxResult,\n PrePeginParams,\n PrePeginResult,\n WatchtowerArtifactsInputs,\n WotsKeypairDerivation,\n WronglyChallengedPsbts,\n WronglyChallengedSigs,\n};\n"],"names":["TAP_INTERNAL_KEY","HEX_CHARS_PER_BYTE","tapInternalPubkey","_","index","wasmModulePromise","loadTbvWasm","error","wasm","createPrePeginTransaction","params","buildPeginTxFromPrePegin","timelockPegin","fundedPrePeginTxHex","htlcVout","getPrePeginHtlcConnectorInfo","computeMinClaimValue","txGraphVersion","numLocalChallengers","numUniversalChallengers","councilQuorum","councilSize","feeRate","computeMinPeginFee","numVks","numUcs","minPeginFeeRate","computePayoutFeeFloor","numVaultKeepers","out0Len","out1Len","supportedTxGraphVersions","peginP2aAnchorOutput","validatePeginP2aAnchor","txHex","createPayoutConnector","network","getAssertPayoutScriptInfo","getAssertNoPayoutScriptInfo","challengerPubkey","getChallengeAssertScriptInfo","getChallengeAssertOutputScriptPubKey","expandAuthAnchor","root","expandHashlockSecret","expandWotsSeed","deriveVaultId","peginTxHash","depositor","buildClaimPsbt","graphJson","buildAssertClaimerPsbt","buildPayoutClaimerPsbt","buildPayoutDepositorPsbt","buildWronglyChallengedPsbts","pinPegoutProof","artifactsJson","proofHex","attachFinalizedAssert","keypairJson","finalizePayout","finalizeWronglyChallenged","challengerPkHex","gcIndex","preimageHex","finalizeClaimTx","depositorSigHex","extractTapScriptSig","psbtBase64","inputIndex","wotsKeypairFromSeed","wotsSeed","validateWotsKeypairAgainstGraph","keypair","buildWatchtowerArtifacts","inputs","verifyWatchtowerArtifacts"],"mappings":"2hBAQO,MAAMA,EACX,mEAEIC,EAAqB,EAEdC,EAAoB,WAAW,KAC1C,CAAE,OAAQF,EAAiB,OAASC,CAAA,EACpC,CAACE,EAAGC,IACF,OAAO,SACLJ,EAAiB,MACfI,EAAQH,EACRG,EAAQH,EAAqBA,CAAA,EAE/B,EAAA,CAEN,ECcA,IAAII,EAeG,SAASC,GAAsC,CACpD,OAAAD,MAAsB,OAAO,uCAAuC,EACjE,MAAOE,GAAmB,CACzB,MAAAF,EAAoB,OACd,IAAI,MACR,wOAIA,CAAE,MAAOE,CAAA,CAAM,CAEnB,CAAC,EACA,KAAK,MAAOC,GAAS,CACpB,GAAI,CACF,MAAMA,EAAK,S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ASA,eAAsBC,EACpBzC,EACAuC,EACAG,EACiB,CACjB,OAAQ,MAAMrD,KAAe,sBAC3BW,EACAuC,EACAG,CAAA,CAEJ,CAOA,eAAsBC,EACpB3C,EACAuC,EACiB,CACjB,OAAQ,MAAMlD,EAAA,GAAe,eAAeW,EAAgBuC,CAAa,CAC3E,CAOA,eAAsBK,EACpB5C,EACAuC,EACAM,EACAC,EACAC,EACiB,CACjB,OAAQ,MAAM1D,KAAe,0BAC3BW,EACAuC,EACAM,EACAC,EACAC,CAAA,CAEJ,CAOA,eAAsBC,EACpBhD,EACAiC,EACAgB,EACiB,CACjB,OAAQ,MAAM5D,KAAe,gBAC3BW,EACAiC,EACAgB,CAAA,CAEJ,CAOA,eAAsBC,EACpBC,EACAC,EACiB,CACjB,OAAQ,MAAM/D,EAAA,GAAe,oBAAoB8D,EAAYC,CAAU,CACzE,CASA,eAAsBC,EACpBC,EACgC,CAChC,OAAQ,MAAMjE,KAAe,oBAAoBiE,CAAQ,CAC3D,CAOA,eAAsBC,EACpBvD,EACAwD,EACAvB,EACe,CACf,OAAQ,MAAM5C,KAAe,gCAC3BW,EACAwD,EACAvB,CAAA,CAEJ,CAOA,eAAsBwB,EACpBC,EACiB,CACjB,OAAQ,MAAMrE,KAAe,yBAAyBqE,CAAM,CAC9D,CAOA,eAAsBC,EACpB3D,EACAuC,EACe,CACf,OAAQ,MAAMlD,KAAe,0BAC3BW,EACAuC,CAAA,CAEJ"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../src/tbv/core/wasm/constants.ts","../../../../src/tbv/core/wasm/index.ts"],"sourcesContent":["/**\n * Protocol constants that do not require loading the vault WASM module.\n *\n * Keeping these values local lets Bitcoin builders construct PSBT metadata\n * without resolving or evaluating the WASM engine at module-import\n * time. The hex value is the BIP-341 nothing-up-my-sleeve internal key and is\n * pinned by the vault protocol.\n */\nexport const TAP_INTERNAL_KEY =\n \"50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0\";\n\nconst HEX_CHARS_PER_BYTE = 2;\n\nexport const tapInternalPubkey = Uint8Array.from(\n { length: TAP_INTERNAL_KEY.length / HEX_CHARS_PER_BYTE },\n (_, index) =>\n Number.parseInt(\n TAP_INTERNAL_KEY.slice(\n index * HEX_CHARS_PER_BYTE,\n index * HEX_CHARS_PER_BYTE + HEX_CHARS_PER_BYTE,\n ),\n 16,\n ),\n);\n","/**\n * Explicit lazy boundary around the vault-WASM engine package.\n *\n * Importing the SDK (including its legacy root barrels) does not resolve the\n * WASM package or generated binary. The engine is loaded only when a caller\n * invokes an operation that actually needs the Bitcoin transaction graph.\n * ETH-only entry points never import this module.\n *\n * @module tbv/core/wasm\n */\n\nimport type {\n AssertNoPayoutScriptInfo,\n AssertPayoutNoPayoutConnectorParams,\n AssertPayoutScriptInfo,\n ChallengeAssertConnectorParams,\n ChallengeAssertOutputConnectorParams,\n ChallengeAssertScriptInfo,\n HtlcConnectorInfo,\n HtlcConnectorParams,\n Network,\n PayoutConnectorInfo,\n PayoutConnectorParams,\n PeginP2aAnchorInfo,\n PeginTxResult,\n PrePeginParams,\n PrePeginResult,\n WatchtowerArtifactsInputs,\n WotsKeypairDerivation,\n WronglyChallengedPsbts,\n WronglyChallengedSigs,\n} from \"@babylonlabs-io/babylon-tbv-rust-wasm\";\n\nexport { TAP_INTERNAL_KEY, tapInternalPubkey } from \"./constants\";\n\ntype TbvWasmModule = typeof import(\"@babylonlabs-io/babylon-tbv-rust-wasm\");\n\nlet wasmModulePromise: Promise<TbvWasmModule> | undefined;\n\n/**\n * Load and initialize the WASM engine on first use. Concurrent callers share\n * one load. The returned module is already initialized, so a caller does not\n * call `initWasm()`. A load or initialization failure rejects with an error\n * that names the engine package. The original error is its cause. A failure\n * clears this cache, so the next call loads again. The engine keeps a failed\n * binary initialization rejected, so only a failed import or binary read can\n * succeed on a later call.\n *\n * The module also contains the wasm-bindgen classes. The classes have no value\n * guards. A caller that uses a class must cross-check its output at the call\n * site.\n */\nexport function loadTbvWasm(): Promise<TbvWasmModule> {\n wasmModulePromise ??= import(\"@babylonlabs-io/babylon-tbv-rust-wasm\")\n .catch((error: unknown) => {\n wasmModulePromise = undefined;\n throw new Error(\n \"The vault-WASM engine @babylonlabs-io/babylon-tbv-rust-wasm failed \" +\n \"to load. The module could not be resolved, or it threw while \" +\n \"evaluating, commonly a missing or stale generated WASM build. \" +\n \"See the cause for the underlying error.\",\n { cause: error },\n );\n })\n .then(async (wasm) => {\n try {\n await wasm.initWasm();\n } catch (error: unknown) {\n wasmModulePromise = undefined;\n throw new Error(\n \"The vault-WASM engine @babylonlabs-io/babylon-tbv-rust-wasm \" +\n \"resolved, but its WebAssembly binary failed to initialize, \" +\n \"commonly a missing or stale generated WASM build. See the \" +\n \"cause for the underlying error.\",\n { cause: error },\n );\n }\n return wasm;\n });\n return wasmModulePromise;\n}\n\n/**\n * Creates an unfunded Pre-PegIn transaction with no inputs and HTLC output(s).\n *\n * The HTLC output value (htlcValue) covers the peg-in amount, depositor claim value,\n * and minimum pegin fee — all computed internally from the provided contract parameters.\n *\n * After building the Pre-PegIn transaction, the caller must:\n * 1. Select UTXOs covering htlcValue + network fees\n * 2. Fund the transaction (add inputs and change output)\n * 3. Call reconstructFromFundedTx() with the funded tx hex\n * 4. Call buildPeginTx() to derive the PegIn transaction\n * 5. Sign the PegIn input using the HTLC hashlock leaf (leaf 0)\n *\n * @param params - Pre-PegIn parameters from contract and depositor wallet\n * @returns Unfunded transaction details with HTLC output information\n */\nexport async function createPrePeginTransaction(\n params: PrePeginParams,\n): Promise<PrePeginResult> {\n return (await loadTbvWasm()).createPrePeginTransaction(params);\n}\n\n/**\n * Derives the PegIn transaction from a funded Pre-PegIn transaction.\n *\n * The PegIn transaction has a single input spending the Pre-PegIn HTLC output\n * at `htlcVout` via the hashlock + all-party script (leaf 0).\n *\n * @param params - Same PrePeginParams used to create the Pre-PegIn transaction\n * @param timelockPegin - CSV timelock in blocks for the PegIn vault output\n * @param fundedPrePeginTxHex - Hex-encoded funded Pre-PegIn transaction\n * @param htlcVout - Index of the HTLC output to spend\n * @returns PegIn transaction details including vault output information\n */\nexport async function buildPeginTxFromPrePegin(\n params: PrePeginParams,\n timelockPegin: number,\n fundedPrePeginTxHex: string,\n htlcVout: number,\n): Promise<PeginTxResult> {\n return (await loadTbvWasm()).buildPeginTxFromPrePegin(\n params,\n timelockPegin,\n fundedPrePeginTxHex,\n htlcVout,\n );\n}\n\n/**\n * Returns HTLC connector script info for signing the PegIn transaction input.\n *\n * The depositor signs PegIn input 0 using the hashlock leaf (leaf 0) of the\n * Pre-PegIn HTLC output. Use getHashlockScript() and getHashlockControlBlock()\n * to construct the tapLeafScript entry in the PSBT.\n *\n * @param params - HTLC connector parameters (subset of PrePeginParams)\n * @returns Hashlock and refund script info for PSBT construction\n */\nexport async function getPrePeginHtlcConnectorInfo(\n params: HtlcConnectorParams,\n): Promise<HtlcConnectorInfo> {\n return (await loadTbvWasm()).getPrePeginHtlcConnectorInfo(params);\n}\n\n/**\n * Compute the minimum depositor claim value (PegIn output 1) in satoshis.\n *\n * This covers the full downstream tx graph cost (Claim → Assert → Payout)\n * based on the protocol parameters.\n */\nexport async function computeMinClaimValue(\n txGraphVersion: number,\n numLocalChallengers: number,\n numUniversalChallengers: number,\n councilQuorum: number,\n councilSize: number,\n feeRate: bigint,\n): Promise<bigint> {\n return (await loadTbvWasm()).computeMinClaimValue(\n txGraphVersion,\n numLocalChallengers,\n numUniversalChallengers,\n councilQuorum,\n councilSize,\n feeRate,\n );\n}\n\n/**\n * Compute the minimum PegIn (activation) transaction fee in satoshis.\n *\n * `minPeginFee = peginTxVsize(numVks, numUcs) × minPeginFeeRate`. Each HTLC\n * the depositor funds in the Pre-PegIn tx must reserve at least this fee\n * inside its value (`htlcValue = peginAmount + depositorClaimValue +\n * p2aAnchorValue + minPeginFee`), otherwise the VP\n * cannot afford to broadcast the PegIn at\n * activation. The vsize comes from a Taproot script-path-spend weight\n * prediction whose witness shape depends on the VK + UC signer count.\n */\nexport async function computeMinPeginFee(\n txGraphVersion: number,\n numVks: number,\n numUcs: number,\n minPeginFeeRate: bigint,\n): Promise<bigint> {\n return (await loadTbvWasm()).computeMinPeginFee(\n txGraphVersion,\n numVks,\n numUcs,\n minPeginFeeRate,\n );\n}\n\n/**\n * Floor of the Payout transaction fee under `txGraphVersion`: the minimum of\n * `estimatedVsize * feeRate` across every output-sizing model a deployed\n * vault provider is known to have used (fixed-34, intermediate,\n * script-aware). A VP-built payout paying less than this is provably not\n * produced by any known VP build. `out0Len` must be the TRUSTED length of the\n * pinned outs[0] script (1..=128); `out1Len` is the measured, UNTRUSTED\n * commission-script length — safe here because padding cannot raise the floor\n * (the fixed-34 model saturates the minimum) and shortening only lowers it.\n * Pass `undefined` for `out1Len` on 2-output (non-VP-claimer) payouts.\n * `feeRate` is the vault's version-locked `offchainParams.feeRate`.\n */\nexport async function computePayoutFeeFloor(\n txGraphVersion: number,\n numVaultKeepers: number,\n numUniversalChallengers: number,\n numLocalChallengers: number,\n councilSize: number,\n out0Len: number,\n out1Len: number | null | undefined,\n feeRate: bigint,\n): Promise<bigint> {\n return (await loadTbvWasm()).computePayoutFeeFloor(\n txGraphVersion,\n numVaultKeepers,\n numUniversalChallengers,\n numLocalChallengers,\n councilSize,\n out0Len,\n out1Len,\n feeRate,\n );\n}\n\n/**\n * Tx graph versions the shipped vault-wasm binary can build. Callers must\n * preflight the required version (fresh: active; resume: stamped) against\n * this list and fail closed instead of hitting per-call errors mid-flow.\n *\n * Note: the facade constructors themselves fail closed on unsupported\n * versions, and derived objects carry the version they were built with —\n * value-level cross-checks live in `assertWasmPeginSizing` and the golden\n * byte-parity tests, not in a per-call version echo.\n */\nexport async function supportedTxGraphVersions(): Promise<number[]> {\n return (await loadTbvWasm()).supportedTxGraphVersions();\n}\n\n/**\n * The PegIn transaction's P2A (pay-to-anchor) output for a graph version: 240\n * sats at vout 2, script `51024e73`. Every supported version's PegIn carries\n * the anchor; the engine throws rather than return none.\n */\nexport async function peginP2aAnchorOutput(\n txGraphVersion: number,\n): Promise<PeginP2aAnchorInfo> {\n return (await loadTbvWasm()).peginP2aAnchorOutput(txGraphVersion);\n}\n\n/**\n * Validate a PegIn transaction's P2A anchor against a graph version's rule:\n * the exact anchor (240 sats, vout 2, P2A script). Throws on any mismatch, so\n * a PegIn without the anchor fails closed.\n */\nexport async function validatePeginP2aAnchor(\n txGraphVersion: number,\n txHex: string,\n): Promise<void> {\n return (await loadTbvWasm()).validatePeginP2aAnchor(txGraphVersion, txHex);\n}\n\n/**\n * Creates a payout connector for vault transactions.\n *\n * The payout connector generates the necessary taproot scripts and information\n * required for signing payout transactions (both optimistic and regular payout paths).\n *\n * @param params - Parameters for creating the payout connector\n * @param network - Bitcoin network\n * @returns Payout connector information including scripts, hashes, and address\n */\nexport async function createPayoutConnector(\n params: PayoutConnectorParams,\n network: Network,\n): Promise<PayoutConnectorInfo> {\n return (await loadTbvWasm()).createPayoutConnector(params, network);\n}\n\n/**\n * Get the Payout script and control block for the depositor's Assert output.\n *\n * Used to build the depositor's Payout PSBT (depositor-as-claimer path).\n *\n * @param params - Assert Payout/NoPayout connector parameters\n * @returns Payout script and control block (hex encoded)\n */\nexport async function getAssertPayoutScriptInfo(\n params: AssertPayoutNoPayoutConnectorParams,\n): Promise<AssertPayoutScriptInfo> {\n return (await loadTbvWasm()).getAssertPayoutScriptInfo(params);\n}\n\n/**\n * Get the NoPayout script and control block for a specific challenger.\n *\n * Used to build the depositor's NoPayout PSBT (depositor-as-claimer path).\n * Each challenger has a distinct NoPayout script.\n *\n * @param params - Assert Payout/NoPayout connector parameters\n * @param challengerPubkey - The challenger's x-only public key (hex encoded)\n * @returns NoPayout script and control block (hex encoded)\n */\nexport async function getAssertNoPayoutScriptInfo(\n params: AssertPayoutNoPayoutConnectorParams,\n challengerPubkey: string,\n): Promise<AssertNoPayoutScriptInfo> {\n return (await loadTbvWasm()).getAssertNoPayoutScriptInfo(\n params,\n challengerPubkey,\n );\n}\n\n/**\n * Get the ChallengeAssert script and control block.\n *\n * Used to build ChallengeAssert PSBTs for the depositor-as-claimer path.\n * Each challenger has 2 ChallengeAssert transactions (X and Y), and this\n * connector generates the spending scripts using WOTS public keys from the VP.\n *\n * @param params - ChallengeAssert connector parameters\n * @returns Script and control block (hex encoded)\n */\nexport async function getChallengeAssertScriptInfo(\n params: ChallengeAssertConnectorParams,\n): Promise<ChallengeAssertScriptInfo> {\n return (await loadTbvWasm()).getChallengeAssertScriptInfo(params);\n}\n\n/**\n * Get the scriptPubKey that output 0 of every ChallengeAssertX/Y transaction\n * pays to for one challenger: the WronglyChallenged leaves plus the NoPayout\n * leaf carrying the ChallengeAssert timelock.\n *\n * Used to bind the VP-supplied ChallengeAssert parents of a NoPayout before\n * the depositor signs it. The engine rejects a non-P2TR return.\n *\n * @param params - ChallengeAssert output connector parameters\n * @returns P2TR scriptPubKey (hex encoded)\n */\nexport async function getChallengeAssertOutputScriptPubKey(\n params: ChallengeAssertOutputConnectorParams,\n): Promise<string> {\n return (await loadTbvWasm()).getChallengeAssertOutputScriptPubKey(params);\n}\n\n/**\n * Derive 32-byte `authAnchor` (OP_RETURN preimage → VP bearer token).\n * @stability frozen - btc-vault Rust owns this API through the vault-wasm pin (`VAULT_WASM_COMMIT`).\n * Changing the derived bytes breaks VP auth for existing deposits. See CLAUDE.md §4.\n */\nexport async function expandAuthAnchor(root: Uint8Array): Promise<Uint8Array> {\n return (await loadTbvWasm()).expandAuthAnchor(root);\n}\n\n/**\n * Derive 32-byte `hashlockSecret` for HTLC `htlcVout` (preimage → `activateVaultWithSecret`).\n * @stability frozen - btc-vault Rust owns this API.\n * Changing the derived bytes means affected vaults can never activate. See CLAUDE.md §4.\n */\nexport async function expandHashlockSecret(\n root: Uint8Array,\n htlcVout: number,\n): Promise<Uint8Array> {\n return (await loadTbvWasm()).expandHashlockSecret(root, htlcVout);\n}\n\n/**\n * Derive 64-byte `wotsSeed` for HTLC `htlcVout` (→ WOTS keys, hashed as `depositorWotsPkHash`).\n * @stability frozen - btc-vault Rust owns this API.\n * Changing the derived bytes breaks existing `depositorWotsPkHash` values. No claim path remains. See CLAUDE.md §4.\n */\nexport async function expandWotsSeed(\n root: Uint8Array,\n htlcVout: number,\n): Promise<Uint8Array> {\n return (await loadTbvWasm()).expandWotsSeed(root, htlcVout);\n}\n\n/**\n * Derives the vault ID from a PegIn transaction hash and depositor ETH address.\n *\n * Vault ID = keccak256(abi.encode(peginTxHash, depositor))\n * This matches the Solidity-side derivation in BTCVaultRegistry.\n *\n * @param peginTxHash - 32-byte PegIn tx hash in display order (big-endian), hex encoded\n * @param depositor - 20-byte Ethereum address of the depositor, hex encoded\n * @returns Hex-encoded vault ID (32 bytes)\n */\nexport async function deriveVaultId(\n peginTxHash: string,\n depositor: string,\n): Promise<string> {\n return (await loadTbvWasm()).deriveVaultId(peginTxHash, depositor);\n}\n\n// ============================================================================\n// Delegated claim (depositor-as-claimer) — assembly and claim-time surface\n// ============================================================================\n//\n// The forwarding hop for the WASM exports that assemble the two files the\n// `vaultd vp wt` watchtower CLI consumes, and for the claim-time exports\n// that run a claim from those files without the CLI.\n//\n// EXPERIMENTAL — under test, signet only. These names and signatures can\n// change in a minor release. See services/delegated-claim.\n\n/**\n * Depositor's Claim signing PSBT (base64) — spends PegIn:1, script path.\n *\n * @experimental\n */\nexport async function buildClaimPsbt(\n txGraphVersion: number,\n graphJson: string,\n): Promise<string> {\n return (await loadTbvWasm()).buildClaimPsbt(txGraphVersion, graphJson);\n}\n\n/**\n * Claimer's Assert signing PSBT (base64) — the single WOTS input.\n *\n * @experimental\n */\nexport async function buildAssertClaimerPsbt(\n txGraphVersion: number,\n graphJson: string,\n): Promise<string> {\n return (await loadTbvWasm()).buildAssertClaimerPsbt(\n txGraphVersion,\n graphJson,\n );\n}\n\n/**\n * Claimer's Payout signing PSBT (base64) — input 1, Assert connector path.\n *\n * @experimental\n */\nexport async function buildPayoutClaimerPsbt(\n txGraphVersion: number,\n graphJson: string,\n): Promise<string> {\n return (await loadTbvWasm()).buildPayoutClaimerPsbt(\n txGraphVersion,\n graphJson,\n );\n}\n\n/**\n * Depositor's Payout signing PSBT (base64) — input 0, the PegIn UTXO spend.\n *\n * @experimental\n */\nexport async function buildPayoutDepositorPsbt(\n txGraphVersion: number,\n graphJson: string,\n): Promise<string> {\n return (await loadTbvWasm()).buildPayoutDepositorPsbt(\n txGraphVersion,\n graphJson,\n );\n}\n\n/**\n * Claimer's WronglyChallenged signing PSBTs, per challenger and GC index.\n *\n * @experimental\n */\nexport async function buildWronglyChallengedPsbts(\n txGraphVersion: number,\n graphJson: string,\n): Promise<WronglyChallengedPsbts> {\n return (await loadTbvWasm()).buildWronglyChallengedPsbts(\n txGraphVersion,\n graphJson,\n );\n}\n\n/**\n * Verifies the Groth16 pegout proof and pins it into the artifacts, returning\n * the updated artifacts JSON. Persist that copy: the one-time WOTS keypair\n * signs exactly one proof, so a second, different one is refused.\n *\n * @experimental\n */\nexport async function pinPegoutProof(\n txGraphVersion: number,\n artifactsJson: string,\n proofHex: string,\n): Promise<string> {\n return (await loadTbvWasm()).pinPegoutProof(\n txGraphVersion,\n artifactsJson,\n proofHex,\n );\n}\n\n/**\n * Finalizes the Assert from the pinned proof and the WOTS keypair, writes it\n * into the artifacts and returns the updated artifacts JSON. The keypair\n * never leaves the caller.\n *\n * @experimental\n */\nexport async function attachFinalizedAssert(\n txGraphVersion: number,\n artifactsJson: string,\n keypairJson: string,\n): Promise<string> {\n return (await loadTbvWasm()).attachFinalizedAssert(\n txGraphVersion,\n artifactsJson,\n keypairJson,\n );\n}\n\n/**\n * Finalizes the Payout tx from the artifacts' signatures, consensus hex.\n *\n * @experimental\n */\nexport async function finalizePayout(\n txGraphVersion: number,\n artifactsJson: string,\n): Promise<string> {\n return (await loadTbvWasm()).finalizePayout(txGraphVersion, artifactsJson);\n}\n\n/**\n * Finalizes one WronglyChallenged tx — the answer to a ChallengeAssert.\n *\n * @experimental\n */\nexport async function finalizeWronglyChallenged(\n txGraphVersion: number,\n artifactsJson: string,\n challengerPkHex: string,\n gcIndex: number,\n preimageHex: string,\n): Promise<string> {\n return (await loadTbvWasm()).finalizeWronglyChallenged(\n txGraphVersion,\n artifactsJson,\n challengerPkHex,\n gcIndex,\n preimageHex,\n );\n}\n\n/**\n * Applies the depositor signature to the Claim tx, returning consensus hex.\n *\n * @experimental\n */\nexport async function finalizeClaimTx(\n txGraphVersion: number,\n graphJson: string,\n depositorSigHex: string,\n): Promise<string> {\n return (await loadTbvWasm()).finalizeClaimTx(\n txGraphVersion,\n graphJson,\n depositorSigHex,\n );\n}\n\n/**\n * Extracts a signed PSBT input's taproot script-path signature (hex).\n *\n * @experimental\n */\nexport async function extractTapScriptSig(\n psbtBase64: string,\n inputIndex: number,\n): Promise<string> {\n return (await loadTbvWasm()).extractTapScriptSig(psbtBase64, inputIndex);\n}\n\n/**\n * Derive the depositor's WOTS keypair from the 64-byte `wotsSeed`.\n * @stability frozen — `HASH160(seed || block index)` binds on-chain through\n * `depositorWotsPkHash`; see CLAUDE.md §4.\n *\n * @experimental\n */\nexport async function wotsKeypairFromSeed(\n wotsSeed: Uint8Array,\n): Promise<WotsKeypairDerivation> {\n return (await loadTbvWasm()).wotsKeypairFromSeed(wotsSeed);\n}\n\n/**\n * Throws unless the keypair matches the WOTS keys the graph's Claim commits to.\n *\n * @experimental\n */\nexport async function validateWotsKeypairAgainstGraph(\n txGraphVersion: number,\n keypair: unknown,\n graphJson: string,\n): Promise<void> {\n return (await loadTbvWasm()).validateWotsKeypairAgainstGraph(\n txGraphVersion,\n keypair,\n graphJson,\n );\n}\n\n/**\n * Assembles the watchtower `artifacts.json` content, verifying every signature.\n *\n * @experimental\n */\nexport async function buildWatchtowerArtifacts(\n inputs: WatchtowerArtifactsInputs,\n): Promise<string> {\n return (await loadTbvWasm()).buildWatchtowerArtifacts(inputs);\n}\n\n/**\n * Re-verifies every claimer-side signature in an `artifacts.json`.\n *\n * @experimental\n */\nexport async function verifyWatchtowerArtifacts(\n txGraphVersion: number,\n artifactsJson: string,\n): Promise<void> {\n return (await loadTbvWasm()).verifyWatchtowerArtifacts(\n txGraphVersion,\n artifactsJson,\n );\n}\n\nexport type {\n AssertNoPayoutScriptInfo,\n AssertPayoutNoPayoutConnectorParams,\n AssertPayoutScriptInfo,\n ChallengeAssertConnectorParams,\n ChallengeAssertOutputConnectorParams,\n ChallengeAssertScriptInfo,\n HtlcConnectorInfo,\n HtlcConnectorParams,\n Network,\n PayoutConnectorInfo,\n PayoutConnectorParams,\n PeginP2aAnchorInfo,\n PeginTxResult,\n PrePeginParams,\n PrePeginResult,\n WatchtowerArtifactsInputs,\n WotsKeypairDerivation,\n WronglyChallengedPsbts,\n WronglyChallengedSigs,\n};\n"],"names":["TAP_INTERNAL_KEY","HEX_CHARS_PER_BYTE","tapInternalPubkey","_","index","wasmModulePromise","loadTbvWasm","error","wasm","createPrePeginTransaction","params","buildPeginTxFromPrePegin","timelockPegin","fundedPrePeginTxHex","htlcVout","getPrePeginHtlcConnectorInfo","computeMinClaimValue","txGraphVersion","numLocalChallengers","numUniversalChallengers","councilQuorum","councilSize","feeRate","computeMinPeginFee","numVks","numUcs","minPeginFeeRate","computePayoutFeeFloor","numVaultKeepers","out0Len","out1Len","supportedTxGraphVersions","peginP2aAnchorOutput","validatePeginP2aAnchor","txHex","createPayoutConnector","network","getAssertPayoutScriptInfo","getAssertNoPayoutScriptInfo","challengerPubkey","getChallengeAssertScriptInfo","getChallengeAssertOutputScriptPubKey","expandAuthAnchor","root","expandHashlockSecret","expandWotsSeed","deriveVaultId","peginTxHash","depositor","buildClaimPsbt","graphJson","buildAssertClaimerPsbt","buildPayoutClaimerPsbt","buildPayoutDepositorPsbt","buildWronglyChallengedPsbts","pinPegoutProof","artifactsJson","proofHex","attachFinalizedAssert","keypairJson","finalizePayout","finalizeWronglyChallenged","challengerPkHex","gcIndex","preimageHex","finalizeClaimTx","depositorSigHex","extractTapScriptSig","psbtBase64","inputIndex","wotsKeypairFromSeed","wotsSeed","validateWotsKeypairAgainstGraph","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B,CACjB,OAAQ,MAAMrE,KAAe,yBAAyBqE,CAAM,CAC9D,CAOA,eAAsBC,EACpB3D,EACAuC,EACe,CACf,OAAQ,MAAMlD,KAAe,0BAC3BW,EACAuC,CAAA,CAEJ"}
@@ -69,7 +69,7 @@ export declare function computeMinClaimValue(txGraphVersion: number, numLocalCha
69
69
  * `minPeginFee = peginTxVsize(numVks, numUcs) × minPeginFeeRate`. Each HTLC
70
70
  * the depositor funds in the Pre-PegIn tx must reserve at least this fee
71
71
  * inside its value (`htlcValue = peginAmount + depositorClaimValue +
72
- * p2aAnchorValue + minPeginFee`, anchor 0 on vault core 1), otherwise the VP
72
+ * p2aAnchorValue + minPeginFee`), otherwise the VP
73
73
  * cannot afford to broadcast the PegIn at
74
74
  * activation. The vsize comes from a Taproot script-path-spend weight
75
75
  * prediction whose witness shape depends on the VK + UC signer count.
@@ -100,18 +100,15 @@ export declare function computePayoutFeeFloor(txGraphVersion: number, numVaultKe
100
100
  */
101
101
  export declare function supportedTxGraphVersions(): Promise<number[]>;
102
102
  /**
103
- * The PegIn transaction's P2A (pay-to-anchor) output for a graph version, or
104
- * `null` when that version's PegIn carries no anchor (v1). The facade returns
105
- * one record per version — never a zero-valued placeholder — so an absent
106
- * anchor can't be mistaken for a real output. For v2/v3: 240 sats at vout 2,
107
- * script `51024e73`.
103
+ * The PegIn transaction's P2A (pay-to-anchor) output for a graph version: 240
104
+ * sats at vout 2, script `51024e73`. Every supported version's PegIn carries
105
+ * the anchor; the engine throws rather than return none.
108
106
  */
109
- export declare function peginP2aAnchorOutput(txGraphVersion: number): Promise<PeginP2aAnchorInfo | null>;
107
+ export declare function peginP2aAnchorOutput(txGraphVersion: number): Promise<PeginP2aAnchorInfo>;
110
108
  /**
111
- * Validate a PegIn transaction's P2A anchor against a graph version's rules:
112
- * v2 and v3 require the exact anchor (240 sats, vout 2, P2A script) and v1
113
- * requires that NO output carries the P2A script. Throws on any mismatch — a
114
- * v2 PegIn checked as v1 fails closed, and vice versa.
109
+ * Validate a PegIn transaction's P2A anchor against a graph version's rule:
110
+ * the exact anchor (240 sats, vout 2, P2A script). Throws on any mismatch, so
111
+ * a PegIn without the anchor fails closed.
115
112
  */
116
113
  export declare function validatePeginP2aAnchor(txGraphVersion: number, txHex: string): Promise<void>;
117
114
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/wasm/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,wBAAwB,EACxB,mCAAmC,EACnC,sBAAsB,EACtB,8BAA8B,EAC9B,oCAAoC,EACpC,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,OAAO,EACP,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAElE,KAAK,aAAa,GAAG,cAAc,uCAAuC,CAAC,CAAC;AAI5E;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAAC,aAAa,CAAC,CA4BpD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,cAAc,CAAC,CAEzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,cAAc,EACtB,aAAa,EAAE,MAAM,EACrB,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,aAAa,CAAC,CAOxB;AAED;;;;;;;;;GASG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAE5B;AAED;;;;;GAKG;AACH,wBAA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ACtB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC7C,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,YAAY,EACV,wBAAwB,EACxB,mCAAmC,EACnC,sBAAsB,EACtB,8BAA8B,EAC9B,oCAAoC,EACpC,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,OAAO,EACP,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,GACtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/wasm/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,wBAAwB,EACxB,mCAAmC,EACnC,sBAAsB,EACtB,8BAA8B,EAC9B,oCAAoC,EACpC,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,OAAO,EACP,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAElE,KAAK,aAAa,GAAG,cAAc,uCAAuC,CAAC,CAAC;AAI5E;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAAC,aAAa,CAAC,CA4BpD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wB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