@exodus/hardware-wallets 3.0.1 → 3.1.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 +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 +2 -0
- package/lib/module/interfaces.d.ts +1 -0
- 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.1.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@3.0.2...@exodus/hardware-wallets@3.1.0) (2025-10-01)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- feat(hardware-wallets): add baseAssetName to signRequest (#13962)
|
|
11
|
+
|
|
12
|
+
## [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)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- fix(hardware-wallets): connected assets memoization by asset list (#13471)
|
|
17
|
+
|
|
6
18
|
## [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)
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
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: {
|
|
@@ -84,6 +84,7 @@ export class HardwareWallets {
|
|
|
84
84
|
id,
|
|
85
85
|
scenario: 'error',
|
|
86
86
|
error: _error,
|
|
87
|
+
baseAssetName: this.#signingRequest.baseAssetName,
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
};
|
|
@@ -114,6 +115,7 @@ export class HardwareWallets {
|
|
|
114
115
|
const deferred = pDefer();
|
|
115
116
|
this.#signingRequest = {
|
|
116
117
|
id,
|
|
118
|
+
baseAssetName,
|
|
117
119
|
sign: async ({ device }) => {
|
|
118
120
|
await this.#updateSigningRequest({
|
|
119
121
|
id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/hardware-wallets",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.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": {
|
|
@@ -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": "49fc43a24e3c998b9a2f3224b22649e61c8d25a5"
|
|
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"}
|