@exodus/assets-feature 9.3.3 → 9.4.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,12 @@
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
+ ## [9.4.0](https://github.com/ExodusMovement/exodus/compare/@exodus/assets-feature@9.3.3...@exodus/assets-feature@9.4.0) (2026-10-07)
7
+
8
+ ### Features
9
+
10
+ - **assets-feature:** add getRuntimeConfig to asset client interface ([#46606](https://github.com/ExodusMovement/exodus/issues/46606)) ([d4e0969](https://github.com/ExodusMovement/exodus/commit/d4e096901d753541928a9e6e8331a25a3765d375))
11
+
6
12
  ## [9.3.3](https://github.com/ExodusMovement/exodus/compare/@exodus/assets-feature@9.3.2...@exodus/assets-feature@9.3.3) (2026-09-11)
7
13
 
8
14
  ### Bug Fixes
@@ -1,4 +1,4 @@
1
- import { filterAsync, pickBy } from '@exodus/basic-utils'
1
+ import { filterAsync, pickBy, set } from '@exodus/basic-utils'
2
2
  import assert from 'minimalistic-assert'
3
3
 
4
4
  class AssetClientInterface {
@@ -16,6 +16,7 @@ class AssetClientInterface {
16
16
  #transactionSigner
17
17
  #walletAccountsAtom
18
18
  #multisigAtom
19
+ #featureFlagAtoms
19
20
  #freshlyCreated = false
20
21
 
21
22
  constructor({
@@ -33,6 +34,7 @@ class AssetClientInterface {
33
34
  transactionSigner,
34
35
  walletAccountsAtom,
35
36
  multisigAtom,
37
+ featureFlagAtoms,
36
38
  }) {
37
39
  this.#addressProvider = addressProvider
38
40
  this.#assetsModule = assetsModule
@@ -48,6 +50,7 @@ class AssetClientInterface {
48
50
  this.#transactionSigner = transactionSigner
49
51
  this.#walletAccountsAtom = walletAccountsAtom
50
52
  this.#multisigAtom = multisigAtom
53
+ this.#featureFlagAtoms = featureFlagAtoms
51
54
  }
52
55
 
53
56
  setFreshlyCreated = (value) => {
@@ -210,6 +213,30 @@ class AssetClientInterface {
210
213
  return out
211
214
  }
212
215
 
216
+ getRuntimeConfig = async ({ assetName }) => {
217
+ const asset = this.#assetsModule.getAsset(assetName)
218
+ assert(asset, `assetName ${assetName} is not supported`)
219
+ const runtimeConfigFlags = this.#config?.runtimeConfigFlags ?? Object.create(null)
220
+ const flagsByPath = {
221
+ ...runtimeConfigFlags[asset.baseAsset.name],
222
+ ...runtimeConfigFlags[asset.name],
223
+ }
224
+ if (!this.#featureFlagAtoms || Object.keys(flagsByPath).length === 0) return {}
225
+
226
+ const flagValuesByPath = await Promise.all(
227
+ Object.entries(flagsByPath).map(async ([path, flag]) => {
228
+ const featureFlagAtom = this.#featureFlagAtoms[flag]
229
+ assert(featureFlagAtom, `feature flag ${flag} is not registered`)
230
+ const featureFlag = await featureFlagAtom.get()
231
+ return [path, featureFlag?.isOn === true]
232
+ })
233
+ )
234
+
235
+ const runtimeConfig = {}
236
+ for (const [path, isOn] of flagValuesByPath) set(runtimeConfig, path, isOn)
237
+ return runtimeConfig
238
+ }
239
+
213
240
  getConfirmationsNumber = async ({ assetName }) => {
214
241
  const baseAsset = this.#assetsModule.getAsset(assetName).baseAsset
215
242
  return baseAsset.api?.getConfirmationsNumber ? baseAsset.api.getConfirmationsNumber() : 1
package/client/index.js CHANGED
@@ -20,6 +20,7 @@ const assetsClientInterfaceDefinition = {
20
20
  'wallet',
21
21
  'walletAccountsAtom',
22
22
  'multisigAtom?',
23
+ 'featureFlagAtoms?',
23
24
  ],
24
25
  public: true,
25
26
  }
package/index.d.ts CHANGED
@@ -3,7 +3,19 @@ import type assetsApiDefinition from './api/index.js'
3
3
  export type { AssetsModule } from './module/assets-module.js'
4
4
  export { TokenStatus } from './api/index.js'
5
5
 
6
- declare const assets: () => {
6
+ export type RuntimeConfigFlags = Record<string, Record<string, string>>
7
+
8
+ export type AssetsConfig = {
9
+ multiAddressMode?: { defaults?: Record<string, boolean> }
10
+ disabledPurposes?: { defaults?: Record<string, number[]> }
11
+ compatibilityModeGapLimits?: Record<string, number>
12
+ compatibilityModeMultiAddressMode?: Record<string, boolean>
13
+ runtimeConfigFlags?: RuntimeConfigFlags
14
+ searchBasedAssetLoaderPlugin?: unknown
15
+ assetsModule?: Record<string, unknown>
16
+ }
17
+
18
+ declare const assets: (config?: AssetsConfig) => {
7
19
  id: 'assets'
8
20
  definitions: [{ definition: typeof assetsApiDefinition }]
9
21
  }
package/index.js CHANGED
@@ -18,6 +18,7 @@ const assets = (config = Object.create(null)) => {
18
18
  disabledPurposes,
19
19
  compatibilityModeGapLimits,
20
20
  compatibilityModeMultiAddressMode,
21
+ runtimeConfigFlags,
21
22
  searchBasedAssetLoaderPlugin,
22
23
  assetsModule,
23
24
  } = { ...defaultConfig, ...config }
@@ -30,6 +31,7 @@ const assets = (config = Object.create(null)) => {
30
31
  config: {
31
32
  compatibilityModeGapLimits,
32
33
  compatibilityModeMultiAddressMode,
34
+ runtimeConfigFlags,
33
35
  },
34
36
  },
35
37
  { definition: assetsPluginDefinition },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/assets-feature",
3
- "version": "9.3.3",
3
+ "version": "9.4.0",
4
4
  "license": "MIT",
5
5
  "description": "This Exodus SDK feature provides access to instances of all blockchain asset adapters supported by the wallet, and enables you to search for and add custom tokens at runtime.",
6
6
  "type": "module",
@@ -52,29 +52,27 @@
52
52
  "reselect": "^3.0.1"
53
53
  },
54
54
  "devDependencies": {
55
- "@exodus/available-assets": "^8.11.2",
56
- "@exodus/bip32": "^4.3.0",
55
+ "@exodus/bip32": "^4.3.1",
57
56
  "@exodus/bip39": "^1.1.0",
58
57
  "@exodus/bip44-constants": "^195.0.2",
59
58
  "@exodus/bitcoin-meta": "^2.0.0",
60
59
  "@exodus/bitcoin-plugin": "^2.0.0",
61
60
  "@exodus/bitcoinregtest-plugin": "^2.0.0",
62
61
  "@exodus/bitcointestnet-plugin": "^2.0.0",
63
- "@exodus/blockchain-metadata": "^17.2.0",
64
62
  "@exodus/cardano-lib": "^4.0.0",
65
63
  "@exodus/cosmos-plugin": "^1.3.3",
66
- "@exodus/ethereum-lib": "^5.0.0",
64
+ "@exodus/ethereum-lib": "^5.26.0",
67
65
  "@exodus/ethereum-meta": "^2.0.0",
68
- "@exodus/ethereum-plugin": "^2.7.4",
66
+ "@exodus/ethereum-plugin": "^3.1.1",
69
67
  "@exodus/fusion-local": "^2.1.0",
70
- "@exodus/keychain": "^12.0.0",
68
+ "@exodus/keychain": "^12.1.0",
71
69
  "@exodus/logger": "^1.2.3",
72
- "@exodus/models": "^13.3.1",
70
+ "@exodus/models": "^13.3.2",
73
71
  "@exodus/osmosis-plugin": "^1.3.3",
74
72
  "@exodus/public-key-provider": "^4.3.1",
75
73
  "@exodus/redux-dependency-injection": "^5.0.0",
76
74
  "@exodus/storage-memory": "^2.4.0",
77
- "@exodus/wallet-accounts": "^20.4.11",
75
+ "@exodus/wallet-accounts": "^20.4.12",
78
76
  "@exodus/wild-emitter": "^1.1.2",
79
77
  "events": "^3.3.0",
80
78
  "msw": "^2.0.0",
@@ -84,5 +82,5 @@
84
82
  "access": "public",
85
83
  "provenance": false
86
84
  },
87
- "gitHead": "3f88b975403ac684cd7c23b7559fecbb797d83ad"
85
+ "gitHead": "a65e66ff61d27471e199419be8b31806f58c6b1b"
88
86
  }