@exodus/assets-feature 3.2.0 → 3.4.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,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
+ ## [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)
7
+
8
+ ### Features
9
+
10
+ - support search on multiple networks ([#4367](https://github.com/ExodusMovement/exodus-hydra/issues/4367)) ([17c5408](https://github.com/ExodusMovement/exodus-hydra/commit/17c5408b6df99b8f9a516bc9c93517aa1f842a13))
11
+
12
+ ## [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)
13
+
14
+ ### Features
15
+
16
+ - use transaction signer ([#3751](https://github.com/ExodusMovement/exodus-hydra/issues/3751)) ([0e60e89](https://github.com/ExodusMovement/exodus-hydra/commit/0e60e8963a799435c5528f596447813b9e012ead))
17
+
6
18
  ## [3.2.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@3.1.2...@exodus/assets-feature@3.2.0) (2023-10-03)
7
19
 
8
20
  ### Features
@@ -6,6 +6,7 @@ class AssetClientInterface {
6
6
  #availableAssetNamesAtom
7
7
  #walletAccountsAtom
8
8
  #enabledWalletAccountsAtom
9
+ #transactionSigner
9
10
 
10
11
  constructor({
11
12
  blockchainMetadata,
@@ -16,6 +17,7 @@ class AssetClientInterface {
16
17
  availableAssetNamesAtom,
17
18
  addressProvider,
18
19
  feeMonitors,
20
+ transactionSigner,
19
21
  }) {
20
22
  this.blockchainMetadata = blockchainMetadata
21
23
  this.wallet = wallet
@@ -25,6 +27,7 @@ class AssetClientInterface {
25
27
  this.addressProvider = addressProvider
26
28
  this.feeMonitors = feeMonitors
27
29
  this.#availableAssetNamesAtom = availableAssetNamesAtom
30
+ this.#transactionSigner = transactionSigner
28
31
 
29
32
  // TODO: remove conditional when clients updated
30
33
  if (assetsModule.initialize) {
@@ -239,11 +242,10 @@ class AssetClientInterface {
239
242
 
240
243
  // wallet interface
241
244
 
242
- signTransaction = async ({ assetName, unsignedTx, walletAccount }) => {
243
- // eslint-disable-next-line unicorn/no-await-expression-member
244
- const accountIndex = (await this.#getWalletAccount(walletAccount)).index
245
+ signTransaction = async ({ assetName, unsignedTx, walletAccount: walletAccountName }) => {
245
246
  const baseAssetName = this.assetsModule.getAsset(assetName).baseAsset.name
246
- return this.wallet.signTransaction({ baseAssetName, unsignedTx, accountIndex })
247
+ const walletAccount = await this.#getWalletAccount(walletAccountName)
248
+ return this.#transactionSigner.signTransaction({ baseAssetName, unsignedTx, walletAccount })
247
249
  }
248
250
  }
249
251
 
package/client/index.js CHANGED
@@ -13,6 +13,7 @@ const assetsClientInterfaceDefinition = {
13
13
  'availableAssetNamesAtom',
14
14
  'addressProvider',
15
15
  'feeMonitors',
16
+ 'transactionSigner',
16
17
  ],
17
18
  }
18
19
 
@@ -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.2.0",
3
+ "version": "3.4.0",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Assets module, clients and apis",
6
6
  "main": "index.js",
@@ -62,5 +62,5 @@
62
62
  "jest": "^29.1.2",
63
63
  "redux": "^4.0.0"
64
64
  },
65
- "gitHead": "423c1e963708c681fe11ad396afe65f9f956336f"
65
+ "gitHead": "572c80d4130b2eda9473ee17d89c630e737c9c09"
66
66
  }