utxo-lib 1.1.2 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +16 -19
- package/dist/src/bitgo/PsbtUtil.d.ts +0 -5
- package/dist/src/bitgo/PsbtUtil.d.ts.map +1 -1
- package/dist/src/bitgo/PsbtUtil.js +2 -15
- package/dist/src/bitgo/UtxoPsbt.d.ts +0 -9
- package/dist/src/bitgo/UtxoPsbt.d.ts.map +1 -1
- package/dist/src/bitgo/UtxoPsbt.js +12 -42
- package/dist/src/bitgo/index.d.ts +0 -1
- package/dist/src/bitgo/index.d.ts.map +1 -1
- package/dist/src/bitgo/index.js +2 -3
- package/dist/src/bitgo/parseInput.js +2 -2
- package/dist/src/bitgo/wallet/Psbt.d.ts +0 -14
- package/dist/src/bitgo/wallet/Psbt.d.ts.map +1 -1
- package/dist/src/bitgo/wallet/Psbt.js +3 -71
- package/dist/src/bitgo/wallet/WalletOutput.d.ts +1 -17
- package/dist/src/bitgo/wallet/WalletOutput.d.ts.map +1 -1
- package/dist/src/bitgo/wallet/WalletOutput.js +23 -64
- package/dist/src/bitgo/wallet/chains.d.ts +1 -1
- package/dist/src/bitgo/zcash/ZcashPsbt.d.ts +1 -0
- package/dist/src/bitgo/zcash/ZcashPsbt.d.ts.map +1 -1
- package/dist/src/bitgo/zcash/ZcashPsbt.js +12 -3
- package/dist/src/testutil/keys.d.ts +0 -3
- package/dist/src/testutil/keys.d.ts.map +1 -1
- package/dist/src/testutil/keys.js +2 -17
- package/dist/src/testutil/psbt.d.ts +5 -23
- package/dist/src/testutil/psbt.d.ts.map +1 -1
- package/dist/src/testutil/psbt.js +13 -16
- package/dist/src/testutil/transaction.d.ts +5 -14
- package/dist/src/testutil/transaction.d.ts.map +1 -1
- package/dist/src/testutil/transaction.js +9 -9
- package/package.json +5 -5
- package/dist/src/base_crypto.d.ts +0 -14
- package/dist/src/base_crypto.d.ts.map +0 -1
- package/dist/src/base_crypto.js +0 -215
- package/dist/src/bitgo/legacysafe/index.d.ts +0 -15
- package/dist/src/bitgo/legacysafe/index.d.ts.map +0 -1
- package/dist/src/bitgo/legacysafe/index.js +0 -61
- package/dist/src/musig.d.ts +0 -390
- package/dist/src/musig.d.ts.map +0 -1
- package/dist/src/musig.js +0 -447
@@ -109,10 +109,19 @@ class ZcashPsbt extends UtxoPsbt_1.UtxoPsbt {
|
|
109
109
|
// transactions because zcash hashes the value directly. Thus, it is unnecessary to have
|
110
110
|
// the previous transaction hash on the unspent.
|
111
111
|
signInput(inputIndex, keyPair, sighashTypes) {
|
112
|
-
return
|
112
|
+
return this.withUnsafeSignNonSegwitTrue(super.signInput.bind(this, inputIndex, keyPair, sighashTypes));
|
113
113
|
}
|
114
114
|
validateSignaturesOfInput(inputIndex, validator, pubkey) {
|
115
|
-
return
|
115
|
+
return this.withUnsafeSignNonSegwitTrue(super.validateSignaturesOfInput.bind(this, inputIndex, validator, pubkey));
|
116
|
+
}
|
117
|
+
withUnsafeSignNonSegwitTrue(fn) {
|
118
|
+
this.__CACHE.__UNSAFE_SIGN_NONSEGWIT = true;
|
119
|
+
try {
|
120
|
+
return fn();
|
121
|
+
}
|
122
|
+
finally {
|
123
|
+
this.__CACHE.__UNSAFE_SIGN_NONSEGWIT = false;
|
124
|
+
}
|
116
125
|
}
|
117
126
|
setPropertyCheckSignatures(propName, value) {
|
118
127
|
if (this.tx[propName] === value) {
|
@@ -135,4 +144,4 @@ class ZcashPsbt extends UtxoPsbt_1.UtxoPsbt {
|
|
135
144
|
}
|
136
145
|
}
|
137
146
|
exports.ZcashPsbt = ZcashPsbt;
|
138
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiWmNhc2hQc2J0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2JpdGdvL3pjYXNoL1pjYXNoUHNidC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwwQ0FBaUQ7QUFDakQseURBSTRCO0FBQ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5VSW50MzIsIGNvbnNlbnN1c0JyYW5jaElkKTtcbiAgICB0aGlzLnNldFByb3BlcnR5Q2hlY2tTaWduYXR1cmVzKCdjb25zZW5zdXNCcmFuY2hJZCcsIGNvbnNlbnN1c0JyYW5jaElkKTtcbiAgfVxuXG4gIHNldFZlcnNpb25Hcm91cElkKHZlcnNpb25Hcm91cElkOiBudW1iZXIpOiB2b2lkIHtcbiAgICB0eXBlZm9yY2UodHlwZXMuVUludDMyLCB2ZXJzaW9uR3JvdXBJZCk7XG4gICAgdGhpcy5zZXRQcm9wZXJ0eUNoZWNrU2lnbmF0dXJlcygndmVyc2lvbkdyb3VwSWQnLCB2ZXJzaW9uR3JvdXBJZCk7XG4gIH1cblxuICBzZXRFeHBpcnlIZWlnaHQoZXhwaXJ5SGVpZ2h0OiBudW1iZXIpOiB2b2lkIHtcbiAgICB0eXBlZm9yY2UodHlwZXMuVUludDMyLCBleHBpcnlIZWlnaHQpO1xuICAgIHRoaXMuc2V0UHJvcGVydHlDaGVja1NpZ25hdHVyZXMoJ2V4cGlyeUhlaWdodCcsIGV4cGlyeUhlaWdodCk7XG4gIH1cbn1cbiJdfQ==
|
@@ -1,12 +1,9 @@
|
|
1
1
|
import { BIP32Interface } from 'bip32';
|
2
2
|
import { Triple } from '../bitgo';
|
3
3
|
import { RootWalletKeys } from '../bitgo';
|
4
|
-
import { ECPairInterface } from '../noble_ecc';
|
5
4
|
export declare type KeyTriple = Triple<BIP32Interface>;
|
6
|
-
export declare type UncompressedKeyTriple = Triple<ECPairInterface>;
|
7
5
|
export declare function getKey(seed: string): BIP32Interface;
|
8
6
|
export declare function getKeyTriple(seed: string): KeyTriple;
|
9
|
-
export declare function getUncompressedKeyTriple(inputs: Triple<number>): UncompressedKeyTriple;
|
10
7
|
export declare function getKeyName(triple: Triple<BIP32Interface>, k: BIP32Interface): string | undefined;
|
11
8
|
export declare function getDefaultCosigner<T>(keyset: Triple<T>, signer: T): T;
|
12
9
|
export declare function getDefaultWalletKeys(): RootWalletKeys;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/testutil/keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,cAAc,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/testutil/keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,cAAc,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAK1C,oBAAY,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAE/C,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAEnD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAEpD;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAEhG;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAarE;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CAErD"}
|
@@ -1,11 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getDefaultWalletKeys = exports.getDefaultCosigner = exports.getKeyName = exports.
|
3
|
+
exports.getDefaultWalletKeys = exports.getDefaultCosigner = exports.getKeyName = exports.getKeyTriple = exports.getKey = void 0;
|
4
4
|
const bip32_1 = require("bip32");
|
5
5
|
const crypto = require("crypto");
|
6
6
|
const bitgo_1 = require("../bitgo");
|
7
7
|
const noble_ecc_1 = require("../noble_ecc");
|
8
|
-
const networks_1 = require("../networks");
|
9
8
|
const bip32 = bip32_1.BIP32Factory(noble_ecc_1.ecc);
|
10
9
|
function getKey(seed) {
|
11
10
|
return bip32.fromSeed(crypto.createHash('sha256').update(seed).digest());
|
@@ -15,20 +14,6 @@ function getKeyTriple(seed) {
|
|
15
14
|
return [getKey(seed + '.0'), getKey(seed + '.1'), getKey(seed + '.2')];
|
16
15
|
}
|
17
16
|
exports.getKeyTriple = getKeyTriple;
|
18
|
-
function getUncompressedKey(input) {
|
19
|
-
// Using input for deterministic randomness
|
20
|
-
return noble_ecc_1.ECPair.makeRandom({
|
21
|
-
compressed: false,
|
22
|
-
network: networks_1.networks.testnet,
|
23
|
-
rng: () => {
|
24
|
-
return Buffer.alloc(32, input);
|
25
|
-
},
|
26
|
-
});
|
27
|
-
}
|
28
|
-
function getUncompressedKeyTriple(inputs) {
|
29
|
-
return [getUncompressedKey(inputs[0]), getUncompressedKey(inputs[1]), getUncompressedKey(inputs[2])];
|
30
|
-
}
|
31
|
-
exports.getUncompressedKeyTriple = getUncompressedKeyTriple;
|
32
17
|
function getKeyName(triple, k) {
|
33
18
|
return ['user', 'backup', 'bitgo'][triple.indexOf(k)];
|
34
19
|
}
|
@@ -52,4 +37,4 @@ function getDefaultWalletKeys() {
|
|
52
37
|
return new bitgo_1.RootWalletKeys(getKeyTriple('default'));
|
53
38
|
}
|
54
39
|
exports.getDefaultWalletKeys = getDefaultWalletKeys;
|
55
|
-
//# sourceMappingURL=data:application/json;base64,
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90ZXN0dXRpbC9rZXlzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGlDQUErRDtBQUMvRCxpQ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zZXI7XG4gIH1cbiAgdGhyb3cgbmV3IEVycm9yKGBzaWduZXIgbm90IGluIHB1YmtleXNgKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGdldERlZmF1bHRXYWxsZXRLZXlzKCk6IFJvb3RXYWxsZXRLZXlzIHtcbiAgcmV0dXJuIG5ldyBSb290V2FsbGV0S2V5cyhnZXRLZXlUcmlwbGUoJ2RlZmF1bHQnKSk7XG59XG4iXX0=
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ScriptType, ScriptType2Of3 } from '../bitgo/outputScripts';
|
2
|
-
import { KeyName, RootWalletKeys, Unspent, UtxoPsbt, UtxoTransaction } from '../bitgo';
|
2
|
+
import { KeyName, RootWalletKeys, Unspent, UtxoPsbt, UtxoTransaction, WalletUnspent } from '../bitgo';
|
3
3
|
import { Network } from '../networks';
|
4
4
|
/**
|
5
5
|
* input script type and value.
|
@@ -53,37 +53,19 @@ export declare function getSigners(inputType: InputScriptType): {
|
|
53
53
|
* signs with first or second signature for single input.
|
54
54
|
* p2shP2pk is signed only with first sign.
|
55
55
|
*/
|
56
|
-
export declare function signPsbtInput(psbt: UtxoPsbt, input: Input, inputIndex: number, rootWalletKeys: RootWalletKeys, sign: 'halfsigned' | 'fullsigned'
|
57
|
-
signers?: {
|
58
|
-
signerName: KeyName;
|
59
|
-
cosignerName?: KeyName;
|
60
|
-
};
|
61
|
-
deterministic?: boolean;
|
62
|
-
}): void;
|
56
|
+
export declare function signPsbtInput(psbt: UtxoPsbt, input: Input, inputIndex: number, rootWalletKeys: RootWalletKeys, sign: 'halfsigned' | 'fullsigned'): void;
|
63
57
|
/**
|
64
58
|
* signs with first or second signature for all inputs.
|
65
59
|
* p2shP2pk is signed only with first sign.
|
66
60
|
*/
|
67
|
-
export declare function signAllPsbtInputs(psbt: UtxoPsbt, inputs: Input[], rootWalletKeys: RootWalletKeys, sign: 'halfsigned' | 'fullsigned'
|
68
|
-
signers?: {
|
69
|
-
signerName: KeyName;
|
70
|
-
cosignerName?: KeyName;
|
71
|
-
};
|
72
|
-
deterministic?: boolean;
|
73
|
-
}): void;
|
61
|
+
export declare function signAllPsbtInputs(psbt: UtxoPsbt, inputs: Input[], rootWalletKeys: RootWalletKeys, sign: 'halfsigned' | 'fullsigned'): void;
|
74
62
|
/**
|
75
63
|
* construct psbt for given inputs, outputs, network and root wallet keys.
|
76
64
|
*/
|
77
|
-
export declare function constructPsbt(inputs: Input[], outputs: Output[], network: Network, rootWalletKeys: RootWalletKeys, sign: 'unsigned' | 'halfsigned' | 'fullsigned'
|
78
|
-
signers?: {
|
79
|
-
signerName: KeyName;
|
80
|
-
cosignerName?: KeyName;
|
81
|
-
};
|
82
|
-
deterministic?: boolean;
|
83
|
-
}): UtxoPsbt;
|
65
|
+
export declare function constructPsbt(inputs: Input[], outputs: Output[], network: Network, rootWalletKeys: RootWalletKeys, sign: 'unsigned' | 'halfsigned' | 'fullsigned'): UtxoPsbt;
|
84
66
|
/**
|
85
67
|
* Verifies signatures of fully signed tx (with taproot key path support).
|
86
68
|
* NOTE: taproot key path tx can only be built and signed with PSBT.
|
87
69
|
*/
|
88
|
-
export declare function verifyFullySignedSignatures(tx: UtxoTransaction<bigint>, unspents:
|
70
|
+
export declare function verifyFullySignedSignatures(tx: UtxoTransaction<bigint>, unspents: WalletUnspent<bigint>[], walletKeys: RootWalletKeys, signer: KeyName, cosigner: KeyName): boolean;
|
89
71
|
//# sourceMappingURL=psbt.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"psbt.d.ts","sourceRoot":"","sources":["../../../src/testutil/psbt.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,UAAU,EACV,cAAc,EAGf,MAAM,wBAAwB,CAAC;AAChC,OAAO,
|
1
|
+
{"version":3,"file":"psbt.d.ts","sourceRoot":"","sources":["../../../src/testutil/psbt.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,UAAU,EACV,cAAc,EAGf,MAAM,wBAAwB,CAAC;AAChC,OAAO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E,EACf,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,YAAY,GAAG,YAAY,GAChC,IAAI,CAIN;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,KAAK,EAAE,EACf,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,UAAU,GAAG,YAAY,GAAG,YAAY,GAC7C,QAAQ,CAoDV;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,eAAe,CAAC,MAAM,CAAC,EAC3B,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,EACjC,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,OAAO,GAChB,OAAO,CAiBT"}
|
@@ -51,9 +51,8 @@ exports.getSigners = getSigners;
|
|
51
51
|
* signs with first or second signature for single input.
|
52
52
|
* p2shP2pk is signed only with first sign.
|
53
53
|
*/
|
54
|
-
function signPsbtInput(psbt, input, inputIndex, rootWalletKeys, sign
|
55
|
-
const {
|
56
|
-
const { signerName, cosignerName } = signers ? signers : getSigners(input.scriptType);
|
54
|
+
function signPsbtInput(psbt, input, inputIndex, rootWalletKeys, sign) {
|
55
|
+
const { signerName, cosignerName } = getSigners(input.scriptType);
|
57
56
|
if (sign === 'halfsigned') {
|
58
57
|
if (input.scriptType === 'p2shP2pk') {
|
59
58
|
psbt.signInput(inputIndex, rootWalletKeys[signerName]);
|
@@ -62,8 +61,8 @@ function signPsbtInput(psbt, input, inputIndex, rootWalletKeys, sign, params) {
|
|
62
61
|
psbt.signInputHD(inputIndex, rootWalletKeys[signerName]);
|
63
62
|
}
|
64
63
|
}
|
65
|
-
if (sign === 'fullsigned' && cosignerName
|
66
|
-
psbt.signInputHD(inputIndex, rootWalletKeys[cosignerName]
|
64
|
+
if (sign === 'fullsigned' && cosignerName) {
|
65
|
+
psbt.signInputHD(inputIndex, rootWalletKeys[cosignerName]);
|
67
66
|
}
|
68
67
|
}
|
69
68
|
exports.signPsbtInput = signPsbtInput;
|
@@ -71,18 +70,16 @@ exports.signPsbtInput = signPsbtInput;
|
|
71
70
|
* signs with first or second signature for all inputs.
|
72
71
|
* p2shP2pk is signed only with first sign.
|
73
72
|
*/
|
74
|
-
function signAllPsbtInputs(psbt, inputs, rootWalletKeys, sign
|
75
|
-
|
76
|
-
|
77
|
-
signPsbtInput(psbt, input, inputIndex, rootWalletKeys, sign, { signers, deterministic });
|
73
|
+
function signAllPsbtInputs(psbt, inputs, rootWalletKeys, sign) {
|
74
|
+
inputs.forEach((input, index) => {
|
75
|
+
signPsbtInput(psbt, input, index, rootWalletKeys, sign);
|
78
76
|
});
|
79
77
|
}
|
80
78
|
exports.signAllPsbtInputs = signAllPsbtInputs;
|
81
79
|
/**
|
82
80
|
* construct psbt for given inputs, outputs, network and root wallet keys.
|
83
81
|
*/
|
84
|
-
function constructPsbt(inputs, outputs, network, rootWalletKeys, sign
|
85
|
-
const { signers, deterministic } = params !== null && params !== void 0 ? params : {};
|
82
|
+
function constructPsbt(inputs, outputs, network, rootWalletKeys, sign) {
|
86
83
|
const totalInputAmount = inputs.reduce((sum, input) => sum + input.value, BigInt(0));
|
87
84
|
const outputInputAmount = outputs.reduce((sum, output) => sum + output.value, BigInt(0));
|
88
85
|
assert(totalInputAmount >= outputInputAmount, 'total output can not exceed total input');
|
@@ -90,7 +87,7 @@ function constructPsbt(inputs, outputs, network, rootWalletKeys, sign, params) {
|
|
90
87
|
const psbt = bitgo_1.createPsbtForNetwork({ network });
|
91
88
|
const unspents = inputs.map((input, i) => toUnspent(input, i, network, rootWalletKeys));
|
92
89
|
unspents.forEach((u, i) => {
|
93
|
-
const { signerName, cosignerName } =
|
90
|
+
const { signerName, cosignerName } = getSigners(inputs[i].scriptType);
|
94
91
|
if (bitgo_1.isWalletUnspent(u) && cosignerName) {
|
95
92
|
bitgo_1.addWalletUnspentToPsbt(psbt, u, rootWalletKeys, signerName, cosignerName);
|
96
93
|
}
|
@@ -113,10 +110,10 @@ function constructPsbt(inputs, outputs, network, rootWalletKeys, sign, params) {
|
|
113
110
|
return psbt;
|
114
111
|
}
|
115
112
|
psbt.setAllInputsMusig2NonceHD(rootWalletKeys['user']);
|
116
|
-
psbt.setAllInputsMusig2NonceHD(rootWalletKeys['bitgo']
|
117
|
-
signAllPsbtInputs(psbt, inputs, rootWalletKeys, 'halfsigned'
|
113
|
+
psbt.setAllInputsMusig2NonceHD(rootWalletKeys['bitgo']);
|
114
|
+
signAllPsbtInputs(psbt, inputs, rootWalletKeys, 'halfsigned');
|
118
115
|
if (sign === 'fullsigned') {
|
119
|
-
signAllPsbtInputs(psbt, inputs, rootWalletKeys, sign
|
116
|
+
signAllPsbtInputs(psbt, inputs, rootWalletKeys, sign);
|
120
117
|
}
|
121
118
|
return psbt;
|
122
119
|
}
|
@@ -147,4 +144,4 @@ function verifyFullySignedSignatures(tx, unspents, walletKeys, signer, cosigner)
|
|
147
144
|
});
|
148
145
|
}
|
149
146
|
exports.verifyFullySignedSignatures = verifyFullySignedSignatures;
|
150
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHNidC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90ZXN0dXRpbC9wc2J0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGlDQUFpQztBQUVqQywwREFNZ0M7QUFDaEMsb0NBaUJrQjtBQUVsQixpQ0FBd0U7QUFDeEUsd0NBQTRDO0FBNkI1Qzs7OztHQUlHO0FBQ1UsUUFBQSxnQkFBZ0IsR0FBRyxDQUFDLEdBQUcsK0JBQWUsRUFBRSxxQkFBcUIsRUFBRSxrQ0FBa0IsQ0FBVSxDQUFDO0FBRXpHOztHQUVHO0FBQ1UsUUFBQSxpQkFBaUIsR0FBRywrQkFBZSxDQUFDO0FBRWpEOztHQUVH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cmlwdDJPZjModHguaW5zW2luZGV4XSkuc2NyaXB0VHlwZSA9PT0gJ3RhcHJvb3RLZXlQYXRoU3BlbmQnKSB7XG4gICAgICBjb25zdCByZXN1bHQgPSBnZXRTaWduYXR1cmVWZXJpZmljYXRpb25zKHR4LCBpbmRleCwgdS52YWx1ZSwgdW5kZWZpbmVkLCBwcmV2T3V0cHV0cyk7XG4gICAgICByZXR1cm4gcmVzdWx0Lmxlbmd0aCA9PT0gMSAmJiByZXN1bHRbMF0uc2lnbmF0dXJlO1xuICAgIH0gZWxzZSB7XG4gICAgICBjb25zdCByZXN1bHQgPSB2ZXJpZnlTaWduYXR1cmVXaXRoVW5zcGVudCh0eCwgaW5kZXgsIHVuc3BlbnRzLCB3YWxsZXRLZXlzKTtcbiAgICAgIGlmICgoc2lnbmVyID09PSAndXNlcicgJiYgY29zaWduZXIgPT09ICdiaXRnbycpIHx8IChzaWduZXIgPT09ICdiaXRnbycgJiYgY29zaWduZXIgPT09ICd1c2VyJykpIHtcbiAgICAgICAgcmV0dXJuIHJlc3VsdFswXSAmJiAhcmVzdWx0WzFdICYmIHJlc3VsdFsyXTtcbiAgICAgIH0gZWxzZSBpZiAoKHNpZ25lciA9PT0gJ3VzZXInICYmIGNvc2lnbmVyID09PSAnYmFja3VwJykgfHwgKHNpZ25lciA9PT0gJ2JhY2t1cCcgJiYgY29zaWduZXIgPT09ICd1c2VyJykpIHtcbiAgICAgICAgcmV0dXJuIHJlc3VsdFswXSAmJiByZXN1bHRbMV0gJiYgIXJlc3VsdFsyXTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybiAhcmVzdWx0WzBdICYmIHJlc3VsdFsxXSAmJiByZXN1bHRbMl07XG4gICAgICB9XG4gICAgfVxuICB9KTtcbn1cbiJdfQ==
|
147
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHNidC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi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nbmF0dXJlVmVyaWZpY2F0aW9ucyh0eCwgaW5kZXgsIHUudmFsdWUsIHVuZGVmaW5lZCwgcHJldk91dHB1dHMpO1xuICAgICAgcmV0dXJuIHJlc3VsdC5sZW5ndGggPT09IDEgJiYgcmVzdWx0WzBdLnNpZ25hdHVyZTtcbiAgICB9IGVsc2Uge1xuICAgICAgY29uc3QgcmVzdWx0ID0gdmVyaWZ5U2lnbmF0dXJlV2l0aFVuc3BlbnQodHgsIGluZGV4LCB1bnNwZW50cywgd2FsbGV0S2V5cyk7XG4gICAgICBpZiAoKHNpZ25lciA9PT0gJ3VzZXInICYmIGNvc2lnbmVyID09PSAnYml0Z28nKSB8fCAoc2lnbmVyID09PSAnYml0Z28nICYmIGNvc2lnbmVyID09PSAndXNlcicpKSB7XG4gICAgICAgIHJldHVybiByZXN1bHRbMF0gJiYgIXJlc3VsdFsxXSAmJiByZXN1bHRbMl07XG4gICAgICB9IGVsc2UgaWYgKChzaWduZXIgPT09ICd1c2VyJyAmJiBjb3NpZ25lciA9PT0gJ2JhY2t1cCcpIHx8IChzaWduZXIgPT09ICdiYWNrdXAnICYmIGNvc2lnbmVyID09PSAndXNlcicpKSB7XG4gICAgICAgIHJldHVybiByZXN1bHRbMF0gJiYgcmVzdWx0WzFdICYmICFyZXN1bHRbMl07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gIXJlc3VsdFswXSAmJiByZXN1bHRbMV0gJiYgcmVzdWx0WzJdO1xuICAgICAgfVxuICAgIH1cbiAgfSk7XG59XG4iXX0=
|
@@ -5,7 +5,7 @@ import { Network } from '../networks';
|
|
5
5
|
* input script type and value.
|
6
6
|
*/
|
7
7
|
export declare type TxnInputScriptType = Exclude<ScriptType, 'p2trMusig2'>;
|
8
|
-
export declare type TxnOutputScriptType = ScriptType2Of3
|
8
|
+
export declare type TxnOutputScriptType = Exclude<ScriptType2Of3, 'p2trMusig2'>;
|
9
9
|
/**
|
10
10
|
* output script type and value
|
11
11
|
*/
|
@@ -30,7 +30,7 @@ export declare const txnInputScriptTypes: readonly ["p2sh", "p2shP2wsh", "p2wsh"
|
|
30
30
|
/**
|
31
31
|
* array of supported output script types.
|
32
32
|
*/
|
33
|
-
export declare const txnOutputScriptTypes: readonly ["p2sh", "p2shP2wsh", "p2wsh", "p2tr"
|
33
|
+
export declare const txnOutputScriptTypes: readonly ["p2sh", "p2shP2wsh", "p2wsh", "p2tr"];
|
34
34
|
/**
|
35
35
|
* create unspent object from input script type, index, network and root wallet key.
|
36
36
|
*/
|
@@ -48,23 +48,14 @@ export declare function getTxnSigners(inputType: TxnInputScriptType): {
|
|
48
48
|
* signs with first or second signature for single input.
|
49
49
|
* p2shP2pk is signed only with first sign.
|
50
50
|
*/
|
51
|
-
export declare function signTxnInput<TNumber extends number | bigint>(txb: UtxoTransactionBuilder<TNumber>, input: TxnInput<TNumber>, inputIndex: number, rootWalletKeys: RootWalletKeys, sign: 'halfsigned' | 'fullsigned'
|
52
|
-
signerName: KeyName;
|
53
|
-
cosignerName?: KeyName;
|
54
|
-
}): void;
|
51
|
+
export declare function signTxnInput<TNumber extends number | bigint>(txb: UtxoTransactionBuilder<TNumber>, input: TxnInput<TNumber>, inputIndex: number, rootWalletKeys: RootWalletKeys, sign: 'halfsigned' | 'fullsigned'): void;
|
55
52
|
/**
|
56
53
|
* signs with first or second signature for all inputs.
|
57
54
|
* p2shP2pk is signed only with first sign.
|
58
55
|
*/
|
59
|
-
export declare function signAllTxnInputs<TNumber extends number | bigint>(txb: UtxoTransactionBuilder<TNumber>, inputs: TxnInput<TNumber>[], rootWalletKeys: RootWalletKeys, sign: 'halfsigned' | 'fullsigned'
|
60
|
-
signerName: KeyName;
|
61
|
-
cosignerName?: KeyName;
|
62
|
-
}): void;
|
56
|
+
export declare function signAllTxnInputs<TNumber extends number | bigint>(txb: UtxoTransactionBuilder<TNumber>, inputs: TxnInput<TNumber>[], rootWalletKeys: RootWalletKeys, sign: 'halfsigned' | 'fullsigned'): void;
|
63
57
|
/**
|
64
58
|
* construct transaction for given inputs, outputs, network and root wallet keys.
|
65
59
|
*/
|
66
|
-
export declare function constructTxnBuilder<TNumber extends number | bigint>(inputs: TxnInput<TNumber>[], outputs: TxnOutput<TNumber>[], network: Network, rootWalletKeys: RootWalletKeys, sign: 'unsigned' | 'halfsigned' | 'fullsigned'
|
67
|
-
signerName: KeyName;
|
68
|
-
cosignerName?: KeyName;
|
69
|
-
}): UtxoTransactionBuilder<TNumber>;
|
60
|
+
export declare function constructTxnBuilder<TNumber extends number | bigint>(inputs: TxnInput<TNumber>[], outputs: TxnOutput<TNumber>[], network: Network, rootWalletKeys: RootWalletKeys, sign: 'unsigned' | 'halfsigned' | 'fullsigned'): UtxoTransactionBuilder<TNumber>;
|
70
61
|
//# sourceMappingURL=transaction.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/testutil/transaction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,cAAc,
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/testutil/transaction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAsB,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAGL,OAAO,EAEP,cAAc,EACd,OAAO,EACP,sBAAsB,EAOvB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC;;GAEG;AACH,oBAAY,kBAAkB,GAAG,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AACnE,oBAAY,mBAAmB,GAAG,OAAO,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,QAAQ,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IACvD,UAAU,EAAE,kBAAkB,CAAC;IAC/B,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,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,MAAM,GAAG,MAAM,EACjE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,EAC3B,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,EAC7B,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,UAAU,GAAG,YAAY,GAAG,YAAY,GAC7C,sBAAsB,CAAC,OAAO,CAAC,CA2CjC"}
|
@@ -12,7 +12,7 @@ exports.txnInputScriptTypes = ['p2sh', 'p2shP2wsh', 'p2wsh', 'p2tr', outputScrip
|
|
12
12
|
/**
|
13
13
|
* array of supported output script types.
|
14
14
|
*/
|
15
|
-
exports.txnOutputScriptTypes =
|
15
|
+
exports.txnOutputScriptTypes = ['p2sh', 'p2shP2wsh', 'p2wsh', 'p2tr'];
|
16
16
|
/**
|
17
17
|
* create unspent object from input script type, index, network and root wallet key.
|
18
18
|
*/
|
@@ -46,8 +46,8 @@ exports.getTxnSigners = getTxnSigners;
|
|
46
46
|
* signs with first or second signature for single input.
|
47
47
|
* p2shP2pk is signed only with first sign.
|
48
48
|
*/
|
49
|
-
function signTxnInput(txb, input, inputIndex, rootWalletKeys, sign
|
50
|
-
const { signerName, cosignerName } =
|
49
|
+
function signTxnInput(txb, input, inputIndex, rootWalletKeys, sign) {
|
50
|
+
const { signerName, cosignerName } = getTxnSigners(input.scriptType);
|
51
51
|
const unspent = toTxnUnspent(input, inputIndex, txb.network, rootWalletKeys);
|
52
52
|
if (sign === 'halfsigned') {
|
53
53
|
if (input.scriptType === 'p2shP2pk') {
|
@@ -66,16 +66,16 @@ exports.signTxnInput = signTxnInput;
|
|
66
66
|
* signs with first or second signature for all inputs.
|
67
67
|
* p2shP2pk is signed only with first sign.
|
68
68
|
*/
|
69
|
-
function signAllTxnInputs(txb, inputs, rootWalletKeys, sign
|
69
|
+
function signAllTxnInputs(txb, inputs, rootWalletKeys, sign) {
|
70
70
|
inputs.forEach((input, index) => {
|
71
|
-
signTxnInput(txb, input, index, rootWalletKeys, sign
|
71
|
+
signTxnInput(txb, input, index, rootWalletKeys, sign);
|
72
72
|
});
|
73
73
|
}
|
74
74
|
exports.signAllTxnInputs = signAllTxnInputs;
|
75
75
|
/**
|
76
76
|
* construct transaction for given inputs, outputs, network and root wallet keys.
|
77
77
|
*/
|
78
|
-
function constructTxnBuilder(inputs, outputs, network, rootWalletKeys, sign
|
78
|
+
function constructTxnBuilder(inputs, outputs, network, rootWalletKeys, sign) {
|
79
79
|
const totalInputAmount = inputs.reduce((sum, input) => sum + BigInt(input.value), BigInt(0));
|
80
80
|
const outputInputAmount = outputs.reduce((sum, output) => sum + BigInt(output.value), BigInt(0));
|
81
81
|
assert(totalInputAmount >= outputInputAmount, 'total output can not exceed total input');
|
@@ -97,11 +97,11 @@ function constructTxnBuilder(inputs, outputs, network, rootWalletKeys, sign, sig
|
|
97
97
|
if (sign === 'unsigned') {
|
98
98
|
return txb;
|
99
99
|
}
|
100
|
-
signAllTxnInputs(txb, inputs, rootWalletKeys, 'halfsigned'
|
100
|
+
signAllTxnInputs(txb, inputs, rootWalletKeys, 'halfsigned');
|
101
101
|
if (sign === 'fullsigned') {
|
102
|
-
signAllTxnInputs(txb, inputs, rootWalletKeys, sign
|
102
|
+
signAllTxnInputs(txb, inputs, rootWalletKeys, sign);
|
103
103
|
}
|
104
104
|
return txb;
|
105
105
|
}
|
106
106
|
exports.constructTxnBuilder = constructTxnBuilder;
|
107
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNhY3Rpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGVzdHV0aWwvdHJhbnNhY3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsaUNBQWlDO0FBRWpDLDBEQUF5RztBQUN6RyxvQ0Fja0I7QUFFbEIsaUNBQXdFO0FBMkJ4RTs7R0FFRztBQUNVLFFBQUEsbUJ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Rlcm5hbENoYWluQ29kZShvdXRwdXQuc2NyaXB0VHlwZSkgOiBnZXRFeHRlcm5hbENoYWluQ29kZShvdXRwdXQuc2NyaXB0VHlwZSksXG4gICAgICAgICAgaSxcbiAgICAgICAgICBuZXR3b3JrXG4gICAgICAgIClcbiAgICAgIDogb3V0cHV0LmFkZHJlc3M7XG4gICAgaWYgKCFhZGRyZXNzKSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoJ2FkZHJlc3MgaXMgbWlzc2luZycpO1xuICAgIH1cbiAgICB0eGIuYWRkT3V0cHV0KGFkZHJlc3MsIG91dHB1dC52YWx1ZSk7XG4gIH0pO1xuXG4gIGlmIChzaWduID09PSAndW5zaWduZWQnKSB7XG4gICAgcmV0dXJuIHR4YjtcbiAgfVxuXG4gIHNpZ25BbGxUeG5JbnB1dHModHhiLCBpbnB1dHMsIHJvb3RXYWxsZXRLZXlzLCAnaGFsZnNpZ25lZCcpO1xuXG4gIGlmIChzaWduID09PSAnZnVsbHNpZ25lZCcpIHtcbiAgICBzaWduQWxsVHhuSW5wdXRzKHR4YiwgaW5wdXRzLCByb290V2FsbGV0S2V5cywgc2lnbik7XG4gIH1cblxuICByZXR1cm4gdHhiO1xufVxuIl19
|
package/package.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "utxo-lib",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.4",
|
4
4
|
"description": "Client-side Bitcoin JavaScript library",
|
5
5
|
"main": "./dist/src/index.js",
|
6
6
|
"engines": {
|
7
|
-
"node": ">=10.22.0 <
|
7
|
+
"node": ">=10.22.0 <17",
|
8
8
|
"npm": ">=3.10.10"
|
9
9
|
},
|
10
10
|
"keywords": [
|
@@ -46,8 +46,8 @@
|
|
46
46
|
"dist/src"
|
47
47
|
],
|
48
48
|
"dependencies": {
|
49
|
-
"@bitgo/blake2b": "^3.2.
|
50
|
-
"@brandonblack/musig": "
|
49
|
+
"@bitgo/blake2b": "^3.2.1",
|
50
|
+
"@brandonblack/musig": "^0.0.1-alpha.0",
|
51
51
|
"@noble/secp256k1": "1.6.3",
|
52
52
|
"bech32": "^2.0.0",
|
53
53
|
"bip174": "npm:@bitgo-forks/bip174@3.1.0-master.4",
|
@@ -68,7 +68,7 @@
|
|
68
68
|
"devDependencies": {
|
69
69
|
"@types/elliptic": "^6.4.12",
|
70
70
|
"@types/fs-extra": "^9.0.12",
|
71
|
-
"@types/node": "^
|
71
|
+
"@types/node": "^14.18.12",
|
72
72
|
"axios": "^0.21.1",
|
73
73
|
"debug": "^3.1.0",
|
74
74
|
"fs-extra": "^9.1.0"
|
@@ -1,14 +0,0 @@
|
|
1
|
-
export declare function readScalar(bytes: Uint8Array): bigint;
|
2
|
-
export declare function readSecret(bytes: Uint8Array): bigint;
|
3
|
-
export declare function isPoint(p: Uint8Array): boolean;
|
4
|
-
export declare function isXOnlyPoint(p: Uint8Array): boolean;
|
5
|
-
export declare function scalarAdd(a: Uint8Array, b: Uint8Array): Uint8Array;
|
6
|
-
export declare function scalarMultiply(a: Uint8Array, b: Uint8Array): Uint8Array;
|
7
|
-
export declare function scalarNegate(a: Uint8Array): Uint8Array;
|
8
|
-
export declare function scalarMod(a: Uint8Array): Uint8Array;
|
9
|
-
export declare function isScalar(t: Uint8Array): boolean;
|
10
|
-
export declare function isSecret(s: Uint8Array): boolean;
|
11
|
-
export declare function pointNegate(p: Uint8Array): Uint8Array;
|
12
|
-
export declare function pointX(p: Uint8Array): Uint8Array;
|
13
|
-
export declare function hasEvenY(p: Uint8Array): boolean;
|
14
|
-
//# sourceMappingURL=base_crypto.d.ts.map
|