@exodus/hw-ledger 2.7.0 → 2.8.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,22 @@
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
+ ## [2.8.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.8.0...@exodus/hw-ledger@2.8.1) (2024-07-10)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **ledger:** fix selectors ([#7744](https://github.com/ExodusMovement/exodus-hydra/issues/7744)) ([11ad709](https://github.com/ExodusMovement/exodus-hydra/commit/11ad7098314c1a7dee014765bfc0500d9636b4df))
11
+
12
+ ## [2.8.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.7.0...@exodus/hw-ledger@2.8.0) (2024-07-10)
13
+
14
+ ### Features
15
+
16
+ - **ledger:** add redux module ([#7734](https://github.com/ExodusMovement/exodus-hydra/issues/7734)) ([a26cb0a](https://github.com/ExodusMovement/exodus-hydra/commit/a26cb0ae76730d20ad6bbbb931f7c0f28094dbf4))
17
+
18
+ ### Bug Fixes
19
+
20
+ - **ledger:** add missing atom ([#7731](https://github.com/ExodusMovement/exodus-hydra/issues/7731)) ([34b77d5](https://github.com/ExodusMovement/exodus-hydra/commit/34b77d5f3a7a1aca97646137e94b42758e5aaa85))
21
+
6
22
  ## [2.7.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.6.0...@exodus/hw-ledger@2.7.0) (2024-07-04)
7
23
 
8
24
  ### Features
package/lib/index.d.ts CHANGED
@@ -2,16 +2,6 @@ import type { HwLedgerConfig } from './module/types';
2
2
  declare const hardwareWalletLedger: ({ bluetoothScannerTimeout, }?: Partial<HwLedgerConfig>) => {
3
3
  readonly id: "hardwareWalletLedger";
4
4
  readonly definitions: readonly [{
5
- readonly definition: {
6
- readonly id: "ledgerDiscovery";
7
- readonly type: "module";
8
- readonly factory: (deps: import("./module").Dependencies) => import("./module").LedgerDiscovery;
9
- readonly dependencies: readonly ["config", "logger", "transportsFactories"];
10
- };
11
- readonly config: {
12
- readonly bluetoothScannerTimeout: number;
13
- };
14
- }, {
15
5
  readonly definition: {
16
6
  readonly id: "bluetoothEnabledAtom";
17
7
  readonly type: "atom";
@@ -42,6 +32,16 @@ declare const hardwareWalletLedger: ({ bluetoothScannerTimeout, }?: Partial<HwLe
42
32
  };
43
33
  readonly dependencies: readonly ["logger", "transportsFactories", "bluetoothEnabledAtom", "bluetoothScanningAtom", "port"];
44
34
  };
35
+ }, {
36
+ readonly definition: {
37
+ readonly id: "ledgerDiscovery";
38
+ readonly type: "module";
39
+ readonly factory: (deps: import("./module").Dependencies) => import("./module").LedgerDiscovery;
40
+ readonly dependencies: readonly ["config", "logger", "transportsFactories", "bluetoothScanningAtom"];
41
+ };
42
+ readonly config: {
43
+ readonly bluetoothScannerTimeout: number;
44
+ };
45
45
  }];
46
46
  };
47
47
  export default hardwareWalletLedger;
package/lib/index.js CHANGED
@@ -5,10 +5,6 @@ const hardwareWalletLedger = ({ bluetoothScannerTimeout = 10000, } = {}) => {
5
5
  return {
6
6
  id: 'hardwareWalletLedger',
7
7
  definitions: [
8
- {
9
- definition: ledgerDiscoveryDefinition,
10
- config: { bluetoothScannerTimeout },
11
- },
12
8
  {
13
9
  definition: bluetoothEnabledAtomDefinition,
14
10
  },
@@ -18,6 +14,10 @@ const hardwareWalletLedger = ({ bluetoothScannerTimeout = 10000, } = {}) => {
18
14
  {
19
15
  definition: hardwareWalletLedgerPluginDefinition,
20
16
  },
17
+ {
18
+ definition: ledgerDiscoveryDefinition,
19
+ config: { bluetoothScannerTimeout },
20
+ },
21
21
  ],
22
22
  };
23
23
  };
@@ -20,6 +20,6 @@ declare const _default: {
20
20
  readonly id: "ledgerDiscovery";
21
21
  readonly type: "module";
22
22
  readonly factory: (deps: Dependencies) => LedgerDiscovery;
23
- readonly dependencies: readonly ["config", "logger", "transportsFactories"];
23
+ readonly dependencies: readonly ["config", "logger", "transportsFactories", "bluetoothScanningAtom"];
24
24
  };
25
25
  export default _default;
@@ -129,5 +129,5 @@ export default {
129
129
  id: MODULE_ID,
130
130
  type: 'module',
131
131
  factory: createLedgerDiscovery,
132
- dependencies: ['config', 'logger', 'transportsFactories'],
132
+ dependencies: ['config', 'logger', 'transportsFactories', 'bluetoothScanningAtom'],
133
133
  };
@@ -0,0 +1,2 @@
1
+ declare const id = "hardwareWalletLedger";
2
+ export default id;
@@ -0,0 +1,2 @@
1
+ const id = 'hardwareWalletLedger';
2
+ export default id;
@@ -0,0 +1,30 @@
1
+ import { type LedgerHardwareWalletState } from './initial-state';
2
+ declare const exchangeReduxDefinition: {
3
+ readonly id: "hardwareWalletLedger";
4
+ readonly type: "redux-module";
5
+ readonly initialState: LedgerHardwareWalletState;
6
+ readonly eventReducers: {
7
+ readonly bluetoothEnabled: (state: LedgerHardwareWalletState, payload: boolean) => {
8
+ bluetoothEnabled: boolean;
9
+ bluetoothScanning: boolean;
10
+ };
11
+ readonly bluetoothScanning: (state: LedgerHardwareWalletState, payload: boolean) => {
12
+ bluetoothScanning: boolean;
13
+ bluetoothEnabled: boolean;
14
+ };
15
+ };
16
+ readonly selectorDefinitions: ({
17
+ readonly id: "bluetoothEnabled";
18
+ readonly resultFunction: (state: LedgerHardwareWalletState) => boolean;
19
+ readonly dependencies: readonly [{
20
+ readonly selector: string;
21
+ }];
22
+ } | {
23
+ readonly id: "bluetoothScanning";
24
+ readonly resultFunction: (state: LedgerHardwareWalletState) => boolean;
25
+ readonly dependencies: readonly [{
26
+ readonly selector: string;
27
+ }];
28
+ })[];
29
+ };
30
+ export default exchangeReduxDefinition;
@@ -0,0 +1,20 @@
1
+ import id from './id';
2
+ import initialState from './initial-state';
3
+ import selectorDefinitions from './selectors';
4
+ const exchangeReduxDefinition = {
5
+ id,
6
+ type: 'redux-module',
7
+ initialState,
8
+ eventReducers: {
9
+ bluetoothEnabled: (state, payload) => ({
10
+ ...state,
11
+ bluetoothEnabled: payload,
12
+ }),
13
+ bluetoothScanning: (state, payload) => ({
14
+ ...state,
15
+ bluetoothScanning: payload,
16
+ }),
17
+ },
18
+ selectorDefinitions,
19
+ };
20
+ export default exchangeReduxDefinition;
@@ -0,0 +1,6 @@
1
+ export type LedgerHardwareWalletState = {
2
+ bluetoothEnabled: boolean;
3
+ bluetoothScanning: boolean;
4
+ };
5
+ declare const initialState: LedgerHardwareWalletState;
6
+ export default initialState;
@@ -0,0 +1,5 @@
1
+ const initialState = {
2
+ bluetoothEnabled: false,
3
+ bluetoothScanning: false,
4
+ };
5
+ export default initialState;
@@ -0,0 +1,9 @@
1
+ import type { LedgerHardwareWalletState } from '../initial-state';
2
+ declare const bluetoothEnabledSelectorDefinition: {
3
+ readonly id: "bluetoothEnabled";
4
+ readonly resultFunction: (state: LedgerHardwareWalletState) => boolean;
5
+ readonly dependencies: readonly [{
6
+ readonly selector: string;
7
+ }];
8
+ };
9
+ export default bluetoothEnabledSelectorDefinition;
@@ -0,0 +1,8 @@
1
+ import { MY_STATE } from '@exodus/redux-dependency-injection';
2
+ const resultFunction = (state) => state.bluetoothEnabled;
3
+ const bluetoothEnabledSelectorDefinition = {
4
+ id: 'bluetoothEnabled',
5
+ resultFunction,
6
+ dependencies: [{ selector: MY_STATE }],
7
+ };
8
+ export default bluetoothEnabledSelectorDefinition;
@@ -0,0 +1,9 @@
1
+ import type { LedgerHardwareWalletState } from '../initial-state';
2
+ declare const bluetoothScanningSelectorDefinition: {
3
+ readonly id: "bluetoothScanning";
4
+ readonly resultFunction: (state: LedgerHardwareWalletState) => boolean;
5
+ readonly dependencies: readonly [{
6
+ readonly selector: string;
7
+ }];
8
+ };
9
+ export default bluetoothScanningSelectorDefinition;
@@ -0,0 +1,8 @@
1
+ import { MY_STATE } from '@exodus/redux-dependency-injection';
2
+ const resultFunction = (state) => state.bluetoothScanning;
3
+ const bluetoothScanningSelectorDefinition = {
4
+ id: 'bluetoothScanning',
5
+ resultFunction,
6
+ dependencies: [{ selector: MY_STATE }],
7
+ };
8
+ export default bluetoothScanningSelectorDefinition;
@@ -0,0 +1,14 @@
1
+ declare const ledgerSelectors: ({
2
+ readonly id: "bluetoothEnabled";
3
+ readonly resultFunction: (state: import("../initial-state").LedgerHardwareWalletState) => boolean;
4
+ readonly dependencies: readonly [{
5
+ readonly selector: string;
6
+ }];
7
+ } | {
8
+ readonly id: "bluetoothScanning";
9
+ readonly resultFunction: (state: import("../initial-state").LedgerHardwareWalletState) => boolean;
10
+ readonly dependencies: readonly [{
11
+ readonly selector: string;
12
+ }];
13
+ })[];
14
+ export default ledgerSelectors;
@@ -0,0 +1,4 @@
1
+ import bluetoothEnabledSelectorDefinition from './bluetoothEnabled';
2
+ import bluetoothScanningSelectorDefinition from './bluetoothScanning';
3
+ const ledgerSelectors = [bluetoothEnabledSelectorDefinition, bluetoothScanningSelectorDefinition];
4
+ export default ledgerSelectors;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/hw-ledger",
3
- "version": "2.7.0",
3
+ "version": "2.8.1",
4
4
  "description": "The ledger module",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "repository": {
@@ -39,6 +39,7 @@
39
39
  "@exodus/ledgerhq-devices": "^8.1.0-exodus.3",
40
40
  "@exodus/ledgerhq-hw-app-eth": "^6.33.7-exodus.8",
41
41
  "@exodus/module": "^1.2.2",
42
+ "@exodus/redux-dependency-injection": "^3.0.0",
42
43
  "@exodus/secp256k1": "^4.0.2-exodus.0",
43
44
  "@ledgerhq/hw-app-solana": "^7.0.10",
44
45
  "@ledgerhq/hw-transport": "^6.28.5",
@@ -66,9 +67,10 @@
66
67
  "ecpair": "^2.1.0",
67
68
  "istanbul-combine": "^0.3.0",
68
69
  "jest-when": "^3.5.2",
70
+ "redux": "^4.2.1",
69
71
  "tiny-secp256k1": "^2.2.3",
70
72
  "ts-jest": "^29.0.3",
71
73
  "typescript": "^4.7.3"
72
74
  },
73
- "gitHead": "c53411aed8e084439cc9d1a5450fa65266f834ab"
75
+ "gitHead": "53b2dc8a2362537c92f3be5b23c6f71e13980d81"
74
76
  }