@exodus/fiat-balances 13.0.2 → 13.1.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,16 @@
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.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
+
8
+ ### Features
9
+
10
+ - feat: add placeholder types files (#11228)
11
+
12
+ ### Bug Fixes
13
+
14
+ - fix: don't export hardware wallet account balances (#11551)
15
+
6
16
  ## [13.0.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@13.0.1...@exodus/fiat-balances@13.0.2) (2025-01-20)
7
17
 
8
18
  ### Bug Fixes
package/index.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ interface FiatBalancesConfig {
2
+ optimistic?: boolean
3
+ balanceFields?: string[]
4
+ nonDustAssets?: any
5
+ assetsToTrackForBalances?: any[]
6
+ }
7
+
8
+ declare const fiatBalances: (config?: FiatBalancesConfig) => {
9
+ id: 'fiatBalances'
10
+ definitions: []
11
+ }
12
+
13
+ export default fiatBalances
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/fiat-balances",
3
- "version": "13.0.2",
3
+ "version": "13.1.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",
@@ -13,14 +13,15 @@
13
13
  },
14
14
  "main": "index.js",
15
15
  "files": [
16
- "module",
17
- "redux",
18
16
  "atoms",
17
+ "module",
19
18
  "plugin",
19
+ "redux",
20
20
  "report",
21
21
  "shared",
22
- "README.md",
22
+ "index.d.ts",
23
23
  "CHANGELOG.md",
24
+ "README.md",
24
25
  "!**/__tests__/**"
25
26
  ],
26
27
  "repository": {
@@ -44,25 +45,25 @@
44
45
  "devDependencies": {
45
46
  "@exodus/assets": "^9.1.0",
46
47
  "@exodus/assets-base": "^8.1.17",
47
- "@exodus/assets-feature": "^6.0.4",
48
+ "@exodus/assets-feature": "^7.0.1",
48
49
  "@exodus/available-assets": "^8.7.0",
49
- "@exodus/balances": "^13.5.4",
50
- "@exodus/blockchain-metadata": "^15.7.1",
50
+ "@exodus/balances": "^13.6.1",
51
+ "@exodus/blockchain-metadata": "^15.8.4",
51
52
  "@exodus/combined-assets-meta": "^1.3.0",
52
53
  "@exodus/enabled-assets": "^10.8.2",
53
- "@exodus/favorite-assets": "^2.4.3",
54
- "@exodus/fee-data-monitors": "^5.0.3",
55
- "@exodus/models": "^12.4.0",
56
- "@exodus/rates-monitor": "^4.7.0",
54
+ "@exodus/favorite-assets": "^2.5.0",
55
+ "@exodus/fee-data-monitors": "^5.0.4",
56
+ "@exodus/models": "^12.7.0",
57
+ "@exodus/rates-monitor": "^4.8.3",
57
58
  "@exodus/redux-dependency-injection": "^4.1.1",
58
59
  "@exodus/solana-meta": "^1.0.4",
59
60
  "@exodus/storage-memory": "^2.2.2",
60
- "@exodus/wallet-accounts": "^17.1.3",
61
+ "@exodus/wallet-accounts": "^17.3.0",
61
62
  "events": "^3.3.0",
62
63
  "redux": "^4.2.1"
63
64
  },
64
65
  "publishConfig": {
65
66
  "access": "public"
66
67
  },
67
- "gitHead": "98dadedc1d95cdb24a57d612d47981386f81a357"
68
+ "gitHead": "ad73865b1ecfacb076a4c4a83084d819fb8d60c8"
68
69
  }
package/report/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { mapValues } from '@exodus/basic-utils'
1
+ import { mapValues, pick, pickBy } from '@exodus/basic-utils'
2
2
 
3
3
  /**
4
4
  * sample report
@@ -10,16 +10,25 @@ import { mapValues } from '@exodus/basic-utils'
10
10
  const fiatBalancesReportDefinition = {
11
11
  type: 'report',
12
12
  id: 'fiatBalancesReport',
13
- factory: ({ fiatBalancesAtom }) => ({
13
+ factory: ({ wallet, walletAccountsAtom, fiatBalancesAtom }) => ({
14
14
  namespace: 'fiatBalances',
15
15
  export: async () => {
16
- const result = await fiatBalancesAtom.get()
17
- return mapValues(result.balances.byWalletAccount, ({ balance }) =>
16
+ if (!(await wallet.exists())) {
17
+ return Object.create(null)
18
+ }
19
+
20
+ const [walletAccounts, { balances }] = await Promise.all([
21
+ walletAccountsAtom.get(),
22
+ fiatBalancesAtom.get(),
23
+ ])
24
+
25
+ const softwareWalletAccountNames = Object.keys(pickBy(walletAccounts, (w) => w.isSoftware))
26
+ return mapValues(pick(balances.byWalletAccount, softwareWalletAccountNames), ({ balance }) =>
18
27
  balance.toDefaultString({ unit: true })
19
28
  )
20
29
  },
21
30
  }),
22
- dependencies: ['fiatBalancesAtom'],
31
+ dependencies: ['wallet', 'fiatBalancesAtom', 'walletAccountsAtom'],
23
32
  }
24
33
 
25
34
  export default fiatBalancesReportDefinition