@babylonlabs-io/ts-sdk 0.18.0 → 0.20.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 (195) hide show
  1. package/README.md +56 -12
  2. package/dist/bitcoin-CNnPFU6Y.cjs +2 -0
  3. package/dist/bitcoin-CNnPFU6Y.cjs.map +1 -0
  4. package/dist/{constants-Q7v2O7Ps.js → bitcoin-nOOgeRyl.js} +64 -76
  5. package/dist/bitcoin-nOOgeRyl.js.map +1 -0
  6. package/dist/buildAndBroadcastRefund-DWEQvj9T.cjs +2 -0
  7. package/dist/buildAndBroadcastRefund-DWEQvj9T.cjs.map +1 -0
  8. package/dist/buildAndBroadcastRefund-DnTQkCgG.js +1331 -0
  9. package/dist/buildAndBroadcastRefund-DnTQkCgG.js.map +1 -0
  10. package/dist/challengeAssert-D1lpvuMv.js +283 -0
  11. package/dist/challengeAssert-D1lpvuMv.js.map +1 -0
  12. package/dist/challengeAssert-nYlgeAI8.cjs +2 -0
  13. package/dist/challengeAssert-nYlgeAI8.cjs.map +1 -0
  14. package/dist/errors-BZON3Wmn.cjs +2 -0
  15. package/dist/errors-BZON3Wmn.cjs.map +1 -0
  16. package/dist/errors-CHY4WNi-.js +1226 -0
  17. package/dist/errors-CHY4WNi-.js.map +1 -0
  18. package/dist/fundPeginTransaction-BLYXxLBv.js +70 -0
  19. package/dist/fundPeginTransaction-BLYXxLBv.js.map +1 -0
  20. package/dist/fundPeginTransaction-DxNOeyNI.cjs +2 -0
  21. package/dist/fundPeginTransaction-DxNOeyNI.cjs.map +1 -0
  22. package/dist/index-BpXpESWu.cjs +2 -0
  23. package/dist/index-BpXpESWu.cjs.map +1 -0
  24. package/dist/index-CFwoGJNQ.js +1141 -0
  25. package/dist/index-CFwoGJNQ.js.map +1 -0
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.js +134 -100
  28. package/dist/payout-DzGsAnhf.js +261 -0
  29. package/dist/payout-DzGsAnhf.js.map +1 -0
  30. package/dist/payout-RFIh7GLN.cjs +2 -0
  31. package/dist/payout-RFIh7GLN.cjs.map +1 -0
  32. package/dist/psbtInputFields-C-zYR1z7.cjs +2 -0
  33. package/dist/psbtInputFields-C-zYR1z7.cjs.map +1 -0
  34. package/dist/psbtInputFields-Dx41_IoI.js +229 -0
  35. package/dist/psbtInputFields-Dx41_IoI.js.map +1 -0
  36. package/dist/signing-DeWVBl7m.js +64 -0
  37. package/dist/signing-DeWVBl7m.js.map +1 -0
  38. package/dist/signing-cl-lowxV.cjs +2 -0
  39. package/dist/signing-cl-lowxV.cjs.map +1 -0
  40. package/dist/tbv/core/clients/eth/__tests__/protocol-params-reader.test.d.ts +2 -0
  41. package/dist/tbv/core/clients/eth/__tests__/protocol-params-reader.test.d.ts.map +1 -0
  42. package/dist/tbv/core/clients/eth/__tests__/signer-set-reader.test.d.ts +2 -0
  43. package/dist/tbv/core/clients/eth/__tests__/signer-set-reader.test.d.ts.map +1 -0
  44. package/dist/tbv/core/clients/eth/contract-address-resolver.d.ts +18 -0
  45. package/dist/tbv/core/clients/eth/contract-address-resolver.d.ts.map +1 -0
  46. package/dist/tbv/core/clients/eth/index.d.ts +4 -1
  47. package/dist/tbv/core/clients/eth/index.d.ts.map +1 -1
  48. package/dist/tbv/core/clients/eth/protocol-params-reader.d.ts +27 -0
  49. package/dist/tbv/core/clients/eth/protocol-params-reader.d.ts.map +1 -0
  50. package/dist/tbv/core/clients/eth/signer-set-reader.d.ts +37 -0
  51. package/dist/tbv/core/clients/eth/signer-set-reader.d.ts.map +1 -0
  52. package/dist/tbv/core/clients/eth/types.d.ts +80 -0
  53. package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
  54. package/dist/tbv/core/clients/index.cjs +1 -1
  55. package/dist/tbv/core/clients/index.js +25 -21
  56. package/dist/tbv/core/contracts/abis/ApplicationRegistry.abi.d.ts +74 -0
  57. package/dist/tbv/core/contracts/abis/ApplicationRegistry.abi.d.ts.map +1 -0
  58. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +20 -0
  59. package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
  60. package/dist/tbv/core/contracts/abis/ProtocolParams.abi.d.ts +233 -0
  61. package/dist/tbv/core/contracts/abis/ProtocolParams.abi.d.ts.map +1 -0
  62. package/dist/tbv/core/contracts/index.d.ts +2 -0
  63. package/dist/tbv/core/contracts/index.d.ts.map +1 -1
  64. package/dist/tbv/core/index.cjs +1 -1
  65. package/dist/tbv/core/index.d.ts +3 -1
  66. package/dist/tbv/core/index.d.ts.map +1 -1
  67. package/dist/tbv/core/index.js +129 -95
  68. package/dist/tbv/core/managers/PeginManager.d.ts +1 -1
  69. package/dist/tbv/core/primitives/index.cjs +1 -1
  70. package/dist/tbv/core/primitives/index.d.ts +3 -2
  71. package/dist/tbv/core/primitives/index.d.ts.map +1 -1
  72. package/dist/tbv/core/primitives/index.js +24 -23
  73. package/dist/tbv/core/primitives/psbt/__tests__/helpers.d.ts +1 -1
  74. package/dist/tbv/core/primitives/psbt/index.d.ts +1 -1
  75. package/dist/tbv/core/primitives/psbt/payout.d.ts.map +1 -1
  76. package/dist/tbv/core/primitives/psbt/pegin.d.ts +2 -3
  77. package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
  78. package/dist/tbv/core/primitives/utils/bitcoin.d.ts +4 -0
  79. package/dist/tbv/core/primitives/utils/bitcoin.d.ts.map +1 -1
  80. package/dist/tbv/core/primitives/utils/index.d.ts +1 -1
  81. package/dist/tbv/core/primitives/utils/index.d.ts.map +1 -1
  82. package/dist/tbv/core/services/activation/__tests__/activateVault.test.d.ts +2 -0
  83. package/dist/tbv/core/services/activation/__tests__/activateVault.test.d.ts.map +1 -0
  84. package/dist/tbv/core/services/activation/activateVault.d.ts +77 -0
  85. package/dist/tbv/core/services/activation/activateVault.d.ts.map +1 -0
  86. package/dist/tbv/core/services/activation/index.d.ts +7 -0
  87. package/dist/tbv/core/services/activation/index.d.ts.map +1 -0
  88. package/dist/tbv/core/services/deposit/__tests__/peginState.test.d.ts +2 -0
  89. package/dist/tbv/core/services/deposit/__tests__/peginState.test.d.ts.map +1 -0
  90. package/dist/tbv/core/services/deposit/__tests__/validation.test.d.ts +5 -0
  91. package/dist/tbv/core/services/deposit/__tests__/validation.test.d.ts.map +1 -0
  92. package/dist/tbv/core/services/deposit/index.d.ts +4 -0
  93. package/dist/tbv/core/services/deposit/index.d.ts.map +1 -1
  94. package/dist/tbv/core/services/deposit/peginState.d.ts +93 -0
  95. package/dist/tbv/core/services/deposit/peginState.d.ts.map +1 -0
  96. package/dist/tbv/core/services/deposit/validation.d.ts +114 -0
  97. package/dist/tbv/core/services/deposit/validation.d.ts.map +1 -0
  98. package/dist/tbv/core/services/htlc/__tests__/htlc.test.d.ts +2 -0
  99. package/dist/tbv/core/services/htlc/__tests__/htlc.test.d.ts.map +1 -0
  100. package/dist/tbv/core/services/htlc/index.d.ts +25 -0
  101. package/dist/tbv/core/services/htlc/index.d.ts.map +1 -0
  102. package/dist/tbv/core/services/index.cjs +1 -1
  103. package/dist/tbv/core/services/index.d.ts +4 -0
  104. package/dist/tbv/core/services/index.d.ts.map +1 -1
  105. package/dist/tbv/core/services/index.js +25 -5
  106. package/dist/tbv/core/services/index.js.map +1 -1
  107. package/dist/tbv/core/services/pegout/__tests__/state.test.d.ts +2 -0
  108. package/dist/tbv/core/services/pegout/__tests__/state.test.d.ts.map +1 -0
  109. package/dist/tbv/core/services/pegout/index.d.ts +2 -0
  110. package/dist/tbv/core/services/pegout/index.d.ts.map +1 -0
  111. package/dist/tbv/core/services/pegout/state.d.ts +30 -0
  112. package/dist/tbv/core/services/pegout/state.d.ts.map +1 -0
  113. package/dist/tbv/core/services/refund/__tests__/buildAndBroadcastRefund.test.d.ts +2 -0
  114. package/dist/tbv/core/services/refund/__tests__/buildAndBroadcastRefund.test.d.ts.map +1 -0
  115. package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts +103 -0
  116. package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts.map +1 -0
  117. package/dist/tbv/core/services/refund/errors.d.ts +13 -0
  118. package/dist/tbv/core/services/refund/errors.d.ts.map +1 -0
  119. package/dist/tbv/core/services/refund/index.d.ts +8 -0
  120. package/dist/tbv/core/services/refund/index.d.ts.map +1 -0
  121. package/dist/tbv/core/utils/index.cjs +1 -1
  122. package/dist/tbv/core/utils/index.js +30 -24
  123. package/dist/tbv/core/utils/transaction/fundPeginTransaction.d.ts +1 -1
  124. package/dist/tbv/core/utils/utxo/__tests__/availability.test.d.ts +3 -0
  125. package/dist/tbv/core/utils/utxo/__tests__/availability.test.d.ts.map +1 -0
  126. package/dist/tbv/core/utils/utxo/__tests__/reservation.test.d.ts +3 -0
  127. package/dist/tbv/core/utils/utxo/__tests__/reservation.test.d.ts.map +1 -0
  128. package/dist/tbv/core/utils/utxo/availability.d.ts +62 -0
  129. package/dist/tbv/core/utils/utxo/availability.d.ts.map +1 -0
  130. package/dist/tbv/core/utils/utxo/index.d.ts +2 -0
  131. package/dist/tbv/core/utils/utxo/index.d.ts.map +1 -1
  132. package/dist/tbv/core/utils/utxo/reservation.d.ts +65 -0
  133. package/dist/tbv/core/utils/utxo/reservation.d.ts.map +1 -0
  134. package/dist/tbv/core/wots/__tests__/blockDerivation.test.d.ts +2 -0
  135. package/dist/tbv/core/wots/__tests__/blockDerivation.test.d.ts.map +1 -0
  136. package/dist/tbv/core/wots/blockDerivation.d.ts +36 -0
  137. package/dist/tbv/core/wots/blockDerivation.d.ts.map +1 -0
  138. package/dist/tbv/core/wots/index.d.ts +1 -0
  139. package/dist/tbv/core/wots/index.d.ts.map +1 -1
  140. package/dist/tbv/index.cjs +1 -1
  141. package/dist/tbv/index.js +129 -95
  142. package/dist/tbv/integrations/aave/index.cjs +1 -1
  143. package/dist/tbv/integrations/aave/index.cjs.map +1 -1
  144. package/dist/tbv/integrations/aave/index.d.ts +3 -3
  145. package/dist/tbv/integrations/aave/index.d.ts.map +1 -1
  146. package/dist/tbv/integrations/aave/index.js +145 -169
  147. package/dist/tbv/integrations/aave/index.js.map +1 -1
  148. package/dist/tbv/integrations/aave/utils/healthFactor.d.ts +0 -30
  149. package/dist/tbv/integrations/aave/utils/healthFactor.d.ts.map +1 -1
  150. package/dist/tbv/integrations/aave/utils/index.d.ts +2 -2
  151. package/dist/tbv/integrations/aave/utils/index.d.ts.map +1 -1
  152. package/dist/types-B-p4dhEH.cjs +2 -0
  153. package/dist/types-B-p4dhEH.cjs.map +1 -0
  154. package/dist/types-DWjaqVfP.js +608 -0
  155. package/dist/types-DWjaqVfP.js.map +1 -0
  156. package/package.json +5 -1
  157. package/dist/challengeAssert-D_k_ADgP.cjs +0 -2
  158. package/dist/challengeAssert-D_k_ADgP.cjs.map +0 -1
  159. package/dist/challengeAssert-k5_LWUtO.js +0 -362
  160. package/dist/challengeAssert-k5_LWUtO.js.map +0 -1
  161. package/dist/constants-EiyZkXce.cjs +0 -2
  162. package/dist/constants-EiyZkXce.cjs.map +0 -1
  163. package/dist/constants-Q7v2O7Ps.js.map +0 -1
  164. package/dist/errors-DAKpPfl7.cjs +0 -2
  165. package/dist/errors-DAKpPfl7.cjs.map +0 -1
  166. package/dist/errors-DARTQrP3.js +0 -1510
  167. package/dist/errors-DARTQrP3.js.map +0 -1
  168. package/dist/fundPeginTransaction-DpwnDslW.js +0 -50
  169. package/dist/fundPeginTransaction-DpwnDslW.js.map +0 -1
  170. package/dist/fundPeginTransaction-EbrZzlrh.cjs +0 -2
  171. package/dist/fundPeginTransaction-EbrZzlrh.cjs.map +0 -1
  172. package/dist/index-DKfhZvdn.cjs +0 -2
  173. package/dist/index-DKfhZvdn.cjs.map +0 -1
  174. package/dist/index-qIcjkxLw.js +0 -911
  175. package/dist/index-qIcjkxLw.js.map +0 -1
  176. package/dist/payout-Ce9vSs9e.js +0 -164
  177. package/dist/payout-Ce9vSs9e.js.map +0 -1
  178. package/dist/payout-CfsDnjKI.cjs +0 -2
  179. package/dist/payout-CfsDnjKI.cjs.map +0 -1
  180. package/dist/psbtInputFields-C0nKn_GD.cjs +0 -2
  181. package/dist/psbtInputFields-C0nKn_GD.cjs.map +0 -1
  182. package/dist/psbtInputFields-DO0ELwiv.js +0 -116
  183. package/dist/psbtInputFields-DO0ELwiv.js.map +0 -1
  184. package/dist/signAndSubmitPayouts-CAOEAQp9.js +0 -490
  185. package/dist/signAndSubmitPayouts-CAOEAQp9.js.map +0 -1
  186. package/dist/signAndSubmitPayouts-CSJmcPQN.cjs +0 -2
  187. package/dist/signAndSubmitPayouts-CSJmcPQN.cjs.map +0 -1
  188. package/dist/signing-Deg5lCoC.cjs +0 -2
  189. package/dist/signing-Deg5lCoC.cjs.map +0 -1
  190. package/dist/signing-Drwr3bXB.js +0 -16
  191. package/dist/signing-Drwr3bXB.js.map +0 -1
  192. package/dist/types-D1rYwwCu.js +0 -235
  193. package/dist/types-D1rYwwCu.js.map +0 -1
  194. package/dist/types-DEWiqXYp.cjs +0 -2
  195. package/dist/types-DEWiqXYp.cjs.map +0 -1
