utxo-lib 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. package/dist/src/address.d.ts.map +1 -1
  2. package/dist/src/address.js +1 -11
  3. package/dist/src/addressFormat.d.ts +1 -1
  4. package/dist/src/addressFormat.d.ts.map +1 -1
  5. package/dist/src/addressFormat.js +1 -1
  6. package/dist/src/bitgo/Musig2.d.ts +17 -115
  7. package/dist/src/bitgo/Musig2.d.ts.map +1 -1
  8. package/dist/src/bitgo/Musig2.js +101 -283
  9. package/dist/src/bitgo/UtxoPsbt.d.ts +49 -173
  10. package/dist/src/bitgo/UtxoPsbt.d.ts.map +1 -1
  11. package/dist/src/bitgo/UtxoPsbt.js +112 -634
  12. package/dist/src/bitgo/bbc/DashPsbt.d.ts +12 -0
  13. package/dist/src/bitgo/bbc/DashPsbt.d.ts.map +1 -0
  14. package/dist/src/bitgo/bbc/DashPsbt.js +27 -0
  15. package/dist/src/bitgo/bbc/DashTransaction.d.ts +39 -0
  16. package/dist/src/bitgo/bbc/DashTransaction.d.ts.map +1 -0
  17. package/dist/src/bitgo/bbc/DashTransaction.js +109 -0
  18. package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts +14 -0
  19. package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts.map +1 -0
  20. package/dist/src/bitgo/bbc/DashTransactionBuilder.js +28 -0
  21. package/dist/src/bitgo/bbc/index.d.ts +4 -0
  22. package/dist/src/bitgo/bbc/index.d.ts.map +1 -0
  23. package/dist/src/bitgo/{litecoin → bbc}/index.js +4 -4
  24. package/dist/src/bitgo/bitcoincash/address.js +2 -2
  25. package/dist/src/bitgo/index.d.ts +0 -10
  26. package/dist/src/bitgo/index.d.ts.map +1 -1
  27. package/dist/src/bitgo/index.js +2 -5
  28. package/dist/src/bitgo/outputScripts.d.ts +1 -3
  29. package/dist/src/bitgo/outputScripts.d.ts.map +1 -1
  30. package/dist/src/bitgo/outputScripts.js +10 -18
  31. package/dist/src/bitgo/parseInput.d.ts +20 -49
  32. package/dist/src/bitgo/parseInput.d.ts.map +1 -1
  33. package/dist/src/bitgo/parseInput.js +24 -108
  34. package/dist/src/bitgo/psbt/fromHalfSigned.d.ts.map +1 -1
  35. package/dist/src/bitgo/psbt/fromHalfSigned.js +6 -9
  36. package/dist/src/bitgo/signature.d.ts +3 -3
  37. package/dist/src/bitgo/signature.d.ts.map +1 -1
  38. package/dist/src/bitgo/signature.js +16 -48
  39. package/dist/src/bitgo/transaction.d.ts +3 -18
  40. package/dist/src/bitgo/transaction.d.ts.map +1 -1
  41. package/dist/src/bitgo/transaction.js +15 -28
  42. package/dist/src/bitgo/types.d.ts +0 -2
  43. package/dist/src/bitgo/types.d.ts.map +1 -1
  44. package/dist/src/bitgo/types.js +1 -1
  45. package/dist/src/bitgo/wallet/Psbt.d.ts +12 -90
  46. package/dist/src/bitgo/wallet/Psbt.d.ts.map +1 -1
  47. package/dist/src/bitgo/wallet/Psbt.js +71 -221
  48. package/dist/src/bitgo/wallet/Unspent.d.ts +0 -28
  49. package/dist/src/bitgo/wallet/Unspent.d.ts.map +1 -1
  50. package/dist/src/bitgo/wallet/Unspent.js +68 -173
  51. package/dist/src/bitgo/wallet/chains.d.ts +2 -2
  52. package/dist/src/bitgo/wallet/chains.d.ts.map +1 -1
  53. package/dist/src/bitgo/wallet/chains.js +1 -1
  54. package/dist/src/bitgo/zcash/ZcashPsbt.d.ts.map +1 -1
  55. package/dist/src/bitgo/zcash/ZcashPsbt.js +3 -4
  56. package/dist/src/networks.d.ts +2 -1
  57. package/dist/src/networks.d.ts.map +1 -1
  58. package/dist/src/networks.js +29 -22
  59. package/dist/src/noble_ecc.d.ts.map +1 -1
  60. package/dist/src/noble_ecc.js +2 -6
  61. package/dist/src/payments/p2tr.d.ts.map +1 -1
  62. package/dist/src/payments/p2tr.js +9 -15
  63. package/dist/src/taproot.d.ts +0 -16
  64. package/dist/src/taproot.d.ts.map +1 -1
  65. package/dist/src/taproot.js +2 -44
  66. package/dist/src/testutil/index.d.ts +0 -2
  67. package/dist/src/testutil/index.d.ts.map +1 -1
  68. package/dist/src/testutil/index.js +1 -3
  69. package/dist/src/testutil/mock.d.ts +1 -1
  70. package/dist/src/testutil/mock.d.ts.map +1 -1
  71. package/dist/src/testutil/mock.js +4 -12
  72. package/package.json +4 -6
  73. package/dist/src/bitgo/PsbtUtil.d.ts +0 -54
  74. package/dist/src/bitgo/PsbtUtil.d.ts.map +0 -1
  75. package/dist/src/bitgo/PsbtUtil.js +0 -79
  76. package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts +0 -10
  77. package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts.map +0 -1
  78. package/dist/src/bitgo/litecoin/LitecoinPsbt.js +0 -17
  79. package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts +0 -16
  80. package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts.map +0 -1
  81. package/dist/src/bitgo/litecoin/LitecoinTransaction.js +0 -46
  82. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts +0 -10
  83. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts.map +0 -1
  84. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.js +0 -15
  85. package/dist/src/bitgo/litecoin/index.d.ts +0 -4
  86. package/dist/src/bitgo/litecoin/index.d.ts.map +0 -1
  87. package/dist/src/testutil/psbt.d.ts +0 -71
  88. package/dist/src/testutil/psbt.d.ts.map +0 -1
  89. package/dist/src/testutil/psbt.js +0 -147
  90. package/dist/src/testutil/transaction.d.ts +0 -61
  91. package/dist/src/testutil/transaction.d.ts.map +0 -1
  92. package/dist/src/testutil/transaction.js +0 -107
