@exodus/bitcoin-api 2.6.5 → 2.6.6

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.6.5",
3
+ "version": "2.6.6",
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": "c8877a87f29d0c4c27b18937a9ec57c81be223dd"
46
+ "gitHead": "b2ed2bffe712facdd412df1a0ebc6a8ac92c4d1c"
47
47
  }
@@ -57,12 +57,11 @@ export default class InsightAPIClient {
57
57
  return !!peerStatus.connected
58
58
  }
59
59
 
60
- /*
61
- async fetchBalance (address) {
62
- const addrData = await this.fetchAddress(address)
63
- return (addrData.balanceSat + addrData.unconfirmedBalanceSat) | 0
60
+ async fetchBalance(address) {
61
+ const encodedAddress = encodeURIComponent(address)
62
+ const url = urlJoin(this._baseURL, `/balance/${encodedAddress}`)
63
+ return fetchJson(url)
64
64
  }
65
- */
66
65
 
67
66
  async fetchBlockHeight() {
68
67
  const url = urlJoin(this._baseURL, '/status')
@@ -505,8 +505,8 @@ export class BitcoinMonitorScanner {
505
505
  let utxoCol = UtxoCollection.fromArray(utxos, { currency })
506
506
 
507
507
  const utxosToRemoveCol = UtxoCollection.fromArray(utxosToRemove, { currency })
508
- // if something else can update currentStoredUtxos in the meantime, we probably need to grab it from state again
509
- utxoCol = currentStoredUtxos.union(utxoCol).difference(utxosToRemoveCol)
508
+ // Keep new utxos when they intersect with the stored utxos.
509
+ utxoCol = utxoCol.union(currentStoredUtxos).difference(utxosToRemoveCol)
510
510
 
511
511
  for (let tx of Object.values(unconfirmedTxsToCheck)) {
512
512
  existingTxs.push({ ...tx, dropped: true }) // TODO: this will decrease the chain index, it shouldn't be an issue considering the gap limit