@babylonlabs-io/ts-sdk 0.10.0 → 0.11.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/dist/challengeAssert-DW0sEUgn.cjs +2 -0
- package/dist/challengeAssert-DW0sEUgn.cjs.map +1 -0
- package/dist/{challengeAssert-D50t_Qyo.js → challengeAssert-DnnliaRt.js} +66 -60
- package/dist/challengeAssert-DnnliaRt.js.map +1 -0
- package/dist/{errors-fLxe1eml.js → errors-DOJdtNTD.js} +367 -316
- package/dist/errors-DOJdtNTD.js.map +1 -0
- package/dist/errors-DbATYfYA.cjs +2 -0
- package/dist/errors-DbATYfYA.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +64 -63
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +61 -60
- package/dist/tbv/core/managers/PeginManager.d.ts +41 -44
- package/dist/tbv/core/managers/PeginManager.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 +9 -10
- package/dist/tbv/core/primitives/psbt/pegin.d.ts +10 -11
- package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
- package/dist/tbv/core/utils/fee/constants.d.ts +16 -0
- package/dist/tbv/core/utils/fee/constants.d.ts.map +1 -1
- package/dist/tbv/core/utils/utxo/selectUtxos.d.ts +2 -1
- package/dist/tbv/core/utils/utxo/selectUtxos.d.ts.map +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +61 -60
- package/package.json +3 -3
- package/dist/challengeAssert-D50t_Qyo.js.map +0 -1
- package/dist/challengeAssert-DDceAi0r.cjs +0 -2
- package/dist/challengeAssert-DDceAi0r.cjs.map +0 -1
- package/dist/errors-CIDTtluC.cjs +0 -2
- package/dist/errors-CIDTtluC.cjs.map +0 -1
- package/dist/errors-fLxe1eml.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./shared/index.cjs"),e=require("./challengeAssert-DW0sEUgn.cjs"),a=require("@babylonlabs-io/babylon-tbv-rust-wasm"),t=require("./errors-DbATYfYA.cjs");exports.BitcoinNetworks=r.BitcoinNetworks;exports.BTC_DUST_SAT=e.BTC_DUST_SAT;exports.DUST_THRESHOLD=e.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=e.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=e.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=e.MAX_NON_LEGACY_OUTPUT_SIZE;exports.P2TR_INPUT_SIZE=e.P2TR_INPUT_SIZE;exports.PEGIN_FIXED_OUTPUTS=e.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=e.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=e.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=e.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.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.peginOutputCount=e.peginOutputCount;exports.processPublicKeyToXOnly=e.processPublicKeyToXOnly;exports.rateBasedTxBufferFee=e.rateBasedTxBufferFee;exports.stripHexPrefix=e.stripHexPrefix;exports.toXOnly=e.toXOnly;exports.uint8ArrayToHex=e.uint8ArrayToHex;exports.validateWalletPubkey=e.validateWalletPubkey;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>a.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.computeLamportPkHash=t.computeLamportPkHash;exports.createSplitTransaction=t.createSplitTransaction;exports.createSplitTransactionPsbt=t.createSplitTransactionPsbt;exports.createTaprootScriptPathSignOptions=t.createTaprootScriptPathSignOptions;exports.deriveLamportKeypair=t.deriveLamportKeypair;exports.deriveLamportPkHash=t.deriveLamportPkHash;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.isLamportMismatchError=t.isLamportMismatchError;exports.keypairToPublicKey=t.keypairToPublicKey;exports.mnemonicToLamportSeed=t.mnemonicToLamportSeed;exports.pushTx=t.pushTx;exports.selectUtxosForPegin=t.selectUtxosForPegin;exports.shouldAddChangeOutput=t.shouldAddChangeOutput;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,79 +1,80 @@
|
|
|
1
1
|
import { BitcoinNetworks as e } from "./shared/index.js";
|
|
2
|
-
import { B as r, D as o, F as i, L as n, M as T, P, S as
|
|
3
|
-
import {
|
|
4
|
-
import { r as
|
|
2
|
+
import { B as r, D as o, F as i, L as n, M as T, P as u, y as P, S as p, T as d, W as l, k as c, i as g, j as E, g as _, d as A, a as x, b as S, c as m, l as b, m as y, n as I, r as L, h as C, e as F, f as R, C as U, E as O, o as h, p as f, q as M, A as H, z as N, s as B, x as D, t as k, u as v, v as w, w as X } from "./challengeAssert-DnnliaRt.js";
|
|
3
|
+
import { computeMinClaimValue as W } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
4
|
+
import { r as V, B as z, C as G, M as Z, i as j, P as q, c as J, A as Q, b as $, d as aa, h as sa, y as ea, D as ta, t as ra, j as oa, k as ia, u as na, g as Ta, l as ua, m as Pa, f as pa, e as da, n as la, o as ca, p as ga, w as Ea, v as _a, E as Aa, z as xa, x as Sa, q as ma, s as ba, a as ya } from "./errors-DOJdtNTD.js";
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
V as BTCVaultRegistryABI,
|
|
7
7
|
r as BTC_DUST_SAT,
|
|
8
8
|
e as BitcoinNetworks,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
z as BitcoinScriptType,
|
|
10
|
+
G as CONTRACT_ERRORS,
|
|
11
11
|
o as DUST_THRESHOLD,
|
|
12
12
|
i as FEE_SAFETY_MARGIN,
|
|
13
13
|
n as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
14
14
|
T as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
j as
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
Z as MEMPOOL_API_URLS,
|
|
16
|
+
u as P2TR_INPUT_SIZE,
|
|
17
|
+
P as PEGIN_FIXED_OUTPUTS,
|
|
18
|
+
j as PayoutManager,
|
|
19
|
+
q as PeginManager,
|
|
20
|
+
p as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
21
|
+
d as TX_BUFFER_SIZE_OVERHEAD,
|
|
22
|
+
l as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
23
|
+
c as buildChallengeAssertPsbt,
|
|
24
|
+
g as buildDepositorPayoutPsbt,
|
|
25
|
+
E as buildNoPayoutPsbt,
|
|
26
|
+
_ as buildPayoutPsbt,
|
|
27
|
+
A as buildPeginInputPsbt,
|
|
28
|
+
x as buildPeginTxFromFundedPrePegin,
|
|
29
29
|
S as buildPrePeginPsbt,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
J as calculateBtcTxHash,
|
|
31
|
+
Q as computeLamportPkHash,
|
|
32
|
+
W as computeMinClaimValue,
|
|
33
|
+
m as computeNumLocalChallengers,
|
|
34
|
+
b as createPayoutScript,
|
|
35
|
+
$ as createSplitTransaction,
|
|
36
|
+
aa as createSplitTransactionPsbt,
|
|
37
|
+
sa as createTaprootScriptPathSignOptions,
|
|
38
|
+
ea as deriveLamportKeypair,
|
|
39
|
+
ta as deriveLamportPkHash,
|
|
40
|
+
y as deriveNativeSegwitAddress,
|
|
41
|
+
I as deriveTaprootAddress,
|
|
42
42
|
L as ensureHexPrefix,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
ra as extractErrorData,
|
|
44
|
+
C as extractPayoutSignature,
|
|
45
|
+
F as extractPeginInputSignature,
|
|
46
|
+
R as finalizePeginInputPsbt,
|
|
47
|
+
U as fundPeginTransaction,
|
|
48
|
+
oa as getAddressTxs,
|
|
49
|
+
ia as getAddressUtxos,
|
|
50
|
+
na as getContractErrorMessage,
|
|
51
|
+
Ta as getDustThreshold,
|
|
52
|
+
ua as getMempoolApiUrl,
|
|
53
53
|
O as getNetwork,
|
|
54
54
|
Pa as getNetworkFees,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
pa as getPsbtInputFields,
|
|
56
|
+
da as getScriptType,
|
|
57
|
+
la as getTxHex,
|
|
58
|
+
ca as getTxInfo,
|
|
59
|
+
ga as getUtxoInfo,
|
|
60
|
+
Ea as handleContractError,
|
|
61
|
+
h as hexToUint8Array,
|
|
62
|
+
f as isAddressFromPublicKey,
|
|
63
|
+
_a as isKnownContractError,
|
|
64
|
+
Aa as isLamportMismatchError,
|
|
65
|
+
M as isValidHex,
|
|
66
|
+
xa as keypairToPublicKey,
|
|
67
67
|
Sa as mnemonicToLamportSeed,
|
|
68
68
|
H as parseUnfundedWasmTransaction,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
ba as
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
N as peginOutputCount,
|
|
70
|
+
B as processPublicKeyToXOnly,
|
|
71
|
+
ma as pushTx,
|
|
72
|
+
D as rateBasedTxBufferFee,
|
|
73
|
+
ba as selectUtxosForPegin,
|
|
74
|
+
ya as shouldAddChangeOutput,
|
|
75
|
+
k as stripHexPrefix,
|
|
76
|
+
v as toXOnly,
|
|
77
|
+
w as uint8ArrayToHex,
|
|
78
|
+
X as validateWalletPubkey
|
|
78
79
|
};
|
|
79
80
|
//# sourceMappingURL=index.js.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-DW0sEUgn.cjs"),r=require("@babylonlabs-io/babylon-tbv-rust-wasm"),t=require("../../errors-DbATYfYA.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.PEGIN_FIXED_OUTPUTS=e.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=e.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=e.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=e.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.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.peginOutputCount=e.peginOutputCount;exports.processPublicKeyToXOnly=e.processPublicKeyToXOnly;exports.rateBasedTxBufferFee=e.rateBasedTxBufferFee;exports.stripHexPrefix=e.stripHexPrefix;exports.toXOnly=e.toXOnly;exports.uint8ArrayToHex=e.uint8ArrayToHex;exports.validateWalletPubkey=e.validateWalletPubkey;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.computeLamportPkHash=t.computeLamportPkHash;exports.createSplitTransaction=t.createSplitTransaction;exports.createSplitTransactionPsbt=t.createSplitTransactionPsbt;exports.createTaprootScriptPathSignOptions=t.createTaprootScriptPathSignOptions;exports.deriveLamportKeypair=t.deriveLamportKeypair;exports.deriveLamportPkHash=t.deriveLamportPkHash;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.isLamportMismatchError=t.isLamportMismatchError;exports.keypairToPublicKey=t.keypairToPublicKey;exports.mnemonicToLamportSeed=t.mnemonicToLamportSeed;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,77 +1,78 @@
|
|
|
1
|
-
import { B as e, D as t, F as r, L as o, M as i, P as n,
|
|
2
|
-
import {
|
|
3
|
-
import { r as
|
|
1
|
+
import { B as e, D as t, F as r, L as o, M as i, P as n, y as T, S as u, T as P, W as p, k as d, i as l, j as c, g, d as E, a as _, b as A, c as S, l as x, m as b, n as m, r as y, h as I, e as L, f as C, C as F, E as R, o as U, p as O, q as h, A as f, z as M, s as H, x as N, t as B, u as D, v as k, w as v } from "../../challengeAssert-DnnliaRt.js";
|
|
2
|
+
import { computeMinClaimValue as X } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
|
+
import { r as W, B as Y, C as V, M as z, i as G, P as Z, c as j, A as q, b as J, d as Q, h as $, y as aa, D as sa, t as ea, j as ta, k as ra, u as oa, g as ia, l as na, m as Ta, f as ua, e as Pa, n as pa, o as da, p as la, w as ca, v as ga, E as Ea, z as _a, x as Aa, q as Sa, s as xa, a as ba } from "../../errors-DOJdtNTD.js";
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
W as BTCVaultRegistryABI,
|
|
6
6
|
e as BTC_DUST_SAT,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
Y as BitcoinScriptType,
|
|
8
|
+
V as CONTRACT_ERRORS,
|
|
9
9
|
t as DUST_THRESHOLD,
|
|
10
10
|
r as FEE_SAFETY_MARGIN,
|
|
11
11
|
o as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
12
12
|
i as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
13
|
-
|
|
13
|
+
z as MEMPOOL_API_URLS,
|
|
14
14
|
n as P2TR_INPUT_SIZE,
|
|
15
|
-
|
|
16
|
-
G as
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
T as PEGIN_FIXED_OUTPUTS,
|
|
16
|
+
G as PayoutManager,
|
|
17
|
+
Z as PeginManager,
|
|
18
|
+
u as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
19
19
|
P as TX_BUFFER_SIZE_OVERHEAD,
|
|
20
|
-
|
|
20
|
+
p as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
21
21
|
d as buildChallengeAssertPsbt,
|
|
22
22
|
l as buildDepositorPayoutPsbt,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
23
|
+
c as buildNoPayoutPsbt,
|
|
24
|
+
g as buildPayoutPsbt,
|
|
25
|
+
E as buildPeginInputPsbt,
|
|
26
|
+
_ as buildPeginTxFromFundedPrePegin,
|
|
27
|
+
A as buildPrePeginPsbt,
|
|
28
|
+
j as calculateBtcTxHash,
|
|
29
|
+
q as computeLamportPkHash,
|
|
30
|
+
X as computeMinClaimValue,
|
|
31
|
+
S as computeNumLocalChallengers,
|
|
32
|
+
x as createPayoutScript,
|
|
33
|
+
J as createSplitTransaction,
|
|
34
|
+
Q as createSplitTransactionPsbt,
|
|
35
|
+
$ as createTaprootScriptPathSignOptions,
|
|
36
|
+
aa as deriveLamportKeypair,
|
|
37
|
+
sa as deriveLamportPkHash,
|
|
38
|
+
b as deriveNativeSegwitAddress,
|
|
39
|
+
m as deriveTaprootAddress,
|
|
40
|
+
y as ensureHexPrefix,
|
|
41
|
+
ea as extractErrorData,
|
|
42
|
+
I as extractPayoutSignature,
|
|
43
43
|
L as extractPeginInputSignature,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
C as finalizePeginInputPsbt,
|
|
45
|
+
F as fundPeginTransaction,
|
|
46
|
+
ta as getAddressTxs,
|
|
47
|
+
ra as getAddressUtxos,
|
|
48
|
+
oa as getContractErrorMessage,
|
|
49
|
+
ia as getDustThreshold,
|
|
50
|
+
na as getMempoolApiUrl,
|
|
51
|
+
R as getNetwork,
|
|
52
|
+
Ta as getNetworkFees,
|
|
53
|
+
ua as getPsbtInputFields,
|
|
54
54
|
Pa as getScriptType,
|
|
55
|
-
|
|
55
|
+
pa as getTxHex,
|
|
56
56
|
da as getTxInfo,
|
|
57
57
|
la as getUtxoInfo,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
ca as handleContractError,
|
|
59
|
+
U as hexToUint8Array,
|
|
60
60
|
O as isAddressFromPublicKey,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
xa as
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
ga as isKnownContractError,
|
|
62
|
+
Ea as isLamportMismatchError,
|
|
63
|
+
h as isValidHex,
|
|
64
|
+
_a as keypairToPublicKey,
|
|
65
|
+
Aa as mnemonicToLamportSeed,
|
|
66
|
+
f as parseUnfundedWasmTransaction,
|
|
67
|
+
M as peginOutputCount,
|
|
68
|
+
H as processPublicKeyToXOnly,
|
|
69
|
+
Sa as pushTx,
|
|
70
|
+
N as rateBasedTxBufferFee,
|
|
71
|
+
xa as selectUtxosForPegin,
|
|
72
|
+
ba as shouldAddChangeOutput,
|
|
73
|
+
B as stripHexPrefix,
|
|
74
|
+
D as toXOnly,
|
|
75
|
+
k as uint8ArrayToHex,
|
|
76
|
+
v as validateWalletPubkey
|
|
76
77
|
};
|
|
77
78
|
//# sourceMappingURL=index.js.map
|
|
@@ -45,9 +45,11 @@ export interface PeginManagerConfig {
|
|
|
45
45
|
*/
|
|
46
46
|
export interface PreparePeginParams {
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Amounts to peg in per HTLC (in satoshis).
|
|
49
|
+
* Must have the same length as `hashlocks`.
|
|
50
|
+
* For single deposits, pass a single-element array.
|
|
49
51
|
*/
|
|
50
|
-
|
|
52
|
+
amounts: readonly bigint[];
|
|
51
53
|
/**
|
|
52
54
|
* Vault provider's BTC public key (x-only, 64-char hex).
|
|
53
55
|
* Can be provided with or without "0x" prefix (will be stripped automatically).
|
|
@@ -107,54 +109,35 @@ export interface PreparePeginParams {
|
|
|
107
109
|
/**
|
|
108
110
|
* Result of preparing a pegin.
|
|
109
111
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
fundedPrePeginTxHex: string;
|
|
116
|
-
/**
|
|
117
|
-
* Pre-PegIn HTLC value in satoshis (amount the UTXOs cover).
|
|
118
|
-
*/
|
|
112
|
+
/** Per-vault PegIn data derived from a shared Pre-PegIn transaction */
|
|
113
|
+
export interface PerVaultPeginData {
|
|
114
|
+
/** Index of the HTLC output in the Pre-PegIn transaction (0, 1, 2, ...) */
|
|
115
|
+
htlcVout: number;
|
|
116
|
+
/** HTLC output value in satoshis */
|
|
119
117
|
htlcValue: bigint;
|
|
120
|
-
/**
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Depositor's Schnorr signature over PegIn input 0 (HTLC leaf 0), 128 hex chars.
|
|
127
|
-
* This is submitted to the contract via the VP's signPeginInput batch.
|
|
128
|
-
*/
|
|
118
|
+
/** Depositor-signed PegIn transaction hex (for contract registration) */
|
|
119
|
+
peginTxHex: string;
|
|
120
|
+
/** PegIn transaction ID */
|
|
121
|
+
peginTxid: string;
|
|
122
|
+
/** Depositor's Schnorr signature over PegIn input (HTLC leaf 0) */
|
|
129
123
|
peginInputSignature: string;
|
|
130
|
-
/**
|
|
131
|
-
* Vault script pubkey hex — used in the ETH registration call.
|
|
132
|
-
*/
|
|
124
|
+
/** Vault output scriptPubKey hex */
|
|
133
125
|
vaultScriptPubKey: string;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
126
|
+
}
|
|
127
|
+
export interface PreparePeginResult {
|
|
128
|
+
/** Funded but unsigned Pre-PegIn transaction hex */
|
|
129
|
+
fundedPrePeginTxHex: string;
|
|
130
|
+
/** Funded Pre-PegIn transaction ID */
|
|
137
131
|
prePeginTxid: string;
|
|
138
|
-
/**
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* PegIn transaction ID (stable — signing does not change it).
|
|
145
|
-
*/
|
|
146
|
-
peginTxid: string;
|
|
147
|
-
/**
|
|
148
|
-
* UTXOs selected to fund the Pre-PegIn transaction.
|
|
149
|
-
*/
|
|
132
|
+
/** Unfunded Pre-PegIn transaction hex (for contract DA submission) */
|
|
133
|
+
unsignedPrePeginTxHex: string;
|
|
134
|
+
/** Per-vault PegIn data — one entry per hashlock/amount */
|
|
135
|
+
perVault: PerVaultPeginData[];
|
|
136
|
+
/** UTXOs selected to fund the Pre-PegIn transaction */
|
|
150
137
|
selectedUTXOs: UTXO[];
|
|
151
|
-
/**
|
|
152
|
-
* Transaction fee in satoshis.
|
|
153
|
-
*/
|
|
138
|
+
/** Transaction fee in satoshis */
|
|
154
139
|
fee: bigint;
|
|
155
|
-
/**
|
|
156
|
-
* Change amount in satoshis (if any).
|
|
157
|
-
*/
|
|
140
|
+
/** Change amount in satoshis (if any) */
|
|
158
141
|
changeAmount: bigint;
|
|
159
142
|
}
|
|
160
143
|
/**
|
|
@@ -233,6 +216,12 @@ export interface RegisterPeginParams {
|
|
|
233
216
|
* TODO: Wire into submitPeginRequest contract call when contract ABI is updated to support the new peg-in flow.
|
|
234
217
|
*/
|
|
235
218
|
depositorSecretHash?: Hex;
|
|
219
|
+
/**
|
|
220
|
+
* Zero-based index of the HTLC output in the Pre-PegIn transaction that
|
|
221
|
+
* this PegIn spends. In a batch Pre-PegIn with N HTLC outputs, each vault
|
|
222
|
+
* registration references a different htlcVout (0..N-1).
|
|
223
|
+
*/
|
|
224
|
+
htlcVout: number;
|
|
236
225
|
}
|
|
237
226
|
/**
|
|
238
227
|
* Result of registering a peg-in on Ethereum.
|
|
@@ -283,6 +272,14 @@ export declare class PeginManager {
|
|
|
283
272
|
* @throws Error if wallet operations fail or insufficient funds
|
|
284
273
|
*/
|
|
285
274
|
preparePegin(params: PreparePeginParams): Promise<PreparePeginResult>;
|
|
275
|
+
/**
|
|
276
|
+
* Signs multiple PSBTs using batch signing if available, falling back to sequential signing.
|
|
277
|
+
*
|
|
278
|
+
* Wallets that support native batch signing (e.g. UniSat) will sign all PSBTs
|
|
279
|
+
* in a single interaction. Others (e.g. Ledger, AppKit) implement signPsbts
|
|
280
|
+
* by looping signPsbt internally, so the UX depends on the wallet adapter.
|
|
281
|
+
*/
|
|
282
|
+
private signPsbtsWithFallback;
|
|
286
283
|
/**
|
|
287
284
|
* Signs and broadcasts a funded peg-in transaction to the Bitcoin network.
|
|
288
285
|
*
|
|
@@ -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,IAAI,
|
|
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,IAAI,EAAmB,MAAM,yBAAyB,CAAC;AAIpF,OAAO,EAOL,KAAK,OAAO,EACb,MAAM,eAAe,CAAC;AAMvB,OAAO,EAOL,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,kBAAkB;IACjC;;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M,CAAqB;IAE5C;;;;OAIG;gBACS,MAAM,EAAE,kBAAkB;IAItC;;;;;;;;;;;;;;;;;;;OAmBG;IACG,YAAY,CAChB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC;IAwI9B;;;;;;OAMG;YACW,qBAAqB;IA6BnC;;;;;;;;;;;;;;OAcG;IACG,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IAwGvE;;;;;;;;;;;;;;;;OAgBG;IACG,oBAAoB,CACxB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC;IAiJ/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,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-DW0sEUgn.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,"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
|
|
78
|
+
export { buildPrePeginPsbt, buildPeginTxFromFundedPrePegin } 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,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,14 +1,13 @@
|
|
|
1
|
-
import { k as s, i as t, j as i, g as r, d as u, a as
|
|
2
|
-
import {
|
|
1
|
+
import { k as s, i as t, j as i, g as r, d as u, a as o, b as P, 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 f, s as A, t as v, u as T, v as h, w as H } from "../../../challengeAssert-DnnliaRt.js";
|
|
2
|
+
import { computeMinClaimValue as C } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
3
|
export {
|
|
4
|
-
h as SINGLE_DEPOSIT_HTLC_VOUT,
|
|
5
4
|
s as buildChallengeAssertPsbt,
|
|
6
5
|
t as buildDepositorPayoutPsbt,
|
|
7
6
|
i as buildNoPayoutPsbt,
|
|
8
7
|
r as buildPayoutPsbt,
|
|
9
8
|
u as buildPeginInputPsbt,
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
o as buildPeginTxFromFundedPrePegin,
|
|
10
|
+
P as buildPrePeginPsbt,
|
|
12
11
|
C as computeMinClaimValue,
|
|
13
12
|
l as computeNumLocalChallengers,
|
|
14
13
|
n as createPayoutScript,
|
|
@@ -20,11 +19,11 @@ export {
|
|
|
20
19
|
y as finalizePeginInputPsbt,
|
|
21
20
|
c as hexToUint8Array,
|
|
22
21
|
m as isAddressFromPublicKey,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
f as isValidHex,
|
|
23
|
+
A as processPublicKeyToXOnly,
|
|
24
|
+
v as stripHexPrefix,
|
|
25
|
+
T as toXOnly,
|
|
26
|
+
h as uint8ArrayToHex,
|
|
28
27
|
H as validateWalletPubkey
|
|
29
28
|
};
|
|
30
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Network } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
2
|
-
export { SINGLE_DEPOSIT_HTLC_VOUT } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
3
2
|
/**
|
|
4
3
|
* Parameters for building an unfunded Pre-PegIn PSBT
|
|
5
4
|
*/
|
|
@@ -16,8 +15,8 @@ export interface PrePeginParams {
|
|
|
16
15
|
hashlocks: readonly string[];
|
|
17
16
|
/** CSV timelock in blocks for the HTLC refund path */
|
|
18
17
|
timelockRefund: number;
|
|
19
|
-
/**
|
|
20
|
-
|
|
18
|
+
/** Amounts to peg in (satoshis), one per deposit */
|
|
19
|
+
pegInAmounts: readonly bigint[];
|
|
21
20
|
/** Fee rate in sat/vB from contract offchain params */
|
|
22
21
|
feeRate: bigint;
|
|
23
22
|
/** Number of local challengers (from contract params) */
|
|
@@ -45,14 +44,14 @@ export interface PrePeginPsbtResult {
|
|
|
45
44
|
psbtHex: string;
|
|
46
45
|
/** Sum of all unfunded outputs (HTLC + CPFP anchor) — use this for UTXO selection */
|
|
47
46
|
totalOutputValue: bigint;
|
|
48
|
-
/** HTLC output
|
|
49
|
-
|
|
50
|
-
/** HTLC output
|
|
51
|
-
|
|
52
|
-
/** HTLC Taproot
|
|
53
|
-
|
|
54
|
-
/** Pegin
|
|
55
|
-
|
|
47
|
+
/** HTLC output values in satoshis, one per deposit (each includes peginAmount + depositorClaimValue + minPeginFee) */
|
|
48
|
+
htlcValues: readonly bigint[];
|
|
49
|
+
/** HTLC output scriptPubKeys (hex encoded), one per deposit */
|
|
50
|
+
htlcScriptPubKeys: readonly string[];
|
|
51
|
+
/** HTLC Taproot addresses, one per deposit */
|
|
52
|
+
htlcAddresses: readonly string[];
|
|
53
|
+
/** Pegin amounts in satoshis, one per deposit */
|
|
54
|
+
peginAmounts: readonly bigint[];
|
|
56
55
|
/** Depositor claim value computed by WASM from contract parameters */
|
|
57
56
|
depositorClaimValue: bigint;
|
|
58
57
|
}
|
|
@@ -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;AAI/C;;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,0BAA0B,EAAE,MAAM,EAAE,CAAC;IACrC,+DAA+D;IAC/D,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,sDAAsD;IACtD,cAAc,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,uDAAuD;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,8BAA8B,CAClD,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,aAAa,CAAC,CA2BxB"}
|
|
@@ -22,6 +22,22 @@ export declare const FEE_SAFETY_MARGIN = 1.1;
|
|
|
22
22
|
* @returns Buffer amount in satoshis to add to the transaction fee
|
|
23
23
|
*/
|
|
24
24
|
export declare function rateBasedTxBufferFee(feeRate: number): number;
|
|
25
|
+
/**
|
|
26
|
+
* Number of fixed (non-HTLC) outputs in a Pre-PegIn transaction.
|
|
27
|
+
* Currently this is 1 CPFP anchor output.
|
|
28
|
+
*/
|
|
29
|
+
export declare const PEGIN_FIXED_OUTPUTS = 1;
|
|
30
|
+
/**
|
|
31
|
+
* Compute the total number of outputs (before change) in a Pre-PegIn transaction.
|
|
32
|
+
*
|
|
33
|
+
* A Pre-PegIn tx has: N HTLC outputs (one per vault) + fixed outputs (CPFP anchor).
|
|
34
|
+
* This count is used for fee estimation — the change output is handled separately
|
|
35
|
+
* by selectUtxosForPegin when the change amount exceeds the dust threshold.
|
|
36
|
+
*
|
|
37
|
+
* @param vaultCount - Number of vaults in the batch (1 for single-vault)
|
|
38
|
+
* @returns Total output count before change
|
|
39
|
+
*/
|
|
40
|
+
export declare function peginOutputCount(vaultCount: number): number;
|
|
25
41
|
/**
|
|
26
42
|
* Safety multiplier for split transaction fee validation.
|
|
27
43
|
* The signed PSBT's fee rate and absolute fee must not exceed this multiple
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/fee/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,eAAe,KAAK,CAAC;AAGlC,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAG7C,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAG1C,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,oFAAoF;AACpF,eAAO,MAAM,cAAc,QAAuB,CAAC;AAGnD,eAAO,MAAM,mCAAmC,KAAK,CAAC;AAGtD,eAAO,MAAM,+BAA+B,IAAI,CAAC;AAGjD,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/fee/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,eAAe,KAAK,CAAC;AAGlC,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAG7C,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAG1C,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,oFAAoF;AACpF,eAAO,MAAM,cAAc,QAAuB,CAAC;AAGnD,eAAO,MAAM,mCAAmC,KAAK,CAAC;AAGtD,eAAO,MAAM,+BAA+B,IAAI,CAAC;AAGjD,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,IAAI,CAAC"}
|