@@ -3,11 +3,10 @@
3
3
  // https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
4
4
  // https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getTaprootOutputKey = exports.createTaprootOutputScript = exports.getTweakedOutputKey = exports.getTaptreeRoot = exports.getTapleafHash = exports.parseControlBlock = exports.parseTaprootWitness = exports.getControlBlock = exports.getHuffmanTaptree = exports.getDepthFirstTaptree = exports.tapTweakPubkey = exports.tapTweakPrivkey = exports.calculateTapTweak = exports.hashTapBranch = exports.hashTapLeaf = exports.serializeScriptSize = exports.aggregateMuSigPubkeys = exports.INITIAL_TAPSCRIPT_VERSION = exports.EVEN_Y_COORD_PREFIX = void 0;
6
+ exports.getTweakedOutputKey = exports.getTaptreeRoot = exports.getTapleafHash = exports.parseControlBlock = exports.parseTaprootWitness = exports.getControlBlock = exports.getHuffmanTaptree = exports.getDepthFirstTaptree = exports.tapTweakPubkey = exports.tapTweakPrivkey = exports.hashTapBranch = exports.hashTapLeaf = exports.serializeScriptSize = exports.aggregateMuSigPubkeys = exports.INITIAL_TAPSCRIPT_VERSION = exports.EVEN_Y_COORD_PREFIX = void 0;
7
7
  const assert = require("assert");
8
8
  const FastPriorityQueue = require("fastpriorityqueue");
9
9
  const bitcoinjs_lib_1 = require("bitcoinjs-lib");
10
- const noble_ecc_1 = require("./noble_ecc");
11
10
  const varuint = require('varuint-bitcoin');
