@exodus/fiat-balances 6.3.1 → 6.3.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,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
+ ## [6.3.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@6.3.0...@exodus/fiat-balances@6.3.2) (2023-08-08)
7
+
8
+ ### Performance Improvements
9
+
10
+ - don't flush if changes in fiat values are the same ([#3183](https://github.com/ExodusMovement/exodus-hydra/issues/3183)) ([a65383e](https://github.com/ExodusMovement/exodus-hydra/commit/a65383e0663584b9df1eba94ca429865506f2d63))
11
+
6
12
  ## [6.3.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@6.3.0...@exodus/fiat-balances@6.3.1) (2023-07-21)
7
13
 
8
14
  **Note:** Version bump only for package @exodus/fiat-balances
@@ -151,6 +151,7 @@ class FiatBalances extends ExodusModule {
151
151
 
152
152
  // TODO set changes to fiatBalancesAtom as well
153
153
  const { byWalletAccount, byAssetSource, byBaseAssetSource } = this.#balances
154
+ let needsFlush = false
154
155
  Object.entries(changes).forEach(([walletAccount, walletAccountBalancesChanges]) => {
155
156
  const walletAccountBalances = byWalletAccount[walletAccount]
156
157
  Object.entries(walletAccountBalancesChanges).forEach(
@@ -165,6 +166,9 @@ class FiatBalances extends ExodusModule {
165
166
 
166
167
  const fromFiatValue = this.#convertToFiat({ assetName, value: from })
167
168
  const toFiatValue = this.#convertToFiat({ assetName, value: to })
169
+
170
+ if (fromFiatValue.equals(toFiatValue)) return
171
+ needsFlush = true
168
172
  walletAccountBalances[field] = walletAccountBalances[field]
169
173
  .sub(fromFiatValue)
170
174
  .add(toFiatValue)
@@ -196,6 +200,8 @@ class FiatBalances extends ExodusModule {
196
200
  )
197
201
  })
198
202
 
203
+ if (!needsFlush) return
204
+
199
205
  this.#recomputeWalletTotals()
200
206
  }
201
207
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/fiat-balances",
3
- "version": "6.3.1",
3
+ "version": "6.3.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",
@@ -33,11 +33,11 @@
33
33
  "lodash": "^4.17.21"
34
34
  },
35
35
  "devDependencies": {
36
- "@exodus/atoms": "^5.2.3",
37
- "@exodus/balances": "^7.0.0",
36
+ "@exodus/atoms": "^5.4.0",
37
+ "@exodus/balances": "^8.0.0",
38
38
  "@exodus/basic-utils": "^2.0.0",
39
39
  "@exodus/blockchain-metadata": "*",
40
- "@exodus/enabled-assets": "^6.0.2",
40
+ "@exodus/enabled-assets": "^7.1.0",
41
41
  "@exodus/models": "^8.9.0",
42
42
  "@exodus/storage-memory": "^2.1.0",
43
43
  "@exodus/wallet-accounts": "*",
@@ -45,5 +45,5 @@
45
45
  "events": "^3.3.0",
46
46
  "jest": "^29.1.2"
47
47
  },
48
- "gitHead": "2408d9e51f2d1f145df0adb8ddeb7bf5970bba39"
48
+ "gitHead": "d50e3ff8f33c61526ddf540c0d4b9f4768c10dbc"
49
49
  }