@babylonlabs-io/ts-sdk 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -12
- package/dist/bitcoin-CNnPFU6Y.cjs +2 -0
- package/dist/bitcoin-CNnPFU6Y.cjs.map +1 -0
- package/dist/{constants-Q7v2O7Ps.js → bitcoin-nOOgeRyl.js} +64 -76
- package/dist/bitcoin-nOOgeRyl.js.map +1 -0
- package/dist/buildAndBroadcastRefund-DWEQvj9T.cjs +2 -0
- package/dist/buildAndBroadcastRefund-DWEQvj9T.cjs.map +1 -0
- package/dist/buildAndBroadcastRefund-DnTQkCgG.js +1331 -0
- package/dist/buildAndBroadcastRefund-DnTQkCgG.js.map +1 -0
- package/dist/challengeAssert-D1lpvuMv.js +283 -0
- package/dist/challengeAssert-D1lpvuMv.js.map +1 -0
- package/dist/challengeAssert-nYlgeAI8.cjs +2 -0
- package/dist/challengeAssert-nYlgeAI8.cjs.map +1 -0
- package/dist/errors-BZON3Wmn.cjs +2 -0
- package/dist/errors-BZON3Wmn.cjs.map +1 -0
- package/dist/{errors-aMocmFr-.js → errors-CHY4WNi-.js} +98 -97
- package/dist/errors-CHY4WNi-.js.map +1 -0
- package/dist/fundPeginTransaction-BLYXxLBv.js +70 -0
- package/dist/fundPeginTransaction-BLYXxLBv.js.map +1 -0
- package/dist/fundPeginTransaction-DxNOeyNI.cjs +2 -0
- package/dist/fundPeginTransaction-DxNOeyNI.cjs.map +1 -0
- package/dist/index-BpXpESWu.cjs +2 -0
- package/dist/index-BpXpESWu.cjs.map +1 -0
- package/dist/{index-BvFLf3vm.js → index-CFwoGJNQ.js} +146 -518
- package/dist/index-CFwoGJNQ.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +133 -109
- package/dist/payout-DzGsAnhf.js +261 -0
- package/dist/payout-DzGsAnhf.js.map +1 -0
- package/dist/payout-RFIh7GLN.cjs +2 -0
- package/dist/payout-RFIh7GLN.cjs.map +1 -0
- package/dist/psbtInputFields-C-zYR1z7.cjs +2 -0
- package/dist/psbtInputFields-C-zYR1z7.cjs.map +1 -0
- package/dist/psbtInputFields-Dx41_IoI.js +229 -0
- package/dist/psbtInputFields-Dx41_IoI.js.map +1 -0
- package/dist/signing-DeWVBl7m.js +64 -0
- package/dist/signing-DeWVBl7m.js.map +1 -0
- package/dist/signing-cl-lowxV.cjs +2 -0
- package/dist/signing-cl-lowxV.cjs.map +1 -0
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +2 -2
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.d.ts +3 -1
- package/dist/tbv/core/index.d.ts.map +1 -1
- package/dist/tbv/core/index.js +130 -106
- package/dist/tbv/core/managers/PeginManager.d.ts +1 -1
- package/dist/tbv/core/primitives/index.cjs +1 -1
- package/dist/tbv/core/primitives/index.d.ts +3 -2
- package/dist/tbv/core/primitives/index.d.ts.map +1 -1
- package/dist/tbv/core/primitives/index.js +24 -23
- package/dist/tbv/core/primitives/psbt/__tests__/helpers.d.ts +1 -1
- package/dist/tbv/core/primitives/psbt/index.d.ts +1 -1
- package/dist/tbv/core/primitives/psbt/payout.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/pegin.d.ts +2 -3
- package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
- package/dist/tbv/core/primitives/utils/bitcoin.d.ts +4 -0
- package/dist/tbv/core/primitives/utils/bitcoin.d.ts.map +1 -1
- package/dist/tbv/core/primitives/utils/index.d.ts +1 -1
- package/dist/tbv/core/primitives/utils/index.d.ts.map +1 -1
- package/dist/tbv/core/services/activation/__tests__/activateVault.test.d.ts +2 -0
- package/dist/tbv/core/services/activation/__tests__/activateVault.test.d.ts.map +1 -0
- package/dist/tbv/core/services/activation/activateVault.d.ts +77 -0
- package/dist/tbv/core/services/activation/activateVault.d.ts.map +1 -0
- package/dist/tbv/core/services/activation/index.d.ts +7 -0
- package/dist/tbv/core/services/activation/index.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/__tests__/peginState.test.d.ts +2 -0
- package/dist/tbv/core/services/deposit/__tests__/peginState.test.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/__tests__/validation.test.d.ts +5 -0
- package/dist/tbv/core/services/deposit/__tests__/validation.test.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/index.d.ts +4 -0
- package/dist/tbv/core/services/deposit/index.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/peginState.d.ts +93 -0
- package/dist/tbv/core/services/deposit/peginState.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/validation.d.ts +114 -0
- package/dist/tbv/core/services/deposit/validation.d.ts.map +1 -0
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.d.ts +3 -0
- package/dist/tbv/core/services/index.d.ts.map +1 -1
- package/dist/tbv/core/services/index.js +25 -7
- package/dist/tbv/core/services/index.js.map +1 -1
- package/dist/tbv/core/services/pegout/__tests__/state.test.d.ts +2 -0
- package/dist/tbv/core/services/pegout/__tests__/state.test.d.ts.map +1 -0
- package/dist/tbv/core/services/pegout/index.d.ts +2 -0
- package/dist/tbv/core/services/pegout/index.d.ts.map +1 -0
- package/dist/tbv/core/services/pegout/state.d.ts +30 -0
- package/dist/tbv/core/services/pegout/state.d.ts.map +1 -0
- package/dist/tbv/core/services/refund/__tests__/buildAndBroadcastRefund.test.d.ts +2 -0
- package/dist/tbv/core/services/refund/__tests__/buildAndBroadcastRefund.test.d.ts.map +1 -0
- package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts +103 -0
- package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts.map +1 -0
- package/dist/tbv/core/services/refund/errors.d.ts +13 -0
- package/dist/tbv/core/services/refund/errors.d.ts.map +1 -0
- package/dist/tbv/core/services/refund/index.d.ts +8 -0
- package/dist/tbv/core/services/refund/index.d.ts.map +1 -0
- package/dist/tbv/core/utils/index.cjs +1 -1
- package/dist/tbv/core/utils/index.js +30 -24
- package/dist/tbv/core/utils/transaction/fundPeginTransaction.d.ts +1 -1
- package/dist/tbv/core/utils/utxo/__tests__/availability.test.d.ts +3 -0
- package/dist/tbv/core/utils/utxo/__tests__/availability.test.d.ts.map +1 -0
- package/dist/tbv/core/utils/utxo/__tests__/reservation.test.d.ts +3 -0
- package/dist/tbv/core/utils/utxo/__tests__/reservation.test.d.ts.map +1 -0
- package/dist/tbv/core/utils/utxo/availability.d.ts +62 -0
- package/dist/tbv/core/utils/utxo/availability.d.ts.map +1 -0
- package/dist/tbv/core/utils/utxo/index.d.ts +2 -0
- package/dist/tbv/core/utils/utxo/index.d.ts.map +1 -1
- package/dist/tbv/core/utils/utxo/reservation.d.ts +65 -0
- package/dist/tbv/core/utils/utxo/reservation.d.ts.map +1 -0
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +130 -106
- package/dist/tbv/integrations/aave/index.cjs +1 -1
- package/dist/tbv/integrations/aave/index.cjs.map +1 -1
- package/dist/tbv/integrations/aave/index.d.ts +3 -3
- package/dist/tbv/integrations/aave/index.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/index.js +145 -169
- package/dist/tbv/integrations/aave/index.js.map +1 -1
- package/dist/tbv/integrations/aave/utils/healthFactor.d.ts +0 -30
- package/dist/tbv/integrations/aave/utils/healthFactor.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/utils/index.d.ts +2 -2
- package/dist/tbv/integrations/aave/utils/index.d.ts.map +1 -1
- package/dist/types-B-p4dhEH.cjs +2 -0
- package/dist/types-B-p4dhEH.cjs.map +1 -0
- package/dist/types-DWjaqVfP.js +608 -0
- package/dist/types-DWjaqVfP.js.map +1 -0
- package/package.json +5 -1
- package/dist/challengeAssert-D_k_ADgP.cjs +0 -2
- package/dist/challengeAssert-D_k_ADgP.cjs.map +0 -1
- package/dist/challengeAssert-k5_LWUtO.js +0 -362
- package/dist/challengeAssert-k5_LWUtO.js.map +0 -1
- package/dist/constants-EiyZkXce.cjs +0 -2
- package/dist/constants-EiyZkXce.cjs.map +0 -1
- package/dist/constants-Q7v2O7Ps.js.map +0 -1
- package/dist/errors-DVNYib5y.cjs +0 -2
- package/dist/errors-DVNYib5y.cjs.map +0 -1
- package/dist/errors-aMocmFr-.js.map +0 -1
- package/dist/fundPeginTransaction-DpwnDslW.js +0 -50
- package/dist/fundPeginTransaction-DpwnDslW.js.map +0 -1
- package/dist/fundPeginTransaction-EbrZzlrh.cjs +0 -2
- package/dist/fundPeginTransaction-EbrZzlrh.cjs.map +0 -1
- package/dist/index-BX-V3C9t.js +0 -995
- package/dist/index-BX-V3C9t.js.map +0 -1
- package/dist/index-BgnxXV5G.cjs +0 -2
- package/dist/index-BgnxXV5G.cjs.map +0 -1
- package/dist/index-BvFLf3vm.js.map +0 -1
- package/dist/index-DpKhuCta.cjs +0 -2
- package/dist/index-DpKhuCta.cjs.map +0 -1
- package/dist/payout-Ce9vSs9e.js +0 -164
- package/dist/payout-Ce9vSs9e.js.map +0 -1
- package/dist/payout-CfsDnjKI.cjs +0 -2
- package/dist/payout-CfsDnjKI.cjs.map +0 -1
- package/dist/psbtInputFields-C0nKn_GD.cjs +0 -2
- package/dist/psbtInputFields-C0nKn_GD.cjs.map +0 -1
- package/dist/psbtInputFields-DO0ELwiv.js +0 -116
- package/dist/psbtInputFields-DO0ELwiv.js.map +0 -1
- package/dist/signing-Deg5lCoC.cjs +0 -2
- package/dist/signing-Deg5lCoC.cjs.map +0 -1
- package/dist/signing-Drwr3bXB.js +0 -16
- package/dist/signing-Drwr3bXB.js.map +0 -1
- package/dist/types-D1rYwwCu.js +0 -235
- package/dist/types-D1rYwwCu.js.map +0 -1
- package/dist/types-DEWiqXYp.cjs +0 -2
- package/dist/types-DEWiqXYp.cjs.map +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { UtxoRef } from './reservation';
|
|
2
|
+
/**
|
|
3
|
+
* Information about a missing/spent UTXO.
|
|
4
|
+
*/
|
|
5
|
+
export interface MissingUtxoInfo {
|
|
6
|
+
/** Transaction ID of the missing UTXO */
|
|
7
|
+
txid: string;
|
|
8
|
+
/** Output index of the missing UTXO */
|
|
9
|
+
vout: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Result of UTXO validation.
|
|
13
|
+
*/
|
|
14
|
+
export interface UtxoValidationResult {
|
|
15
|
+
/** Whether all UTXOs are still available */
|
|
16
|
+
allAvailable: boolean;
|
|
17
|
+
/** List of missing UTXOs (if any) */
|
|
18
|
+
missingUtxos: MissingUtxoInfo[];
|
|
19
|
+
/** Total number of inputs checked */
|
|
20
|
+
totalInputs: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Error thrown when UTXOs are not available.
|
|
24
|
+
*/
|
|
25
|
+
export declare class UtxoNotAvailableError extends Error {
|
|
26
|
+
readonly missingUtxos: MissingUtxoInfo[];
|
|
27
|
+
constructor(missingUtxos: MissingUtxoInfo[]);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Extract input references (txid:vout) from an unsigned transaction.
|
|
31
|
+
*
|
|
32
|
+
* @param unsignedTxHex - Unsigned transaction hex
|
|
33
|
+
* @returns Array of input references
|
|
34
|
+
*/
|
|
35
|
+
export declare function extractInputsFromTransaction(unsignedTxHex: string): Array<{
|
|
36
|
+
txid: string;
|
|
37
|
+
vout: number;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Validate that all UTXOs in a transaction are still available.
|
|
41
|
+
*
|
|
42
|
+
* Pure function — accepts pre-fetched UTXOs instead of making network calls.
|
|
43
|
+
* This should be called BEFORE signing to avoid wasting user effort
|
|
44
|
+
* signing a transaction that will fail to broadcast.
|
|
45
|
+
*
|
|
46
|
+
* @param unsignedTxHex - Unsigned transaction hex
|
|
47
|
+
* @param availableUtxos - Pre-fetched list of available UTXOs for the depositor
|
|
48
|
+
* @returns Validation result with missing UTXO details
|
|
49
|
+
*/
|
|
50
|
+
export declare function validateUtxosAvailable(unsignedTxHex: string, availableUtxos: UtxoRef[]): UtxoValidationResult;
|
|
51
|
+
/**
|
|
52
|
+
* Validate UTXOs and throw if any are not available.
|
|
53
|
+
*
|
|
54
|
+
* Pure convenience function that combines validation and error throwing.
|
|
55
|
+
*
|
|
56
|
+
* @param unsignedTxHex - Unsigned transaction hex
|
|
57
|
+
* @param availableUtxos - Pre-fetched list of available UTXOs for the depositor
|
|
58
|
+
* @throws UtxoNotAvailableError if any UTXOs are not available
|
|
59
|
+
* @throws Error if validation fails
|
|
60
|
+
*/
|
|
61
|
+
export declare function assertUtxosAvailable(unsignedTxHex: string, availableUtxos: UtxoRef[]): void;
|
|
62
|
+
//# sourceMappingURL=availability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"availability.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/utxo/availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,YAAY,EAAE,OAAO,CAAC;IACtB,qCAAqC;IACrC,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,SAAgB,YAAY,EAAE,eAAe,EAAE,CAAC;gBAEpC,YAAY,EAAE,eAAe,EAAE;CAW5C;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,MAAM,GACpB,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAmBvC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,OAAO,EAAE,GACxB,oBAAoB,CA6BtB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,OAAO,EAAE,GACxB,IAAI,CAMN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/utxo/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/utxo/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UTXO reservation utilities for vault deposits.
|
|
3
|
+
*
|
|
4
|
+
* Handles tracking which UTXOs are already in use by pending deposits
|
|
5
|
+
* and selecting available UTXOs with smart fallback logic.
|
|
6
|
+
*/
|
|
7
|
+
/** A txid:vout pair uniquely identifying a UTXO (outpoint). */
|
|
8
|
+
export interface UtxoRef {
|
|
9
|
+
txid: string;
|
|
10
|
+
vout: number;
|
|
11
|
+
}
|
|
12
|
+
/** Narrow structural type for pending pegin data. */
|
|
13
|
+
export interface PendingPeginLike {
|
|
14
|
+
selectedUTXOs?: Array<{
|
|
15
|
+
txid: string;
|
|
16
|
+
vout: number;
|
|
17
|
+
}>;
|
|
18
|
+
unsignedTxHex?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Narrow structural type for vault data. */
|
|
21
|
+
export interface VaultLike {
|
|
22
|
+
status: number;
|
|
23
|
+
unsignedPrePeginTx: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SelectUtxosForDepositParams<T extends {
|
|
26
|
+
txid: string;
|
|
27
|
+
vout: number;
|
|
28
|
+
value: number;
|
|
29
|
+
}> {
|
|
30
|
+
/** All available UTXOs from the wallet. */
|
|
31
|
+
availableUtxos: T[];
|
|
32
|
+
/** UTXOs that are reserved/in-flight and should be avoided if possible. */
|
|
33
|
+
reservedUtxoRefs: UtxoRef[];
|
|
34
|
+
/** Required deposit amount in satoshis (excluding fees). */
|
|
35
|
+
requiredAmount: bigint;
|
|
36
|
+
/** Fee rate in sat/vB. Used to estimate fee buffer for sufficiency check. */
|
|
37
|
+
feeRate: number;
|
|
38
|
+
}
|
|
39
|
+
export interface CollectReservedUtxoRefsParams {
|
|
40
|
+
vaults?: VaultLike[];
|
|
41
|
+
pendingPegins?: PendingPeginLike[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Collect UTXO refs from in-flight deposits (PENDING/VERIFIED vaults and pending pegins).
|
|
45
|
+
*/
|
|
46
|
+
export declare function collectReservedUtxoRefs(params: CollectReservedUtxoRefsParams): UtxoRef[];
|
|
47
|
+
/**
|
|
48
|
+
* Select UTXOs for a deposit, filtering out reserved ones.
|
|
49
|
+
*
|
|
50
|
+
* Logic:
|
|
51
|
+
* 1. Filter out reserved UTXOs from the available pool
|
|
52
|
+
* 2. If unreserved UTXOs are sufficient for the required amount + estimated fee, return them
|
|
53
|
+
* 3. Otherwise, throw — never silently reuse reserved UTXOs, as this risks double-spend
|
|
54
|
+
* failures that strand registered-but-unbroadcastable vaults
|
|
55
|
+
*
|
|
56
|
+
* @param params - Selection parameters
|
|
57
|
+
* @returns Array of unreserved UTXOs to use for the deposit
|
|
58
|
+
* @throws When all UTXOs are reserved or unreserved UTXOs are insufficient
|
|
59
|
+
*/
|
|
60
|
+
export declare function selectUtxosForDeposit<T extends {
|
|
61
|
+
txid: string;
|
|
62
|
+
vout: number;
|
|
63
|
+
value: number;
|
|
64
|
+
}>(params: SelectUtxosForDepositParams<T>): T[];
|
|
65
|
+
//# sourceMappingURL=reservation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reservation.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/utils/utxo/reservation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkBH,+DAA+D;AAC/D,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,aAAa,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,6CAA6C;AAC7C,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,2BAA2B,CAC1C,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;IAEvD,2CAA2C;IAC3C,cAAc,EAAE,CAAC,EAAE,CAAC;IACpB,2EAA2E;IAC3E,gBAAgB,EAAE,OAAO,EAAE,CAAC;IAC5B,4DAA4D;IAC5D,cAAc,EAAE,MAAM,CAAC;IACvB,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,6BAA6B;IAC5C,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACpC;AA6DD;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,6BAA6B,GACpC,OAAO,EAAE,CA2BX;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACvD,MAAM,EAAE,2BAA2B,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAuC7C"}
|
package/dist/tbv/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../challengeAssert-nYlgeAI8.cjs"),P=require("@babylonlabs-io/babylon-tbv-rust-wasm"),u=require("../payout-RFIh7GLN.cjs"),a=require("../bitcoin-CNnPFU6Y.cjs"),l=require("../signing-cl-lowxV.cjs"),e=require("../buildAndBroadcastRefund-DWEQvj9T.cjs"),r=require("../fundPeginTransaction-DxNOeyNI.cjs"),i=require("../psbtInputFields-C-zYR1z7.cjs"),o=require("../errors-BZON3Wmn.cjs"),t=require("../index-BpXpESWu.cjs"),s=require("../types-B-p4dhEH.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=u.buildPayoutPsbt;exports.buildRefundPsbt=u.buildRefundPsbt;exports.createPayoutScript=u.createPayoutScript;exports.extractPayoutSignature=u.extractPayoutSignature;exports.deriveNativeSegwitAddress=a.deriveNativeSegwitAddress;exports.deriveTaprootAddress=a.deriveTaprootAddress;exports.ensureHexPrefix=a.ensureHexPrefix;exports.formatSatoshisToBtc=a.formatSatoshisToBtc;exports.getNetwork=a.getNetwork;exports.hexToUint8Array=a.hexToUint8Array;exports.isAddressFromPublicKey=a.isAddressFromPublicKey;exports.isValidHex=a.isValidHex;exports.processPublicKeyToXOnly=a.processPublicKeyToXOnly;exports.stripHexPrefix=a.stripHexPrefix;exports.toXOnly=a.toXOnly;exports.uint8ArrayToHex=a.uint8ArrayToHex;exports.validateWalletPubkey=a.validateWalletPubkey;exports.ContractStatus=l.ContractStatus;exports.PeginAction=l.PeginAction;exports.canPerformAction=l.canPerformAction;exports.createTaprootScriptPathSignOptions=l.createTaprootScriptPathSignOptions;exports.getPeginProtocolState=l.getPeginProtocolState;exports.BIP68NotMatureError=e.BIP68NotMatureError;exports.ClaimerPegoutStatusValue=e.ClaimerPegoutStatusValue;exports.PayoutManager=e.PayoutManager;exports.activateVault=e.activateVault;exports.buildAndBroadcastRefund=e.buildAndBroadcastRefund;exports.computeHashlock=e.computeHashlock;exports.isDepositAmountValid=e.isDepositAmountValid;exports.isPegoutTerminalStatus=e.isPegoutTerminalStatus;exports.isRecognizedPegoutStatus=e.isRecognizedPegoutStatus;exports.pollAndSignPayouts=e.pollAndSignPayouts;exports.signDepositorGraph=e.signDepositorGraph;exports.submitWotsPublicKey=e.submitWotsPublicKey;exports.validateDepositAmount=e.validateDepositAmount;exports.validateMultiVaultDepositInputs=e.validateMultiVaultDepositInputs;exports.validateProviderSelection=e.validateProviderSelection;exports.validateRemainingCapacity=e.validateRemainingCapacity;exports.validateSecretAgainstHashlock=e.validateSecretAgainstHashlock;exports.validateVaultAmounts=e.validateVaultAmounts;exports.validateVaultProviderPubkey=e.validateVaultProviderPubkey;exports.waitForPeginStatus=e.waitForPeginStatus;exports.BTC_DUST_SAT=r.BTC_DUST_SAT;exports.DUST_THRESHOLD=r.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=r.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=r.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=r.MAX_NON_LEGACY_OUTPUT_SIZE;exports.P2TR_INPUT_SIZE=r.P2TR_INPUT_SIZE;exports.PEGIN_FIXED_OUTPUTS=r.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=r.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=r.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=r.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.fundPeginTransaction=r.fundPeginTransaction;exports.parseUnfundedWasmTransaction=r.parseUnfundedWasmTransaction;exports.peginOutputCount=r.peginOutputCount;exports.rateBasedTxBufferFee=r.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=o.CONTRACT_ERRORS;exports.PeginManager=o.PeginManager;exports.computeWotsBlockPublicKeysHash=o.computeWotsBlockPublicKeysHash;exports.computeWotsPkHash=o.computeWotsPkHash;exports.deriveWotsBlockPublicKeys=o.deriveWotsBlockPublicKeys;exports.deriveWotsKeypair=o.deriveWotsKeypair;exports.deriveWotsPkHash=o.deriveWotsPkHash;exports.extractErrorData=o.extractErrorData;exports.getContractErrorMessage=o.getContractErrorMessage;exports.handleContractError=o.handleContractError;exports.isKnownContractError=o.isKnownContractError;exports.isWotsMismatchError=o.isWotsMismatchError;exports.keypairToPublicKey=o.keypairToPublicKey;exports.mnemonicToWotsSeed=o.mnemonicToWotsSeed;exports.ApplicationRegistryABI=t.ApplicationRegistryABI;exports.MEMPOOL_API_URLS=t.MEMPOOL_API_URLS;exports.ProtocolParamsABI=t.ProtocolParamsABI;exports.VaultProviderRpcClient=t.VaultProviderRpcClient;exports.ViemProtocolParamsReader=t.ViemProtocolParamsReader;exports.ViemUniversalChallengerReader=t.ViemUniversalChallengerReader;exports.ViemVaultKeeperReader=t.ViemVaultKeeperReader;exports.ViemVaultRegistryReader=t.ViemVaultRegistryReader;exports.VpResponseValidationError=t.VpResponseValidationError;exports.getAddressTxs=t.getAddressTxs;exports.getAddressUtxos=t.getAddressUtxos;exports.getMempoolApiUrl=t.getMempoolApiUrl;exports.getNetworkFees=t.getNetworkFees;exports.getTxHex=t.getTxHex;exports.getTxInfo=t.getTxInfo;exports.getUtxoInfo=t.getUtxoInfo;exports.pushTx=t.pushTx;exports.resolveProtocolAddresses=t.resolveProtocolAddresses;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
|
@@ -1,112 +1,136 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { computeMinClaimValue as
|
|
3
|
-
import { b as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { P as
|
|
10
|
-
import { A as
|
|
11
|
-
import { D as
|
|
1
|
+
import { i as e, g as t, h as o, d as r, a as i, b as l, c as n, e as u, f as P } from "../challengeAssert-D1lpvuMv.js";
|
|
2
|
+
import { computeMinClaimValue as c, deriveVaultId as p } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
|
+
import { a as g, b as S, c as A, e as E } from "../payout-DzGsAnhf.js";
|
|
4
|
+
import { d as m, a as _, e as b, f as x, g as f, h as I, i as v, b as U, p as C, s as y, t as h, u as O, v as V } from "../bitcoin-nOOgeRyl.js";
|
|
5
|
+
import { C as B, P as D, a as N, c as M, g as H } from "../signing-DeWVBl7m.js";
|
|
6
|
+
import { B as k, C as W, P as K, a as w, m as X, h as G, i as Y, l as J, k as j, p as Z, b as z, s as q, v as Q, g as $, d as aa, c as sa, j as ea, e as ta, f as oa, w as ra } from "../buildAndBroadcastRefund-DnTQkCgG.js";
|
|
7
|
+
import { B as la, D as na, F as ua, L as Pa, M as da, P as ca, a as pa, S as Ta, T as ga, W as Sa, f as Aa, b as Ea, p as Ra, r as ma } from "../fundPeginTransaction-BLYXxLBv.js";
|
|
8
|
+
import { B as ba, U as xa, a as fa, f as Ia, c as va, e as Ua, g as Ca, i as ya, h as ha, s as Oa, b as Va, d as Fa, v as Ba } from "../psbtInputFields-Dx41_IoI.js";
|
|
9
|
+
import { C as Na, P as Ma, b as Ha, c as La, a as ka, d as Wa, f as Ka, e as wa, g as Xa, h as Ga, i as Ya, j as Ja, k as ja, m as Za } from "../errors-CHY4WNi-.js";
|
|
10
|
+
import { A as qa, M as Qa, P as $a, V as as, i as ss, j as es, k as ts, l as os, h as rs, g as is, a as ls, b as ns, c as us, d as Ps, e as ds, f as cs, p as ps, r as Ts } from "../index-CFwoGJNQ.js";
|
|
11
|
+
import { B as Ss, D as As, b as Es, J as Rs, a as ms, d as _s, P as bs, R as xs, c as fs, V as Is } from "../types-DWjaqVfP.js";
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
13
|
+
qa as ApplicationRegistryABI,
|
|
14
|
+
k as BIP68NotMatureError,
|
|
15
|
+
Ss as BTCVaultRegistryABI,
|
|
16
|
+
la as BTC_DUST_SAT,
|
|
17
|
+
ba as BitcoinScriptType,
|
|
18
|
+
Na as CONTRACT_ERRORS,
|
|
19
|
+
W as ClaimerPegoutStatusValue,
|
|
20
|
+
B as ContractStatus,
|
|
21
|
+
na as DUST_THRESHOLD,
|
|
22
|
+
As as DaemonStatus,
|
|
23
|
+
ua as FEE_SAFETY_MARGIN,
|
|
24
|
+
Es as JSON_RPC_ERROR_CODES,
|
|
25
|
+
Rs as JsonRpcClient,
|
|
26
|
+
ms as JsonRpcError,
|
|
27
|
+
Pa as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
28
|
+
da as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
29
|
+
Qa as MEMPOOL_API_URLS,
|
|
30
|
+
ca as P2TR_INPUT_SIZE,
|
|
31
|
+
pa as PEGIN_FIXED_OUTPUTS,
|
|
32
|
+
_s as POST_WOTS_STATUSES,
|
|
33
|
+
bs as PRE_DEPOSITOR_SIGNATURES_STATES,
|
|
34
|
+
K as PayoutManager,
|
|
35
|
+
D as PeginAction,
|
|
36
|
+
Ma as PeginManager,
|
|
37
|
+
$a as ProtocolParamsABI,
|
|
38
|
+
xs as RpcErrorCode,
|
|
39
|
+
Ta as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
40
|
+
ga as TX_BUFFER_SIZE_OVERHEAD,
|
|
41
|
+
xa as UtxoNotAvailableError,
|
|
42
|
+
fs as VP_TERMINAL_STATUSES,
|
|
43
|
+
Is as VP_TRANSIENT_STATUSES,
|
|
44
|
+
as as VaultProviderRpcClient,
|
|
45
|
+
ss as ViemProtocolParamsReader,
|
|
46
|
+
es as ViemUniversalChallengerReader,
|
|
47
|
+
ts as ViemVaultKeeperReader,
|
|
48
|
+
os as ViemVaultRegistryReader,
|
|
49
|
+
rs as VpResponseValidationError,
|
|
50
|
+
Sa as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
51
|
+
w as activateVault,
|
|
52
|
+
fa as assertUtxosAvailable,
|
|
53
|
+
X as buildAndBroadcastRefund,
|
|
46
54
|
e as buildChallengeAssertPsbt,
|
|
47
55
|
t as buildDepositorPayoutPsbt,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
o as buildNoPayoutPsbt,
|
|
57
|
+
g as buildPayoutPsbt,
|
|
58
|
+
r as buildPeginInputPsbt,
|
|
51
59
|
i as buildPeginTxFromFundedPrePegin,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
60
|
+
l as buildPrePeginPsbt,
|
|
61
|
+
S as buildRefundPsbt,
|
|
62
|
+
Ia as calculateBtcTxHash,
|
|
63
|
+
N as canPerformAction,
|
|
64
|
+
va as collectReservedUtxoRefs,
|
|
65
|
+
G as computeHashlock,
|
|
66
|
+
c as computeMinClaimValue,
|
|
67
|
+
n as computeNumLocalChallengers,
|
|
68
|
+
Ha as computeWotsBlockPublicKeysHash,
|
|
69
|
+
La as computeWotsPkHash,
|
|
70
|
+
A as createPayoutScript,
|
|
71
|
+
M as createTaprootScriptPathSignOptions,
|
|
72
|
+
m as deriveNativeSegwitAddress,
|
|
73
|
+
_ as deriveTaprootAddress,
|
|
74
|
+
p as deriveVaultId,
|
|
75
|
+
ka as deriveWotsBlockPublicKeys,
|
|
76
|
+
Wa as deriveWotsKeypair,
|
|
77
|
+
Ka as deriveWotsPkHash,
|
|
78
|
+
b as ensureHexPrefix,
|
|
79
|
+
wa as extractErrorData,
|
|
80
|
+
Ua as extractInputsFromTransaction,
|
|
81
|
+
E as extractPayoutSignature,
|
|
82
|
+
u as extractPeginInputSignature,
|
|
83
|
+
P as finalizePeginInputPsbt,
|
|
84
|
+
x as formatSatoshisToBtc,
|
|
85
|
+
Aa as fundPeginTransaction,
|
|
86
|
+
is as getAddressTxs,
|
|
87
|
+
ls as getAddressUtxos,
|
|
88
|
+
Xa as getContractErrorMessage,
|
|
89
|
+
Ca as getDustThreshold,
|
|
90
|
+
ns as getMempoolApiUrl,
|
|
91
|
+
f as getNetwork,
|
|
92
|
+
us as getNetworkFees,
|
|
93
|
+
H as getPeginProtocolState,
|
|
94
|
+
ya as getPsbtInputFields,
|
|
95
|
+
ha as getScriptType,
|
|
96
|
+
Ps as getTxHex,
|
|
97
|
+
ds as getTxInfo,
|
|
98
|
+
cs as getUtxoInfo,
|
|
99
|
+
Ga as handleContractError,
|
|
100
|
+
I as hexToUint8Array,
|
|
101
|
+
v as isAddressFromPublicKey,
|
|
102
|
+
Y as isDepositAmountValid,
|
|
103
|
+
Ya as isKnownContractError,
|
|
104
|
+
J as isPegoutTerminalStatus,
|
|
105
|
+
j as isRecognizedPegoutStatus,
|
|
106
|
+
U as isValidHex,
|
|
107
|
+
Ja as isWotsMismatchError,
|
|
108
|
+
ja as keypairToPublicKey,
|
|
109
|
+
Za as mnemonicToWotsSeed,
|
|
110
|
+
Ea as parseUnfundedWasmTransaction,
|
|
111
|
+
Ra as peginOutputCount,
|
|
112
|
+
Z as pollAndSignPayouts,
|
|
113
|
+
C as processPublicKeyToXOnly,
|
|
114
|
+
ps as pushTx,
|
|
115
|
+
ma as rateBasedTxBufferFee,
|
|
116
|
+
Ts as resolveProtocolAddresses,
|
|
117
|
+
Oa as selectUtxosForDeposit,
|
|
118
|
+
Va as selectUtxosForPegin,
|
|
119
|
+
Fa as shouldAddChangeOutput,
|
|
120
|
+
z as signDepositorGraph,
|
|
121
|
+
y as stripHexPrefix,
|
|
122
|
+
q as submitWotsPublicKey,
|
|
123
|
+
h as toXOnly,
|
|
124
|
+
O as uint8ArrayToHex,
|
|
125
|
+
Q as validateDepositAmount,
|
|
126
|
+
$ as validateMultiVaultDepositInputs,
|
|
127
|
+
aa as validateProviderSelection,
|
|
128
|
+
sa as validateRemainingCapacity,
|
|
129
|
+
ea as validateSecretAgainstHashlock,
|
|
130
|
+
Ba as validateUtxosAvailable,
|
|
131
|
+
ta as validateVaultAmounts,
|
|
132
|
+
oa as validateVaultProviderPubkey,
|
|
133
|
+
V as validateWalletPubkey,
|
|
134
|
+
ra as waitForPeginStatus
|
|
111
135
|
};
|
|
112
136
|
//# sourceMappingURL=index.js.map
|