@babylonlabs-io/ts-sdk 0.12.0 → 0.13.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-BpzES0KW.cjs +2 -0
- package/dist/challengeAssert-BpzES0KW.cjs.map +1 -0
- package/dist/challengeAssert-CenzzhZU.js +724 -0
- package/dist/challengeAssert-CenzzhZU.js.map +1 -0
- package/dist/errors-B2aR9f2F.cjs +2 -0
- package/dist/errors-B2aR9f2F.cjs.map +1 -0
- package/dist/{errors-DOJdtNTD.js → errors-ZoUEvcDE.js} +162 -156
- package/dist/errors-ZoUEvcDE.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +59 -58
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +15 -7
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts.map +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.d.ts +1 -1
- package/dist/tbv/core/index.d.ts.map +1 -1
- package/dist/tbv/core/index.js +59 -58
- package/dist/tbv/core/managers/PeginManager.d.ts +2 -2
- 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 +2 -0
- package/dist/tbv/core/primitives/index.d.ts.map +1 -1
- package/dist/tbv/core/primitives/index.js +21 -20
- package/dist/tbv/core/primitives/psbt/refund.d.ts +42 -0
- package/dist/tbv/core/primitives/psbt/refund.d.ts.map +1 -0
- package/dist/tbv/core/wots/__tests__/derivation.test.d.ts.map +1 -0
- package/dist/tbv/core/{lamport → wots}/derivation.d.ts +16 -16
- package/dist/tbv/core/wots/derivation.d.ts.map +1 -0
- package/dist/tbv/core/wots/deriveWotsPkHash.d.ts +9 -0
- package/dist/tbv/core/wots/deriveWotsPkHash.d.ts.map +1 -0
- package/dist/tbv/core/wots/errors.d.ts +7 -0
- package/dist/tbv/core/wots/errors.d.ts.map +1 -0
- package/dist/tbv/core/wots/index.d.ts +5 -0
- package/dist/tbv/core/wots/index.d.ts.map +1 -0
- package/dist/tbv/core/{lamport → wots}/types.d.ts +8 -8
- package/dist/tbv/core/wots/types.d.ts.map +1 -0
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +59 -58
- package/dist/tbv/integrations/aave/clients/abis/AaveIntegrationAdapter.abi.json.d.ts +459 -485
- 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 +91 -91
- package/package.json +3 -3
- package/dist/challengeAssert-DW0sEUgn.cjs +0 -2
- package/dist/challengeAssert-DW0sEUgn.cjs.map +0 -1
- package/dist/challengeAssert-DnnliaRt.js +0 -645
- package/dist/challengeAssert-DnnliaRt.js.map +0 -1
- package/dist/errors-DOJdtNTD.js.map +0 -1
- package/dist/errors-DbATYfYA.cjs +0 -2
- package/dist/errors-DbATYfYA.cjs.map +0 -1
- package/dist/tbv/core/lamport/__tests__/derivation.test.d.ts.map +0 -1
- package/dist/tbv/core/lamport/derivation.d.ts.map +0 -1
- package/dist/tbv/core/lamport/deriveLamportPkHash.d.ts +0 -9
- package/dist/tbv/core/lamport/deriveLamportPkHash.d.ts.map +0 -1
- package/dist/tbv/core/lamport/errors.d.ts +0 -7
- package/dist/tbv/core/lamport/errors.d.ts.map +0 -1
- package/dist/tbv/core/lamport/index.d.ts +0 -5
- package/dist/tbv/core/lamport/index.d.ts.map +0 -1
- package/dist/tbv/core/lamport/types.d.ts.map +0 -1
- /package/dist/tbv/core/{lamport → wots}/__tests__/derivation.test.d.ts +0 -0
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 i=require("./shared/index.cjs"),e=require("./challengeAssert-BpzES0KW.cjs"),r=require("@babylonlabs-io/babylon-tbv-rust-wasm"),t=require("./errors-B2aR9f2F.cjs");exports.BitcoinNetworks=i.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.buildRefundPsbt=e.buildRefundPsbt;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});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>r.deriveVaultId});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.computeWotsPkHash=t.computeWotsPkHash;exports.createSplitTransaction=t.createSplitTransaction;exports.createSplitTransactionPsbt=t.createSplitTransactionPsbt;exports.createTaprootScriptPathSignOptions=t.createTaprootScriptPathSignOptions;exports.deriveWotsKeypair=t.deriveWotsKeypair;exports.deriveWotsPkHash=t.deriveWotsPkHash;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.isWotsMismatchError=t.isWotsMismatchError;exports.keypairToPublicKey=t.keypairToPublicKey;exports.mnemonicToWotsSeed=t.mnemonicToWotsSeed;exports.pushTx=t.pushTx;exports.selectUtxosForPegin=t.selectUtxosForPegin;exports.shouldAddChangeOutput=t.shouldAddChangeOutput;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,78 +1,79 @@
|
|
|
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
|
|
3
|
-
import { computeMinClaimValue as V, deriveVaultId as
|
|
4
|
-
import { r as z, B as
|
|
2
|
+
import { B as r, D as o, F as i, L as n, M as u, P as T, z as P, S as d, T as l, W as c, l as p, j as g, k as E, h as _, d as A, a as x, b as S, g as b, c as y, m as I, n as R, o as m, s as C, i as F, e as U, f as O, E as f, G as h, p as L, q as M, r as H, C as N, A as B, t as D, y as W, u as k, v, w, x as X } from "./challengeAssert-CenzzhZU.js";
|
|
3
|
+
import { computeMinClaimValue as V, deriveVaultId as Y } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
4
|
+
import { r as z, B as Z, C as j, M as q, i as J, P as Q, c as $, A as aa, b as sa, d as ea, h as ta, y as ra, D as oa, t as ia, j as na, k as ua, u as Ta, g as Pa, l as da, m as la, f as ca, e as pa, n as ga, o as Ea, p as _a, w as Aa, v as xa, E as Sa, z as ba, x as ya, q as Ia, s as Ra, a as ma } from "./errors-ZoUEvcDE.js";
|
|
5
5
|
export {
|
|
6
6
|
z as BTCVaultRegistryABI,
|
|
7
7
|
r as BTC_DUST_SAT,
|
|
8
8
|
e as BitcoinNetworks,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
Z as BitcoinScriptType,
|
|
10
|
+
j 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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
u as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
15
|
+
q as MEMPOOL_API_URLS,
|
|
16
|
+
T as P2TR_INPUT_SIZE,
|
|
17
17
|
P as PEGIN_FIXED_OUTPUTS,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
J as PayoutManager,
|
|
19
|
+
Q as PeginManager,
|
|
20
|
+
d as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
21
|
+
l as TX_BUFFER_SIZE_OVERHEAD,
|
|
22
|
+
c as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
23
|
+
p as buildChallengeAssertPsbt,
|
|
24
24
|
g as buildDepositorPayoutPsbt,
|
|
25
25
|
E as buildNoPayoutPsbt,
|
|
26
26
|
_ as buildPayoutPsbt,
|
|
27
27
|
A as buildPeginInputPsbt,
|
|
28
28
|
x as buildPeginTxFromFundedPrePegin,
|
|
29
29
|
S as buildPrePeginPsbt,
|
|
30
|
-
|
|
31
|
-
$ as
|
|
30
|
+
b as buildRefundPsbt,
|
|
31
|
+
$ as calculateBtcTxHash,
|
|
32
32
|
V as computeMinClaimValue,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
sa as
|
|
37
|
-
ea as
|
|
38
|
-
ta as
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
F as
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
na as
|
|
33
|
+
y as computeNumLocalChallengers,
|
|
34
|
+
aa as computeWotsPkHash,
|
|
35
|
+
I as createPayoutScript,
|
|
36
|
+
sa as createSplitTransaction,
|
|
37
|
+
ea as createSplitTransactionPsbt,
|
|
38
|
+
ta as createTaprootScriptPathSignOptions,
|
|
39
|
+
R as deriveNativeSegwitAddress,
|
|
40
|
+
m as deriveTaprootAddress,
|
|
41
|
+
Y as deriveVaultId,
|
|
42
|
+
ra as deriveWotsKeypair,
|
|
43
|
+
oa as deriveWotsPkHash,
|
|
44
|
+
C as ensureHexPrefix,
|
|
45
|
+
ia as extractErrorData,
|
|
46
|
+
F as extractPayoutSignature,
|
|
47
|
+
U as extractPeginInputSignature,
|
|
48
|
+
O as finalizePeginInputPsbt,
|
|
49
|
+
f as fundPeginTransaction,
|
|
50
|
+
na as getAddressTxs,
|
|
51
|
+
ua as getAddressUtxos,
|
|
51
52
|
Ta as getContractErrorMessage,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
Pa as getDustThreshold,
|
|
54
|
+
da as getMempoolApiUrl,
|
|
55
|
+
h as getNetwork,
|
|
56
|
+
la as getNetworkFees,
|
|
57
|
+
ca as getPsbtInputFields,
|
|
58
|
+
pa as getScriptType,
|
|
59
|
+
ga as getTxHex,
|
|
60
|
+
Ea as getTxInfo,
|
|
61
|
+
_a as getUtxoInfo,
|
|
62
|
+
Aa as handleContractError,
|
|
63
|
+
L as hexToUint8Array,
|
|
64
|
+
M as isAddressFromPublicKey,
|
|
65
|
+
xa as isKnownContractError,
|
|
66
|
+
H as isValidHex,
|
|
67
|
+
Sa as isWotsMismatchError,
|
|
68
|
+
ba as keypairToPublicKey,
|
|
69
|
+
ya as mnemonicToWotsSeed,
|
|
70
|
+
N as parseUnfundedWasmTransaction,
|
|
71
|
+
B as peginOutputCount,
|
|
72
|
+
D as processPublicKeyToXOnly,
|
|
73
|
+
Ia as pushTx,
|
|
74
|
+
W as rateBasedTxBufferFee,
|
|
75
|
+
Ra as selectUtxosForPegin,
|
|
76
|
+
ma as shouldAddChangeOutput,
|
|
76
77
|
k as stripHexPrefix,
|
|
77
78
|
v as toXOnly,
|
|
78
79
|
w as uint8ArrayToHex,
|
|
@@ -50,7 +50,7 @@ export declare const BTCVaultRegistryABI: readonly [{
|
|
|
50
50
|
readonly type: "bytes";
|
|
51
51
|
readonly internalType: "bytes";
|
|
52
52
|
}, {
|
|
53
|
-
readonly name: "
|
|
53
|
+
readonly name: "depositorWotsPkHash";
|
|
54
54
|
readonly type: "bytes32";
|
|
55
55
|
readonly internalType: "bytes32";
|
|
56
56
|
}];
|
|
@@ -104,7 +104,7 @@ export declare const BTCVaultRegistryABI: readonly [{
|
|
|
104
104
|
readonly type: "bytes";
|
|
105
105
|
readonly internalType: "bytes";
|
|
106
106
|
}, {
|
|
107
|
-
readonly name: "
|
|
107
|
+
readonly name: "depositorWotsPkHash";
|
|
108
108
|
readonly type: "bytes32";
|
|
109
109
|
readonly internalType: "bytes32";
|
|
110
110
|
}];
|
|
@@ -125,6 +125,10 @@ export declare const BTCVaultRegistryABI: readonly [{
|
|
|
125
125
|
readonly name: "s";
|
|
126
126
|
readonly type: "bytes32";
|
|
127
127
|
readonly internalType: "bytes32";
|
|
128
|
+
}, {
|
|
129
|
+
readonly name: "activationMetadata";
|
|
130
|
+
readonly type: "bytes";
|
|
131
|
+
readonly internalType: "bytes";
|
|
128
132
|
}];
|
|
129
133
|
readonly outputs: readonly [];
|
|
130
134
|
readonly stateMutability: "nonpayable";
|
|
@@ -194,10 +198,6 @@ export declare const BTCVaultRegistryABI: readonly [{
|
|
|
194
198
|
readonly name: "offchainParamsVersion";
|
|
195
199
|
readonly type: "uint16";
|
|
196
200
|
readonly internalType: "uint16";
|
|
197
|
-
}, {
|
|
198
|
-
readonly name: "proverProgramVersion";
|
|
199
|
-
readonly type: "uint16";
|
|
200
|
-
readonly internalType: "uint16";
|
|
201
201
|
}, {
|
|
202
202
|
readonly name: "createdAt";
|
|
203
203
|
readonly type: "uint256";
|
|
@@ -207,7 +207,7 @@ export declare const BTCVaultRegistryABI: readonly [{
|
|
|
207
207
|
readonly type: "uint256";
|
|
208
208
|
readonly internalType: "uint256";
|
|
209
209
|
}, {
|
|
210
|
-
readonly name: "
|
|
210
|
+
readonly name: "depositorWotsPkHash";
|
|
211
211
|
readonly type: "bytes32";
|
|
212
212
|
readonly internalType: "bytes32";
|
|
213
213
|
}, {
|
|
@@ -218,6 +218,14 @@ export declare const BTCVaultRegistryABI: readonly [{
|
|
|
218
218
|
readonly name: "htlcVout";
|
|
219
219
|
readonly type: "uint8";
|
|
220
220
|
readonly internalType: "uint8";
|
|
221
|
+
}, {
|
|
222
|
+
readonly name: "depositorPopSignature";
|
|
223
|
+
readonly type: "bytes";
|
|
224
|
+
readonly internalType: "bytes";
|
|
225
|
+
}, {
|
|
226
|
+
readonly name: "prePeginTxHash";
|
|
227
|
+
readonly type: "bytes32";
|
|
228
|
+
readonly internalType: "bytes32";
|
|
221
229
|
}];
|
|
222
230
|
}];
|
|
223
231
|
readonly stateMutability: "view";
|
|
@@ -1 +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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyQtB,CAAC"}
|
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-BpzES0KW.cjs"),r=require("@babylonlabs-io/babylon-tbv-rust-wasm"),t=require("../../errors-B2aR9f2F.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.buildRefundPsbt=e.buildRefundPsbt;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});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>r.deriveVaultId});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.computeWotsPkHash=t.computeWotsPkHash;exports.createSplitTransaction=t.createSplitTransaction;exports.createSplitTransactionPsbt=t.createSplitTransactionPsbt;exports.createTaprootScriptPathSignOptions=t.createTaprootScriptPathSignOptions;exports.deriveWotsKeypair=t.deriveWotsKeypair;exports.deriveWotsPkHash=t.deriveWotsPkHash;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.isWotsMismatchError=t.isWotsMismatchError;exports.keypairToPublicKey=t.keypairToPublicKey;exports.mnemonicToWotsSeed=t.mnemonicToWotsSeed;exports.pushTx=t.pushTx;exports.selectUtxosForPegin=t.selectUtxosForPegin;exports.shouldAddChangeOutput=t.shouldAddChangeOutput;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/tbv/core/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tbv/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tbv/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC"}
|
package/dist/tbv/core/index.js
CHANGED
|
@@ -1,78 +1,79 @@
|
|
|
1
|
-
import { B as e, D as t, F as r, L as i, M as o, P as n,
|
|
1
|
+
import { B as e, D as t, F as r, L as i, M as o, P as n, z as u, S as T, T as P, W as d, l, j as c, k as g, h as p, d as E, a as _, b as A, g as S, c as x, m as b, n as y, o as I, s as R, i as C, e as F, f as U, E as m, G as O, p as h, q as f, r as L, C as M, A as H, t as N, y as B, u as D, v as W, w as v, x as k } from "../../challengeAssert-CenzzhZU.js";
|
|
2
2
|
import { computeMinClaimValue as X, deriveVaultId as K } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
|
-
import { r as
|
|
3
|
+
import { r as Y, B as G, C as z, 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 ia, k as oa, u as na, g as ua, l as Ta, m as Pa, f as da, e as la, n as ca, o as ga, p as pa, w as Ea, v as _a, E as Aa, z as Sa, x as xa, q as ba, s as ya, a as Ia } from "../../errors-ZoUEvcDE.js";
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
Y as BTCVaultRegistryABI,
|
|
6
6
|
e as BTC_DUST_SAT,
|
|
7
|
-
|
|
7
|
+
G as BitcoinScriptType,
|
|
8
8
|
z as CONTRACT_ERRORS,
|
|
9
9
|
t as DUST_THRESHOLD,
|
|
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
|
+
Z as MEMPOOL_API_URLS,
|
|
14
14
|
n as P2TR_INPUT_SIZE,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
u as PEGIN_FIXED_OUTPUTS,
|
|
16
|
+
j as PayoutManager,
|
|
17
|
+
q as PeginManager,
|
|
18
|
+
T as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
19
19
|
P as TX_BUFFER_SIZE_OVERHEAD,
|
|
20
20
|
d as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
l as buildChallengeAssertPsbt,
|
|
22
|
+
c as buildDepositorPayoutPsbt,
|
|
23
|
+
g as buildNoPayoutPsbt,
|
|
24
|
+
p as buildPayoutPsbt,
|
|
25
25
|
E as buildPeginInputPsbt,
|
|
26
26
|
_ as buildPeginTxFromFundedPrePegin,
|
|
27
27
|
A as buildPrePeginPsbt,
|
|
28
|
-
|
|
29
|
-
J as
|
|
28
|
+
S as buildRefundPsbt,
|
|
29
|
+
J as calculateBtcTxHash,
|
|
30
30
|
X as computeMinClaimValue,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
$ as
|
|
35
|
-
aa as
|
|
36
|
-
sa as
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
m as deriveTaprootAddress,
|
|
31
|
+
x as computeNumLocalChallengers,
|
|
32
|
+
Q as computeWotsPkHash,
|
|
33
|
+
b as createPayoutScript,
|
|
34
|
+
$ as createSplitTransaction,
|
|
35
|
+
aa as createSplitTransactionPsbt,
|
|
36
|
+
sa as createTaprootScriptPathSignOptions,
|
|
37
|
+
y as deriveNativeSegwitAddress,
|
|
38
|
+
I as deriveTaprootAddress,
|
|
40
39
|
K as deriveVaultId,
|
|
41
|
-
|
|
42
|
-
ta as
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
C as
|
|
46
|
-
F as
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
ea as deriveWotsKeypair,
|
|
41
|
+
ta as deriveWotsPkHash,
|
|
42
|
+
R as ensureHexPrefix,
|
|
43
|
+
ra as extractErrorData,
|
|
44
|
+
C as extractPayoutSignature,
|
|
45
|
+
F as extractPeginInputSignature,
|
|
46
|
+
U as finalizePeginInputPsbt,
|
|
47
|
+
m as fundPeginTransaction,
|
|
48
|
+
ia as getAddressTxs,
|
|
49
|
+
oa as getAddressUtxos,
|
|
50
|
+
na as getContractErrorMessage,
|
|
51
|
+
ua as getDustThreshold,
|
|
51
52
|
Ta as getMempoolApiUrl,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
O as getNetwork,
|
|
54
|
+
Pa as getNetworkFees,
|
|
55
|
+
da as getPsbtInputFields,
|
|
56
|
+
la as getScriptType,
|
|
57
|
+
ca as getTxHex,
|
|
58
|
+
ga as getTxInfo,
|
|
59
|
+
pa as getUtxoInfo,
|
|
60
|
+
Ea as handleContractError,
|
|
61
|
+
h as hexToUint8Array,
|
|
62
|
+
f as isAddressFromPublicKey,
|
|
63
|
+
_a as isKnownContractError,
|
|
64
|
+
L as isValidHex,
|
|
65
|
+
Aa as isWotsMismatchError,
|
|
66
|
+
Sa as keypairToPublicKey,
|
|
67
|
+
xa as mnemonicToWotsSeed,
|
|
68
|
+
M as parseUnfundedWasmTransaction,
|
|
69
|
+
H as peginOutputCount,
|
|
70
|
+
N as processPublicKeyToXOnly,
|
|
71
|
+
ba as pushTx,
|
|
72
|
+
B as rateBasedTxBufferFee,
|
|
73
|
+
ya as selectUtxosForPegin,
|
|
74
|
+
Ia as shouldAddChangeOutput,
|
|
75
|
+
D as stripHexPrefix,
|
|
76
|
+
W as toXOnly,
|
|
76
77
|
v as uint8ArrayToHex,
|
|
77
78
|
k as validateWalletPubkey
|
|
78
79
|
};
|
|
@@ -202,8 +202,8 @@ export interface RegisterPeginParams {
|
|
|
202
202
|
* via `btcWallet.getAddress()`.
|
|
203
203
|
*/
|
|
204
204
|
depositorPayoutBtcAddress?: string;
|
|
205
|
-
/** Keccak256 hash of the depositor's
|
|
206
|
-
|
|
205
|
+
/** Keccak256 hash of the depositor's WOTS public key (bytes32) */
|
|
206
|
+
depositorWotsPkHash: Hex;
|
|
207
207
|
/**
|
|
208
208
|
* Pre-signed BTC PoP signature (hex with 0x prefix).
|
|
209
209
|
* When provided, the BTC wallet signing step is skipped and this signature is used directly.
|
|
@@ -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,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;;;;OAIG;IACH,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAE3B;;;OAGG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;;OAGG;IACH,qBAAqB,EAAE,SAAS,MA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C;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAEhB;;;;OAIG;IACH,OAAO,EAAE,GAAG,CAAC;IAEb;;;OAGG;IACH,eAAe,EAAE,GAAG,CAAC;CACtB;AA8DD,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;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-BpzES0KW.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.buildRefundPsbt=e.buildRefundPsbt;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});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>t.deriveVaultId});
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -79,6 +79,8 @@ 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';
|
|
82
|
+
export { buildRefundPsbt } from './psbt/refund';
|
|
83
|
+
export type { BuildRefundPsbtParams, BuildRefundPsbtResult, } from './psbt/refund';
|
|
82
84
|
export { buildPayoutPsbt, extractPayoutSignature } from './psbt/payout';
|
|
83
85
|
export type { PayoutParams, PayoutPsbtResult } from './psbt/payout';
|
|
84
86
|
export { buildDepositorPayoutPsbt } from './psbt/depositorPayout';
|
|
@@ -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,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAC5F,YAAY,EACV,mCAAmC,EACnC,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AACjF,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC5G,YAAY,EACV,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACxE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,YAAY,EAAE,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;A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OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACxE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,YAAY,EAAE,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,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { computeMinClaimValue as
|
|
1
|
+
import { l as s, j as t, k as i, h as r, d as u, a as l, b as P, g as o, c as d, m as n, n as b, o as p, s as x, i as g, e as y, f as c, p as m, q as f, r as v, t as A, u as T, v as h, w as H, x as I } from "../../../challengeAssert-CenzzhZU.js";
|
|
2
|
+
import { computeMinClaimValue as C, deriveVaultId as F } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
3
|
export {
|
|
4
4
|
s as buildChallengeAssertPsbt,
|
|
5
5
|
t as buildDepositorPayoutPsbt,
|
|
@@ -7,24 +7,25 @@ export {
|
|
|
7
7
|
r as buildPayoutPsbt,
|
|
8
8
|
u as buildPeginInputPsbt,
|
|
9
9
|
l as buildPeginTxFromFundedPrePegin,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
d as
|
|
14
|
-
n as
|
|
15
|
-
b as
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
P as buildPrePeginPsbt,
|
|
11
|
+
o as buildRefundPsbt,
|
|
12
|
+
C as computeMinClaimValue,
|
|
13
|
+
d as computeNumLocalChallengers,
|
|
14
|
+
n as createPayoutScript,
|
|
15
|
+
b as deriveNativeSegwitAddress,
|
|
16
|
+
p as deriveTaprootAddress,
|
|
17
|
+
F as deriveVaultId,
|
|
18
|
+
x as ensureHexPrefix,
|
|
18
19
|
g as extractPayoutSignature,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
y as extractPeginInputSignature,
|
|
21
|
+
c as finalizePeginInputPsbt,
|
|
22
|
+
m as hexToUint8Array,
|
|
23
|
+
f as isAddressFromPublicKey,
|
|
24
|
+
v as isValidHex,
|
|
25
|
+
A as processPublicKeyToXOnly,
|
|
26
|
+
T as stripHexPrefix,
|
|
27
|
+
h as toXOnly,
|
|
28
|
+
H as uint8ArrayToHex,
|
|
29
|
+
I as validateWalletPubkey
|
|
29
30
|
};
|
|
30
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { PrePeginParams } from './pegin';
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for building a refund PSBT
|
|
4
|
+
*/
|
|
5
|
+
export interface BuildRefundPsbtParams {
|
|
6
|
+
/** Same PrePeginParams used when the original Pre-PegIn tx was created */
|
|
7
|
+
prePeginParams: PrePeginParams;
|
|
8
|
+
/** Funded Pre-PegIn transaction hex (the tx whose HTLC output is being refunded) */
|
|
9
|
+
fundedPrePeginTxHex: string;
|
|
10
|
+
/** Index of the HTLC output in the Pre-PegIn transaction */
|
|
11
|
+
htlcVout: number;
|
|
12
|
+
/** Transaction fee in satoshis for the refund transaction */
|
|
13
|
+
refundFee: bigint;
|
|
14
|
+
/** SHA256 hash commitment for the HTLC (64 hex chars, no 0x prefix) */
|
|
15
|
+
hashlock: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Result of building a refund PSBT
|
|
19
|
+
*/
|
|
20
|
+
export interface BuildRefundPsbtResult {
|
|
21
|
+
/** PSBT hex ready for depositor signing */
|
|
22
|
+
psbtHex: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build a PSBT for signing the refund transaction.
|
|
26
|
+
*
|
|
27
|
+
* The refund transaction spends the Pre-PegIn HTLC output via leaf 1
|
|
28
|
+
* (the refund script: `<timelockRefund> CSV DROP <depositorPubkey> CHECKSIG`).
|
|
29
|
+
* The PSBT includes the tapLeafScript entry so the depositor's wallet can
|
|
30
|
+
* sign using Taproot script-path spending.
|
|
31
|
+
*
|
|
32
|
+
* The input's sequence is set to `timelockRefund` by the WASM, enforcing
|
|
33
|
+
* the Bitcoin CSV timelock. The refund broadcast will be rejected by the
|
|
34
|
+
* network if the timelock has not yet expired.
|
|
35
|
+
*
|
|
36
|
+
* @param params - Refund PSBT parameters
|
|
37
|
+
* @returns PSBT hex for depositor signing
|
|
38
|
+
* @throws If the HTLC output at htlcVout is not found
|
|
39
|
+
* @throws If the refund transaction does not have exactly 1 input
|
|
40
|
+
*/
|
|
41
|
+
export declare function buildRefundPsbt(params: BuildRefundPsbtParams): Promise<BuildRefundPsbtResult>;
|
|
42
|
+
//# sourceMappingURL=refund.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refund.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/refund.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,0EAA0E;IAC1E,cAAc,EAAE,cAAc,CAAC;IAC/B,oFAAoF;IACpF,mBAAmB,EAAE,MAAM,CAAC;IAC5B,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAiHhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivation.test.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/wots/__tests__/derivation.test.ts"],"names":[],"mappings":""}
|