@babylonlabs-io/ts-sdk 0.2.1-rc.3 → 0.4.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 (51) hide show
  1. package/LICENSE +169 -0
  2. package/dist/{PayoutManager-rMj54HDh.js → PayoutManager-BK1jKgL5.js} +404 -361
  3. package/dist/PayoutManager-BK1jKgL5.js.map +1 -0
  4. package/dist/PayoutManager-CzKMN6xT.cjs +2 -0
  5. package/dist/PayoutManager-CzKMN6xT.cjs.map +1 -0
  6. package/dist/challengeAssert-DOa5L0kv.cjs +2 -0
  7. package/dist/challengeAssert-DOa5L0kv.cjs.map +1 -0
  8. package/dist/challengeAssert-Dvcg38_y.js +606 -0
  9. package/dist/challengeAssert-Dvcg38_y.js.map +1 -0
  10. package/dist/index.cjs +1 -1
  11. package/dist/index.js +62 -57
  12. package/dist/tbv/core/contracts/abis/BTCVaultsManager.abi.d.ts +50 -4
  13. package/dist/tbv/core/contracts/abis/BTCVaultsManager.abi.d.ts.map +1 -1
  14. package/dist/tbv/core/index.cjs +1 -1
  15. package/dist/tbv/core/index.js +62 -57
  16. package/dist/tbv/core/managers/PeginManager.d.ts +89 -48
  17. package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
  18. package/dist/tbv/core/managers/__tests__/PeginManager.test.d.ts +1 -1
  19. package/dist/tbv/core/managers/index.d.ts +4 -4
  20. package/dist/tbv/core/managers/index.d.ts.map +1 -1
  21. package/dist/tbv/core/primitives/index.cjs +1 -1
  22. package/dist/tbv/core/primitives/index.d.ts +5 -3
  23. package/dist/tbv/core/primitives/index.d.ts.map +1 -1
  24. package/dist/tbv/core/primitives/index.js +22 -18
  25. package/dist/tbv/core/primitives/psbt/__tests__/pegin.test.d.ts +1 -1
  26. package/dist/tbv/core/primitives/psbt/index.d.ts +8 -3
  27. package/dist/tbv/core/primitives/psbt/index.d.ts.map +1 -1
  28. package/dist/tbv/core/primitives/psbt/pegin.d.ts +76 -59
  29. package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
  30. package/dist/tbv/core/primitives/psbt/peginInput.d.ts +69 -0
  31. package/dist/tbv/core/primitives/psbt/peginInput.d.ts.map +1 -0
  32. package/dist/tbv/core/primitives/utils/bitcoin.d.ts +11 -0
  33. package/dist/tbv/core/primitives/utils/bitcoin.d.ts.map +1 -1
  34. package/dist/tbv/core/primitives/utils/index.d.ts +1 -1
  35. package/dist/tbv/core/primitives/utils/index.d.ts.map +1 -1
  36. package/dist/tbv/core/utils/fee/constants.d.ts +7 -0
  37. package/dist/tbv/core/utils/fee/constants.d.ts.map +1 -1
  38. package/dist/tbv/index.cjs +1 -1
  39. package/dist/tbv/index.js +62 -57
  40. package/dist/tbv/integrations/aave/clients/abis/AaveIntegrationController.abi.json.d.ts +16 -1
  41. package/dist/tbv/integrations/aave/index.cjs +1 -1
  42. package/dist/tbv/integrations/aave/index.cjs.map +1 -1
  43. package/dist/tbv/integrations/aave/index.js +3 -3
  44. package/package.json +19 -19
  45. package/dist/PayoutManager-Dg_i_S7w.cjs +0 -2
  46. package/dist/PayoutManager-Dg_i_S7w.cjs.map +0 -1
  47. package/dist/PayoutManager-rMj54HDh.js.map +0 -1
  48. package/dist/challengeAssert-34HqeVFH.cjs +0 -2
  49. package/dist/challengeAssert-34HqeVFH.cjs.map +0 -1
  50. package/dist/challengeAssert-DVErOd8l.js +0 -423
  51. package/dist/challengeAssert-DVErOd8l.js.map +0 -1
@@ -1,62 +1,67 @@
1
1
  import { computeMinClaimValue as e } from "@babylonlabs-io/babylon-tbv-rust-wasm";
