@exodus/assets-feature 8.7.0 → 8.7.2

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
+ ## [8.7.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@8.7.1...@exodus/assets-feature@8.7.2) (2025-12-04)
7
+
8
+ ### Bug Fixes
9
+
10
+ - fix: consistenly handle storeIcons errors (#14556)
11
+
12
+ ## [8.7.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@8.7.0...@exodus/assets-feature@8.7.1) (2025-10-03)
13
+
14
+ ### Bug Fixes
15
+
16
+ - fix: loading custom tokens when base asset doesn't exist (#13998)
17
+
6
18
  ## [8.7.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@8.6.0...@exodus/assets-feature@8.7.0) (2025-09-24)
7
19
 
8
20
  ### Features
@@ -1,6 +1,7 @@
1
1
  import { combine, compute, createStorageAtomFactory } from '@exodus/atoms'
2
2
  import { omitBy } from '@exodus/basic-utils'
3
3
  import { createFusionAtom } from '@exodus/fusion-atoms'
4
+ // eslint-disable-next-line no-restricted-imports -- TODO: Fix this the next time the file is edited.
4
5
  import lodash from 'lodash'
5
6
 
6
7
  const { isUndefined } = lodash
@@ -1,4 +1,5 @@
1
1
  import { pickBy, filterAsync } from '@exodus/basic-utils'
2
+ // eslint-disable-next-line no-restricted-imports -- TODO: Fix this the next time the file is edited.
2
3
  import lodash from 'lodash'
3
4
  import assert from 'minimalistic-assert'
4
5
 
@@ -5,6 +5,7 @@ import {
5
5
  CT_UPDATEABLE_PROPERTIES,
6
6
  } from '@exodus/assets'
7
7
  import { keyBy, mapValues, partition, pickBy, difference } from '@exodus/basic-utils'
8
+ // eslint-disable-next-line no-restricted-imports -- TODO: Fix this the next time the file is edited.
8
9
  import lodash from 'lodash'
9
10
  import assert from 'minimalistic-assert'
10
11
  import { memoizeLruCache } from '@exodus/asset-lib'
@@ -174,7 +175,7 @@ export class AssetsModule {
174
175
  const storedTokens = await this.#readCustomTokens()
175
176
  const tokens = pickBy(storedTokens, ({ baseAssetName }) => {
176
177
  const baseAsset = this.getAsset(baseAssetName)
177
- return baseAsset.api?.hasFeature?.('customTokens')
178
+ return baseAsset?.api?.hasFeature?.('customTokens')
178
179
  })
179
180
 
180
181
  // tokens may be:
@@ -185,7 +186,7 @@ export class AssetsModule {
185
186
  const { added, updated } = this.#handleFetchedTokens(Object.values(tokens))
186
187
  this.#flushChanges({ added, updated })
187
188
  } catch (e) {
188
- this.#logger.log('error reading custom tokens from storage:', e)
189
+ this.#logger.error('error reading custom tokens from storage: ' + e.message, e)
189
190
  }
190
191
  })
191
192
 
@@ -233,11 +234,7 @@ export class AssetsModule {
233
234
 
234
235
  const token = normalizeToken(_token)
235
236
 
236
- try {
237
- await this.#iconsStorage.storeIcons([token])
238
- } catch (err) {
239
- this.#logger.warn(`An error occurred while decoding icon for ${assetId}`, err.message)
240
- }
237
+ await this.#storeIcons([token])
241
238
 
242
239
  this.#setCache(key, token)
243
240
  return this.#getCache(key)
@@ -283,11 +280,7 @@ export class AssetsModule {
283
280
 
284
281
  const tokens = validTokens.map((token) => normalizeToken(token))
285
282
 
286
- try {
287
- await this.#iconsStorage.storeIcons(tokens)
288
- } catch (err) {
289
- this.#logger.warn(`An error occurred while decoding icons`, err.message)
290
- }
283
+ await this.#storeIcons(tokens)
291
284
 
292
285
  for (const token of tokens) {
293
286
  const key = getFetchCacheKey(token.baseAssetName, token.assetId)
@@ -427,7 +420,7 @@ export class AssetsModule {
427
420
 
428
421
  if (fetchedAndHandledTokens.length > 0) {
429
422
  await this.#storeCustomTokens(fetchedAndHandledTokens)
430
- await this.#iconsStorage.storeIcons(fetchedAndHandledTokens)
423
+ await this.#storeIcons(fetchedAndHandledTokens)
431
424
  }
432
425
 
433
426
  this.#flushChanges({ added, updated })
@@ -530,7 +523,8 @@ export class AssetsModule {
530
523
  this.#logger.warn('Invalid Custom Token schema')
531
524
  }
532
525
 
533
- await this.#iconsStorage.storeIcons(validatedTokens)
526
+ await this.#storeIcons(validatedTokens)
527
+
534
528
  return validatedTokens
535
529
  }
536
530
 
@@ -637,7 +631,7 @@ export class AssetsModule {
637
631
  parentNames.push(...updates)
638
632
  }
639
633
  } catch (err) {
640
- this.#logger.warn('Handle fetched custom tokens error:', err.message)
634
+ this.#logger.error('Handle fetched custom tokens error: ' + err.message, err)
641
635
  }
642
636
  }
643
637
 
@@ -679,6 +673,19 @@ export class AssetsModule {
679
673
  }
680
674
  }
