@babylonlabs-io/ts-sdk 0.4.1-rc.2 → 0.7.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.
- package/LICENSE +169 -0
- package/README.md +1 -1
- package/dist/{PayoutManager-B8vLG1dE.js → PayoutManager-BVmU4UsM.js} +213 -170
- package/dist/PayoutManager-BVmU4UsM.js.map +1 -0
- package/dist/PayoutManager-Ba6cNgHC.cjs +2 -0
- package/dist/PayoutManager-Ba6cNgHC.cjs.map +1 -0
- package/dist/{challengeAssert-ZXE00zkT.js → challengeAssert-D50t_Qyo.js} +96 -74
- package/dist/challengeAssert-D50t_Qyo.js.map +1 -0
- package/dist/challengeAssert-DDceAi0r.cjs +2 -0
- package/dist/challengeAssert-DDceAi0r.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -53
- package/dist/index.js.map +1 -1
- package/dist/tbv/core/contracts/abis/{BTCVaultsManager.abi.d.ts → BTCVaultRegistry.abi.d.ts} +41 -9
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -0
- package/dist/tbv/core/contracts/index.d.ts +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +51 -49
- package/dist/tbv/core/managers/PeginManager.d.ts +21 -20
- package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
- package/dist/tbv/core/managers/__tests__/PeginManager.test.d.ts +1 -1
- package/dist/tbv/core/managers/index.d.ts +4 -4
- package/dist/tbv/core/managers/index.d.ts.map +1 -1
- package/dist/tbv/core/primitives/index.cjs +1 -1
- package/dist/tbv/core/primitives/index.d.ts +2 -2
- package/dist/tbv/core/primitives/index.d.ts.map +1 -1
- package/dist/tbv/core/primitives/index.js +19 -17
- package/dist/tbv/core/primitives/psbt/pegin.d.ts +11 -8
- package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/peginInput.d.ts +11 -1
- package/dist/tbv/core/primitives/psbt/peginInput.d.ts.map +1 -1
- package/dist/tbv/core/utils/transaction/btcTxHash.d.ts +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +51 -49
- package/dist/tbv/integrations/aave/clients/abis/AaveIntegrationController.abi.json.d.ts +7 -2
- package/dist/tbv/integrations/aave/index.cjs +1 -1
- package/dist/tbv/integrations/aave/index.cjs.map +1 -1
- package/dist/tbv/integrations/aave/index.js +3 -3
- package/package.json +19 -19
- package/dist/PayoutManager-B8vLG1dE.js.map +0 -1
- package/dist/PayoutManager-Shw7TY5P.cjs +0 -2
- package/dist/PayoutManager-Shw7TY5P.cjs.map +0 -1
- package/dist/challengeAssert-ClJYoKxJ.cjs +0 -2
- package/dist/challengeAssert-ClJYoKxJ.cjs.map +0 -1
- package/dist/challengeAssert-ZXE00zkT.js.map +0 -1
- package/dist/tbv/core/contracts/abis/BTCVaultsManager.abi.d.ts.map +0 -1
package/dist/tbv/core/index.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { B as e, D as t, F as r, L as
|
|
2
|
-
import { computeMinClaimValue as
|
|
3
|
-
import { q as
|
|
1
|
+
import { B as e, D as t, F as r, L as i, M as o, P as n, S as T, T as u, W as P, k as l, i as d, j as g, g as E, d as _, a as c, b as A, c as p, l as x, m as S, n as b, r as I, h as R, e as y, f as C, z as F, A as U, o as L, p as O, q as f, y as m, s as M, x as h, t as H, u as N, v as B, w as D } from "../../challengeAssert-D50t_Qyo.js";
|
|
2
|
+
import { SINGLE_DEPOSIT_HTLC_VOUT as k, computeMinClaimValue as w } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
|
+
import { q as W, B as X, C as Y, M as G, h as K, P as Z, c as j, b as q, d as z, r as J, i as Q, j as $, t as aa, g as sa, k as ea, l as ta, f as ra, e as ia, m as oa, n as na, o as Ta, v as ua, u as Pa, p as la, s as da, a as ga } from "../../PayoutManager-BVmU4UsM.js";
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
W as BTCVaultRegistryABI,
|
|
6
6
|
e as BTC_DUST_SAT,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
X as BitcoinScriptType,
|
|
8
|
+
Y as CONTRACT_ERRORS,
|
|
9
9
|
t as DUST_THRESHOLD,
|
|
10
10
|
r as FEE_SAFETY_MARGIN,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
i as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
12
|
+
o as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
13
|
+
G as MEMPOOL_API_URLS,
|
|
14
14
|
n as P2TR_INPUT_SIZE,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
K as PayoutManager,
|
|
16
|
+
Z as PeginManager,
|
|
17
|
+
k as SINGLE_DEPOSIT_HTLC_VOUT,
|
|
17
18
|
T as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
18
19
|
u as TX_BUFFER_SIZE_OVERHEAD,
|
|
19
20
|
P as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
@@ -21,48 +22,49 @@ export {
|
|
|
21
22
|
d as buildDepositorPayoutPsbt,
|
|
22
23
|
g as buildNoPayoutPsbt,
|
|
23
24
|
E as buildPayoutPsbt,
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
_ as buildPeginInputPsbt,
|
|
26
|
+
c as buildPeginTxFromFundedPrePegin,
|
|
26
27
|
A as buildPrePeginPsbt,
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
j as calculateBtcTxHash,
|
|
29
|
+
w as computeMinClaimValue,
|
|
29
30
|
p as computeNumLocalChallengers,
|
|
30
31
|
x as createPayoutScript,
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
q as createSplitTransaction,
|
|
33
|
+
z as createSplitTransactionPsbt,
|
|
33
34
|
S as deriveNativeSegwitAddress,
|
|
34
35
|
b as deriveTaprootAddress,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
oa as
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
L as
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
36
|
+
I as ensureHexPrefix,
|
|
37
|
+
J as extractErrorData,
|
|
38
|
+
R as extractPayoutSignature,
|
|
39
|
+
y as extractPeginInputSignature,
|
|
40
|
+
C as finalizePeginInputPsbt,
|
|
41
|
+
F as fundPeginTransaction,
|
|
42
|
+
Q as getAddressTxs,
|
|
43
|
+
$ as getAddressUtxos,
|
|
44
|
+
aa as getContractErrorMessage,
|
|
45
|
+
sa as getDustThreshold,
|
|
46
|
+
ea as getMempoolApiUrl,
|
|
47
|
+
U as getNetwork,
|
|
48
|
+
ta as getNetworkFees,
|
|
49
|
+
ra as getPsbtInputFields,
|
|
50
|
+
ia as getScriptType,
|
|
51
|
+
oa as getTxHex,
|
|
52
|
+
na as getTxInfo,
|
|
53
|
+
Ta as getUtxoInfo,
|
|
54
|
+
ua as handleContractError,
|
|
55
|
+
L as hexToUint8Array,
|
|
56
|
+
O as isAddressFromPublicKey,
|
|
57
|
+
Pa as isKnownContractError,
|
|
58
|
+
f as isValidHex,
|
|
59
|
+
m as parseUnfundedWasmTransaction,
|
|
60
|
+
M as processPublicKeyToXOnly,
|
|
61
|
+
la as pushTx,
|
|
62
|
+
h as rateBasedTxBufferFee,
|
|
63
|
+
da as selectUtxosForPegin,
|
|
64
|
+
ga as shouldAddChangeOutput,
|
|
65
|
+
H as stripHexPrefix,
|
|
66
|
+
N as toXOnly,
|
|
67
|
+
B as uint8ArrayToHex,
|
|
68
|
+
D as validateWalletPubkey
|
|
67
69
|
};
|
|
68
70
|
//# sourceMappingURL=index.js.map
|
|
@@ -30,9 +30,9 @@ export interface PeginManagerConfig {
|
|
|
30
30
|
*/
|
|
31
31
|
vaultContracts: {
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* BTCVaultRegistry contract address on Ethereum.
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
btcVaultRegistry: Address;
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
* Mempool API URL for fetching UTXO data and broadcasting transactions.
|
|
@@ -42,9 +42,9 @@ export interface PeginManagerConfig {
|
|
|
42
42
|
mempoolApiUrl: string;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
* Parameters for the
|
|
45
|
+
* Parameters for the pegin flow (pre-pegin + pegin transactions).
|
|
46
46
|
*/
|
|
47
|
-
export interface
|
|
47
|
+
export interface PreparePeginParams {
|
|
48
48
|
/**
|
|
49
49
|
* Amount to peg in (in satoshis).
|
|
50
50
|
*/
|
|
@@ -73,10 +73,11 @@ export interface CreateAtomicPeginParams {
|
|
|
73
73
|
*/
|
|
74
74
|
timelockRefund: number;
|
|
75
75
|
/**
|
|
76
|
-
* SHA256 hash commitment for the HTLC (64 hex chars = 32 bytes).
|
|
76
|
+
* SHA256 hash commitment(s) for the HTLC (64 hex chars = 32 bytes each).
|
|
77
77
|
* Generated by the depositor as H = SHA256(secret).
|
|
78
|
+
* For single deposits, pass a single-element array.
|
|
78
79
|
*/
|
|
79
|
-
|
|
80
|
+
hashlocks: readonly string[];
|
|
80
81
|
/**
|
|
81
82
|
* Protocol fee rate in sat/vB from the contract offchain params.
|
|
82
83
|
* Used by WASM for computing depositorClaimValue and min pegin fee.
|
|
@@ -105,9 +106,9 @@ export interface CreateAtomicPeginParams {
|
|
|
105
106
|
changeAddress: string;
|
|
106
107
|
}
|
|
107
108
|
/**
|
|
108
|
-
* Result of preparing
|
|
109
|
+
* Result of preparing a pegin.
|
|
109
110
|
*/
|
|
110
|
-
export interface
|
|
111
|
+
export interface PreparePeginResult {
|
|
111
112
|
/**
|
|
112
113
|
* Funded but unsigned Pre-PegIn transaction hex.
|
|
113
114
|
* Sign and broadcast this AFTER registering on Ethereum.
|
|
@@ -162,7 +163,7 @@ export interface AtomicPeginResult {
|
|
|
162
163
|
*/
|
|
163
164
|
export interface SignAndBroadcastParams {
|
|
164
165
|
/**
|
|
165
|
-
* Funded Pre-PegIn transaction hex from
|
|
166
|
+
* Funded Pre-PegIn transaction hex from preparePegin().
|
|
166
167
|
*/
|
|
167
168
|
fundedPrePeginTxHex: string;
|
|
168
169
|
/**
|
|
@@ -194,7 +195,7 @@ export interface RegisterPeginParams {
|
|
|
194
195
|
*/
|
|
195
196
|
vaultProvider: Address;
|
|
196
197
|
/**
|
|
197
|
-
* SHA256 hashlock for
|
|
198
|
+
* SHA256 hashlock for HTLC activation (bytes32 hex with 0x prefix).
|
|
198
199
|
*/
|
|
199
200
|
hashlock: Hex;
|
|
200
201
|
/**
|
|
@@ -233,7 +234,7 @@ export interface RegisterPeginResult {
|
|
|
233
234
|
*/
|
|
234
235
|
ethTxHash: Hash;
|
|
235
236
|
/**
|
|
236
|
-
* Vault identifier used in the
|
|
237
|
+
* Vault identifier used in the BTCVaultRegistry contract.
|
|
237
238
|
* This is the Bitcoin transaction hash with 0x prefix for Ethereum compatibility.
|
|
238
239
|
* Corresponds to btcTxHash from PeginResult, but formatted as Hex with '0x' prefix.
|
|
239
240
|
*/
|
|
@@ -251,11 +252,11 @@ export interface RegisterPeginResult {
|
|
|
251
252
|
* by coordinating between SDK primitives, utilities, and wallet interfaces.
|
|
252
253
|
*
|
|
253
254
|
* @remarks
|
|
254
|
-
* The complete
|
|
255
|
+
* The complete peg-in flow consists of 4 steps:
|
|
255
256
|
*
|
|
256
257
|
* | Step | Method | Description |
|
|
257
258
|
* |------|--------|-------------|
|
|
258
|
-
* | 1 | {@link
|
|
259
|
+
* | 1 | {@link preparePegin} | Build Pre-PegIn HTLC, fund it, sign PegIn input |
|
|
259
260
|
* | 2 | {@link registerPeginOnChain} | Submit to Ethereum contract with PoP |
|
|
260
261
|
* | 3 | {@link PayoutManager} | Sign BOTH payout authorizations |
|
|
261
262
|
* | 4 | {@link signAndBroadcast} | Sign and broadcast Pre-PegIn tx to Bitcoin network |
|
|
@@ -284,7 +285,7 @@ export declare class PeginManager {
|
|
|
284
285
|
*/
|
|
285
286
|
constructor(config: PeginManagerConfig);
|
|
286
287
|
/**
|
|
287
|
-
* Prepares
|
|
288
|
+
* Prepares a peg-in by building the Pre-PegIn HTLC transaction,
|
|
288
289
|
* funding it, constructing the PegIn transaction, and signing the PegIn input.
|
|
289
290
|
*
|
|
290
291
|
* This method orchestrates the following steps:
|
|
@@ -299,11 +300,11 @@ export declare class PeginManager {
|
|
|
299
300
|
* The returned `fundedPrePeginTxHex` is funded but unsigned (inputs unsigned).
|
|
300
301
|
* Use `signAndBroadcast()` AFTER registering on Ethereum to broadcast it.
|
|
301
302
|
*
|
|
302
|
-
* @param params -
|
|
303
|
-
* @returns
|
|
303
|
+
* @param params - Pegin parameters including amount, HTLC params, UTXOs
|
|
304
|
+
* @returns Pegin result with funded Pre-PegIn tx, signed PegIn input, and signatures
|
|
304
305
|
* @throws Error if wallet operations fail or insufficient funds
|
|
305
306
|
*/
|
|
306
|
-
|
|
307
|
+
preparePegin(params: PreparePeginParams): Promise<PreparePeginResult>;
|
|
307
308
|
/**
|
|
308
309
|
* Signs and broadcasts a funded peg-in transaction to the Bitcoin network.
|
|
309
310
|
*
|
|
@@ -321,7 +322,7 @@ export declare class PeginManager {
|
|
|
321
322
|
*/
|
|
322
323
|
signAndBroadcast(params: SignAndBroadcastParams): Promise<string>;
|
|
323
324
|
/**
|
|
324
|
-
* Registers a peg-in on Ethereum by calling the
|
|
325
|
+
* Registers a peg-in on Ethereum by calling the BTCVaultRegistry contract.
|
|
325
326
|
*
|
|
326
327
|
* This method:
|
|
327
328
|
* 1. Gets depositor ETH address from wallet
|
|
@@ -367,9 +368,9 @@ export declare class PeginManager {
|
|
|
367
368
|
*/
|
|
368
369
|
getNetwork(): Network;
|
|
369
370
|
/**
|
|
370
|
-
* Gets the configured
|
|
371
|
+
* Gets the configured BTCVaultRegistry contract address.
|
|
371
372
|
*
|
|
372
|
-
* @returns The Ethereum address of the
|
|
373
|
+
* @returns The Ethereum address of the BTCVaultRegistry contract
|
|
373
374
|
*/
|
|
374
375
|
getVaultContractAddress(): Address;
|
|
375
376
|
}
|
|
@@ -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,
|
|
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,EAQL,KAAK,OAAO,EACb,MAAM,eAAe,CAAC;AAMvB,OAAO,EAML,KAAK,IAAI,EACV,MAAM,UAAU,CAAC;AAElB;;GAE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8BG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAE5C;;;;OAIG;gBACS,MAAM,EAAE,kBAAkB;IAItC;;;;;;;;;;;;;;;;;;;OAmBG;IACG,YAAY,CAChB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC;IA+H9B;;;;;;;;;;;;;;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;IAiI/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"}
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
* ## Available Managers
|
|
36
36
|
*
|
|
37
37
|
* ### {@link PeginManager}
|
|
38
|
-
* Orchestrates the
|
|
39
|
-
* - {@link PeginManager.
|
|
38
|
+
* Orchestrates the peg-in flow:
|
|
39
|
+
* - {@link PeginManager.preparePegin | preparePegin()} - 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 | `
|
|
53
|
+
* | 1 | PeginManager | `preparePegin()` |
|
|
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 {
|
|
70
|
+
export type { PreparePeginResult, PreparePeginParams, 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,
|
|
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,kBAAkB,EAClB,kBAAkB,EAClB,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 e=require("../../../challengeAssert-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../challengeAssert-DDceAi0r.cjs"),t=require("@babylonlabs-io/babylon-tbv-rust-wasm");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.computeNumLocalChallengers=e.computeNumLocalChallengers;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.finalizePeginInputPsbt=e.finalizePeginInputPsbt;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;Object.defineProperty(exports,"SINGLE_DEPOSIT_HTLC_VOUT",{enumerable:!0,get:()=>t.SINGLE_DEPOSIT_HTLC_VOUT});Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>t.computeMinClaimValue});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -75,9 +75,9 @@ export { computeNumLocalChallengers } from './challengers';
|
|
|
75
75
|
export type { Network } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
76
76
|
export { computeMinClaimValue } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
77
77
|
export type { AssertPayoutNoPayoutConnectorParams, ChallengeAssertConnectorParams, PayoutConnectorParams, } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
78
|
-
export { buildPrePeginPsbt, buildPeginTxFromFundedPrePegin } from './psbt/pegin';
|
|
78
|
+
export { buildPrePeginPsbt, buildPeginTxFromFundedPrePegin, SINGLE_DEPOSIT_HTLC_VOUT } from './psbt/pegin';
|
|
79
79
|
export type { PrePeginParams, PrePeginPsbtResult, BuildPeginTxParams, PeginTxResult, } from './psbt/pegin';
|
|
80
|
-
export { buildPeginInputPsbt, extractPeginInputSignature } from './psbt/peginInput';
|
|
80
|
+
export { buildPeginInputPsbt, extractPeginInputSignature, finalizePeginInputPsbt } from './psbt/peginInput';
|
|
81
81
|
export type { BuildPeginInputPsbtParams, BuildPeginInputPsbtResult, } from './psbt/peginInput';
|
|
82
82
|
export { buildPayoutPsbt, extractPayoutSignature } from './psbt/payout';
|
|
83
83
|
export type { PayoutParams, PayoutPsbtResult } from './psbt/payout';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/primitives/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAGH,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAG3D,YAAY,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,YAAY,EACV,mCAAmC,EACnC,8BAA8B,EAC9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B,CAAC;AAClE,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,uBAAuB,EACvB,cAAc,EACd,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,KAAK,4BAA4B,GAClC,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { computeMinClaimValue as
|
|
1
|
+
import { k as s, i as t, j as i, g as r, d as u, a as P, b as o, c as l, l as n, m as d, n as b, r as p, h as g, e as x, f as y, o as c, p as m, q as T, s as f, t as A, u as S, v, w as H } from "../../../challengeAssert-D50t_Qyo.js";
|
|
2
|
+
import { SINGLE_DEPOSIT_HTLC_VOUT as h, computeMinClaimValue as C } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
3
|
export {
|
|
4
|
+
h as SINGLE_DEPOSIT_HTLC_VOUT,
|
|
4
5
|
s as buildChallengeAssertPsbt,
|
|
5
6
|
t as buildDepositorPayoutPsbt,
|
|
6
7
|
i as buildNoPayoutPsbt,
|
|
7
8
|
r as buildPayoutPsbt,
|
|
8
9
|
u as buildPeginInputPsbt,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
P as buildPeginTxFromFundedPrePegin,
|
|
11
|
+
o as buildPrePeginPsbt,
|
|
12
|
+
C as computeMinClaimValue,
|
|
13
|
+
l as computeNumLocalChallengers,
|
|
14
|
+
n as createPayoutScript,
|
|
15
|
+
d as deriveNativeSegwitAddress,
|
|
15
16
|
b as deriveTaprootAddress,
|
|
16
17
|
p as ensureHexPrefix,
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
g as extractPayoutSignature,
|
|
19
|
+
x as extractPeginInputSignature,
|
|
20
|
+
y as finalizePeginInputPsbt,
|
|
19
21
|
c as hexToUint8Array,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
m as isAddressFromPublicKey,
|
|
23
|
+
T as isValidHex,
|
|
24
|
+
f as processPublicKeyToXOnly,
|
|
25
|
+
A as stripHexPrefix,
|
|
26
|
+
S as toXOnly,
|
|
27
|
+
v as uint8ArrayToHex,
|
|
28
|
+
H as validateWalletPubkey
|
|
27
29
|
};
|
|
28
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Network } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
2
|
+
export { SINGLE_DEPOSIT_HTLC_VOUT } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
2
3
|
/**
|
|
3
4
|
* Parameters for building an unfunded Pre-PegIn PSBT
|
|
4
5
|
*/
|
|
@@ -11,8 +12,8 @@ export interface PrePeginParams {
|
|
|
11
12
|
vaultKeeperPubkeys: string[];
|
|
12
13
|
/** Array of universal challenger BTC public keys (x-only, 64-char hex) */
|
|
13
14
|
universalChallengerPubkeys: string[];
|
|
14
|
-
/** SHA256 hash commitment (64 hex chars = 32 bytes) */
|
|
15
|
-
|
|
15
|
+
/** SHA256 hash commitment(s) (64 hex chars = 32 bytes each) */
|
|
16
|
+
hashlocks: readonly string[];
|
|
16
17
|
/** CSV timelock in blocks for the HTLC refund path */
|
|
17
18
|
timelockRefund: number;
|
|
18
19
|
/** Amount to peg in (satoshis) */
|
|
@@ -63,8 +64,10 @@ export interface BuildPeginTxParams {
|
|
|
63
64
|
prePeginParams: PrePeginParams;
|
|
64
65
|
/** CSV timelock in blocks for the PegIn vault output */
|
|
65
66
|
timelockPegin: number;
|
|
66
|
-
/**
|
|
67
|
-
|
|
67
|
+
/** Hex-encoded funded Pre-PegIn transaction */
|
|
68
|
+
fundedPrePeginTxHex: string;
|
|
69
|
+
/** Index of the HTLC output to spend */
|
|
70
|
+
htlcVout: number;
|
|
68
71
|
}
|
|
69
72
|
/**
|
|
70
73
|
* Result of building the PegIn transaction
|
|
@@ -92,12 +95,12 @@ export interface PeginTxResult {
|
|
|
92
95
|
*/
|
|
93
96
|
export declare function buildPrePeginPsbt(params: PrePeginParams): Promise<PrePeginPsbtResult>;
|
|
94
97
|
/**
|
|
95
|
-
* Build the PegIn transaction from a funded Pre-PegIn
|
|
98
|
+
* Build the PegIn transaction from a funded Pre-PegIn transaction.
|
|
96
99
|
*
|
|
97
|
-
* The PegIn transaction spends Pre-PegIn output
|
|
98
|
-
*
|
|
100
|
+
* The PegIn transaction spends the Pre-PegIn HTLC output at htlcVout via the
|
|
101
|
+
* hashlock + all-party script (leaf 0).
|
|
99
102
|
*
|
|
100
|
-
* @param params - Build parameters including Pre-PegIn params and funded
|
|
103
|
+
* @param params - Build parameters including Pre-PegIn params and funded tx hex
|
|
101
104
|
* @returns PegIn transaction details
|
|
102
105
|
* @throws If WASM initialization fails or parameters are invalid
|
|
103
106
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pegin.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/pegin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"pegin.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/pegin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAIjF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,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ACpE,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAiC7B;AAED;;;;;;;;;GASG;AACH,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,aAAa,CAAC,CA2BxB"}
|
|
@@ -22,7 +22,7 @@ export interface BuildPeginInputPsbtParams {
|
|
|
22
22
|
/** Universal challenger BTC public keys (x-only, 64-char hex) */
|
|
23
23
|
universalChallengerPubkeys: string[];
|
|
24
24
|
/** SHA256 hash commitment (64 hex chars = 32 bytes) */
|
|
25
|
-
|
|
25
|
+
hashlock: string;
|
|
26
26
|
/** CSV timelock in blocks for the HTLC refund path */
|
|
27
27
|
timelockRefund: number;
|
|
28
28
|
/** Bitcoin network */
|
|
@@ -66,4 +66,14 @@ export declare function buildPeginInputPsbt(params: BuildPeginInputPsbtParams):
|
|
|
66
66
|
* @throws If no signature is found for the depositor's key
|
|
67
67
|
*/
|
|
68
68
|
export declare function extractPeginInputSignature(signedPsbtHex: string, depositorPubkey: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* Finalize a signed PegIn input PSBT and return the depositor-signed transaction hex.
|
|
71
|
+
*
|
|
72
|
+
* The default tapscript finalizer builds the full witness stack [sig, script, controlBlock]
|
|
73
|
+
* that vaultd requires when verifying the depositor signature on-chain.
|
|
74
|
+
*
|
|
75
|
+
* @param signedPsbtHex - Non-finalized signed PSBT hex (returned by wallet with autoFinalized: false)
|
|
76
|
+
* @returns Depositor-signed PegIn transaction hex with full taproot witness stack
|
|
77
|
+
*/
|
|
78
|
+
export declare function finalizePeginInputPsbt(signedPsbtHex: string): string;
|
|
69
79
|
//# sourceMappingURL=peginInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peginInput.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/peginInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,uCAAuC,CAAC;AAK/C;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,mBAAmB,EAAE,MAAM,CAAC;IAC5B,yDAAyD;IACzD,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,iEAAiE;IACjE,0BAA0B,EAAE,MAAM,EAAE,CAAC;IACrC,uDAAuD;IACvD,
|
|
1
|
+
{"version":3,"file":"peginInput.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/peginInput.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,uCAAuC,CAAC;AAK/C;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,mBAAmB,EAAE,MAAM,CAAC;IAC5B,yDAAyD;IACzD,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,iEAAiE;IACjE,0BAA0B,EAAE,MAAM,EAAE,CAAC;IACrC,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB;IACtB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,yBAAyB,CAAC,CAkFpC;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,MAAM,GACtB,MAAM,CAuCR;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAoBpE"}
|
|
@@ -6,7 +6,7 @@ import { Hex } from 'viem';
|
|
|
6
6
|
* 1. Double SHA256 the transaction bytes
|
|
7
7
|
* 2. Reverse the byte order (Bitcoin convention)
|
|
8
8
|
*
|
|
9
|
-
* The resulting hash is used as the unique vault identifier in the
|
|
9
|
+
* The resulting hash is used as the unique vault identifier in the BTCVaultRegistry contract.
|
|
10
10
|
*
|
|
11
11
|
* @param txHex - Transaction hex (with or without 0x prefix)
|
|
12
12
|
* @returns The transaction hash as Hex (with 0x prefix)
|
package/dist/tbv/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../challengeAssert-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../challengeAssert-DDceAi0r.cjs"),r=require("@babylonlabs-io/babylon-tbv-rust-wasm"),t=require("../PayoutManager-Ba6cNgHC.cjs");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.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.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.computeNumLocalChallengers=e.computeNumLocalChallengers;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.finalizePeginInputPsbt=e.finalizePeginInputPsbt;exports.fundPeginTransaction=e.fundPeginTransaction;exports.getNetwork=e.getNetwork;exports.hexToUint8Array=e.hexToUint8Array;exports.isAddressFromPublicKey=e.isAddressFromPublicKey;exports.isValidHex=e.isValidHex;exports.parseUnfundedWasmTransaction=e.parseUnfundedWasmTransaction;exports.processPublicKeyToXOnly=e.processPublicKeyToXOnly;exports.rateBasedTxBufferFee=e.rateBasedTxBufferFee;exports.stripHexPrefix=e.stripHexPrefix;exports.toXOnly=e.toXOnly;exports.uint8ArrayToHex=e.uint8ArrayToHex;exports.validateWalletPubkey=e.validateWalletPubkey;Object.defineProperty(exports,"SINGLE_DEPOSIT_HTLC_VOUT",{enumerable:!0,get:()=>r.SINGLE_DEPOSIT_HTLC_VOUT});Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>r.computeMinClaimValue});exports.BTCVaultRegistryABI=t.BTCVaultRegistryABI;exports.BitcoinScriptType=t.BitcoinScriptType;exports.CONTRACT_ERRORS=t.CONTRACT_ERRORS;exports.MEMPOOL_API_URLS=t.MEMPOOL_API_URLS;exports.PayoutManager=t.PayoutManager;exports.PeginManager=t.PeginManager;exports.calculateBtcTxHash=t.calculateBtcTxHash;exports.createSplitTransaction=t.createSplitTransaction;exports.createSplitTransactionPsbt=t.createSplitTransactionPsbt;exports.extractErrorData=t.extractErrorData;exports.getAddressTxs=t.getAddressTxs;exports.getAddressUtxos=t.getAddressUtxos;exports.getContractErrorMessage=t.getContractErrorMessage;exports.getDustThreshold=t.getDustThreshold;exports.getMempoolApiUrl=t.getMempoolApiUrl;exports.getNetworkFees=t.getNetworkFees;exports.getPsbtInputFields=t.getPsbtInputFields;exports.getScriptType=t.getScriptType;exports.getTxHex=t.getTxHex;exports.getTxInfo=t.getTxInfo;exports.getUtxoInfo=t.getUtxoInfo;exports.handleContractError=t.handleContractError;exports.isKnownContractError=t.isKnownContractError;exports.pushTx=t.pushTx;exports.selectUtxosForPegin=t.selectUtxosForPegin;exports.shouldAddChangeOutput=t.shouldAddChangeOutput;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|