@exodus/hw-ledger 2.2.0 → 2.2.2

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
+ ## [2.2.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.2.1...@exodus/hw-ledger@2.2.2) (2024-01-18)
7
+
8
+ ### Bug Fixes
9
+
10
+ - proper error handling for eth ([#5447](https://github.com/ExodusMovement/exodus-hydra/issues/5447)) ([4f72307](https://github.com/ExodusMovement/exodus-hydra/commit/4f72307b52c6dcd2584a7bf347139b9b7cf42387))
11
+
12
+ ## [2.2.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.2.0...@exodus/hw-ledger@2.2.1) (2024-01-16)
13
+
14
+ ### Bug Fixes
15
+
16
+ - generalize errors for blind signing ([#5421](https://github.com/ExodusMovement/exodus-hydra/issues/5421)) ([cb0a009](https://github.com/ExodusMovement/exodus-hydra/commit/cb0a009d06b750691b80021f7a9de5f073a117a7))
17
+
6
18
  ## [2.2.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.1.1...@exodus/hw-ledger@2.2.0) (2024-01-11)
7
19
 
8
20
  ### Features
@@ -4,6 +4,7 @@ import AppEth, { ledgerService } from '@exodus/ledgerhq-hw-app-eth';
4
4
  import { TypedDataUtils, SignTypedDataVersion, } from '@metamask/eth-sig-util';
5
5
  import assert from 'minimalistic-assert';
6
6
  import { buildFauxXPUB } from './utils';
7
+ import { RequiresBlindSigningError } from '../errors';
7
8
  function hashEIP712Message(typedData) {
8
9
  const version = SignTypedDataVersion.V4;
9
10
  const { sanitizeData, hashStruct } = TypedDataUtils;
@@ -73,13 +74,16 @@ async function createHandler(transport) {
73
74
  });
74
75
  }
75
76
  catch (err) {
76
- if (err instanceof Error && err.message.includes('EthAppNftNotSupported')) {
77
+ if (err.name === 'EthAppNftNotSupported') {
77
78
  response = await signTransaction({
78
79
  derivationPath: params.derivationPaths[0],
79
80
  serializedTransactionHex,
80
81
  withNFT: false,
81
82
  });
82
83
  }
84
+ else if (err.name === 'EthAppPleaseEnableContractData') {
85
+ throw new RequiresBlindSigningError();
86
+ }
83
87
  else {
84
88
  throw err;
85
89
  }
@@ -2,6 +2,7 @@ import AppSolana from '@ledgerhq/hw-app-solana';
2
2
  import assert from 'minimalistic-assert';
3
3
  import bs58 from 'bs58';
4
4
  import { XPubUnsupportedError } from '@exodus/hw-common';
5
+ import { RequiresBlindSigningError } from '../errors';
5
6
  async function createHandler(transport) {
6
7
  const app = new AppSolana(transport);
7
8
  const getAddress = async (params) => {
@@ -30,7 +31,16 @@ async function createHandler(transport) {
30
31
  if (!Buffer.isBuffer(serializedTransaction)) {
31
32
  throw new TypeError(`signableTransaction must be Buffer or serializable to a Buffer.`);
32
33
  }
33
- const { signature } = await app.signTransaction(params.derivationPaths[0].replace('m/', ''), serializedTransaction);
34
+ const { signature } = await app
35
+ .signTransaction(params.derivationPaths[0].replace('m/', ''), serializedTransaction)
36
+ .catch((err) => {
37
+ if (err.message.includes('Try enabling blind signature in the app')) {
38
+ throw new RequiresBlindSigningError();
39
+ }
40
+ else {
41
+ throw err;
42
+ }
43
+ });
34
44
  const { address: publicKey } = await app.getAddress(params.derivationPaths[0].replace('m/', ''));
35
45
  return [
36
46
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/hw-ledger",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "The ledger module",
5
5
  "author": "Exodus Movement Inc.",
6
6
  "repository": {
@@ -67,5 +67,5 @@
67
67
  "ts-jest": "^29.0.3",
68
68
  "typescript": "^4.7.3"
69
69
  },
70
- "gitHead": "d19b9139b125653c52a2d4e657d87d9ed40e5d4b"
70
+ "gitHead": "894d5c0882f74eecc06069d8048c7a103db4efc6"
71
71
  }