@exodus/fiat-balances 13.7.4 → 13.7.5

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,10 @@
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.7.5](https://github.com/ExodusMovement/exodus/compare/@exodus/fiat-balances@13.7.4...@exodus/fiat-balances@13.7.5) (2026-10-09)
7
+
8
+ **Note:** Version bump only for package @exodus/fiat-balances
9
+
6
10
  ## [13.7.4](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/fiat-balances@13.7.3...@exodus/fiat-balances@13.7.4) (2026-05-19)
7
11
 
8
12
  ### Features
package/README.md CHANGED
@@ -5,7 +5,7 @@ This Exodus SDK feature tracks fiat-denominated balances for all enabled wallet
5
5
  ## Install
6
6
 
7
7
  ```sh
8
- yarn add @exodus/fiat-balances
8
+ pnpm add @exodus/fiat-balances
9
9
  ```
10
10
 
11
11
  ## Usage
@@ -1,6 +1,6 @@
1
1
  import { createInMemoryAtom } from '@exodus/atoms'
2
2
 
3
- // eslint-disable-next-line @exodus/hydra/in-memory-atom-default-value
3
+ // oxlint-disable-next-line @exodus/oxlint-plugin-hydra/in-memory-atom-default-value
4
4
  const createFiatBalancesAtom = () => createInMemoryAtom()
5
5
 
6
6
  export default createFiatBalancesAtom
@@ -1,6 +1,6 @@
1
1
  import { createInMemoryAtom } from '@exodus/atoms'
2
2
 
3
- // eslint-disable-next-line @exodus/hydra/in-memory-atom-default-value
3
+ // oxlint-disable-next-line @exodus/oxlint-plugin-hydra/in-memory-atom-default-value
4
4
  const createOptimisticFiatBalancesAtom = () => createInMemoryAtom()
5
5
 
6
6
  export default createOptimisticFiatBalancesAtom
@@ -51,7 +51,7 @@ export const cloneBalances = (wrapper) => {
51
51
 
52
52
  class FiatBalances {
53
53
  #logger
54
- #assetsModule
54
+ #assetsAtom
55
55
  #balanceFields
56
56
  #fiatCurrency
57
57
  #cachedRates
@@ -67,7 +67,7 @@ class FiatBalances {
67
67
  #subscriptions = []
68
68
 
69
69
  constructor({
70
- assetsModule,
70
+ assetsAtom,
71
71
  logger,
72
72
  balancesAtom,
73
73
  config: { balanceFields },
@@ -76,7 +76,7 @@ class FiatBalances {
76
76
  currencyAtom,
77
77
  }) {
78
78
  this.#logger = logger
79
- this.#assetsModule = assetsModule
79
+ this.#assetsAtom = assetsAtom
80
80
  this.#balanceFields = balanceFields
81
81
  this.#fiatBalancesAtom = fiatBalancesAtom
82
82
  this.#balancesAtom = balancesAtom
@@ -127,12 +127,13 @@ class FiatBalances {
127
127
  }
128
128
 
129
129
  #maybeRecompute = () => {
130
- if (this.#isReady()) this.#recompute()
130
+ if (this.#isReady()) void this.#recompute()
131
131
  }
132
132
 
133
133
  #recompute = async () => {
134
134
  this.#reset()
135
135
 
136
+ const { value: assets } = await this.#assetsAtom.get()
136
137
  const balances = this.#latestAssetBalances
137
138
  const { byAssetSource, byBaseAssetSource, byWalletAccount, byAsset } = this.#balances
138
139
  const fiatZero = fiatCurrencies[this.#fiatCurrency].ZERO
@@ -163,7 +164,7 @@ class FiatBalances {
163
164
  for (const assetName in walletAccountBalances) {
164
165
  const assetBalances = walletAccountBalances[assetName]
165
166
  if (!assetBalances) continue
166
- const asset = this.#assetsModule.getAsset(assetName)
167
+ const asset = assets[assetName]
167
168
  const baseAssetName = asset.baseAsset.name
168
169
 
169
170
  let byAssetSourceAssetRef = byAssetSourceWalletRef[assetName]
@@ -207,7 +208,7 @@ class FiatBalances {
207
208
  this.#recomputeWalletTotals()
208
209
  }
209
210
 
210
- #setBalances = ({ balances, changes }) => {
211
+ #setBalances = async ({ balances, changes }) => {
211
212
  const needsRecompute =
212
213
  !this.#balances.byWalletAccount ||
213
214
  !changes ||
@@ -221,6 +222,7 @@ class FiatBalances {
221
222
 
222
223
  this.#logger.log('recomputing based on new balances')
223
224
 
225
+ const { value: assets } = await this.#assetsAtom.get()
224
226
  const fiatZero = fiatCurrencies[this.#fiatCurrency].ZERO
225
227
 
226
228
  // TODO set changes to fiatBalancesAtom as well
@@ -230,7 +232,7 @@ class FiatBalances {
230
232
  const walletAccountBalances = byWalletAccount[walletAccount]
231
233
  Object.entries(walletAccountBalancesChanges).forEach(
232
234
  ([assetName, assetSourceBalancesChanges]) => {
233
- const asset = this.#assetsModule.getAsset(assetName)
235
+ const asset = assets[assetName]
234
236
  const baseAssetName = asset.baseAsset.name
235
237
  this.#balanceFields.forEach((field) => {
236
238
  // we may not be interested in all fields from `balances`
@@ -270,7 +272,7 @@ class FiatBalances {
270
272
  set(byAssetSource, [walletAccount, assetName, field], fiatZero)
271
273
  }
272
274
 
273
- // eslint-disable-next-line @exodus/mutable/no-param-reassign-prop-only
275
+ // oxlint-disable-next-line @exodus/oxlint-plugin-hydra/no-param-reassign-prop-only
274
276
  byAssetSource[walletAccount][assetName][field] = byAssetSource[walletAccount][
275
277
  assetName
276
278
  ][field]
@@ -332,7 +334,7 @@ const fiatBalancesDefinition = {
332
334
  type: 'module',
333
335
  factory: createFiatBalances,
334
336
  dependencies: [
335
- 'assetsModule',
337
+ 'assetsAtom',
336
338
  'logger',
337
339
  'balancesAtom',
338
340
  'fiatBalancesAtom',
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@exodus/fiat-balances",
3
- "version": "13.7.4",
3
+ "version": "13.7.5",
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",
7
7
  "scripts": {
8
- "test": "run -T exodus-test --jest",
9
- "lint": "run -T eslint -c ../../eslint.config.mjs",
10
- "lint:fix": "yarn lint --fix",
11
- "format": "run -T prettier --write \"**/*.{json,md,yaml}\" --log-level warn",
12
- "format:check": "run -T prettier --check \"**/*.{json,md,yaml}\" --log-level warn"
8
+ "test": "pnpm exec exodus-test --jest",
9
+ "typecheck": "pnpm exec tsc -p tsconfig.json --noEmit",
10
+ "lint": "pnpm exec eslint -c ../../eslint.config.mjs",
11
+ "lint:fix": "pnpm run lint --fix",
12
+ "format": "pnpm exec prettier --write \"**/*.{json,md,yaml}\" --log-level warn",
13
+ "format:check": "pnpm exec prettier --check \"**/*.{json,md,yaml}\" --log-level warn"
13
14
  },
14
15
  "type": "module",
15
16
  "main": "index.js",
@@ -27,18 +28,18 @@
27
28
  ],
28
29
  "repository": {
29
30
  "type": "git",
30
- "url": "git+https://github.com/ExodusMovement/exodus-hydra.git"
31
+ "url": "git+https://github.com/ExodusMovement/exodus.git"
31
32
  },
32
- "homepage": "https://github.com/ExodusMovement/exodus-hydra/tree/master/features/fiat-balances",
33
+ "homepage": "https://github.com/ExodusMovement/exodus/tree/master/libs/features/fiat-balances",
33
34
  "bugs": {
34
- "url": "https://github.com/ExodusMovement/exodus-hydra/issues?q=is%3Aissue+is%3Aopen+label%3Afiat-balances"
35
+ "url": "https://github.com/ExodusMovement/exodus/issues?q=is%3Aissue+is%3Aopen+label%3Afiat-balances"
35
36
  },
36
37
  "dependencies": {
37
- "@exodus/atoms": "^10.3.3",
38
- "@exodus/basic-utils": "^5.0.0",
39
- "@exodus/currency": "^6.0.0",
40
- "@exodus/fiat-currencies": "^1.2.3",
41
- "@exodus/formatting": "^11.0.0",
38
+ "@exodus/atoms": "^10.3.5",
39
+ "@exodus/basic-utils": "^5.2.1",
40
+ "@exodus/currency": "^6.4.1",
41
+ "@exodus/fiat-currencies": "^1.3.1",
42
+ "@exodus/formatting": "^11.1.0",
42
43
  "lodash": "^4.17.21",
43
44
  "minimalistic-assert": "^1.0.1",
44
45
  "reselect": "^3.0.1"
@@ -46,20 +47,20 @@
46
47
  "devDependencies": {
47
48
  "@exodus/assets": "^11.0.0",
48
49
  "@exodus/assets-base": "^12.0.0",
49
- "@exodus/assets-feature": "^9.2.2",
50
- "@exodus/available-assets": "^8.11.0",
51
- "@exodus/balances": "^13.15.5",
52
- "@exodus/blockchain-metadata": "^17.1.1",
50
+ "@exodus/assets-feature": "^9.4.0",
51
+ "@exodus/available-assets": "^8.11.2",
52
+ "@exodus/balances": "^13.16.1",
53
+ "@exodus/blockchain-metadata": "^17.2.1",
53
54
  "@exodus/combined-assets-meta": "^3.3.2",
54
- "@exodus/enabled-assets": "^10.11.0",
55
- "@exodus/favorite-assets": "^2.6.0",
56
- "@exodus/fee-data-monitors": "^5.0.5",
57
- "@exodus/models": "^13.2.5",
58
- "@exodus/rates-monitor": "^4.15.0",
59
- "@exodus/redux-dependency-injection": "^4.5.0",
55
+ "@exodus/enabled-assets": "^10.11.1",
56
+ "@exodus/favorite-assets": "^2.6.1",
57
+ "@exodus/fee-data-monitors": "^5.0.6",
58
+ "@exodus/models": "^13.3.2",
59
+ "@exodus/rates-monitor": "^4.16.0",
60
+ "@exodus/redux-dependency-injection": "^5.0.0",
60
61
  "@exodus/solana-meta": "^2.0.0",
61
- "@exodus/storage-memory": "^2.4.0",
62
- "@exodus/wallet-accounts": "^20.4.4",
62
+ "@exodus/storage-memory": "^2.4.1",
63
+ "@exodus/wallet-accounts": "^20.4.12",
63
64
  "events": "^3.3.0",
64
65
  "redux": "^4.2.1"
65
66
  },
@@ -67,5 +68,5 @@
67
68
  "access": "public",
68
69
  "provenance": false
69
70
  },
70
- "gitHead": "48fd01e119a9bedd865a7f3b49fa48ad5f5c5a2b"
71
+ "gitHead": "1f4cac80971bb7800acb1493c4b231098a9d39d8"
71
72
  }
@@ -39,7 +39,7 @@ const createFiatBalancesAnalyticsPlugin = ({
39
39
 
40
40
  const onStart = () => {
41
41
  const unsubscribe = assetsTotalWalletAmountsAtom.observe((cryptoBalancesByAsset) => {
42
- setBalanceProperties(cryptoBalancesByAsset)
42
+ void setBalanceProperties(cryptoBalancesByAsset)
43
43
  })
44
44
 
45
45
  subscriptions = [unsubscribe]
@@ -4,7 +4,7 @@ import fiatCurrencies from '@exodus/fiat-currencies'
4
4
  const { USD } = fiatCurrencies
5
5
 
6
6
  const createTrackNonDustAssetNamesPlugin = ({
7
- assetsModule,
7
+ assetsAtom,
8
8
  fiatBalancesAtom,
9
9
  fiatRateConverter,
10
10
  nonDustBalanceAssetNamesAtom,
@@ -50,7 +50,7 @@ const createTrackNonDustAssetNamesPlugin = ({
50
50
  const onLoad = () => {
51
51
  unobserveFiatBalancesAtom = fiatBalancesAtom.observe((data) => {
52
52
  // don't block processing
53
- handleFiatBalancesChanged(data)
53
+ void handleFiatBalancesChanged(data)
54
54
  })
55
55
  }
56
56
 
@@ -64,7 +64,8 @@ const createTrackNonDustAssetNamesPlugin = ({
64
64
  defaultBalanceThresholdUsd
65
65
 
66
66
  const isAboveEnableThreshold = async ({ assetName, usdBalance }) => {
67
- const asset = assetsModule.getAsset(assetName)
67
+ const { value: assets } = await assetsAtom.get()
68
+ const asset = assets[assetName]
68
69
  const reserve = asset.accountReserve || asset.currency.ZERO
69
70
  const configuredThreshold = resolveConfiguredThreshold(asset)
70
71
  const reserveUsd = asset.accountReserve
@@ -92,7 +93,7 @@ const trackNonDustAssetsNamesPluginDefinition = {
92
93
  'nonDustBalanceAssetNamesAtom',
93
94
  'fiatBalancesAtom',
94
95
  'fiatRateConverter',
95
- 'assetsModule',
96
+ 'assetsAtom',
96
97
  'config?',
97
98
  ],
98
99
  public: true,