@exodus/fiat-balances 10.3.0 → 10.4.1

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
+ ## [10.4.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@10.4.0...@exodus/fiat-balances@10.4.1) (2024-03-08)
7
+
8
+ ### Bug Fixes
9
+
10
+ - re-calc fiat balances ([#6037](https://github.com/ExodusMovement/exodus-hydra/issues/6037)) ([846b255](https://github.com/ExodusMovement/exodus-hydra/commit/846b25581c07928a2d4775b0f2e8fdd674b45981))
11
+
12
+ ## [10.4.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@10.3.0...@exodus/fiat-balances@10.4.0) (2024-02-28)
13
+
14
+ ### Features
15
+
16
+ - add fiatBalances default config ([#5906](https://github.com/ExodusMovement/exodus-hydra/issues/5906)) ([ffa55e4](https://github.com/ExodusMovement/exodus-hydra/commit/ffa55e4abade224643266febf60fc0ce248318a6))
17
+
6
18
  ## [10.3.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@10.2.0...@exodus/fiat-balances@10.3.0) (2024-01-17)
7
19
 
8
20
  ### Features
package/index.js CHANGED
@@ -7,19 +7,29 @@ import {
7
7
  import fiatBalancesPluginDefinition from './plugin'
8
8
  import trackNonDustAssetsNamesPluginDefinition from './plugin/track-non-dust-asset-names'
9
9
 
10
+ const DEFAULT_BALANCE_FIELDS = ['balance']
11
+
10
12
  /**
11
13
  * @param optimistic {boolean}
14
+ * @param balanceFields {string[]}
12
15
  * @param nonDustAssets {object}
13
16
  * @param nonDustAssets.balanceThresholdsUsd {object}
14
17
  * @param nonDustAssets.balanceThresholdByChainUsd {object}
15
18
  * @param nonDustAssets.defaultBalanceThresholdUsd {import('@exodus/fiat-currencies').Unit}
16
19
  */
17
20
 
18
- const fiatBalances = ({ optimistic, nonDustAssets }) => ({
21
+ const fiatBalances = ({
22
+ optimistic,
23
+ nonDustAssets,
24
+ balanceFields = DEFAULT_BALANCE_FIELDS,
25
+ } = {}) => ({
19
26
  id: 'fiatBalances',
20
27
  definitions: [
21
28
  {
22
29
  definition: fiatBalancesDefinition,
30
+ config: {
31
+ balanceFields,
32
+ },
23
33
  },
24
34
  { definition: fiatBalancesAtomDefinition },
25
35
  { definition: fiatBalancesPluginDefinition },
@@ -142,6 +142,7 @@ class FiatBalances extends ExodusModule {
142
142
 
143
143
  #setBalances = ({ balances, changes }) => {
144
144
  const needsRecompute =
145
+ !this.#balances.byWalletAccount ||
145
146
  !changes ||
146
147
  // adding/removing walletAccounts is fairly rare, recompute to reduce code complexity
147
148
  (this.#latestAssetBalances && !areKeysSame(this.#latestAssetBalances, balances))
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@exodus/fiat-balances",
3
- "version": "10.3.0",
3
+ "version": "10.4.1",
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",
7
7
  "scripts": {
8
- "test": "jest",
9
- "lint": "eslint . --ignore-path ../../.gitignore",
8
+ "test": "run -T jest",
9
+ "lint": "run -T eslint . --ignore-path ../../.gitignore",
10
10
  "lint:fix": "yarn lint --fix"
11
11
  },
12
12
  "main": "index.js",
@@ -42,22 +42,20 @@
42
42
  "devDependencies": {
43
43
  "@exodus/assets": "^9.1.0",
44
44
  "@exodus/assets-base": "^8.1.17",
45
- "@exodus/assets-feature": "^4.1.0",
45
+ "@exodus/assets-feature": "^4.1.2",
46
46
  "@exodus/available-assets": "^8.0.0",
47
47
  "@exodus/balances": "^12.6.1",
48
48
  "@exodus/blockchain-metadata": "*",
49
- "@exodus/enabled-assets": "^9.3.0",
50
- "@exodus/favorite-assets": "^2.2.0",
49
+ "@exodus/enabled-assets": "^10.1.1",
50
+ "@exodus/favorite-assets": "^2.3.0",
51
51
  "@exodus/models": "^8.9.0",
52
52
  "@exodus/rates-monitor": "^4.1.1",
53
53
  "@exodus/redux-dependency-injection": "^3.0.0",
54
54
  "@exodus/solana-meta": "^1.0.4",
55
55
  "@exodus/storage-memory": "^2.1.1",
56
56
  "@exodus/wallet-accounts": "*",
57
- "eslint": "^8.44.0",
58
57
  "events": "^3.3.0",
59
- "jest": "^29.1.2",
60
58
  "redux": "^4.2.1"
61
59
  },
62
- "gitHead": "4e30904221e2f4bbe5d0ca90164373f79b8cac63"
60
+ "gitHead": "21b1f96d9703df1a94a47d30a9b56bfb20bde06c"
63
61
  }
@@ -16,7 +16,7 @@ import optimisticByWalletAccountFieldSelector from './optimistic-by-wallet-accou
16
16
  import optimisticTotalBalanceSelector from './optimistic-total-balance'
17
17
  import createSortAssetsSelectorFactorySelector from './create-sort-assets-selector-factory'
18
18
  import createAssetsWithBalanceSelector from './create-assets-with-balance'
19
- import sortedAssetsWithoutParentCombinedInActiveAccountSelector from './sorted-assets-without-parent-combined'
19
+ import sortedAssetsWithoutParentCombinedInActiveAccountSelector from './sorted-assets-without-parent-combined-in-active-account'
20
20
  import getFormatFiatSelector from './get-format-fiat'
21
21
  import sortedAssetsWithBalanceInActiveAccountSelector from './sorted-assets-with-balance-in-active-account'
22
22
  import sortedAssetsWithTotalBalanceSelector from './sorted-assets-with-total-balance'