@exodus/fiat-balances 13.5.1 → 13.5.3
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 +12 -0
- package/module/fiat-balances.js +2 -1
- package/package.json +5 -5
- package/redux/index.js +18 -21
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
|
+
## [13.5.3](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@13.5.2...@exodus/fiat-balances@13.5.3) (2025-07-01)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- fix(fiat-balances): calculate fiat balances only when rates are valid (#13075)
|
|
11
|
+
|
|
12
|
+
## [13.5.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@13.5.1...@exodus/fiat-balances@13.5.2) (2025-06-11)
|
|
13
|
+
|
|
14
|
+
### Performance
|
|
15
|
+
|
|
16
|
+
- perf: merge fiat balances in reducer (#12879)
|
|
17
|
+
|
|
6
18
|
## [13.5.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@13.5.0...@exodus/fiat-balances@13.5.1) (2025-06-11)
|
|
7
19
|
|
|
8
20
|
### Performance
|
package/module/fiat-balances.js
CHANGED
|
@@ -75,7 +75,8 @@ class FiatBalances {
|
|
|
75
75
|
this.#cachedRates &&
|
|
76
76
|
this.#fiatCurrency &&
|
|
77
77
|
this.#latestAssetBalances &&
|
|
78
|
-
this.#cachedRates[this.#fiatCurrency]
|
|
78
|
+
this.#cachedRates[this.#fiatCurrency] &&
|
|
79
|
+
!Object.values(this.#cachedRates[this.#fiatCurrency]).every(({ invalid }) => invalid)
|
|
79
80
|
)
|
|
80
81
|
}
|
|
81
82
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/fiat-balances",
|
|
3
|
-
"version": "13.5.
|
|
3
|
+
"version": "13.5.3",
|
|
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": "MIT",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"@exodus/assets-feature": "^8.1.2",
|
|
50
50
|
"@exodus/available-assets": "^8.7.0",
|
|
51
51
|
"@exodus/balances": "^13.9.1",
|
|
52
|
-
"@exodus/blockchain-metadata": "^15.
|
|
52
|
+
"@exodus/blockchain-metadata": "^15.12.0",
|
|
53
53
|
"@exodus/combined-assets-meta": "^3.3.2",
|
|
54
|
-
"@exodus/enabled-assets": "^10.10.
|
|
54
|
+
"@exodus/enabled-assets": "^10.10.1",
|
|
55
55
|
"@exodus/favorite-assets": "^2.6.0",
|
|
56
56
|
"@exodus/fee-data-monitors": "^5.0.4",
|
|
57
|
-
"@exodus/models": "^12.
|
|
57
|
+
"@exodus/models": "^12.14.0",
|
|
58
58
|
"@exodus/rates-monitor": "^4.14.3",
|
|
59
59
|
"@exodus/redux-dependency-injection": "^4.1.1",
|
|
60
60
|
"@exodus/solana-meta": "^2.0.0",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "4245c97f8b6281925b9c01376ddba13706d114eb"
|
|
70
70
|
}
|
package/redux/index.js
CHANGED
|
@@ -1,32 +1,29 @@
|
|
|
1
1
|
import id from './id.js'
|
|
2
2
|
import initialState from './initial-state.js'
|
|
3
3
|
import createSelectorDefinitions from './selectors/index.js'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const {
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
balances,
|
|
21
|
-
byType
|
|
22
|
-
)
|
|
4
|
+
|
|
5
|
+
const mergeChanges = (balances, changes) => {
|
|
6
|
+
const result = { ...balances }
|
|
7
|
+
|
|
8
|
+
for (const key in changes) {
|
|
9
|
+
const sourceValue = changes[key]
|
|
10
|
+
|
|
11
|
+
if (sourceValue && typeof sourceValue === 'object' && sourceValue.constructor === Object) {
|
|
12
|
+
result[key] = mergeChanges(result[key] || {}, sourceValue)
|
|
13
|
+
} else {
|
|
14
|
+
result[key] = sourceValue
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return result
|
|
19
|
+
}
|
|
23
20
|
|
|
24
21
|
const prepareData = ({ state, payload }) => {
|
|
25
22
|
const { totals, byWalletAccount, ...rest } = payload
|
|
26
23
|
return {
|
|
27
|
-
...
|
|
24
|
+
...mergeChanges(state.data, rest),
|
|
28
25
|
totals,
|
|
29
|
-
byWalletAccount:
|
|
26
|
+
byWalletAccount: mergeChanges(state.data.byWalletAccount, byWalletAccount),
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
29
|
|