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.
@@ -101,11 +101,12 @@ class UtxoPsbt extends __1.Psbt {
101
101
  return node;
102
102
  }
103
103
  static deriveKeyPairForInput(bip32, input) {
104
- return input.tapBip32Derivation?.length
105
- ? UtxoPsbt.deriveKeyPair(bip32, input.tapBip32Derivation, { ignoreY: true })?.publicKey
106
- : input.bip32Derivation?.length
107
- ? UtxoPsbt.deriveKeyPair(bip32, input.bip32Derivation, { ignoreY: false })?.publicKey
108
- : bip32?.publicKey;
104
+ var _a, _b, _c, _d;
105
+ return ((_a = input.tapBip32Derivation) === null || _a === void 0 ? void 0 : _a.length)
106
+ ? (_b = UtxoPsbt.deriveKeyPair(bip32, input.tapBip32Derivation, { ignoreY: true })) === null || _b === void 0 ? void 0 : _b.publicKey
107
+ : ((_c = input.bip32Derivation) === null || _c === void 0 ? void 0 : _c.length)
108
+ ? (_d = UtxoPsbt.deriveKeyPair(bip32, input.bip32Derivation, { ignoreY: false })) === null || _d === void 0 ? void 0 : _d.publicKey
109
+ : bip32 === null || bip32 === void 0 ? void 0 : bip32.publicKey;
109
110
  }