@@ -0,0 +1,62 @@
1
+ import { UtxoRef } from './reservation';
2
+ /**
3
+ * Information about a missing/spent UTXO.
4
+ */
5
+ export interface MissingUtxoInfo {
6
+ /** Transaction ID of the missing UTXO */
7
+ txid: string;
8
+ /** Output index of the missing UTXO */
9
+ vout: number;
10
+ }
11
+ /**
12
+ * Result of UTXO validation.
13
+ */
14
+ export interface UtxoValidationResult {
15
+ /** Whether all UTXOs are still available */
16
+ allAvailable: boolean;
17
+ /** List of missing UTXOs (if any) */
18
+ missingUtxos: MissingUtxoInfo[];
19
+ /** Total number of inputs checked */
20
+ totalInputs: number;
21
+ }
22
+ /**
23
+ * Error thrown when UTXOs are not available.
24
+ */
25
+ export declare class UtxoNotAvailableError extends Error {
26
+ readonly missingUtxos: MissingUtxoInfo[];
27
+ constructor(missingUtxos: MissingUtxoInfo[]);
28
+ }
29
+ /**
30
+ * Extract input references (txid:vout) from an unsigned transaction.
31
+ *
32
+ * @param unsignedTxHex - Unsigned transaction hex
33
+ * @returns Array of input references
34
+ */
35
+ export declare function extractInputsFromTransaction(unsignedTxHex: string): Array<{
36
+ txid: string;
37
+ vout: number;
38
+ }>;
39
+ /**
40
+ * Validate that all UTXOs in a transaction are still available.
41
+ *
42
+ * Pure function — accepts pre-fetched UTXOs instead of making network calls.
43
+ * This should be called BEFORE signing to avoid wasting user effort
44
+ * signing a transaction that will fail to broadcast.
45
+ *
46
+ * @param unsignedTxHex - Unsigned transaction hex
47
+ * @param availableUtxos - Pre-fetched list of available UTXOs for the depositor
48
+ * @returns Validation result with missing UTXO details
49
+ */
50
+ export declare function validateUtxosAvailable(unsignedTxHex: string, availableUtxos: UtxoRef[]): UtxoValidationResult;
51
+ /**
52
+ * Validate UTXOs and throw if any are not available.
53
+ *
54
+ * Pure convenience function that combines validation and error throwing.
55
+ *
56
+ * @param unsignedTxHex - Unsigned transaction hex
57
+ * @param availableUtxos - Pre-fetched list of available UTXOs for the depositor
58
+ * @throws UtxoNotAvailableError if any UTXOs are not available
59
+ * @throws Error if validation fails
60
+ */
61
+ export declare function assertUtxosAvailable(unsignedTxHex: string, availableUtxos: UtxoRef[]): void;
62
+ //# sourceMappingURL=availability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"availability.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/utxo/availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,YAAY,EAAE,OAAO,CAAC;IACtB,qCAAqC;IACrC,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,SAAgB,YAAY,EAAE,eAAe,EAAE,CAAC;gBAEpC,YAAY,EAAE,eAAe,EAAE;CAW5C;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,MAAM,GACpB,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAmBvC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,OAAO,EAAE,GACxB,oBAAoB,CA6BtB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,OAAO,EAAE,GACxB,IAAI,CAMN"}
@@ -3,5 +3,7 @@
3
3
  *
