@exodus/fiat-balances 13.5.3 → 13.6.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 +8 -0
- package/module/fiat-balances.js +7 -13
- package/package.json +6 -6
- package/report/index.js +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.6.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@13.5.3...@exodus/fiat-balances@13.6.0) (2025-07-10)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- feat: provide feeData to asset.api.getBalances (#13104)
|
|
11
|
+
|
|
12
|
+
- feat: update basic utils in balances (#13183)
|
|
13
|
+
|
|
6
14
|
## [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
15
|
|
|
8
16
|
### Bug Fixes
|
package/module/fiat-balances.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { set } from '@exodus/basic-utils'
|
|
1
|
+
import { cloneDeepWith, set } from '@exodus/basic-utils'
|
|
2
2
|
import { isNumberUnit } from '@exodus/currency'
|
|
3
3
|
import lodash from 'lodash'
|
|
4
4
|
import fiatCurrencies from '@exodus/fiat-currencies'
|
|
@@ -9,18 +9,12 @@ const { isEqual } = lodash
|
|
|
9
9
|
// not super efficient, so we're assuming small objects, like { [walletAccount]: xyz }
|
|
10
10
|
const areKeysSame = (a, b) => isEqual(Object.keys(a).sort(), Object.keys(b).sort())
|
|
11
11
|
|
|
12
|
-
export const cloneBalances = (balances) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
for (const key in balances) {
|
|
19
|
-
cloned[key] = cloneBalances(balances[key])
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return cloned
|
|
23
|
-
}
|
|
12
|
+
export const cloneBalances = (balances) =>
|
|
13
|
+
cloneDeepWith(balances, (value) => {
|
|
14
|
+
if (isNumberUnit(value)) {
|
|
15
|
+
return value
|
|
16
|
+
}
|
|
17
|
+
})
|
|
24
18
|
|
|
25
19
|
class FiatBalances {
|
|
26
20
|
#logger
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/fiat-balances",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.6.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": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@exodus/atoms": "^9.0.0",
|
|
38
|
-
"@exodus/basic-utils": "^3.0
|
|
38
|
+
"@exodus/basic-utils": "^4.3.0",
|
|
39
39
|
"@exodus/currency": "^5.0.2",
|
|
40
40
|
"@exodus/fiat-currencies": "^1.2.3",
|
|
41
41
|
"@exodus/formatting": "^9.0.0",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@exodus/assets": "^11.0.0",
|
|
48
48
|
"@exodus/assets-base": "^10.0.0",
|
|
49
|
-
"@exodus/assets-feature": "^8.1.
|
|
49
|
+
"@exodus/assets-feature": "^8.1.3",
|
|
50
50
|
"@exodus/available-assets": "^8.7.0",
|
|
51
|
-
"@exodus/balances": "^13.
|
|
51
|
+
"@exodus/balances": "^13.12.0",
|
|
52
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.2",
|
|
55
55
|
"@exodus/favorite-assets": "^2.6.0",
|
|
56
56
|
"@exodus/fee-data-monitors": "^5.0.4",
|
|
57
57
|
"@exodus/models": "^12.14.0",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "20a4bbabfa39c51c7e52e628fb5fa7a8ed54c72f"
|
|
70
70
|
}
|
package/report/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mapValues,
|
|
1
|
+
import { mapValues, pickBy, pickByArrayPaths } from '@exodus/basic-utils'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* sample report
|
|
@@ -21,8 +21,9 @@ const fiatBalancesReportDefinition = {
|
|
|
21
21
|
])
|
|
22
22
|
|
|
23
23
|
const softwareWalletAccountNames = Object.keys(pickBy(walletAccounts, (w) => w.isSoftware))
|
|
24
|
-
return mapValues(
|
|
25
|
-
|
|
24
|
+
return mapValues(
|
|
25
|
+
pickByArrayPaths(balances.byWalletAccount, softwareWalletAccountNames),
|
|
26
|
+
({ balance }) => balance.toDefaultString({ unit: true })
|
|
26
27
|
)
|
|
27
28
|
},
|
|
28
29
|
}),
|