@exodus/assets-feature 3.3.0 → 3.5.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,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
+ ## [3.5.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@3.4.0...@exodus/assets-feature@3.5.0) (2023-10-17)
7
+
8
+ ### Features
9
+
10
+ - clear assets feature in plugin ([#4444](https://github.com/ExodusMovement/exodus-hydra/issues/4444)) ([ac5442d](https://github.com/ExodusMovement/exodus-hydra/commit/ac5442d30ead24260f10f336497fbc745ff66e17))
11
+
12
+ ### Bug Fixes
13
+
14
+ - headless test config ([#4399](https://github.com/ExodusMovement/exodus-hydra/issues/4399)) ([27618df](https://github.com/ExodusMovement/exodus-hydra/commit/27618df282becfb07e25759d7e870c1ce9cc6331))
15
+
16
+ ## [3.4.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@3.3.0...@exodus/assets-feature@3.4.0) (2023-10-06)
17
+
18
+ ### Features
19
+
20
+ - support search on multiple networks ([#4367](https://github.com/ExodusMovement/exodus-hydra/issues/4367)) ([17c5408](https://github.com/ExodusMovement/exodus-hydra/commit/17c5408b6df99b8f9a516bc9c93517aa1f842a13))
21
+
6
22
  ## [3.3.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@3.2.0...@exodus/assets-feature@3.3.0) (2023-10-05)
7
23
 
8
24
  ### Features
@@ -331,12 +331,21 @@ export class AssetsModule extends ExodusModule {
331
331
 
332
332
  searchTokens = async ({ baseAssetName, lifecycleStatus, query, excludeTags = ['offensive'] }) => {
333
333
  assert(
334
- !baseAssetName || typeof baseAssetName === 'string',
335
- 'searchTokens(): baseAssetName must be a string if supplied'
334
+ !baseAssetName || typeof baseAssetName === 'string' || Array.isArray(baseAssetName),
335
+ 'searchTokens(): baseAssetName must be a string or an array if supplied'
336
336
  )
337
- baseAssetName && this.#assertSupportsCustomTokens(baseAssetName)
338
337
 
339
- const baseAssetNames = baseAssetName ? [baseAssetName] : this.#getCustomTokensNetworkNames()
338
+ let baseAssetNames
339
+ if (Array.isArray(baseAssetName)) {
340
+ baseAssetName.every((assetName) => this.#assertSupportsCustomTokens(assetName))
341
+ baseAssetNames = baseAssetName
342
+ } else if (baseAssetName) {
343
+ this.#assertSupportsCustomTokens(baseAssetName)
344
+ baseAssetNames = [baseAssetName]
345
+ } else {
346
+ baseAssetNames = this.#getCustomTokensNetworkNames()
347
+ }
348
+
340
349
  const tokens = await this.#fetch(
341
350
  'search',
342
351
  { baseAssetName: baseAssetNames, lifecycleStatus, query, excludeTags },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/assets-feature",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Assets module, clients and apis",
6
6
  "main": "index.js",
@@ -41,8 +41,8 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@exodus/assets": "^8.0.95",
44
- "@exodus/atoms": "^5.7.1",
45
- "@exodus/available-assets": "^6.0.0",
44
+ "@exodus/atoms": "^5.7.2",
45
+ "@exodus/available-assets": "^7.0.0",
46
46
  "@exodus/bitcoin-meta": "^1.0.1",
47
47
  "@exodus/bitcoin-plugin": "^1.0.3",
48
48
  "@exodus/bitcoinregtest-plugin": "^1.0.3",
@@ -62,5 +62,5 @@
62
62
  "jest": "^29.1.2",
63
63
  "redux": "^4.0.0"
64
64
  },
65
- "gitHead": "791e546a70c1e544e7bb0e64502e431670b9bb86"
65
+ "gitHead": "28aeb225a8d874b836e19a6c305b9b8543f261c4"
66
66
  }
package/plugin/index.js CHANGED
@@ -49,7 +49,11 @@ const createAssetsPlugin = ({ port, assetsModule, disabledPurposesAtom, multiAdd
49
49
  observers.forEach((observer) => observer.unregister())
50
50
  }
51
51
 
52
- return { onStart, onLoad, onStop }
52
+ const onClear = async () => {
53
+ await assetsModule.clear()
54
+ }
55
+
56
+ return { onStart, onLoad, onStop, onClear }
53
57
  }
54
58
 
55
59
  const assetsPluginDefinition = {