@exodus/fiat-balances 6.3.1 → 7.0.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 +16 -0
- package/module/fiat-balances.js +6 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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
|
+
## [7.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@6.3.2...@exodus/fiat-balances@7.0.0) (2023-08-21)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
- balances.load (#3383)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- balances.load ([#3383](https://github.com/ExodusMovement/exodus-hydra/issues/3383)) ([754179f](https://github.com/ExodusMovement/exodus-hydra/commit/754179f65713afc19490240702aa0fee18047073))
|
|
15
|
+
|
|
16
|
+
## [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)
|
|
17
|
+
|
|
18
|
+
### Performance Improvements
|
|
19
|
+
|
|
20
|
+
- 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))
|
|
21
|
+
|
|
6
22
|
## [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
23
|
|
|
8
24
|
**Note:** Version bump only for package @exodus/fiat-balances
|
package/module/fiat-balances.js
CHANGED
|
@@ -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": "
|
|
3
|
+
"version": "7.0.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",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"lodash": "^4.17.21"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@exodus/atoms": "^5.
|
|
37
|
-
"@exodus/balances": "^
|
|
36
|
+
"@exodus/atoms": "^5.5.0",
|
|
37
|
+
"@exodus/balances": "^9.0.0",
|
|
38
38
|
"@exodus/basic-utils": "^2.0.0",
|
|
39
39
|
"@exodus/blockchain-metadata": "*",
|
|
40
|
-
"@exodus/enabled-assets": "^
|
|
40
|
+
"@exodus/enabled-assets": "^8.0.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": "
|
|
48
|
+
"gitHead": "6de4a6859547f6d1bbce9506cc6f32480d9c728b"
|
|
49
49
|
}
|