@exodus/bitcoin-api 2.7.2 → 2.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bitcoin-api",
3
- "version": "2.7.2",
3
+ "version": "2.7.3",
4
4
  "description": "Exodus bitcoin-api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -43,5 +43,5 @@
43
43
  "@scure/btc-signer": "^1.1.0",
44
44
  "jest-when": "^3.5.1"
45
45
  },
46
- "gitHead": "fc4a81292bf22690343a09522c159773a1606b7f"
46
+ "gitHead": "4a7004951e0b166368bf8366ccdeeac4cbcff0e3"
47
47
  }
@@ -47,10 +47,13 @@ export function createSignWithWallet({
47
47
  // BIP143: As a default policy, only compressed public keys are accepted in P2WPKH and P2WSH
48
48
  const p2wpkh = payments.p2wpkh({ pubkey: publicKey })
49
49
  const p2sh = payments.p2sh({ redeem: p2wpkh })
50
- if (address === p2sh.address && !Buffer.isBuffer(psbt.data.inputs[index].redeemScript)) {
51
- psbt.updateInput(index, {
52
- redeemScript: p2sh.redeem.output,
53
- })
50
+ if (address === p2sh.address) {
51
+ // Set the redeem script in the psbt in case it's missing.
52
+ if (!Buffer.isBuffer(psbt.data.inputs[index].redeemScript)) {
53
+ psbt.updateInput(index, {
54
+ redeemScript: p2sh.redeem.output,
55
+ })
56
+ }
54
57
  } else {
55
58
  throw new Error('Expected P2SH script to be a nested segwit input')
56
59
  }