@exodus/hardware-wallets 1.1.2 → 1.2.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 +6 -0
- package/lib/api/index.d.ts +4 -0
- package/lib/api/index.js +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/module/hardware-wallets.d.ts +4 -0
- package/lib/module/hardware-wallets.js +7 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@1.1.2...@exodus/hardware-wallets@1.2.0) (2024-08-16)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- add getAvailableDevices ([#8474](https://github.com/ExodusMovement/exodus-hydra/issues/8474)) ([377ef0d](https://github.com/ExodusMovement/exodus-hydra/commit/377ef0d2c4e25ac33085c638ec7bbfe5dff74efd))
|
|
11
|
+
|
|
6
12
|
## [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
13
|
|
|
8
14
|
### Bug Fixes
|
package/lib/api/index.d.ts
CHANGED
|
@@ -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>;
|
|
@@ -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.
|
|
3
|
+
"version": "1.2.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": {
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"@exodus/logger": "^1.2.2",
|
|
41
41
|
"@exodus/public-key-store": "^1.2.2"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "c01ac6f4a75a5af1e5f83c2cba4fe2b34d6617ef"
|
|
44
44
|
}
|