utxo-lib 1.0.9 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +19 -16
- package/dist/src/address.d.ts.map +1 -1
- package/dist/src/address.js +11 -1
- 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 +115 -17
- package/dist/src/bitgo/Musig2.d.ts.map +1 -1
- package/dist/src/bitgo/Musig2.js +283 -100
- package/dist/src/bitgo/PsbtUtil.d.ts +59 -0
- package/dist/src/bitgo/PsbtUtil.d.ts.map +1 -0
- package/dist/src/bitgo/PsbtUtil.js +92 -0
- package/dist/src/bitgo/UtxoPsbt.d.ts +180 -47
- package/dist/src/bitgo/UtxoPsbt.d.ts.map +1 -1
- package/dist/src/bitgo/UtxoPsbt.js +673 -113
- package/dist/src/bitgo/UtxoTransaction.js +2 -2
- package/dist/src/bitgo/bitcoincash/address.js +2 -2
- package/dist/src/bitgo/index.d.ts +11 -0
- package/dist/src/bitgo/index.d.ts.map +1 -1
- package/dist/src/bitgo/index.js +6 -2
- package/dist/src/bitgo/legacysafe/index.d.ts +15 -0
- package/dist/src/bitgo/legacysafe/index.d.ts.map +1 -0
- package/dist/src/bitgo/legacysafe/index.js +61 -0
- package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts +10 -0
- package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts.map +1 -0
- package/dist/src/bitgo/litecoin/LitecoinPsbt.js +17 -0
- package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts +16 -0
- package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts.map +1 -0
- package/dist/src/bitgo/litecoin/LitecoinTransaction.js +46 -0
- package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts +10 -0
- package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts.map +1 -0
- package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.js +15 -0
- package/dist/src/bitgo/litecoin/index.d.ts +4 -0
- package/dist/src/bitgo/litecoin/index.d.ts.map +1 -0
- package/dist/src/bitgo/litecoin/index.js +16 -0
- package/dist/src/bitgo/outputScripts.d.ts +3 -1
- package/dist/src/bitgo/outputScripts.d.ts.map +1 -1
- package/dist/src/bitgo/outputScripts.js +20 -12
- package/dist/src/bitgo/parseInput.d.ts +49 -20
- package/dist/src/bitgo/parseInput.d.ts.map +1 -1
- package/dist/src/bitgo/parseInput.js +110 -26
- package/dist/src/bitgo/psbt/fromHalfSigned.d.ts.map +1 -1
- package/dist/src/bitgo/psbt/fromHalfSigned.js +9 -6
- package/dist/src/bitgo/psbt/scriptTypes.js +3 -3
- 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 +48 -16
- package/dist/src/bitgo/transaction.d.ts +18 -3
- package/dist/src/bitgo/transaction.d.ts.map +1 -1
- package/dist/src/bitgo/transaction.js +28 -15
- package/dist/src/bitgo/types.d.ts +2 -0
- 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 +104 -12
- package/dist/src/bitgo/wallet/Psbt.d.ts.map +1 -1
- package/dist/src/bitgo/wallet/Psbt.js +288 -70
- package/dist/src/bitgo/wallet/Unspent.d.ts +28 -0
- package/dist/src/bitgo/wallet/Unspent.d.ts.map +1 -1
- package/dist/src/bitgo/wallet/Unspent.js +173 -68
- package/dist/src/bitgo/wallet/WalletOutput.d.ts +17 -1
- package/dist/src/bitgo/wallet/WalletOutput.d.ts.map +1 -1
- package/dist/src/bitgo/wallet/WalletOutput.js +64 -23
- 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 +0 -1
- package/dist/src/bitgo/zcash/ZcashPsbt.d.ts.map +1 -1
- package/dist/src/bitgo/zcash/ZcashPsbt.js +8 -15
- package/dist/src/bitgo/zcash/ZcashTransaction.js +2 -2
- package/dist/src/musig.d.ts +0 -1
- package/dist/src/musig.d.ts.map +1 -1
- package/dist/src/musig.js +15 -29
- package/dist/src/networks.d.ts +1 -2
- package/dist/src/networks.d.ts.map +1 -1
- package/dist/src/networks.js +22 -29
- package/dist/src/noble_ecc.d.ts +1 -1
- package/dist/src/noble_ecc.d.ts.map +1 -1
- package/dist/src/noble_ecc.js +9 -5
- package/dist/src/payments/p2tr.d.ts.map +1 -1
- package/dist/src/payments/p2tr.js +25 -15
- package/dist/src/payments/p2tr_ns.js +3 -2
- package/dist/src/taproot.d.ts +16 -0
- package/dist/src/taproot.d.ts.map +1 -1
- package/dist/src/taproot.js +46 -3
- package/dist/src/testutil/index.d.ts +2 -0
- package/dist/src/testutil/index.d.ts.map +1 -1
- package/dist/src/testutil/index.js +3 -1
- package/dist/src/testutil/keys.d.ts +3 -0
- package/dist/src/testutil/keys.d.ts.map +1 -1
- package/dist/src/testutil/keys.js +17 -2
- 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 +12 -4
- package/dist/src/testutil/psbt.d.ts +89 -0
- package/dist/src/testutil/psbt.d.ts.map +1 -0
- package/dist/src/testutil/psbt.js +150 -0
- package/dist/src/testutil/transaction.d.ts +70 -0
- package/dist/src/testutil/transaction.d.ts.map +1 -0
- package/dist/src/testutil/transaction.js +107 -0
- package/dist/src/transaction_builder.js +2 -2
- package/package.json +7 -6
@@ -82,7 +82,7 @@ class UtxoTransaction extends bitcoinjs.Transaction {
|
|
82
82
|
return super.hashForSignature(inIndex, prevoutScript, hashType);
|
83
83
|
}
|
84
84
|
hashForSignature(inIndex, prevOutScript, hashType, value) {
|
85
|
-
value = value
|
85
|
+
value = value !== null && value !== void 0 ? value : this.ins[inIndex].value;
|
86
86
|
return this.hashForSignatureByNetwork(inIndex, prevOutScript, value, hashType);
|
87
87
|
}
|
88
88
|
clone(amountType) {
|
@@ -94,4 +94,4 @@ exports.UtxoTransaction = UtxoTransaction;
|
|
94
94
|
UtxoTransaction.SIGHASH_FORKID = 0x40;
|
95
95
|
/** @deprecated use SIGHASH_FORKID */
|
96
96
|
UtxoTransaction.SIGHASH_BITCOINCASHBIP143 = UtxoTransaction.SIGHASH_FORKID;
|
97
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVXR4b1RyYW5zYWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2JpdGdvL1V0eG9UcmFuc2FjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxpQ0FBaUM7QUFDakMsMkNBQTJDO0FBQzNDLDJDQUEyQztBQUMzQyx1Q0FBc0M7QUFFdEMsMENBQTJFO0FBRTNFLFNBQWdCLFlBQVksQ0FBQyxLQUFhO0lBQ3hDLE1BQU0sTUFBTSxHQUFHLEtBQUssQ0FBQyxNQUFNLENBQUM7SUFDNUIsT0FBTyxPQUFPLENBQUMsY0FBYyxDQUFDLE1BQU0sQ0FBQyxHQUFHLE1BQU0sQ0FBQztBQUNqRCxDQUFDO0FBSEQsb0NBR0M7QUFFRCxNQUFhLGVBQTBELFNBQVEsU0FBUyxDQUFDLFdBQW9CO0lBSzNHLFlBQ1MsT0FBZ0IsRUFDdkIsV0FBb0QsRUFDcEQsVUFBZ0M7UUFFaEMsS0FBSyxFQUFFLENBQUM7UUFKRCxZQUFPLEdBQVAsT0FBTyxDQUFTO1FBS3ZCLElBQUksV0FBVyxFQUFFO1lBQ2YsSUFBSSxDQUFDLE9BQU8sR0FBRyxXQUFXLENBQUMsT0FBTyxDQUFDO1lBQ25DLElBQUksQ0FBQyxRQUFRLEdBQUcsV0FBVyxDQUFDLFFBQVEsQ0FBQztZQUNyQyxJQUFJLENBQUMsR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gY2xvbmUuIEV2ZXJ5dGhpbmcgaXMgY29waWVkIGluIHRoZSBjb25zdHJ1Y3Rvci5cbiAgICByZXR1cm4gbmV3IFV0eG9UcmFuc2FjdGlvbjxUTjI+KHRoaXMubmV0d29yaywgdGhpcywgYW1vdW50VHlwZSk7XG4gIH1cbn1cbiJdfQ==
|
@@ -47,7 +47,7 @@ function getPrefix(network) {
|
|
47
47
|
case networks_1.networks.ecash:
|
48
48
|
return 'ecash';
|
49
49
|
case networks_1.networks.ecashTest:
|
50
|
-
return '
|
50
|
+
return 'ectest';
|
51
51
|
default:
|
52
52
|
throw new Error(`unsupported prefix for ${networks_1.getNetworkName(network)}`);
|
53
53
|
}
|
@@ -148,4 +148,4 @@ function toOutputScriptWithFormat(address, format, network) {
|
|
148
148
|
throw new Error(`invalid format`);
|
149
149
|
}
|
150
150
|
exports.toOutputScriptWithFormat = toOutputScriptWithFormat;
|
151
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iaXRnby9iaXRjb2luY2FzaC9hZGRyZXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBOzs7Ozs7Ozs7Ozs7R0FZRztBQUNILDJDQUEyQztBQUMzQywyQ0FBMkM7QUFDM0MsNkNBQTJGO0FBRzNGOzs7O0dBSUc7QUFDSCxTQUFTLHVCQUF1QixDQUFDLElBQVksRUFBRSxNQUFjO0lBRTNELE1BQU0sSUFBSSxHQUFJLFNBQVMsQ0FBQyxRQUFtRCxDQUFDLElBQUksQ0FBQyxDQUFDO0lBQ2xGLElBQUksQ0FBQyxJQUFJLEVBQUU7UUFDVCxNQUFNLElBQUksS0FBSyxDQUFDLHdCQUF3QixJQUFJLEVBQUUsQ0FBQyxDQUFDO0tBQ2pEO0lBQ0QsSUFBSTtRQUNGLE9BQ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ICB9XG5cbiAgdGhyb3cgbmV3IEVycm9yKGBpbnZhbGlkIGZvcm1hdGApO1xufVxuXG4vKipcbiAqIEBwYXJhbSBhZGRyZXNzXG4gKiBAcGFyYW0gZm9ybWF0XG4gKiBAcGFyYW0gbmV0d29ya1xuICogQHJldHVybiBvdXRwdXQgc2NyaXB0IGZyb20gYWRkcmVzcyBpbiBzcGVjaWZpZWQgZm9ybWF0XG4gKi9cbmV4cG9ydCBmdW5jdGlvbiB0b091dHB1dFNjcmlwdFdpdGhGb3JtYXQoYWRkcmVzczogc3RyaW5nLCBmb3JtYXQ6IEFkZHJlc3NGb3JtYXQsIG5ldHdvcms6IE5ldHdvcmspOiBCdWZmZXIge1xuICBpZiAoIWlzQml0Y29pbkNhc2gobmV0d29yaykgJiYgIWlzRUNhc2gobmV0d29yaykpIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoYGludmFsaWQgbmV0d29ya2ApO1xuICB9XG5cbiAgaWYgKGZvcm1hdCA9PT0gJ2Nhc2hhZGRyJykge1xuICAgIHJldHVybiB0b091dHB1dFNjcmlwdEZyb21DYXNoQWRkcmVzcyhhZGRyZXNzLCBuZXR3b3JrKTtcbiAgfVxuXG4gIGlmIChmb3JtYXQgPT09ICdkZWZhdWx0Jykge1xuICAgIHJldHVybiBiaXRjb2luanMuYWRkcmVzcy50b091dHB1dFNjcmlwdChhZGRyZXNzLCBuZXR3b3JrIGFzIGJpdGNvaW5qcy5OZXR3b3JrKTtcbiAgfVxuXG4gIHRocm93IG5ldyBFcnJvcihgaW52YWxpZCBmb3JtYXRgKTtcbn1cbiJdfQ==
|
@@ -1,7 +1,10 @@
|
|
1
|
+
export { PsbtInput, PsbtOutput } from 'bip174/src/lib/interfaces';
|
1
2
|
export * as bcashAddress from './bitcoincash';
|
2
3
|
export * as keyutil from './keyutil';
|
3
4
|
export * as nonStandardHalfSigned from './nonStandardHalfSigned';
|
4
5
|
export * as outputScripts from './outputScripts';
|
6
|
+
export * as legacySafe from './legacysafe';
|
7
|
+
export * as musig2 from './Musig2';
|
5
8
|
export * from './dash';
|
6
9
|
export * from './parseInput';
|
7
10
|
export * from './signature';
|
@@ -14,4 +17,12 @@ export * from './UtxoTransactionBuilder';
|
|
14
17
|
export * from './wallet';
|
15
18
|
export * from './zcash';
|
16
19
|
export * from './tnumber';
|
20
|
+
export * from './litecoin';
|
21
|
+
export * from './PsbtUtil';
|
22
|
+
import { PsbtInput } from 'bip174/src/lib/interfaces';
|
23
|
+
/**
|
24
|
+
* alias for PsbtInput type to avoid direct bip174 library dependency by users of the util functions
|
25
|
+
* @deprecated use PsbtInput instead
|
26
|
+
*/
|
27
|
+
export declare type PsbtInputType = PsbtInput;
|
17
28
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bitgo/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,qBAAqB,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bitgo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,qBAAqB,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD;;;GAGG;AACH,oBAAY,aAAa,GAAG,SAAS,CAAC"}
|
package/dist/src/bitgo/index.js
CHANGED
@@ -10,11 +10,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
11
11
|
};
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
-
exports.outputScripts = exports.nonStandardHalfSigned = exports.keyutil = exports.bcashAddress = void 0;
|
13
|
+
exports.musig2 = exports.legacySafe = exports.outputScripts = exports.nonStandardHalfSigned = exports.keyutil = exports.bcashAddress = void 0;
|
14
14
|
exports.bcashAddress = require("./bitcoincash");
|
15
15
|
exports.keyutil = require("./keyutil");
|
16
16
|
exports.nonStandardHalfSigned = require("./nonStandardHalfSigned");
|
17
17
|
exports.outputScripts = require("./outputScripts");
|
18
|
+
exports.legacySafe = require("./legacysafe");
|
19
|
+
exports.musig2 = require("./Musig2");
|
18
20
|
__exportStar(require("./dash"), exports);
|
19
21
|
__exportStar(require("./parseInput"), exports);
|
20
22
|
__exportStar(require("./signature"), exports);
|
@@ -27,4 +29,6 @@ __exportStar(require("./UtxoTransactionBuilder"), exports);
|
|
27
29
|
__exportStar(require("./wallet"), exports);
|
28
30
|
__exportStar(require("./zcash"), exports);
|
29
31
|
__exportStar(require("./tnumber"), exports);
|
30
|
-
|
32
|
+
__exportStar(require("./litecoin"), exports);
|
33
|
+
__exportStar(require("./PsbtUtil"), exports);
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYml0Z28vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OztBQUVBLGdEQUE4QztBQUM5Qyx1Q0FBcUM7QUFDckMsbUVBQWlFO0FBQ2pFLG1EQUFpRDtBQUNqRCw2Q0FBMkM7QUFDM0MscUNBQW1DO0FBQ25DLHlDQUF1QjtBQUN2QiwrQ0FBNkI7QUFDN0IsOENBQTRCO0FBQzVCLGdEQUE4QjtBQUM5QiwwQ0FBd0I7QUFDeEIsNENBQTBCO0FBQzFCLDZDQUEyQjtBQUMzQixvREFBa0M7QUFDbEMsMkRBQXlDO0FBQ3pDLDJDQUF5QjtBQUN6QiwwQ0FBd0I7QUFDeEIsNENBQTBCO0FBQzFCLDZDQUEyQjtBQUMzQiw2Q0FBMkIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBQc2J0SW5wdXQsIFBzYnRPdXRwdXQgfSBmcm9tICdiaXAxNzQvc3JjL2xpYi9pbnRlcmZhY2VzJztcblxuZXhwb3J0ICogYXMgYmNhc2hBZGRyZXNzIGZyb20gJy4vYml0Y29pbmNhc2gnO1xuZXhwb3J0ICogYXMga2V5dXRpbCBmcm9tICcuL2tleXV0aWwnO1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J0SW5wdXQgaW5zdGVhZFxuICovXG5leHBvcnQgdHlwZSBQc2J0SW5wdXRUeXBlID0gUHNidElucHV0O1xuIl19
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
* V1 Safe Wallets are the oldest type of wallets that BitGo supports. They were
|
3
|
+
* created back in 2013-14 and don't use HD chains. Instead, they have only one
|
4
|
+
* P2SH address per wallet whose redeem script uses uncompressed public keys.
|
5
|
+
* */
|
6
|
+
/// <reference types="node" />
|
7
|
+
import { Network } from '../../networks';
|
8
|
+
export declare function toUncompressedPub(pubkey: Buffer): Buffer;
|
9
|
+
export declare function toCompressedPub(pubkey: Buffer): Buffer;
|
10
|
+
/** create p2sh scripts with uncompressed pubkeys */
|
11
|
+
export declare function createLegacySafeOutputScript2of3(pubkeys: Buffer[], network?: Network): {
|
12
|
+
scriptPubKey: Buffer;
|
13
|
+
redeemScript: Buffer;
|
14
|
+
};
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/legacysafe/index.ts"],"names":[],"mappings":"AAAA;;;;KAIK;;AAIL,OAAO,EAAa,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAepD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,oDAAoD;AACpD,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,CAAC,EAAE,OAAO,GAChB;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAgCA"}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
"use strict";
|
2
|
+
/**
|
3
|
+
* V1 Safe Wallets are the oldest type of wallets that BitGo supports. They were
|
4
|
+
* created back in 2013-14 and don't use HD chains. Instead, they have only one
|
5
|
+
* P2SH address per wallet whose redeem script uses uncompressed public keys.
|
6
|
+
* */
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
8
|
+
exports.createLegacySafeOutputScript2of3 = exports.toCompressedPub = exports.toUncompressedPub = void 0;
|
9
|
+
const assert = require("assert");
|
10
|
+
const noble_ecc_1 = require("../../noble_ecc");
|
11
|
+
const networks_1 = require("../../networks");
|
12
|
+
const types_1 = require("../types");
|
13
|
+
const bitcoinjs = require("bitcoinjs-lib");
|
14
|
+
function getPublicKeyBuffer(publicKey, { compressed = true } = {}) {
|
15
|
+
const res = noble_ecc_1.ecc.pointCompress(publicKey, compressed);
|
16
|
+
if (res === null) {
|
17
|
+
throw new Error('invalid public key');
|
18
|
+
}
|
19
|
+
const buffer = Buffer.from(res);
|
20
|
+
assert.strictEqual(buffer.length, compressed ? 33 : 65);
|
21
|
+
return buffer;
|
22
|
+
}
|
23
|
+
function toUncompressedPub(pubkey) {
|
24
|
+
return getPublicKeyBuffer(pubkey, { compressed: false });
|
25
|
+
}
|
26
|
+
exports.toUncompressedPub = toUncompressedPub;
|
27
|
+
function toCompressedPub(pubkey) {
|
28
|
+
return getPublicKeyBuffer(pubkey, { compressed: true });
|
29
|
+
}
|
30
|
+
exports.toCompressedPub = toCompressedPub;
|
31
|
+
/** create p2sh scripts with uncompressed pubkeys */
|
32
|
+
function createLegacySafeOutputScript2of3(pubkeys, network) {
|
33
|
+
if (network) {
|
34
|
+
if (!networks_1.isBitcoin(network)) {
|
35
|
+
throw new Error(`unsupported network for legacy safe output script: ${network.coin}`);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
if (!types_1.isTriple(pubkeys)) {
|
39
|
+
throw new Error(`must provide pubkey triple`);
|
40
|
+
}
|
41
|
+
pubkeys.forEach((key) => {
|
42
|
+
if (key.length !== pubkeys[0].length) {
|
43
|
+
throw new Error(`all pubkeys must have the same length`);
|
44
|
+
}
|
45
|
+
if (key.length !== 65 && key.length !== 33) {
|
46
|
+
// V1 Safe BTC wallets could contain either uncompressed or compressed pubkeys
|
47
|
+
throw new Error(`Unexpected key length ${key.length}, neither compressed nor uncompressed.`);
|
48
|
+
}
|
49
|
+
});
|
50
|
+
const script2of3 = bitcoinjs.payments.p2ms({ m: 2, pubkeys });
|
51
|
+
assert(script2of3.output);
|
52
|
+
const scriptPubKey = bitcoinjs.payments.p2sh({ redeem: script2of3 });
|
53
|
+
assert(scriptPubKey);
|
54
|
+
assert(scriptPubKey.output);
|
55
|
+
return {
|
56
|
+
scriptPubKey: scriptPubKey.output,
|
57
|
+
redeemScript: script2of3.output,
|
58
|
+
};
|
59
|
+
}
|
60
|
+
exports.createLegacySafeOutputScript2of3 = createLegacySafeOutputScript2of3;
|
61
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYml0Z28vbGVnYWN5c2FmZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7S0FJSzs7O0FBRUwsaUNBQWlDO0FBQ2pDLCtDQUFnRDtBQUNoRCw2Q0FBb0Q7QUFDcEQsb0NBQW9DO0FBQ3BDLDJDQUEyQztBQUUzQyxTQUFTLGtCQUFrQixDQUFDLFNBQWlCLEVBQUUsRUFBRSxVQUFVLEdBQUcsSUFBSSxFQUFFLEdBQUcsRUFBRTtJQUN2RSxNQUFNLEdBQUcsR0FBRyxlQUFNLENBQUMsYUFBYSxDQUFDLFNBQVMsRUFBRSxVQUFVLENBQUMsQ0FBQztJQUN4RCxJQUFJLEdBQUcsS0FBSyxJQUFJLEVBQUU7UUFDaEIsTUFBTSxJQUFJLEtBQUssQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDO0tBQ3ZDO0lBQ0QsTUFBTSxNQUFNLEdBQUcsTUFBTSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0F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IgdW5jb21wcmVzc2VkIG9yIGNvbXByZXNzZWQgcHVia2V5c1xuICAgICAgdGhyb3cgbmV3IEVycm9yKGBVbmV4cGVjdGVkIGtleSBsZW5ndGggJHtrZXkubGVuZ3RofSwgbmVpdGhlciBjb21wcmVzc2VkIG5vciB1bmNvbXByZXNzZWQuYCk7XG4gICAgfVxuICB9KTtcblxuICBjb25zdCBzY3JpcHQyb2YzID0gYml0Y29pbmpzLnBheW1lbnRzLnAybXMoeyBtOiAyLCBwdWJrZXlzIH0pO1xuICBhc3NlcnQoc2NyaXB0Mm9mMy5vdXRwdXQpO1xuXG4gIGNvbnN0IHNjcmlwdFB1YktleSA9IGJpdGNvaW5qcy5wYXltZW50cy5wMnNoKHsgcmVkZWVtOiBzY3JpcHQyb2YzIH0pO1xuICBhc3NlcnQoc2NyaXB0UHViS2V5KTtcbiAgYXNzZXJ0KHNjcmlwdFB1YktleS5vdXRwdXQpO1xuXG4gIHJldHVybiB7XG4gICAgc2NyaXB0UHViS2V5OiBzY3JpcHRQdWJLZXkub3V0cHV0LFxuICAgIHJlZGVlbVNjcmlwdDogc2NyaXB0Mm9mMy5vdXRwdXQsXG4gIH07XG59XG4iXX0=
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { PsbtOpts, UtxoPsbt } from '../UtxoPsbt';
|
3
|
+
import { Network } from '../../networks';
|
4
|
+
import { Psbt as PsbtBase } from 'bip174';
|
5
|
+
import { LitecoinTransaction } from './LitecoinTransaction';
|
6
|
+
export declare class LitecoinPsbt extends UtxoPsbt<LitecoinTransaction<bigint>> {
|
7
|
+
protected static transactionFromBuffer(buffer: Buffer, network: Network): LitecoinTransaction<bigint>;
|
8
|
+
static createPsbt(opts: PsbtOpts, data?: PsbtBase): LitecoinPsbt;
|
9
|
+
}
|
10
|
+
//# sourceMappingURL=LitecoinPsbt.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LitecoinPsbt.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/litecoin/LitecoinPsbt.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBAAa,YAAa,SAAQ,QAAQ,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACrE,SAAS,CAAC,MAAM,CAAC,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAIrG,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,YAAY;CAMjE"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.LitecoinPsbt = void 0;
|
4
|
+
const UtxoPsbt_1 = require("../UtxoPsbt");
|
5
|
+
const bip174_1 = require("bip174");
|
6
|
+
const bitcoinjs_lib_1 = require("bitcoinjs-lib");
|
7
|
+
const LitecoinTransaction_1 = require("./LitecoinTransaction");
|
8
|
+
class LitecoinPsbt extends UtxoPsbt_1.UtxoPsbt {
|
9
|
+
static transactionFromBuffer(buffer, network) {
|
10
|
+
return LitecoinTransaction_1.LitecoinTransaction.fromBuffer(buffer, false, 'bigint', network);
|
11
|
+
}
|
12
|
+
static createPsbt(opts, data) {
|
13
|
+
return new LitecoinPsbt(opts, data || new bip174_1.Psbt(new bitcoinjs_lib_1.PsbtTransaction({ tx: new LitecoinTransaction_1.LitecoinTransaction(opts.network) })));
|
14
|
+
}
|
15
|
+
}
|
16
|
+
exports.LitecoinPsbt = LitecoinPsbt;
|
17
|
+
//# sourceM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vaW5qcy1saWInO1xuaW1wb3J0IHsgTGl0ZWNvaW5UcmFuc2FjdGlvbiB9IGZyb20gJy4vTGl0ZWNvaW5UcmFuc2FjdGlvbic7XG5cbmV4cG9ydCBjbGFzcyBMaXRlY29pblBzYnQgZXh0ZW5kcyBVdHhvUHNidDxMaXRlY29pblRyYW5zYWN0aW9uPGJpZ2ludD4+IHtcbiAgcHJvdGVjdGVkIHN0YXRpYyB0cmFuc2FjdGlvbkZyb21CdWZmZXIoYnVmZmVyOiBCdWZmZXIsIG5ldHdvcms6IE5ldHdvcmspOiBMaXRlY29pblRyYW5zYWN0aW9uPGJpZ2ludD4ge1xuICAgIHJldHVybiBMaXRlY29pblRyYW5zYWN0aW9uLmZyb21CdWZmZXI8YmlnaW50PihidWZmZXIsIGZhbHNlLCAnYmlnaW50JywgbmV0d29yayk7XG4gIH1cblxuICBzdGF0aWMgY3JlYXRlUHNidChvcHRzOiBQc2J0T3B0cywgZGF0YT86IFBzYnRCYXNlKTogTGl0ZWNvaW5Qc2J0IHtcbiAgICByZXR1cm4gbmV3IExpdGVjb2luUHNidChcbiAgICAgIG9wdHMsXG4gICAgICBkYXRhIHx8IG5ldyBQc2J0QmFzZShuZXcgUHNidFRyYW5zYWN0aW9uKHsgdHg6IG5ldyBMaXRlY29pblRyYW5zYWN0aW9uPGJpZ2ludD4ob3B0cy5uZXR3b3JrKSB9KSlcbiAgICApO1xuICB9XG59XG4iXX0=
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { UtxoTransaction } from '../UtxoTransaction';
|
3
|
+
import { Network, networks } from '../../networks';
|
4
|
+
export declare type LitecoinNetwork = typeof networks.litecoin | typeof networks.litecoinTest;
|
5
|
+
/**
|
6
|
+
* We only care about reading a transaction that can have a potentially different advanced transaction flag,
|
7
|
+
* but we dont need to write one.
|
8
|
+
*/
|
9
|
+
export declare class LitecoinTransaction<TNumber extends number | bigint = number> extends UtxoTransaction<TNumber> {
|
10
|
+
static MWEB_PEGOUT_TX_FLAG: number;
|
11
|
+
constructor(network: Network, tx?: LitecoinTransaction<bigint | number>, amountType?: 'bigint' | 'number');
|
12
|
+
protected static newTransaction<TNumber extends number | bigint = number>(network: Network, transaction?: LitecoinTransaction<number | bigint>, amountType?: 'number' | 'bigint'): LitecoinTransaction<TNumber>;
|
13
|
+
clone<TN2 extends bigint | number = TNumber>(amountType?: 'number' | 'bigint'): LitecoinTransaction<TN2>;
|
14
|
+
static fromBuffer<TNumber extends number | bigint = number>(buffer: Buffer, noStrict: boolean, amountType?: 'number' | 'bigint', network?: LitecoinNetwork): LitecoinTransaction<TNumber>;
|
15
|
+
}
|
16
|
+
//# sourceMappingURL=LitecoinTransaction.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LitecoinTransaction.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/litecoin/LitecoinTransaction.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAc,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/D,oBAAY,eAAe,GAAG,OAAO,QAAQ,CAAC,QAAQ,GAAG,OAAO,QAAQ,CAAC,YAAY,CAAC;AAEtF;;;GAGG;AACH,qBAAa,mBAAmB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAE,SAAQ,eAAe,CAAC,OAAO,CAAC;IACzG,MAAM,CAAC,mBAAmB,SAAQ;gBAEtB,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,mBAAmB,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ;IAQzG,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EACtE,OAAO,EAAE,OAAO,EAChB,WAAW,CAAC,EAAE,mBAAmB,CAAC,MAAM,GAAG,MAAM,CAAC,EAClD,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAC/B,mBAAmB,CAAC,OAAO,CAAC;IAI/B,KAAK,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,UAAU,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,mBAAmB,CAAC,GAAG,CAAC;IAIxG,MAAM,CAAC,UAAU,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,EACxD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,OAAO,EACjB,UAAU,GAAE,QAAQ,GAAG,QAAmB,EAC1C,OAAO,CAAC,EAAE,eAAe,GACxB,mBAAmB,CAAC,OAAO,CAAC;CAuBhC"}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.LitecoinTransaction = void 0;
|
4
|
+
const bufferutils_1 = require("bitcoinjs-lib/src/bufferutils");
|
5
|
+
const UtxoTransaction_1 = require("../UtxoTransaction");
|
6
|
+
const networks_1 = require("../../networks");
|
7
|
+
/**
|
8
|
+
* We only care about reading a transaction that can have a potentially different advanced transaction flag,
|
9
|
+
* but we dont need to write one.
|
10
|
+
*/
|
11
|
+
class LitecoinTransaction extends UtxoTransaction_1.UtxoTransaction {
|
12
|
+
constructor(network, tx, amountType) {
|
13
|
+
super(network, tx, amountType);
|
14
|
+
if (!networks_1.isLitecoin(network)) {
|
15
|
+
throw new Error(`invalid network`);
|
16
|
+
}
|
17
|
+
}
|
18
|
+
static newTransaction(network, transaction, amountType) {
|
19
|
+
return new LitecoinTransaction(network, transaction, amountType);
|
20
|
+
}
|
21
|
+
clone(amountType) {
|
22
|
+
return new LitecoinTransaction(this.network, this, amountType);
|
23
|
+
}
|
24
|
+
static fromBuffer(buffer, noStrict, amountType = 'number', network) {
|
25
|
+
if (!network) {
|
26
|
+
throw new Error(`must provide network`);
|
27
|
+
}
|
28
|
+
const bufferReader = new bufferutils_1.BufferReader(buffer);
|
29
|
+
const txVersion = bufferReader.readInt32();
|
30
|
+
const marker = bufferReader.readUInt8();
|
31
|
+
const flag = bufferReader.readUInt8();
|
32
|
+
if (marker === LitecoinTransaction.ADVANCED_TRANSACTION_MARKER &&
|
33
|
+
flag === LitecoinTransaction.MWEB_PEGOUT_TX_FLAG) {
|
34
|
+
// Litecoin has an MWEB advanced transaction marker. Slice out the marker and 5th to last byte and read like a normal transaction
|
35
|
+
const bufferWriter = new bufferutils_1.BufferWriter(Buffer.allocUnsafe(buffer.length - 3));
|
36
|
+
bufferWriter.writeUInt32(txVersion);
|
37
|
+
bufferWriter.writeSlice(buffer.slice(6, buffer.length - 5));
|
38
|
+
bufferWriter.writeSlice(buffer.slice(buffer.length - 4, buffer.length));
|
39
|
+
return super.fromBuffer(bufferWriter.buffer, noStrict, amountType, network);
|
40
|
+
}
|
41
|
+
return super.fromBuffer(buffer, noStrict, amountType, network);
|
42
|
+
}
|
43
|
+
}
|
44
|
+
exports.LitecoinTransaction = LitecoinTransaction;
|
45
|
+
LitecoinTransaction.MWEB_PEGOUT_TX_FLAG = 0x08;
|
46
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTGl0ZWNvaW5UcmFuc2FjdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iaXRnby9saXRlY29pbi9MaXRlY29pblRyYW5zYWN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLCtEQUEyRTtBQUUzRSx3REFBcUQ7QUFDckQsNkNBQStEO0FBSS9EOzs7R0FHRztBQUNILE1BQWEsbUJBQThELFNBQVEsaUNBQXdCO0lBR3pHLFlBQVksT0FBZ0IsRUFBRSxFQUF5QyxFQUFFLFVBQWdDO1FBQ3ZHLEtBQUssQ0FBQyxPQUFPLEVBQUUsRUFBRSxFQUFFLFVB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uilder';
|
3
|
+
import { Network } from '../../networks';
|
4
|
+
import { UtxoTransaction } from '../UtxoTransaction';
|
5
|
+
import { LitecoinTransaction } from './LitecoinTransaction';
|
6
|
+
export declare class LitecoinTransactionBuilder<TNumber extends number | bigint = number> extends UtxoTransactionBuilder<TNumber, LitecoinTransaction<TNumber>> {
|
7
|
+
protected static newTransactionBuilder<TNumber extends number | bigint>(network: Network, tx: UtxoTransaction<TNumber>): LitecoinTransactionBuilder<TNumber>;
|
8
|
+
protected createInitialTransaction(network: Network, tx?: bitcoinjs.Transaction<TNumber>): LitecoinTransaction<TNumber>;
|
9
|
+
}
|
10
|
+
//# sourceMappingURL=LitecoinTransactionBuilder.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LitecoinTransactionBuilder.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/litecoin/LitecoinTransactionBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBAAa,0BAA0B,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAE,SAAQ,sBAAsB,CAC9G,OAAO,EACP,mBAAmB,CAAC,OAAO,CAAC,CAC7B;IACC,SAAS,CAAC,MAAM,CAAC,qBAAqB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EACpE,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,eAAe,CAAC,OAAO,CAAC,GAC3B,0BAA0B,CAAC,OAAO,CAAC;IAItC,SAAS,CAAC,wBAAwB,CAChC,OAAO,EAAE,OAAO,EAChB,EAAE,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,GAClC,mBAAmB,CAAC,OAAO,CAAC;CAGhC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.LitecoinTransactionBuilder = void 0;
|
4
|
+
const UtxoTransactionBuilder_1 = require("../UtxoTransactionBuilder");
|
5
|
+
const LitecoinTransaction_1 = require("./LitecoinTransaction");
|
6
|
+
class LitecoinTransactionBuilder extends UtxoTransactionBuilder_1.UtxoTransactionBuilder {
|
7
|
+
static newTransactionBuilder(network, tx) {
|
8
|
+
return new LitecoinTransactionBuilder(network, tx);
|
9
|
+
}
|
10
|
+
createInitialTransaction(network, tx) {
|
11
|
+
return new LitecoinTransaction_1.LitecoinTransaction(network, tx);
|
12
|
+
}
|
13
|
+
}
|
14
|
+
exports.LitecoinTransactionBuilder = LitecoinTransactionBuilder;
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTGl0ZWNvaW5UcmFuc2FjdGlvbkJ1aWxkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYml0Z28vbGl0ZWNvaW4vTGl0ZWNvaW5UcmFuc2FjdGlvbkJ1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsc0VBQW1FO0FBR25FLCtEQUE0RDtBQUU1RCxNQUFhLDBCQUFxRSxTQUFRLCtDQUd6RjtJQUNXLE1BQU0sQ0FBQyxxQkFBcUIsQ0FDcEMsT0FBZ0IsRUFDaEIsRUFBNEI7UUFFNUIsT0FBTyxJQUFJLDBCQUEwQixDQUFVLE9BQU8sRUFBRSxFQUFFLENBQUMsQ0FBQztJQUM5RCxDQUFDO0lBRVMsd0JBQXdCLENBQ2hDLE9BQWdCLEVBQ2hCLEVBQW1DO1FBRW5DLE9BQU8sSUFBSSx5Q0FBbUIsQ0FBVSxP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YWxUcmFuc2FjdGlvbihcbiAgICBuZXR3b3JrOiBOZXR3b3JrLFxuICAgIHR4PzogYml0Y29pbmpzLlRyYW5zYWN0aW9uPFROdW1iZXI+XG4gICk6IExpdGVjb2luVHJhbnNhY3Rpb248VE51bWJlcj4ge1xuICAgIHJldHVybiBuZXcgTGl0ZWNvaW5UcmFuc2FjdGlvbjxUTnVtYmVyPihuZXR3b3JrLCB0eCBhcyBMaXRlY29pblRyYW5zYWN0aW9uPFROdW1iZXI+KTtcbiAgfVxufVxuIl19
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/litecoin/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
11
|
+
};
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
+
__exportStar(require("./LitecoinPsbt"), exports);
|
14
|
+
__exportStar(require("./LitecoinTransaction"), exports);
|
15
|
+
__exportStar(require("./LitecoinTransactionBuilder"), exports);
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYml0Z28vbGl0ZWNvaW4vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQUEsaURBQStCO0FBQy9CLHdEQUFzQztBQUN0QywrREFBNkMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL0xpdGVjb2luUHNidCc7XG5leHBvcnQgKiBmcm9tICcuL0xpdGVjb2luVHJhbnNhY3Rpb24nO1xuZXhwb3J0ICogZnJvbSAnLi9MaXRlY29pblRyYW5zYWN0aW9uQnVpbGRlcic7XG4iXX0=
|
@@ -6,7 +6,7 @@ export { scriptTypeForChain } from './wallet/chains';
|
|
6
6
|
export declare const scriptTypeP2shP2pk = "p2shP2pk";
|
7
7
|
export declare type ScriptTypeP2shP2pk = typeof scriptTypeP2shP2pk;
|
8
8
|
export declare const scriptTypes2Of3: readonly ["p2sh", "p2shP2wsh", "p2wsh", "p2tr", "p2trMusig2"];
|
9
|
-
export declare type ScriptType2Of3 = typeof scriptTypes2Of3[number];
|
9
|
+
export declare type ScriptType2Of3 = (typeof scriptTypes2Of3)[number];
|
10
10
|
export declare function isScriptType2Of3(t: string): t is ScriptType2Of3;
|
11
11
|
export declare type ScriptType = ScriptTypeP2shP2pk | ScriptType2Of3;
|
12
12
|
/**
|
@@ -65,6 +65,8 @@ export declare function checkXOnlyPublicKey(b: Buffer): Buffer;
|
|
65
65
|
* Validates size of the pub key for 32 bytes and returns the same iff true.
|
66
66
|
*/
|
67
67
|
export declare function checkPlainPublicKey(b: Buffer): Buffer;
|
68
|
+
export declare function checkTapMerkleRoot(b: Buffer): Buffer;
|
69
|
+
export declare function checkTxHash(b: Buffer): Buffer;
|
68
70
|
export declare function createPaymentP2tr(pubkeys: Triple<Buffer>, redeemIndex?: number | {
|
69
71
|
signer: Buffer;
|
70
72
|
cosigner: Buffer;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"outputScripts.d.ts","sourceRoot":"","sources":["../../../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