utxo-lib 1.0.9 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. package/README.md +19 -16
  2. package/dist/src/address.d.ts.map +1 -1
  3. package/dist/src/address.js +11 -1
  4. package/dist/src/addressFormat.d.ts +1 -1
  5. package/dist/src/addressFormat.d.ts.map +1 -1
  6. package/dist/src/addressFormat.js +1 -1
  7. package/dist/src/bitgo/Musig2.d.ts +115 -17
  8. package/dist/src/bitgo/Musig2.d.ts.map +1 -1
  9. package/dist/src/bitgo/Musig2.js +283 -100
  10. package/dist/src/bitgo/PsbtUtil.d.ts +59 -0
  11. package/dist/src/bitgo/PsbtUtil.d.ts.map +1 -0
  12. package/dist/src/bitgo/PsbtUtil.js +92 -0
  13. package/dist/src/bitgo/UtxoPsbt.d.ts +180 -47
  14. package/dist/src/bitgo/UtxoPsbt.d.ts.map +1 -1
  15. package/dist/src/bitgo/UtxoPsbt.js +673 -113
  16. package/dist/src/bitgo/UtxoTransaction.js +2 -2
  17. package/dist/src/bitgo/bitcoincash/address.js +2 -2
  18. package/dist/src/bitgo/index.d.ts +11 -0
  19. package/dist/src/bitgo/index.d.ts.map +1 -1
  20. package/dist/src/bitgo/index.js +6 -2
  21. package/dist/src/bitgo/legacysafe/index.d.ts +15 -0
  22. package/dist/src/bitgo/legacysafe/index.d.ts.map +1 -0
  23. package/dist/src/bitgo/legacysafe/index.js +61 -0
  24. package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts +10 -0
  25. package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts.map +1 -0
  26. package/dist/src/bitgo/litecoin/LitecoinPsbt.js +17 -0
  27. package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts +16 -0
  28. package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts.map +1 -0
  29. package/dist/src/bitgo/litecoin/LitecoinTransaction.js +46 -0
  30. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts +10 -0
  31. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts.map +1 -0
  32. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.js +15 -0
  33. package/dist/src/bitgo/litecoin/index.d.ts +4 -0
  34. package/dist/src/bitgo/litecoin/index.d.ts.map +1 -0
  35. package/dist/src/bitgo/litecoin/index.js +16 -0
  36. package/dist/src/bitgo/outputScripts.d.ts +3 -1
  37. package/dist/src/bitgo/outputScripts.d.ts.map +1 -1
  38. package/dist/src/bitgo/outputScripts.js +20 -12
  39. package/dist/src/bitgo/parseInput.d.ts +49 -20
  40. package/dist/src/bitgo/parseInput.d.ts.map +1 -1
  41. package/dist/src/bitgo/parseInput.js +110 -26
  42. package/dist/src/bitgo/psbt/fromHalfSigned.d.ts.map +1 -1
  43. package/dist/src/bitgo/psbt/fromHalfSigned.js +9 -6
  44. package/dist/src/bitgo/psbt/scriptTypes.js +3 -3
  45. package/dist/src/bitgo/signature.d.ts +3 -3
  46. package/dist/src/bitgo/signature.d.ts.map +1 -1
  47. package/dist/src/bitgo/signature.js +48 -16
  48. package/dist/src/bitgo/transaction.d.ts +18 -3
  49. package/dist/src/bitgo/transaction.d.ts.map +1 -1
  50. package/dist/src/bitgo/transaction.js +28 -15
  51. package/dist/src/bitgo/types.d.ts +2 -0
  52. package/dist/src/bitgo/types.d.ts.map +1 -1
  53. package/dist/src/bitgo/types.js +1 -1
  54. package/dist/src/bitgo/wallet/Psbt.d.ts +104 -12
  55. package/dist/src/bitgo/wallet/Psbt.d.ts.map +1 -1
  56. package/dist/src/bitgo/wallet/Psbt.js +288 -70
  57. package/dist/src/bitgo/wallet/Unspent.d.ts +28 -0
  58. package/dist/src/bitgo/wallet/Unspent.d.ts.map +1 -1
  59. package/dist/src/bitgo/wallet/Unspent.js +173 -68
  60. package/dist/src/bitgo/wallet/WalletOutput.d.ts +17 -1
  61. package/dist/src/bitgo/wallet/WalletOutput.d.ts.map +1 -1
  62. package/dist/src/bitgo/wallet/WalletOutput.js +64 -23
  63. package/dist/src/bitgo/wallet/chains.d.ts +2 -2
  64. package/dist/src/bitgo/wallet/chains.d.ts.map +1 -1
  65. package/dist/src/bitgo/wallet/chains.js +1 -1
  66. package/dist/src/bitgo/zcash/ZcashPsbt.d.ts +0 -1
  67. package/dist/src/bitgo/zcash/ZcashPsbt.d.ts.map +1 -1
  68. package/dist/src/bitgo/zcash/ZcashPsbt.js +8 -15
  69. package/dist/src/bitgo/zcash/ZcashTransaction.js +2 -2
  70. package/dist/src/musig.d.ts +0 -1
  71. package/dist/src/musig.d.ts.map +1 -1
  72. package/dist/src/musig.js +15 -29
  73. package/dist/src/networks.d.ts +1 -2
  74. package/dist/src/networks.d.ts.map +1 -1
  75. package/dist/src/networks.js +22 -29
  76. package/dist/src/noble_ecc.d.ts +1 -1
  77. package/dist/src/noble_ecc.d.ts.map +1 -1
  78. package/dist/src/noble_ecc.js +9 -5
  79. package/dist/src/payments/p2tr.d.ts.map +1 -1
  80. package/dist/src/payments/p2tr.js +25 -15
  81. package/dist/src/payments/p2tr_ns.js +3 -2
  82. package/dist/src/taproot.d.ts +16 -0
  83. package/dist/src/taproot.d.ts.map +1 -1
  84. package/dist/src/taproot.js +46 -3
  85. package/dist/src/testutil/index.d.ts +2 -0
  86. package/dist/src/testutil/index.d.ts.map +1 -1
  87. package/dist/src/testutil/index.js +3 -1
  88. package/dist/src/testutil/keys.d.ts +3 -0
  89. package/dist/src/testutil/keys.d.ts.map +1 -1
  90. package/dist/src/testutil/keys.js +17 -2
  91. package/dist/src/testutil/mock.d.ts +1 -1
  92. package/dist/src/testutil/mock.d.ts.map +1 -1
  93. package/dist/src/testutil/mock.js +12 -4
  94. package/dist/src/testutil/psbt.d.ts +89 -0
  95. package/dist/src/testutil/psbt.d.ts.map +1 -0
  96. package/dist/src/testutil/psbt.js +150 -0
  97. package/dist/src/testutil/transaction.d.ts +70 -0
  98. package/dist/src/testutil/transaction.d.ts.map +1 -0
  99. package/dist/src/testutil/transaction.js +107 -0
  100. package/dist/src/transaction_builder.js +2 -2
  101. package/package.json +7 -6
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parsePubScript = exports.parseSignatureScript2Of3 = exports.parseSignatureScript = exports.getScriptPathLevel = exports.calculateScriptPathLevel = exports.isValidControlBock = exports.isPlaceholderSignature = void 0;
3
+ exports.parsePubScript = exports.parsePubScript2Of3 = exports.parseSignatureScript2Of3 = exports.parseSignatureScript = exports.getLeafVersion = exports.calculateScriptPathLevel = exports.isValidControlBock = exports.isPlaceholderSignature = void 0;
4
+ /* eslint no-redeclare: 0 */
4
5
  const opcodes = require("bitcoin-ops");
