@exodus/bitcoin-api 4.14.2 → 4.14.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/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
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.14.3](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@4.14.2...@exodus/bitcoin-api@4.14.3) (2026-04-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+
12
+ * fix(bitcoin-api): anchor isHex regex to correctly validate hex strings (#7774)
13
+
14
+ * fix(bitcoin-api): fix assert call that failed to validate address (#7772)
15
+
16
+ * fix(bitcoin-api): remove yieldToUI from BitcoinMonitorScanner (#7773)
17
+
18
+
19
+
6
20
  ## [4.14.2](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@4.14.1...@exodus/bitcoin-api@4.14.2) (2026-04-04)
7
21
 
8
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bitcoin-api",
3
- "version": "4.14.2",
3
+ "version": "4.14.3",
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",
@@ -63,5 +63,5 @@
63
63
  "type": "git",
64
64
  "url": "git+https://github.com/ExodusMovement/assets.git"
65
65
  },
66
- "gitHead": "0e21e32b5a5ef1bccabd562609a09a027188984b"
66
+ "gitHead": "166b906440f92ef09d2f2563fec9d9a365a81015"
67
67
  }
@@ -6,7 +6,7 @@ import assert from 'minimalistic-assert'
6
6
  import { resolveExtraFeeOfTx } from '../unconfirmed-ancestor-data.js'
7
7
  import { isUtxoConfirmed } from '../utxos-utils.js'
8
8
 
9
- export const isHex = (s) => typeof s === 'string' && /[\da-f]*/.test(s.toLowerCase())
9
+ export const isHex = (s) => typeof s === 'string' && /^[\da-f]+$/.test(s.toLowerCase())
10
10
 
11
11
  export function getExtraFee({ asset, inputs, feePerKB, unconfirmedTxAncestor }) {
12
12
  let extraFee = 0
@@ -30,7 +30,7 @@ export const scriptClassifierFactory = ({ addressApi }) => {
30
30
  const classifyAddress = memoizeLruCache(
31
31
  ({ assetName, address }) => {
32
32
  assert(assetName, 'assetName is required')
33
- assert(assetName, address, 'address is required')
33
+ assert(address, 'address is required')
34
34
  if (addressApi.isP2PKH(address)) return P2PKH
35
35
  if (addressApi.isP2SH(address)) return P2SH
36
36
  if (addressApi.isP2WPKH && addressApi.isP2WPKH(address)) return P2WPKH
package/src/move-funds.js CHANGED
@@ -66,6 +66,7 @@ export const moveFundsFactory = ({
66
66
  signTx,
67
67
  address,
68
68
  getAddressesFromPrivateKey,
69
+ assetClientInterface,
69
70
  shouldExcludeVoutUtxo = () => false,
70
71
  }) => {
71
72
  assert(asset, 'asset is required')
@@ -74,6 +75,7 @@ export const moveFundsFactory = ({
74
75
  assert(address, 'address is required')
75
76
  assert(signTx, 'signTx is required')
76
77
  assert(getAddressesFromPrivateKey, 'getAddressesFromPrivateKey is required')
78
+ assert(assetClientInterface, 'assetClientInterface is required')
77
79
  assert(typeof shouldExcludeVoutUtxo === 'function', 'shouldExcludeVoutUtxo must be a function')
78
80
 
79
81
  async function prepareSendFundsTx({
@@ -81,13 +83,11 @@ export const moveFundsFactory = ({
81
83
  walletAccount,
82
84
  input,
83
85
  toAddress,
84
- assetClientInterface,
85
86
  MoveFundsError,
86
87
  }) {
87
88
  assert(asset.name === assetName, `expected asset ${asset.name} but got assetName ${assetName}`)
88
89
  assert(walletAccount, 'walletAccount is required')
89
90
  assert(toAddress, 'toAddress is required')
90
- assert(assetClientInterface, 'assetClientInterface is required')
91
91
  assert(MoveFundsError, 'MoveFundsError is required') // should we move MoveFundsError to asset libs?
92
92
 
93
93
  const formatProps = {
@@ -20,7 +20,6 @@ export class BitcoinMonitorScanner {
20
20
  #assetClientInterface
21
21
  #txFetchLimitResolver
22
22
  #shouldExcludeVoutUtxo
23
- #yieldToUI
24
23
  #extraChainIndexEnabled
25
24
  #extraChainIndex
26
25
  #gapLimit
@@ -29,7 +28,6 @@ export class BitcoinMonitorScanner {
29
28
  asset,
30
29
  assetClientInterface,
31
30
  insightClient,
32
- yieldToUI = () => {},
33
31
  shouldExcludeVoutUtxo = () => false,
34
32
  txFetchLimitResolver = ({ refresh }) => (refresh ? 50 : 10),
35
33
  extraChainIndexEnabled,
@@ -40,7 +38,6 @@ export class BitcoinMonitorScanner {
40
38
  assert(asset, 'asset is required!')
41
39
  assert(assetClientInterface, 'assetClientInterface is required!')
42
40
  assert(insightClient, 'insightClient is required')
43
- assert(typeof yieldToUI === 'function', 'yieldToUI must be a function')
44
41
  assert(typeof txFetchLimitResolver === 'function', 'txFetchLimitResolver must be a function')
45
42
  assert(typeof shouldExcludeVoutUtxo === 'function', 'shouldExcludeVoutUtxo must be a function')
46
43
  assert(typeof gapLimit === 'number', 'gapLimit must be a number')
@@ -65,7 +62,6 @@ export class BitcoinMonitorScanner {
65
62
  async rescanBlockchainInsight({ walletAccount, refresh }) {
66
63
  const asset = this.#asset
67
64
  const assetClientInterface = this.#assetClientInterface
68
- const yieldToUI = this.#yieldToUI
69
65
  const insightClient = this.#insightClient
70
66
  const txFetchLimit = this.#txFetchLimitResolver({ assetName: asset.name, refresh })
71
67
  const assetName = asset.name
@@ -366,9 +362,6 @@ export class BitcoinMonitorScanner {
366
362
  return addressIndex + resolvedGapLimit
367
363
  })
368
364
  })
369
-
370
- // Safety check. Slow down if after 100 iterations txs are still being fetched.
371
- if (fetchCount > 100) await yieldToUI(1000)
372
365
  }
373
366
 
374
367
  allTxs = orderTxs(allTxs)
@@ -50,7 +50,7 @@ export class Monitor extends BaseMonitor {
50
50
  super({ asset, interval, assetClientInterface, logger, runner })
51
51
  assert(insightClient, 'insightClient is required!')
52
52
  assert(apiUrl, 'apiUrl is required')
53
- assert(yieldToUI, 'yieldToUI is required!')
53
+ assert(typeof yieldToUI === 'function', 'yieldToUI must be a function')
54
54
  this.#wsInterval = wsInterval
55
55
  this.#ws = null
56
56
  this.#apiUrl = apiUrl
@@ -69,7 +69,6 @@ export class Monitor extends BaseMonitor {
69
69
  asset,
70
70
  assetClientInterface,
71
71
  insightClient,
72
- yieldToUI,
73
72
  ...extraScannerParams,
74
73
  })
75
74