@exodus/hw-ledger 2.9.0 → 2.9.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 CHANGED
@@ -3,6 +3,16 @@
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.9.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.9.1...@exodus/hw-ledger@2.9.2) (2024-07-25)
7
+
8
+ ### Bug Fixes
9
+
10
+ - migrate definitions ([#8030](https://github.com/ExodusMovement/exodus-hydra/issues/8030)) ([d2dfde5](https://github.com/ExodusMovement/exodus-hydra/commit/d2dfde55dfa843eb52842f64b3aac3a6f9a59069))
11
+
12
+ ## [2.9.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.9.0...@exodus/hw-ledger@2.9.1) (2024-07-18)
13
+
14
+ **Note:** Version bump only for package @exodus/hw-ledger
15
+
6
16
  ## [2.9.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.8.1...@exodus/hw-ledger@2.9.0) (2024-07-16)
7
17
 
8
18
  ### Features
@@ -3,10 +3,12 @@ export declare const bluetoothStatusAtomDefinition: {
3
3
  readonly type: "atom";
4
4
  readonly factory: () => import("@exodus/atoms").Atom<boolean>;
5
5
  readonly dependencies: readonly [];
6
+ readonly public: true;
6
7
  };
7
8
  export declare const bluetoothScanningAtomDefinition: {
8
9
  readonly id: "bluetoothScanningAtom";
9
10
  readonly type: "atom";
10
11
  readonly factory: () => import("@exodus/atoms").Atom<boolean>;
11
12
  readonly dependencies: readonly [];
13
+ readonly public: true;
12
14
  };
@@ -4,10 +4,12 @@ export const bluetoothStatusAtomDefinition = {
4
4
  type: 'atom',
5
5
  factory: () => createInMemoryAtom({ defaultValue: false }),
6
6
  dependencies: [],
7
+ public: true,
7
8
  };
8
9
  export const bluetoothScanningAtomDefinition = {
9
10
  id: 'bluetoothScanningAtom',
10
11
  type: 'atom',
11
12
  factory: () => createInMemoryAtom({ defaultValue: false }),
12
13
  dependencies: [],
14
+ public: true,
13
15
  };
package/lib/index.d.ts CHANGED
@@ -7,6 +7,7 @@ declare const hardwareWalletLedger: ({ bluetoothScannerTimeout, }?: Partial<HwLe
7
7
  readonly type: "atom";
8
8
  readonly factory: () => import("libraries/atoms/lib").Atom<boolean>;
9
9
  readonly dependencies: readonly [];
10
+ readonly public: true;
10
11
  };
11
12
  }, {
12
13
  readonly definition: {
@@ -14,6 +15,7 @@ declare const hardwareWalletLedger: ({ bluetoothScannerTimeout, }?: Partial<HwLe
14
15
  readonly type: "atom";
15
16
  readonly factory: () => import("libraries/atoms/lib").Atom<boolean>;
16
17
  readonly dependencies: readonly [];
18
+ readonly public: true;
17
19
  };
18
20
  }, {
19
21
  readonly definition: {
@@ -31,6 +33,7 @@ declare const hardwareWalletLedger: ({ bluetoothScannerTimeout, }?: Partial<HwLe
31
33
  onStop: () => void;
32
34
  };
33
35
  readonly dependencies: readonly ["logger", "transportsFactories", "bluetoothStatusAtom", "bluetoothScanningAtom", "port"];
36
+ readonly public: true;
34
37
  };
35
38
  }, {
36
39
  readonly definition: {
@@ -38,6 +41,7 @@ declare const hardwareWalletLedger: ({ bluetoothScannerTimeout, }?: Partial<HwLe
38
41
  readonly type: "module";
39
42
  readonly factory: (deps: import("./module").Dependencies) => import("./module").LedgerDiscovery;
40
43
  readonly dependencies: readonly ["config", "logger", "transportsFactories", "bluetoothScanningAtom"];
44
+ readonly public: true;
41
45
  };
42
46
  readonly config: {
43
47
  readonly bluetoothScannerTimeout: number;
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { bluetoothStatusAtomDefinition, bluetoothScanningAtomDefinition } from './atoms';
2
2
  import ledgerDiscoveryDefinition from './module';
3
3
  import hardwareWalletLedgerPluginDefinition from './plugin';
4
- const hardwareWalletLedger = ({ bluetoothScannerTimeout = 10000, } = {}) => {
4
+ const hardwareWalletLedger = ({ bluetoothScannerTimeout = 10_000, } = {}) => {
5
5
  return {
6
6
  id: 'hardwareWalletLedger',
7
7
  definitions: [
@@ -3,6 +3,6 @@ declare const metadata: {
3
3
  applicationName: string;
4
4
  supportedVersions: string;
5
5
  }[];
6
- handler: (transport: import("@ledgerhq/hw-transport").default) => Promise<import("libraries/hw-common/lib").HardwareWalletAssetHandler<import("libraries/hw-common/lib").Message>>;
6
+ handler: (transport: import("@ledgerhq/hw-transport").default) => Promise<import("libraries/hw-common/lib").HardwareWalletAssetHandler>;
7
7
  };
8
8
  export default metadata;
@@ -3,6 +3,6 @@ declare const metadata: {
3
3
  applicationName: string;
4
4
  supportedVersions: string;
5
5
  }[];
6
- handler: (transport: import("@ledgerhq/hw-transport").default) => Promise<import("libraries/hw-common/lib").HardwareWalletAssetHandler<import("libraries/hw-common/lib").Message>>;
6
+ handler: (transport: import("@ledgerhq/hw-transport").default) => Promise<import("libraries/hw-common/lib").HardwareWalletAssetHandler>;
7
7
  };
8
8
  export default metadata;
@@ -25,12 +25,12 @@ export function assertBip44PathNumber(parts) {
25
25
  }
26
26
  export function buildBip44PathFromNumber(parts) {
27
27
  const [purpose, coin, account, chainIndex, addressIndex] = parts;
28
- const HARDENED_OFFSET = 2147483648;
28
+ const HARDENED_OFFSET = 0x80_00_00_00;
29
29
  return `m/${purpose - HARDENED_OFFSET}'/${coin - HARDENED_OFFSET}'/${account - HARDENED_OFFSET}'/${chainIndex}/${addressIndex}`;
30
30
  }
31
31
  export function splitBip44PathToNumber(derivationPath) {
32
32
  const [purpose, coin, account, change, address] = splitBip44DerivationPath(derivationPath);
33
- const HARDENED_OFFSET = 2147483648;
33
+ const HARDENED_OFFSET = 0x80_00_00_00;
34
34
  return [
35
35
  Number(purpose.replaceAll(`'`, '')) + HARDENED_OFFSET,
36
36
  Number(coin.replaceAll(`'`, '')) + HARDENED_OFFSET,
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { DefaultWalletPolicy, PsbtV2, WalletPolicy } from '@exodus/ledger-bitcoin';
3
2
  export declare function assertPsbtOnlyHasAllowedDerivationPaths(psbt: PsbtV2, masterFingerprint: string, derivationPaths: string[]): void;
4
3
  export declare function tagPsbtWithDerivationPaths(psbt: PsbtV2, masterFingerprint: string, derivationPathToPublicKeyMap: Record<string, Buffer>): void;
@@ -1,2 +1 @@
1
- /// <reference types="node" />
2
1
  export declare function buildFauxXPUB(publicKey: Buffer, chainCode: Buffer): string;
@@ -1,9 +1,9 @@
1
1
  import bs58check from 'bs58check';
2
2
  export function buildFauxXPUB(publicKey, chainCode) {
3
3
  const LEN = 78;
4
- const XPUB_PREFIX = 76067358;
4
+ const XPUB_PREFIX = 0x04_88_b2_1e;
5
5
  const buffer = Buffer.allocUnsafe(LEN);
6
- const fingerprint = 0;
6
+ const fingerprint = 0x00_00_00_00;
7
7
  const depth = 0;
8
8
  const index = 0;
9
9
  buffer.writeUInt32BE(XPUB_PREFIX, 0);
@@ -1 +1 @@
1
- export const APDU_PORT = 40000;
1
+ export const APDU_PORT = 40_000;
@@ -77,7 +77,7 @@ export class LedgerDevice {
77
77
  break;
78
78
  }
79
79
  catch (err) {
80
- const APPLICATION_NOT_INSTALLED = 26631;
80
+ const APPLICATION_NOT_INSTALLED = 0x68_07;
81
81
  if (err.statusCode === APPLICATION_NOT_INSTALLED) {
82
82
  continue;
83
83
  }
@@ -21,5 +21,6 @@ declare const _default: {
21
21
  readonly type: "module";
22
22
  readonly factory: (deps: Dependencies) => LedgerDiscovery;
23
23
  readonly dependencies: readonly ["config", "logger", "transportsFactories", "bluetoothScanningAtom"];
24
+ readonly public: true;
24
25
  };
25
26
  export default _default;
@@ -130,4 +130,5 @@ export default {
130
130
  type: 'module',
131
131
  factory: createLedgerDiscovery,
132
132
  dependencies: ['config', 'logger', 'transportsFactories', 'bluetoothScanningAtom'],
133
+ public: true,
133
134
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type Transport from '@ledgerhq/hw-transport';
3
2
  export type GetInformationResponse = {
4
3
  name: string;
@@ -17,5 +17,6 @@ declare const hardwareWalletLedgerPluginDefinition: {
17
17
  onStop: () => void;
18
18
  };
19
19
  readonly dependencies: readonly ["logger", "transportsFactories", "bluetoothStatusAtom", "bluetoothScanningAtom", "port"];
20
+ readonly public: true;
20
21
  };
21
22
  export default hardwareWalletLedgerPluginDefinition;
@@ -51,5 +51,6 @@ const hardwareWalletLedgerPluginDefinition = {
51
51
  'bluetoothScanningAtom',
52
52
  'port',
53
53
  ],
54
+ public: true,
54
55
  };
55
56
  export default hardwareWalletLedgerPluginDefinition;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/hw-ledger",
3
- "version": "2.9.0",
3
+ "version": "2.9.2",
4
4
  "description": "The ledger module",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "repository": {
@@ -19,9 +19,9 @@
19
19
  "./CHANGELOG.md"
20
20
  ],
21
21
  "scripts": {
22
- "build": "tsc --build tsconfig.build.json",
23
- "build:watch": "tsc --build tsconfig.build.json && (concurrently 'tsc --build -w tsconfig.build.json')",
24
- "clean": "tsc --build --clean",
22
+ "build": "run -T tsc --build tsconfig.build.json",
23
+ "build:watch": "run -T tsc --build tsconfig.build.json && (concurrently 'tsc --build -w tsconfig.build.json')",
24
+ "clean": "run -T tsc --build --clean",
25
25
  "test": "run -T jest --testMatch='**/*.unit.test.js' --coverageDirectory coverage/unit",
26
26
  "zemu:install": "docker pull zondax/builder-zemu:speculos-745fe46f81cfc18114b94a37beaefb58a09c0fcd",
27
27
  "test:integration": "yarn zemu:install && run -T jest --runInBand",
@@ -30,7 +30,7 @@
30
30
  "prepublishOnly": "yarn run -T build --scope @exodus/hw-ledger"
31
31
  },
32
32
  "dependencies": {
33
- "@exodus/atoms": "^7.5.1",
33
+ "@exodus/atoms": "^8.0.0",
34
34
  "@exodus/bip322-js": "^1.1.0-exodus.4",
35
35
  "@exodus/bitcoinjs-lib": "^6.1.5-exodus.0",
36
36
  "@exodus/ethersproject-transactions": "^5.4.2-exodus.0",
@@ -69,8 +69,7 @@
69
69
  "jest-when": "^3.5.2",
70
70
  "redux": "^4.2.1",
71
71
  "tiny-secp256k1": "^2.2.3",
72
- "ts-jest": "^29.0.3",
73
- "typescript": "^4.7.3"
72
+ "ts-jest": "^29.0.3"
74
73
  },
75
- "gitHead": "03f1666538fa7d596c729b77a380f891f7e747e4"
74
+ "gitHead": "3995391eb48639b2d60ced5224a6a8f4902a2466"
76
75
  }