@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 +10 -0
- package/lib/atoms/index.d.ts +2 -0
- package/lib/atoms/index.js +2 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +1 -1
- package/lib/module/assets/basemainnet.d.ts +1 -1
- package/lib/module/assets/matic.d.ts +1 -1
- package/lib/module/assets/utils/derivation-paths.js +2 -2
- package/lib/module/assets/utils/psbt.d.ts +0 -1
- package/lib/module/assets/utils/xpub.d.ts +0 -1
- package/lib/module/assets/utils/xpub.js +2 -2
- package/lib/module/constants.js +1 -1
- package/lib/module/device.js +1 -1
- package/lib/module/discovery.d.ts +1 -0
- package/lib/module/discovery.js +1 -0
- package/lib/module/management/application.d.ts +0 -1
- package/lib/plugin/index.d.ts +1 -0
- package/lib/plugin/index.js +1 -0
- package/package.json +7 -8
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
|
package/lib/atoms/index.d.ts
CHANGED
|
@@ -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
|
};
|
package/lib/atoms/index.js
CHANGED
|
@@ -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 =
|
|
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
|
|
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
|
|
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 =
|
|
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 =
|
|
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,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 =
|
|
4
|
+
const XPUB_PREFIX = 0x04_88_b2_1e;
|
|
5
5
|
const buffer = Buffer.allocUnsafe(LEN);
|
|
6
|
-
const fingerprint =
|
|
6
|
+
const fingerprint = 0x00_00_00_00;
|
|
7
7
|
const depth = 0;
|
|
8
8
|
const index = 0;
|
|
9
9
|
buffer.writeUInt32BE(XPUB_PREFIX, 0);
|
package/lib/module/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const APDU_PORT =
|
|
1
|
+
export const APDU_PORT = 40_000;
|
package/lib/module/device.js
CHANGED
|
@@ -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;
|
package/lib/module/discovery.js
CHANGED
package/lib/plugin/index.d.ts
CHANGED
|
@@ -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;
|
package/lib/plugin/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/hw-ledger",
|
|
3
|
-
"version": "2.9.
|
|
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": "^
|
|
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": "
|
|
74
|
+
"gitHead": "3995391eb48639b2d60ced5224a6a8f4902a2466"
|
|
76
75
|
}
|