@exodus/hardware-wallets 1.5.1 → 1.6.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
+ ## [1.6.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@1.5.1...@exodus/hardware-wallets@1.6.0) (2024-10-22)
7
+
8
+ ### Features
9
+
10
+ - support cancelling an action on the ledger device ([#10105](https://github.com/ExodusMovement/exodus-hydra/issues/10105)) ([f1c1fbf](https://github.com/ExodusMovement/exodus-hydra/commit/f1c1fbff6ec70b7ddc68dd700ffb556b673b7a5a))
11
+
12
+ ### Bug Fixes
13
+
14
+ - catch xpub key identifier errrors ([#10124](https://github.com/ExodusMovement/exodus-hydra/issues/10124)) ([7cd681d](https://github.com/ExodusMovement/exodus-hydra/commit/7cd681deec14adfa9c3e7613f276f2745f1df441))
15
+
6
16
  ## [1.5.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@1.5.0...@exodus/hardware-wallets@1.5.1) (2024-10-17)
7
17
 
8
18
  ### Bug Fixes
@@ -52,6 +52,7 @@ export class HardwareWallets {
52
52
  };
53
53
  const result = await Promise.race([approvePromise, runSign()]);
54
54
  if (typeof result === 'object' && result.tryAgain === false) {
55
+ device.cancelAction();
55
56
  throw new UserRefusedError(false);
56
57
  }
57
58
  this.#requestUserAction({ scenario: 'completed' });
@@ -183,28 +184,32 @@ export class HardwareWallets {
183
184
  });
184
185
  };
185
186
  #getXPUB = async ({ device, baseAsset, purpose, accountIndex, }) => {
186
- const keyIdentifier = baseAsset.api.getKeyIdentifier({
187
- compatibilityMode: 'ledger',
188
- purpose,
189
- accountIndex,
190
- chainIndex: undefined,
191
- addressIndex: undefined,
192
- });
193
- const { derivationPath } = keyIdentifier;
194
- const xpub = await device
195
- .getXPub({
196
- assetName: baseAsset.name,
197
- derivationPath,
198
- })
199
- .catch((error) => {
200
- if (error.name === 'XPubUnsupportedError') {
201
- this.#logger.warn(`Retrieving XPUBs for ${baseAsset.name} is not supported`, error);
187
+ try {
188
+ const keyIdentifier = baseAsset.api.getKeyIdentifier({
189
+ compatibilityMode: 'ledger',
190
+ purpose,
191
+ accountIndex,
192
+ chainIndex: undefined,
193
+ addressIndex: undefined,
194
+ });
195
+ const { derivationPath } = keyIdentifier;
196
+ const xpub = await device.getXPub({
197
+ assetName: baseAsset.name,
198
+ derivationPath,
199
+ });
200
+ if (xpub) {
201
+ return { keyIdentifier, xpub };
202
202
  }
203
- else {
204
- throw error;
203
+ return null;
204
+ }
205
+ catch (error) {
206
+ if (error.name === 'XPubUnsupportedError' ||
207
+ error.message.includes(`XPUB derivation is not allowed`)) {
208
+ this.#logger.warn(`Retrieving XPUBs for ${baseAsset.name} is not supported`, error);
209
+ return null;
205
210
  }
206
- });
207
- return xpub ? { keyIdentifier, xpub } : null;
211
+ throw error;
212
+ }
208
213
  };
209
214
  #getPublicKey = async ({ device, baseAsset, purpose, accountIndex, }) => {
210
215
  const keyIdentifier = baseAsset.api.getKeyIdentifier({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/hardware-wallets",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "An Exodus SDK feature that provides a high level abstraction for interacting with hardware wallet devices",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "prepublishOnly": "yarn run -T build --scope @exodus/hardware-wallets"
29
29
  },
30
30
  "dependencies": {
31
- "@exodus/hw-common": "^3.0.0",
31
+ "@exodus/hw-common": "^3.1.0",
32
32
  "@exodus/models": "^12.0.1",
33
33
  "@exodus/wild-emitter": "^1.1.0",
34
34
  "delay": "^5.0.0",
@@ -44,5 +44,5 @@
44
44
  "@types/randombytes": "^2.0.3",
45
45
  "p-defer": "^4.0.1"
46
46
  },
47
- "gitHead": "c74a9968861467c805398c25b4017985e976ba31"
47
+ "gitHead": "6a40d50082582568d68206d8926737eea560fa50"
48
48
  }