@exodus/fiat-balances 12.1.3 → 12.2.0

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.2.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@12.1.4...@exodus/fiat-balances@12.2.0) (2024-09-20)
7
+
8
+ ### Features
9
+
10
+ - use formatting v7 ([#9321](https://github.com/ExodusMovement/exodus-hydra/issues/9321)) ([83b1d31](https://github.com/ExodusMovement/exodus-hydra/commit/83b1d311204adcf03e33377f19ff980c8e8cceda))
11
+
12
+ ## [12.1.4](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@12.1.3...@exodus/fiat-balances@12.1.4) (2024-09-16)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **fiat-balances:** adjust optimistic balances with fallback selector ([#9298](https://github.com/ExodusMovement/exodus-hydra/issues/9298)) ([c67bc9e](https://github.com/ExodusMovement/exodus-hydra/commit/c67bc9e71be3002d81e09c28f4b4daa9425ebbc7))
17
+
6
18
  ## [12.1.3](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@12.1.2...@exodus/fiat-balances@12.1.3) (2024-09-09)
7
19
 
8
20
  **Note:** Version bump only for package @exodus/fiat-balances
@@ -1,6 +1,6 @@
1
1
  import { set } from '@exodus/basic-utils'
2
2
  import { isNumberUnit } from '@exodus/currency'
3
- import ExodusModule from '@exodus/module' // eslint-disable-line import/no-deprecated
3
+ import ExodusModule from '@exodus/module'
4
4
  import { cloneDeepWith, isEqual } from 'lodash'
5
5
  import fiatCurrencies from '@exodus/fiat-currencies'
6
6
  import { combine } from '@exodus/atoms'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/fiat-balances",
3
- "version": "12.1.3",
3
+ "version": "12.2.0",
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",
@@ -36,7 +36,7 @@
36
36
  "@exodus/basic-utils": "^3.0.1",
37
37
  "@exodus/currency": "^5.0.2",
38
38
  "@exodus/fiat-currencies": "^1.1.0",
39
- "@exodus/formatting": "^6.0.0",
39
+ "@exodus/formatting": "^8.0.0",
40
40
  "@exodus/module": "^1.1.0",
41
41
  "@exodus/typeforce": "^1.18.1",
42
42
  "lodash": "^4.17.21",
@@ -48,10 +48,10 @@
48
48
  "@exodus/assets-base": "^8.1.17",
49
49
  "@exodus/assets-feature": "^5.11.3",
50
50
  "@exodus/available-assets": "^8.5.0",
51
- "@exodus/balances": "^13.3.1",
51
+ "@exodus/balances": "^13.3.2",
52
52
  "@exodus/blockchain-metadata": "^15.5.0",
53
53
  "@exodus/combined-assets-meta": "^1.3.0",
54
- "@exodus/enabled-assets": "^10.7.0",
54
+ "@exodus/enabled-assets": "^10.7.1",
55
55
  "@exodus/favorite-assets": "^2.4.3",
56
56
  "@exodus/fee-data-monitors": "^4.3.0",
57
57
  "@exodus/locale": "^2.2.2",
@@ -64,5 +64,5 @@
64
64
  "events": "^3.3.0",
65
65
  "redux": "^4.2.1"
66
66
  },
67
- "gitHead": "d64de7579b06afe91fbded3d1f7eb29950f82e5a"
67
+ "gitHead": "9f46287a2df974301fb838845f271dd2ee9adcb3"
68
68
  }
@@ -15,7 +15,7 @@ const selectorFactory =
15
15
  const getExtraProps = (asset) => {
16
16
  const fiatValue = fiatBalances?.[asset.name] || fiatCurrency.ZERO
17
17
  return {
18
- balance: balances[asset] || asset.currency.ZERO,
18
+ balance: balances?.[asset] || asset.currency.ZERO,
19
19
  fiatValue,
20
20
  formattedFiatValue: formatFiat(fiatValue, { adaptiveFraction: true }),
21
21
  }
@@ -1,5 +1,8 @@
1
1
  import sortAssetsSelectorFactoryCreator from '../helpers/sort-assets-selector-factory-creator'
2
2
 
3
+ const noBalances = Object.freeze(Object.create(null))
4
+ const noBalancesSelector = () => () => noBalances
5
+
3
6
  const createSelectorFactory =
4
7
  ({ ignoreMarketCapAssets }) =>
5
8
  (
@@ -11,7 +14,9 @@ const createSelectorFactory =
11
14
  (assetsListSelector) =>
12
15
  sortAssetsSelectorFactoryCreator({
13
16
  fiatBalancesByAssetSourceSelector,
14
- getAccountAssetsBalanceSelector,
17
+ getAccountAssetsBalanceSelector: getAccountAssetsBalanceSelector.isFallback
18
+ ? noBalancesSelector
19
+ : getAccountAssetsBalanceSelector,
15
20
  ratesSelector,
16
21
  getIsFavoriteAssetSelector,
17
22
  ignoreMarketCapAssets,