5
6
  const bitcoinjs_lib_1 = require("bitcoinjs-lib");
6
- const outputScripts_1 = require("./outputScripts");
7
7
  const types_1 = require("./types");
8
+ const outputScripts_1 = require("./outputScripts");
8
9
  function isPlaceholderSignature(v) {
9
10
  if (Buffer.isBuffer(v)) {
10
11
  return v.length === 0;
@@ -39,13 +40,13 @@ exports.calculateScriptPathLevel = calculateScriptPathLevel;
39
40
  /**
40
41
  * @return leaf version for P2TR control block.
41
42
  */
42
- function getScriptPathLevel(controlBlock) {
43
+ function getLeafVersion(controlBlock) {
43
44
  if (Buffer.isBuffer(controlBlock) && controlBlock.length > 0) {
44
45
  return controlBlock[0] & 0xfe;
45
46
  }
46
47
  throw new Error('unexpected leafVersion.');
47
48
  }
48
- exports.getScriptPathLevel = getScriptPathLevel;
49
+ exports.getLeafVersion = getLeafVersion;
49
50
  function emptyMatchResult() {
50
51
  return {
51
52
  ':pubkey': [],
@@ -89,7 +90,7 @@ function matchScript(script, pattern) {
89
90
  case 'OP_CHECKSIGVERIFY':
90
91
  return e === opcodes[p];
91
92
  case ':pubkey':
92
- return Buffer.isBuffer(e) && e.length === 33;
93
+ return Buffer.isBuffer(e) && (e.length === 33 || e.length === 65);
93
94
  case ':pubkey-xonly':
94
95
  return Buffer.isBuffer(e) && e.length === 32;
95
96
  case ':signature':
@@ -227,7 +228,24 @@ const parseP2wsh2Of3 = (p) => {
227
228
  }
228
229
  return parseP2ms(p.witness, 'p2wsh');
229
230
  };
230
- const parseP2tr2Of3 = (p) => {
231
+ const parseTaprootKeyPath2Of3 = (p) => {
232
+ if (!isNativeSegwit(p)) {
233
+ return new MatchError(`expected native segwit`);
234
+ }
235
+ const match = matchScript(p.witness, [':signature']);
236
+ if (match instanceof MatchError) {
237
+ return match;
238
+ }
239
+ const signatures = match[':signature'];
240
+ if (isPlaceholderSignature(signatures[0])) {
241
+ throw new Error(`invalid taproot key path signature`);
242
+ }
243
+ return {
244
+ scriptType: 'taprootKeyPathSpend',
245
+ signatures,
246
+ };
247
+ };
248
+ const parseTaprootScriptPath2Of3 = (p) => {
231
249
  if (!isNativeSegwit(p)) {
232
250
  return new MatchError(`expected native segwit`);
233
251
  }
@@ -243,9 +261,9 @@ const parseP2tr2Of3 = (p) => {
243
261
  }
244
262
  const [controlBlock] = match[':control-block'];
245
263
  const scriptPathLevel = calculateScriptPathLevel(controlBlock);
246
- const leafVersion = getScriptPathLevel(controlBlock);
264
+ const leafVersion = getLeafVersion(controlBlock);
247
265
  return {
248
- scriptType: 'p2tr',
266
+ scriptType: 'taprootScriptPathSpend',
249
267
  pubScript: match[':script'][0].buffer,
250
268
  publicKeys: match[':script'][0].match[':pubkey-xonly'],
251
269
  signatures: match[':signature'],
@@ -265,10 +283,17 @@ const parseP2tr2Of3 = (p) => {
265
283
  */
266
284
  function parseSignatureScript(input) {
267
285
  const decScript = bitcoinjs_lib_1.script.decompile(input.script);
268
- const parsers = [parseP2sh2Of3, parseP2shP2wsh2Of3, parseP2wsh2Of3, parseP2tr2Of3, parseP2shP2pk];
286
+ const parsers = [
287
+ parseP2sh2Of3,
288
+ parseP2shP2wsh2Of3,
289
+ parseP2wsh2Of3,
290
+ parseTaprootKeyPath2Of3,
291
+ parseTaprootScriptPath2Of3,
292
+ parseP2shP2pk,
293
+ ];
269
294
  for (const f of parsers) {
270
295
  const parsed = f({
271
- script: decScript?.length === 0 ? null : decScript,
296
+ script: (decScript === null || decScript === void 0 ? void 0 : decScript.length) === 0 ? null : decScript,
272
297
  witness: input.witness.length === 0 ? null : input.witness,
273
298
  });
274
299
  if (parsed instanceof MatchError) {
@@ -281,19 +306,42 @@ function parseSignatureScript(input) {
281
306
  exports.parseSignatureScript = parseSignatureScript;
282
307
  function parseSignatureScript2Of3(input) {
283
308
  const result = parseSignatureScript(input);
284
- if (!outputScripts_1.isScriptType2Of3(result.scriptType)) {
309
+ if (!outputScripts_1.isScriptType2Of3(result.scriptType) &&
310
+ result.scriptType !== 'taprootKeyPathSpend' &&
311
+ result.scriptType !== 'taprootScriptPathSpend') {
285
312
  throw new Error(`invalid script type`);
286
313
  }
287
314
  if (!result.signatures) {
288
315
  throw new Error(`missing signatures`);
289
316
  }
290
- if (result.publicKeys.length !== 3 && (result.publicKeys.length !== 2 || result.scriptType !== 'p2tr')) {
317
+ if (result.scriptType !== 'taprootKeyPathSpend' &&
318
+ result.publicKeys.length !== 3 &&
319
+ (result.publicKeys.length !== 2 || result.scriptType !== 'taprootScriptPathSpend')) {
291
320
  throw new Error(`unexpected pubkey count`);
292
321
  }
293
322
  return result;
294
323
  }
295
324
  exports.parseSignatureScript2Of3 = parseSignatureScript2Of3;
325
+ const parseP2shP2pkPubScript = (pubScript, scriptType) => {
326
+ if (scriptType !== 'p2shP2pk') {
327
+ throw new Error('invalid script type');
328
+ }
329
+ const match = matchScript([pubScript], [{ ':script': [':pubkey', 'OP_CHECKSIG'] }]);
330
+ if (match instanceof MatchError) {
331
+ return match;
332
+ }
333
+ const [script] = match[':script'];
334
+ return {
335
+ scriptType,
336
+ publicKeys: script.match[':pubkey'],
337
+ pubScript: pubScript,
338
+ redeemScript: pubScript,
339
+ };
340
+ };
296
341
  const parseP2msPubScript = (pubScript, scriptType) => {
342
+ if (scriptType === 'taprootScriptPathSpend' || scriptType === 'taprootKeyPathSpend' || scriptType === 'p2shP2pk') {
343
+ throw new Error('invalid script type');
344
+ }
297
345
  const match = matchScript([pubScript], [{ ':script': ['OP_2', ':pubkey', ':pubkey', ':pubkey', 'OP_3', 'OP_CHECKMULTISIG'] }]);
298
346
  if (match instanceof MatchError) {
299
347
  return match;
@@ -310,35 +358,71 @@ const parseP2msPubScript = (pubScript, scriptType) => {
310
358
  witnessScript: scriptType === 'p2shP2wsh' || scriptType === 'p2wsh' ? redeemScript.buffer : undefined,
311
359
  };
312
360
  };
313
- const parseP2tr2Of3PubScript = (pubScript, scriptType) => {
361
+ const parseTaprootKeyPathPubScript = (pubScript, scriptType) => {
362
+ if (scriptType === 'p2sh' ||
363
+ scriptType === 'p2wsh' ||
364
+ scriptType === 'p2shP2wsh' ||
365
+ scriptType === 'taprootScriptPathSpend' ||
366
+ scriptType === 'p2shP2pk') {
367
+ throw new Error('invalid script type');
368
+ }
369
+ const match = matchScript([pubScript], [{ ':script': ['OP_1', ':pubkey-xonly'] }]);
370
+ if (match instanceof MatchError) {
371
+ return match;
372
+ }
373
+ const [script] = match[':script'];
374
+ return {
375
+ scriptType: 'taprootKeyPathSpend',
376
+ publicKeys: script.match[':pubkey-xonly'],
377
+ pubScript: pubScript,
378
+ };
379
+ };
380
+ const parseTaprootScriptPathPubScript = (pubScript, scriptType) => {
381
+ if (scriptType === 'p2sh' ||
382
+ scriptType === 'p2wsh' ||
383
+ scriptType === 'p2shP2wsh' ||
384
+ scriptType === 'taprootKeyPathSpend' ||
385
+ scriptType === 'p2shP2pk') {
386
+ throw new Error('invalid script type');
387
+ }
314
388
  const match = matchScript([pubScript], [{ ':script': [':pubkey-xonly', 'OP_CHECKSIGVERIFY', ':pubkey-xonly', 'OP_CHECKSIG'] }]);
315
389
  if (match instanceof MatchError) {
316
390
  return match;
317
391
  }
318
392
  return {
319
- scriptType: 'p2tr',
393
+ scriptType,
320
394
  pubScript: match[':script'][0].buffer,
321
395
  publicKeys: match[':script'][0].match[':pubkey-xonly'],
322
396
  };
323
397
  };
324
- /**
325
- * @return pubScript (scriptPubKey/redeemScript/witnessScript) is parsed.
326
- * P2SH => scriptType, pubScript (redeemScript), redeemScript, public keys
327
- * PW2SH => scriptType, pubScript (witnessScript), witnessScript, public keys.
328
- * P2SH-PW2SH => scriptType, pubScript (witnessScript), witnessScript, public keys.
329
- * P2TR => scriptType, pubScript, controlBlock, scriptPathLevel, leafVersion, pub keys, signatures.
330
- */
398
+ function parsePubScript2Of3(inputPubScript, scriptType) {
399
+ const result = scriptType === 'taprootKeyPathSpend'
400
+ ? parseTaprootKeyPathPubScript(inputPubScript, scriptType)
401
+ : scriptType === 'taprootScriptPathSpend'
402
+ ? parseTaprootScriptPathPubScript(inputPubScript, scriptType)
403
+ : parseP2msPubScript(inputPubScript, scriptType);
404
+ if (result instanceof MatchError) {
405
+ throw new Error(result.message);
406
+ }
407
+ if ((result.scriptType === 'taprootKeyPathSpend' && result.publicKeys.length !== 1) ||
408
+ (result.scriptType === 'taprootScriptPathSpend' && result.publicKeys.length !== 2) ||
409
+ (outputScripts_1.isScriptType2Of3(result.scriptType) && result.publicKeys.length !== 3)) {
410
+ throw new Error('unexpected pubkey count');
411
+ }
412
+ return result;
413
+ }
414
+ exports.parsePubScript2Of3 = parsePubScript2Of3;
331
415
  function parsePubScript(inputPubScript, scriptType) {
332
- const result = scriptType === 'p2tr'
333
- ? parseP2tr2Of3PubScript(inputPubScript, scriptType)
334
- : parseP2msPubScript(inputPubScript, scriptType);
416
+ const result = scriptType === 'p2shP2pk'
417
+ ? parseP2shP2pkPubScript(inputPubScript, scriptType)
418
+ : parsePubScript2Of3(inputPubScript, scriptType);
335
419
  if (result instanceof MatchError) {
336
420
  throw new Error(result.message);
337
421
  }
338
- if (result.publicKeys.length !== 3 && (result.publicKeys.length !== 2 || result.scriptType !== 'p2tr')) {
422
+ if (result.scriptType === 'p2shP2pk' && result.publicKeys.length !== 1) {
339
423
  throw new Error('unexpected pubkey count');
340
424
  }
341
425
  return result;
342
426
  }
343
427
  exports.parsePubScript = parsePubScript;
344
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJz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1xuICAgIHRocm93IG5ldyBFcnJvcigndW5leHBlY3RlZCBwdWJrZXkgY291bnQnKTtcbiAgfVxuXG4gIHJldHVybiByZXN1bHQ7XG59XG4iXX0=
@@ -1 +1 @@
1
- {"version":3,"file":"fromHalfSigned.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/psbt/fromHalfSigned.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAc,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAiB,QAAQ,EAAiC,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AASrD,wBAAgB,cAAc,CAC5B,EAAE,EAAE,eAAe,CAAC,MAAM,CAAC,EAC3B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,GACnD,eAAe,CA2DjB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,eAAe,EAAE,CAOnG"}
1
+ {"version":3,"file":"fromHalfSigned.d.ts","sourceRoot":"","sources":["../../../../src/bitgo/psbt/fromHalfSigned.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAc,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAiB,QAAQ,EAAiC,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AASrD,wBAAgB,cAAc,CAC5B,EAAE,EAAE,eAAe,CAAC,MAAM,CAAC,EAC3B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,GACnD,eAAe,CA+DjB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,EAAE,EAAE,eAAe,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,eAAe,EAAE,CAOnG"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.unsign = exports.getInputUpdate = void 0;
4
+ const assert = require("assert");
4
5
  const __1 = require("../..");
5
6
  const parseInput_1 = require("../parseInput");
6
7
  const signature_1 = require("../signature");
@@ -15,7 +16,9 @@ function getInputUpdate(tx, vin, prevOuts) {
15
16
  return nonWitnessUtxo ? { nonWitnessUtxo } : {};
16
17
  }
17
18
  const parsedInput = parseInput_1.parseSignatureScript(tx.ins[vin]);
19
+ assert.ok(parsedInput.scriptType !== 'taprootKeyPathSpend');
18
20
  function getPartialSigs() {
21
+ assert.ok(parsedInput.scriptType !== 'taprootKeyPathSpend');
19
22
  return signature_1.getSignaturesWithPublicKeys(tx, vin, prevOuts, parsedInput.publicKeys).flatMap((signature, i) => signature
20
23
  ? [
21
24
  {
@@ -28,7 +31,10 @@ function getInputUpdate(tx, vin, prevOuts) {
28
31
  // Because Zcash directly hashes the value for non-segwit transactions, we do not need to check indirectly
29
32
  // with the previous transaction. Therefore, we can treat Zcash non-segwit transactions as Bitcoin
30
33
  // segwit transactions
31
- if (!outputScripts_1.hasWitnessData(parsedInput.scriptType) && !nonWitnessUtxo && __1.getMainnet(tx.network) !== __1.networks.zcash) {
34
+ if (parsedInput.scriptType !== 'taprootScriptPathSpend' &&
35
+ !outputScripts_1.hasWitnessData(parsedInput.scriptType) &&
36
+ !nonWitnessUtxo &&
37
+ __1.getMainnet(tx.network) !== __1.networks.zcash) {
32
38
  throw new Error(`scriptType ${parsedInput.scriptType} requires prevTx Buffer`);
33
39
  }
34
40
  switch (parsedInput.scriptType) {
@@ -46,10 +52,7 @@ function getInputUpdate(tx, vin, prevOuts) {
46
52
  redeemScript: parsedInput.redeemScript,
47
53
  witnessScript: parsedInput.witnessScript,
48
54
  });
49
- case 'p2tr':
50
- if (!('controlBlock' in parsedInput)) {
51
- throw new Error(`keypath not implemented`);
52
- }
55
+ case 'taprootScriptPathSpend':
53
56
  const leafHash = __1.taproot.getTapleafHash(__1.ecc, parsedInput.controlBlock, parsedInput.pubScript);
54
57
  return {
55
58
  tapLeafScript: [
@@ -88,4 +91,4 @@ function unsign(tx, prevOuts) {
88
91
  });
89
92
  }
90
93
  exports.unsign = unsign;
91
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJvbUhhbGZTaWduZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYml0Z28vcHNidC9mcm9tSGFsZlNpZ25lZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSw2QkFBK0U7QUFFL0UsOENBQXFEO0FBQ3JELDRDQUEyRDtBQUMzRCxvREFBa0Q7QUFFbEQsU0FBUyxhQUFhLENBQW9DLENBQTBCO0lBQ2xGLE9BQU8sTUFBTSxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLEtBQUssU0FBUyxDQUFDLENBQU0sQ0FBQztBQUN4RixDQUFDO0FBRUQsU0FBZ0IsY0FBYyxDQUM1QixFQUEyQixFQUMzQixHQUFXLEVBQ1gsUUFBb0Q7SUFFcEQsTUFBTSxjQUFjLEdBQUcsUUFBUSxDQUFDLEdBQUcsQ0FBQyxDQUFDLE1BQU0sQ0FBQztJQUM1QyxNQUFNLEVBQUUsTUFBTSxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsQ0FBQyxHQUFHLENBQUMsR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biAqXG4gKiBJbnB1dHMgbXVzdCBiZSBvbmUgb2Y6XG4gKiAgLSBwMnNoUDJwa1xuICogIC0gcDJzaCAyLW9mLTNcbiAqICAtIHAyc2hQMndzaCAyLW9mLTNcbiAqICAtIHAyd3NoIDItb2YtM1xuICogIC0gcDJ0ciBzY3JpcHQgcGF0aCAyLW9mLTJcbiAqXG4gKiBAcGFyYW0gdHggdGhlIHBhcnRpYWxseSBzaWduZWQgdHJhbnNhY3Rpb25cbiAqIEBwYXJhbSBwcmV2T3V0c1xuICpcbiAqIEByZXR1cm4gdGhlIHJlbW92ZWQgc2NyaXB0cyBhbmQgc2lnbmF0dXJlcywgcmVhZHkgdG8gYmUgYWRkZWQgdG8gYSBQU0JUXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiB1bnNpZ24odHg6IFV0eG9UcmFuc2FjdGlvbjxiaWdpbnQ+LCBwcmV2T3V0czogVHhPdXRwdXQ8YmlnaW50PltdKTogUHNidElucHV0VXBkYXRlW10ge1xuICByZXR1cm4gdHguaW5zLm1hcCgoaW5wdXQsIHZpbikgPT4ge1xuICAgIGNvbnN0IHVwZGF0ZSA9IGdldElucHV0VXBkYXRlKHR4LCB2aW4sIHByZXZPdXRzKTtcbiAgICBpbnB1dC53aXRuZXNzID0gW107XG4gICAgaW5wdXQuc2NyaXB0ID0gQnVmZmVyLmFsbG9jKDApO1xuICAgIHJldHVybiB1cGRhdGU7XG4gIH0pO1xufVxuIl19
@@ -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
22
  exports.isSegwit = isSegwit;
23
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NyaXB0VHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvYml0Z28vcHNidC9zY3JpcHRUeXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx1Q0FBdUM7QUFFdkMsU0FBZ0IsT0FBTyxDQUFDLFlBQW9CLEVBQUUsWUFBcUI7SUFDakUsTUFBTSx1QkFBdUIsR0FBRyxZQUFZLElBQUksWUFBWSxDQUFDO0lBQzdELE9BQU8sdUJBQXVCLENBQUMsQ0FBQyxDQUFDLEtBQUssT0FBTyxDQUFDLElBQUksSUFBSSx1QkFBdUIsQ0FBQyxNQUFNLEtBQUssRUFBRSxDQUFDO0FBQzlGLENBQUM7QUFIRCwwQkFHQztBQUVELFNBQWdCLFFBQVEsQ0FBQyxZQUFvQixFQUFFLFlBQXFCO0lBQ2xFLE1BQU0sdUJBQXVCLEdBQUcsWUFBWSxJQUFJLFlBQVksQ0FBQztJQUM3RCxPQUFPLHVCQUF1QixDQUFDLENBQUMsQ0FBQyxLQUFLLE9BQU8sQ0FBQyxJQUFJLElBQUksdUJBQXVCLENBQUMsTUFBTSxLQ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SBvcGNvZGVzLk9QXzAgJiYgd2l0bmVzc1Byb2dyYW1DYW5kaWRhdGUubGVuZ3RoID09PSAzNDtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGlzUDJ3cGtoKHNjcmlwdFB1YmtleTogQnVmZmVyLCByZWRlZW1TY3JpcHQ/OiBCdWZmZXIpOiBib29sZWFuIHtcbiAgY29uc3Qgd2l0bmVzc1Byb2dyYW1DYW5kaWRhdGUgPSByZWRlZW1TY3JpcHQgPz8gc2NyaXB0UHVia2V5O1xuICByZXR1cm4gd2l0bmVzc1Byb2dyYW1DYW5kaWRhdGVbMF0gPT09IG9wY29kZXMuT1BfMCAmJiB3aXRuZXNzUHJvZ3JhbUNhbmRpZGF0ZS5sZW5ndGggPT09IDIyO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gaXNUYXByb290KHNjcmlwdFB1YmtleTogQnVmZmVyKTogYm9vbGVhbiB7XG4gIHJldHVybiBzY3JpcHRQdWJrZXlbMF0gPT09IG9wY29kZXMuT1BfMSAmJiBzY3JpcHRQdWJrZXkubGVuZ3RoID09PSAzNDtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGlzU2Vnd2l0KHNjcmlwdFB1YmtleTogQnVmZmVyLCByZWRlZW1TY3JpcHQ/OiBCdWZmZXIpOiBib29sZWFuIHtcbiAgcmV0dXJuIGlzVGFwcm9vdChzY3JpcHRQdWJrZXkpIHx8IGlzUDJ3c2goc2NyaXB0UHVia2V5LCByZWRlZW1TY3JpcHQpIHx8IGlzUDJ3cGtoKHNjcmlwdFB1YmtleSwgcmVkZWVtU2NyaXB0KTtcbn1cbiJdfQ==
@@ -3,7 +3,7 @@ import { BIP32Interface } from 'bip32';
3
3
  import { TxOutput } from 'bitcoinjs-lib';
4
4
  import { UtxoTransaction } from './UtxoTransaction';
5
5
  import { UtxoTransactionBuilder } from './UtxoTransactionBuilder';
6
- import { ScriptType2Of3 } from './outputScripts';
6
+ import { ScriptType, ScriptType2Of3 } from './outputScripts';
7
7
  import { Triple } from './types';
8
8
  import { Network } from '../networks';
9
9
  /**
@@ -40,7 +40,7 @@ export declare type SignatureVerification = {
40
40
  * @param inputIndex
41
41
  * @param amount - must be set for segwit transactions and BIP143 transactions
42
42
  * @param verificationSettings
43
- * @param prevOutputs - must be set for p2tr transactions
43
+ * @param prevOutputs - must be set for p2tr and p2trMusig2 transactions
44
44
  * @returns SignatureVerification[] - in order of parsed non-empty signatures
45
45
  */
46
46
  export declare function getSignatureVerifications<TNumber extends number | bigint>(transaction: UtxoTransaction<TNumber>, inputIndex: number, amount: TNumber, verificationSettings?: VerificationSettings, prevOutputs?: TxOutput<TNumber>[]): SignatureVerification[];
@@ -78,7 +78,7 @@ export declare function verifySignatureWithPublicKeys<TNumber extends number | b
78
78
  * @return true iff signature is valid
79
79
  */
80
80
  export declare function verifySignatureWithPublicKey<TNumber extends number | bigint>(transaction: UtxoTransaction<TNumber>, inputIndex: number, prevOutputs: TxOutput<TNumber>[], publicKey: Buffer): boolean;
81
- export declare function getDefaultSigHash(network: Network, scriptType?: ScriptType2Of3): number;
81
+ export declare function getDefaultSigHash(network: Network, scriptType?: ScriptType): number;
82
82
  export declare function signInputP2shP2pk<TNumber extends number | bigint>(txBuilder: UtxoTransactionBuilder<TNumber>, vin: number, keyPair: BIP32Interface): void;
83
83
  export declare function signInput2Of3<TNumber extends number | bigint>(txBuilder: UtxoTransactionBuilder<TNumber>, vin: number, scriptType: ScriptType2Of3, pubkeys: Triple<Buffer>, keyPair: BIP32Interface, cosigner: Buffer, amount: TNumber): void;
84
84
  //# sourceMappingURL=signature.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../../src/bitgo/signature.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAwB,QAAQ,EAAmB,MAAM,eAAe,CAAC;AAEhF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;A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