2
- import { f as r, c as o, d as i, a as T, b as n, g as d, h as l, i as u, e as A, m as E, j as P, k as c, l as g, p as _, s as p, t as x, u as S, v as b } from "../../challengeAssert-DVErOd8l.js";
3
- import { x as R, B as C, e as U, C as O, D as F, F as f, L as I, M, v as h, P as m, k as B, j as H, T as L, W as N, c as D, b as v, d as k, y as w, f as W, l as V, m as X, z as Y, g as K, n as Z, o as j, i as G, h as q, q as z, t as J, u as Q, E as $, A as aa, p as sa, w as ea, r as ta, s as ra, a as oa } from "../../PayoutManager-rMj54HDh.js";
2
+ import { B as r, D as o, F as i, L as n, M as T, P as u, S as P, T as d, W as l, i as g, g as E, h as _, d as c, c as A, a as p, b as x, j as S, k as b, l as F, p as I, f as R, e as y, x as U, y as C, m as M, n as O, o as f, w as L, q as h, r as m, s as B, t as H, u as N, v as D } from "../../challengeAssert-Dvcg38_y.js";
3
+ import { q as k, B as w, C as W, M as X, h as Y, P as V, c as K, b as Z, d as j, r as q, i as G, j as z, t as J, g as Q, k as $, l as aa, f as sa, e as ea, m as ta, n as ra, o as oa, v as ia, u as na, p as Ta, s as ua, a as Pa } from "../../PayoutManager-BK1jKgL5.js";
4
4
  export {
5
- R as BTCVaultsManagerABI,
6
- C as BTC_DUST_SAT,
7
- U as BitcoinScriptType,
8
- O as CONTRACT_ERRORS,
9
- F as DUST_THRESHOLD,
10
- f as FEE_SAFETY_MARGIN,
11
- I as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
12
- M as MAX_NON_LEGACY_OUTPUT_SIZE,
13
- h as MEMPOOL_API_URLS,
14
- m as P2TR_INPUT_SIZE,
15
- B as PayoutManager,
16
- H as PeginManager,
17
- L as TX_BUFFER_SIZE_OVERHEAD,
18
- N as WALLET_RELAY_FEE_RATE_THRESHOLD,
19
- r as buildChallengeAssertPsbt,
20
- o as buildDepositorPayoutPsbt,
21
- i as buildNoPayoutPsbt,
22
- T as buildPayoutPsbt,
23
- n as buildPeginPsbt,
24
- D as calculateBtcTxHash,
5
+ k as BTCVaultsManagerABI,
6
+ r as BTC_DUST_SAT,
7
+ w as BitcoinScriptType,
8
+ W as CONTRACT_ERRORS,
9
+ o as DUST_THRESHOLD,
10
+ i as FEE_SAFETY_MARGIN,
11
+ n as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
12
+ T as MAX_NON_LEGACY_OUTPUT_SIZE,
13
+ X as MEMPOOL_API_URLS,
14
+ u as P2TR_INPUT_SIZE,
15
+ Y as PayoutManager,
16
+ V as PeginManager,
17
+ P as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
18
+ d as TX_BUFFER_SIZE_OVERHEAD,
19
+ l as WALLET_RELAY_FEE_RATE_THRESHOLD,
20
+ g as buildChallengeAssertPsbt,
21
+ E as buildDepositorPayoutPsbt,
22
+ _ as buildNoPayoutPsbt,
23
+ c as buildPayoutPsbt,
24
+ A as buildPeginInputPsbt,
25
+ p as buildPeginTxFromFundedPrePegin,
26
+ x as buildPrePeginPsbt,
27
+ K as calculateBtcTxHash,
25
28
  e as computeMinClaimValue,
26
- d as createPayoutScript,
27
- v as createSplitTransaction,
28
- k as createSplitTransactionPsbt,
29
- l as deriveNativeSegwitAddress,
30
- u as deriveTaprootAddress,
31
- w as extractErrorData,
32
- A as extractPayoutSignature,
33
- W as fundPeginTransaction,
34
- V as getAddressTxs,
35
- X as getAddressUtxos,
36
- Y as getContractErrorMessage,
37
- K as getDustThreshold,
38
- Z as getMempoolApiUrl,
39
- E as getNetwork,
40
- j as getNetworkFees,
41
- G as getPsbtInputFields,
42
- q as getScriptType,
43
- z as getTxHex,
44
- J as getTxInfo,
45
- Q as getUtxoInfo,
46
- $ as handleContractError,
47
- P as hexToUint8Array,
48
- c as isAddressFromPublicKey,
49
- aa as isKnownContractError,
50
- g as isValidHex,
51
- sa as parseUnfundedWasmTransaction,
52
- _ as processPublicKeyToXOnly,
53
- ea as pushTx,
54
- ta as rateBasedTxBufferFee,
55
- ra as selectUtxosForPegin,
56
- oa as shouldAddChangeOutput,
57
- p as stripHexPrefix,
58
- x as toXOnly,
59
- S as uint8ArrayToHex,
60
- b as validateWalletPubkey
29
+ S as createPayoutScript,
30
+ Z as createSplitTransaction,
31
+ j as createSplitTransactionPsbt,
32
+ b as deriveNativeSegwitAddress,
33
+ F as deriveTaprootAddress,
34
+ I as ensureHexPrefix,
35
+ q as extractErrorData,
36
+ R as extractPayoutSignature,
37
+ y as extractPeginInputSignature,
38
+ U as fundPeginTransaction,
39
+ G as getAddressTxs,
40
+ z as getAddressUtxos,
41
+ J as getContractErrorMessage,
42
+ Q as getDustThreshold,
43
+ $ as getMempoolApiUrl,
44
+ C as getNetwork,
45
+ aa as getNetworkFees,
46
+ sa as getPsbtInputFields,
47
+ ea as getScriptType,
48
+ ta as getTxHex,
49
+ ra as getTxInfo,
50
+ oa as getUtxoInfo,
51
+ ia as handleContractError,
52
+ M as hexToUint8Array,
53
+ O as isAddressFromPublicKey,
54
+ na as isKnownContractError,
55
+ f as isValidHex,
56
+ L as parseUnfundedWasmTransaction,
57
+ h as processPublicKeyToXOnly,
58
+ Ta as pushTx,
59
+ m as rateBasedTxBufferFee,
60
+ ua as selectUtxosForPegin,
61
+ Pa as shouldAddChangeOutput,
62
+ B as stripHexPrefix,
63
+ H as toXOnly,
64
+ N as uint8ArrayToHex,
65
+ D as validateWalletPubkey
61
66
  };
