@exodus/bitcoin-api 4.8.2 → 4.8.4

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/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.8.4](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@4.8.3...@exodus/bitcoin-api@4.8.4) (2026-02-03)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **bitcoin-api:** Fix non-BTC nested‑segwit redeem script ([#7357](https://github.com/ExodusMovement/assets/issues/7357)) ([#7381](https://github.com/ExodusMovement/assets/issues/7381)) ([c049583](https://github.com/ExodusMovement/assets/commit/c04958336885777f66b845db72a0900c935cbab0))
12
+
13
+
14
+
15
+ ## [4.8.3](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@4.8.2...@exodus/bitcoin-api@4.8.3) (2025-12-16)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+
21
+ * fix: keep pending txs until /tx check fails for utxo coins (#7009)
22
+
23
+
24
+
6
25
  ## [4.8.2](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@4.8.1...@exodus/bitcoin-api@4.8.2) (2025-12-04)
7
26
 
8
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bitcoin-api",
3
- "version": "4.8.2",
3
+ "version": "4.8.4",
4
4
  "description": "Bitcoin transaction and fee monitors, RPC with the blockchain node, other networking code.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -60,5 +60,5 @@
60
60
  "type": "git",
61
61
  "url": "git+https://github.com/ExodusMovement/assets.git"
62
62
  },
63
- "gitHead": "5440ba73907657281aa3c062168f4fda1f3b6581"
63
+ "gitHead": "bd87fd7045fd427d4fb972aacb3877af10247aec"
64
64
  }
@@ -20,9 +20,9 @@ function canParseTx(rawTxBuffer, Transaction) {
20
20
  }
21
21
  }
22
22
 
23
- function getWrappedSegwitRedeemScript({ publicKey, address, context = '' }) {
24
- const p2wpkh = payments.p2wpkh({ pubkey: publicKey })
25
- const p2sh = payments.p2sh({ redeem: p2wpkh })
23
+ function getWrappedSegwitRedeemScript({ publicKey, address, network, context = '' }) {
24
+ const p2wpkh = payments.p2wpkh({ pubkey: publicKey, network })
25
+ const p2sh = payments.p2sh({ redeem: p2wpkh, network })
26
26
 
27
27
  if (address !== p2sh.address) {
28
28
  throw new Error(`Expected P2SH script to be a nested p2wpkh${context ? ' for ' + context : ''}`)
@@ -105,6 +105,7 @@ function createPsbtInput({
105
105
  psbtInput.redeemScript = getWrappedSegwitRedeemScript({
106
106
  publicKey,
107
107
  address: input.address,
108
+ network: asset.coinInfo.toBitcoinJS(),
108
109
  context: `input address ${input.address}`,
109
110
  })
110
111
  }
@@ -170,6 +171,7 @@ function createPsbtOutput({ address, amount, asset, addressPathsMap, purposeXPub
170
171
  psbtOutput.redeemScript = getWrappedSegwitRedeemScript({
171
172
  publicKey,
172
173
  address,
174
+ network: asset.coinInfo.toBitcoinJS(),
173
175
  context: `output address ${address}`,
174
176
  })
175
177
  }
@@ -669,7 +669,26 @@ export class BitcoinMonitorScanner {
669
669
  // Keep new utxos when they intersect with the stored utxos.
670
670
  utxoCol = utxoCol.union(currentStoredUtxos).difference(utxosToRemoveCol)
671
671
 
672
- for (const tx of Object.values(unconfirmedTxsToCheck)) {
672
+ const pendingDropCandidates = Object.values(unconfirmedTxsToCheck)
673
+ const verificationResults = await Promise.all(
674
+ pendingDropCandidates.map(async (tx) => {
675
+ try {
676
+ const txStatus = await insightClient.fetchTx(tx.txId)
677
+ return { tx, shouldDrop: !txStatus }
678
+ } catch (err) {
679
+ console.log(
680
+ `${assetName}: failed to verify pending tx ${tx.txId} before drop check: ${
681
+ err?.message || 'unknown'
682
+ }`
683
+ )
684
+ return { tx, shouldDrop: false }
685
+ }
686
+ })
687
+ )
688
+
689
+ for (const { tx, shouldDrop } of verificationResults) {
690
+ if (!shouldDrop) continue
691
+
673
692
  existingTxs.push({ ...tx, dropped: true }) // TODO: this will decrease the chain index, it shouldn't be an issue considering the gap limit
674
693
  utxoCol = utxoCol.difference(utxoCol.getTxIdUtxos(tx.txId))
675
694
  const utxosToAdd = []
@@ -64,8 +64,9 @@ export function createSignWithWallet({
64
64
  // P2WPKH. Exodus doesn't use P2SH addresses so we should only ever be
65
65
  // signing a P2SH input if we are importing a private key
66
66
  // BIP143: As a default policy, only compressed public keys are accepted in P2WPKH and P2WSH
67
- const p2wpkh = payments.p2wpkh({ pubkey: publicKey })
68
- const p2sh = payments.p2sh({ redeem: p2wpkh })
67
+ const network = coinInfo.toBitcoinJS()
68
+ const p2wpkh = payments.p2wpkh({ pubkey: publicKey, network })
69
+ const p2sh = payments.p2sh({ redeem: p2wpkh, network })
69
70
  if (address === p2sh.address) {
70
71
  // Set the redeem script in the psbt in case it's missing.
71
72
  if (!Buffer.isBuffer(input.redeemScript)) {