@babylonlabs-io/ts-sdk 0.28.0 → 0.29.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/PeginManager-DcjXiKYC.cjs +2 -0
- package/dist/PeginManager-DcjXiKYC.cjs.map +1 -0
- package/dist/{deriveVaultRoot-DAMZDqg-.js → PeginManager-Dj6oDaH5.js} +1275 -1145
- package/dist/PeginManager-Dj6oDaH5.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 +73 -33
- 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/managers/pegin/__tests__/assertAuthAnchorOpReturn.test.d.ts +2 -0
- package/dist/tbv/core/managers/pegin/__tests__/assertAuthAnchorOpReturn.test.d.ts.map +1 -0
- package/dist/tbv/core/managers/pegin/__tests__/expandPerVaultSecrets.test.d.ts +2 -0
- package/dist/tbv/core/managers/pegin/__tests__/expandPerVaultSecrets.test.d.ts.map +1 -0
- package/dist/tbv/core/managers/pegin/__tests__/normalizeWalletInputs.test.d.ts +2 -0
- package/dist/tbv/core/managers/pegin/__tests__/normalizeWalletInputs.test.d.ts.map +1 -0
- package/dist/tbv/core/managers/pegin/__tests__/signPsbtsWithFallback.test.d.ts +2 -0
- package/dist/tbv/core/managers/pegin/__tests__/signPsbtsWithFallback.test.d.ts.map +1 -0
- package/dist/tbv/core/managers/pegin/assertAuthAnchorOpReturn.d.ts +25 -0
- package/dist/tbv/core/managers/pegin/assertAuthAnchorOpReturn.d.ts.map +1 -0
- package/dist/tbv/core/managers/pegin/expandPerVaultSecrets.d.ts +25 -0
- package/dist/tbv/core/managers/pegin/expandPerVaultSecrets.d.ts.map +1 -0
- package/dist/tbv/core/managers/pegin/index.d.ts +12 -0
- package/dist/tbv/core/managers/pegin/index.d.ts.map +1 -0
- package/dist/tbv/core/managers/pegin/normalizeWalletInputs.d.ts +23 -0
- package/dist/tbv/core/managers/pegin/normalizeWalletInputs.d.ts.map +1 -0
- package/dist/tbv/core/managers/pegin/signPsbtsWithFallback.d.ts +12 -0
- package/dist/tbv/core/managers/pegin/signPsbtsWithFallback.d.ts.map +1 -0
- 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-DcjXiKYC.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-Dj6oDaH5.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,46 @@ 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
|
+
* Raw 32-byte auth-anchor preimage as 64-char lowercase hex (no `0x`).
|
|
161
|
+
* Sent to the VP via `auth_createDepositorToken` to obtain a bearer
|
|
162
|
+
* token; the VP validates `SHA256(authAnchorHex) === OP_RETURN_PUSH32`
|
|
163
|
+
* in the broadcast Pre-PegIn. Reveal is intentional: once exposed
|
|
164
|
+
* the anchor is public, but its scope is bound to a single
|
|
165
|
+
* `peginTxid`. Domain-separated from `htlcSecretHexes` and
|
|
166
|
+
* `perVaultWotsKeys` via the HKDF `info` label, so revealing it does
|
|
167
|
+
* not weaken the other derived secrets.
|
|
168
|
+
*/
|
|
169
|
+
authAnchorHex: string;
|
|
170
|
+
}
|
|
171
|
+
export interface PreparePeginResult {
|
|
172
|
+
/** Broadcast-ready Pre-PegIn + per-vault PegIn txs. Safe to log. */
|
|
173
|
+
transaction: PreparePeginTransaction;
|
|
174
|
+
/**
|
|
175
|
+
* x-only depositor pubkey snapshot used end-to-end across sizing,
|
|
176
|
+
* vault-root derivation, and PSBT signing. Safe to persist; not
|
|
177
|
+
* sensitive. Reusing this snapshot downstream guarantees that
|
|
178
|
+
* derived secrets and signed PSBTs reference the same identity.
|
|
179
|
+
*/
|
|
180
|
+
depositorBtcPubkey: string;
|
|
181
|
+
/** Sensitive derived material — see {@link PreparePeginDerivedSecrets}. */
|
|
182
|
+
derivedSecrets: PreparePeginDerivedSecrets;
|
|
183
|
+
}
|
|
145
184
|
/**
|
|
146
185
|
* Parameters for signing and broadcasting a transaction.
|
|
147
186
|
*/
|
|
@@ -187,8 +226,9 @@ export interface PopSignature {
|
|
|
187
226
|
export interface RegisterPeginParams {
|
|
188
227
|
/**
|
|
189
228
|
* Funded, pre-witness Pre-PegIn tx hex — pass
|
|
190
|
-
* {@link
|
|
191
|
-
*
|
|
229
|
+
* {@link PreparePeginTransaction.fundedPrePeginTxHex} from
|
|
230
|
+
* {@link PreparePeginResult.transaction}. The contract-side parameter
|
|
231
|
+
* is named `unsignedPrePeginTx` but it stores the funded form.
|
|
192
232
|
*/
|
|
193
233
|
unsignedPrePeginTx: string;
|
|
194
234
|
/**
|
|
@@ -301,34 +341,34 @@ export declare class PeginManager {
|
|
|
301
341
|
*/
|
|
302
342
|
constructor(config: PeginManagerConfig);
|
|
303
343
|
/**
|
|
304
|
-
*
|
|
305
|
-
*
|
|
344
|
+
* Prepare a peg-in: sizing pass → vault-root derivation (one wallet
|
|
345
|
+
* popup) → per-vault WOTS / hashlock derivation → commit pass with
|
|
346
|
+
* batch PSBT signing (one popup). Returns broadcast-ready txs, the
|
|
347
|
+
* pubkey snapshot, and the sensitive derived material.
|
|
306
348
|
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
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
|
|
315
|
-
*
|
|
316
|
-
* The returned `fundedPrePeginTxHex` is funded but unsigned (inputs unsigned).
|
|
317
|
-
* Use `signAndBroadcast()` AFTER registering on Ethereum to broadcast it.
|
|
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
|
|
349
|
+
* @throws If the wallet rejects, insufficient funds, or an internal
|
|
350
|
+
* invariant violation.
|
|
322
351
|
*/
|
|
323
352
|
preparePegin(params: PreparePeginParams): Promise<PreparePeginResult>;
|
|
324
353
|
/**
|
|
325
|
-
*
|
|
354
|
+
* Build unfunded Pre-PegIn + select UTXOs. No PSBT signing.
|
|
326
355
|
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
|
|
331
|
-
|
|
356
|
+
* Returns the full selection result (UTXOs, fee, changeAmount) so the
|
|
357
|
+
* commit pass funds the broadcast tx with the exact same set used to
|
|
358
|
+
* build the vault-context funding-outpoints commitment. Re-running
|
|
359
|
+
* `selectUtxosForPegin` in the commit pass would be deterministic given
|
|
360
|
+
* the same inputs, but threading the result through guarantees the
|
|
361
|
+
* domain separator structurally matches the funded tx inputs.
|
|
362
|
+
*
|
|
363
|
+
* Sizing runs before the wallet popup, so neither the real per-vault
|
|
364
|
+
* hashlocks nor the real `authAnchorHash` are known yet. Both slots
|
|
365
|
+
* are filled with a 32-byte placeholder; the commit pass swaps in the
|
|
366
|
+
* real values. Output budget is identical (32-byte push regardless of
|
|
367
|
+
* content), so UTXO selection is invariant under substitution.
|
|
368
|
+
*/
|
|
369
|
+
private prepareSizing;
|
|
370
|
+
/** Build PegIn txs and batch-sign their inputs with real hashlocks. */
|
|
371
|
+
private preparePeginCommit;
|
|
332
372
|
/**
|
|
333
373
|
* Signs and broadcasts a funded peg-in transaction to the Bitcoin network.
|
|
334
374
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeginManager.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/PeginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"PeginManager.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/managers/PeginManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAcH,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;AACpF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAG1E,OAAO,EAQL,KAAK,OAAO,EACb,MAAM,eAAe,CAAC;AAQvB,OAAO,EAOL,KAAK,IAAI,EAEV,MAAM,UAAU,CAAC;AAsBlB;;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,MAAM,EAAE,CAAC;IAEzC;;;OAGG;IACH,6BAA6B,EAAE,SAAS,MAAM,EAAE,CAAC;IAEjD;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,cA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E,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC;IAqJ/B;;;;;;;;;OASG;IACG,yBAAyB,CAC7B,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,wBAAwB,CAAC;IAuJpC;;;;;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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertAuthAnchorOpReturn.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/managers/pegin/__tests__/assertAuthAnchorOpReturn.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expandPerVaultSecrets.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/managers/pegin/__tests__/expandPerVaultSecrets.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeWalletInputs.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/managers/pegin/__tests__/normalizeWalletInputs.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signPsbtsWithFallback.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/managers/pegin/__tests__/signPsbtsWithFallback.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural verifier for the auth-anchor OP_RETURN in a funded
|
|
3
|
+
* Pre-PegIn transaction.
|
|
4
|
+
*
|
|
5
|
+
* @module managers/pegin/assertAuthAnchorOpReturn
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Verify the broadcast Pre-PegIn carries the expected OP_RETURN
|
|
9
|
+
* commitment to the auth anchor.
|
|
10
|
+
*
|
|
11
|
+
* The OP_RETURN sits at `vout = vaultCount` (right after the per-vault
|
|
12
|
+
* HTLC outputs and before the depositor-claim/change outputs) and
|
|
13
|
+
* pushes the 32-byte `SHA256(authAnchor)`. The script encoding is
|
|
14
|
+
* exactly `OP_RETURN || PUSH32 || <32 bytes>` (34 bytes). A
|
|
15
|
+
* non-conformant WASM build that omitted the OP_RETURN, swapped its
|
|
16
|
+
* position, or changed its push payload would let the depositor
|
|
17
|
+
* obtain a valid bearer token for a Pre-PegIn whose on-chain
|
|
18
|
+
* commitment doesn't actually bind the anchor — degrading the auth
|
|
19
|
+
* from on-chain-bound to a shared secret. Fail closed.
|
|
20
|
+
*
|
|
21
|
+
* @throws If the OP_RETURN is missing, mis-located, mis-encoded, or
|
|
22
|
+
* pushes a payload other than `expectedAuthAnchorHashHex`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function assertAuthAnchorOpReturn(fundedPrePeginTxHex: string, vaultCount: number, expectedAuthAnchorHashHex: string): void;
|
|
25
|
+
//# sourceMappingURL=assertAuthAnchorOpReturn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertAuthAnchorOpReturn.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/managers/pegin/assertAuthAnchorOpReturn.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CACtC,mBAAmB,EAAE,MAAM,EAC3B,UAAU,EAAE,MAAM,EAClB,yBAAyB,EAAE,MAAM,GAChC,IAAI,CAwCN"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
import { WotsBlockPublicKey } from '../../clients/vault-provider/types';
|
|
3
|
+
/**
|
|
4
|
+
* Result of {@link expandPerVaultSecrets}.
|
|
5
|
+
*/
|
|
6
|
+
export interface PerVaultExpansionResult {
|
|
7
|
+
perVaultWotsKeys: WotsBlockPublicKey[][];
|
|
8
|
+
/** Keccak256 of WOTS keys, ready as `depositorWotsPkHash` (0x-prefixed). */
|
|
9
|
+
wotsPkHashes: Hex[];
|
|
10
|
+
/** HTLC preimage hex per vault (no 0x prefix). */
|
|
11
|
+
htlcSecretHexes: string[];
|
|
12
|
+
/** SHA-256 of each HTLC preimage as 64-char hex (no 0x prefix). */
|
|
13
|
+
hashlocks: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Derive per-vault WOTS keys + HTLC preimages from the wallet root.
|
|
17
|
+
*
|
|
18
|
+
* Takes ownership of `root`: zeros the buffer (and per-vault secret
|
|
19
|
+
* buffers) before returning, regardless of how the caller exits.
|
|
20
|
+
*
|
|
21
|
+
* @param root 32-byte wallet-derived root from `deriveVaultRoot`.
|
|
22
|
+
* @param vaultCount Number of vaults (= length of `amounts`).
|
|
23
|
+
*/
|
|
24
|
+
export declare function expandPerVaultSecrets(root: Uint8Array, vaultCount: number): Promise<PerVaultExpansionResult>;
|
|
25
|
+
//# sourceMappingURL=expandPerVaultSecrets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expandPerVaultSecrets.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/managers/pegin/expandPerVaultSecrets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAe7E;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,gBAAgB,EAAE,kBAAkB,EAAE,EAAE,CAAC;IACzC,4EAA4E;IAC5E,YAAY,EAAE,GAAG,EAAE,CAAC;IACpB,kDAAkD;IAClD,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,mEAAmE;IACnE,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,uBAAuB,CAAC,CA+BlC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal-only re-exports for the Pre-PegIn / PegIn building blocks.
|
|
3
|
+
* Consumers should depend on `PeginManager`; these helpers exist to
|
|
4
|
+
* keep that file a thin coordinator.
|
|
5
|
+
*
|
|
6
|
+
* @module managers/pegin
|
|
7
|
+
*/
|
|
8
|
+
export { assertAuthAnchorOpReturn } from './assertAuthAnchorOpReturn';
|
|
9
|
+
export { expandPerVaultSecrets, type PerVaultExpansionResult, } from './expandPerVaultSecrets';
|
|
10
|
+
export { normalizePopSignature, normalizeXOnlyPubkey, } from './normalizeWalletInputs';
|
|
11
|
+
export { signPsbtsWithFallback } from './signPsbtsWithFallback';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/managers/pegin/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EACL,qBAAqB,EACrB,KAAK,uBAAuB,GAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* Normalize a wallet-returned BTC public key to the canonical x-only
|
|
4
|
+
* 64-char lowercase hex form (no 0x prefix).
|
|
5
|
+
*
|
|
6
|
+
* Throws on empty/non-string input. Idempotent on x-only input.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeXOnlyPubkey(raw: unknown): string;
|
|
9
|
+
/**
|
|
10
|
+
* Normalize a wallet-returned BIP-322 signature into 0x-prefixed hex.
|
|
11
|
+
*
|
|
12
|
+
* Accepts:
|
|
13
|
+
* - 0x-prefixed lowercase/uppercase hex
|
|
14
|
+
* - unprefixed hex (wins over base64 when input is pure `[0-9a-fA-F]+`)
|
|
15
|
+
* - canonical standard base64 (`[A-Za-z0-9+/]` with `=` padding to a
|
|
16
|
+
* multiple of 4 and no non-canonical encodings)
|
|
17
|
+
*
|
|
18
|
+
* Rejects URL-safe base64 (`-`/`_`) and base64 without padding. Wallets
|
|
19
|
+
* known to return BIP-322 signatures (Keystone, UniSat, OKX, OneKey,
|
|
20
|
+
* Unisat) all use standard base64; URL-safe is an explicit non-goal.
|
|
21
|
+
*/
|
|
22
|
+
export declare function normalizePopSignature(raw: unknown): Hex;
|
|
23
|
+
//# sourceMappingURL=normalizeWalletInputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeWalletInputs.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/managers/pegin/normalizeWalletInputs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAQhC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAQzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAoCvD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BitcoinWallet, SignPsbtOptions } from '../../../../shared/wallets';
|
|
2
|
+
/**
|
|
3
|
+
* Sign multiple PSBTs against a wallet. Wallets exposing native batch
|
|
4
|
+
* signing (e.g. UniSat) sign all PSBTs in a single interaction; others
|
|
5
|
+
* (Ledger, AppKit) loop `signPsbt` internally, so the popup UX depends
|
|
6
|
+
* on the wallet adapter.
|
|
7
|
+
*
|
|
8
|
+
* @throws If `signPsbts` returns a different number of signed PSBTs
|
|
9
|
+
* than were submitted.
|
|
10
|
+
*/
|
|
11
|
+
export declare function signPsbtsWithFallback(wallet: BitcoinWallet, psbtsHexes: string[], options: SignPsbtOptions[]): Promise<string[]>;
|
|
12
|
+
//# sourceMappingURL=signPsbtsWithFallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signPsbtsWithFallback.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/managers/pegin/signPsbtsWithFallback.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EAChB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,MAAM,EAAE,EACpB,OAAO,EAAE,eAAe,EAAE,GACzB,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBnB"}
|
|
@@ -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,U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