4
4
  * @module utils/utxo
5
5
  */
6
+ export * from './availability';
7
+ export * from './reservation';
6
8
  export * from './selectUtxos';
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/utxo/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/utxo/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * UTXO reservation utilities for vault deposits.
3
+ *
4
+ * Handles tracking which UTXOs are already in use by pending deposits
5
+ * and selecting available UTXOs with smart fallback logic.
6
+ */
7
+ /** A txid:vout pair uniquely identifying a UTXO (outpoint). */
8
+ export interface UtxoRef {
9
+ txid: string;
10
+ vout: number;
11
+ }
12
+ /** Narrow structural type for pending pegin data. */
13
+ export interface PendingPeginLike {
14
+ selectedUTXOs?: Array<{
15
+ txid: string;
16
+ vout: number;
17
+ }>;
18
+ unsignedTxHex?: string;
19
+ }
20
+ /** Narrow structural type for vault data. */
21
+ export interface VaultLike {
22
+ status: number;
23
+ unsignedPrePeginTx: string;
24
+ }
25
+ export interface SelectUtxosForDepositParams<T extends {
26
+ txid: string;
27
+ vout: number;
28
+ value: number;
29
+ }> {
30
+ /** All available UTXOs from the wallet. */
31
+ availableUtxos: T[];
32
+ /** UTXOs that are reserved/in-flight and should be avoided if possible. */
33
+ reservedUtxoRefs: UtxoRef[];
34
+ /** Required deposit amount in satoshis (excluding fees). */
35
+ requiredAmount: bigint;
36
+ /** Fee rate in sat/vB. Used to estimate fee buffer for sufficiency check. */
37
+ feeRate: number;
38
+ }
39
+ export interface CollectReservedUtxoRefsParams {
40
+ vaults?: VaultLike[];
41
+ pendingPegins?: PendingPeginLike[];
42
+ }
43
+ /**
44
+ * Collect UTXO refs from in-flight deposits (PENDING/VERIFIED vaults and pending pegins).
45
+ */
46
+ export declare function collectReservedUtxoRefs(params: CollectReservedUtxoRefsParams): UtxoRef[];
47
+ /**
48
+ * Select UTXOs for a deposit, filtering out reserved ones.
49
+ *
50
+ * Logic:
51
+ * 1. Filter out reserved UTXOs from the available pool
52
+ * 2. If unreserved UTXOs are sufficient for the required amount + estimated fee, return them
53
+ * 3. Otherwise, throw — never silently reuse reserved UTXOs, as this risks double-spend
54
+ * failures that strand registered-but-unbroadcastable vaults
55
+ *
56
+ * @param params - Selection parameters
57
+ * @returns Array of unreserved UTXOs to use for the deposit
58
+ * @throws When all UTXOs are reserved or unreserved UTXOs are insufficient
59
+ */
60
+ export declare function selectUtxosForDeposit<T extends {
61
+ txid: string;
62
+ vout: number;
63
+ value: number;
64
+ }>(params: SelectUtxosForDepositParams<T>): T[];
65
+ //# sourceMappingURL=reservation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reservation.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/utxo/reservation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkBH,+DAA+D;AAC/D,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,aAAa,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,6CAA6C;AAC7C,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,2BAA2B,CAC1C,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;IAEvD,2CAA2C;IAC3C,cAAc,EAAE,CAAC,EAAE,CAAC;IACpB,2EAA2E;IAC3E,gBAAgB,EAAE,OAAO,EAAE,CAAC;IAC5B,4DAA4D;IAC5D,cAAc,EAAE,MAAM,CAAC;IACvB,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,6BAA6B;IAC5C,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACpC;AA6DD;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,6BAA6B,GACpC,OAAO,EAAE,CA2BX;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACvD,MAAM,EAAE,2BAA2B,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAuC7C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=blockDerivation.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockDerivation.test.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/wots/__tests__/blockDerivation.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,36 @@
1
+ import { WotsBlockPublicKey } from '../clients/vault-provider/types';
2
+ import { Hex } from 'viem';
3
+ /**
4
+ * Derive deterministic WOTS block public keys for a specific vault.
5
+ *
6
+ * Produces an array of {@link WotsBlockPublicKey} (one per assert block),
7
+ * matching the Rust `Vec<babe::wots::PublicKey>` format expected by the
8
+ * vault provider's `submitDepositorWotsKey` RPC.
9
+ *
10
+ * The VP expects exactly 2 blocks and validates that keccak256 of the
11
+ * concatenated chain tips matches the on-chain `depositorWotsPkHash`.
12
+ *
13
+ * @param seed - 64-byte seed (e.g. from `mnemonicToWotsSeed`). Zeroed after use.
14
+ * @param vaultId - Vault identifier / pegin tx hash (hex, with or without 0x prefix).
15
+ * @param depositorPk - Depositor's BTC public key (hex, with or without 0x prefix).
16
+ * @param appContractAddress - Application contract address.
17
+ * @returns Array of 2 WOTS block public keys.
18
+ * @throws If seed is not exactly 64 bytes.
19
+ */
20
+ export declare function deriveWotsBlockPublicKeys(seed: Uint8Array, vaultId: string, depositorPk: string, appContractAddress: string): Promise<WotsBlockPublicKey[]>;
21
+ /**
22
+ * Compute the keccak256 hash of WOTS block public keys.
23
+ *
24
+ * Matches Rust `btc_vault::wots_public_keys_keccak256`: for each block,
25
+ * chain tips are concatenated in canonical order
26
+ * `[checksum_minor, checksum_major, message_terminals...]`, then all
27
+ * blocks are concatenated and hashed.
28
+ *
29
+ * The result is committed on-chain as `depositorWotsPkHash` so the vault
30
+ * provider can verify submitted WOTS public keys.
31
+ *
32
+ * @param publicKeys - Array of WOTS block public keys (must not be empty).
33
+ * @returns 0x-prefixed keccak256 hex string.
34
+ */
35
+ export declare function computeWotsBlockPublicKeysHash(publicKeys: WotsBlockPublicKey[]): Hex;
36
+ //# sourceMappingURL=blockDerivation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockDerivation.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/wots/blockDerivation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAEnB,MAAM,iCAAiC,CAAC;AAMzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAmMhC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAuF/B;AAuBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,kBAAkB,EAAE,GAC/B,GAAG,CAsCL"}
@@ -1,5 +1,6 @@
1
1
  export type { WotsKeypair, WotsPublicKey, WotsKeyProvider } from './types';
