@babylonlabs-io/ts-sdk 0.6.0 → 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/README.md +1 -1
- package/dist/{PayoutManager-CgS9Y0KB.js → PayoutManager-BVmU4UsM.js} +202 -159
- 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-BpX9FQ-i.js → challengeAssert-D50t_Qyo.js} +102 -101
- 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.js +36 -35
- 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 +38 -37
- 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 +1 -1
- package/dist/tbv/core/primitives/index.d.ts.map +1 -1
- package/dist/tbv/core/primitives/index.js +10 -9
- 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 +1 -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 +38 -37
- 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 +3 -3
- package/dist/PayoutManager-AJJ-3vvu.cjs +0 -2
- package/dist/PayoutManager-AJJ-3vvu.cjs.map +0 -1
- package/dist/PayoutManager-CgS9Y0KB.js.map +0 -1
- package/dist/challengeAssert-BMSvVtzu.cjs +0 -2
- package/dist/challengeAssert-BMSvVtzu.cjs.map +0 -1
- package/dist/challengeAssert-BpX9FQ-i.js.map +0 -1
- package/dist/tbv/core/contracts/abis/BTCVaultsManager.abi.d.ts.map +0 -1
package/dist/tbv/core/contracts/abis/{BTCVaultsManager.abi.d.ts → BTCVaultRegistry.abi.d.ts}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* BTCVaultRegistry Contract ABI
|
|
3
3
|
*
|
|
4
4
|
* Minimal ABI containing only the functions needed by the SDK.
|
|
5
5
|
* Full ABI is available in the vault service package.
|
|
6
6
|
*
|
|
7
|
-
* @module contracts/abis/
|
|
7
|
+
* @module contracts/abis/BTCVaultRegistry
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
-
* Minimal ABI for
|
|
10
|
+
* Minimal ABI for BTCVaultRegistry contract.
|
|
11
11
|
* Contains submitPeginRequest, activateVaultWithSecret, getPegInFee, and getBTCVault.
|
|
12
12
|
*/
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const BTCVaultRegistryABI: readonly [{
|
|
14
14
|
readonly type: "function";
|
|
15
15
|
readonly name: "submitPeginRequest";
|
|
16
16
|
readonly inputs: readonly [{
|
|
@@ -41,6 +41,10 @@ export declare const BTCVaultsManagerABI: readonly [{
|
|
|
41
41
|
readonly name: "hashlock";
|
|
42
42
|
readonly type: "bytes32";
|
|
43
43
|
readonly internalType: "bytes32";
|
|
44
|
+
}, {
|
|
45
|
+
readonly name: "htlcVout";
|
|
46
|
+
readonly type: "uint8";
|
|
47
|
+
readonly internalType: "uint8";
|
|
44
48
|
}, {
|
|
45
49
|
readonly name: "depositorPayoutBtcAddress";
|
|
46
50
|
readonly type: "bytes";
|
|
@@ -87,6 +91,10 @@ export declare const BTCVaultsManagerABI: readonly [{
|
|
|
87
91
|
readonly name: "hashlock";
|
|
88
92
|
readonly type: "bytes32";
|
|
89
93
|
readonly internalType: "bytes32";
|
|
94
|
+
}, {
|
|
95
|
+
readonly name: "htlcVout";
|
|
96
|
+
readonly type: "uint8";
|
|
97
|
+
readonly internalType: "uint8";
|
|
90
98
|
}, {
|
|
91
99
|
readonly name: "referralCode";
|
|
92
100
|
readonly type: "uint32";
|
|
@@ -145,7 +153,7 @@ export declare const BTCVaultsManagerABI: readonly [{
|
|
|
145
153
|
readonly outputs: readonly [{
|
|
146
154
|
readonly name: "vault";
|
|
147
155
|
readonly type: "tuple";
|
|
148
|
-
readonly internalType: "struct
|
|
156
|
+
readonly internalType: "struct IBTCVaultRegistry.BTCVault";
|
|
149
157
|
readonly components: readonly [{
|
|
150
158
|
readonly name: "depositor";
|
|
151
159
|
readonly type: "address";
|
|
@@ -169,9 +177,9 @@ export declare const BTCVaultsManagerABI: readonly [{
|
|
|
169
177
|
}, {
|
|
170
178
|
readonly name: "status";
|
|
171
179
|
readonly type: "uint8";
|
|
172
|
-
readonly internalType: "enum
|
|
180
|
+
readonly internalType: "enum IBTCVaultRegistry.BTCVaultStatus";
|
|
173
181
|
}, {
|
|
174
|
-
readonly name: "
|
|
182
|
+
readonly name: "applicationEntryPoint";
|
|
175
183
|
readonly type: "address";
|
|
176
184
|
readonly internalType: "address";
|
|
177
185
|
}, {
|
|
@@ -187,7 +195,7 @@ export declare const BTCVaultsManagerABI: readonly [{
|
|
|
187
195
|
readonly type: "uint16";
|
|
188
196
|
readonly internalType: "uint16";
|
|
189
197
|
}, {
|
|
190
|
-
readonly name: "
|
|
198
|
+
readonly name: "proverProgramVersion";
|
|
191
199
|
readonly type: "uint16";
|
|
192
200
|
readonly internalType: "uint16";
|
|
193
201
|
}, {
|
|
@@ -206,6 +214,10 @@ export declare const BTCVaultsManagerABI: readonly [{
|
|
|
206
214
|
readonly name: "hashlock";
|
|
207
215
|
readonly type: "bytes32";
|
|
208
216
|
readonly internalType: "bytes32";
|
|
217
|
+
}, {
|
|
218
|
+
readonly name: "htlcVout";
|
|
219
|
+
readonly type: "uint8";
|
|
220
|
+
readonly internalType: "uint8";
|
|
209
221
|
}];
|
|
210
222
|
}];
|
|
211
223
|
readonly stateMutability: "view";
|
|
@@ -229,5 +241,25 @@ export declare const BTCVaultsManagerABI: readonly [{
|
|
|
229
241
|
readonly type: "error";
|
|
230
242
|
readonly name: "ActivationDeadlineExpired";
|
|
231
243
|
readonly inputs: readonly [];
|
|
244
|
+
}, {
|
|
245
|
+
readonly type: "error";
|
|
246
|
+
readonly name: "InvalidHashlock";
|
|
247
|
+
readonly inputs: readonly [];
|
|
248
|
+
}, {
|
|
249
|
+
readonly type: "error";
|
|
250
|
+
readonly name: "DuplicateHashlock";
|
|
251
|
+
readonly inputs: readonly [];
|
|
252
|
+
}, {
|
|
253
|
+
readonly type: "error";
|
|
254
|
+
readonly name: "CapExceeded";
|
|
255
|
+
readonly inputs: readonly [];
|
|
256
|
+
}, {
|
|
257
|
+
readonly type: "error";
|
|
258
|
+
readonly name: "InvalidOutputIndex";
|
|
259
|
+
readonly inputs: readonly [];
|
|
260
|
+
}, {
|
|
261
|
+
readonly type: "error";
|
|
262
|
+
readonly name: "PeginSignaturesIncomplete";
|
|
263
|
+
readonly inputs: readonly [];
|
|
232
264
|
}];
|
|
233
|
-
//# sourceMappingURL=
|
|
265
|
+
//# sourceMappingURL=BTCVaultRegistry.abi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BTCVaultRegistry.abi.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/contracts/abis/BTCVaultRegistry.abi.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmQtB,CAAC"}
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module contracts
|
|
8
8
|
*/
|
|
9
|
-
export {
|
|
9
|
+
export { BTCVaultRegistryABI } from './abis/BTCVaultRegistry.abi';
|
|
10
10
|
export { CONTRACT_ERRORS, extractErrorData, getContractErrorMessage, isKnownContractError, handleContractError, } from './errors';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/tbv/core/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
|
package/dist/tbv/core/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import { q as W, B as X, C as Y, M 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
|
-
W as
|
|
5
|
+
W as BTCVaultRegistryABI,
|
|
6
6
|
e as BTC_DUST_SAT,
|
|
7
7
|
X as BitcoinScriptType,
|
|
8
8
|
Y as CONTRACT_ERRORS,
|
|
@@ -10,10 +10,11 @@ export {
|
|
|
10
10
|
r as FEE_SAFETY_MARGIN,
|
|
11
11
|
i as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
12
12
|
o as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
13
|
-
|
|
13
|
+
G as MEMPOOL_API_URLS,
|
|
14
14
|
n as P2TR_INPUT_SIZE,
|
|
15
15
|
K as PayoutManager,
|
|
16
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,11 +22,11 @@ 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
|
j as calculateBtcTxHash,
|
|
28
|
-
|
|
29
|
+
w as computeMinClaimValue,
|
|
29
30
|
p as computeNumLocalChallengers,
|
|
30
31
|
x as createPayoutScript,
|
|
31
32
|
q as createSplitTransaction,
|
|
@@ -33,37 +34,37 @@ export {
|
|
|
33
34
|
S as deriveNativeSegwitAddress,
|
|
34
35
|
b as deriveTaprootAddress,
|
|
35
36
|
I as ensureHexPrefix,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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,
|
|
46
47
|
U as getNetwork,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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,
|
|
61
62
|
h as rateBasedTxBufferFee,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
da as selectUtxosForPegin,
|
|
64
|
+
ga as shouldAddChangeOutput,
|
|
65
|
+
H as stripHexPrefix,
|
|
66
|
+
N as toXOnly,
|
|
67
|
+
B as uint8ArrayToHex,
|
|
67
68
|
D as validateWalletPubkey
|
|
68
69
|
};
|
|
69
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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C;IAEhB;;;;OAIG;IACH,OAAO,EAAE,GAAG,CAAC;IAEb;;;OAGG;IACH,eAAe,EAAE,GAAG,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;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,7 +75,7 @@ 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
80
|
export { buildPeginInputPsbt, extractPeginInputSignature, finalizePeginInputPsbt } from './psbt/peginInput';
|
|
81
81
|
export type { BuildPeginInputPsbtParams, BuildPeginInputPsbtResult, } from './psbt/peginInput';
|
|
@@ -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,EAC9B,qBAAqB,GACtB,M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Y,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,13 +1,14 @@
|
|
|
1
|
-
import { k as s, i as t, j as i, g as r, d as u, a as
|
|
2
|
-
import { computeMinClaimValue as C } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
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
|
-
|
|
10
|
+
P as buildPeginTxFromFundedPrePegin,
|
|
11
|
+
o as buildPrePeginPsbt,
|
|
11
12
|
C as computeMinClaimValue,
|
|
12
13
|
l as computeNumLocalChallengers,
|
|
13
14
|
n as createPayoutScript,
|
|
@@ -19,11 +20,11 @@ export {
|
|
|
19
20
|
y as finalizePeginInputPsbt,
|
|
20
21
|
c as hexToUint8Array,
|
|
21
22
|
m as isAddressFromPublicKey,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
T as isValidHex,
|
|
24
|
+
f as processPublicKeyToXOnly,
|
|
25
|
+
A as stripHexPrefix,
|
|
26
|
+
S as toXOnly,
|
|
27
|
+
v as uint8ArrayToHex,
|
|
27
28
|
H as validateWalletPubkey
|
|
28
29
|
};
|
|
29
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,yEAAyE;IACzE,eAAe,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kEAAkE;IAClE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,0EAA0E;IAC1E,0BAA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pB;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 */
|
|
@@ -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
|