12
11
  /**
13
12
  * The 0x02 prefix indicating an even Y coordinate which is implicitly assumed
@@ -97,13 +96,7 @@ function hashTapBranch(child1, child2) {
97
96
  }
98
97
  exports.hashTapBranch = hashTapBranch;
99
98
  function calculateTapTweak(pubkey, taptreeRoot) {
100
- if (pubkey.length !== 32) {
101
- throw new Error(`Invalid pubkey size ${pubkey.length}.`);
102
- }
103
99
  if (taptreeRoot) {
104
- if (taptreeRoot.length !== 32) {
105
- throw new Error(`Invalid taptreeRoot size ${taptreeRoot.length}.`);
106
- }
107
100
  return bitcoinjs_lib_1.crypto.taggedHash('TapTweak', Buffer.concat([pubkey, taptreeRoot]));
108
101
  }
109
102
  // If the spending conditions do not require a script path, the output key should commit to an
@@ -111,7 +104,6 @@ function calculateTapTweak(pubkey, taptreeRoot) {
111
104
  // https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#cite_note-22
112
105
  return bitcoinjs_lib_1.crypto.taggedHash('TapTweak', Buffer.from(pubkey));
113
106
  }
114
- exports.calculateTapTweak = calculateTapTweak;
115
107
  /**
116
108
  * Tweaks a privkey, using the tagged hash of its pubkey, and (optionally) a taptree root
117
109
  * @param ecc Elliptic curve implementation
@@ -389,38 +381,4 @@ function getTweakedOutputKey(payment) {
389
381
  throw new Error(`invalid p2tr tweaked output key size ${payment.output.length}`);
390
382
  }
391
383
  exports.getTweakedOutputKey = getTweakedOutputKey;
392
- /**
393
- * @returns output script for either script path input controlBlock
394
- * & leafScript OR key path input internalPubKey & taptreeRoot
395
- */
396
- function createTaprootOutputScript(p2trArgs) {
397
- let internalPubKey;
398
- let taptreeRoot;
399
- if ('internalPubKey' in p2trArgs) {
400
- internalPubKey = p2trArgs.internalPubKey;
401
- taptreeRoot = p2trArgs.taptreeRoot;
402
- }
403
- else {
404
- internalPubKey = parseControlBlock(noble_ecc_1.ecc, p2trArgs.controlBlock).internalPubkey;
405
- taptreeRoot = getTaptreeRoot(noble_ecc_1.ecc, p2trArgs.controlBlock, p2trArgs.leafScript);
406
- }
407
- const outputKey = tapTweakPubkey(noble_ecc_1.ecc, internalPubKey, taptreeRoot).xOnlyPubkey;
408
- return bitcoinjs_lib_1.script.compile([bitcoinjs_lib_1.script.OPS.OP_1, Buffer.from(outputKey)]);
409
- }
410
- exports.createTaprootOutputScript = createTaprootOutputScript;
411
- /**
412
- * @returns x-only taproot output key (tapOutputKey)
413
- */
414
- function getTaprootOutputKey(outputScript) {
415
- const outputDecompiled = bitcoinjs_lib_1.script.decompile(outputScript);
416
- if ((outputDecompiled === null || outputDecompiled === void 0 ? void 0 : outputDecompiled.length) !== 2) {
417
- throw new Error('invalid taproot output script');
418
- }
419
- const [op1, outputKey] = outputDecompiled;
420
- if (op1 !== bitcoinjs_lib_1.script.OPS.OP_1 || !Buffer.isBuffer(outputKey) || outputKey.length !== 32) {
421
- throw new Error('invalid taproot output script');
422
- }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uZ3RofWApO1xufVxuIl19
@@ -1,5 +1,3 @@
1
1
  export * from './keys';
2
2
  export * from './mock';
3
- export * from './psbt';
4
- export * from './transaction';
5
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testutil/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testutil/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
@@ -12,6 +12,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./keys"), exports);
14
14
  __exportStar(require("./mock"), exports);
15
- __exportStar(require("./psbt"), exports);
16
- __exportStar(require("./transaction"), exports);
17
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGVzdHV0aWwvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQUEseUNBQXVCO0FBQ3ZCLHlDQUF1QjtBQUN2Qix5Q0FBdUI7QUFDdkIsZ0RBQThCIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9rZXlzJztcbmV4cG9ydCAqIGZyb20gJy4vbW9jayc7XG5leHBvcnQgKiBmcm9tICcuL3BzYnQnO1xuZXhwb3J0ICogZnJvbSAnLi90cmFuc2FjdGlvbic7XG4iXX0=
15
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGVzdHV0aWwvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQUEseUNBQXVCO0FBQ3ZCLHlDQUF1QiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4va2V5cyc7XG5leHBvcnQgKiBmcm9tICcuL21vY2snO1xuIl19
@@ -17,5 +17,5 @@ export declare function mockWalletUnspent<TNumber extends number | bigint>(netwo
17
17
  vout?: number;
18
18
  id?: string;
19
19
  }): WalletUnspent<TNumber> | NonWitnessWalletUnspent<TNumber>;
