@caravan/psbt 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -413,6 +413,12 @@ interface LegacyMultisig {
413
413
  path: string;
414
414
  pubkey: Buffer;
415
415
  }[];
416
+ redeem?: {
417
+ output: Buffer;
418
+ };
419
+ witness?: {
420
+ output: Buffer;
421
+ };
416
422
  }
417
423
  interface LegacyInput {
418
424
  txid: string;
package/dist/index.js CHANGED
@@ -93787,8 +93787,7 @@ var convertLegacyOutput = (output) => {
93787
93787
  address: output.address,
93788
93788
  value: new import_bignumber.default(output.amountSats).toNumber(),
93789
93789
  bip32Derivation: output.bip32Derivation || getBip32Derivation(output.multisig),
93790
- witnessScript: output.witnessScript,
93791
- redeemScript: output.redeemScript
93790
+ ...psbtMultisigLock(output.multisig)
93792
93791
  };
93793
93792
  };
93794
93793
  var getWalletConfigFromInput = (input) => {
@@ -93841,10 +93840,11 @@ var getUnsignedMultisigPsbtV0 = ({
93841
93840
  var psbtInputFormatter = (input, addressType) => {
93842
93841
  const tx = import_bitcoinjs_lib_v63.Transaction.fromHex(input.transactionHex);
93843
93842
  const inputData = { ...input };
93843
+ const nonWitnessUtxo = tx.toBuffer();
93844
93844
  if (addressType === import_bitcoin4.P2SH) {
93845
- const nonWitnessUtxo = tx.toBuffer();
93846
93845
  inputData.nonWitnessUtxo = nonWitnessUtxo;
93847
93846
  } else {
93847
+ inputData.nonWitnessUtxo = nonWitnessUtxo;
93848
93848
  inputData.witnessUtxo = tx.outs[input.index];
93849
93849
  }
93850
93850
  Object.keys(inputData).forEach((key) => {
package/dist/index.mjs CHANGED
@@ -93765,8 +93765,7 @@ var convertLegacyOutput = (output) => {
93765
93765
  address: output.address,
93766
93766
  value: new BigNumber(output.amountSats).toNumber(),
93767
93767
  bip32Derivation: output.bip32Derivation || getBip32Derivation(output.multisig),
93768
- witnessScript: output.witnessScript,
93769
- redeemScript: output.redeemScript
93768
+ ...psbtMultisigLock(output.multisig)
93770
93769
  };
93771
93770
  };
93772
93771
  var getWalletConfigFromInput = (input) => {
@@ -93819,10 +93818,11 @@ var getUnsignedMultisigPsbtV0 = ({
93819
93818
  var psbtInputFormatter = (input, addressType) => {
93820
93819
  const tx = Transaction.fromHex(input.transactionHex);
93821
93820
  const inputData = { ...input };
93821
+ const nonWitnessUtxo = tx.toBuffer();
93822
93822
  if (addressType === P2SH2) {
93823
- const nonWitnessUtxo = tx.toBuffer();
93824
93823
  inputData.nonWitnessUtxo = nonWitnessUtxo;
93825
93824
  } else {
93825
+ inputData.nonWitnessUtxo = nonWitnessUtxo;
93826
93826
  inputData.witnessUtxo = tx.outs[input.index];
93827
93827
  }
93828
93828
  Object.keys(inputData).forEach((key) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caravan/psbt",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "typescript library for working with PSBTs",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",