@exodus/assets-feature 5.6.0 → 5.6.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 +10 -0
- package/module/assets-module.js +7 -13
- package/module/index.js +0 -1
- package/package.json +7 -7
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
|
+
## [5.6.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@5.6.1...@exodus/assets-feature@5.6.2) (2024-07-09)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- only validate fetched tokens ([#7727](https://github.com/ExodusMovement/exodus-hydra/issues/7727)) ([d4c79ac](https://github.com/ExodusMovement/exodus-hydra/commit/d4c79ac8554cdc89caa3b214c882e8736b875e3f))
|
|
11
|
+
|
|
12
|
+
## [5.6.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@5.6.0...@exodus/assets-feature@5.6.1) (2024-07-02)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @exodus/assets-feature
|
|
15
|
+
|
|
6
16
|
## [5.6.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@5.5.0...@exodus/assets-feature@5.6.0) (2024-06-17)
|
|
7
17
|
|
|
8
18
|
### Features
|
package/module/assets-module.js
CHANGED
|
@@ -84,7 +84,6 @@ export class AssetsModule {
|
|
|
84
84
|
#storageTimestampKey
|
|
85
85
|
#customTokenUpdateInterval
|
|
86
86
|
#fetchCacheExpiry
|
|
87
|
-
#isExternalRegistry
|
|
88
87
|
#assetsAtom
|
|
89
88
|
#fetchival
|
|
90
89
|
#logger
|
|
@@ -92,7 +91,6 @@ export class AssetsModule {
|
|
|
92
91
|
constructor({
|
|
93
92
|
storage,
|
|
94
93
|
iconsStorage,
|
|
95
|
-
assetRegistry, // temporary
|
|
96
94
|
assetPlugins,
|
|
97
95
|
assetsAtom,
|
|
98
96
|
combinedAssetsList = [],
|
|
@@ -103,8 +101,7 @@ export class AssetsModule {
|
|
|
103
101
|
}) {
|
|
104
102
|
this.#assetsAtom = assetsAtom
|
|
105
103
|
this.#storage = storage
|
|
106
|
-
this.#
|
|
107
|
-
this.#setRegistry(assetRegistry ?? initialAssetRegistry)
|
|
104
|
+
this.#setRegistry(initialAssetRegistry)
|
|
108
105
|
this.#assetPlugins = assetPlugins
|
|
109
106
|
this.#combinedAssetsList = combinedAssetsList
|
|
110
107
|
this.#fetchCache = {}
|
|
@@ -138,10 +135,6 @@ export class AssetsModule {
|
|
|
138
135
|
}
|
|
139
136
|
|
|
140
137
|
initialize = ({ assetClientInterface }) => {
|
|
141
|
-
assert(
|
|
142
|
-
!this.#isExternalRegistry,
|
|
143
|
-
'initialize(): cannot initialize when using external registry'
|
|
144
|
-
)
|
|
145
138
|
// TODO: pass asset specific config to assets module in `config.assetsConfig`
|
|
146
139
|
const { assetsConfig = {} } = this.#config
|
|
147
140
|
const assetsList = Object.entries(this.#assetPlugins)
|
|
@@ -311,17 +304,18 @@ export class AssetsModule {
|
|
|
311
304
|
tokenNamesToFetch.length > 0
|
|
312
305
|
? await this.#fetch('tokens', { tokenNames: tokenNamesToFetch }, 'tokens')
|
|
313
306
|
: []
|
|
307
|
+
const validTokensToAdd = tokensToAdd.filter(this.#validateCustomToken).map(normalizeToken)
|
|
308
|
+
if (validTokensToAdd.length !== tokensToAdd.length)
|
|
309
|
+
this.#logger.warn('Invalid Custom Token schema')
|
|
310
|
+
|
|
314
311
|
const tokensToUpdate = tokenNames
|
|
315
312
|
.map((tokenName) => assets[tokenName])
|
|
316
313
|
.filter((token) => !!token)
|
|
317
|
-
const tokens = [...
|
|
314
|
+
const tokens = [...validTokensToAdd, ...tokensToUpdate]
|
|
318
315
|
|
|
319
316
|
if (isEmpty(tokens)) return
|
|
320
317
|
|
|
321
|
-
const
|
|
322
|
-
if (validTokens.length !== tokens.length) this.#logger.warn('Invalid Custom Token schema')
|
|
323
|
-
|
|
324
|
-
const { fetchedAndHandledTokens, added, updated } = this.#handleFetchedTokens(validTokens)
|
|
318
|
+
const { fetchedAndHandledTokens, added, updated } = this.#handleFetchedTokens(tokens)
|
|
325
319
|
|
|
326
320
|
if (fetchedAndHandledTokens.length > 0) {
|
|
327
321
|
await this.#storeCustomTokens(fetchedAndHandledTokens)
|
package/module/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/assets-feature",
|
|
3
|
-
"version": "5.6.
|
|
3
|
+
"version": "5.6.2",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Assets module, clients and apis",
|
|
6
6
|
"main": "index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"url": "git+https://github.com/ExodusMovement/exodus-hydra.git"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@exodus/assets": "^
|
|
35
|
+
"@exodus/assets": "^9.2.0",
|
|
36
36
|
"@exodus/atoms": "^7.0.1",
|
|
37
37
|
"@exodus/basic-utils": "^2.1.0",
|
|
38
38
|
"@exodus/fetch": "^1.3.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"reselect": "^3.0.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@exodus/available-assets": "^8.
|
|
47
|
+
"@exodus/available-assets": "^8.3.0",
|
|
48
48
|
"@exodus/bip44-constants": "^195.0.0",
|
|
49
49
|
"@exodus/bitcoin-meta": "^1.0.1",
|
|
50
50
|
"@exodus/bitcoin-plugin": "^1.0.3",
|
|
@@ -59,16 +59,16 @@
|
|
|
59
59
|
"@exodus/keychain": "^6.4.0",
|
|
60
60
|
"@exodus/models": "^9.1.1",
|
|
61
61
|
"@exodus/osmosis-plugin": "^1.0.0",
|
|
62
|
-
"@exodus/public-key-provider": "^2.
|
|
62
|
+
"@exodus/public-key-provider": "^2.3.0",
|
|
63
63
|
"@exodus/public-key-store": "^1.2.1",
|
|
64
|
-
"@exodus/redux-dependency-injection": "^3.2.
|
|
64
|
+
"@exodus/redux-dependency-injection": "^3.2.3",
|
|
65
65
|
"@exodus/storage-memory": "^2.1.1",
|
|
66
|
-
"@exodus/wallet-accounts": "^16.
|
|
66
|
+
"@exodus/wallet-accounts": "^16.7.2",
|
|
67
67
|
"@exodus/wild-emitter": "^1.0.0",
|
|
68
68
|
"bip39": "^3.1.0",
|
|
69
69
|
"events": "^3.3.0",
|
|
70
70
|
"msw": "^2.0.0",
|
|
71
71
|
"redux": "^4.0.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "41b85254a61cd07e842bcc75fa83e4cd71bd6242"
|
|
74
74
|
}
|