@exodus/assets-feature 8.0.0 → 8.1.1
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 +16 -0
- package/module/assets-module.js +15 -12
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.1.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@8.1.0...@exodus/assets-feature@8.1.1) (2025-05-20)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- fix: do not remove demoted token with unchanged name (#12588)
|
|
11
|
+
|
|
12
|
+
## [8.1.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@8.0.0...@exodus/assets-feature@8.1.0) (2025-05-19)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- feat: add support for filtering invalid token names (#12443)
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
- fix: asset storage race condition (#12577)
|
|
21
|
+
|
|
6
22
|
## [8.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@7.4.1...@exodus/assets-feature@8.0.0) (2025-05-19)
|
|
7
23
|
|
|
8
24
|
### ⚠ BREAKING CHANGES
|
package/module/assets-module.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @exodus/mutable/no-param-reassign-prop-only */
|
|
2
1
|
import {
|
|
3
2
|
createAssetRegistry,
|
|
4
3
|
CT_DEFAULT_SERVER,
|
|
@@ -18,6 +17,7 @@ import {
|
|
|
18
17
|
import { getAssetFromAssetId, getFetchErrorMessage, isDisabledCustomToken } from './utils.js'
|
|
19
18
|
import createFetchival from '@exodus/fetch/create-fetchival'
|
|
20
19
|
import { validateCustomToken, isValidCustomToken } from '@exodus/asset-schema-validation'
|
|
20
|
+
import makeConcurrent from 'make-concurrent'
|
|
21
21
|
|
|
22
22
|
const { get, isEmpty, once, uniq } = lodash
|
|
23
23
|
|
|
@@ -602,20 +602,23 @@ export class AssetsModule {
|
|
|
602
602
|
return mapValues(tokens, normalizeToken)
|
|
603
603
|
}
|
|
604
604
|
|
|
605
|
-
#
|
|
606
|
-
|
|
607
|
-
await this.#storage.set(this.#storageDataKey, { ..._tokens, ...keyBy(tokens, 'name') })
|
|
605
|
+
#updateStoredCustomTokens = async (tokens) => {
|
|
606
|
+
await this.#storeCustomTokens(tokens, true)
|
|
608
607
|
}
|
|
609
608
|
|
|
610
|
-
#
|
|
609
|
+
#storeCustomTokens = makeConcurrent(async (tokens, isUpdate) => {
|
|
611
610
|
const _tokens = await this.#readCustomTokens()
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
611
|
+
if (isUpdate) {
|
|
612
|
+
// safer not to overwrite everything
|
|
613
|
+
const updates = tokens.map((token) => ({
|
|
614
|
+
..._tokens[token.name],
|
|
615
|
+
...pick(token, this.#updateableProps), // like state updates, safer not to overwrite everything in storage
|
|
616
|
+
}))
|
|
617
|
+
await this.#storage.set(this.#storageDataKey, { ..._tokens, ...keyBy(updates, 'name') })
|
|
618
|
+
} else {
|
|
619
|
+
await this.#storage.set(this.#storageDataKey, { ..._tokens, ...keyBy(tokens, 'name') })
|
|
620
|
+
}
|
|
621
|
+
})
|
|
619
622
|
|
|
620
623
|
#getVersionedAssetNames = async () => {
|
|
621
624
|
const tokens = await this.#readCustomTokens()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/assets-feature",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.1",
|
|
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",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"@exodus/fusion-atoms": "^1.4.0",
|
|
45
45
|
"@exodus/timer": "^1.1.2",
|
|
46
46
|
"lodash": "^4.17.21",
|
|
47
|
+
"make-concurrent": "^5.4.0",
|
|
47
48
|
"minimalistic-assert": "^1.0.1",
|
|
48
49
|
"ms": "^2.1.3",
|
|
49
50
|
"reselect": "^3.0.1"
|
|
@@ -80,5 +81,5 @@
|
|
|
80
81
|
"publishConfig": {
|
|
81
82
|
"access": "public"
|
|
82
83
|
},
|
|
83
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "d0cc19c45e1ddaaeb9dec288cf94595d89fdf62c"
|
|
84
85
|
}
|