@exodus/balances 13.5.2 → 13.5.4

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.5.4](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@13.5.3...@exodus/balances@13.5.4) (2025-01-17)
7
+
8
+ ### Bug Fixes
9
+
10
+ - fix: balance typo "stakeable" (#11131)
11
+
12
+ ## [13.5.3](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@13.5.2...@exodus/balances@13.5.3) (2025-01-06)
13
+
14
+ ### Bug Fixes
15
+
16
+ - fix: filter by available asset names in balances (#10962)
17
+
6
18
  ## [13.5.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/balances@13.5.1...@exodus/balances@13.5.2) (2025-01-03)
7
19
 
8
20
  ### Bug Fixes
package/README.md CHANGED
@@ -10,7 +10,7 @@ yarn add @exodus/balances
10
10
 
11
11
  ## Usage
12
12
 
13
- This feature is designed to be used together with `@exodus/headless`. See [using the sdk](../../docs/docs-website/docs/development/using-the-sdk.md).
13
+ This feature is designed to be used together with `@exodus/headless`. See [using the sdk](../../docs/development/using-the-sdk.md).
14
14
 
15
15
  ### Play with it
16
16
 
@@ -36,7 +36,7 @@ selectors.balances
36
36
 
37
37
  ### API Side
38
38
 
39
- See [using the sdk](../../docs/docs-website/docs/development/using-the-sdk.md#setup-the-api-side) for more details on how features plug into the SDK. Note that the balances feature currently doesn't provide a top level API and is meant to be used purely through selectors.
39
+ See [using the sdk](../../docs/development/using-the-sdk.md#setup-the-api-side) for more details on how features plug into the SDK. Note that the balances feature currently doesn't provide a top level API and is meant to be used purely through selectors.
40
40
 
41
41
  If you're building a feature that requires balances, add a dependency on the `balancesAtom` as below. See also the [available balance fields](./default-config.js).
42
42
 
@@ -68,7 +68,7 @@ const myModuleDefinition = {
68
68
 
69
69
  ### UI Side
70
70
 
71
- See [using the sdk](../../docs/docs-website/docs/development/using-the-sdk.md#events) for more details on basic UI-side setup.
71
+ See [using the sdk](../../docs/development/using-the-sdk.md#events) for more details on basic UI-side setup.
72
72
 
73
73
  ```js
74
74
  import { selectors } from '~/ui/flux'
package/default-config.js CHANGED
@@ -8,7 +8,7 @@ const balanceFieldsConfig = [
8
8
  { name: 'networkReserve' },
9
9
  { name: 'staking' },
10
10
  { name: 'staked' },
11
- { name: 'stakable' },
11
+ { name: 'stakeable' },
12
12
  { name: 'unstaking' },
13
13
  { name: 'unstaked' },
14
14
  { name: 'rewards' },
package/module/index.js CHANGED
@@ -24,6 +24,7 @@ class Balances {
24
24
  #logger
25
25
  #assetsModule
26
26
  #availableAssetNamesAtom
27
+ #availableAssetNames = []
27
28
  #balanceFieldsConfig
28
29
  #balanceFields
29
30
  #walletAccounts = [] // string[]
@@ -84,7 +85,7 @@ class Balances {
84
85
  this.#setWalletAccounts = swallowErrors(this.#setWalletAccounts)
85
86
  }
86
87
 
87
- load = () => {
88
+ load = async () => {
88
89
  if (this.#loaded) return
89
90
  this.#loaded = true
90
91
 
@@ -103,10 +104,13 @@ class Balances {
103
104
  )
104
105
  ),
105
106
  getChanges(this.#availableAssetNamesAtom).observe(({ previous = [], current }) => {
107
+ this.#availableAssetNames = current
106
108
  const added = difference(current, previous)
107
109
  if (added.length > 0) this.#onAssetsChanged(added)
108
110
  })
109
111
  )
112
+
113
+ this.#availableAssetNames = await this.#availableAssetNamesAtom.get()
110
114
  }
111
115
 
112
116
  #getAsset = (assetName) => this.#assetsModule.getAsset(assetName)
@@ -228,7 +232,9 @@ class Balances {
228
232
  this.#recompute()
229
233
  }
230
234
 
231
- #isSupportedAsset = (assetName) => !this.#getAsset(assetName).isCombined
235
+ #isSupportedAsset = (assetName) =>
236
+ this.#availableAssetNames.includes(assetName) && !this.#getAsset(assetName).isCombined
237
+
232
238
  #getSupportedAssetNames = () => Object.keys(this.#getAssets()).filter(this.#isSupportedAsset)
233
239
 
234
240
  #getRelatedAssetNames = (assetName) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/balances",
3
- "version": "13.5.2",
3
+ "version": "13.5.4",
4
4
  "description": "Tracks crypto balances across enabled wallet accounts.",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "license": "MIT",
@@ -51,7 +51,7 @@
51
51
  "devDependencies": {
52
52
  "@exodus/assets": "^11.0.0",
53
53
  "@exodus/assets-base": "^10.0.0",
54
- "@exodus/assets-feature": "^6.0.1",
54
+ "@exodus/assets-feature": "^6.0.4",
55
55
  "@exodus/available-assets": "^8.7.0",
56
56
  "@exodus/bitcoin-meta": "^2.0.0",
57
57
  "@exodus/blockchain-metadata": "^15.7.1",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "2b30d69ddf8f4d0ebd3bcc4d4280d3ea12906673"
68
+ "gitHead": "3d47f165cb39e12e093ecb479674ba8f67ede525"
69
69
  }
@@ -35,7 +35,7 @@ const createBalanceSelectors = [
35
35
  { id: 'createNetworkReserve', field: 'networkReserve' },
36
36
  { id: 'createStaking', field: 'staking' },
37
37
  { id: 'createStaked', field: 'staked' },
38
- { id: 'createStakable', field: 'stakable' },
38
+ { id: 'createStakeable', field: 'stakeable' },
39
39
  { id: 'createUnstaking', field: 'unstaking' },
40
40
  { id: 'createUnstaked', field: 'unstaked' },
41
41
  { id: 'createRewards', field: 'rewards' },
@@ -31,7 +31,7 @@ const getBalanceSelectors = [
31
31
  { id: 'getNetworkReserve', field: 'networkReserve' },
32
32
  { id: 'getStaking', field: 'staking' },
33
33
  { id: 'getStaked', field: 'staked' },
34
- { id: 'getStakable', field: 'stakable' },
34
+ { id: 'getStakeable', field: 'stakeable' },
35
35
  { id: 'getUnstaking', field: 'unstaking' },
36
36
  { id: 'getUnstaked', field: 'unstaked' },
37
37
  { id: 'getRewards', field: 'rewards' },