110
111
  get network() {
111
112
  return this.tx.network;
@@ -179,8 +180,9 @@ class UtxoPsbt extends __1.Psbt {
179
180
  }
180
181
  checkForSignatures(propName) {
181
182
  this.data.inputs.forEach((input) => {
182
- if (input.tapScriptSig?.length || input.tapKeySig || input.partialSig?.length) {
183
- throw new Error(`Cannot modify ${propName ?? 'transaction'} - signatures exist.`);
183
+ var _a, _b;
184
+ if (((_a = input.tapScriptSig) === null || _a === void 0 ? void 0 : _a.length) || input.tapKeySig || ((_b = input.partialSig) === null || _b === void 0 ? void 0 : _b.length)) {
185
+ throw new Error(`Cannot modify ${propName !== null && propName !== void 0 ? propName : 'transaction'} - signatures exist.`);
184
186
  }
185
187
  });
186
188
  }
@@ -189,20 +191,22 @@ class UtxoPsbt extends __1.Psbt {
189
191
  * Checks for presence of minimum required key path input fields and absence of any script path only input fields.
190
192
  */
191
193
  isTaprootKeyPathInput(inputIndex) {
194
+ var _a, _b, _c;
192
195
  const input = utils_1.checkForInput(this.data.inputs, inputIndex);
193
196
  return (!!input.tapInternalKey &&
194
197
  !!input.tapMerkleRoot &&
195
- !(input.tapLeafScript?.length ||
196
- input.tapScriptSig?.length ||
197
- input.tapBip32Derivation?.some((v) => v.leafHashes.length)));
198
+ !(((_a = input.tapLeafScript) === null || _a === void 0 ? void 0 : _a.length) ||
199
+ ((_b = input.tapScriptSig) === null || _b === void 0 ? void 0 : _b.length) ||
200
+ ((_c = input.tapBip32Derivation) === null || _c === void 0 ? void 0 : _c.some((v) => v.leafHashes.length))));
198
201
  }
199
202
  /**
200
203
  * @returns true if the input at inputIndex is a taproot script path.
201
204
  * Checks for presence of minimum required script path input fields and absence of any key path only input fields.
202
205
  */
203
206
  isTaprootScriptPathInput(inputIndex) {
207
+ var _a;
204
208
  const input = utils_1.checkForInput(this.data.inputs, inputIndex);
205
- return (!!input.tapLeafScript?.length &&
209
+ return (!!((_a = input.tapLeafScript) === null || _a === void 0 ? void 0 : _a.length) &&
206
210
  !(this.getProprietaryKeyVals(inputIndex, {
207
211
  identifier: PsbtUtil_1.PSBT_PROPRIETARY_IDENTIFIER,
208
212
  subtype: PsbtUtil_1.ProprietaryKeySubtype.MUSIG2_PARTICIPANT_PUB_KEYS,
@@ -220,6 +224,7 @@ class UtxoPsbt extends __1.Psbt {
220
224
  * @returns true if the input at inputIndex is a taproot
221
225
  */
222
226
  isTaprootInput(inputIndex) {
227
+ var _a, _b, _c;
223
228
  const input = utils_1.checkForInput(this.data.inputs, inputIndex);
224
229
  const isP2TR = (script) => {
225
230
  try {
@@ -232,9 +237,9 @@ class UtxoPsbt extends __1.Psbt {
232
237
  };
233
238
  return !!(input.tapInternalKey ||
234
239
  input.tapMerkleRoot ||
235
- input.tapLeafScript?.length ||
236
- input.tapBip32Derivation?.length ||
237
- input.tapScriptSig?.length ||
240
+ ((_a = input.tapLeafScript) === null || _a === void 0 ? void 0 : _a.length) ||
241
+ ((_b = input.tapBip32Derivation) === null || _b === void 0 ? void 0 : _b.length) ||
242
+ ((_c = input.tapScriptSig) === null || _c === void 0 ? void 0 : _c.length) ||
238
243
  this.getProprietaryKeyVals(inputIndex, {
239
244
  identifier: PsbtUtil_1.PSBT_PROPRIETARY_IDENTIFIER,
240
245
  subtype: PsbtUtil_1.ProprietaryKeySubtype.MUSIG2_PARTICIPANT_PUB_KEYS,
@@ -264,7 +269,8 @@ class UtxoPsbt extends __1.Psbt {
264
269
  finalizeAllInputs() {
265
270
  utils_1.checkForInput(this.data.inputs, 0); // making sure we have at least one
266
271
  this.data.inputs.map((input, idx) => {
267
- if (input.tapLeafScript?.length) {
272
+ var _a;
273
+ if ((_a = input.tapLeafScript) === null || _a === void 0 ? void 0 : _a.length) {
268
274
  return this.isMultisigTaprootScript(input.tapLeafScript[0].script)
269
275
  ? this.finalizeTaprootInput(idx)
270
276
  : this.finalizeTapInputWithSingleLeafScriptAndSignature(idx);
@@ -277,6 +283,7 @@ class UtxoPsbt extends __1.Psbt {
277
283
  return this;
278
284
  }
279
285
  finalizeTaprootInput(inputIndex) {
286
+ var _a, _b;
280
287
  const checkPartialSigSighashes = (sig) => {
281
288
  const sighashType = sig.length === 64 ? __1.Transaction.SIGHASH_DEFAULT : sig.readUInt8(sig.length - 1);
282
289
  const inputSighashType = input.sighashType === undefined ? __1.Transaction.SIGHASH_DEFAULT : input.sighashType;
@@ -284,14 +291,14 @@ class UtxoPsbt extends __1.Psbt {
284
291
  };
285
292
  const input = utils_1.checkForInput(this.data.inputs, inputIndex);
286
293
  // witness = control-block script first-sig second-sig
287
- if (input.tapLeafScript?.length !== 1) {
294
+ if (((_a = input.tapLeafScript) === null || _a === void 0 ? void 0 : _a.length) !== 1) {
288
295
  throw new Error('Only one leaf script supported for finalizing');
289
296
  }
290
297
  const { controlBlock, script } = input.tapLeafScript[0];
291
298
  const witness = [script, controlBlock];
292
299
  const [pubkey1, pubkey2] = parseInput_1.parsePubScript2Of3(script, 'taprootScriptPathSpend').publicKeys;
293
300
  for (const pk of [pubkey1, pubkey2]) {
294
- const sig = input.tapScriptSig?.find(({ pubkey }) => equalPublicKeyIgnoreY(pk, pubkey));
301
+ const sig = (_b = input.tapScriptSig) === null || _b === void 0 ? void 0 : _b.find(({ pubkey }) => equalPublicKeyIgnoreY(pk, pubkey));
295
302
  if (!sig) {
296
303
  throw new Error('Could not find signatures in Script Sig.');
297
304
  }
@@ -313,7 +320,7 @@ class UtxoPsbt extends __1.Psbt {
313
320
  finalizeTaprootMusig2Input(inputIndex) {
314
321
  const input = utils_1.checkForInput(this.data.inputs, inputIndex);
315
322
  const partialSigs = Musig2_1.parsePsbtMusig2PartialSigs(input);
316
- if (partialSigs?.length !== 2) {
323
+ if ((partialSigs === null || partialSigs === void 0 ? void 0 : partialSigs.length) !== 2) {
317
324
  throw new Error(`invalid number of partial signatures ${partialSigs ? partialSigs.length : 0} to finalize`);
318
325
  }
319
326
  const { partialSigs: pSigs, sigHashType } = Musig2_1.getSigHashTypeFromSigs(partialSigs);
@@ -331,11 +338,12 @@ class UtxoPsbt extends __1.Psbt {
331
338
  return this;
332
339
  }
333
340
  finalizeTapInputWithSingleLeafScriptAndSignature(inputIndex) {
341
+ var _a, _b;
334
342
  const input = utils_1.checkForInput(this.data.inputs, inputIndex);
335
- if (input.tapLeafScript?.length !== 1) {
343
+ if (((_a = input.tapLeafScript) === null || _a === void 0 ? void 0 : _a.length) !== 1) {
336
344
  throw new Error('Only one leaf script supported for finalizing');
337
345
  }
338
- if (input.tapScriptSig?.length !== 1) {
346
+ if (((_b = input.tapScriptSig) === null || _b === void 0 ? void 0 : _b.length) !== 1) {
339
347
  throw new Error('Could not find signatures in Script Sig.');
340
348
  }
341
349
  const { controlBlock, script } = input.tapLeafScript[0];
@@ -428,7 +436,7 @@ class UtxoPsbt extends __1.Psbt {
428
436
  let myPartialSigs = partialSigs;
429
437
  if (pubkey) {
430
438
  myPartialSigs = partialSigs.filter((kv) => equalPublicKeyIgnoreY(kv.participantPubKey, pubkey));
431
- if (myPartialSigs?.length < 1) {
439
+ if ((myPartialSigs === null || myPartialSigs === void 0 ? void 0 : myPartialSigs.length) < 1) {
432
440
  throw new Error('No signatures for this pubkey');
433
441
  }
434
442
  }
@@ -450,6 +458,7 @@ class UtxoPsbt extends __1.Psbt {
450
458
  return __1.ecc.verifySchnorr(hash, participants.tapOutputKey, aggSig);
451
459
  }
452
460
  validateTaprootSignaturesOfInput(inputIndex, pubkey) {
461
+ var _a, _b;
453
462
  const input = this.data.inputs[inputIndex];
454
463
  const tapSigs = (input || {}).tapScriptSig;
455
464
  if (!input || !tapSigs || tapSigs.length < 1) {
@@ -466,7 +475,7 @@ class UtxoPsbt extends __1.Psbt {
466
475
  mySigs = tapSigs;
467
476
  }
468
477
  const results = [];
469
- assert(input.tapLeafScript?.length === 1, `single tapLeafScript is expected. Got ${input.tapLeafScript?.length}`);
478
+ assert(((_a = input.tapLeafScript) === null || _a === void 0 ? void 0 : _a.length) === 1, `single tapLeafScript is expected. Got ${(_b = input.tapLeafScript) === null || _b === void 0 ? void 0 : _b.length}`);
470
479
  const [tapLeafScript] = input.tapLeafScript;
471
480
  const pubKeys = this.isMultisigTaprootScript(tapLeafScript.script)
472
481
  ? parseInput_1.parsePubScript2Of3(tapLeafScript.script, 'taprootScriptPathSpend').publicKeys
@@ -498,12 +507,13 @@ class UtxoPsbt extends __1.Psbt {
498
507
  * If no signature in the tx or no public key matching signature, the validation is considered as false.
499
508
  */
500
509
  getSignatureValidationArray(inputIndex, { rootNodes } = {}) {
501
- if (!rootNodes && (!this.data.globalMap.globalXpub?.length || !types_1.isTriple(this.data.globalMap.globalXpub))) {
510
+ var _a, _b;
511
+ if (!rootNodes && (!((_a = this.data.globalMap.globalXpub) === null || _a === void 0 ? void 0 : _a.length) || !types_1.isTriple(this.data.globalMap.globalXpub))) {
502
512
  throw new Error('Cannot get signature validation array without 3 global xpubs');
503
513
  }
504
514
  const bip32s = rootNodes
505
515
  ? rootNodes
506
- : this.data.globalMap.globalXpub?.map((xpub) => bip32_1.BIP32Factory(__1.ecc).fromBase58(bs58check.encode(xpub.extendedPubkey)));
516
+ : (_b = this.data.globalMap.globalXpub) === null || _b === void 0 ? void 0 : _b.map((xpub) => bip32_1.BIP32Factory(__1.ecc).fromBase58(bs58check.encode(xpub.extendedPubkey)));
507
517
  if (!bip32s) {
508
518
  throw new Error('either globalMap or rootNodes is required');
509
519
  }
@@ -555,6 +565,7 @@ class UtxoPsbt extends __1.Psbt {
555
565
  * Mostly copied from bitcoinjs-lib/ts_src/psbt.ts:signInputHD
556
566
  */
557
567
  signTaprootInputHD(inputIndex, hdKeyPair, { sighashTypes = [__1.Transaction.SIGHASH_DEFAULT, __1.Transaction.SIGHASH_ALL], deterministic = false } = {}) {
568
+ var _a, _b;
558
569
  if (!this.isTaprootInput(inputIndex)) {
559
570
  throw new Error('not a taproot input');
560
571
  }
@@ -582,7 +593,7 @@ class UtxoPsbt extends __1.Psbt {
582
593
  }
583
594
  return node;
584
595
  }
585
- if (input.tapLeafScript?.length) {
596
+ if ((_a = input.tapLeafScript) === null || _a === void 0 ? void 0 : _a.length) {
586
597
  const signers = myDerivations.map((bipDv) => {
587
598
  const signer = getDerivedNode(bipDv);
588
599
  if (!('signSchnorr' in signer)) {
@@ -592,7 +603,7 @@ class UtxoPsbt extends __1.Psbt {
592
603
  });
593
604
  signers.forEach(({ signer, leafHashes }) => this.signTaprootInput(inputIndex, signer, leafHashes, sighashTypes));
594
605
  }
595
- else if (input.tapInternalKey?.length) {
606
+ else if ((_b = input.tapInternalKey) === null || _b === void 0 ? void 0 : _b.length) {
596
607
  const signers = myDerivations.map((bipDv) => {
597
608
  const signer = getDerivedNode(bipDv);
598
609
  if (!('privateKey' in signer) || !signer.privateKey) {
@@ -624,7 +635,7 @@ class UtxoPsbt extends __1.Psbt {
624
635
  getMusig2Nonces(inputIndex, participantsKeyValData) {
625
636
  const noncesKeyValsData = Musig2_1.parsePsbtMusig2Nonces(this.data.inputs[inputIndex]);
626
637
  if (!noncesKeyValsData || !types_1.isTuple(noncesKeyValsData)) {
627
- throw new Error(`Found ${noncesKeyValsData?.length ? noncesKeyValsData.length : 0} matching nonce key value instead of 2`);
638
+ throw new Error(`Found ${(noncesKeyValsData === null || noncesKeyValsData === void 0 ? void 0 : noncesKeyValsData.length) ? noncesKeyValsData.length : 0} matching nonce key value instead of 2`);
628
639
  }
629
640
  Musig2_1.assertPsbtMusig2Nonces(noncesKeyValsData, participantsKeyValData);
630
641
  return noncesKeyValsData;
@@ -699,9 +710,10 @@ class UtxoPsbt extends __1.Psbt {
699
710
  return this;
700
711
  }
701
712
  signTaprootInput(inputIndex, signer, leafHashes, sighashTypes = [__1.Transaction.SIGHASH_DEFAULT, __1.Transaction.SIGHASH_ALL]) {
713
+ var _a;
702
714
  const input = utils_1.checkForInput(this.data.inputs, inputIndex);
703
715
  // Figure out if this is script path or not, if not, tweak the private key
704
- if (!input.tapLeafScript?.length) {
716
+ if (!((_a = input.tapLeafScript) === null || _a === void 0 ? void 0 : _a.length)) {
705
717
  throw new Error('tapLeafScript is required for p2tr script path');
706
718
  }
707
719
  const pubkey = outputScripts_1.toXOnlyPublicKey(signer.publicKey);
@@ -739,8 +751,9 @@ class UtxoPsbt extends __1.Psbt {
739
751
  return this;
740
752
  }
741
753
  getTaprootOutputScript(inputIndex) {
754
+ var _a;
742
755
  const input = utils_1.checkForInput(this.data.inputs, inputIndex);
743
- if (input.tapLeafScript?.length) {
756
+ if ((_a = input.tapLeafScript) === null || _a === void 0 ? void 0 : _a.length) {
744
757
  return __1.taproot.createTaprootOutputScript({
745
758
  controlBlock: input.tapLeafScript[0].controlBlock,
746
759
  leafScript: input.tapLeafScript[0].script,
@@ -811,10 +824,11 @@ class UtxoPsbt extends __1.Psbt {
811
824
  * Default identifierEncoding is utf-8 for identifier.
812
825
  */
813
826
  addOrUpdateProprietaryKeyValToInput(inputIndex, keyValueData) {
827
+ var _a;
814
828
  const input = utils_1.checkForInput(this.data.inputs, inputIndex);
815
829
  const key = proprietaryKeyVal_1.encodeProprietaryKey(keyValueData.key);
816
830
  const { value } = keyValueData;
817
- if (input.unknownKeyVals?.length) {
831
+ if ((_a = input.unknownKeyVals) === null || _a === void 0 ? void 0 : _a.length) {
818
832
  const ukvIndex = input.unknownKeyVals.findIndex((ukv) => ukv.key.equals(key));
819
833
  if (ukvIndex > -1) {
820
834
  input.unknownKeyVals[ukvIndex] = { key, value };
@@ -840,8 +854,9 @@ class UtxoPsbt extends __1.Psbt {
840
854
  * Default identifierEncoding is utf-8 for identifier.
841
855
  */
842
856
  deleteProprietaryKeyVals(inputIndex, keysToDelete) {
857
+ var _a;
843
858
  const input = utils_1.checkForInput(this.data.inputs, inputIndex);
844
- if (!input.unknownKeyVals?.length) {
859
+ if (!((_a = input.unknownKeyVals) === null || _a === void 0 ? void 0 : _a.length)) {
845
860
  return this;
846
861
  }
847
862
  if (keysToDelete && keysToDelete.subtype === undefined && Buffer.isBuffer(keysToDelete.keydata)) {
@@ -866,7 +881,8 @@ class UtxoPsbt extends __1.Psbt {
866
881
  throw new Error('tapMerkleRoot is required to create nonce');
867
882
  }
868
883
  const getDerivedKeyPair = () => {
869
- if (!input.tapBip32Derivation?.length) {
884
+ var _a;
885
+ if (!((_a = input.tapBip32Derivation) === null || _a === void 0 ? void 0 : _a.length)) {
870
886
  throw new Error('tapBip32Derivation is required to create nonce');
871
887
  }
872
888
  const derived = UtxoPsbt.deriveKeyPair(keyPair, input.tapBip32Derivation, { ignoreY: true });
@@ -1002,4 +1018,4 @@ class UtxoPsbt extends __1.Psbt {
1002
1018
  }
1003
1019
  }
1004
1020
  exports.UtxoPsbt = UtxoPsbt;
1005
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVXR4b1BzYnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYml0Z28vVXR4b1BzYnQudHMiXSw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FNCVF9QUk9QUklFVEFSWV9JREVOVElGSUVSLFxuICAgICAgICAgIHN1YnR5cGU6IFByb3ByaWV0YXJ5S2V5U3VidHlwZS5NVVNJRzJfUFVCX05PTkNFLFxuICAgICAgICB9KS5sZW5ndGggfHxcbiAgICAgICAgdGhpcy5nZXRQcm9wcmlldGFyeUtleVZhbHMoaW5wdXRJbmRleCwge1xuICAgICAgICAgIGlkZW50aWZpZXI6IFBTQlRfUFJPUFJJRVRBUllfSURFTlRJRklFUixcbiAgICAgICAgICBzdWJ0eXBlOiBQcm9wcmlldGFyeUtleVN1YnR5cGUuTVVTSUcyX1BBUlRJQUxfU0lHLFxuICAgICAgICB9KS5sZW5ndGhcbiAgICAgIClcbiAgICApO1xuICB9XG5cbiAgLyoqXG4gICAqIEByZXR1cm5zIHRydWUgaWYgdGhlIGlucHV0IGF0IGlucHV0SW5kZXggaXMgYSB0YXByb290XG4gICAqL1xuICBpc1RhcHJvb3RJbnB1dChpbnB1dEluZGV4OiBudW1iZXIpOiBib29sZWFuIHtcbiAgICBjb25zdCBpbnB1dCA9IGNoZWNrRm9ySW5wdXQodGhpcy5kYXRhLmlucHV0cywgaW5wdXRJbmRleCk7XG4gICAgY29uc3QgaXNQMlRSID0gKHNjcmlwdDogQnVmZmVyKTogYm9vbGVhbiA9PiB7XG4gICAgICB0cnkge1xuICAgICAgICBnZXRUYXByb290T3V0cHV0S2V5KHNjcmlwdCk7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICB9XG4gICAgfTtcbiAgICByZXR1cm4gISEoXG4gICAgICBpbnB1dC50YXBJbnRlcm5hbEtleSB8fFxuICAgICAgaW5wdXQudGFwTWVya2xlUm9vdCB8fFxuICAgICAgaW5wdXQudGFwTGVhZlNjcmlwdD8ubGVuZ3RoIHx8XG4gICAgICBpbnB1dC50YXBCaXAzMkRlcml2YXRpb24/Lmxlbmd0aCB8fF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