@exodus/balances 13.5.2 → 13.5.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,12 @@
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
+ ## [13.5.3](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@13.5.2...@exodus/balances@13.5.3) (2025-01-06)
7
+
8
+ ### Bug Fixes
9
+
10
+ - fix: filter by available asset names in balances (#10962)
11
+
6
12
  ## [13.5.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@13.5.1...@exodus/balances@13.5.2) (2025-01-03)
7
13
 
8
14
  ### Bug Fixes
package/module/index.js CHANGED
@@ -24,6 +24,7 @@ class Balances {
24
24
  #logger
25
25
  #assetsModule
26
26
  #availableAssetNamesAtom
27
+ #availableAssetNames = []
27
28
  #balanceFieldsConfig
28
29
  #balanceFields
29
30
  #walletAccounts = [] // string[]
@@ -84,7 +85,7 @@ class Balances {
84
85
  this.#setWalletAccounts = swallowErrors(this.#setWalletAccounts)
85
86
  }
86
87
 
87
- load = () => {
88
+ load = async () => {
88
89
  if (this.#loaded) return
89
90
  this.#loaded = true
90
91
 
@@ -103,10 +104,13 @@ class Balances {
103
104
  )
104
105
  ),
105
106
  getChanges(this.#availableAssetNamesAtom).observe(({ previous = [], current }) => {
107
+ this.#availableAssetNames = current
106
108
  const added = difference(current, previous)
107
109
  if (added.length > 0) this.#onAssetsChanged(added)
108
110
  })
109
111
  )
112
+
113
+ this.#availableAssetNames = await this.#availableAssetNamesAtom.get()
110
114
  }
111
115
 
112
116
  #getAsset = (assetName) => this.#assetsModule.getAsset(assetName)
@@ -228,7 +232,9 @@ class Balances {
228
232
  this.#recompute()
229
233
  }
230
234
 
231
- #isSupportedAsset = (assetName) => !this.#getAsset(assetName).isCombined
235
+ #isSupportedAsset = (assetName) =>
236
+ this.#availableAssetNames.includes(assetName) && !this.#getAsset(assetName).isCombined
237
+
232
238
  #getSupportedAssetNames = () => Object.keys(this.#getAssets()).filter(this.#isSupportedAsset)
233
239
 
234
240
  #getRelatedAssetNames = (assetName) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/balances",
3
- "version": "13.5.2",
3
+ "version": "13.5.3",
4
4
  "description": "Tracks crypto balances across enabled wallet accounts.",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "license": "MIT",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "2b30d69ddf8f4d0ebd3bcc4d4280d3ea12906673"
68
+ "gitHead": "552dad03015b2b38c40cdf19662b3d26f0bc788e"
69
69
  }