@babylonlabs-io/ts-sdk 0.28.0 → 0.28.1
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/PeginManager-Da4uSHzl.cjs +2 -0
- package/dist/PeginManager-Da4uSHzl.cjs.map +1 -0
- package/dist/{deriveVaultRoot-DAMZDqg-.js → PeginManager-DzMSIQ0I.js} +1131 -1043
- package/dist/PeginManager-DzMSIQ0I.js.map +1 -0
- package/dist/buildAndBroadcastRefund-DkEpTFkv.cjs +2 -0
- package/dist/buildAndBroadcastRefund-DkEpTFkv.cjs.map +1 -0
- package/dist/{buildAndBroadcastRefund-Cc4-L7gX.js → buildAndBroadcastRefund-xWS8frc6.js} +318 -329
- package/dist/buildAndBroadcastRefund-xWS8frc6.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/{sha2-CPdTLk1u.js → sha2-6wN58S6R.js} +9 -9
- package/dist/{sha2-CPdTLk1u.js.map → sha2-6wN58S6R.js.map} +1 -1
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts.map +1 -1
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +2 -2
- package/dist/tbv/core/contracts/abis/BTCVaultRegistry.abi.d.ts +80 -70
- 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.js +4 -4
- package/dist/tbv/core/managers/PeginManager.d.ts +64 -27
- package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
- package/dist/tbv/core/managers/index.d.ts +1 -1
- package/dist/tbv/core/managers/index.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/validation.d.ts +0 -4
- package/dist/tbv/core/services/deposit/validation.d.ts.map +1 -1
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +4 -4
- package/dist/testing/MockBitcoinWallet.d.ts +1 -0
- package/dist/testing/MockBitcoinWallet.d.ts.map +1 -1
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.js +35 -34
- package/dist/testing/index.js.map +1 -1
- package/dist/{types-CQ86O7NX.js → types-CnG3JsRs.js} +111 -81
- package/dist/types-CnG3JsRs.js.map +1 -0
- package/dist/types-jmEyzzhY.cjs +2 -0
- package/dist/types-jmEyzzhY.cjs.map +1 -0
- package/dist/{vault-registry-reader-CshEgmS0.js → vault-registry-reader-BywZhqJL.js} +37 -37
- package/dist/{vault-registry-reader-CshEgmS0.js.map → vault-registry-reader-BywZhqJL.js.map} +1 -1
- package/dist/{vault-registry-reader-_2BjSjoN.cjs → vault-registry-reader-DdruADqa.cjs} +2 -2
- package/dist/{vault-registry-reader-_2BjSjoN.cjs.map → vault-registry-reader-DdruADqa.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/buildAndBroadcastRefund-Cc4-L7gX.js.map +0 -1
- package/dist/buildAndBroadcastRefund-OoaQaNqn.cjs +0 -2
- package/dist/buildAndBroadcastRefund-OoaQaNqn.cjs.map +0 -1
- package/dist/deriveVaultRoot-B4gnRbW_.cjs +0 -2
- package/dist/deriveVaultRoot-B4gnRbW_.cjs.map +0 -1
- package/dist/deriveVaultRoot-DAMZDqg-.js.map +0 -1
- package/dist/types-CQ86O7NX.js.map +0 -1
- package/dist/types-CcwaEPE1.cjs +0 -2
- package/dist/types-CcwaEPE1.cjs.map +0 -1
|
@@ -214,33 +214,38 @@ export declare const BTCVaultRegistryABI: readonly [{
|
|
|
214
214
|
readonly internalType: "bytes32";
|
|
215
215
|
}];
|
|
216
216
|
readonly outputs: readonly [{
|
|
217
|
-
readonly name: "
|
|
218
|
-
readonly type: "
|
|
219
|
-
readonly internalType: "
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
217
|
+
readonly name: "vBasic";
|
|
218
|
+
readonly type: "tuple";
|
|
219
|
+
readonly internalType: "struct BTCVaultTypes.BTCVaultBasicInfo";
|
|
220
|
+
readonly components: readonly [{
|
|
221
|
+
readonly name: "depositor";
|
|
222
|
+
readonly type: "address";
|
|
223
|
+
readonly internalType: "address";
|
|
224
|
+
}, {
|
|
225
|
+
readonly name: "depositorBtcPubKey";
|
|
226
|
+
readonly type: "bytes32";
|
|
227
|
+
readonly internalType: "bytes32";
|
|
228
|
+
}, {
|
|
229
|
+
readonly name: "amount";
|
|
230
|
+
readonly type: "uint256";
|
|
231
|
+
readonly internalType: "uint256";
|
|
232
|
+
}, {
|
|
233
|
+
readonly name: "vaultProvider";
|
|
234
|
+
readonly type: "address";
|
|
235
|
+
readonly internalType: "address";
|
|
236
|
+
}, {
|
|
237
|
+
readonly name: "status";
|
|
238
|
+
readonly type: "uint8";
|
|
239
|
+
readonly internalType: "enum IBTCVaultRegistry.BTCVaultStatus";
|
|
240
|
+
}, {
|
|
241
|
+
readonly name: "applicationEntryPoint";
|
|
242
|
+
readonly type: "address";
|
|
243
|
+
readonly internalType: "address";
|
|
244
|
+
}, {
|
|
245
|
+
readonly name: "createdAt";
|
|
246
|
+
readonly type: "uint256";
|
|
247
|
+
readonly internalType: "uint256";
|
|
248
|
+
}];
|
|
244
249
|
}];
|
|
245
250
|
readonly stateMutability: "view";
|
|
246
251
|
}, {
|
|
@@ -292,49 +297,54 @@ export declare const BTCVaultRegistryABI: readonly [{
|
|
|
292
297
|
readonly internalType: "bytes32";
|
|
293
298
|
}];
|
|
294
299
|
readonly outputs: readonly [{
|
|
295
|
-
readonly name: "
|
|
296
|
-
readonly type: "
|
|
297
|
-
readonly internalType: "
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
300
|
+
readonly name: "vProtocol";
|
|
301
|
+
readonly type: "tuple";
|
|
302
|
+
readonly internalType: "struct BTCVaultRegistryTypes.BTCVaultProtocolInfo";
|
|
303
|
+
readonly components: readonly [{
|
|
304
|
+
readonly name: "depositorSignedPeginTx";
|
|
305
|
+
readonly type: "bytes";
|
|
306
|
+
readonly internalType: "bytes";
|
|
307
|
+
}, {
|
|
308
|
+
readonly name: "universalChallengersVersion";
|
|
309
|
+
readonly type: "uint16";
|
|
310
|
+
readonly internalType: "uint16";
|
|
311
|
+
}, {
|
|
312
|
+
readonly name: "appVaultKeepersVersion";
|
|
313
|
+
readonly type: "uint16";
|
|
314
|
+
readonly internalType: "uint16";
|
|
315
|
+
}, {
|
|
316
|
+
readonly name: "offchainParamsVersion";
|
|
317
|
+
readonly type: "uint16";
|
|
318
|
+
readonly internalType: "uint16";
|
|
319
|
+
}, {
|
|
320
|
+
readonly name: "verifiedAt";
|
|
321
|
+
readonly type: "uint256";
|
|
322
|
+
readonly internalType: "uint256";
|
|
323
|
+
}, {
|
|
324
|
+
readonly name: "depositorWotsPkHash";
|
|
325
|
+
readonly type: "bytes32";
|
|
326
|
+
readonly internalType: "bytes32";
|
|
327
|
+
}, {
|
|
328
|
+
readonly name: "hashlock";
|
|
329
|
+
readonly type: "bytes32";
|
|
330
|
+
readonly internalType: "bytes32";
|
|
331
|
+
}, {
|
|
332
|
+
readonly name: "htlcVout";
|
|
333
|
+
readonly type: "uint8";
|
|
334
|
+
readonly internalType: "uint8";
|
|
335
|
+
}, {
|
|
336
|
+
readonly name: "depositorPopSignature";
|
|
337
|
+
readonly type: "bytes";
|
|
338
|
+
readonly internalType: "bytes";
|
|
339
|
+
}, {
|
|
340
|
+
readonly name: "prePeginTxHash";
|
|
341
|
+
readonly type: "bytes32";
|
|
342
|
+
readonly internalType: "bytes32";
|
|
343
|
+
}, {
|
|
344
|
+
readonly name: "vaultProviderCommissionBps";
|
|
345
|
+
readonly type: "uint16";
|
|
346
|
+
readonly internalType: "uint16";
|
|
347
|
+
}];
|
|
338
348
|
}];
|
|
339
349
|
readonly stateMutability: "view";
|
|
340
350
|
}, {
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkZtB,CAAC"}
|
package/dist/tbv/core/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../challengeAssert-BM8m9gPM.cjs"),P=require("@babylonlabs-io/babylon-tbv-rust-wasm"),d=require("../../payout-DP6KMFP1.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../../challengeAssert-BM8m9gPM.cjs"),P=require("@babylonlabs-io/babylon-tbv-rust-wasm"),d=require("../../payout-DP6KMFP1.cjs"),o=require("../../bitcoin-DIN0OupO.cjs"),l=require("../../signing-DHSXjhLM.cjs"),u=require("../../validation-u8W7Lp2x.cjs"),t=require("../../buildAndBroadcastRefund-DkEpTFkv.cjs"),a=require("../../fundPeginTransaction-DaWoYCgO.cjs"),i=require("../../psbtInputFields-CB8hqjQ5.cjs"),r=require("../../PeginManager-Da4uSHzl.cjs"),e=require("../../vault-registry-reader-DdruADqa.cjs"),s=require("../../types-jmEyzzhY.cjs");exports.buildChallengeAssertPsbt=n.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=n.buildDepositorPayoutPsbt;exports.buildNoPayoutPsbt=n.buildNoPayoutPsbt;exports.buildPeginInputPsbt=n.buildPeginInputPsbt;exports.buildPeginTxFromFundedPrePegin=n.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=n.buildPrePeginPsbt;exports.computeNumLocalChallengers=n.computeNumLocalChallengers;exports.extractPeginInputSignature=n.extractPeginInputSignature;exports.finalizePeginInputPsbt=n.finalizePeginInputPsbt;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>P.computeMinClaimValue});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>P.deriveVaultId});exports.buildPayoutPsbt=d.buildPayoutPsbt;exports.buildRefundPsbt=d.buildRefundPsbt;exports.createPayoutScript=d.createPayoutScript;exports.extractPayoutSignature=d.extractPayoutSignature;exports.deriveNativeSegwitAddress=o.deriveNativeSegwitAddress;exports.deriveTaprootAddress=o.deriveTaprootAddress;exports.ensureHexPrefix=o.ensureHexPrefix;exports.formatSatoshisToBtc=o.formatSatoshisToBtc;exports.getNetwork=o.getNetwork;exports.hexToUint8Array=o.hexToUint8Array;exports.isAddressFromPublicKey=o.isAddressFromPublicKey;exports.isValidHex=o.isValidHex;exports.processPublicKeyToXOnly=o.processPublicKeyToXOnly;exports.stripHexPrefix=o.stripHexPrefix;exports.toXOnly=o.toXOnly;exports.uint8ArrayToHex=o.uint8ArrayToHex;exports.validateWalletPubkey=o.validateWalletPubkey;exports.ContractStatus=l.ContractStatus;exports.PeginAction=l.PeginAction;exports.canPerformAction=l.canPerformAction;exports.createTaprootScriptPathSignOptions=l.createTaprootScriptPathSignOptions;exports.getPeginProtocolState=l.getPeginProtocolState;exports.BITCOIN_ADDRESS_RE=u.BITCOIN_ADDRESS_RE;exports.HEX_RE=u.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=u.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=u.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=u.TXID_RE;exports.BIP68NotMatureError=t.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=t.ClaimerPegoutStatusValue;exports.PayoutManager=t.PayoutManager;exports.activateVault=t.activateVault;exports.buildAndBroadcastRefund=t.buildAndBroadcastRefund;exports.computeHashlock=t.computeHashlock;exports.isDepositAmountValid=t.isDepositAmountValid;exports.isPegoutTerminalStatus=t.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=t.isRecognizedPegoutStatus;exports.pollAndSignPayouts=t.pollAndSignPayouts;exports.signDepositorGraph=t.signDepositorGraph;exports.submitWotsPublicKey=t.submitWotsPublicKey;exports.validateDepositAmount=t.validateDepositAmount;exports.validateMultiVaultDepositInputs=t.validateMultiVaultDepositInputs;exports.validateProviderSelection=t.validateProviderSelection;exports.validateRemainingCapacity=t.validateRemainingCapacity;exports.validateSecretAgainstHashlock=t.validateSecretAgainstHashlock;exports.validateVaultAmounts=t.validateVaultAmounts;exports.validateVaultProviderPubkey=t.validateVaultProviderPubkey;exports.waitForPeginStatus=t.waitForPeginStatus;exports.BTC_DUST_SAT=a.BTC_DUST_SAT;exports.DUST_THRESHOLD=a.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=a.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=a.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=a.MAX_NON_LEGACY_OUTPUT_SIZE;exports.P2TR_INPUT_SIZE=a.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=a.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=a.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=a.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=a.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=a.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=a.fundPeginTransaction;exports.parseUnfundedWasmTransaction=a.parseUnfundedWasmTransaction;exports.peginOutputCount=a.peginOutputCount;exports.rateBasedTxBufferFee=a.rateBasedTxBufferFee;exports.BitcoinScriptType=i.BitcoinScriptType;exports.UtxoNotAvailableError=i.UtxoNotAvailableError;exports.assertUtxosAvailable=i.assertUtxosAvailable;exports.calculateBtcTxHash=i.calculateBtcTxHash;exports.collectReservedUtxoRefs=i.collectReservedUtxoRefs;exports.extractInputsFromTransaction=i.extractInputsFromTransaction;exports.getDustThreshold=i.getDustThreshold;exports.getPsbtInputFields=i.getPsbtInputFields;exports.getScriptType=i.getScriptType;exports.selectUtxosForDeposit=i.selectUtxosForDeposit;exports.selectUtxosForPegin=i.selectUtxosForPegin;exports.shouldAddChangeOutput=i.shouldAddChangeOutput;exports.validateUtxosAvailable=i.validateUtxosAvailable;exports.CONTRACT_ERRORS=r.CONTRACT_ERRORS;exports.PeginManager=r.PeginManager;exports.VAULT_APP_NAME=r.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=r.buildFundingOutpointsCommitment;exports.buildVaultContext=r.buildVaultContext;exports.computeWotsBlockPublicKeysHash=r.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=r.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=r.deriveWotsBlocksFromSeed;exports.expandAuthAnchor=r.expandAuthAnchor;exports.expandHashlockSecret=r.expandHashlockSecret;exports.expandWotsSeed=r.expandWotsSeed;exports.extractErrorData=r.extractErrorData;exports.getContractErrorMessage=r.getContractErrorMessage;exports.handleContractError=r.handleContractError;exports.isKnownContractError=r.isKnownContractError;exports.isWotsMismatchError=r.isWotsMismatchError;exports.ApplicationRegistryABI=e.ApplicationRegistryABI;exports.MEMPOOL_API_URLS=e.MEMPOOL_API_URLS;exports.ProtocolParamsABI=e.ProtocolParamsABI;exports.ServerIdentityError=e.ServerIdentityError;exports.VaultProviderRpcClient=e.VaultProviderRpcClient;exports.ViemProtocolParamsReader=e.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=e.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=e.ViemVaultKeeperReader;exports.ViemVaultRegistryReader=e.ViemVaultRegistryReader;exports.VpResponseValidationError=e.VpResponseValidationError;exports.VpTokenProvider=e.VpTokenProvider;exports.getAddressTxs=e.getAddressTxs;exports.getAddressUtxos=e.getAddressUtxos;exports.getMempoolApiUrl=e.getMempoolApiUrl;exports.getNetworkFees=e.getNetworkFees;exports.getTxHex=e.getTxHex;exports.getTxInfo=e.getTxInfo;exports.getUtxoInfo=e.getUtxoInfo;exports.pushTx=e.pushTx;exports.resolveProtocolAddresses=e.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=e.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=e.verifyServerIdentity;exports.BTCVaultRegistryABI=s.BTCVaultRegistryABI;exports.DaemonStatus=s.DaemonStatus;exports.JSON_RPC_ERROR_CODES=s.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=s.JsonRpcClient;exports.JsonRpcError=s.JsonRpcError;exports.POST_WOTS_STATUSES=s.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=s.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=s.RpcErrorCode;exports.VP_TERMINAL_STATUSES=s.VP_TERMINAL_STATUSES;exports.VP_TRANSIENT_STATUSES=s.VP_TRANSIENT_STATUSES;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/tbv/core/index.js
CHANGED
|
@@ -4,12 +4,12 @@ import { a as S, b as A, c as E, e as _ } from "../../payout-B_fvQU3q.js";
|
|
|
4
4
|
import { d as R, a as m, e as x, f as b, g as I, h as f, i as v, b as C, p as U, s as O, t as V, u as h, v as y } from "../../bitcoin-B-Y0DlqR.js";
|
|
5
5
|
import { C as F, P as B, a as D, c as M, g as H } from "../../signing-BZigafm0.js";
|
|
6
6
|
import { B as k, H as W, K as X, M as K, T as w } from "../../validation-CxqROCno.js";
|
|
7
|
-
import { B as Y, C as J, P as j, a as Z, m as z, h as q, i as Q, l as $, k as aa, p as sa, b as ea, s as ta, v as ra, g as oa, d as ia, c as na, j as la, e as ua, f as da, w as Pa } from "../../buildAndBroadcastRefund-
|
|
7
|
+
import { B as Y, C as J, P as j, a as Z, m as z, h as q, i as Q, l as $, k as aa, p as sa, b as ea, s as ta, v as ra, g as oa, d as ia, c as na, j as la, e as ua, f as da, w as Pa } from "../../buildAndBroadcastRefund-xWS8frc6.js";
|
|
8
8
|
import { B as Ta, D as pa, F as Sa, L as Aa, M as Ea, P as _a, b as ga, a as Ra, S as ma, T as xa, W as ba, f as Ia, c as fa, p as va, r as Ca } from "../../fundPeginTransaction-oV-dNJOU.js";
|
|
9
9
|
import { B as Oa, U as Va, a as ha, f as ya, c as Na, e as Fa, g as Ba, i as Da, h as Ma, s as Ha, b as La, d as ka, v as Wa } from "../../psbtInputFields-DeTFSJOq.js";
|
|
10
|
-
import { C as Ka, P as wa, V as Ga, k as Ya, l as Ja, c as ja, m as Za, d as za, b as qa, f as Qa, j as $a, e as as, g as ss, h as es, i as ts, a as rs } from "../../
|
|
11
|
-
import { A as is, M as ns, P as ls, S as us, V as ds, k as Ps, l as cs, m as Ts, n as ps, h as Ss, j as As, g as Es, a as _s, b as gs, c as Rs, d as ms, e as xs, f as bs, p as Is, r as fs, v as vs, i as Cs } from "../../vault-registry-reader-
|
|
12
|
-
import { B as Os, D as Vs, b as hs, J as ys, a as Ns, d as Fs, P as Bs, R as Ds, c as Ms, V as Hs } from "../../types-
|
|
10
|
+
import { C as Ka, P as wa, V as Ga, k as Ya, l as Ja, c as ja, m as Za, d as za, b as qa, f as Qa, j as $a, e as as, g as ss, h as es, i as ts, a as rs } from "../../PeginManager-DzMSIQ0I.js";
|
|
11
|
+
import { A as is, M as ns, P as ls, S as us, V as ds, k as Ps, l as cs, m as Ts, n as ps, h as Ss, j as As, g as Es, a as _s, b as gs, c as Rs, d as ms, e as xs, f as bs, p as Is, r as fs, v as vs, i as Cs } from "../../vault-registry-reader-BywZhqJL.js";
|
|
12
|
+
import { B as Os, D as Vs, b as hs, J as ys, a as Ns, d as Fs, P as Bs, R as Ds, c as Ms, V as Hs } from "../../types-CnG3JsRs.js";
|
|
13
13
|
export {
|
|
14
14
|
is as ApplicationRegistryABI,
|
|
15
15
|
Y as BIP68NotMatureError,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Address, Chain, Hex, WalletClient } from 'viem';
|
|
2
2
|
import { BitcoinWallet, Hash } from '../../../shared/wallets';
|
|
3
|
+
import { WotsBlockPublicKey } from '../clients/vault-provider/types';
|
|
3
4
|
import { Network } from '../primitives';
|
|
4
5
|
import { UTXO } from '../utils';
|
|
5
6
|
/**
|
|
@@ -73,12 +74,6 @@ export interface PreparePeginParams {
|
|
|
73
74
|
* CSV timelock in blocks for the Pre-PegIn HTLC refund path.
|
|
74
75
|
*/
|
|
75
76
|
timelockRefund: number;
|
|
76
|
-
/**
|
|
77
|
-
* SHA256 hash commitment(s) for the HTLC (64 hex chars = 32 bytes each).
|
|
78
|
-
* Generated by the depositor as H = SHA256(secret).
|
|
79
|
-
* For single deposits, pass a single-element array.
|
|
80
|
-
*/
|
|
81
|
-
hashlocks: readonly string[];
|
|
82
77
|
/**
|
|
83
78
|
* Protocol fee rate in sat/vB from the contract offchain params.
|
|
84
79
|
* Used by WASM for computing depositorClaimValue and min pegin fee.
|
|
@@ -124,7 +119,11 @@ export interface PerVaultPeginData {
|
|
|
124
119
|
/** Vault output scriptPubKey hex */
|
|
125
120
|
vaultScriptPubKey: string;
|
|
126
121
|
}
|
|
127
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Broadcast-ready transaction output of {@link PeginManager.preparePegin}.
|
|
124
|
+
* Safe to log / persist — contains no sensitive material.
|
|
125
|
+
*/
|
|
126
|
+
export interface PreparePeginTransaction {
|
|
128
127
|
/**
|
|
129
128
|
* Funded, pre-witness Pre-PegIn tx hex. Pass this for register calls'
|
|
130
129
|
* `unsignedPrePeginTx` — despite the contract-side name, the registry
|
|
@@ -133,7 +132,7 @@ export interface PreparePeginResult {
|
|
|
133
132
|
fundedPrePeginTxHex: string;
|
|
134
133
|
/** Funded Pre-PegIn transaction ID */
|
|
135
134
|
prePeginTxid: string;
|
|
136
|
-
/** Per-vault PegIn data — one entry per
|
|
135
|
+
/** Per-vault PegIn data — one entry per amount */
|
|
137
136
|
perVault: PerVaultPeginData[];
|
|
138
137
|
/** UTXOs selected to fund the Pre-PegIn transaction */
|
|
139
138
|
selectedUTXOs: UTXO[];
|
|
@@ -142,6 +141,35 @@ export interface PreparePeginResult {
|
|
|
142
141
|
/** Change amount in satoshis (if any) */
|
|
143
142
|
changeAmount: bigint;
|
|
144
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Sensitive material derived from the wallet root. Do not log; do not
|
|
146
|
+
* persist beyond the activation flow. Strings are immutable in JS, so
|
|
147
|
+
* lifetime is GC-only — secrets stay live until the result is dropped.
|
|
148
|
+
*/
|
|
149
|
+
export interface PreparePeginDerivedSecrets {
|
|
150
|
+
/** Per-vault WOTS block public keys (one array per vault). */
|
|
151
|
+
perVaultWotsKeys: WotsBlockPublicKey[][];
|
|
152
|
+
/** Per-vault keccak256 of WOTS keys, ready as `depositorWotsPkHash`. */
|
|
153
|
+
wotsPkHashes: Hex[];
|
|
154
|
+
/**
|
|
155
|
+
* Per-vault HTLC preimage hex (no 0x prefix). Re-derivable any time
|
|
156
|
+
* via `expandHashlockSecret(root, htlcVout)`; not persisted.
|
|
157
|
+
*/
|
|
158
|
+
htlcSecretHexes: string[];
|
|
159
|
+
}
|
|
160
|
+
export interface PreparePeginResult {
|
|
161
|
+
/** Broadcast-ready Pre-PegIn + per-vault PegIn txs. Safe to log. */
|
|
162
|
+
transaction: PreparePeginTransaction;
|
|
163
|
+
/**
|
|
164
|
+
* x-only depositor pubkey snapshot used end-to-end across sizing,
|
|
165
|
+
* vault-root derivation, and PSBT signing. Safe to persist; not
|
|
166
|
+
* sensitive. Reusing this snapshot downstream guarantees that
|
|
167
|
+
* derived secrets and signed PSBTs reference the same identity.
|
|
168
|
+
*/
|
|
169
|
+
depositorBtcPubkey: string;
|
|
170
|
+
/** Sensitive derived material — see {@link PreparePeginDerivedSecrets}. */
|
|
171
|
+
derivedSecrets: PreparePeginDerivedSecrets;
|
|
172
|
+
}
|
|
145
173
|
/**
|
|
146
174
|
* Parameters for signing and broadcasting a transaction.
|
|
147
175
|
*/
|
|
@@ -187,8 +215,9 @@ export interface PopSignature {
|
|
|
187
215
|
export interface RegisterPeginParams {
|
|
188
216
|
/**
|
|
189
217
|
* Funded, pre-witness Pre-PegIn tx hex — pass
|
|
190
|
-
* {@link
|
|
191
|
-
*
|
|
218
|
+
* {@link PreparePeginTransaction.fundedPrePeginTxHex} from
|
|
219
|
+
* {@link PreparePeginResult.transaction}. The contract-side parameter
|
|
220
|
+
* is named `unsignedPrePeginTx` but it stores the funded form.
|
|
192
221
|
*/
|
|
193
222
|
unsignedPrePeginTx: string;
|
|
194
223
|
/**
|
|
@@ -301,26 +330,34 @@ export declare class PeginManager {
|
|
|
301
330
|
*/
|
|
302
331
|
constructor(config: PeginManagerConfig);
|
|
303
332
|
/**
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
* 1. Get depositor BTC public key from wallet
|
|
309
|
-
* 2. Build unfunded Pre-PegIn transaction (HTLC output) using primitives
|
|
310
|
-
* 3. Select UTXOs to cover the HTLC value
|
|
311
|
-
* 4. Fund the Pre-PegIn transaction
|
|
312
|
-
* 5. Derive the PegIn transaction from the funded Pre-PegIn tx
|
|
313
|
-
* 6. Build PSBT for signing the PegIn input (HTLC leaf 0)
|
|
314
|
-
* 7. Sign via BTC wallet and extract depositor signature
|
|
333
|
+
* Prepare a peg-in: sizing pass → vault-root derivation (one wallet
|
|
334
|
+
* popup) → per-vault WOTS / hashlock derivation → commit pass with
|
|
335
|
+
* batch PSBT signing (one popup). Returns broadcast-ready txs, the
|
|
336
|
+
* pubkey snapshot, and the sensitive derived material.
|
|
315
337
|
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
* @param params - Pegin parameters including amount, HTLC params, UTXOs
|
|
320
|
-
* @returns Pegin result with funded Pre-PegIn tx, signed PegIn input, and signatures
|
|
321
|
-
* @throws Error if wallet operations fail or insufficient funds
|
|
338
|
+
* @throws If the wallet rejects, insufficient funds, or an internal
|
|
339
|
+
* invariant violation.
|
|
322
340
|
*/
|
|
323
341
|
preparePegin(params: PreparePeginParams): Promise<PreparePeginResult>;
|
|
342
|
+
/**
|
|
343
|
+
* Derive per-vault WOTS keys + HTLC preimages from the wallet root.
|
|
344
|
+
* Takes ownership of `root`: zeros the buffer (and per-vault secret
|
|
345
|
+
* buffers) before returning, regardless of how the caller exits.
|
|
346
|
+
*/
|
|
347
|
+
private expandPerVaultSecrets;
|
|
348
|
+
/**
|
|
349
|
+
* Build unfunded Pre-PegIn + select UTXOs. No PSBT signing.
|
|
350
|
+
*
|
|
351
|
+
* Returns the full selection result (UTXOs, fee, changeAmount) so the
|
|
352
|
+
* commit pass funds the broadcast tx with the exact same set used to
|
|
353
|
+
* build the vault-context funding-outpoints commitment. Re-running
|
|
354
|
+
* `selectUtxosForPegin` in the commit pass would be deterministic given
|
|
355
|
+
* the same inputs, but threading the result through guarantees the
|
|
356
|
+
* domain separator structurally matches the funded tx inputs.
|
|
357
|
+
*/
|
|
358
|
+
private prepareSizing;
|
|
359
|
+
/** Build PegIn txs and batch-sign their inputs with real hashlocks. */
|
|
360
|
+
private preparePeginCommit;
|
|
324
361
|
/**
|
|
325
362
|
* Signs multiple PSBTs using batch signing if available, falling back to sequential signing.
|
|
326
363
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeginManager.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/PeginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAML,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;
|
|
1
|
+
{"version":3,"file":"PeginManager.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/Pe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pC;;;;;OAKG;YACW,gBAAgB;IAsB9B;;;;;;OAMG;YACW,yBAAyB;IAmCvC;;;;;OAKG;IACG,qBAAqB,IAAI,OAAO,CAAC,YAAY,CAAC;YAyBtC,yBAAyB;IAkBvC;;;;OAIG;IACH,UAAU,IAAI,OAAO;IAIrB;;;;OAIG;IACH,uBAAuB,IAAI,OAAO;CAGnC"}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* @module managers
|
|
22
22
|
*/
|
|
23
23
|
export { PeginManager } from './PeginManager';
|
|
24
|
-
export type { PopSignature, PreparePeginResult, PreparePeginParams, PeginManagerConfig, RegisterPeginParams, RegisterPeginResult, SignAndBroadcastParams, BatchPeginRequestItem, RegisterPeginBatchParams, BatchPeginResultItem, RegisterPeginBatchResult, } from './PeginManager';
|
|
24
|
+
export type { PopSignature, PreparePeginResult, PreparePeginTransaction, PreparePeginDerivedSecrets, PreparePeginParams, PerVaultPeginData, PeginManagerConfig, RegisterPeginParams, RegisterPeginResult, SignAndBroadcastParams, BatchPeginRequestItem, RegisterPeginBatchParams, BatchPeginResultItem, RegisterPeginBatchResult, } from './PeginManager';
|
|
25
25
|
export { PayoutManager } from './PayoutManager';
|
|
26
26
|
export type { PayoutManagerConfig, PayoutSignatureResult, SignPayoutParams, } from './PayoutManager';
|
|
27
27
|
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;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACtD,YAAY,EACV,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,GAChB,MAAM,kDAAkD,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,GACzB,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"}
|
|
@@ -65,10 +65,6 @@ export interface MultiVaultDepositFlowInputs {
|
|
|
65
65
|
minDeposit: bigint;
|
|
66
66
|
/** Protocol maximum deposit per vault (satoshis) */
|
|
67
67
|
maxDeposit?: bigint;
|
|
68
|
-
/** Number of HTLC secret hexes — must match vaultAmounts.length */
|
|
69
|
-
htlcSecretHexesLength: number;
|
|
70
|
-
/** Number of depositor secret hashes — must match vaultAmounts.length */
|
|
71
|
-
depositorSecretHashesLength: number;
|
|
72
68
|
}
|
|
73
69
|
/**
|
|
74
70
|
* Check if deposit amount is within valid range and affordable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/deposit/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qFAAqF;IACrF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,+EAA+E;AAC/E,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,QAAQ,EAAE,CAAC;IAC3B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,6BAA6B,EAAE,MAAM,EAAE,CAAC;IACxC,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/deposit/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qFAAqF;IACrF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,+EAA+E;AAC/E,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,2BAA2B;IAC1C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,QAAQ,EAAE,CAAC;IAC3B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,6BAA6B,EAAE,MAAM,EAAE,CAAC;IACxC,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAcD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAoBT;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,CAuBlB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,uBAAuB,GAC9B,gBAAgB,CAmBlB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,iBAAiB,EAAE,MAAM,EAAE,EAC3B,kBAAkB,EAAE,MAAM,EAAE,GAC3B,gBAAgB,CAuBlB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EAAE,EACjB,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,CA+BlB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAU5E;AAqCD;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,2BAA2B,GAClC,IAAI,CA6BN"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../buildAndBroadcastRefund-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../buildAndBroadcastRefund-DkEpTFkv.cjs"),a=require("../../../signing-DHSXjhLM.cjs");exports.BIP68NotMatureError=t.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=t.ClaimerPegoutStatusValue;exports.activateVault=t.activateVault;exports.buildAndBroadcastRefund=t.buildAndBroadcastRefund;exports.computeHashlock=t.computeHashlock;exports.isDepositAmountValid=t.isDepositAmountValid;exports.isPegoutTerminalStatus=t.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=t.isRecognizedPegoutStatus;exports.pollAndSignPayouts=t.pollAndSignPayouts;exports.signDepositorGraph=t.signDepositorGraph;exports.submitWotsPublicKey=t.submitWotsPublicKey;exports.validateDepositAmount=t.validateDepositAmount;exports.validateMultiVaultDepositInputs=t.validateMultiVaultDepositInputs;exports.validateProviderSelection=t.validateProviderSelection;exports.validateRemainingCapacity=t.validateRemainingCapacity;exports.validateSecretAgainstHashlock=t.validateSecretAgainstHashlock;exports.validateVaultAmounts=t.validateVaultAmounts;exports.validateVaultProviderPubkey=t.validateVaultProviderPubkey;exports.waitForPeginStatus=t.waitForPeginStatus;exports.ContractStatus=a.ContractStatus;exports.PeginAction=a.PeginAction;exports.canPerformAction=a.canPerformAction;exports.getPeginProtocolState=a.getPeginProtocolState;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as s, C as e, a as i, m as o, h as u, i as l, l as r, k as n, p as d, b as c, s as P, v as g, g as m, d as p, c as v, j as S, e as A, f as V, w as b } from "../../../buildAndBroadcastRefund-
|
|
1
|
+
import { B as s, C as e, a as i, m as o, h as u, i as l, l as r, k as n, p as d, b as c, s as P, v as g, g as m, d as p, c as v, j as S, e as A, f as V, w as b } from "../../../buildAndBroadcastRefund-xWS8frc6.js";
|
|
2
2
|
import { C, P as h, a as k, g as y } from "../../../signing-BZigafm0.js";
|
|
3
3
|
export {
|
|
4
4
|
s as BIP68NotMatureError,
|
package/dist/tbv/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../challengeAssert-BM8m9gPM.cjs"),P=require("@babylonlabs-io/babylon-tbv-rust-wasm"),d=require("../payout-DP6KMFP1.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../challengeAssert-BM8m9gPM.cjs"),P=require("@babylonlabs-io/babylon-tbv-rust-wasm"),d=require("../payout-DP6KMFP1.cjs"),o=require("../bitcoin-DIN0OupO.cjs"),l=require("../signing-DHSXjhLM.cjs"),u=require("../validation-u8W7Lp2x.cjs"),t=require("../buildAndBroadcastRefund-DkEpTFkv.cjs"),a=require("../fundPeginTransaction-DaWoYCgO.cjs"),i=require("../psbtInputFields-CB8hqjQ5.cjs"),r=require("../PeginManager-Da4uSHzl.cjs"),e=require("../vault-registry-reader-DdruADqa.cjs"),s=require("../types-jmEyzzhY.cjs");exports.buildChallengeAssertPsbt=n.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=n.buildDepositorPayoutPsbt;exports.buildNoPayoutPsbt=n.buildNoPayoutPsbt;exports.buildPeginInputPsbt=n.buildPeginInputPsbt;exports.buildPeginTxFromFundedPrePegin=n.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=n.buildPrePeginPsbt;exports.computeNumLocalChallengers=n.computeNumLocalChallengers;exports.extractPeginInputSignature=n.extractPeginInputSignature;exports.finalizePeginInputPsbt=n.finalizePeginInputPsbt;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>P.computeMinClaimValue});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>P.deriveVaultId});exports.buildPayoutPsbt=d.buildPayoutPsbt;exports.buildRefundPsbt=d.buildRefundPsbt;exports.createPayoutScript=d.createPayoutScript;exports.extractPayoutSignature=d.extractPayoutSignature;exports.deriveNativeSegwitAddress=o.deriveNativeSegwitAddress;exports.deriveTaprootAddress=o.deriveTaprootAddress;exports.ensureHexPrefix=o.ensureHexPrefix;exports.formatSatoshisToBtc=o.formatSatoshisToBtc;exports.getNetwork=o.getNetwork;exports.hexToUint8Array=o.hexToUint8Array;exports.isAddressFromPublicKey=o.isAddressFromPublicKey;exports.isValidHex=o.isValidHex;exports.processPublicKeyToXOnly=o.processPublicKeyToXOnly;exports.stripHexPrefix=o.stripHexPrefix;exports.toXOnly=o.toXOnly;exports.uint8ArrayToHex=o.uint8ArrayToHex;exports.validateWalletPubkey=o.validateWalletPubkey;exports.ContractStatus=l.ContractStatus;exports.PeginAction=l.PeginAction;exports.canPerformAction=l.canPerformAction;exports.createTaprootScriptPathSignOptions=l.createTaprootScriptPathSignOptions;exports.getPeginProtocolState=l.getPeginProtocolState;exports.BITCOIN_ADDRESS_RE=u.BITCOIN_ADDRESS_RE;exports.HEX_RE=u.HEX_RE;exports.KNOWN_SCRIPT_PREFIXES=u.KNOWN_SCRIPT_PREFIXES;exports.MAX_REASONABLE_FEE_SATS=u.MAX_REASONABLE_FEE_SATS;exports.TXID_RE=u.TXID_RE;exports.BIP68NotMatureError=t.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=t.ClaimerPegoutStatusValue;exports.PayoutManager=t.PayoutManager;exports.activateVault=t.activateVault;exports.buildAndBroadcastRefund=t.buildAndBroadcastRefund;exports.computeHashlock=t.computeHashlock;exports.isDepositAmountValid=t.isDepositAmountValid;exports.isPegoutTerminalStatus=t.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=t.isRecognizedPegoutStatus;exports.pollAndSignPayouts=t.pollAndSignPayouts;exports.signDepositorGraph=t.signDepositorGraph;exports.submitWotsPublicKey=t.submitWotsPublicKey;exports.validateDepositAmount=t.validateDepositAmount;exports.validateMultiVaultDepositInputs=t.validateMultiVaultDepositInputs;exports.validateProviderSelection=t.validateProviderSelection;exports.validateRemainingCapacity=t.validateRemainingCapacity;exports.validateSecretAgainstHashlock=t.validateSecretAgainstHashlock;exports.validateVaultAmounts=t.validateVaultAmounts;exports.validateVaultProviderPubkey=t.validateVaultProviderPubkey;exports.waitForPeginStatus=t.waitForPeginStatus;exports.BTC_DUST_SAT=a.BTC_DUST_SAT;exports.DUST_THRESHOLD=a.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=a.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=a.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=a.MAX_NON_LEGACY_OUTPUT_SIZE;exports.P2TR_INPUT_SIZE=a.P2TR_INPUT_SIZE;exports.PEGIN_AUTH_ANCHOR_OUTPUTS=a.PEGIN_AUTH_ANCHOR_OUTPUTS;exports.PEGIN_FIXED_OUTPUTS=a.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=a.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=a.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=a.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=a.fundPeginTransaction;exports.parseUnfundedWasmTransaction=a.parseUnfundedWasmTransaction;exports.peginOutputCount=a.peginOutputCount;exports.rateBasedTxBufferFee=a.rateBasedTxBufferFee;exports.BitcoinScriptType=i.BitcoinScriptType;exports.UtxoNotAvailableError=i.UtxoNotAvailableError;exports.assertUtxosAvailable=i.assertUtxosAvailable;exports.calculateBtcTxHash=i.calculateBtcTxHash;exports.collectReservedUtxoRefs=i.collectReservedUtxoRefs;exports.extractInputsFromTransaction=i.extractInputsFromTransaction;exports.getDustThreshold=i.getDustThreshold;exports.getPsbtInputFields=i.getPsbtInputFields;exports.getScriptType=i.getScriptType;exports.selectUtxosForDeposit=i.selectUtxosForDeposit;exports.selectUtxosForPegin=i.selectUtxosForPegin;exports.shouldAddChangeOutput=i.shouldAddChangeOutput;exports.validateUtxosAvailable=i.validateUtxosAvailable;exports.CONTRACT_ERRORS=r.CONTRACT_ERRORS;exports.PeginManager=r.PeginManager;exports.VAULT_APP_NAME=r.VAULT_APP_NAME;exports.buildFundingOutpointsCommitment=r.buildFundingOutpointsCommitment;exports.buildVaultContext=r.buildVaultContext;exports.computeWotsBlockPublicKeysHash=r.computeWotsBlockPublicKeysHash;exports.deriveVaultRoot=r.deriveVaultRoot;exports.deriveWotsBlocksFromSeed=r.deriveWotsBlocksFromSeed;exports.expandAuthAnchor=r.expandAuthAnchor;exports.expandHashlockSecret=r.expandHashlockSecret;exports.expandWotsSeed=r.expandWotsSeed;exports.extractErrorData=r.extractErrorData;exports.getContractErrorMessage=r.getContractErrorMessage;exports.handleContractError=r.handleContractError;exports.isKnownContractError=r.isKnownContractError;exports.isWotsMismatchError=r.isWotsMismatchError;exports.ApplicationRegistryABI=e.ApplicationRegistryABI;exports.MEMPOOL_API_URLS=e.MEMPOOL_API_URLS;exports.ProtocolParamsABI=e.ProtocolParamsABI;exports.ServerIdentityError=e.ServerIdentityError;exports.VaultProviderRpcClient=e.VaultProviderRpcClient;exports.ViemProtocolParamsReader=e.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=e.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=e.ViemVaultKeeperReader;exports.ViemVaultRegistryReader=e.ViemVaultRegistryReader;exports.VpResponseValidationError=e.VpResponseValidationError;exports.VpTokenProvider=e.VpTokenProvider;exports.getAddressTxs=e.getAddressTxs;exports.getAddressUtxos=e.getAddressUtxos;exports.getMempoolApiUrl=e.getMempoolApiUrl;exports.getNetworkFees=e.getNetworkFees;exports.getTxHex=e.getTxHex;exports.getTxInfo=e.getTxInfo;exports.getUtxoInfo=e.getUtxoInfo;exports.pushTx=e.pushTx;exports.resolveProtocolAddresses=e.resolveProtocolAddresses;exports.validateRequestDepositorClaimerArtifactsResponse=e.validateRequestDepositorClaimerArtifactsResponse;exports.verifyServerIdentity=e.verifyServerIdentity;exports.BTCVaultRegistryABI=s.BTCVaultRegistryABI;exports.DaemonStatus=s.DaemonStatus;exports.JSON_RPC_ERROR_CODES=s.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=s.JsonRpcClient;exports.JsonRpcError=s.JsonRpcError;exports.POST_WOTS_STATUSES=s.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=s.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=s.RpcErrorCode;exports.VP_TERMINAL_STATUSES=s.VP_TERMINAL_STATUSES;exports.VP_TRANSIENT_STATUSES=s.VP_TRANSIENT_STATUSES;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/tbv/index.js
CHANGED
|
@@ -4,12 +4,12 @@ import { a as S, b as A, c as E, e as _ } from "../payout-B_fvQU3q.js";
|
|
|
4
4
|
import { d as R, a as m, e as x, f as b, g as I, h as f, i as v, b as C, p as U, s as O, t as V, u as h, v as y } from "../bitcoin-B-Y0DlqR.js";
|
|
5
5
|
import { C as F, P as B, a as D, c as M, g as H } from "../signing-BZigafm0.js";
|
|
6
6
|
import { B as k, H as W, K as X, M as K, T as w } from "../validation-CxqROCno.js";
|
|
7
|
-
import { B as Y, C as J, P as j, a as Z, m as z, h as q, i as Q, l as $, k as aa, p as sa, b as ea, s as ta, v as ra, g as oa, d as ia, c as na, j as la, e as ua, f as da, w as Pa } from "../buildAndBroadcastRefund-
|
|
7
|
+
import { B as Y, C as J, P as j, a as Z, m as z, h as q, i as Q, l as $, k as aa, p as sa, b as ea, s as ta, v as ra, g as oa, d as ia, c as na, j as la, e as ua, f as da, w as Pa } from "../buildAndBroadcastRefund-xWS8frc6.js";
|
|
8
8
|
import { B as Ta, D as pa, F as Sa, L as Aa, M as Ea, P as _a, b as ga, a as Ra, S as ma, T as xa, W as ba, f as Ia, c as fa, p as va, r as Ca } from "../fundPeginTransaction-oV-dNJOU.js";
|
|
9
9
|
import { B as Oa, U as Va, a as ha, f as ya, c as Na, e as Fa, g as Ba, i as Da, h as Ma, s as Ha, b as La, d as ka, v as Wa } from "../psbtInputFields-DeTFSJOq.js";
|
|
10
|
-
import { C as Ka, P as wa, V as Ga, k as Ya, l as Ja, c as ja, m as Za, d as za, b as qa, f as Qa, j as $a, e as as, g as ss, h as es, i as ts, a as rs } from "../
|
|
11
|
-
import { A as is, M as ns, P as ls, S as us, V as ds, k as Ps, l as cs, m as Ts, n as ps, h as Ss, j as As, g as Es, a as _s, b as gs, c as Rs, d as ms, e as xs, f as bs, p as Is, r as fs, v as vs, i as Cs } from "../vault-registry-reader-
|
|
12
|
-
import { B as Os, D as Vs, b as hs, J as ys, a as Ns, d as Fs, P as Bs, R as Ds, c as Ms, V as Hs } from "../types-
|
|
10
|
+
import { C as Ka, P as wa, V as Ga, k as Ya, l as Ja, c as ja, m as Za, d as za, b as qa, f as Qa, j as $a, e as as, g as ss, h as es, i as ts, a as rs } from "../PeginManager-DzMSIQ0I.js";
|
|
11
|
+
import { A as is, M as ns, P as ls, S as us, V as ds, k as Ps, l as cs, m as Ts, n as ps, h as Ss, j as As, g as Es, a as _s, b as gs, c as Rs, d as ms, e as xs, f as bs, p as Is, r as fs, v as vs, i as Cs } from "../vault-registry-reader-BywZhqJL.js";
|
|
12
|
+
import { B as Os, D as Vs, b as hs, J as ys, a as Ns, d as Fs, P as Bs, R as Ds, c as Ms, V as Hs } from "../types-CnG3JsRs.js";
|
|
13
13
|
export {
|
|
14
14
|
is as ApplicationRegistryABI,
|
|
15
15
|
Y as BIP68NotMatureError,
|
|
@@ -17,6 +17,7 @@ export interface MockBitcoinWalletConfig {
|
|
|
17
17
|
*/
|
|
18
18
|
deriveContextHash?: (appName: string, context: string) => Promise<string>;
|
|
19
19
|
}
|
|
20
|
+
/** Mock Bitcoin wallet for testing. */
|
|
20
21
|
export declare class MockBitcoinWallet implements BitcoinWallet {
|
|
21
22
|
private config;
|
|
22
23
|
constructor(config?: MockBitcoinWalletConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MockBitcoinWallet.d.ts","sourceRoot":"","sources":["../../src/testing/MockBitcoinWallet.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACpF,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EAChB,MAAM,4CAA4C,CAAC;AAGpD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO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GAC9B,OAAO,CAAC,MAAM,CAAC;IAiBZ,UAAU,IAAI,OAAO,CAAC,cAAc,CAAC;IAIrC,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1E,6DAA6D;IAC7D,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI;IAO7D,uCAAuC;IACvC,KAAK,IAAI,IAAI;CAGd"}
|
package/dist/testing/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var d=Object.defineProperty;var l=(i,t,e)=>t in i?d(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var
|
|
1
|
+
"use strict";var d=Object.defineProperty;var l=(i,t,e)=>t in i?d(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var r=(i,t,e)=>l(i,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../sha2-CsTynrfJ.cjs"),o=require("buffer"),g=require("../bitcoin-DIN0OupO.cjs"),q=require("../shared/index.cjs"),f=async(i,t)=>{const e=new TextEncoder,n=e.encode(i),s=e.encode(t),a=new Uint8Array(4+n.length+4+s.length),c=new DataView(a.buffer);return c.setUint32(0,n.length),a.set(n,4),c.setUint32(4+n.length,s.length),a.set(s,4+n.length+4),g.uint8ArrayToHex(u.sha256(a))},h={publicKeyHex:"a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",address:"tb1pqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkx6jks",network:q.BitcoinNetworks.SIGNET,shouldFailSigning:!1,deriveContextHash:f};class b{constructor(t={}){r(this,"config");this.config={...h,...t.publicKeyHex?{publicKeyHex:t.publicKeyHex}:{},...t.address?{address:t.address}:{},...t.network!==void 0?{network:t.network}:{},...t.shouldFailSigning!==void 0?{shouldFailSigning:t.shouldFailSigning}:{},...t.deriveContextHash?{deriveContextHash:t.deriveContextHash}:{}}}async getPublicKeyHex(){return this.config.publicKeyHex}async getAddress(){return this.config.address}async signPsbt(t){if(this.config.shouldFailSigning)throw new Error("Mock signing failed");if(!t||t.length===0)throw new Error("Invalid PSBT: empty hex string");return t+"deadbeef"}async signPsbts(t,e){const n=[];for(const s of t){const a=await this.signPsbt(s);n.push(a)}return n}async signMessage(t,e){if(this.config.shouldFailSigning)throw new Error("Mock signing failed");if(!t||t.length===0)throw new Error("Invalid message: empty string");return o.Buffer.from(`mock-signature-${e}-${t}-${this.config.publicKeyHex}`).toString("base64")}async getNetwork(){return this.config.network}async deriveContextHash(t,e){return this.config.deriveContextHash(t,e)}updateConfig(t){this.config={...this.config,...t}}reset(){this.config={...h}}}class y{constructor(t={}){r(this,"account");r(this,"chain");r(this,"shouldFailOperations");r(this,"transactionDelay");r(this,"nonce",0);this.account={address:t.address||"0x742d35cc6634c0532925a3b844bc9e7595f0beb0"},this.chain={id:t.chainId??11155111},this.shouldFailOperations=t.shouldFailOperations??!1,this.transactionDelay=t.transactionDelay??0,this.signMessage=this.signMessage.bind(this),this.sendTransaction=this.sendTransaction.bind(this)}async signMessage(t){const e=t.message,n=t.account||this.account.address;if(this.shouldFailOperations)throw new Error("Mock signing failed");if(!e||e.length===0)throw new Error("Invalid message: empty string");const s=`personal_sign:${e}-${n}-${this.chain.id}`;return`0x${o.Buffer.from(s).toString("hex").slice(0,130).padEnd(130,"0")}`}async sendTransaction(t){var s;if(this.shouldFailOperations)throw new Error("Mock transaction failed");if(!t.to)throw new Error("Invalid transaction: missing 'to' address");this.transactionDelay>0&&await new Promise(a=>setTimeout(a,this.transactionDelay)),this.nonce++;const e=JSON.stringify({from:this.account.address,to:t.to,value:((s=t.value)==null?void 0:s.toString())||"0",nonce:this.nonce,chainId:this.chain.id});return`0x${o.Buffer.from(e).toString("hex").slice(0,64).padEnd(64,"0")}`}updateConfig(t){t.address!==void 0&&(this.account.address=t.address),t.chainId!==void 0&&(this.chain.id=t.chainId),t.shouldFailOperations!==void 0&&(this.shouldFailOperations=t.shouldFailOperations),t.transactionDelay!==void 0&&(this.transactionDelay=t.transactionDelay)}reset(){this.account.address="0x742d35cc6634c0532925a3b844bc9e7595f0beb0",this.chain.id=11155111,this.shouldFailOperations=!1,this.transactionDelay=0,this.nonce=0}getCurrentNonce(){return this.nonce}}exports.MockBitcoinWallet=b;exports.MockEthereumWallet=y;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|