2
2
  export { mnemonicToWotsSeed, deriveWotsKeypair, keypairToPublicKey, computeWotsPkHash, } from './derivation';
3
+ export { deriveWotsBlockPublicKeys, computeWotsBlockPublicKeysHash, } from './blockDerivation';
3
4
  export { deriveWotsPkHash } from './deriveWotsPkHash';
4
5
  export { isWotsMismatchError } from './errors';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/wots/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/wots/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../challengeAssert-D_k_ADgP.cjs"),u=require("@babylonlabs-io/babylon-tbv-rust-wasm"),a=require("../payout-CfsDnjKI.cjs"),e=require("../constants-EiyZkXce.cjs"),s=require("../psbtInputFields-C0nKn_GD.cjs"),T=require("../fundPeginTransaction-EbrZzlrh.cjs"),P=require("../signing-Deg5lCoC.cjs"),r=require("../errors-DAKpPfl7.cjs"),n=require("../signAndSubmitPayouts-CSJmcPQN.cjs"),t=require("../index-DKfhZvdn.cjs"),o=require("../types-DEWiqXYp.cjs");exports.buildChallengeAssertPsbt=i.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=i.buildDepositorPayoutPsbt;exports.buildNoPayoutPsbt=i.buildNoPayoutPsbt;exports.buildPeginInputPsbt=i.buildPeginInputPsbt;exports.buildPeginTxFromFundedPrePegin=i.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=i.buildPrePeginPsbt;exports.buildRefundPsbt=i.buildRefundPsbt;exports.computeNumLocalChallengers=i.computeNumLocalChallengers;exports.extractPeginInputSignature=i.extractPeginInputSignature;exports.finalizePeginInputPsbt=i.finalizePeginInputPsbt;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>u.computeMinClaimValue});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>u.deriveVaultId});exports.buildPayoutPsbt=a.buildPayoutPsbt;exports.createPayoutScript=a.createPayoutScript;exports.extractPayoutSignature=a.extractPayoutSignature;exports.BTC_DUST_SAT=e.BTC_DUST_SAT;exports.DUST_THRESHOLD=e.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=e.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=e.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=e.MAX_NON_LEGACY_OUTPUT_SIZE;exports.P2TR_INPUT_SIZE=e.P2TR_INPUT_SIZE;exports.PEGIN_FIXED_OUTPUTS=e.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=e.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=e.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=e.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.deriveNativeSegwitAddress=e.deriveNativeSegwitAddress;exports.deriveTaprootAddress=e.deriveTaprootAddress;exports.ensureHexPrefix=e.ensureHexPrefix;exports.getNetwork=e.getNetwork;exports.hexToUint8Array=e.hexToUint8Array;exports.isAddressFromPublicKey=e.isAddressFromPublicKey;exports.isValidHex=e.isValidHex;exports.peginOutputCount=e.peginOutputCount;exports.processPublicKeyToXOnly=e.processPublicKeyToXOnly;exports.rateBasedTxBufferFee=e.rateBasedTxBufferFee;exports.stripHexPrefix=e.stripHexPrefix;exports.toXOnly=e.toXOnly;exports.uint8ArrayToHex=e.uint8ArrayToHex;exports.validateWalletPubkey=e.validateWalletPubkey;exports.BitcoinScriptType=s.BitcoinScriptType;exports.calculateBtcTxHash=s.calculateBtcTxHash;exports.getDustThreshold=s.getDustThreshold;exports.getPsbtInputFields=s.getPsbtInputFields;exports.getScriptType=s.getScriptType;exports.selectUtxosForPegin=s.selectUtxosForPegin;exports.shouldAddChangeOutput=s.shouldAddChangeOutput;exports.fundPeginTransaction=T.fundPeginTransaction;exports.parseUnfundedWasmTransaction=T.parseUnfundedWasmTransaction;exports.createTaprootScriptPathSignOptions=P.createTaprootScriptPathSignOptions;exports.CONTRACT_ERRORS=r.CONTRACT_ERRORS;exports.PeginManager=r.PeginManager;exports.computeWotsPkHash=r.computeWotsPkHash;exports.deriveWotsKeypair=r.deriveWotsKeypair;exports.deriveWotsPkHash=r.deriveWotsPkHash;exports.extractErrorData=r.extractErrorData;exports.getContractErrorMessage=r.getContractErrorMessage;exports.handleContractError=r.handleContractError;exports.isKnownContractError=r.isKnownContractError;exports.isWotsMismatchError=r.isWotsMismatchError;exports.keypairToPublicKey=r.keypairToPublicKey;exports.mnemonicToWotsSeed=r.mnemonicToWotsSeed;exports.PayoutManager=n.PayoutManager;exports.pollAndSignPayouts=n.pollAndSignPayouts;exports.signDepositorGraph=n.signDepositorGraph;exports.submitWotsPublicKey=n.submitWotsPublicKey;exports.waitForPeginStatus=n.waitForPeginStatus;exports.BTCVaultRegistryABI=t.BTCVaultRegistryABI;exports.MEMPOOL_API_URLS=t.MEMPOOL_API_URLS;exports.VaultProviderRpcClient=t.VaultProviderRpcClient;exports.ViemVaultRegistryReader=t.ViemVaultRegistryReader;exports.VpResponseValidationError=t.VpResponseValidationError;exports.getAddressTxs=t.getAddressTxs;exports.getAddressUtxos=t.getAddressUtxos;exports.getMempoolApiUrl=t.getMempoolApiUrl;exports.getNetworkFees=t.getNetworkFees;exports.getTxHex=t.getTxHex;exports.getTxInfo=t.getTxInfo;exports.getUtxoInfo=t.getUtxoInfo;exports.pushTx=t.pushTx;exports.DaemonStatus=o.DaemonStatus;exports.JSON_RPC_ERROR_CODES=o.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=o.JsonRpcClient;exports.JsonRpcError=o.JsonRpcError;exports.POST_WOTS_STATUSES=o.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=o.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=o.RpcErrorCode;exports.VP_TERMINAL_STATUSES=o.VP_TERMINAL_STATUSES;exports.VP_TRANSIENT_STATUSES=o.VP_TRANSIENT_STATUSES;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../challengeAssert-nYlgeAI8.cjs"),P=require("@babylonlabs-io/babylon-tbv-rust-wasm"),u=require("../payout-RFIh7GLN.cjs"),a=require("../bitcoin-CNnPFU6Y.cjs"),l=require("../signing-cl-lowxV.cjs"),e=require("../buildAndBroadcastRefund-DWEQvj9T.cjs"),r=require("../fundPeginTransaction-DxNOeyNI.cjs"),i=require("../psbtInputFields-C-zYR1z7.cjs"),o=require("../errors-BZON3Wmn.cjs"),t=require("../index-BpXpESWu.cjs"),s=require("../types-B-p4dhEH.cjs");exports.buildChallengeAssertPsbt=n.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=n.buildDepositorPayoutPsbt;exports.buildNoPayoutPsbt=n.buildNoPayoutPsbt;exports.buildPeginInputPsbt=n.buildPeginInputPsbt;exports.buildPeginTxFromFundedPrePegin=n.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=n.buildPrePeginPsbt;exports.computeNumLocalChallengers=n.computeNumLocalChallengers;exports.extractPeginInputSignature=n.extractPeginInputSignature;exports.finalizePeginInputPsbt=n.finalizePeginInputPsbt;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>P.computeMinClaimValue});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>P.deriveVaultId});exports.buildPayoutPsbt=u.buildPayoutPsbt;exports.buildRefundPsbt=u.buildRefundPsbt;exports.createPayoutScript=u.createPayoutScript;exports.extractPayoutSignature=u.extractPayoutSignature;exports.deriveNativeSegwitAddress=a.deriveNativeSegwitAddress;exports.deriveTaprootAddress=a.deriveTaprootAddress;exports.ensureHexPrefix=a.ensureHexPrefix;exports.formatSatoshisToBtc=a.formatSatoshisToBtc;exports.getNetwork=a.getNetwork;exports.hexToUint8Array=a.hexToUint8Array;exports.isAddressFromPublicKey=a.isAddressFromPublicKey;exports.isValidHex=a.isValidHex;exports.processPublicKeyToXOnly=a.processPublicKeyToXOnly;exports.stripHexPrefix=a.stripHexPrefix;exports.toXOnly=a.toXOnly;exports.uint8ArrayToHex=a.uint8ArrayToHex;exports.validateWalletPubkey=a.validateWalletPubkey;exports.ContractStatus=l.ContractStatus;exports.PeginAction=l.PeginAction;exports.canPerformAction=l.canPerformAction;exports.createTaprootScriptPathSignOptions=l.createTaprootScriptPathSignOptions;exports.getPeginProtocolState=l.getPeginProtocolState;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.PayoutManager=e.PayoutManager;exports.activateVault=e.activateVault;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.computeHashlock=e.computeHashlock;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.pollAndSignPayouts=e.pollAndSignPayouts;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.validateDepositAmount=e.validateDepositAmount;exports.validateMultiVaultDepositInputs=e.validateMultiVaultDepositInputs;exports.validateProviderSelection=e.validateProviderSelection;exports.validateRemainingCapacity=e.validateRemainingCapacity;exports.validateSecretAgainstHashlock=e.validateSecretAgainstHashlock;exports.validateVaultAmounts=e.validateVaultAmounts;exports.validateVaultProviderPubkey=e.validateVaultProviderPubkey;exports.waitForPeginStatus=e.waitForPeginStatus;exports.BTC_DUST_SAT=r.BTC_DUST_SAT;exports.DUST_THRESHOLD=r.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=r.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=r.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=r.MAX_NON_LEGACY_OUTPUT_SIZE;exports.P2TR_INPUT_SIZE=r.P2TR_INPUT_SIZE;exports.PEGIN_FIXED_OUTPUTS=r.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=r.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=r.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=r.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=r.fundPeginTransaction;exports.parseUnfundedWasmTransaction=r.parseUnfundedWasmTransaction;exports.peginOutputCount=r.peginOutputCount;exports.rateBasedTxBufferFee=r.rateBasedTxBufferFee;exports.BitcoinScriptType=i.BitcoinScriptType;exports.UtxoNotAvailableError=i.UtxoNotAvailableError;exports.assertUtxosAvailable=i.assertUtxosAvailable;exports.calculateBtcTxHash=i.calculateBtcTxHash;exports.collectReservedUtxoRefs=i.collectReservedUtxoRefs;exports.extractInputsFromTransaction=i.extractInputsFromTransaction;exports.getDustThreshold=i.getDustThreshold;exports.getPsbtInputFields=i.getPsbtInputFields;exports.getScriptType=i.getScriptType;exports.selectUtxosForDeposit=i.selectUtxosForDeposit;exports.selectUtxosForPegin=i.selectUtxosForPegin;exports.shouldAddChangeOutput=i.shouldAddChangeOutput;exports.validateUtxosAvailable=i.validateUtxosAvailable;exports.CONTRACT_ERRORS=o.CONTRACT_ERRORS;exports.PeginManager=o.PeginManager;exports.computeWotsBlockPublicKeysHash=o.computeWotsBlockPublicKeysHash;exports.computeWotsPkHash=o.computeWotsPkHash;exports.deriveWotsBlockPublicKeys=o.deriveWotsBlockPublicKeys;exports.deriveWotsKeypair=o.deriveWotsKeypair;exports.deriveWotsPkHash=o.deriveWotsPkHash;exports.extractErrorData=o.extractErrorData;exports.getContractErrorMessage=o.getContractErrorMessage;exports.handleContractError=o.handleContractError;exports.isKnownContractError=o.isKnownContractError;exports.isWotsMismatchError=o.isWotsMismatchError;exports.keypairToPublicKey=o.keypairToPublicKey;exports.mnemonicToWotsSeed=o.mnemonicToWotsSeed;exports.ApplicationRegistryABI=t.ApplicationRegistryABI;exports.MEMPOOL_API_URLS=t.MEMPOOL_API_URLS;exports.ProtocolParamsABI=t.ProtocolParamsABI;exports.VaultProviderRpcClient=t.VaultProviderRpcClient;exports.ViemProtocolParamsReader=t.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=t.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=t.ViemVaultKeeperReader;exports.ViemVaultRegistryReader=t.ViemVaultRegistryReader;exports.VpResponseValidationError=t.VpResponseValidationError;exports.getAddressTxs=t.getAddressTxs;exports.getAddressUtxos=t.getAddressUtxos;exports.getMempoolApiUrl=t.getMempoolApiUrl;exports.getNetworkFees=t.getNetworkFees;exports.getTxHex=t.getTxHex;exports.getTxInfo=t.getTxInfo;exports.getUtxoInfo=t.getUtxoInfo;exports.pushTx=t.pushTx;exports.resolveProtocolAddresses=t.resolveProtocolAddresses;exports.BTCVaultRegistryABI=s.BTCVaultRegistryABI;exports.DaemonStatus=s.DaemonStatus;exports.JSON_RPC_ERROR_CODES=s.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=s.JsonRpcClient;exports.JsonRpcError=s.JsonRpcError;exports.POST_WOTS_STATUSES=s.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=s.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=s.RpcErrorCode;exports.VP_TERMINAL_STATUSES=s.VP_TERMINAL_STATUSES;exports.VP_TRANSIENT_STATUSES=s.VP_TRANSIENT_STATUSES;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/tbv/index.js CHANGED