20
- export declare function mockUnspents<TNumber extends number | bigint>(rootWalletKeys: RootWalletKeys, inputScriptTypes: (InputType | outputScripts.ScriptTypeP2shP2pk)[], testOutputAmount: TNumber, network: Network): (Unspent<TNumber> | WalletUnspent<TNumber>)[];
20
+ export declare function mockUnspents<TNumber extends number | bigint>(rootWalletKeys: RootWalletKeys, inputScriptTypes: InputType[], testOutputAmount: TNumber, network: Network): WalletUnspent<TNumber>[];
21
21
  //# sourceMappingURL=mock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../../src/testutil/mock.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAc,OAAO,EAAY,MAAM,aAAa,CAAC;AAE5D,OAAO,EACL,SAAS,EAMT,uBAAuB,EACvB,aAAa,EACb,cAAc,EAEd,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,aAAa,EACd,MAAM,UAAU,CAAC;AAMlB,oBAAY,SAAS,GAAG,aAAa,CAAC,cAAc,CAAC;AAErD,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,GACf,eAAe,CAAC,MAAM,CAAC,CA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AAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/F,aAAa,CAAC,OAAO,CAAC,GAAG,uBAAuB,CAAC,OAAO,CAAC,CA0B3D;AAED,wBAAgB,YAAY,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM,EAC1D,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,SAAS,EAAE,EAC7B,gBAAgB,EAAE,OAAO,EACzB,OAAO,EAAE,OAAO,GACf,aAAa,CAAC,OAAO,CAAC,EAAE,CAW1B"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mockUnspents = exports.mockWalletUnspent = exports.mockReplayProtectionUnspent = exports.isReplayProtectionUnspent = exports.replayProtectionKeyPair = exports.mockPrevTx = void 0;
4
- const assert = require("assert");
5
4
  const noble = require("@noble/secp256k1");
6
5
  const utxolib = require("..");
7
6
  const networks_1 = require("../networks");
@@ -11,9 +10,8 @@ const outputScripts_1 = require("../bitgo/outputScripts");
11
10
  const keys_1 = require("./keys");
12
11
  function mockPrevTx(vout, outputScript, value, network) {
13
12
  const psbtFromNetwork = bitgo_1.createPsbtForNetwork({ network });
14
- const keypair = keys_1.getKey('mock-prev-tx');
15
- const pubkey = keypair.publicKey;
16
- assert(keypair.privateKey);
13
+ const privKey = noble.utils.randomPrivateKey();
14
+ const pubkey = Buffer.from(noble.getPublicKey(privKey, true));
17
15
  const payment = utxolib.payments.p2wpkh({ pubkey });
18
16
  const destOutput = payment.output;
19
17
  if (!destOutput)
@@ -33,7 +31,7 @@ function mockPrevTx(vout, outputScript, value, network) {
33
31
  });
34
32
  psbtFromNetwork.signInput(0, {
35
33
  publicKey: pubkey,
36
- sign: (hash, lowR) => Buffer.from(noble.signSync(hash, keypair.privateKey, { canonical: !lowR, der: false })),
34
+ sign: (hash, lowR) => Buffer.from(noble.signSync(hash, privKey, { canonical: !lowR, der: false })),
37
35
  });
38
36
  psbtFromNetwork.validateSignaturesOfAllInputs();
39
37
  psbtFromNetwork.finalizeAllInputs();
@@ -81,14 +79,8 @@ function mockUnspents(rootWalletKeys, inputScriptTypes, testOutputAmount, networ
81
79
  vout: i,
82
80
  });
83
81
  }
84
- else if (t === bitgo_1.outputScripts.scriptTypeP2shP2pk) {
85
- return mockReplayProtectionUnspent(network, testOutputAmount, {
86
- key: exports.replayProtectionKeyPair,
87
- vout: i,
88
- });
89
- }
90
82
  throw new Error(`invalid input type ${t}`);
91
83
  });
92
84
  }
93
85
  exports.mockUnspents = mockUnspents;
