utxo-lib 1.1.0 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 ?? this.ins[inIndex].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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVXR4b1RyYW5zYWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2JpdGdvL1V0eG9UcmFuc2FjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxpQ0FBaUM7QUFDakMsMkNBQTJDO0FBQzNDLDJDQUEyQztBQUMzQyx1Q0FBc0M7QUFFdEMsMENBQTJFO0FBRTNFLFNBQWdCLFlBQVksQ0FBQyxLQUFhO0lBQ3hDLE1BQU0sTUFBTSxHQUFHLEtBQUssQ0FBQyxNQUFNLENBQUM7SUFDNUIsT0FBTyxPQUFPLENBQUMsY0FBYyxDQUFDLE1BQU0sQ0FBQyxHQUFHLE1BQU0sQ0FBQztBQUNqRCxDQUFDO0FBSEQsb0NBR0M7QUFFRCxNQUFhLGVBQTBELFNBQVEsU0FBUyxDQUFDLFdBQW9CO0lBSzNHLFlBQ1MsT0FBZ0IsRUFDdkIsV0FBb0QsRUFDcEQsVUFBZ0M7UUFFaEMsS0FBSy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leCwgcHJldk91dFNjcmlwdCwgdmFsdWUsIGhhc2hUeXBlKTtcbiAgfVxuXG4gIGNsb25lPFROMiBleHRlbmRzIGJpZ2ludCB8IG51bWJlciA9IFROdW1iZXI+KGFtb3VudFR5cGU/OiAnbnVtYmVyJyB8ICdiaWdpbnQnKTogVXR4b1RyYW5zYWN0aW9uPFROMj4ge1xuICAgIC8vIE5vIG5lZWQgdG8gY2xvbmUuIEV2ZXJ5dGhpbmcgaXMgY29waWVkIGluIHRoZSBjb25zdHJ1Y3Rvci5cbiAgICByZXR1cm4gbmV3IFV0eG9UcmFuc2FjdGlvbjxUTjI+KHRoaXMubmV0d29yaywgdGhpcywgYW1vdW50VHlwZSk7XG4gIH1cbn1cbiJdfQ==
@@ -132,8 +132,8 @@ function createOutputScript2of3(pubkeys, scriptType, network) {
132
132
  assert(scriptPubKey.output);
133
133
  return {
134
134
  scriptPubKey: scriptPubKey.output,
135
- redeemScript: redeemScript?.output,
136
- witnessScript: witnessScript?.output,
135
+ redeemScript: redeemScript === null || redeemScript === void 0 ? void 0 : redeemScript.output,
136
+ witnessScript: witnessScript === null || witnessScript === void 0 ? void 0 : witnessScript.output,
137
137
  };
138
138
  }
139
139
  exports.createOutputScript2of3 = createOutputScript2of3;
@@ -302,4 +302,4 @@ function createTaprootScript2of3(scriptType, pubkeys) {
302
302
  scriptPubKey: output,
303
303
  };
304
304
  }
305
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0cHV0U2NyaXB0cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9iaXRnby9vdXRwdXRTY3JpcHRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGlDQUFpQztBQUNqQywyQ0FBMkM7QUFFM0MsMEJBQXFGO0FBRXJGLG1DQUFrRDtBQUVsRCw0Q0FBNkM7QUFDN0Msd0NBQXVFO0FBRXZFLDBDQ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n1cbiJdfQ==
@@ -293,7 +293,7 @@ function parseSignatureScript(input) {
293
293
  ];
