@exodus/hw-ledger 2.5.0 → 2.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,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.6.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.5.1...@exodus/hw-ledger@2.6.0) (2024-07-03)
7
+
8
+ ### Features
9
+
10
+ - **ledger:** support retrieving name & model ([#7597](https://github.com/ExodusMovement/exodus-hydra/issues/7597)) ([a3210d7](https://github.com/ExodusMovement/exodus-hydra/commit/a3210d7db77b44119bca90b6e7d4507e4012b4cf))
11
+
12
+ ## [2.5.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.5.0...@exodus/hw-ledger@2.5.1) (2024-05-27)
13
+
14
+ ### Bug Fixes
15
+
16
+ - order base & eth ([#7126](https://github.com/ExodusMovement/exodus-hydra/issues/7126)) ([63b7408](https://github.com/ExodusMovement/exodus-hydra/commit/63b7408dac094fa0a0d178fd2a4b0e89e74fdbcf))
17
+
6
18
  ## [2.5.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.4.1...@exodus/hw-ledger@2.5.0) (2024-04-18)
7
19
 
8
20
  ### Features
package/lib/index.d.ts CHANGED
@@ -3,10 +3,10 @@ declare const hardwareWalletLedger: ({ bluetoothScannerTimeout, }?: Partial<HwLe
3
3
  id: string;
4
4
  definitions: {
5
5
  definition: {
6
- id: string;
7
- type: string;
8
- factory: (deps: import("./module").Dependencies) => import("./module").LedgerDiscovery;
9
- dependencies: string[];
6
+ readonly id: "ledgerDiscovery";
7
+ readonly type: "module";
8
+ readonly factory: (deps: import("./module").Dependencies) => import("./module").LedgerDiscovery;
9
+ readonly dependencies: readonly ["config", "logger", "transportsFactories"];
10
10
  };
11
11
  config: {
12
12
  bluetoothScannerTimeout: number;
@@ -4,11 +4,11 @@ import ethereum from './ethereum';
4
4
  import matic from './matic';
5
5
  import solana from './solana';
6
6
  export const assetApplications = {
7
+ basemainnet,
7
8
  bitcoin,
8
- ethereum,
9
9
  matic,
10
10
  solana,
11
- basemainnet,
11
+ ethereum,
12
12
  };
13
13
  export const supportedBaseAssetNames = Object.keys(assetApplications);
14
14
  export const applicationNameToBaseAssetName = Object.entries(assetApplications).reduce((mapping, [assetName, metadata]) => {
@@ -20,9 +20,9 @@ export declare class LedgerDiscovery extends ExodusModule implements HardwareWal
20
20
  getFirstDevice: () => Promise<import("@exodus/hw-common").HardwareWalletDevice<import("@exodus/hw-common").Message>>;
21
21
  }
22
22
  declare const _default: {
23
- id: string;
24
- type: string;
25
- factory: (deps: Dependencies) => LedgerDiscovery;
26
- dependencies: string[];
23
+ readonly id: "ledgerDiscovery";
24
+ readonly type: "module";
25
+ readonly factory: (deps: Dependencies) => LedgerDiscovery;
26
+ readonly dependencies: readonly ["config", "logger", "transportsFactories"];
27
27
  };
28
28
  export default _default;
@@ -1,4 +1,5 @@
1
1
  import ExodusModule from '@exodus/module';
2
+ import { getInfosForServiceUuid, identifyUSBProductId } from '@exodus/ledgerhq-devices';
2
3
  import { APDU_PORT } from './constants';
3
4
  import { LedgerDevice } from './device';
4
5
  import { NoDeviceFoundError, UnknownTransportError } from './errors';
@@ -67,25 +68,38 @@ export class LedgerDiscovery extends ExodusModule {
67
68
  switch (transportName) {
68
69
  case 'usb':
69
70
  const deviceList = await transportFactory.list();
70
- const usbDeviceList = deviceList.map((hidDevice) => ({
71
- manufacturer: 'ledger',
72
- transport: 'usb',
73
- get: async () => new LedgerDevice({ transportFactory, descriptor: hidDevice }),
74
- }));
71
+ const usbDeviceList = deviceList.map((hidDevice) => {
72
+ const deviceModel = identifyUSBProductId(hidDevice.productId);
73
+ return {
74
+ name: deviceModel?.productName ?? 'Ledger USB',
75
+ manufacturer: 'ledger',
76
+ transport: 'usb',
77
+ model: deviceModel?.id ?? 'unknown',
78
+ get: async () => new LedgerDevice({ transportFactory, descriptor: hidDevice }),
79
+ };
80
+ });
75
81
  descriptors.push(...usbDeviceList);
76
82
  break;
77
83
  case 'bluetooth':
78
- const bluetoothDeviceList = Object.values(this.#discoveredBluetoothDevices).map((bluetoothDevice) => ({
79
- manufacturer: 'ledger',
80
- transport: 'bluetooth',
81
- get: async () => new LedgerDevice({ transportFactory, descriptor: bluetoothDevice }),
82
- }));
84
+ const bluetoothDeviceList = Object.values(this.#discoveredBluetoothDevices).map((bluetoothDevice) => {
85
+ const deviceModel = getInfosForServiceUuid(bluetoothDevice.serviceUUIDs?.[0] ?? '')
86
+ ?.deviceModel;
87
+ return {
88
+ name: bluetoothDevice.localName ?? deviceModel?.productName,
89
+ manufacturer: 'ledger',
90
+ transport: 'bluetooth',
91
+ model: deviceModel?.id ?? 'unknown',
92
+ get: async () => new LedgerDevice({ transportFactory, descriptor: bluetoothDevice }),
93
+ };
94
+ });
83
95
  descriptors.push(...bluetoothDeviceList);
84
96
  break;
85
97
  case 'tcp':
86
98
  descriptors.push({
99
+ name: 'TCP Emulator',
87
100
  manufacturer: 'ledger',
88
101
  transport: 'tcp',
102
+ model: 'unknown',
89
103
  get: async () => new LedgerDevice({
90
104
  transportFactory,
91
105
  descriptor: { apduPort: APDU_PORT },
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@exodus/hw-ledger",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "The ledger module",
5
- "author": "Exodus Movement Inc.",
5
+ "author": "Exodus Movement, Inc.",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/ExodusMovement/exodus-hydra.git"
@@ -24,7 +24,7 @@
24
24
  "clean": "tsc --build --clean",
25
25
  "test": "run -T jest --testMatch='**/*.unit.test.js' --coverageDirectory coverage/unit",
26
26
  "zemu:install": "docker pull zondax/builder-zemu:speculos-745fe46f81cfc18114b94a37beaefb58a09c0fcd",
27
- "test:integration": "yarn zemu:install && jest --runInBand",
27
+ "test:integration": "yarn zemu:install && run -T jest --runInBand",
28
28
  "lint": "run -T eslint . --ignore-path ../../.gitignore",
29
29
  "lint:fix": "yarn lint --fix",
30
30
  "prepublishOnly": "yarn run -T build --scope @exodus/hw-ledger"
@@ -33,8 +33,9 @@
33
33
  "@exodus/bip322-js": "^1.1.0-exodus.4",
34
34
  "@exodus/bitcoinjs-lib": "^6.1.5-exodus.0",
35
35
  "@exodus/ethersproject-transactions": "^5.4.2-exodus.0",
36
- "@exodus/hw-common": "^2.0.0",
36
+ "@exodus/hw-common": "^2.1.0",
37
37
  "@exodus/ledger-bitcoin": "^0.2.3-exodus.3",
38
+ "@exodus/ledgerhq-devices": "^8.1.0-exodus.3",
38
39
  "@exodus/ledgerhq-hw-app-eth": "^6.33.7-exodus.8",
39
40
  "@exodus/module": "^1.2.2",
40
41
  "@exodus/secp256k1": "^4.0.2-exodus.0",
@@ -49,7 +50,6 @@
49
50
  "devDependencies": {
50
51
  "@exodus/bip32": "^2.0.0",
51
52
  "@exodus/ethersproject-abi": "^5.4.2-exodus.3",
52
- "@exodus/ledgerhq-devices": "^8.1.0-exodus.2",
53
53
  "@ledgerhq/hw-transport-node-hid": "^6.27.17",
54
54
  "@ledgerhq/hw-transport-node-speculos": "^6.27.16",
55
55
  "@solana/web3.js": "^1.78.0",
@@ -69,5 +69,5 @@
69
69
  "ts-jest": "^29.0.3",
70
70
  "typescript": "^4.7.3"
71
71
  },
72
- "gitHead": "b5201feca4d6fdaa66e5573537fb308b4615653a"
72
+ "gitHead": "2ac1721860b9d11c2ebbf365f7a8ecd123e9ed40"
73
73
  }