utxo-lib 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/address.d.ts.map +1 -1
- package/dist/src/address.js +1 -11
- package/dist/src/addressFormat.d.ts +1 -1
- package/dist/src/addressFormat.d.ts.map +1 -1
- package/dist/src/addressFormat.js +1 -1
- package/dist/src/bitgo/Musig2.d.ts +17 -115
- package/dist/src/bitgo/Musig2.d.ts.map +1 -1
- package/dist/src/bitgo/Musig2.js +101 -283
- package/dist/src/bitgo/UtxoPsbt.d.ts +49 -173
- package/dist/src/bitgo/UtxoPsbt.d.ts.map +1 -1
- package/dist/src/bitgo/UtxoPsbt.js +112 -634
- package/dist/src/bitgo/bbc/DashPsbt.d.ts +12 -0
- package/dist/src/bitgo/bbc/DashPsbt.d.ts.map +1 -0
- package/dist/src/bitgo/bbc/DashPsbt.js +27 -0
- package/dist/src/bitgo/bbc/DashTransaction.d.ts +39 -0
- package/dist/src/bitgo/bbc/DashTransaction.d.ts.map +1 -0
- package/dist/src/bitgo/bbc/DashTransaction.js +109 -0
- package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts +14 -0
- package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts.map +1 -0
- package/dist/src/bitgo/bbc/DashTransactionBuilder.js +28 -0
- package/dist/src/bitgo/bbc/index.d.ts +4 -0
- package/dist/src/bitgo/bbc/index.d.ts.map +1 -0
- package/dist/src/bitgo/{litecoin → bbc}/index.js +4 -4
- package/dist/src/bitgo/bitcoincash/address.js +2 -2
- package/dist/src/bitgo/index.d.ts +0 -10
- package/dist/src/bitgo/index.d.ts.map +1 -1
- package/dist/src/bitgo/index.js +2 -5
- package/dist/src/bitgo/outputScripts.d.ts +1 -3
- package/dist/src/bitgo/outputScripts.d.ts.map +1 -1
- package/dist/src/bitgo/outputScripts.js +10 -18
- package/dist/src/bitgo/parseInput.d.ts +20 -49
- package/dist/src/bitgo/parseInput.d.ts.map +1 -1
- package/dist/src/bitgo/parseInput.js +24 -108
- package/dist/src/bitgo/psbt/fromHalfSigned.d.ts.map +1 -1
- package/dist/src/bitgo/psbt/fromHalfSigned.js +6 -9
- package/dist/src/bitgo/signature.d.ts +3 -3
- package/dist/src/bitgo/signature.d.ts.map +1 -1
- package/dist/src/bitgo/signature.js +16 -48
- package/dist/src/bitgo/transaction.d.ts +3 -18
- package/dist/src/bitgo/transaction.d.ts.map +1 -1
- package/dist/src/bitgo/transaction.js +15 -28
- package/dist/src/bitgo/types.d.ts +0 -2
- package/dist/src/bitgo/types.d.ts.map +1 -1
- package/dist/src/bitgo/types.js +1 -1
- package/dist/src/bitgo/wallet/Psbt.d.ts +12 -90
- package/dist/src/bitgo/wallet/Psbt.d.ts.map +1 -1
- package/dist/src/bitgo/wallet/Psbt.js +71 -221
- package/dist/src/bitgo/wallet/Unspent.d.ts +0 -28
- package/dist/src/bitgo/wallet/Unspent.d.ts.map +1 -1
- package/dist/src/bitgo/wallet/Unspent.js +68 -173
- package/dist/src/bitgo/wallet/chains.d.ts +2 -2
- package/dist/src/bitgo/wallet/chains.d.ts.map +1 -1
- package/dist/src/bitgo/wallet/chains.js +1 -1
- package/dist/src/bitgo/zcash/ZcashPsbt.d.ts.map +1 -1
- package/dist/src/bitgo/zcash/ZcashPsbt.js +3 -4
- package/dist/src/networks.d.ts +2 -1
- package/dist/src/networks.d.ts.map +1 -1
- package/dist/src/networks.js +29 -22
- package/dist/src/noble_ecc.d.ts.map +1 -1
- package/dist/src/noble_ecc.js +2 -6
- package/dist/src/payments/p2tr.d.ts.map +1 -1
- package/dist/src/payments/p2tr.js +9 -15
- package/dist/src/taproot.d.ts +0 -16
- package/dist/src/taproot.d.ts.map +1 -1
- package/dist/src/taproot.js +2 -44
- package/dist/src/testutil/index.d.ts +0 -2
- package/dist/src/testutil/index.d.ts.map +1 -1
- package/dist/src/testutil/index.js +1 -3
- package/dist/src/testutil/mock.d.ts +1 -1
- package/dist/src/testutil/mock.d.ts.map +1 -1
- package/dist/src/testutil/mock.js +4 -12
- package/package.json +4 -6
- package/dist/src/bitgo/PsbtUtil.d.ts +0 -54
- package/dist/src/bitgo/PsbtUtil.d.ts.map +0 -1
- package/dist/src/bitgo/PsbtUtil.js +0 -79
- package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts +0 -10
- package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts.map +0 -1
- package/dist/src/bitgo/litecoin/LitecoinPsbt.js +0 -17
- package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts +0 -16
- package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts.map +0 -1
- package/dist/src/bitgo/litecoin/LitecoinTransaction.js +0 -46
- package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts +0 -10
- package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts.map +0 -1
- package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.js +0 -15
- package/dist/src/bitgo/litecoin/index.d.ts +0 -4
- package/dist/src/bitgo/litecoin/index.d.ts.map +0 -1
- package/dist/src/testutil/psbt.d.ts +0 -71
- package/dist/src/testutil/psbt.d.ts.map +0 -1
- package/dist/src/testutil/psbt.js +0 -147
- package/dist/src/testutil/transaction.d.ts +0 -61
- package/dist/src/testutil/transaction.d.ts.map +0 -1
- package/dist/src/testutil/transaction.js +0 -107
@@ -1,57 +1,21 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
import { PsbtInput } from 'bip174/src/lib/interfaces';
|
3
|
-
import { BIP32Interface } from 'bip32';
|
4
2
|
import { UtxoPsbt } from '../UtxoPsbt';
|
5
3
|
import { UtxoTransaction } from '../UtxoTransaction';
|
6
4
|
import { RootWalletKeys } from './WalletKeys';
|
5
|
+
import { BIP32Interface } from 'bip32';
|
7
6
|
import { WalletUnspent } from './Unspent';
|
8
|
-
import {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
declare type HalfSignedSignatureContainer = BaseSignatureContainer<[Buffer]>;
|
16
|
-
declare type FullSignedSignatureContainer = BaseSignatureContainer<[Buffer, Buffer]>;
|
17
|
-
declare type SignatureContainer = UnsignedSignatureContainer | HalfSignedSignatureContainer | FullSignedSignatureContainer;
|
18
|
-
/**
|
19
|
-
* Contents of a pre-finalized PSBT Input for p2trMusig2 key path in the non-finalized state.
|
20
|
-
* T is [Buffer] for first signature, [Buffer, Buffer] for both signatures and `undefined` for no signatures.
|
21
|
-
*/
|
22
|
-
declare type BaseTaprootKeyPathSignatureContainer<T> = {
|
23
|
-
signatures: T;
|
24
|
-
/** Only contains participants that have added a signature */
|
25
|
-
participantPublicKeys: T;
|
26
|
-
};
|
27
|
-
declare type UnsignedTaprootKeyPathSignatureContainer = BaseTaprootKeyPathSignatureContainer<undefined>;
|
28
|
-
declare type HalfSignedTaprootKeyPathSignatureContainer = BaseTaprootKeyPathSignatureContainer<[Buffer]>;
|
29
|
-
declare type FullSignedTaprootKeyPathSignatureContainer = BaseTaprootKeyPathSignatureContainer<[Buffer, Buffer]>;
|
30
|
-
declare type TaprootKeyPathSignatureContainer = UnsignedTaprootKeyPathSignatureContainer | HalfSignedTaprootKeyPathSignatureContainer | FullSignedTaprootKeyPathSignatureContainer;
|
31
|
-
/**
|
32
|
-
* To hold parsed psbt data for p2ms based script types - p2sh, p2wsh, and p2shP2wsh
|
33
|
-
*/
|
34
|
-
export declare type ParsedPsbtP2ms = ParsedPubScriptP2ms & SignatureContainer;
|
35
|
-
/**
|
36
|
-
* To hold parsed psbt data for TaprootKeyPathSpend script type.
|
37
|
-
*/
|
38
|
-
export declare type ParsedPsbtTaprootKeyPath = ParsedPubScriptTaprootKeyPath & TaprootKeyPathSignatureContainer;
|
39
|
-
/**
|
40
|
-
* To hold parsed psbt data for TaprootScriptPathSpend script path script type.
|
41
|
-
*/
|
42
|
-
export declare type ParsedPsbtTaprootScriptPath = ParsedPubScriptTaprootScriptPath & SignatureContainer & {
|
7
|
+
import { ParsedPubScript2Of3, ParsedPubScriptTaprootScriptPath } from '../parseInput';
|
8
|
+
declare type Signatures = [Buffer] | [Buffer, Buffer] | undefined;
|
9
|
+
export interface ParsedPsbt2Of3 extends ParsedPubScript2Of3 {
|
10
|
+
signatures: Signatures;
|
11
|
+
}
|
12
|
+
export interface ParsedPsbtP2TR extends ParsedPubScriptTaprootScriptPath {
|
13
|
+
signatures: Signatures;
|
43
14
|
controlBlock: Buffer;
|
44
15
|
leafVersion: number;
|
45
16
|
/** Indicates the level inside the taptree. */
|
46
17
|
scriptPathLevel: number;
|
47
|
-
}
|
48
|
-
export declare type ParsedPsbtTaproot = ParsedPsbtTaprootKeyPath | ParsedPsbtTaprootScriptPath;
|
49
|
-
declare type P2shP2pkSignatureContainer = UnsignedSignatureContainer | HalfSignedSignatureContainer;
|
50
|
-
export declare type ParsedPsbtP2shP2pk = ParsedPubScriptP2shP2pk & P2shP2pkSignatureContainer;
|
51
|
-
/**
|
52
|
-
* psbt input index and its user, backup, bitgo signatures status
|
53
|
-
*/
|
54
|
-
export declare type SignatureValidation = [index: number, sigTriple: Triple<boolean>];
|
18
|
+
}
|
55
19
|
/**
|
56
20
|
* @return PSBT filled with metatdata as per input params tx, unspents and rootWalletKeys.
|
57
21
|
* Unsigned PSBT for taproot input with witnessUtxo
|
@@ -68,58 +32,16 @@ export declare function toWalletPsbt(tx: UtxoTransaction<bigint>, unspents: Wall
|
|
68
32
|
* @return signed PSBT with signer's key for unspent
|
69
33
|
*/
|
70
34
|
export declare function signWalletPsbt(psbt: UtxoPsbt, inputIndex: number, signer: BIP32Interface, unspent: WalletUnspent<bigint>): void;
|
71
|
-
/**
|
72
|
-
* @returns script type of the input
|
73
|
-
*/
|
74
|
-
export declare function getPsbtInputScriptType(input: PsbtInput): ParsedScriptType;
|
75
35
|
/**
|
76
36
|
* @return psbt metadata are parsed as per below conditions.
|
77
37
|
* redeemScript/witnessScript/tapLeafScript matches BitGo.
|
78
38
|
* signature and public key count matches BitGo.
|
79
|
-
* P2SH-P2PK => scriptType, redeemScript, public key, signature.
|
80
39
|
* P2SH => scriptType, redeemScript, public keys, signatures.
|
81
40
|
* PW2SH => scriptType, witnessScript, public keys, signatures.
|
82
41
|
* P2SH-PW2SH => scriptType, redeemScript, witnessScript, public keys, signatures.
|
83
|
-
* P2TR
|
84
|
-
*
|
85
|
-
* P2TR MUSIG2 kep path => scriptType (taprootKeyPathSpend), pubScript (scriptPubKey), participant pub keys (signer),
|
86
|
-
* public key (tapOutputkey), signatures (partial signer sigs).
|
87
|
-
*/
|
88
|
-
export declare function parsePsbtInput(input: PsbtInput): ParsedPsbtP2ms | ParsedPsbtTaproot | ParsedPsbtP2shP2pk;
|
89
|
-
/**
|
90
|
-
* @returns strictly parse the input and get signature count.
|
91
|
-
* unsigned(0), half-signed(1) or fully-signed(2)
|
92
|
-
*/
|
93
|
-
export declare function getStrictSignatureCount(input: TxInput | PsbtInput): 0 | 1 | 2;
|
94
|
-
/**
|
95
|
-
* @returns strictly parse input and get signature count for all inputs.
|
96
|
-
* 0=unsigned, 1=half-signed or 2=fully-signed
|
97
|
-
*/
|
98
|
-
export declare function getStrictSignatureCounts(tx: UtxoPsbt | UtxoTransaction<number | bigint> | PsbtInput[] | TxInput[]): (0 | 1 | 2)[];
|
99
|
-
/**
|
100
|
-
* @return true iff inputs array is of PsbtInputType type
|
101
|
-
* */
|
102
|
-
export declare function isPsbtInputArray(inputs: PsbtInput[] | TxInput[]): inputs is PsbtInput[];
|
103
|
-
/**
|
104
|
-
* @return true iff inputs array is of TxInput type
|
105
|
-
* */
|
106
|
-
export declare function isTxInputArray(inputs: PsbtInput[] | TxInput[]): inputs is TxInput[];
|
107
|
-
/**
|
108
|
-
* @returns true iff given psbt/transaction/tx-input-array/psbt-input-array contains at least one taproot key path spend input
|
109
|
-
*/
|
110
|
-
export declare function isTransactionWithKeyPathSpendInput(data: UtxoPsbt | UtxoTransaction<bigint | number> | PsbtInput[] | TxInput[]): boolean;
|
111
|
-
/**
|
112
|
-
* Set the RootWalletKeys as the globalXpubs on the psbt
|
113
|
-
*
|
114
|
-
* We do all the matching of the (tap)bip32Derivations masterFingerprint to the fingerprint of the
|
115
|
-
* extendedPubkey.
|
116
|
-
*/
|
117
|
-
export declare function addXpubsToPsbt(psbt: UtxoPsbt, rootWalletKeys: RootWalletKeys): void;
|
118
|
-
/**
|
119
|
-
* validates signatures for each 2 of 3 input against user, backup, bitgo keys derived from rootWalletKeys.
|
120
|
-
* @returns array of input index and its [is valid user sig exist, is valid backup sig exist, is valid user bitgo exist]
|
121
|
-
* For p2shP2pk input, [false, false, false] is returned since it is not a 2 of 3 sig input.
|
42
|
+
* P2TR => scriptType, pubScript (witnessScript), controlBlock, scriptPathLevel, leafVersion, public keys, signatures.
|
43
|
+
* Any unsigned PSBT and without required metadata is returned with undefined.
|
122
44
|
*/
|
123
|
-
export declare function
|
45
|
+
export declare function parsePsbtInput(psbt: UtxoPsbt, inputIndex: number): ParsedPsbt2Of3 | ParsedPsbtP2TR | undefined;
|
124
46
|
export {};
|
125
47
|
//# sourceMappingURL=Psbt.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Psbt.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/wallet/Psbt.ts"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"Psbt.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/wallet/Psbt.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAQrD,OAAO,EAAqB,cAAc,EAAE,MAAM,cAAc,CAAC;AAGjE,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAmB,aAAa,EAAE,MAAM,WAAW,CAAC;AAG3D,OAAO,EAIL,mBAAmB,EACnB,gCAAgC,EAEjC,MAAM,eAAe,CAAC;AAEvB,aAAK,UAAU,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;AAE1D,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,cAAe,SAAQ,gCAAgC;IACtE,UAAU,EAAE,UAAU,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,eAAe,EAAE,MAAM,CAAC;CACzB;AAkFD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,EAAE,EAAE,eAAe,CAAC,MAAM,CAAC,EAC3B,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,EACjC,cAAc,EAAE,cAAc,GAC7B,QAAQ,CASV;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,GAC7B,IAAI,CAMN;AA6GD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc,GAAG,SAAS,CAa9G"}
|