@exodus/hardware-wallets 3.0.0 → 3.0.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 +12 -0
- package/lib/atoms/index.d.ts +3 -3
- package/lib/atoms/index.js +12 -5
- package/lib/index.d.ts +2 -2
- package/lib/module/hardware-wallets.js +5 -5
- package/package.json +3 -3
- package/lib/tsconfig.build.tsbuildinfo +0 -1
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
|
+
## [3.0.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@3.0.1...@exodus/hardware-wallets@3.0.2) (2025-08-08)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- fix(hardware-wallets): connected assets memoization by asset list (#13471)
|
|
11
|
+
|
|
12
|
+
## [3.0.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@3.0.0...@exodus/hardware-wallets@3.0.1) (2025-06-17)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- fix: retry logic on hardware signing (#12944)
|
|
17
|
+
|
|
6
18
|
## [3.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@2.1.0...@exodus/hardware-wallets@3.0.0) (2025-06-16)
|
|
7
19
|
|
|
8
20
|
### ⚠ BREAKING CHANGES
|
package/lib/atoms/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ export { hardwareWalletSigningRequestsAtomDefinition } from './hardwareWalletSig
|
|
|
2
2
|
type WalletAccountName = string;
|
|
3
3
|
type AssetName = string;
|
|
4
4
|
export type WalletAccountNameToConnectedAssetNamesMap = Record<WalletAccountName, AssetName[]>;
|
|
5
|
-
export declare const createHardwareWalletConnectedAssetNamesAtom: ({
|
|
5
|
+
export declare const createHardwareWalletConnectedAssetNamesAtom: ({ hardwareWalletPublicKeysAtom, assetsModule, walletAccountsAtom, availableAssetNamesAtom, }: any) => import("@exodus/atoms").ReadonlyAtom<unknown>;
|
|
6
6
|
export declare const hardwareWalletConnectedAssetNamesAtomDefinition: {
|
|
7
7
|
readonly id: "hardwareWalletConnectedAssetNamesAtom";
|
|
8
8
|
readonly type: "atom";
|
|
9
|
-
readonly factory: ({
|
|
10
|
-
readonly dependencies: readonly ["hardwareWalletPublicKeysAtom", "assetsModule", "walletAccountsAtom"];
|
|
9
|
+
readonly factory: ({ hardwareWalletPublicKeysAtom, assetsModule, walletAccountsAtom, availableAssetNamesAtom, }: any) => import("@exodus/atoms").ReadonlyAtom<unknown>;
|
|
10
|
+
readonly dependencies: readonly ["hardwareWalletPublicKeysAtom", "assetsModule", "walletAccountsAtom", "availableAssetNamesAtom"];
|
|
11
11
|
};
|
package/lib/atoms/index.js
CHANGED
|
@@ -2,10 +2,11 @@ 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 const createHardwareWalletConnectedAssetNamesAtom = ({
|
|
6
|
-
const selector = memoize(({ hardwareWalletPublicKeys, walletAccounts }) => {
|
|
5
|
+
export const createHardwareWalletConnectedAssetNamesAtom = ({ hardwareWalletPublicKeysAtom, assetsModule, walletAccountsAtom, availableAssetNamesAtom, }) => {
|
|
6
|
+
const selector = memoize(({ hardwareWalletPublicKeys, walletAccounts, availableAssetNames }) => {
|
|
7
7
|
const result = Object.create(null);
|
|
8
8
|
const assets = assetsModule.getAssets();
|
|
9
|
+
const availableAssets = Object.values(assets).filter((asset) => availableAssetNames.includes(asset.name));
|
|
9
10
|
for (const [walletAccountName, walletAccount] of Object.entries(walletAccounts)) {
|
|
10
11
|
if (!walletAccount.isHardware) {
|
|
11
12
|
continue;
|
|
@@ -21,17 +22,18 @@ export const createHardwareWalletConnectedAssetNamesAtom = ({ assetsModule, hard
|
|
|
21
22
|
return match ? match[1] : null;
|
|
22
23
|
})
|
|
23
24
|
.filter(Boolean));
|
|
24
|
-
const syncedAssetNames =
|
|
25
|
+
const syncedAssetNames = availableAssets
|
|
25
26
|
.filter((asset) => bip44Values.has(String(asset.baseAsset.bip44 - HARDENED_OFFSET)))
|
|
26
27
|
.map((asset) => asset.name);
|
|
27
28
|
result[walletAccountName] = syncedAssetNames;
|
|
28
29
|
}
|
|
29
30
|
return result;
|
|
30
|
-
}, (
|
|
31
|
+
}, ({ hardwareWalletPublicKeys, walletAccounts, availableAssetNames }) => `${JSON.stringify(hardwareWalletPublicKeys)}_${JSON.stringify(walletAccounts)}_${JSON.stringify(availableAssetNames.join(','))}`);
|
|
31
32
|
return compute({
|
|
32
33
|
atom: combine({
|
|
33
34
|
hardwareWalletPublicKeys: hardwareWalletPublicKeysAtom,
|
|
34
35
|
walletAccounts: walletAccountsAtom,
|
|
36
|
+
availableAssetNames: availableAssetNamesAtom,
|
|
35
37
|
}),
|
|
36
38
|
selector,
|
|
37
39
|
});
|
|
@@ -40,5 +42,10 @@ export const hardwareWalletConnectedAssetNamesAtomDefinition = {
|
|
|
40
42
|
id: 'hardwareWalletConnectedAssetNamesAtom',
|
|
41
43
|
type: 'atom',
|
|
42
44
|
factory: createHardwareWalletConnectedAssetNamesAtom,
|
|
43
|
-
dependencies: [
|
|
45
|
+
dependencies: [
|
|
46
|
+
'hardwareWalletPublicKeysAtom',
|
|
47
|
+
'assetsModule',
|
|
48
|
+
'walletAccountsAtom',
|
|
49
|
+
'availableAssetNamesAtom',
|
|
50
|
+
],
|
|
44
51
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -42,8 +42,8 @@ declare const hardwareWallets: () => {
|
|
|
42
42
|
readonly definition: {
|
|
43
43
|
readonly id: "hardwareWalletConnectedAssetNamesAtom";
|
|
44
44
|
readonly type: "atom";
|
|
45
|
-
readonly factory: ({
|
|
46
|
-
readonly dependencies: readonly ["hardwareWalletPublicKeysAtom", "assetsModule", "walletAccountsAtom"];
|
|
45
|
+
readonly factory: ({ hardwareWalletPublicKeysAtom, assetsModule, walletAccountsAtom, availableAssetNamesAtom, }: any) => import("libraries/atoms/lib/index.js").ReadonlyAtom<unknown>;
|
|
46
|
+
readonly dependencies: readonly ["hardwareWalletPublicKeysAtom", "assetsModule", "walletAccountsAtom", "availableAssetNamesAtom"];
|
|
47
47
|
};
|
|
48
48
|
}, {
|
|
49
49
|
readonly definition: {
|
|
@@ -65,14 +65,14 @@ export class HardwareWallets {
|
|
|
65
65
|
request.resolve(result);
|
|
66
66
|
}
|
|
67
67
|
catch (error) {
|
|
68
|
+
if (this.#signingRequest?.id !== id) {
|
|
69
|
+
this.#logger.warn(`Signing request with id: ${id} was cancelled, not retrying`);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
68
72
|
const _error = error;
|
|
69
|
-
if (['DisconnectedDevice', 'DisconnectedDeviceDuringOperation'].includes(
|
|
73
|
+
if (['DisconnectedDevice', 'DisconnectedDeviceDuringOperation'].includes(_error.name)) {
|
|
70
74
|
this.#logger.debug(`Device disconnected during signing request, likely due to app opening: ${id}`, _error);
|
|
71
75
|
await delay(300);
|
|
72
|
-
if (this.#signingRequest?.id !== id) {
|
|
73
|
-
this.#logger.warn(`Signing request with id: ${id} was cancelled, not retrying`);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
76
|
await this.retrySigningRequest(id);
|
|
77
77
|
return;
|
|
78
78
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/hardware-wallets",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
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": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"!**/__tests__/**"
|
|
21
21
|
],
|
|
22
22
|
"scripts": {
|
|
23
|
-
"build": "run -T tsc
|
|
23
|
+
"build": "run -T tsc -p tsconfig.build.json",
|
|
24
24
|
"clean": "run -T tsc --build --clean",
|
|
25
25
|
"lint": "run -T eslint .",
|
|
26
26
|
"lint:fix": "yarn lint --fix",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "918fd19c3b78e2400f8e98a0e4d6a3cb79368e61"
|
|
56
56
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/types.d.ts","../src/api/index.ts","../src/atoms/hardwareWalletSigningRequestsAtom.ts","../src/atoms/index.ts","../src/module/hardware-wallets.ts","../src/module/index.ts","../src/module/interfaces.ts","../src/plugin/index.ts","../src/redux/id.ts","../src/redux/index.ts","../src/redux/initial-state.ts","../src/redux/selectors/getSigningRequests.ts","../src/redux/selectors/index.ts","../src/redux/selectors/isAssetNameConnectedForWalletAccount.ts","../src/shared/types.d.ts"],"version":"5.8.3"}
|