@exodus/assets-feature 8.5.0 → 8.6.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
+ ## [8.6.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@8.5.0...@exodus/assets-feature@8.6.0) (2025-09-19)
7
+
8
+ ### Features
9
+
10
+ - feat: batch addRemoteTokens requests by 50 (#13858)
11
+
6
12
  ## [8.5.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@8.4.0...@exodus/assets-feature@8.5.0) (2025-09-18)
7
13
 
8
14
  ### Features
@@ -396,12 +396,10 @@ export class AssetsModule {
396
396
  const tokens = tokenNamesToUpdate.map((tokenName) => assets[tokenName])
397
397
 
398
398
  if (tokenNamesToFetch.length > 0) {
399
- const body = { tokenNames: tokenNamesToFetch }
400
- if (allowedStatusList) {
401
- body.lifecycleStatus = allowedStatusList
402
- }
403
-
404
- const fetchedTokens = await this.#fetch('tokens', body, 'tokens')
399
+ const fetchedTokens = await this.#fetchTokensByNames({
400
+ tokenNames: tokenNamesToFetch,
401
+ allowedStatusList,
402
+ })
405
403
  const validTokens = fetchedTokens.filter(this.#isValidCustomToken).map(normalizeToken)
406
404
 
407
405
  if (validTokens && validTokens.length !== fetchedTokens.length) {
@@ -501,6 +499,22 @@ export class AssetsModule {
501
499
  this.getAsset(assetName).api?.hasFeature?.('customTokens')
502
500
  )
503
501
 
502
+ #fetchTokensByNames = async ({ tokenNames, allowedStatusList }) => {
503
+ const pages = chunk(tokenNames, CTR_TOKENS_LIMIT)
504
+
505
+ const pagePromises = pages.map(async (page) => {
506
+ const body = {
507
+ tokenNames: page,
508
+ ...(allowedStatusList && { lifecycleStatus: allowedStatusList }),
509
+ }
510
+
511
+ return this.#fetch('tokens', body, 'tokens')
512
+ })
513
+
514
+ const pagesResults = await Promise.all(pagePromises)
515
+ return pagesResults.flat()
516
+ }
517
+
504
518
  #fetchUpdates = async (assetVersions) => {
505
519
  const updatedTokens = await this.#fetch('updates', assetVersions, 'tokens')
506
520
  const validatedTokens = updatedTokens.filter(this.#isValidCustomToken).map(normalizeToken)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/assets-feature",
3
- "version": "8.5.0",
3
+ "version": "8.6.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",
@@ -82,5 +82,5 @@
82
82
  "publishConfig": {
83
83
  "access": "public"
84
84
  },
85
- "gitHead": "164e7082a3f0caf2a20915fe098cff406067cde0"
85
+ "gitHead": "bf7e26ead6a6562139716a17a9281f0370cc21af"
86
86
  }