@bitcoinerlab/descriptors 3.0.2 → 3.0.4
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.
|
@@ -6,9 +6,41 @@
|
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.isTaprootInput = exports.witnessStackToScriptWitness = exports.tweakKey = exports.toHashTree = exports.tapTweakHash = exports.tapleafHash = exports.findScriptPath = void 0;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
9
|
+
function resolveAbsoluteCjsPath(relativePath) {
|
|
10
|
+
try {
|
|
11
|
+
const entryPoint = require.resolve('bitcoinjs-lib');
|
|
12
|
+
const root = entryPoint.replace(/src[\\/]+cjs[\\/]+index\.cjs$/, '');
|
|
13
|
+
if (root === entryPoint)
|
|
14
|
+
return undefined;
|
|
15
|
+
return `${root}src/cjs/${relativePath}.cjs`;
|
|
16
|
+
}
|
|
17
|
+
catch (_err) {
|
|
18
|
+
void _err;
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function requireBitcoinJsInternal(relativePath) {
|
|
23
|
+
const candidatePaths = [
|
|
24
|
+
`bitcoinjs-lib/src/${relativePath}`,
|
|
25
|
+
`bitcoinjs-lib/src/cjs/${relativePath}.cjs`
|
|
26
|
+
];
|
|
27
|
+
const absoluteCjsPath = resolveAbsoluteCjsPath(relativePath);
|
|
28
|
+
if (absoluteCjsPath)
|
|
29
|
+
candidatePaths.push(absoluteCjsPath);
|
|
30
|
+
let lastError;
|
|
31
|
+
for (const modulePath of candidatePaths) {
|
|
32
|
+
try {
|
|
33
|
+
return require(modulePath);
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
lastError = err;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
throw lastError;
|
|
40
|
+
}
|
|
41
|
+
const bip341 = requireBitcoinJsInternal('payments/bip341');
|
|
42
|
+
const bip371 = requireBitcoinJsInternal('psbt/bip371');
|
|
43
|
+
const psbtUtils = requireBitcoinJsInternal('psbt/psbtutils');
|
|
12
44
|
exports.findScriptPath = bip341.findScriptPath;
|
|
13
45
|
exports.tapleafHash = bip341.tapleafHash;
|
|
14
46
|
exports.tapTweakHash = bip341.tapTweakHash;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@bitcoinerlab/descriptors",
|
|
3
3
|
"description": "This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets.",
|
|
4
4
|
"homepage": "https://github.com/bitcoinerlab/descriptors",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.4",
|
|
6
6
|
"author": "Jose-Luis Landabaso",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@bitcoinerlab/miniscript": "^2.0.0",
|
|
71
71
|
"@bitcoinerlab/secp256k1": "^1.2.0",
|
|
72
|
-
"bip32": "
|
|
72
|
+
"bip32": "^5.0.1",
|
|
73
73
|
"bitcoinjs-lib": "^7.0.1",
|
|
74
74
|
"ecpair": "^3.0.1",
|
|
75
75
|
"lodash.memoize": "^4.1.2",
|