@exodus/assets-feature 5.3.1 → 5.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,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.4.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@5.3.1...@exodus/assets-feature@5.4.0) (2024-05-28)
7
+
8
+ ### Features
9
+
10
+ - add getAssetConfig ([#7153](https://github.com/ExodusMovement/exodus-hydra/issues/7153)) ([62e622b](https://github.com/ExodusMovement/exodus-hydra/commit/62e622b801ac20dd96b9a03184949d1fa2b0db45))
11
+
12
+ ### Bug Fixes
13
+
14
+ - default purpose is asset-source speicfic ([#6903](https://github.com/ExodusMovement/exodus-hydra/issues/6903)) ([92999be](https://github.com/ExodusMovement/exodus-hydra/commit/92999be05017fe8da3396cae966f409a4e39dbca))
15
+
6
16
  ## [5.3.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@5.3.0...@exodus/assets-feature@5.3.1) (2024-05-02)
7
17
 
8
18
  ### Bug Fixes
@@ -9,6 +9,7 @@ class AssetClientInterface {
9
9
  #enabledWalletAccountsAtom
10
10
  #transactionSigner
11
11
  #publicKeyProvider
12
+ #config
12
13
 
13
14
  constructor({
14
15
  blockchainMetadata,
@@ -20,6 +21,7 @@ class AssetClientInterface {
20
21
  feeMonitors,
21
22
  transactionSigner,
22
23
  publicKeyProvider,
24
+ config,
23
25
  }) {
24
26
  this.blockchainMetadata = blockchainMetadata
25
27
  this.#walletAccountsAtom = walletAccountsAtom
@@ -30,6 +32,7 @@ class AssetClientInterface {
30
32
  this.#availableAssetNamesAtom = availableAssetNamesAtom
31
33
  this.#transactionSigner = transactionSigner
32
34
  this.#publicKeyProvider = publicKeyProvider
35
+ this.#config = config
33
36
 
34
37
  // TODO: remove conditional when clients updated
35
38
  if (assetsModule.initialize) {
@@ -145,6 +148,28 @@ class AssetClientInterface {
145
148
 
146
149
  // configParams interface
147
150
 
151
+ async getAssetConfig({ assetName, walletAccount }) {
152
+ const walletAccountInstance = await this.#getWalletAccount(walletAccount)
153
+ const asset = this.assetsModule.getAsset(assetName)
154
+ assert(asset, `assetName ${assetName} is not supported`)
155
+ assert(walletAccountInstance, `walletAccountInstance ${walletAccount} is not available`)
156
+
157
+ const baseAsset = asset.baseAsset
158
+ const out = {
159
+ confirmationsNumber: baseAsset.api?.getConfirmationsNumber
160
+ ? baseAsset.api.getConfirmationsNumber()
161
+ : 1,
162
+ }
163
+
164
+ const gapLimit =
165
+ this.#config?.compatibilityModeGapLimits?.[walletAccountInstance.compatibilityMode]
166
+ if (typeof gapLimit === 'number') {
167
+ out.gapLimit = gapLimit
168
+ }
169
+
170
+ return out
171
+ }
172
+
148
173
  async getConfirmationsNumber({ assetName }) {
149
174
  const baseAsset = this.assetsModule.getAsset(assetName).baseAsset
150
175
  return baseAsset.api?.getConfirmationsNumber ? baseAsset.api.getConfirmationsNumber() : 1
@@ -176,18 +201,22 @@ class AssetClientInterface {
176
201
  getPublicKey = async ({
177
202
  assetName,
178
203
  walletAccount,
179
- purpose = 44,
204
+ purpose,
180
205
  addressIndex = 0,
181
206
  chainIndex = 0,
182
207
  }) => {
183
- const walletAccountInstance = await this.#getWalletAccount(walletAccount)
184
- const asset = this.assetsModule.getAsset(assetName)
208
+ if (purpose === undefined) {
209
+ ;[purpose] = await this.getSupportedPurposes({ assetName, walletAccount })
210
+ }
185
211
 
212
+ const asset = this.assetsModule.getAsset(assetName)
213
+ const walletAccountInstance = await this.#getWalletAccount(walletAccount)
186
214
  const keyIdentifier = asset.baseAsset.api.getKeyIdentifier({
187
215
  purpose,
188
216
  accountIndex: walletAccountInstance.index,
189
217
  chainIndex,
190
218
  addressIndex,
219
+ compatibilityMode: walletAccountInstance.compatibilityMode,
191
220
  })
192
221
 
193
222
  return this.#publicKeyProvider.getPublicKey({
package/client/index.js CHANGED
@@ -15,6 +15,7 @@ const assetsClientInterfaceDefinition = {
15
15
  'feeMonitors',
16
16
  'transactionSigner',
17
17
  'publicKeyProvider',
18
+ 'config',
18
19
  ],
19
20
  }
20
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/assets-feature",
3
- "version": "5.3.1",
3
+ "version": "5.4.0",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Assets module, clients and apis",
6
6
  "main": "index.js",
@@ -44,13 +44,14 @@
44
44
  "reselect": "^3.0.1"
45
45
  },
46
46
  "devDependencies": {
47
- "@exodus/available-assets": "^8.1.0",
47
+ "@exodus/available-assets": "^8.2.1",
48
48
  "@exodus/bip44-constants": "^195.0.0",
49
49
  "@exodus/bitcoin-meta": "^1.0.1",
50
50
  "@exodus/bitcoin-plugin": "^1.0.3",
51
51
  "@exodus/bitcoinregtest-plugin": "^1.0.3",
52
52
  "@exodus/bitcointestnet-plugin": "^1.0.3",
53
- "@exodus/blockchain-metadata": "^15.3.0",
53
+ "@exodus/blockchain-metadata": "^15.3.1",
54
+ "@exodus/cardano-lib": "^2.2.0",
54
55
  "@exodus/combined-assets-meta": "^1.2.5",
55
56
  "@exodus/cosmos-plugin": "^1.0.0",
56
57
  "@exodus/ethereum-lib": "^4.2.7",
@@ -62,12 +63,12 @@
62
63
  "@exodus/public-key-store": "^1.2.1",
63
64
  "@exodus/redux-dependency-injection": "^3.1.0",
64
65
  "@exodus/storage-memory": "^2.1.1",
65
- "@exodus/wallet-accounts": "^16.4.0",
66
+ "@exodus/wallet-accounts": "^16.5.1",
66
67
  "@exodus/wild-emitter": "^1.0.0",
67
68
  "bip39": "^3.1.0",
68
69
  "events": "^3.3.0",
69
70
  "msw": "^2.0.0",
70
71
  "redux": "^4.0.0"
71
72
  },
72
- "gitHead": "d255a58566bf0d8231c5575d29de44f34b20aa91"
73
+ "gitHead": "95e37f72becd4f3b4669283ef2bcebf8677b582a"
73
74
  }