@exodus/hardware-wallets 1.1.2 → 1.2.1

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
+ ## [1.2.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@1.2.0...@exodus/hardware-wallets@1.2.1) (2024-09-13)
7
+
8
+ ### Bug Fixes
9
+
10
+ - dont await sign transaction/message modal ([#9268](https://github.com/ExodusMovement/exodus-hydra/issues/9268)) ([c2e1de9](https://github.com/ExodusMovement/exodus-hydra/commit/c2e1de987c31b2277bcc3cf65d13e11758bd2110))
11
+
12
+ ## [1.2.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@1.1.2...@exodus/hardware-wallets@1.2.0) (2024-08-16)
13
+
14
+ ### Features
15
+
16
+ - add getAvailableDevices ([#8474](https://github.com/ExodusMovement/exodus-hydra/issues/8474)) ([377ef0d](https://github.com/ExodusMovement/exodus-hydra/commit/377ef0d2c4e25ac33085c638ec7bbfe5dff74efd))
17
+
6
18
  ## [1.1.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@1.1.1...@exodus/hardware-wallets@1.1.2) (2024-08-13)
7
19
 
8
20
  ### Bug Fixes
@@ -9,6 +9,10 @@ declare const hardwareWalletsApiDefinition: {
9
9
  }) => {
10
10
  hardwareWallets: {
11
11
  isDeviceConnected: () => Promise<boolean>;
12
+ getAvailableDevices: () => Promise<{
13
+ model: ("blue" | "nanoS" | "nanoSP" | "nanoX" | "stax" | "europa") | ("1" | "t" | "Safe 3" | "Safe 5") | "unknown";
14
+ name: string;
15
+ }[]>;
12
16
  listUseableAssetNames: () => Promise<string[]>;
13
17
  scanForDevices: () => Promise<void>;
14
18
  canAccessAsset: ({ assetName }: import("../module/interfaces.js").CanAccessAssetParams) => Promise<boolean>;
package/lib/api/index.js CHANGED
@@ -19,6 +19,7 @@ const createHardwareWalletsApi = ({ hardwareWallets, restoreProgressTracker, txL
19
19
  return {
20
20
  hardwareWallets: {
21
21
  isDeviceConnected: hardwareWallets.isDeviceConnected,
22
+ getAvailableDevices: hardwareWallets.getAvailableDevices,
22
23
  listUseableAssetNames: hardwareWallets.listUseableAssetNames,
23
24
  scanForDevices: hardwareWallets.scanForDevices,
24
25
  canAccessAsset: hardwareWallets.canAccessAsset,
package/lib/index.d.ts CHANGED
@@ -11,6 +11,10 @@ declare const hardwareWallets: () => {
11
11
  }) => {
12
12
  hardwareWallets: {
13
13
  isDeviceConnected: () => Promise<boolean>;
14
+ getAvailableDevices: () => Promise<{
15
+ model: ("blue" | "nanoS" | "nanoSP" | "nanoX" | "stax" | "europa") | ("1" | "t" | "Safe 3" | "Safe 5") | "unknown";
16
+ name: string;
17
+ }[]>;
14
18
  listUseableAssetNames: () => Promise<string[]>;
15
19
  scanForDevices: () => Promise<void>;
16
20
  canAccessAsset: ({ assetName }: import("./module/interfaces.js").CanAccessAssetParams) => Promise<boolean>;
@@ -25,6 +25,10 @@ export declare class HardwareWallets implements HardwareSignerProvider {
25
25
  signMessage: ({ assetName, derivationPath, message }: SignMessageParams) => Promise<any>;
26
26
  isDeviceConnected: () => Promise<boolean>;
27
27
  scanForDevices: () => Promise<void>;
28
+ getAvailableDevices: () => Promise<{
29
+ model: ("blue" | "nanoS" | "nanoSP" | "nanoX" | "stax" | "europa") | ("1" | "t" | "Safe 3" | "Safe 5") | "unknown";
30
+ name: string;
31
+ }[]>;
28
32
  canAccessAsset: ({ assetName }: CanAccessAssetParams) => Promise<boolean>;
29
33
  listUseableAssetNames: () => Promise<string[]>;
30
34
  ensureApplicationIsOpened: ({ assetName }: EnsureApplicationIsOpenedParams) => Promise<void>;
@@ -53,7 +53,7 @@ export class HardwareWallets {
53
53
  break;
54
54
  }
55
55
  if (error.name === 'DisconnectedDeviceDuringOperation') {
56
- await this.#requestUserAction({
56
+ this.#requestUserAction({
57
57
  scenario,
58
58
  baseAssetName,
59
59
  });
@@ -118,6 +118,13 @@ export class HardwareWallets {
118
118
  this.#ledgerDiscovery.stopScan(true);
119
119
  return this.#ledgerDiscovery.scan();
120
120
  };
121
+ getAvailableDevices = async () => {
122
+ const devices = await this.#ledgerDiscovery.list();
123
+ return devices.map((device) => ({
124
+ model: device.model,
125
+ name: device.name,
126
+ }));
127
+ };
121
128
  canAccessAsset = async ({ assetName }) => {
122
129
  const asset = this.#assetsModule.getAsset(assetName);
123
130
  const device = await this.#ledgerDiscovery.getFirstDevice();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/hardware-wallets",
3
- "version": "1.1.2",
3
+ "version": "1.2.1",
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": {
@@ -22,23 +22,24 @@
22
22
  "scripts": {
23
23
  "build": "run -T tsc --build tsconfig.build.json",
24
24
  "clean": "run -T tsc --build --clean",
25
- "lint": "run -T eslint . --ignore-path ../../.gitignore",
25
+ "lint": "run -T eslint .",
26
26
  "lint:fix": "yarn lint --fix",
27
27
  "test": "run -T jest",
28
28
  "prepublishOnly": "yarn run -T build --scope @exodus/hardware-wallets"
29
29
  },
30
30
  "dependencies": {
31
- "@exodus/models": "^11.7.0",
31
+ "@exodus/models": "^12.0.1",
32
32
  "@exodus/wild-emitter": "^1.1.0",
33
33
  "delay": "^5.0.0",
34
34
  "minimalistic-assert": "^1.0.1",
35
35
  "randombytes": "^2.1.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@exodus/atoms": "^8.0.0",
38
+ "@exodus/atoms": "^8.1.1",
39
39
  "@exodus/hw-common": "^2.3.0",
40
40
  "@exodus/logger": "^1.2.2",
41
- "@exodus/public-key-store": "^1.2.2"
41
+ "@exodus/public-key-store": "^1.2.2",
42
+ "@types/randombytes": "^2.0.3"
42
43
  },
43
- "gitHead": "007b39adfd80a3f8367b46999f006a6904dfd002"
44
+ "gitHead": "4b5ea436184efe7a8c6017705893436905cd8c2f"
44
45
  }