94
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9jay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90ZXN0dXRpbC9tb2NrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGlDQUFpQztBQUVqQywwQ0FBMEM7QUFDMUMsOEJBQThCO0FBQzlCLDBDQUE0RDtBQUU1RCxvQ0Fla0I7QUFDbEIsd0NBQThDO0FBQzlDLDBEQUE0RjtBQUU1RixpQ0FBc0Q7QUFJdEQsU0FBZ0IsVUFBVSxDQUN4QixJQUFZLEVBQ1osWUFBb0IsRUFDcEIsS0FBYSxFQUNiLE9BQWdCO0lBRWhCLE1BQU0sZUFBZSxHQUFHLDRCQUFvQixDQUFDLEVBQUUsT0FBTyxFQUFFLENBQUMsQ0FBQztJQUUxRCxNQUFNLE9BQU8sR0FBRyxhQUFNLENBQUMsY0FBYyxDQUFDLENBQUM7SUFDdkMsTUFBTSxNQUFNLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQztJQUNqQyxNQUFNLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFDO0lBQzNCLE1BQU0sT0FBTyxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLEVBQUUsTUFBTSxFQUFFLENBQUMsQ0FBQztJQUNwR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lcj4gPT4ge1xuICAgIGlmIChvdXRwdXRTY3JpcHRzLmlzU2NyaXB0VHlwZTJPZjModCkpIHtcbiAgICAgIHJldHVybiBtb2NrV2FsbGV0VW5zcGVudChuZXR3b3JrLCB0ZXN0T3V0cHV0QW1vdW50LCB7XG4gICAgICAgIGtleXM6IHJvb3RXYWxsZXRLZXlzLFxuICAgICAgICBjaGFpbjogZ2V0RXh0ZXJuYWxDaGFpbkNvZGUodCksXG4gICAgICAgIHZvdXQ6IGksXG4gICAgICB9KTtcbiAgICB9XG4gICAgdGhyb3cgbmV3IEVycm9yKGBpbnZhbGlkIGlucHV0IHR5cGUgJHt0fWApO1xuICB9KTtcbn1cbiJdfQ==
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utxo-lib",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Client-side Bitcoin JavaScript library",
5
5
  "main": "./dist/src/index.js",
6
6
  "engines": {
@@ -18,8 +18,6 @@
18
18
  "javascript"
19
19
  ],
20
20
  "scripts": {
21
- "prepare": "npm run build",
22
- "build": "yarn tsc --build --incremental --verbose .",
23
21
  "coverage-report": "nyc report --reporter=lcov",
24
22
  "coverage-html": "nyc report --reporter=html",
25
23
  "coverage": "npm run build && nyc --check-coverage mocha",
@@ -47,13 +45,13 @@
47
45
  ],
