@exodus/hardware-wallets 3.3.0 → 3.4.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 +1 -1
- package/lib/atoms/index.d.ts +0 -1
- package/lib/atoms/index.js +0 -1
- package/lib/index.d.ts +2 -9
- package/lib/index.js +1 -4
- package/lib/module/hardware-wallets.d.ts +5 -5
- package/lib/module/hardware-wallets.js +15 -9
- package/lib/module/interfaces.d.ts +2 -2
- package/package.json +3 -3
- package/lib/atoms/hardwareWalletPairingPromptAtom.d.ts +0 -6
- package/lib/atoms/hardwareWalletPairingPromptAtom.js +0 -9
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
|
+
## [3.4.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@3.3.0...@exodus/hardware-wallets@3.4.0) (2025-11-13)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- feat: trezor bluetooth (#14374)
|
|
11
|
+
|
|
6
12
|
## [3.3.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@3.2.0...@exodus/hardware-wallets@3.3.0) (2025-10-27)
|
|
7
13
|
|
|
8
14
|
### Features
|
package/lib/api/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ declare const hardwareWalletsApiDefinition: {
|
|
|
14
14
|
name: string;
|
|
15
15
|
}[]>;
|
|
16
16
|
listUseableAssetNames: () => Promise<string[]>;
|
|
17
|
-
scanForDevices: () => Promise<void>;
|
|
17
|
+
scanForDevices: (deviceType?: import("libraries/hw-common/lib/types.js").HardwareWalletManufacturer) => Promise<void>;
|
|
18
18
|
canAccessAsset: ({ assetName }: import("../module/interfaces.js").CanAccessAssetParams) => Promise<boolean>;
|
|
19
19
|
ensureApplicationIsOpened: ({ assetName }: import("../module/interfaces.js").EnsureApplicationIsOpenedParams) => Promise<void>;
|
|
20
20
|
scan: ({ assetName, accountIndexes, addressLimit, addressOffset, }: import("../module/interfaces.js").ScanParams) => Promise<import("../module/interfaces.js").ScanResult>;
|
package/lib/atoms/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { hardwareWalletSigningRequestsAtomDefinition } from './hardwareWalletSigningRequestsAtom.js';
|
|
2
|
-
export { hardwareWalletPairingPromptAtomDefinition } from './hardwareWalletPairingPromptAtom.js';
|
|
3
2
|
type WalletAccountName = string;
|
|
4
3
|
type AssetName = string;
|
|
5
4
|
export type WalletAccountNameToConnectedAssetNamesMap = Record<WalletAccountName, AssetName[]>;
|
package/lib/atoms/index.js
CHANGED
|
@@ -2,7 +2,6 @@ import { combine, compute } from '@exodus/atoms';
|
|
|
2
2
|
import { memoize } from '@exodus/basic-utils';
|
|
3
3
|
import { HARDENED_OFFSET } from '@exodus/bip32';
|
|
4
4
|
export { hardwareWalletSigningRequestsAtomDefinition } from './hardwareWalletSigningRequestsAtom.js';
|
|
5
|
-
export { hardwareWalletPairingPromptAtomDefinition } from './hardwareWalletPairingPromptAtom.js';
|
|
6
5
|
export const createHardwareWalletConnectedAssetNamesAtom = ({ hardwareWalletPublicKeysAtom, assetsModule, walletAccountsAtom, availableAssetNamesAtom, }) => {
|
|
7
6
|
const selector = memoize(({ hardwareWalletPublicKeys, walletAccounts, availableAssetNames }) => {
|
|
8
7
|
const result = Object.create(null);
|
package/lib/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ declare const hardwareWallets: () => {
|
|
|
17
17
|
name: string;
|
|
18
18
|
}[]>;
|
|
19
19
|
listUseableAssetNames: () => Promise<string[]>;
|
|
20
|
-
scanForDevices: () => Promise<void>;
|
|
20
|
+
scanForDevices: (deviceType?: import("libraries/hw-common/lib/types.js").HardwareWalletManufacturer) => Promise<void>;
|
|
21
21
|
canAccessAsset: ({ assetName }: import("./module/interfaces.js").CanAccessAssetParams) => Promise<boolean>;
|
|
22
22
|
ensureApplicationIsOpened: ({ assetName }: import("./module/interfaces.js").EnsureApplicationIsOpenedParams) => Promise<void>;
|
|
23
23
|
scan: ({ assetName, accountIndexes, addressLimit, addressOffset, }: import("./module/interfaces.js").ScanParams) => Promise<import("./module/interfaces.js").ScanResult>;
|
|
@@ -37,7 +37,7 @@ declare const hardwareWallets: () => {
|
|
|
37
37
|
readonly id: "hardwareWallets";
|
|
38
38
|
readonly type: "module";
|
|
39
39
|
readonly factory: (opts: import("./module/hardware-wallets.js").Dependencies) => import("./module/hardware-wallets.js").HardwareWallets;
|
|
40
|
-
readonly dependencies: readonly ["assetsModule", "logger", "ledgerDiscovery", "trezorDiscovery", "publicKeyStore", "hardwareWalletSigningRequestsAtom", "
|
|
40
|
+
readonly dependencies: readonly ["assetsModule", "logger", "ledgerDiscovery", "trezorDiscovery", "publicKeyStore", "hardwareWalletSigningRequestsAtom", "wallet", "walletAccountsAtom", "walletAccounts"];
|
|
41
41
|
readonly public: true;
|
|
42
42
|
};
|
|
43
43
|
}, {
|
|
@@ -55,13 +55,6 @@ declare const hardwareWallets: () => {
|
|
|
55
55
|
readonly dependencies: readonly [];
|
|
56
56
|
readonly public: false;
|
|
57
57
|
};
|
|
58
|
-
}, {
|
|
59
|
-
readonly definition: {
|
|
60
|
-
readonly id: "hardwareWalletPairingPromptAtom";
|
|
61
|
-
readonly type: "atom";
|
|
62
|
-
readonly factory: () => import("@exodus/atoms").Atom<boolean>;
|
|
63
|
-
readonly public: true;
|
|
64
|
-
};
|
|
65
58
|
}, {
|
|
66
59
|
readonly definition: {
|
|
67
60
|
readonly id: "hardwareWalletsPlugin";
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import hardwareWalletsApiDefinition from './api/index.js';
|
|
2
2
|
import hardwareWalletsModuleDefinition from './module/hardware-wallets.js';
|
|
3
|
-
import { hardwareWalletConnectedAssetNamesAtomDefinition, hardwareWalletSigningRequestsAtomDefinition,
|
|
3
|
+
import { hardwareWalletConnectedAssetNamesAtomDefinition, hardwareWalletSigningRequestsAtomDefinition, } from './atoms/index.js';
|
|
4
4
|
import hardwareWalletsPluginDefinition from './plugin/index.js';
|
|
5
5
|
const hardwareWallets = () => {
|
|
6
6
|
return {
|
|
@@ -18,9 +18,6 @@ const hardwareWallets = () => {
|
|
|
18
18
|
{
|
|
19
19
|
definition: hardwareWalletSigningRequestsAtomDefinition,
|
|
20
20
|
},
|
|
21
|
-
{
|
|
22
|
-
definition: hardwareWalletPairingPromptAtomDefinition,
|
|
23
|
-
},
|
|
24
21
|
{
|
|
25
22
|
definition: hardwareWalletsPluginDefinition,
|
|
26
23
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WalletAccount } from '@exodus/models';
|
|
2
2
|
import Emitter from '@exodus/wild-emitter';
|
|
3
3
|
import type { HardwareSignerProvider, CanAccessAssetParams, CreateParams, StoreSyncedKeysParams, ScanParams, SyncParams, EnsureApplicationIsOpenedParams, SignTransactionParams, ScanResult, SyncedKeysId, GetAddressParams, RequireDeviceForParams, ProcessPairingCodeParams, SigningRequestState } from './interfaces.js';
|
|
4
|
-
import type { HardwareWalletDiscovery, SignMessageParams } from '@exodus/hw-common';
|
|
4
|
+
import type { HardwareWalletDiscovery, HardwareWalletManufacturer, SignMessageParams } from '@exodus/hw-common';
|
|
5
5
|
import type { Atom } from '@exodus/atoms';
|
|
6
6
|
import type { IPublicKeyStore } from '@exodus/public-key-provider/lib/module/store/types';
|
|
7
7
|
import type { Logger } from '@exodus/logger';
|
|
@@ -11,10 +11,10 @@ export type Dependencies = {
|
|
|
11
11
|
trezorDiscovery: HardwareWalletDiscovery & {
|
|
12
12
|
connected: boolean;
|
|
13
13
|
submitPairingCode: (code: string) => Promise<any>;
|
|
14
|
+
clearPairingPrompt: () => Promise<void>;
|
|
14
15
|
};
|
|
15
16
|
logger: Logger;
|
|
16
17
|
hardwareWalletSigningRequestsAtom: Atom<SigningRequestState>;
|
|
17
|
-
hardwareWalletPairingPromptAtom: Atom<boolean>;
|
|
18
18
|
publicKeyStore: IPublicKeyStore;
|
|
19
19
|
wallet: any;
|
|
20
20
|
walletAccountsAtom: Atom<WalletAccount>;
|
|
@@ -25,13 +25,13 @@ export type Dependencies = {
|
|
|
25
25
|
export declare class HardwareWallets implements HardwareSignerProvider {
|
|
26
26
|
#private;
|
|
27
27
|
readonly events: Emitter<string, any>;
|
|
28
|
-
constructor({ assetsModule, ledgerDiscovery, trezorDiscovery, logger, hardwareWalletSigningRequestsAtom,
|
|
28
|
+
constructor({ assetsModule, ledgerDiscovery, trezorDiscovery, logger, hardwareWalletSigningRequestsAtom, publicKeyStore, wallet, walletAccountsAtom, walletAccounts, }: Dependencies);
|
|
29
29
|
retrySigningRequest: (id: string) => Promise<void>;
|
|
30
30
|
cancelSigningRequest: (id: string, fromUI: boolean) => Promise<void>;
|
|
31
31
|
signTransaction: ({ baseAssetName, unsignedTx, walletAccount, multisigData, }: SignTransactionParams) => Promise<any>;
|
|
32
32
|
signMessage: ({ assetName, derivationPath, message }: SignMessageParams) => Promise<any>;
|
|
33
33
|
isDeviceConnected: () => Promise<boolean>;
|
|
34
|
-
scanForDevices: () => Promise<void>;
|
|
34
|
+
scanForDevices: (deviceType?: HardwareWalletManufacturer) => Promise<void>;
|
|
35
35
|
getAvailableDevices: () => Promise<{
|
|
36
36
|
model: import("@exodus/hw-common").HardwareWalletDeviceModels;
|
|
37
37
|
name: string;
|
|
@@ -55,7 +55,7 @@ declare const hardwareWalletsModuleDefinition: {
|
|
|
55
55
|
readonly id: "hardwareWallets";
|
|
56
56
|
readonly type: "module";
|
|
57
57
|
readonly factory: (opts: Dependencies) => HardwareWallets;
|
|
58
|
-
readonly dependencies: readonly ["assetsModule", "logger", "ledgerDiscovery", "trezorDiscovery", "publicKeyStore", "hardwareWalletSigningRequestsAtom", "
|
|
58
|
+
readonly dependencies: readonly ["assetsModule", "logger", "ledgerDiscovery", "trezorDiscovery", "publicKeyStore", "hardwareWalletSigningRequestsAtom", "wallet", "walletAccountsAtom", "walletAccounts"];
|
|
59
59
|
readonly public: true;
|
|
60
60
|
};
|
|
61
61
|
export default hardwareWalletsModuleDefinition;
|
|
@@ -13,21 +13,19 @@ export class HardwareWallets {
|
|
|
13
13
|
#logger;
|
|
14
14
|
#publicKeyStore;
|
|
15
15
|
#signingRequestAtom;
|
|
16
|
-
#pairingPromptAtom;
|
|
17
16
|
#wallet;
|
|
18
17
|
#walletAccountsAtom;
|
|
19
18
|
#walletAccounts;
|
|
20
19
|
#syncedKeysMap = new Map();
|
|
21
20
|
#signingRequest;
|
|
22
21
|
events = new Emitter();
|
|
23
|
-
constructor({ assetsModule, ledgerDiscovery, trezorDiscovery, logger, hardwareWalletSigningRequestsAtom,
|
|
22
|
+
constructor({ assetsModule, ledgerDiscovery, trezorDiscovery, logger, hardwareWalletSigningRequestsAtom, publicKeyStore, wallet, walletAccountsAtom, walletAccounts, }) {
|
|
24
23
|
this.#assetsModule = assetsModule;
|
|
25
24
|
this.#ledgerDiscovery = ledgerDiscovery;
|
|
26
25
|
this.#trezorDiscovery = trezorDiscovery;
|
|
27
26
|
this.#logger = logger;
|
|
28
27
|
this.#publicKeyStore = publicKeyStore;
|
|
29
28
|
this.#signingRequestAtom = hardwareWalletSigningRequestsAtom;
|
|
30
|
-
this.#pairingPromptAtom = hardwareWalletPairingPromptAtom;
|
|
31
29
|
this.#wallet = wallet;
|
|
32
30
|
this.#walletAccountsAtom = walletAccountsAtom;
|
|
33
31
|
this.#walletAccounts = walletAccounts;
|
|
@@ -164,9 +162,13 @@ export class HardwareWallets {
|
|
|
164
162
|
return this.#signGeneric({ baseAssetName, scenario: 'signMessage', sign });
|
|
165
163
|
};
|
|
166
164
|
isDeviceConnected = async () => {
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
try {
|
|
166
|
+
const devices = await this.#trezorDiscovery.list();
|
|
167
|
+
if (devices.length > 0) {
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
169
170
|
}
|
|
171
|
+
catch { }
|
|
170
172
|
try {
|
|
171
173
|
const devices = await this.#ledgerDiscovery.list();
|
|
172
174
|
return devices.length > 0;
|
|
@@ -175,10 +177,15 @@ export class HardwareWallets {
|
|
|
175
177
|
return false;
|
|
176
178
|
}
|
|
177
179
|
};
|
|
178
|
-
scanForDevices = async () => {
|
|
180
|
+
scanForDevices = async (deviceType) => {
|
|
179
181
|
this.#trezorDiscovery.stopScan(true);
|
|
180
182
|
this.#ledgerDiscovery.stopScan(true);
|
|
181
|
-
|
|
183
|
+
if (!deviceType || deviceType === 'ledger') {
|
|
184
|
+
await this.#ledgerDiscovery.scan();
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
await this.#trezorDiscovery.scan();
|
|
188
|
+
}
|
|
182
189
|
};
|
|
183
190
|
getAvailableDevices = async () => {
|
|
184
191
|
const [ledgers, trezors] = await Promise.all([
|
|
@@ -391,7 +398,7 @@ export class HardwareWallets {
|
|
|
391
398
|
return walletAccount;
|
|
392
399
|
};
|
|
393
400
|
clearPairingRequest = async () => {
|
|
394
|
-
await this.#
|
|
401
|
+
await this.#trezorDiscovery.clearPairingPrompt();
|
|
395
402
|
};
|
|
396
403
|
submitPairingCode = async ({ code }) => {
|
|
397
404
|
return this.#trezorDiscovery.submitPairingCode(code);
|
|
@@ -415,7 +422,6 @@ const hardwareWalletsModuleDefinition = {
|
|
|
415
422
|
'trezorDiscovery',
|
|
416
423
|
'publicKeyStore',
|
|
417
424
|
'hardwareWalletSigningRequestsAtom',
|
|
418
|
-
'hardwareWalletPairingPromptAtom',
|
|
419
425
|
'wallet',
|
|
420
426
|
'walletAccountsAtom',
|
|
421
427
|
'walletAccounts',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { WalletAccount } from '@exodus/models';
|
|
2
|
-
import type { HardwareWalletDeviceModels, HardwareWalletDevice, MultisigData, SignMessageParams } from '@exodus/hw-common';
|
|
2
|
+
import type { HardwareWalletDeviceModels, HardwareWalletDevice, HardwareWalletManufacturer, MultisigData, SignMessageParams } from '@exodus/hw-common';
|
|
3
3
|
import type KeyIdentifier from '@exodus/key-identifier';
|
|
4
4
|
export interface HardwareSignerProvider {
|
|
5
5
|
isDeviceConnected: () => Promise<boolean>;
|
|
6
|
-
scanForDevices: () => Promise<void>;
|
|
6
|
+
scanForDevices: (deviceType: HardwareWalletManufacturer) => Promise<void>;
|
|
7
7
|
canAccessAsset: ({ assetName }: CanAccessAssetParams) => Promise<boolean>;
|
|
8
8
|
listUseableAssetNames: () => Promise<string[]>;
|
|
9
9
|
ensureApplicationIsOpened: ({ assetName }: EnsureApplicationIsOpenedParams) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/hardware-wallets",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.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": {
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"@exodus/dependency-types": "^2.1.1",
|
|
47
47
|
"@exodus/key-identifier": "^1.3.0",
|
|
48
48
|
"@exodus/logger": "^1.2.3",
|
|
49
|
-
"@exodus/public-key-provider": "^4.2.
|
|
49
|
+
"@exodus/public-key-provider": "^4.2.1",
|
|
50
50
|
"redux": "^4.2.1"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public",
|
|
54
54
|
"provenance": false
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "781bdadc2bb8d8a749ade2dd01f3f7f62792363d"
|
|
57
57
|
}
|