@@ -1,102 +1,136 @@
1
- import { j as e, h as t, i as r, d as o, a as i, b as n, g as T, c as P, e as u, f as p } from "../challengeAssert-k5_LWUtO.js";
2
- import { computeMinClaimValue as E, deriveVaultId as S } from "@babylonlabs-io/babylon-tbv-rust-wasm";
3
- import { b as _, c, e as g } from "../payout-Ce9vSs9e.js";
4
- import { B as A, D as x, F as b, L as m, M as f, P as I, c as O, S as y, T as C, W as U, d as h, a as F, e as N, g as D, h as L, i as M, b as V, f as H, p as B, r as W, s as v, t as k, u as w, v as K } from "../constants-Q7v2O7Ps.js";
5
- import { B as G, c as Y, g as J, d as Z, b as j, s as z, a as q } from "../psbtInputFields-DO0ELwiv.js";
6
- import { f as $, p as aa } from "../fundPeginTransaction-DpwnDslW.js";
7
- import { c as ea } from "../signing-Drwr3bXB.js";
8
- import { C as ra, P as oa, c as ia, d as na, a as Ta, e as Pa, g as ua, h as pa, i as da, b as Ea, k as Sa, m as la } from "../errors-DARTQrP3.js";
9
- import { P as ca, p as ga, a as Ra, s as Aa, w as xa } from "../signAndSubmitPayouts-CAOEAQp9.js";
10
- import { B as ma, M as fa, V as Ia, i as Oa, h as ya, g as Ca, a as Ua, b as ha, c as Fa, d as Na, e as Da, f as La, p as Ma } from "../index-qIcjkxLw.js";
11
- import { D as Ha, b as Ba, J as Wa, a as va, d as ka, P as wa, R as Ka, c as Xa, V as Ga } from "../types-D1rYwwCu.js";
1
+ import { i as e, g as t, h as o, d as r, a as i, b as l, c as n, e as u, f as P } from "../challengeAssert-D1lpvuMv.js";
2
+ import { computeMinClaimValue as c, deriveVaultId as p } from "@babylonlabs-io/babylon-tbv-rust-wasm";
3
+ import { a as g, b as S, c as A, e as E } from "../payout-DzGsAnhf.js";
4
+ import { d as m, a as _, e as b, f as x, g as f, h as I, i as v, b as U, p as C, s as y, t as h, u as O, v as V } from "../bitcoin-nOOgeRyl.js";
5
+ import { C as B, P as D, a as N, c as M, g as H } from "../signing-DeWVBl7m.js";
6
+ import { B as k, C as W, P as K, a as w, m as X, h as G, i as Y, l as J, k as j, p as Z, b as z, s as q, v as Q, g as $, d as aa, c as sa, j as ea, e as ta, f as oa, w as ra } from "../buildAndBroadcastRefund-DnTQkCgG.js";
7
+ import { B as la, D as na, F as ua, L as Pa, M as da, P as ca, a as pa, S as Ta, T as ga, W as Sa, f as Aa, b as Ea, p as Ra, r as ma } from "../fundPeginTransaction-BLYXxLBv.js";
8
+ import { B as ba, U as xa, a as fa, f as Ia, c as va, e as Ua, g as Ca, i as ya, h as ha, s as Oa, b as Va, d as Fa, v as Ba } from "../psbtInputFields-Dx41_IoI.js";
9
+ import { C as Na, P as Ma, b as Ha, c as La, a as ka, d as Wa, f as Ka, e as wa, g as Xa, h as Ga, i as Ya, j as Ja, k as ja, m as Za } from "../errors-CHY4WNi-.js";
10
+ import { A as qa, M as Qa, P as $a, V as as, i as ss, j as es, k as ts, l as os, h as rs, g as is, a as ls, b as ns, c as us, d as Ps, e as ds, f as cs, p as ps, r as Ts } from "../index-CFwoGJNQ.js";
11
+ import { B as Ss, D as As, b as Es, J as Rs, a as ms, d as _s, P as bs, R as xs, c as fs, V as Is } from "../types-DWjaqVfP.js";
12
12
  export {
13
- ma as BTCVaultRegistryABI,
14
- A as BTC_DUST_SAT,
15
- G as BitcoinScriptType,
16
- ra as CONTRACT_ERRORS,
17
- x as DUST_THRESHOLD,
18
- Ha as DaemonStatus,
19
- b as FEE_SAFETY_MARGIN,
20
- Ba as JSON_RPC_ERROR_CODES,
21
- Wa as JsonRpcClient,
22
- va as JsonRpcError,
23
- m as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
24
- f as MAX_NON_LEGACY_OUTPUT_SIZE,
25
- fa as MEMPOOL_API_URLS,
26
- I as P2TR_INPUT_SIZE,
27
- O as PEGIN_FIXED_OUTPUTS,
28
- ka as POST_WOTS_STATUSES,
29
- wa as PRE_DEPOSITOR_SIGNATURES_STATES,
30
- ca as PayoutManager,
31
- oa as PeginManager,
32
- Ka as RpcErrorCode,
33
- y as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
34
- C as TX_BUFFER_SIZE_OVERHEAD,
35
- Xa as VP_TERMINAL_STATUSES,
36
- Ga as VP_TRANSIENT_STATUSES,
37
- Ia as VaultProviderRpcClient,
38
- Oa as ViemVaultRegistryReader,
39
- ya as VpResponseValidationError,
40
- U as WALLET_RELAY_FEE_RATE_THRESHOLD,
13
+ qa as ApplicationRegistryABI,
14
+ k as BIP68NotMatureError,
15
+ Ss as BTCVaultRegistryABI,
16
+ la as BTC_DUST_SAT,
17
+ ba as BitcoinScriptType,
18
+ Na as CONTRACT_ERRORS,
19
+ W as ClaimerPegoutStatusValue,
20
+ B as ContractStatus,
21
+ na as DUST_THRESHOLD,
22
+ As as DaemonStatus,
23
+ ua as FEE_SAFETY_MARGIN,
24
+ Es as JSON_RPC_ERROR_CODES,
25
+ Rs as JsonRpcClient,
26
+ ms as JsonRpcError,
27
+ Pa as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
28
+ da as MAX_NON_LEGACY_OUTPUT_SIZE,
29
+ Qa as MEMPOOL_API_URLS,
30
+ ca as P2TR_INPUT_SIZE,
31
+ pa as PEGIN_FIXED_OUTPUTS,
32
+ _s as POST_WOTS_STATUSES,
33
+ bs as PRE_DEPOSITOR_SIGNATURES_STATES,
34
+ K as PayoutManager,
35
+ D as PeginAction,
36
+ Ma as PeginManager,
37
+ $a as ProtocolParamsABI,
38
+ xs as RpcErrorCode,
39
+ Ta as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
40
+ ga as TX_BUFFER_SIZE_OVERHEAD,
41
+ xa as UtxoNotAvailableError,
42
+ fs as VP_TERMINAL_STATUSES,
43
+ Is as VP_TRANSIENT_STATUSES,
44
+ as as VaultProviderRpcClient,
45
+ ss as ViemProtocolParamsReader,
46
+ es as ViemUniversalChallengerReader,
47
+ ts as ViemVaultKeeperReader,
48
+ os as ViemVaultRegistryReader,
49
+ rs as VpResponseValidationError,
50
+ Sa as WALLET_RELAY_FEE_RATE_THRESHOLD,
51
+ w as activateVault,
52
+ fa as assertUtxosAvailable,
53
+ X as buildAndBroadcastRefund,
41
54
  e as buildChallengeAssertPsbt,
42
55
  t as buildDepositorPayoutPsbt,
43
- r as buildNoPayoutPsbt,
44
- _ as buildPayoutPsbt,
45
- o as buildPeginInputPsbt,
56
+ o as buildNoPayoutPsbt,
57
+ g as buildPayoutPsbt,
58
+ r as buildPeginInputPsbt,
46
59
  i as buildPeginTxFromFundedPrePegin,
47
- n as buildPrePeginPsbt,
48
- T as buildRefundPsbt,
49
- Y as calculateBtcTxHash,
50
- E as computeMinClaimValue,
51
- P as computeNumLocalChallengers,
52
- ia as computeWotsPkHash,
53
- c as createPayoutScript,
54
- ea as createTaprootScriptPathSignOptions,
55
- h as deriveNativeSegwitAddress,
56
- F as deriveTaprootAddress,
57
- S as deriveVaultId,
58
- na as deriveWotsKeypair,
59
- Ta as deriveWotsPkHash,
60
- N as ensureHexPrefix,
61
- Pa as extractErrorData,
62
- g as extractPayoutSignature,
60
+ l as buildPrePeginPsbt,
61
+ S as buildRefundPsbt,
62
+ Ia as calculateBtcTxHash,
63
+ N as canPerformAction,
64
+ va as collectReservedUtxoRefs,
65
+ G as computeHashlock,
66
+ c as computeMinClaimValue,
67
+ n as computeNumLocalChallengers,
68
+ Ha as computeWotsBlockPublicKeysHash,
69
+ La as computeWotsPkHash,
70
+ A as createPayoutScript,
71
+ M as createTaprootScriptPathSignOptions,
72
+ m as deriveNativeSegwitAddress,
73
+ _ as deriveTaprootAddress,
74
+ p as deriveVaultId,
75
+ ka as deriveWotsBlockPublicKeys,
76
+ Wa as deriveWotsKeypair,
77
+ Ka as deriveWotsPkHash,
78
+ b as ensureHexPrefix,
79
+ wa as extractErrorData,
80
+ Ua as extractInputsFromTransaction,
81
+ E as extractPayoutSignature,
63
82
  u as extractPeginInputSignature,
64
- p as finalizePeginInputPsbt,
65
- $ as fundPeginTransaction,
66
- Ca as getAddressTxs,
67
- Ua as getAddressUtxos,
68
- ua as getContractErrorMessage,
69
- J as getDustThreshold,
70
- ha as getMempoolApiUrl,
71
- D as getNetwork,
72
- Fa as getNetworkFees,
73
- Z as getPsbtInputFields,
74
- j as getScriptType,
75
- Na as getTxHex,
76
- Da as getTxInfo,
77
- La as getUtxoInfo,
78
- pa as handleContractError,
79
- L as hexToUint8Array,
80
- M as isAddressFromPublicKey,
81
- da as isKnownContractError,
82
- V as isValidHex,
83
- Ea as isWotsMismatchError,
84
- Sa as keypairToPublicKey,
85
- la as mnemonicToWotsSeed,
86
- aa as parseUnfundedWasmTransaction,
87
- H as peginOutputCount,
88
- ga as pollAndSignPayouts,
89
- B as processPublicKeyToXOnly,
90
- Ma as pushTx,
91
- W as rateBasedTxBufferFee,
92
- z as selectUtxosForPegin,
93
- q as shouldAddChangeOutput,
94
- Ra as signDepositorGraph,
95
- v as stripHexPrefix,
96
- Aa as submitWotsPublicKey,
97
- k as toXOnly,
98
- w as uint8ArrayToHex,
99
- K as validateWalletPubkey,
100
- xa as waitForPeginStatus
83
+ P as finalizePeginInputPsbt,
84
+ x as formatSatoshisToBtc,
85
+ Aa as fundPeginTransaction,
86
+ is as getAddressTxs,
87
+ ls as getAddressUtxos,
88
+ Xa as getContractErrorMessage,
89
+ Ca as getDustThreshold,
90
+ ns as getMempoolApiUrl,
91
+ f as getNetwork,
92
+ us as getNetworkFees,
93
+ H as getPeginProtocolState,
94
+ ya as getPsbtInputFields,
95
+ ha as getScriptType,
96
+ Ps as getTxHex,
97
+ ds as getTxInfo,
98
+ cs as getUtxoInfo,
99
+ Ga as handleContractError,
100
+ I as hexToUint8Array,
101
+ v as isAddressFromPublicKey,
102
+ Y as isDepositAmountValid,
103
+ Ya as isKnownContractError,
104
+ J as isPegoutTerminalStatus,
105
+ j as isRecognizedPegoutStatus,
106
+ U as isValidHex,
107
+ Ja as isWotsMismatchError,
108
+ ja as keypairToPublicKey,
109
+ Za as mnemonicToWotsSeed,
110
+ Ea as parseUnfundedWasmTransaction,
111
+ Ra as peginOutputCount,
112
+ Z as pollAndSignPayouts,
113
+ C as processPublicKeyToXOnly,
114
+ ps as pushTx,
115
+ ma as rateBasedTxBufferFee,
116
+ Ts as resolveProtocolAddresses,
117
+ Oa as selectUtxosForDeposit,
118
+ Va as selectUtxosForPegin,
119
+ Fa as shouldAddChangeOutput,
120
+ z as signDepositorGraph,
121
+ y as stripHexPrefix,
122
+ q as submitWotsPublicKey,
123
+ h as toXOnly,
124
+ O as uint8ArrayToHex,
125
+ Q as validateDepositAmount,
126
+ $ as validateMultiVaultDepositInputs,
127
+ aa as validateProviderSelection,
128
+ sa as validateRemainingCapacity,
129
+ ea as validateSecretAgainstHashlock,
130
+ Ba as validateUtxosAvailable,
131
+ ta as validateVaultAmounts,
132
+ oa as validateVaultProviderPubkey,
133
+ V as validateWalletPubkey,
134
+ ra as waitForPeginStatus
101
135
  };
102
136
  //# sourceMappingURL=index.js.map