48
46
  "dependencies": {
49
47
  "@bitgo/blake2b": "^3.2.1",
50
- "@brandonblack/musig": "^0.0.1-alpha.0",
48
+ "@brandonblack/musig": "https://github.com/Mustafa-Agha/musig-js.git",
51
49
  "@noble/secp256k1": "1.6.3",
52
50
  "bech32": "^2.0.0",
53
- "bip174": "npm:@bitgo-forks/bip174@3.1.0-master.4",
51
+ "bip174": "npm:@bitgo-forks/bip174@3.1.0-master.3",
54
52
  "bip32": "^3.0.1",
55
53
  "bitcoin-ops": "^1.3.0",
56
- "bitcoinjs-lib": "npm:@bitgo-forks/bitcoinjs-lib@7.1.0-master.6",
54
+ "bitcoinjs-lib": "npm:@bitgo-forks/bitcoinjs-lib@7.1.0-master.4",
57
55
  "bn.js": "^5.2.1",
58
56
  "bs58check": "^2.1.2",
59
57
  "cashaddress": "^1.1.0",
@@ -1,54 +0,0 @@
1
- /// <reference types="node" />
2
- import { ProprietaryKey } from 'bip174/src/lib/proprietaryKeyVal';
3
- import { PsbtInput } from 'bip174/src/lib/interfaces';
4
- /**
5
- * bitgo proprietary key identifier
6
- */
7
- export declare const PSBT_PROPRIETARY_IDENTIFIER = "BITGO";
8
- /**
9
- * subtype for proprietary keys that bitgo uses
10
- */
11
- export declare enum ProprietaryKeySubtype {
12
- ZEC_CONSENSUS_BRANCH_ID = 0,
13
- MUSIG2_PARTICIPANT_PUB_KEYS = 1,
14
- MUSIG2_PUB_NONCE = 2,
15
- MUSIG2_PARTIAL_SIG = 3
16
- }
17
- /**
18
- * Psbt proprietary keydata object.
19
- * <compact size uint identifier length> <bytes identifier> <compact size uint subtype> <bytes subkeydata>
20
- * => <bytes valuedata>
21
- */
22
- export interface ProprietaryKeyValue {
23
- key: ProprietaryKey;
24
- value: Buffer;
25
- }
26
- /**
27
- * Psbt proprietary keydata object search fields.
28
- * <compact size uint identifier length> <bytes identifier> <compact size uint subtype> <bytes subkeydata>
29
- */
30
- export interface ProprietaryKeySearch {
31
- identifier: string;
32
- subtype?: number;
33
- keydata?: Buffer;
34
- identifierEncoding?: BufferEncoding;
35
- }
36
- /**
37
- * Search any data from psbt proprietary key value against keydata.
38
- * Default identifierEncoding is utf-8 for identifier.
39
- */
40
- export declare function getPsbtInputProprietaryKeyVals(input: PsbtInput, keySearch?: ProprietaryKeySearch): ProprietaryKeyValue[];
41
- /**
42
- * @return partialSig/tapScriptSig/MUSIG2_PARTIAL_SIG count iff input is not finalized
43
- */
44
- export declare function getPsbtInputSignatureCount(input: PsbtInput): number;
45
- /**
46
- * @return true iff PSBT input is finalized
47
- */
48
- export declare function isPsbtInputFinalized(input: PsbtInput): boolean;
49
- /**
50
- * @return true iff data starts with magic PSBT byte sequence
51
- * @param data byte array or hex string
52
- * */
53
- export declare function isPsbt(data: Buffer | string): boolean;
54
- //# sourceMappingURL=PsbtUtil.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PsbtUtil.d.ts","sourceRoot":"","sources":["../../../src/bitgo/PsbtUtil.ts"],"names":[],"mappings":";AAAA,OAAO,EAAwB,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,2BAA2B,UAAU,CAAC;AAEnD;;GAEG;AACH,oBAAY,qBAAqB;IAC/B,uBAAuB,IAAO;IAC9B,2BAA2B,IAAO;IAClC,gBAAgB,IAAO;IACvB,kBAAkB,IAAO;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,cAAc,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,cAAc,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,SAAS,EAChB,SAAS,CAAC,EAAE,oBAAoB,GAC/B,mBAAmB,EAAE,CAmBvB;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAYnE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAE9D;AAED;;;KAGK;AACL,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAUrD"}
@@ -1,79 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isPsbt = exports.isPsbtInputFinalized = exports.getPsbtInputSignatureCount = exports.getPsbtInputProprietaryKeyVals = exports.ProprietaryKeySubtype = exports.PSBT_PROPRIETARY_IDENTIFIER = void 0;
4
- const proprietaryKeyVal_1 = require("bip174/src/lib/proprietaryKeyVal");
5
- /**
6
- * bitgo proprietary key identifier
7
- */
8
- exports.PSBT_PROPRIETARY_IDENTIFIER = 'BITGO';
9
- /**
10
- * subtype for proprietary keys that bitgo uses
11
- */
12
- var ProprietaryKeySubtype;
13
- (function (ProprietaryKeySubtype) {
14
- ProprietaryKeySubtype[ProprietaryKeySubtype["ZEC_CONSENSUS_BRANCH_ID"] = 0] = "ZEC_CONSENSUS_BRANCH_ID";
15
- ProprietaryKeySubtype[ProprietaryKeySubtype["MUSIG2_PARTICIPANT_PUB_KEYS"] = 1] = "MUSIG2_PARTICIPANT_PUB_KEYS";
16
- ProprietaryKeySubtype[ProprietaryKeySubtype["MUSIG2_PUB_NONCE"] = 2] = "MUSIG2_PUB_NONCE";
17
- ProprietaryKeySubtype[ProprietaryKeySubtype["MUSIG2_PARTIAL_SIG"] = 3] = "MUSIG2_PARTIAL_SIG";
18
- })(ProprietaryKeySubtype = exports.ProprietaryKeySubtype || (exports.ProprietaryKeySubtype = {}));
19
- /**
20
- * Search any data from psbt proprietary key value against keydata.
21
- * Default identifierEncoding is utf-8 for identifier.
22
- */
23
- function getPsbtInputProprietaryKeyVals(input, keySearch) {
24
- var _a;
25
- if (!((_a = input.unknownKeyVals) === null || _a === void 0 ? void 0 : _a.length)) {
26
- return [];
27
- }
28
- if (keySearch && keySearch.subtype === undefined && Buffer.isBuffer(keySearch.keydata)) {
29
- throw new Error('invalid proprietary key search filter combination. subtype is required');
30
- }
31
- const keyVals = input.unknownKeyVals.map(({ key, value }, i) => {
32
- return { key: proprietaryKeyVal_1.decodeProprietaryKey(key), value };
33
- });
34
- return keyVals.filter((keyVal) => {
35
- return (keySearch === undefined ||
36
- (keySearch.identifier === keyVal.key.identifier &&
37
- (keySearch.subtype === undefined ||
38
- (keySearch.subtype === keyVal.key.subtype &&
39
- (!Buffer.isBuffer(keySearch.keydata) || keySearch.keydata.equals(keyVal.key.keydata))))));
40
- });
41
- }
42
- exports.getPsbtInputProprietaryKeyVals = getPsbtInputProprietaryKeyVals;
43
- /**
44
- * @return partialSig/tapScriptSig/MUSIG2_PARTIAL_SIG count iff input is not finalized
45
- */
46
- function getPsbtInputSignatureCount(input) {
47
- if (isPsbtInputFinalized(input)) {
48
- throw new Error('Input is already finalized');
49
- }
50
- return Math.max(Array.isArray(input.partialSig) ? input.partialSig.length : 0, Array.isArray(input.tapScriptSig) ? input.tapScriptSig.length : 0, getPsbtInputProprietaryKeyVals(input, {
51
- identifier: exports.PSBT_PROPRIETARY_IDENTIFIER,
52
- subtype: ProprietaryKeySubtype.MUSIG2_PARTIAL_SIG,
53
- }).length);
54
- }
55
- exports.getPsbtInputSignatureCount = getPsbtInputSignatureCount;
56
- /**
57
- * @return true iff PSBT input is finalized
58
- */
59
- function isPsbtInputFinalized(input) {
60
- return Buffer.isBuffer(input.finalScriptSig) || Buffer.isBuffer(input.finalScriptWitness);
61
- }
62
- exports.isPsbtInputFinalized = isPsbtInputFinalized;
63
- /**
64
- * @return true iff data starts with magic PSBT byte sequence
65
- * @param data byte array or hex string
66
- * */
67
- function isPsbt(data) {
68
- // https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#specification
69
- // 0x70736274 - ASCII for 'psbt'. 0xff - separator
70
- if (typeof data === 'string') {
71
- if (data.length < 10) {
72
- return false;
73
- }
74
- data = Buffer.from(data.slice(0, 10), 'hex');
75
- }
76
- return 5 <= data.length && data.readUInt32BE(0) === 0x70736274 && data.readUInt8(4) === 0xff;
77
- }
78
- exports.isPsbt = isPsbt;
79
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUHNidFV0aWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYml0Z28vUHNidFV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ICAgIGRhdGEgPSBCdWZmZXIuZnJvbShkYXRhLnNsaWNlKDAsIDEwKSwgJ2hleCcpO1xuICB9XG4gIHJldHVybiA1IDw9IGRhdGEubGVuZ3RoICYmIGRhdGEucmVhZFVJbnQzMkJFKDApID09PSAweDcwNzM2Mjc0ICYmIGRhdGEucmVhZFVJbnQ4KDQpID09PSAweGZmO1xufVxuIl19
@@ -1,10 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,17 +0,0 @@
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
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTGl0ZWNvaW5Qc2J0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2JpdGdvL2xpdGVjb2luL0xpdGVjb2luUHNidC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwwQ0FBaUQ7QUFFakQsbUNBQTBDO0FBQzFDLGlEQUFnRDtBQUNoRCwrREFBNEQ7QUFFNUQsTUFBYSxZQUFhLFNBQVEsbUJBQXFDO0lBQzNELE1BQU0sQ0FBQyxxQkFBcUIsQ0FBQyxNQUFjLEVBQUUsT0FBZ0I7UUFDckUsT0FBTyx5Q0FBbUIsQ0FBQyxVQUFVLENBQVMsTUFBTSxFQUFFLEtBQUssRUFBRSxRQUFRLEVBQUUsT0FBTyxDQUFDLENBQUM7SUFDbEYsQ0FBQztJQUVELE1BQU0sQ0FBQyxVQUFVLENBQUMsSUFBYyxFQUFFLElBQWU7UUFDL0MsT0FBTyxJQUFJLFlBQVksQ0FDckIsSU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