@exodus/assets-feature 5.3.1 → 5.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
+ ## [5.5.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/assets-feature@5.4.0...@exodus/assets-feature@5.5.0) (2024-06-13)
7
+
8
+ ### Features
9
+
10
+ - allow specifying multiAddressMode per compatibility mode via config ([#7360](https://github.com/ExodusMovement/exodus-hydra/issues/7360)) ([2d4fb51](https://github.com/ExodusMovement/exodus-hydra/commit/2d4fb5173e239f238e0a5ab2ffb14ae31b77783e))
11
+
12
+ ## [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)
13
+
14
+ ### Features
15
+
16
+ - add getAssetConfig ([#7153](https://github.com/ExodusMovement/exodus-hydra/issues/7153)) ([62e622b](https://github.com/ExodusMovement/exodus-hydra/commit/62e622b801ac20dd96b9a03184949d1fa2b0db45))
17
+
18
+ ### Bug Fixes
19
+
20
+ - default purpose is asset-source speicfic ([#6903](https://github.com/ExodusMovement/exodus-hydra/issues/6903)) ([92999be](https://github.com/ExodusMovement/exodus-hydra/commit/92999be05017fe8da3396cae966f409a4e39dbca))
21
+
6
22
  ## [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
23
 
8
24
  ### 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,34 @@ 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
+ const multiAddressMode =
171
+ this.#config?.compatibilityModeMultiAddressMode?.[walletAccountInstance.compatibilityMode]
172
+ if (typeof multiAddressMode === 'boolean') {
173
+ out.multiAddressMode = multiAddressMode
174
+ }
175
+
176
+ return out
177
+ }
178
+
148
179
  async getConfirmationsNumber({ assetName }) {
149
180
  const baseAsset = this.assetsModule.getAsset(assetName).baseAsset
150
181
  return baseAsset.api?.getConfirmationsNumber ? baseAsset.api.getConfirmationsNumber() : 1
@@ -176,18 +207,22 @@ class AssetClientInterface {
176
207
  getPublicKey = async ({
177
208
  assetName,
178
209
  walletAccount,
179
- purpose = 44,
210
+ purpose,
180
211
  addressIndex = 0,
181
212
  chainIndex = 0,
182
213
  }) => {
183
- const walletAccountInstance = await this.#getWalletAccount(walletAccount)
184
- const asset = this.assetsModule.getAsset(assetName)
214
+ if (purpose === undefined) {
215
+ ;[purpose] = await this.getSupportedPurposes({ assetName, walletAccount })
216
+ }
185
217
 
218
+ const asset = this.assetsModule.getAsset(assetName)
219
+ const walletAccountInstance = await this.#getWalletAccount(walletAccount)
186
220
  const keyIdentifier = asset.baseAsset.api.getKeyIdentifier({
187
221
  purpose,
188
222
  accountIndex: walletAccountInstance.index,
189
223
  chainIndex,
190
224
  addressIndex,
225
+ compatibilityMode: walletAccountInstance.compatibilityMode,
191
226
  })
192
227
 
193
228
  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.5.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.3",
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.2",
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": "522ea8a880753620052cb8529ca8af929a4c45b3"
73
74
  }