62
67
  //# sourceMappingURL=index.js.map
@@ -42,17 +42,13 @@ export interface PeginManagerConfig {
42
42
  mempoolApiUrl: string;
43
43
  }
44
44
  /**
45
- * Parameters for creating a peg-in transaction.
45
+ * Parameters for the atomic swap pegin flow (pre-pegin + pegin transactions).
46
46
  */
47
- export interface CreatePeginParams {
47
+ export interface CreateAtomicPeginParams {
48
48
  /**
49
49
  * Amount to peg in (in satoshis).
50
50
  */
51
51
  amount: bigint;
52
- /**
53
- * Vault provider's Ethereum address.
54
- */
55
- vaultProvider: Address;
56
52
  /**
57
53
  * Vault provider's BTC public key (x-only, 64-char hex).
58
54
  * Can be provided with or without "0x" prefix (will be stripped automatically).
@@ -62,54 +58,92 @@ export interface CreatePeginParams {
62
58
  * Vault keeper BTC public keys (x-only, 64-char hex).
63
59
  * Can be provided with or without "0x" prefix (will be stripped automatically).
64
60
  */
65
- vaultKeeperBtcPubkeys: string[];
61
+ vaultKeeperBtcPubkeys: readonly string[];
66
62
  /**
67
63
  * Universal challenger BTC public keys (x-only, 64-char hex).
68
64
  * Can be provided with or without "0x" prefix (will be stripped automatically).
69
65
  */
70
- universalChallengerBtcPubkeys: string[];
66
+ universalChallengerBtcPubkeys: readonly string[];
71
67
  /**
72
- * CSV timelock in blocks for the PegIn output.
68
+ * CSV timelock in blocks for the PegIn vault output.
73
69
  */
74
70
  timelockPegin: number;
75
71
  /**
76
- * Amount in satoshis for the depositor's claim output.
72
+ * CSV timelock in blocks for the Pre-PegIn HTLC refund path.
77
73
  */
78
- depositorClaimValue: bigint;
74
+ timelockRefund: number;
79
75
  /**
80
- * Available UTXOs from the depositor's wallet for funding the transaction.
76
+ * SHA256 hash commitment for the HTLC (64 hex chars = 32 bytes).
77
+ * Generated by the depositor as H = SHA256(secret).
81
78
  */
82
- availableUTXOs: UTXO[];
79
+ hashH: string;
83
80
  /**
84
- * Fee rate in satoshis per vbyte for the transaction.
81
+ * Fee rate in satoshis per vbyte for the Pre-PegIn transaction.
85
82
  */
86
83
  feeRate: number;
87
84
  /**
88
- * Bitcoin address for receiving change from the transaction.
85
+ * Number of local challengers (from contract params).
86
+ */
87
+ numLocalChallengers: number;
88
+ /**
89
+ * M in M-of-N council multisig (from contract params).
90
+ */
91
+ councilQuorum: number;
92
+ /**
93
+ * N in M-of-N council multisig (from contract params).
94
+ */
95
+ councilSize: number;
96
+ /**
97
+ * Available UTXOs from the depositor's wallet for funding the Pre-PegIn transaction.
98
+ */
99
+ availableUTXOs: readonly UTXO[];
100
+ /**
101
+ * Bitcoin address for receiving change from the Pre-PegIn transaction.
89
102
  */
90
103
  changeAddress: string;
91
104
  }
92
105
  /**
93
- * Result of a peg-in preparation.
106
+ * Result of preparing an atomic swap pegin.
94
107
  */
95
- export interface PeginResult {
108
+ export interface AtomicPeginResult {
109
+ /**
110
+ * Funded but unsigned Pre-PegIn transaction hex.
111
+ * Sign and broadcast this AFTER registering on Ethereum.
112
+ */
113
+ fundedPrePeginTxHex: string;
96
114
  /**
97
- * Bitcoin transaction hash (without 0x prefix).
98
- * This is the hash of the unsigned transaction and will NOT change after signing.
99
- * Used as the unique vault identifier in the contract.
115
+ * Pre-PegIn HTLC value in satoshis (amount the UTXOs cover).
100
116
  */
101
- btcTxHash: string;
117
+ htlcValue: bigint;
102
118
  /**
103
- * Funded but unsigned transaction hex.
104
- * This transaction has inputs and outputs but is not yet signed.
119
+ * PegIn transaction hex with depositor's HTLC leaf 0 signature embedded in the PSBT.
120
+ * Submit the extracted signature to the vault provider.
105
121
  */
106
- fundedTxHex: string;
122
+ signedPeginInputPsbtHex: string;
107
123
  /**
108
- * Vault script pubkey hex.
124
+ * Depositor's Schnorr signature over PegIn input 0 (HTLC leaf 0), 128 hex chars.
125
+ * This is submitted to the contract via the VP's signPeginInput batch.
126
+ */
127
+ peginInputSignature: string;
128
+ /**
129
+ * Vault script pubkey hex — used in the ETH registration call.
109
130
  */
110
131
  vaultScriptPubKey: string;
111
132
  /**
112
- * UTXOs selected for funding the transaction.
133
+ * Funded Pre-PegIn transaction ID.
134
+ */
135
+ prePeginTxid: string;
136
+ /**
137
+ * PegIn transaction hex. Pass to registerPeginOnChain as `depositorSignedPeginTx`
138
+ * so the contract computes the correct vault ID from the pegin txid.
139
+ */
140
+ peginTxHex: string;
141
+ /**
142
+ * PegIn transaction ID (stable — signing does not change it).
143
+ */
144
+ peginTxid: string;
145
+ /**
146
+ * UTXOs selected to fund the Pre-PegIn transaction.
113
147
  */
114
148
  selectedUTXOs: UTXO[];
115
149
  /**
@@ -120,20 +154,15 @@ export interface PeginResult {
120
154
  * Change amount in satoshis (if any).
121
155
  */
122
156
  changeAmount: bigint;
123
- /**
124
- * Ethereum transaction hash (peg-in registration).
125
- * Will be null until registerPeginOnChain is called.
126
- */
127
- ethTxHash: Hash | null;
128
157
  }
129
158
  /**
130
159
  * Parameters for signing and broadcasting a transaction.
131
160
  */
132
161
  export interface SignAndBroadcastParams {
133
162
  /**
134
- * Funded transaction hex from preparePegin().
163
+ * Funded Pre-PegIn transaction hex from prepareAtomicPegin().
135
164
  */
136
- fundedTxHex: string;
165
+ fundedPrePeginTxHex: string;
137
166
  /**
138
167
  * Depositor's BTC public key (x-only, 64-char hex).
139
168
  * Can be provided with or without "0x" prefix.
@@ -151,13 +180,21 @@ export interface RegisterPeginParams {
151
180
  */
152
181
  depositorBtcPubkey: string;
153
182
  /**
154
- * Funded but unsigned BTC transaction hex.
183
+ * Unsigned Pre-PegIn transaction hex (submitted to contract for data availability).
155
184
  */
156
- unsignedBtcTx: string;
185
+ unsignedPrePeginTx: string;
186
+ /**
187
+ * Depositor-signed PegIn transaction hex (submitted to contract; vault ID derived from this).
188
+ */
189
+ depositorSignedPeginTx: string;
157
190
  /**
158
191
  * Vault provider's Ethereum address.
159
192
  */
160
193
  vaultProvider: Address;
194
+ /**
195
+ * SHA256 hashlock for atomic swap activation (bytes32 hex with 0x prefix).
196
+ */
197
+ hashlock: Hex;
161
198
  /**
162
199
  * Optional callback invoked after PoP signing completes but before ETH transaction.
163
200
  */
@@ -212,14 +249,14 @@ export interface RegisterPeginResult {
212
249
  * by coordinating between SDK primitives, utilities, and wallet interfaces.
213
250
  *
214
251
  * @remarks
215
- * The complete peg-in flow consists of 4 steps:
252
+ * The complete atomic swap peg-in flow consists of 4 steps:
216
253
  *
217
254
  * | Step | Method | Description |
218
255
  * |------|--------|-------------|
219
- * | 1 | {@link preparePegin} | Build and fund the transaction |
256
+ * | 1 | {@link prepareAtomicPegin} | Build Pre-PegIn HTLC, fund it, sign PegIn input |
220
257
  * | 2 | {@link registerPeginOnChain} | Submit to Ethereum contract with PoP |
221
258
  * | 3 | {@link PayoutManager} | Sign BOTH payout authorizations |
222
- * | 4 | {@link signAndBroadcast} | Sign and broadcast to Bitcoin network |
259
+ * | 4 | {@link signAndBroadcast} | Sign and broadcast Pre-PegIn tx to Bitcoin network |
223
260
  *
224
261
  * **Important:** Step 3 uses {@link PayoutManager}, not this class. After step 2,
225
262
  * the vault provider prepares 3 transactions per claimer:
@@ -233,7 +270,7 @@ export interface RegisterPeginResult {
233
270
  * Submit all signatures to the vault provider before proceeding to step 4.
234
271
  *
235
272
  * @see {@link PayoutManager} - Required for Step 3 (payout authorization)
236
- * @see {@link buildPeginPsbt} - Lower-level primitive for custom implementations
273
+ * @see {@link buildPrePeginPsbt} - Lower-level primitive for custom implementations
237
274
  * @see {@link https://github.com/babylonlabs-io/babylon-toolkit/blob/main/packages/babylon-ts-sdk/docs/quickstart/managers.md | Managers Quickstart}
238
275
  */
239
276
  export declare class PeginManager {
@@ -245,22 +282,26 @@ export declare class PeginManager {
245
282
  */
246
283
  constructor(config: PeginManagerConfig);
247
284
  /**
248
- * Prepares a peg-in transaction by building and funding it.
285
+ * Prepares an atomic swap peg-in by building the Pre-PegIn HTLC transaction,
286
+ * funding it, constructing the PegIn transaction, and signing the PegIn input.
249
287
  *
250
288
  * This method orchestrates the following steps:
251
289
  * 1. Get depositor BTC public key from wallet
252
- * 2. Build unfunded PSBT using primitives
253
- * 3. Select UTXOs using iterative fee calculation
254
- * 4. Fund transaction by adding inputs and change output
290
+ * 2. Build unfunded Pre-PegIn transaction (HTLC output) using primitives
291
+ * 3. Select UTXOs to cover the HTLC value
292
+ * 4. Fund the Pre-PegIn transaction
293
+ * 5. Derive the PegIn transaction from the funded Pre-PegIn txid
294
+ * 6. Build PSBT for signing the PegIn input (HTLC leaf 0)
295
+ * 7. Sign via BTC wallet and extract depositor signature
255
296
  *
256
- * The returned transaction is funded but unsigned. Use `signAndBroadcast()`
257
- * to complete the Bitcoin side, and `registerPeginOnChain()` for Ethereum.
297
+ * The returned `fundedPrePeginTxHex` is funded but unsigned (inputs unsigned).
298
+ * Use `signAndBroadcast()` AFTER registering on Ethereum to broadcast it.
258
299
  *
259
- * @param params - Peg-in parameters including amount, provider, UTXOs, and fee rate
260
- * @returns Peg-in result with funded transaction and selection details
300
+ * @param params - Atomic pegin parameters including amount, HTLC params, UTXOs
301
+ * @returns Atomic pegin result with funded Pre-PegIn tx, signed PegIn input, and signatures
261
302
  * @throws Error if wallet operations fail or insufficient funds
262
303
  */
263
- preparePegin(params: CreatePeginParams): Promise<PeginResult>;
304
+ prepareAtomicPegin(params: CreateAtomicPeginParams): Promise<AtomicPeginResult>;
264
305
  /**
265
306
  * Signs and broadcasts a funded peg-in transaction to the Bitcoin network.
266
307
  *
@@ -1 +1 @@
1
- {"version":3,"file":"PeginManager.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/PeginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,EAKL,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,GAAG,EACR,KAAK,YAAY,EAClB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AACtF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mDAAmD,CAAC;AAG9E,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAK7D,OAAO,EAML,KAAK,IAAI,EACV,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,aAAa,CAAC;IAEzB;;;OAGG;IACH,SAAS,EAAE,YAAY,CAAC;IAExB;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC;IAEhB;;OAEG;IACH,cAAc,EAAE;QACd;;WAEG;QACH,gBAAgB,EAAE,OAAO,CAAC;KAC3B,CAAC;IAEF;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;;OAGG;IACH,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAEhC;;;OAGG;IACH,6BAA6B,EAAE,MAAM,EAAE,CAAC;IAEx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;;GA8BG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAE5C;;;;OAIG;gBACS,MAAM,EAAE,kBAAkB;IAItC;;;;;;;;;;;;;;;;;;;OAmBG;IACG,kBAAkB,CACtB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,iBAAiB,CAAC;IAiH7B;;;;;;;;;;;;;;OAcG;IACG,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IA2GvE;;;;;;;;;;;;;;;;OAgBG;IACG,oBAAoB,CACxB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC;IAgI/B;;;;;OAKG;YACW,gBAAgB;IAuB9B;;;;;;OAMG;YACW,yBAAyB;IAmCvC;;;;;OAKG;YACW,mBAAmB;IAwBjC;;;;OAIG;IACH,UAAU,IAAI,OAAO;IAIrB;;;;OAIG;IACH,uBAAuB,IAAI,OAAO;CAGnC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Tests for PeginManager
3
3
  *
4
- * Tests the manager's ability to orchestrate peg-in operations
4
+ * Tests the manager's ability to orchestrate atomic swap peg-in operations
5
5
  * using primitives, utilities, and mock wallets.
6
6
  */
7
7
  export {};
@@ -35,8 +35,8 @@
35
35
  * ## Available Managers
36
36
  *
37
37
  * ### {@link PeginManager}
38
- * Orchestrates the peg-in deposit flow:
39
- * - {@link PeginManager.preparePegin | preparePegin()} - Build and fund transaction
38
+ * Orchestrates the atomic swap peg-in flow:
39
+ * - {@link PeginManager.prepareAtomicPegin | prepareAtomicPegin()} - Build Pre-PegIn HTLC and sign PegIn input
40
40
  * - {@link PeginManager.registerPeginOnChain | registerPeginOnChain()} - Submit to Ethereum
41
41
  * - {@link PeginManager.signAndBroadcast | signAndBroadcast()} - Broadcast to Bitcoin
42
42
  *
@@ -50,7 +50,7 @@
50
50
  *
51
51
  * | Step | Manager | Method |
52
52
  * |------|---------|--------|
53
- * | 1 | PeginManager | `preparePegin()` |
53
+ * | 1 | PeginManager | `prepareAtomicPegin()` |
54
54
  * | 2 | PeginManager | `registerPeginOnChain()` |
55
55
  * | 3 | PayoutManager | `signPayoutTransaction()` |
56
56
  * | 4 | PeginManager | `signAndBroadcast()` |
@@ -67,7 +67,7 @@
67
67
  * @module managers
68
68
  */
69
69
  export { PeginManager } from './PeginManager';
70
- export type { CreatePeginParams, PeginManagerConfig, PeginResult, RegisterPeginParams, RegisterPeginResult, SignAndBroadcastParams, } from './PeginManager';
70
+ export type { AtomicPeginResult, CreateAtomicPeginParams, PeginManagerConfig, RegisterPeginParams, RegisterPeginResult, SignAndBroadcastParams, } from './PeginManager';
71
71
  export { PayoutManager } from './PayoutManager';
72
72
  export type { PayoutManagerConfig, PayoutSignatureResult, SignPayoutParams, } from './PayoutManager';
73
73
  export type { UTXO } from '../utils/utxo/selectUtxos';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACtD,YAAY,EACV,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,MAAM,kDAAkD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACtD,YAAY,EACV,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,MAAM,kDAAkD,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@babylonlabs-io/babylon-tbv-rust-wasm"),e=require("../../../challengeAssert-34HqeVFH.cjs");Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>t.computeMinClaimValue});exports.buildChallengeAssertPsbt=e.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=e.buildDepositorPayoutPsbt;exports.buildNoPayoutPsbt=e.buildNoPayoutPsbt;exports.buildPayoutPsbt=e.buildPayoutPsbt;exports.buildPeginPsbt=e.buildPeginPsbt;exports.createPayoutScript=e.createPayoutScript;exports.deriveNativeSegwitAddress=e.deriveNativeSegwitAddress;exports.deriveTaprootAddress=e.deriveTaprootAddress;exports.extractPayoutSignature=e.extractPayoutSignature;exports.hexToUint8Array=e.hexToUint8Array;exports.isAddressFromPublicKey=e.isAddressFromPublicKey;exports.isValidHex=e.isValidHex;exports.processPublicKeyToXOnly=e.processPublicKeyToXOnly;exports.stripHexPrefix=e.stripHexPrefix;exports.toXOnly=e.toXOnly;exports.uint8ArrayToHex=e.uint8ArrayToHex;exports.validateWalletPubkey=e.validateWalletPubkey;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@babylonlabs-io/babylon-tbv-rust-wasm"),e=require("../../../challengeAssert-DOa5L0kv.cjs");Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>t.computeMinClaimValue});exports.buildChallengeAssertPsbt=e.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=e.buildDepositorPayoutPsbt;exports.buildNoPayoutPsbt=e.buildNoPayoutPsbt;exports.buildPayoutPsbt=e.buildPayoutPsbt;exports.buildPeginInputPsbt=e.buildPeginInputPsbt;exports.buildPeginTxFromFundedPrePegin=e.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=e.buildPrePeginPsbt;exports.createPayoutScript=e.createPayoutScript;exports.deriveNativeSegwitAddress=e.deriveNativeSegwitAddress;exports.deriveTaprootAddress=e.deriveTaprootAddress;exports.ensureHexPrefix=e.ensureHexPrefix;exports.extractPayoutSignature=e.extractPayoutSignature;exports.extractPeginInputSignature=e.extractPeginInputSignature;exports.hexToUint8Array=e.hexToUint8Array;exports.isAddressFromPublicKey=e.isAddressFromPublicKey;exports.isValidHex=e.isValidHex;exports.processPublicKeyToXOnly=e.processPublicKeyToXOnly;exports.stripHexPrefix=e.stripHexPrefix;exports.toXOnly=e.toXOnly;exports.uint8ArrayToHex=e.uint8ArrayToHex;exports.validateWalletPubkey=e.validateWalletPubkey;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -71,8 +71,10 @@
71
71
  export type { Network } from '@babylonlabs-io/babylon-tbv-rust-wasm';
72
72
  export { computeMinClaimValue } from '@babylonlabs-io/babylon-tbv-rust-wasm';
73
73
  export type { AssertPayoutNoPayoutConnectorParams, ChallengeAssertConnectorParams, PayoutConnectorParams, } from '@babylonlabs-io/babylon-tbv-rust-wasm';
74
- export { buildPeginPsbt } from './psbt/pegin';
75
- export type { PeginParams, PeginPsbtResult } from './psbt/pegin';
74
+ export { buildPrePeginPsbt, buildPeginTxFromFundedPrePegin } from './psbt/pegin';
75
+ export type { PrePeginParams, PrePeginPsbtResult, BuildPeginTxParams, PeginTxResult, } from './psbt/pegin';
76
+ export { buildPeginInputPsbt, extractPeginInputSignature } from './psbt/peginInput';
77
+ export type { BuildPeginInputPsbtParams, BuildPeginInputPsbtResult, } from './psbt/peginInput';
76
78
  export { buildPayoutPsbt, extractPayoutSignature } from './psbt/payout';
77
79
  export type { PayoutParams, PayoutPsbtResult } from './psbt/payout';
78
80
  export { buildDepositorPayoutPsbt } from './psbt/depositorPayout';
@@ -83,5 +85,5 @@ export { buildChallengeAssertPsbt } from './psbt/challengeAssert';
83
85
  export type { ChallengeAssertParams } from './psbt/challengeAssert';
84
86
  export { createPayoutScript } from './scripts/payout';
85
87
  export type { PayoutScriptParams, PayoutScriptResult } from './scripts/payout';
86
- export { deriveNativeSegwitAddress, deriveTaprootAddress, hexToUint8Array, isAddressFromPublicKey, isValidHex, processPublicKeyToXOnly, stripHexPrefix, toXOnly, uint8ArrayToHex, validateWalletPubkey, type WalletPubkeyValidationResult, } from './utils/bitcoin';
88
+ export { deriveNativeSegwitAddress, deriveTaprootAddress, hexToUint8Array, isAddressFromPublicKey, isValidHex, ensureHexPrefix, processPublicKeyToXOnly, stripHexPrefix, toXOnly, uint8ArrayToHex, validateWalletPubkey, type WalletPubkeyValidationResult, } from './utils/bitcoin';
87
89
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/primitives/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AAGH,YAAY,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;A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, g as d, h as P, i as b, e as y, j as p, k as c, l as n, p as x, s as A, t as g, u as m, v } from "../../../challengeAssert-DVErOd8l.js";
1
+ import { computeMinClaimValue as s } from "@babylonlabs-io/babylon-tbv-rust-wasm";
2
+ import { i, g as r, h as u, d as o, c as P, a as d, b as l, j as n, k as b, l as x, p as y, f as p, e as g, m as c, n as m, o as A, q as f, s as v, t as T, u as H, v as S } from "../../../challengeAssert-Dvcg38_y.js";
3
3
  export {
4
4
  i as buildChallengeAssertPsbt,
5
5
  r as buildDepositorPayoutPsbt,
6
- o as buildNoPayoutPsbt,
7
- l as buildPayoutPsbt,
8
- u as buildPeginPsbt,
9
- e as computeMinClaimValue,
10
- d as createPayoutScript,
11
- P as deriveNativeSegwitAddress,
12
- b as deriveTaprootAddress,
13
- y as extractPayoutSignature,
14
- p as hexToUint8Array,
15
- c as isAddressFromPublicKey,
16
- n as isValidHex,
17
- x as processPublicKeyToXOnly,
18
- A as stripHexPrefix,
19
- g as toXOnly,
20
- m as uint8ArrayToHex,
21
- v as validateWalletPubkey
6
+ u as buildNoPayoutPsbt,
7
+ o as buildPayoutPsbt,
8
+ P as buildPeginInputPsbt,
9
+ d as buildPeginTxFromFundedPrePegin,
10
+ l as buildPrePeginPsbt,
11
+ s as computeMinClaimValue,
12
+ n as createPayoutScript,
13
+ b as deriveNativeSegwitAddress,
14
+ x as deriveTaprootAddress,
15
+ y as ensureHexPrefix,
16
+ p as extractPayoutSignature,
17
+ g as extractPeginInputSignature,
18
+ c as hexToUint8Array,
19
+ m as isAddressFromPublicKey,
20
+ A as isValidHex,
21
+ f as processPublicKeyToXOnly,
22
+ v as stripHexPrefix,
23
+ T as toXOnly,
24
+ H as uint8ArrayToHex,
25
+ S as validateWalletPubkey
22
26
  };
23
27
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Tests for buildPeginPsbt primitive function
2
+ * Tests for buildPrePeginPsbt and buildPeginTxFromFundedPrePegin primitives
3
3
  */
4
4
  export {};
5
5
  //# sourceMappingURL=pegin.test.d.ts.map
@@ -5,7 +5,10 @@
5
5
  * These functions wrap the WASM implementation with a clean TypeScript API.
6
6
  *
7
7
  * Exports:
8
- * - {@link buildPeginPsbt} - Create unfunded peg-in transaction
8
+ * - {@link buildPrePeginPsbt} - Create unfunded Pre-PegIn transaction (HTLC output)
9
+ * - {@link buildPeginTxFromFundedPrePegin} - Derive PegIn tx from funded Pre-PegIn txid
10
+ * - {@link buildPeginInputPsbt} - Create PSBT for depositor to sign PegIn HTLC leaf 0 input
11
+ * - {@link extractPeginInputSignature} - Extract depositor signature from signed PegIn input PSBT
9
12
  * - {@link buildPayoutPsbt} - Create payout PSBT for signing
10
13
  * - {@link extractPayoutSignature} - Extract Schnorr signature from signed PSBT
11
14
  * - {@link buildDepositorPayoutPsbt} - Create depositor's own Payout PSBT (depositor-as-claimer path)
@@ -14,8 +17,10 @@
14
17
  *
15
18
  * @module primitives/psbt
16
19
  */
17
- export { buildPeginPsbt } from './pegin';
18
- export type { PeginParams, PeginPsbtResult } from './pegin';
20
+ export { buildPrePeginPsbt, buildPeginTxFromFundedPrePegin } from './pegin';
21
+ export type { PrePeginParams, PrePeginPsbtResult, BuildPeginTxParams, PeginTxResult, } from './pegin';
22
+ export { buildPeginInputPsbt, extractPeginInputSignature } from './peginInput';
23
+ export type { BuildPeginInputPsbtParams, BuildPeginInputPsbtResult, } from './peginInput';
19
24
  export { buildPayoutPsbt, extractPayoutSignature } from './payout';
20
25
  export type { PayoutParams, PayoutPsbtResult } from './payout';
21
26
  export { buildDepositorPayoutPsbt } from './depositorPayout';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE5D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