@exodus/fiat-balances 13.1.0 → 13.2.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
+ ## [13.2.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@13.1.1...@exodus/fiat-balances@13.2.0) (2025-03-04)
7
+
8
+ ### Features
9
+
10
+ - feat: add `createConversions` selector (#11655)
11
+
12
+ ## [13.1.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@13.1.0...@exodus/fiat-balances@13.1.1) (2025-02-21)
13
+
14
+ ### Bug Fixes
15
+
16
+ - fix: skip exporting most reports if wallet doesn't exist (#11553)
17
+
6
18
  ## [13.1.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@13.0.2...@exodus/fiat-balances@13.1.0) (2025-02-21)
7
19
 
8
20
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/fiat-balances",
3
- "version": "13.1.0",
3
+ "version": "13.2.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",
@@ -45,25 +45,25 @@
45
45
  "devDependencies": {
46
46
  "@exodus/assets": "^9.1.0",
47
47
  "@exodus/assets-base": "^8.1.17",
48
- "@exodus/assets-feature": "^7.0.1",
48
+ "@exodus/assets-feature": "^7.0.2",
49
49
  "@exodus/available-assets": "^8.7.0",
50
- "@exodus/balances": "^13.6.1",
51
- "@exodus/blockchain-metadata": "^15.8.4",
50
+ "@exodus/balances": "^13.7.0",
51
+ "@exodus/blockchain-metadata": "^15.9.0",
52
52
  "@exodus/combined-assets-meta": "^1.3.0",
53
- "@exodus/enabled-assets": "^10.8.2",
53
+ "@exodus/enabled-assets": "^10.9.0",
54
54
  "@exodus/favorite-assets": "^2.5.0",
55
55
  "@exodus/fee-data-monitors": "^5.0.4",
56
- "@exodus/models": "^12.7.0",
57
- "@exodus/rates-monitor": "^4.8.3",
56
+ "@exodus/models": "^12.8.0",
57
+ "@exodus/rates-monitor": "^4.9.1",
58
58
  "@exodus/redux-dependency-injection": "^4.1.1",
59
59
  "@exodus/solana-meta": "^1.0.4",
60
60
  "@exodus/storage-memory": "^2.2.2",
61
- "@exodus/wallet-accounts": "^17.3.0",
61
+ "@exodus/wallet-accounts": "^17.3.2",
62
62
  "events": "^3.3.0",
63
63
  "redux": "^4.2.1"
64
64
  },
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "ad73865b1ecfacb076a4c4a83084d819fb8d60c8"
68
+ "gitHead": "a95dc0fbfdb47270dbe7c44b929d8df784896b49"
69
69
  }
@@ -0,0 +1,24 @@
1
+ import { getCreateConversion } from '../../shared/get-create-conversion.js'
2
+ import { mapValues, memoize } from '@exodus/basic-utils'
3
+ import currencies from '@exodus/fiat-currencies'
4
+ import { createSelector } from 'reselect'
5
+
6
+ const selectorFactory = (assetsSelector, ratesSelector) =>
7
+ memoize((fiatTicker) =>
8
+ createSelector(assetsSelector, ratesSelector, (assets, rates) => {
9
+ const createConversion = getCreateConversion(currencies[fiatTicker], rates[fiatTicker])
10
+ return mapValues(assets, (asset) => createConversion(asset))
11
+ })
12
+ )
13
+
14
+ const createConversionsSelectorDefinition = {
15
+ id: 'createConversions',
16
+ selectorFactory,
17
+ dependencies: [
18
+ //
19
+ { module: 'assets', selector: 'all' },
20
+ { module: 'rates', selector: 'data' },
21
+ ],
22
+ }
23
+
24
+ export default createConversionsSelectorDefinition
@@ -29,6 +29,7 @@ import sortedEnabledAssetsWithTotalBalanceSelector from './sorted-assets/enabled
29
29
  import sortedEnabledAssetsWithParentCombinedWithBalanceInActiveAccountSelectorDefinition from './sorted-assets/enabled/with-parent-combined-with-balance-in-active-account'
30
30
  import conversionsSelector from './conversions.js'
31
31
  import createConversionSelector from './create-conversion.js'
32
+ import createConversionsSelector from './create-conversions.js'
32
33
  import createAssetConversion from './create-asset-conversion'
33
34
  import createAssetConversionUsd from './create-asset-conversion-usd'
34
35
  import createSortOptimisticAssetsSelectorFactoryDefinition from './sorted-optimistic-assets/create-sort-assets-selector-factory'
@@ -72,6 +73,7 @@ export default function createSelectorDefinitions(config) {
72
73
  getFormatFiatSelector,
73
74
  conversionsSelector,
74
75
  createConversionSelector,
76
+ createConversionsSelector,
75
77
  createAssetConversion,
76
78
  createAssetConversionUsd,
77
79
  createSortOptimisticAssetsSelectorFactoryDefinition(config),
package/report/index.js CHANGED
@@ -12,10 +12,8 @@ const fiatBalancesReportDefinition = {
12
12
  id: 'fiatBalancesReport',
13
13
  factory: ({ wallet, walletAccountsAtom, fiatBalancesAtom }) => ({
14
14
  namespace: 'fiatBalances',
15
- export: async () => {
16
- if (!(await wallet.exists())) {
17
- return Object.create(null)
18
- }
15
+ export: async ({ walletExists } = Object.create(null)) => {
16
+ if (!walletExists) return Object.create(null)
19
17
 
20
18
  const [walletAccounts, { balances }] = await Promise.all([
21
19
  walletAccountsAtom.get(),