294
294
  for (const f of parsers) {
295
295
  const parsed = f({
296
- script: decScript?.length === 0 ? null : decScript,
296
+ script: (decScript === null || decScript === void 0 ? void 0 : decScript.length) === 0 ? null : decScript,
297
297
  witness: input.witness.length === 0 ? null : input.witness,
298
298
  });
299
299
  if (parsed instanceof MatchError) {
@@ -425,4 +425,4 @@ function parsePubScript(inputPubScript, scriptType) {
425
425
  return result;
426
426
  }
427
427
  exports.parsePubScript = parsePubScript;
428
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyc2VJbnB1dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9iaXRnby9wYXJzZUlucHV0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDRCQUE0QjtBQUM1Qix1Q0FBdUM7QUFDdkMsaURBQTJEO0FBRTNELG1DQUFtQztBQUNuQyxtREFBbUQ7QUFFbkQsU0FBZ0Isc0JBQXNCLENBQUMsQ0FBa0I7SUFDdkQsSUFBSSxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxFQUFFO1FBQ3RCLE9BQU8sQ0FBQyxDQUFDLE1BQU0sS0FBSyxDQUFDLENBQUM7S0FDdkI7SUFDRCxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUM7QUFDakIsQ0FBQztBQUxELHdEQUtDO0FBRUQ7O0dBRUc7QUFDSCxTQUFnQixrQkFBa0IsQ0FBQyxZQUFvQjtJQUNyRCxzRkFBc0Y7SUFDdEYsT0FBTyxNQUFNLENBQUMsUUFBUSxDQUFDLFlBQVksQ0FBQyxJQUFJLEVBQUUsSUFBSSxZQUFZLENBQUMsTUFBTSxJQUFJLFlBQVksQ0FBQyxNQUFNLEdBQUcsRUFBRSxLQUFLLENBQUMsQ0FBQztBQUN0RyxDQUFDO0FBS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JTY3JpcHQsIHNjcmlwdFR5cGUpXG4gICAgICA6IHBhcnNlUHViU2NyaXB0Mk9mMyhpbnB1dFB1YlNjcmlwdCwgc2NyaXB0VHlwZSk7XG5cbiAgaWYgKHJlc3VsdCBpbnN0YW5jZW9mIE1hdGNoRXJyb3IpIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IocmVzdWx0Lm1lc3NhZ2UpO1xuICB9XG5cbiAgaWYgKHJlc3VsdC5zY3JpcHRUeXBlID09PSAncDJzaFAycGsnICYmIHJlc3VsdC5wdWJsaWNLZXlzLmxlbmd0aCAhPT0gMSkge1xuICAgIHRocm93IG5ldyBFcnJvcigndW5leHBlY3RlZCBwdWJrZXkgY291bnQnKTtcbiAgfVxuXG4gIHJldHVybiByZXN1bHQ7XG59XG4iXX0=
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isSegwit = exports.isTaproot = exports.isP2wpkh = exports.isP2wsh = void 0;
4
4
  const opcodes = require("bitcoin-ops");
5
5
  function isP2wsh(scriptPubkey, redeemScript) {
6
- const witnessProgramCandidate = redeemScript ?? scriptPubkey;
6
+ const witnessProgramCandidate = redeemScript !== null && redeemScript !== void 0 ? redeemScript : scriptPubkey;
7
7
  return witnessProgramCandidate[0] === opcodes.OP_0 && witnessProgramCandidate.length === 34;
8
8
  }
9
9
  exports.isP2wsh = isP2wsh;
10
10
  function isP2wpkh(scriptPubkey, redeemScript) {
11
- const witnessProgramCandidate = redeemScript ?? scriptPubkey;
11
+ const witnessProgramCandidate = redeemScript !== null && redeemScript !== void 0 ? redeemScript : scriptPubkey;
12
12
  return witnessProgramCandidate[0] === opcodes.OP_0 && witnessProgramCandidate.length === 22;
13
13
  }
14
14
  exports.isP2wpkh = isP2wpkh;
@@ -20,4 +20,4 @@ function isSegwit(scriptPubkey, redeemScript) {
20
20
  return isTaproot(scriptPubkey) || isP2wsh(scriptPubkey, redeemScript) || isP2wpkh(scriptPubkey, redeemScript);
21
21
  }
22
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