@exodus/fiat-balances 13.0.2 → 13.1.1

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,22 @@
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.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@13.1.0...@exodus/fiat-balances@13.1.1) (2025-02-21)
7
+
8
+ ### Bug Fixes
9
+
10
+ - fix: skip exporting most reports if wallet doesn't exist (#11553)
11
+
12
+ ## [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)
13
+
14
+ ### Features
15
+
16
+ - feat: add placeholder types files (#11228)
17
+
18
+ ### Bug Fixes
19
+
20
+ - fix: don't export hardware wallet account balances (#11551)
21
+
6
22
  ## [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
23
 
8
24
  ### 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.1",
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.2",
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.2",
51
+ "@exodus/blockchain-metadata": "^15.8.5",
51
52
  "@exodus/combined-assets-meta": "^1.3.0",
52
- "@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",
53
+ "@exodus/enabled-assets": "^10.8.3",
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.4",
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.1",
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": "7f7ccf5ba141c8c392a34e2004247658d2bf9c73"
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,23 @@ 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
- export: async () => {
16
- const result = await fiatBalancesAtom.get()
17
- return mapValues(result.balances.byWalletAccount, ({ balance }) =>
15
+ export: async ({ walletExists } = Object.create(null)) => {
16
+ if (!walletExists) return Object.create(null)
17
+
18
+ const [walletAccounts, { balances }] = await Promise.all([
19
+ walletAccountsAtom.get(),
20
+ fiatBalancesAtom.get(),
21
+ ])
22
+
23
+ const softwareWalletAccountNames = Object.keys(pickBy(walletAccounts, (w) => w.isSoftware))
24
+ return mapValues(pick(balances.byWalletAccount, softwareWalletAccountNames), ({ balance }) =>
18
25
  balance.toDefaultString({ unit: true })
19
26
  )
20
27
  },
21
28
  }),
22
- dependencies: ['fiatBalancesAtom'],
29
+ dependencies: ['wallet', 'fiatBalancesAtom', 'walletAccountsAtom'],
23
30
  }
24
31
 
25
32
  export default fiatBalancesReportDefinition