@exodus/fiat-balances 10.7.0 → 10.8.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,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
|
+
## [10.8.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@10.7.1...@exodus/fiat-balances@10.8.0) (2024-05-13)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- make trustedUnverifiedTokens and removedTokens optional ([#6904](https://github.com/ExodusMovement/exodus-hydra/issues/6904)) ([f057013](https://github.com/ExodusMovement/exodus-hydra/commit/f057013e1c3ea4b4ba958a358a090d24398567ef))
|
|
11
|
+
|
|
12
|
+
## [10.7.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@10.7.0...@exodus/fiat-balances@10.7.1) (2024-05-03)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- export shared folder ([#6801](https://github.com/ExodusMovement/exodus-hydra/issues/6801)) ([69ff0fc](https://github.com/ExodusMovement/exodus-hydra/commit/69ff0fc3d55f1b8acb9f6d1c99a4823cd972d870))
|
|
17
|
+
|
|
6
18
|
## [10.7.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@10.6.0...@exodus/fiat-balances@10.7.0) (2024-05-02)
|
|
7
19
|
|
|
8
20
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/fiat-balances",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.8.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",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"redux",
|
|
16
16
|
"atoms",
|
|
17
17
|
"plugin",
|
|
18
|
+
"shared",
|
|
18
19
|
"README.md",
|
|
19
20
|
"CHANGELOG.md",
|
|
20
21
|
"!**/__tests__/**"
|
|
@@ -43,11 +44,11 @@
|
|
|
43
44
|
"@exodus/assets": "^9.1.0",
|
|
44
45
|
"@exodus/assets-base": "^8.1.17",
|
|
45
46
|
"@exodus/assets-feature": "^5.3.1",
|
|
46
|
-
"@exodus/available-assets": "^8.
|
|
47
|
+
"@exodus/available-assets": "^8.2.0",
|
|
47
48
|
"@exodus/balances": "^13.1.2",
|
|
48
49
|
"@exodus/blockchain-metadata": "*",
|
|
49
50
|
"@exodus/combined-assets-meta": "^1.3.0",
|
|
50
|
-
"@exodus/enabled-assets": "^10.3.
|
|
51
|
+
"@exodus/enabled-assets": "^10.3.1",
|
|
51
52
|
"@exodus/favorite-assets": "^2.4.1",
|
|
52
53
|
"@exodus/models": "^8.9.0",
|
|
53
54
|
"@exodus/rates-monitor": "^4.2.0",
|
|
@@ -58,5 +59,5 @@
|
|
|
58
59
|
"events": "^3.3.0",
|
|
59
60
|
"redux": "^4.2.1"
|
|
60
61
|
},
|
|
61
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "03fdaa6458628443d9d7904438c3d54e6704f1d4"
|
|
62
63
|
}
|
|
@@ -2,6 +2,7 @@ import { createSelector } from 'reselect'
|
|
|
2
2
|
import { isMultiNetworkAsset } from '../utils'
|
|
3
3
|
import { groupBy } from 'lodash'
|
|
4
4
|
|
|
5
|
+
const EMPTY = Object.freeze([])
|
|
5
6
|
const selectorFactory =
|
|
6
7
|
(getIsEnabledAssetSelector, getIsUnverifiedTokenSelector, removedTokensSelector) =>
|
|
7
8
|
({ assetsListSelector }) =>
|
|
@@ -10,7 +11,12 @@ const selectorFactory =
|
|
|
10
11
|
getIsEnabledAssetSelector,
|
|
11
12
|
removedTokensSelector,
|
|
12
13
|
getIsUnverifiedTokenSelector,
|
|
13
|
-
(
|
|
14
|
+
(
|
|
15
|
+
sortedAssetsWithBalance,
|
|
16
|
+
getIsAssetEnabled,
|
|
17
|
+
removedTokens = EMPTY,
|
|
18
|
+
getIsUnverifiedCustomToken
|
|
19
|
+
) => {
|
|
14
20
|
const assetsByNetwork = groupBy(sortedAssetsWithBalance, 'baseAsset.name')
|
|
15
21
|
|
|
16
22
|
return (
|
|
@@ -25,7 +31,9 @@ const selectorFactory =
|
|
|
25
31
|
assetsByNetwork[asset.baseAsset.name].some((asset) => getIsAssetEnabled(asset))
|
|
26
32
|
|
|
27
33
|
const unverifiedCustomTokenRule =
|
|
28
|
-
|
|
34
|
+
getIsUnverifiedCustomToken &&
|
|
35
|
+
getIsUnverifiedCustomToken(asset) &&
|
|
36
|
+
getIsSomeNetworkAssetEnabled()
|
|
29
37
|
|
|
30
38
|
const multiNetworkAssetRule =
|
|
31
39
|
isMultiNetworkAsset(asset) &&
|
|
@@ -62,8 +70,8 @@ const createEnabledAssetsWithBalanceSelectorDefinition = {
|
|
|
62
70
|
dependencies: [
|
|
63
71
|
//
|
|
64
72
|
{ module: 'enabledAssets', selector: 'getIsEnabled' },
|
|
65
|
-
{ module: 'trustedUnverifiedTokens', selector: 'getIsUnverified' },
|
|
66
|
-
{ module: 'removedTokens', selector: 'data' },
|
|
73
|
+
{ module: 'trustedUnverifiedTokens', selector: 'getIsUnverified', optional: true },
|
|
74
|
+
{ module: 'removedTokens', selector: 'data', optional: true },
|
|
67
75
|
],
|
|
68
76
|
}
|
|
69
77
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { conversionByRate } from '@exodus/currency'
|
|
2
|
+
|
|
3
|
+
export const getCreateConversion = (fiatCurrency, rates) => (asset) => {
|
|
4
|
+
let fiatRate
|
|
5
|
+
// HACK: Super hacky, terrible, the rates state object should have the prices split up by sub-objects per fiat
|
|
6
|
+
if (fiatCurrency.defaultUnit.unitName === 'USD') {
|
|
7
|
+
fiatRate = rates?.[asset.ticker]?.priceUSD || 0
|
|
8
|
+
} else {
|
|
9
|
+
fiatRate = rates?.[asset.ticker]?.price || 0
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return conversionByRate(asset.currency, fiatCurrency, fiatRate)
|
|
13
|
+
}
|