@exodus/available-assets 8.10.0 → 8.11.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
+ ## [8.11.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/available-assets@8.10.1...@exodus/available-assets@8.11.0) (2026-02-13)
7
+
8
+ ### Features
9
+
10
+ - feat(available-assets): fetch missing default assets via addRemoteTokens (#15248)
11
+
12
+ ## [8.10.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/available-assets@8.10.0...@exodus/available-assets@8.10.1) (2026-01-22)
13
+
14
+ **Note:** Version bump only for package @exodus/available-assets
15
+
6
16
  ## [8.10.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/available-assets@8.9.0...@exodus/available-assets@8.10.0) (2026-01-21)
7
17
 
8
18
  ### Features
package/index.js CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  import availableAssetsModuleDefinition from './module/index.js'
7
7
  import availableAssetsApiDefinition from './api/index.js'
8
8
  import availableAssetsPluginDefinition from './plugins/index.js'
9
+ import remoteConfigAvailableTokensPluginDefinition from './plugins/remote-config-available-custom-tokens.js'
9
10
 
10
11
  const availableAssets = (config = Object.create(null)) => ({
11
12
  id: 'availableAssets',
@@ -23,6 +24,7 @@ const availableAssets = (config = Object.create(null)) => ({
23
24
  { definition: availableAssetNamesWithoutParentCombinedAtomDefinition },
24
25
  { definition: availableAssetsApiDefinition },
25
26
  { definition: availableAssetsPluginDefinition },
27
+ { definition: remoteConfigAvailableTokensPluginDefinition },
26
28
  ],
27
29
  })
28
30
 
package/module/index.js CHANGED
@@ -1,6 +1,9 @@
1
1
  import restrictConcurrency from 'make-concurrent'
2
+ // eslint-disable-next-line no-restricted-imports
3
+ import lodash from 'lodash'
2
4
 
3
5
  const TOKEN_NAME_RE = /^[^_]+_([^_]+)_([^_]+)$/u
6
+ const { once } = lodash
4
7
 
5
8
  class AvailableAssets {
6
9
  #logger
@@ -81,6 +84,19 @@ class AvailableAssets {
81
84
  )
82
85
  }
83
86
 
87
+ load = once(async () => {
88
+ const missingTokenNames = this.#defaultAvailableAssetNames.filter(
89
+ (name) => TOKEN_NAME_RE.test(name) && !this.#assetsModule.getAsset(name)
90
+ )
91
+
92
+ if (missingTokenNames.length > 0) {
93
+ await this.#assetsModule.addRemoteTokens({
94
+ tokenNames: missingTokenNames,
95
+ allowedStatusList: ['c'],
96
+ })
97
+ }
98
+ })
99
+
84
100
  #resolveBaseAssetName = (assetName) => {
85
101
  if (!assetName) return {}
86
102
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/available-assets",
3
- "version": "8.10.0",
3
+ "version": "8.11.0",
4
4
  "description": "This Exodus SDK feature tracks available assets, i.e. assets that the user can potentially enable via the UI.",
5
5
  "license": "MIT",
6
6
  "author": "Exodus Movement, Inc.",
@@ -45,7 +45,7 @@
45
45
  "@exodus/assets-feature": "^8.8.0",
46
46
  "@exodus/combined-assets-meta": "^3.0.0",
47
47
  "@exodus/enabled-assets": "^10.11.0",
48
- "@exodus/models": "^12.18.0",
48
+ "@exodus/models": "^12.19.0",
49
49
  "@exodus/redux-dependency-injection": "^4.1.2",
50
50
  "jest-when": "^3.6.0",
51
51
  "redux": "^4.2.1"
@@ -54,5 +54,5 @@
54
54
  "access": "public",
55
55
  "provenance": false
56
56
  },
57
- "gitHead": "c78411cee430824a8f7e61db3c151ddfdb99db2d"
57
+ "gitHead": "cffc75523a4f65e63f54677a11079ba060da8125"
58
58
  }
package/plugins/index.js CHANGED
@@ -15,6 +15,7 @@ const createAvailableAssetsPlugin = ({ port, availableAssetNamesAtom, availableA
15
15
 
16
16
  const onLoad = () => {
17
17
  observers.forEach((observer) => observer.start())
18
+ availableAssets.load()
18
19
  }
19
20
 
20
21
  const onStop = () => {
@@ -0,0 +1,47 @@
1
+ function createRemoteConfigAvailableCustomTokensPlugin({
2
+ assetsModule,
3
+ assetsConfigAtom,
4
+ availableAssetNamesAtom,
5
+ logger,
6
+ }) {
7
+ let unsubscribe
8
+
9
+ return {
10
+ onStart: () => {
11
+ unsubscribe = assetsConfigAtom.observe(async (assetsConfig) => {
12
+ const assets = assetsModule.getAssets()
13
+ const availableAssetNames = new Set(await availableAssetNamesAtom.get())
14
+ const baseAssetNames = Object.values(assets)
15
+ .filter(
16
+ (asset) =>
17
+ asset.name === asset.baseAsset.name && asset.baseAsset.api?.features?.customTokens
18
+ )
19
+ .map(({ name }) => name)
20
+
21
+ const remoteCustomTokenNames = baseAssetNames
22
+ .flatMap((baseAssetName) => assetsConfig?.[baseAssetName]?.customTokens || [])
23
+ .filter((name) => !availableAssetNames.has(name))
24
+
25
+ if (remoteCustomTokenNames.length > 0) {
26
+ try {
27
+ await assetsModule.addRemoteTokens({ tokenNames: remoteCustomTokenNames })
28
+ } catch (error) {
29
+ logger.warn('Failed to add tokens from remote config', remoteCustomTokenNames, error)
30
+ }
31
+ }
32
+ })
33
+ },
34
+ onStop: () => {
35
+ if (typeof unsubscribe === 'function') unsubscribe()
36
+ },
37
+ }
38
+ }
39
+
40
+ const remoteConfigAvailableTokensPluginDefinition = {
41
+ id: 'remoteConfigAvailableCustomTokensPlugin',
42
+ type: 'plugin',
43
+ factory: createRemoteConfigAvailableCustomTokensPlugin,
44
+ dependencies: ['assetsModule', 'assetsConfigAtom', 'availableAssetNamesAtom', 'logger'],
45
+ }
46
+
47
+ export default remoteConfigAvailableTokensPluginDefinition