@exodus/fiat-balances 12.1.0 → 12.1.2

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,18 @@
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
+ ## [12.1.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@12.1.1...@exodus/fiat-balances@12.1.2) (2024-08-26)
7
+
8
+ ### Performance Improvements
9
+
10
+ - don't sort arrays without need ([#3183](https://github.com/ExodusMovement/exodus-hydra/pull/8665) ([ac79f66](https://github.com/ExodusMovement/exodus-hydra/commit/ac79f662e48c3e4262f4aed33d72ef77d485f6d4))
11
+
12
+ ## [12.1.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@12.1.0...@exodus/fiat-balances@12.1.1) (2024-08-23)
13
+
14
+ ### Bug Fixes
15
+
16
+ - no combinedAssets case ([#8653](https://github.com/ExodusMovement/exodus-hydra/issues/8653)) ([82fb4ed](https://github.com/ExodusMovement/exodus-hydra/commit/82fb4ed31147ee28994350204dab0a60eea5e296))
17
+
6
18
  ## [12.1.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@12.0.0...@exodus/fiat-balances@12.1.0) (2024-08-23)
7
19
 
8
20
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/fiat-balances",
3
- "version": "12.1.0",
3
+ "version": "12.1.2",
4
4
  "description": "Track asset and portfolio fiat balances based on changes in crypto balances and the user's preferred fiat currency",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "license": "UNLICENSED",
@@ -64,5 +64,5 @@
64
64
  "events": "^3.3.0",
65
65
  "redux": "^4.2.1"
66
66
  },
67
- "gitHead": "8b45e5b5e807c1afd9c32173199d3a2733c591e8"
67
+ "gitHead": "7bf9f116fe9de95dd02bdfe9a2340e0778453dd9"
68
68
  }
@@ -1,6 +1,5 @@
1
1
  import { flattenToPaths, filterAsync } from '@exodus/basic-utils'
2
2
  import fiatCurrencies from '@exodus/fiat-currencies'
3
- import { isEqual } from 'lodash'
4
3
 
5
4
  const { USD } = fiatCurrencies
6
5
 
@@ -40,8 +39,13 @@ const createTrackNonDustAssetNamesPlugin = ({
40
39
  const nonDisableableAssetNamesSet = new Set(aboveThreshold.map(({ assetName }) => assetName))
41
40
 
42
41
  const before = [...(await nonDustBalanceAssetNamesAtom.get())]
43
- const after = [...nonDisableableAssetNamesSet]
44
- if (!isEqual(before.sort(), after.sort())) await nonDustBalanceAssetNamesAtom.set(after)
42
+ if (
43
+ nonDisableableAssetNamesSet.size !== before.length ||
44
+ before.some((x) => !nonDisableableAssetNamesSet.has(x))
45
+ ) {
46
+ const after = [...nonDisableableAssetNamesSet].sort()
47
+ await nonDustBalanceAssetNamesAtom.set(after)
48
+ }
45
49
  }
46
50
 
47
51
  let unobserveFiatBalancesAtom
@@ -41,7 +41,7 @@ const sortAssetsSelectorFactoryCreator = ({
41
41
  const assetsMap = keyBy(assetsListWithSingleCombined, 'name')
42
42
  const assetsWithMetaData = assetsListWithSingleCombined.map((asset) => {
43
43
  const cap = isMultiNetworkAsset(asset)
44
- ? rates[asset.combinedAssets[0].ticker]?.cap
44
+ ? rates[asset.combinedAssets[0]?.ticker]?.cap
45
45
  : rates[asset.ticker]?.cap
46
46
 
47
47
  const getAssetBalanceNumber = (assetName) => balances?.[assetName]?.toDefaultNumber() ?? 0