@exodus/fiat-balances 10.0.0 → 10.1.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,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
+ ## [10.1.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@10.0.0...@exodus/fiat-balances@10.1.0) (2023-12-14)
7
+
8
+ ### Features
9
+
10
+ - remove storing oldBalances in balances atoms ([#5073](https://github.com/ExodusMovement/exodus-hydra/issues/5073)) ([414db86](https://github.com/ExodusMovement/exodus-hydra/commit/414db866a86aaf3242e68698596af187da6927c3))
11
+
6
12
  ## [10.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@9.1.2...@exodus/fiat-balances@10.0.0) (2023-12-12)
7
13
 
8
14
  ### ⚠ BREAKING CHANGES
@@ -1,5 +1,6 @@
1
1
  import { createInMemoryAtom } from '@exodus/atoms'
2
2
 
3
+ // eslint-disable-next-line @exodus/hydra/in-memory-atom-default-value
3
4
  const createFiatBalancesAtom = () => createInMemoryAtom()
4
5
 
5
6
  export default createFiatBalancesAtom
@@ -1,5 +1,6 @@
1
1
  import { createInMemoryAtom } from '@exodus/atoms'
2
2
 
3
+ // eslint-disable-next-line @exodus/hydra/in-memory-atom-default-value
3
4
  const createOptimisticFiatBalancesAtom = () => createInMemoryAtom()
4
5
 
5
6
  export default createOptimisticFiatBalancesAtom
package/index.js CHANGED
@@ -20,7 +20,6 @@ const fiatBalances = ({ optimistic, nonDustAssets }) => ({
20
20
  definitions: [
21
21
  {
22
22
  definition: fiatBalancesDefinition,
23
- writesAtoms: ['fiatBalancesAtom'],
24
23
  },
25
24
  { definition: fiatBalancesAtomDefinition },
26
25
  { definition: fiatBalancesPluginDefinition },
@@ -46,7 +45,6 @@ const fiatBalances = ({ optimistic, nonDustAssets }) => ({
46
45
  interfaceId: 'fiatBalancesAtom',
47
46
  },
48
47
  ],
49
- writesAtoms: ['fiatBalancesAtom'],
50
48
  },
51
49
  ],
52
50
  })
@@ -140,13 +140,11 @@ class FiatBalances extends ExodusModule {
140
140
  this.#recomputeWalletTotals()
141
141
  }
142
142
 
143
- #setBalances = ({ balances, oldBalances, changes }) => {
143
+ #setBalances = ({ balances, changes }) => {
144
144
  const needsRecompute =
145
145
  !changes ||
146
- this.#latestAssetBalances !== oldBalances ||
147
146
  // adding/removing walletAccounts is fairly rare, recompute to reduce code complexity
148
- !oldBalances ||
149
- !areKeysSame(oldBalances, balances)
147
+ (this.#latestAssetBalances && !areKeysSame(this.#latestAssetBalances, balances))
150
148
 
151
149
  this.#latestAssetBalances = balances
152
150
  if (!this.#isReady()) return
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/fiat-balances",
3
- "version": "10.0.0",
3
+ "version": "10.1.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",
@@ -39,7 +39,7 @@
39
39
  "devDependencies": {
40
40
  "@exodus/assets": "^9.1.0",
41
41
  "@exodus/atoms": "^7.0.0",
42
- "@exodus/balances": "^12.0.0",
42
+ "@exodus/balances": "^12.1.0",
43
43
  "@exodus/basic-utils": "^2.0.0",
44
44
  "@exodus/blockchain-metadata": "*",
45
45
  "@exodus/enabled-assets": "^9.0.1",
@@ -53,5 +53,5 @@
53
53
  "jest": "^29.1.2",
54
54
  "redux": "^4.2.1"
55
55
  },
56
- "gitHead": "678623e0bd6eddc9d7615648878938a807cf3a33"
56
+ "gitHead": "b2cc53c628d9cdb2e4a25557f72b88ec05c75e14"
57
57
  }