utxo-lib 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -62,9 +62,10 @@ function p2tr_ns(a, opts) {
62
62
  return chunks.filter((_, index) => index % 2 === 0);
63
63
  });
64
64
  bitcoinjs_lib_1.lazy.prop(o, 'signatures', () => {
65
+ var _a;
65
66
  if (!a.input)
66
67
  return;
67
- return bitcoinjs_lib_1.script.decompile(a.input)?.reverse();
68
+ return (_a = bitcoinjs_lib_1.script.decompile(a.input)) === null || _a === void 0 ? void 0 : _a.reverse();
68
69
  });
69
70
  bitcoinjs_lib_1.lazy.prop(o, 'input', () => {
70
71
  if (!a.signatures)
@@ -130,4 +131,4 @@ function p2tr_ns(a, opts) {
130
131
  return Object.assign(o, a);
131
132
  }
132
133
  exports.p2tr_ns = p2tr_ns;
133
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicDJ0cl9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wYXltZW50cy9wMnRyX25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDBDQUF1QztBQUN2QyxpREFBcUY7QUFFckYsTUFBTSxHQUFHLEdBQUcsc0JBQU8sQ0FBQyxHQUFHLENBQUM7QUFDeEIsTUFBTSxLQUFLLEdBQUcsT0FBTyxDQUFDLFdBQVcsQ0FBQyxDQUFDO0FBRW5DLE1BQU0sZUFBZSxHQUFHLG1CQUFRLENBQUMsT0FBTyxDQUFDO0FBRXpDLFNBQVMsV0FBVyxDQUFDLENBQVcsRUFBRSxDQUFXO0lBQzNDLElBQUksQ0FBQyxDQUFDLE1BQU0sS0FBSyxDQUFDLENBQUMsTUFBTTtRQUFFLE9BQU8sS0FBSyxDQUFDO0lBRXhDLE9BQU8sQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtRQUN0QixPQUFPLENBQU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mF0dXJlcy5sZW5ndGggPCBvLm4pIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignTm90IGVub3VnaCBzaWduYXR1cmVzIHByb3ZpZGVkJyk7XG4gICAgICB9XG4gICAgICBpZiAoYS5zaWduYXR1cmVzLmxlbmd0aCA+IG8ubikge1xuICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdUb28gbWFueSBzaWduYXR1cmVzIHByb3ZpZGVkJyk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKGEuaW5wdXQpIHtcbiAgICAgIGlmICghby5zaWduYXR1cmVzIS5ldmVyeShpc0FjY2VwdGFibGVTaWduYXR1cmUpKSB7XG4gICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ0lucHV0IGhhcyBpbnZhbGlkIHNpZ25hdHVyZShzKScpO1xuICAgICAgfVxuXG4gICAgICBpZiAoYS5zaWduYXR1cmVzICYmICFzdGFja3NFcXVhbChhLnNpZ25hdHVyZXMsIG8uc2lnbmF0dXJlcyEpKSB7XG4gICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoJ1NpZ25hdHVyZSBtaXNtYXRjaCcpO1xuICAgICAgfVxuICAgICAgaWYgKG8ubiAhPT0gby5zaWduYXR1cmVzIS5sZW5ndGgpIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcihgU2lnbmF0dXJlIGNvdW50IG1pc21hdGNoIChuOiAke28ubn0sIHNpZ25hdHVyZXMubGVuZ3RoOiAke28uc2lnbmF0dXJlcyEubGVuZ3RofWApO1xuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIHJldHVybiBPYmplY3QuYXNzaWduKG8sIGEpO1xufVxuIl19
@@ -381,9 +381,10 @@ function getTaptreeRoot(ecc, controlBlock, tapscript, tapleafHash) {
381
381
  }
382
382
  exports.getTaptreeRoot = getTaptreeRoot;
383
383
  function getTweakedOutputKey(payment) {
384
+ var _a;
384
385
  assert(payment.output);
385
386
  if (payment.output.length === 34) {
386
- return payment.output?.subarray(2);
387
+ return (_a = payment.output) === null || _a === void 0 ? void 0 : _a.subarray(2);
387
388
  }
388
389
  throw new Error(`invalid p2tr tweaked output key size ${payment.output.length}`);
389
390
  }
@@ -412,7 +413,7 @@ exports.createTaprootOutputScript = createTaprootOutputScript;
412
413
  */
413
414
  function getTaprootOutputKey(outputScript) {
414
415
  const outputDecompiled = bitcoinjs_lib_1.script.decompile(outputScript);
415
- if (outputDecompiled?.length !== 2) {
416
+ if ((outputDecompiled === null || outputDecompiled === void 0 ? void 0 : outputDecompiled.length) !== 2) {
416
417
  throw new Error('invalid taproot output script');
417
418
  }
418
419
  const [op1, outputKey] = outputDecompiled;
@@ -422,4 +423,4 @@ function getTaprootOutputKey(outputScript) {
422
423
  return outputKey;
423
424
  }
424
425
  exports.getTaprootOutputKey = getTaprootOutputKey;
425
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwcm9vdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90YXByb290LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxvRUFBb0U7QUFDcEUsaUVBQWlFO0FBQ2pFLGlFQUFpRTs7O0FBR2pFLGlDQUFrQztBQUNsQyx1REFBd0Q7QUFDeEQsaURBQTRGO0FBQzVGLDJDQUE0QztBQUM1QyxNQUFNLE9BQU8sR0FBRyxPQUFPLENBQUMsaUJBQWlCLENBQUMsQ0FBQztBQUUzQzs7O0dBR0c7QUFDVSxRQUFBLG1CQUFtQixHQUFHLE1BQU0sQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDdEMsUUFBQSx5QkFBeUIsR0FBRyxJQUFJLENBQUM7QUFZOUM7Ozs7OztHQU1HO0FBQ0gsU0FBZ0IscUJBQXFCLENBQUMsR0FBMkIsRUFBRSxPQUFpQjtJQUNsRiwyQ0FBMkM7SUFDM0MsTU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Ghyb3cgbmV3IEVycm9yKCdpbnZhbGlkIHRhcHJvb3Qgb3V0cHV0IHNjcmlwdCcpO1xuICB9XG4gIHJldHVybiBvdXRwdXRLZXk7XG59XG4iXX0=
@@ -52,7 +52,7 @@ exports.getSigners = getSigners;
52
52
  * p2shP2pk is signed only with first sign.
53
53
  */
54
54
  function signPsbtInput(psbt, input, inputIndex, rootWalletKeys, sign, params) {
55
- const { signers, deterministic } = params ?? {};
55
+ const { signers, deterministic } = params !== null && params !== void 0 ? params : {};
56
56
  const { signerName, cosignerName } = signers ? signers : getSigners(input.scriptType);
57
57
  if (sign === 'halfsigned') {
58
58
  if (input.scriptType === 'p2shP2pk') {
@@ -72,7 +72,7 @@ exports.signPsbtInput = signPsbtInput;
72
72
  * p2shP2pk is signed only with first sign.
73
73
  */
74
74
  function signAllPsbtInputs(psbt, inputs, rootWalletKeys, sign, params) {
75
- const { signers, deterministic } = params ?? {};
75
+ const { signers, deterministic } = params !== null && params !== void 0 ? params : {};
76
76
  inputs.forEach((input, inputIndex) => {
77
77
  signPsbtInput(psbt, input, inputIndex, rootWalletKeys, sign, { signers, deterministic });
78
78
  });
@@ -82,7 +82,7 @@ exports.signAllPsbtInputs = signAllPsbtInputs;
82
82
  * construct psbt for given inputs, outputs, network and root wallet keys.
83
83
  */
84
84
  function constructPsbt(inputs, outputs, network, rootWalletKeys, sign, params) {
85
- const { signers, deterministic } = params ?? {};
85
+ const { signers, deterministic } = params !== null && params !== void 0 ? params : {};
86
86
  const totalInputAmount = inputs.reduce((sum, input) => sum + input.value, BigInt(0));
87
87
  const outputInputAmount = outputs.reduce((sum, output) => sum + output.value, BigInt(0));
88
88
  assert(totalInputAmount >= outputInputAmount, 'total output can not exceed total input');
@@ -147,4 +147,4 @@ function verifyFullySignedSignatures(tx, unspents, walletKeys, signer, cosigner)
147
147
  });
148
148
  }
149
149
  exports.verifyFullySignedSignatures = verifyFullySignedSignatures;
150
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9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