681
675
 
676
+ #storeIcons = async (tokens) => {
677
+ try {
678
+ if (tokens.length > 0) {
679
+ await this.#iconsStorage.storeIcons(tokens)
680
+ }
681
+ } catch (err) {
682
+ this.#logger.warn(
683
+ `An error occurred while storing icons ${tokens.map((t) => t.name).join(',')}`,
684
+ err
685
+ )
686
+ }
687
+ }
688
+
682
689
  #assertSupportsCustomTokens = (baseAssetName) => {
683
690
  const baseAsset = this.getAsset(baseAssetName)
684
691
  if (!baseAsset?.api?.hasFeature('customTokens')) {
package/module/utils.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { CT_STATUS as STATUS } from '@exodus/assets'
2
2
  import { pick } from '@exodus/basic-utils'
3
+ // eslint-disable-next-line no-restricted-imports -- TODO: Fix this the next time the file is edited.
3
4
  import lodash from 'lodash'
4
5
  import assert from 'minimalistic-assert'
5
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/assets-feature",
3
- "version": "8.7.0",
3
+ "version": "8.7.2",
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,13 +52,13 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@exodus/available-assets": "^8.8.0",
55
- "@exodus/bip39": "^1.0.3",
55
+ "@exodus/bip39": "^1.0.4",
56
56
  "@exodus/bip44-constants": "^195.0.0",
57
57
  "@exodus/bitcoin-meta": "^2.0.0",
58
58
  "@exodus/bitcoin-plugin": "^1.29.1",
59
59
  "@exodus/bitcoinregtest-plugin": "^1.11.0",
60
60
  "@exodus/bitcointestnet-plugin": "^1.13.1",
61
- "@exodus/blockchain-metadata": "^16.0.0",
61
+ "@exodus/blockchain-metadata": "^17.1.0",
62
62
  "@exodus/cardano-lib": "^3.4.1",
63
63
  "@exodus/combined-assets-meta": "^3.0.0",
64
64
  "@exodus/cosmos-plugin": "^1.3.3",
@@ -68,19 +68,20 @@
68
68
  "@exodus/fusion-local": "^2.1.0",
69
69
  "@exodus/keychain": "^7.3.0",
70
70
  "@exodus/logger": "^1.2.3",
71
- "@exodus/models": "^12.16.0",
71
+ "@exodus/models": "^12.18.0",
72
72
  "@exodus/osmosis-plugin": "^1.3.3",
73
- "@exodus/public-key-provider": "^4.2.0",
73
+ "@exodus/public-key-provider": "^4.2.1",
74
74
  "@exodus/redux-dependency-injection": "^4.1.2",
75
75
  "@exodus/storage-memory": "^2.3.0",
76
- "@exodus/wallet-accounts": "^20.0.0",
76
+ "@exodus/wallet-accounts": "^20.2.1",
77
77
  "@exodus/wild-emitter": "^1.0.0",
78
78
  "events": "^3.3.0",
79
79
  "msw": "^2.0.0",
80
80
  "redux": "^4.0.0"
81
81
  },
82
82
  "publishConfig": {
83
- "access": "public"
83
+ "access": "public",
84
+ "provenance": false
84
85
  },
85
- "gitHead": "dde97e04554c3f37aab76ac0c307ba9bcd0673a1"
86
+ "gitHead": "653e974357049abfb5b4b6389b89cf49a81e8e95"
86
87
  }
@@ -1,6 +1,7 @@
1
1
  import { keyBy } from '@exodus/basic-utils'
2
2
  import { createSelector } from 'reselect'
3
3
 
4
+ // eslint-disable-next-line no-restricted-imports -- TODO: Fix this the next time the file is edited.
4
5
  import lodash from 'lodash'
5
6
 
6
7
  const { memoize } = lodash // eslint-disable-line @exodus/basic-utils/prefer-basic-utils