@exodus/hw-ledger 2.10.0 → 2.12.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.js +0 -1
- package/lib/index.d.ts +5 -5
- package/lib/module/assets/utils/psbt.d.ts +0 -1
- package/lib/module/assets/utils/psbt.js +1 -2
- package/lib/module/device.js +3 -4
- package/lib/module/errors.d.ts +3 -1
- package/lib/module/errors.js +5 -1
- package/package.json +3 -4
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
|
+
## [2.11.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.11.0...@exodus/hw-ledger@2.11.1) (2024-10-01)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- use internal xpub for multisig hardware wallet policy ([#9639](https://github.com/ExodusMovement/exodus-hydra/issues/9639)) ([e96bee0](https://github.com/ExodusMovement/exodus-hydra/commit/e96bee045b3799a43464db4487d42a980ef95f0f))
|
|
11
|
+
|
|
12
|
+
## [2.11.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.10.0...@exodus/hw-ledger@2.11.0) (2024-09-23)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- add more metadata to unsupported version error ([#9267](https://github.com/ExodusMovement/exodus-hydra/issues/9267)) ([1a78d90](https://github.com/ExodusMovement/exodus-hydra/commit/1a78d9032bd97dfb77967be90d5cfad2678035b9))
|
|
17
|
+
|
|
6
18
|
## [2.10.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@2.9.5...@exodus/hw-ledger@2.10.0) (2024-09-16)
|
|
7
19
|
|
|
8
20
|
### Features
|
package/lib/atoms/index.js
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ declare const hardwareWalletLedger: ({ bluetoothScannerTimeout, }?: Partial<HwLe
|
|
|
5
5
|
readonly definition: {
|
|
6
6
|
readonly id: "bluetoothStatusAtom";
|
|
7
7
|
readonly type: "atom";
|
|
8
|
-
readonly factory: () => import("
|
|
8
|
+
readonly factory: () => import("@exodus/atoms").Atom<import("./atoms").BluetoothStatus>;
|
|
9
9
|
readonly dependencies: readonly [];
|
|
10
10
|
readonly public: true;
|
|
11
11
|
};
|
|
@@ -13,7 +13,7 @@ declare const hardwareWalletLedger: ({ bluetoothScannerTimeout, }?: Partial<HwLe
|
|
|
13
13
|
readonly definition: {
|
|
14
14
|
readonly id: "bluetoothScanningAtom";
|
|
15
15
|
readonly type: "atom";
|
|
16
|
-
readonly factory: () => import("
|
|
16
|
+
readonly factory: () => import("@exodus/atoms").Atom<boolean>;
|
|
17
17
|
readonly dependencies: readonly [];
|
|
18
18
|
readonly public: true;
|
|
19
19
|
};
|
|
@@ -23,7 +23,7 @@ declare const hardwareWalletLedger: ({ bluetoothScannerTimeout, }?: Partial<HwLe
|
|
|
23
23
|
readonly type: "atom";
|
|
24
24
|
readonly factory: ({ storage }: {
|
|
25
25
|
storage: import("adapters/storage-interface").Storage<Record<string, Buffer>>;
|
|
26
|
-
}) => import("
|
|
26
|
+
}) => import("@exodus/atoms").Atom<Record<string, Buffer> | {}>;
|
|
27
27
|
readonly dependencies: readonly ["storage"];
|
|
28
28
|
readonly public: true;
|
|
29
29
|
};
|
|
@@ -32,8 +32,8 @@ declare const hardwareWalletLedger: ({ bluetoothScannerTimeout, }?: Partial<HwLe
|
|
|
32
32
|
readonly id: "hardwareWalletLedgerPlugin";
|
|
33
33
|
readonly type: "plugin";
|
|
34
34
|
readonly factory: ({ bluetoothStatusAtom, bluetoothScanningAtom, ledgerDiscovery, port, }: {
|
|
35
|
-
bluetoothStatusAtom: import("
|
|
36
|
-
bluetoothScanningAtom: import("
|
|
35
|
+
bluetoothStatusAtom: import("@exodus/atoms").Atom<import("./atoms").BluetoothStatus>;
|
|
36
|
+
bluetoothScanningAtom: import("@exodus/atoms").Atom<boolean>;
|
|
37
37
|
ledgerDiscovery: import("./module").LedgerDiscovery;
|
|
38
38
|
port: import("./shared/types").Port;
|
|
39
39
|
}) => {
|
|
@@ -4,7 +4,6 @@ import type { MultisigData } from 'libraries/hw-common/lib';
|
|
|
4
4
|
export declare function assertPsbtOnlyHasAllowedDerivationPaths(psbt: PsbtV2, masterFingerprint: string, derivationPaths: string[]): void;
|
|
5
5
|
export declare function tagPsbtWithDerivationPaths(psbt: PsbtV2, masterFingerprint: string, derivationPathToPublicKeyMap: Record<string, Buffer>, addressToDerivationPathMap?: Record<string, string>): void;
|
|
6
6
|
export declare const getWalletPolicy: (fpr: string, xpub: string, purpose: string, coin: string, account: string) => DefaultWalletPolicy;
|
|
7
|
-
export declare const DUMMY_TAPROOT_XPUB = "xpub661MyMwAqRbcEYS8w7XLSVeEsBXy79zSzH1J8vCdxAZningWLdN3zgtU6QgnecKFpJFPpdzxKrwoaZoV44qAJewsc4kX9vGaCaBExuvJH57";
|
|
8
7
|
export declare const getMultisigWalletPolicy: (fpr: string, xpub: string, purpose: string, coin: string, account: string, multisigData: MultisigData) => WalletPolicy;
|
|
9
8
|
export declare function derivationPathsToWalletPolicy(fpr: string, app: any, derivationPaths: string[], multisigData?: MultisigData): Promise<WalletPolicy[]>;
|
|
10
9
|
export declare function addDummyInputs(psbt: PsbtV2): void;
|
|
@@ -118,10 +118,9 @@ export const getWalletPolicy = (fpr, xpub, purpose, coin, account) => {
|
|
|
118
118
|
}[purpose];
|
|
119
119
|
return new DefaultWalletPolicy(desc, `[${fpr}/${purpose}/${coin}/${account}]${xpub}`);
|
|
120
120
|
};
|
|
121
|
-
export const DUMMY_TAPROOT_XPUB = 'xpub661MyMwAqRbcEYS8w7XLSVeEsBXy79zSzH1J8vCdxAZningWLdN3zgtU6QgnecKFpJFPpdzxKrwoaZoV44qAJewsc4kX9vGaCaBExuvJH57';
|
|
122
121
|
export const getMultisigWalletPolicy = (fpr, xpub, purpose, coin, account, multisigData) => {
|
|
123
122
|
let template = `tr(@0/**,sortedmulti_a(${multisigData.threshold}`;
|
|
124
|
-
const keys = [
|
|
123
|
+
const keys = [multisigData.internalXpub];
|
|
125
124
|
multisigData.xpubs.forEach((xpub2, i) => {
|
|
126
125
|
if (xpub === xpub2) {
|
|
127
126
|
keys.push(`[${fpr}/${purpose}/${coin}/${account}]${xpub}`);
|
package/lib/module/device.js
CHANGED
|
@@ -65,7 +65,7 @@ export class LedgerDevice {
|
|
|
65
65
|
const { applications } = this.#getAssetApplication(baseAssetName);
|
|
66
66
|
const supportedApplicationNames = applications.map(({ applicationName }) => applicationName);
|
|
67
67
|
const currentApplicationInfo = await this.#getInformation();
|
|
68
|
-
let desiredApplicationInfo
|
|
68
|
+
let desiredApplicationInfo;
|
|
69
69
|
if (supportedApplicationNames.includes(currentApplicationInfo.name)) {
|
|
70
70
|
desiredApplicationInfo = currentApplicationInfo;
|
|
71
71
|
}
|
|
@@ -90,11 +90,10 @@ export class LedgerDevice {
|
|
|
90
90
|
}
|
|
91
91
|
desiredApplicationInfo = await this.#getInformation();
|
|
92
92
|
}
|
|
93
|
-
const
|
|
94
|
-
const { supportedVersions } = applications.find(({ applicationName }) => applicationName === currentApplicationName);
|
|
93
|
+
const { supportedVersions } = applications.find(({ applicationName }) => applicationName === desiredApplicationInfo.name);
|
|
95
94
|
const isSupportedVersion = semver.satisfies(desiredApplicationInfo.version, supportedVersions);
|
|
96
95
|
if (!isSupportedVersion) {
|
|
97
|
-
throw new UnsupportedVersionError(desiredApplicationInfo.version, supportedVersions);
|
|
96
|
+
throw new UnsupportedVersionError(baseAssetName, desiredApplicationInfo.name, desiredApplicationInfo.version, supportedVersions);
|
|
98
97
|
}
|
|
99
98
|
};
|
|
100
99
|
listSupportedAssetNames = async () => {
|
package/lib/module/errors.d.ts
CHANGED
|
@@ -14,9 +14,11 @@ export declare class ApplicationNotFoundError extends HardwareWalletError {
|
|
|
14
14
|
}
|
|
15
15
|
export declare class UnsupportedVersionError extends HardwareWalletError {
|
|
16
16
|
name: string;
|
|
17
|
+
baseAssetName: string;
|
|
18
|
+
applicationName: string;
|
|
17
19
|
supportedVersions: string;
|
|
18
20
|
actualVersion: string;
|
|
19
|
-
constructor(actualVersion: string, supportedVersions: string);
|
|
21
|
+
constructor(baseAssetName: string, applicationName: string, actualVersion: string, supportedVersions: string);
|
|
20
22
|
}
|
|
21
23
|
export declare class RequiresBlindSigningError extends HardwareWalletError {
|
|
22
24
|
name: string;
|
package/lib/module/errors.js
CHANGED
|
@@ -21,10 +21,14 @@ export class ApplicationNotFoundError extends HardwareWalletError {
|
|
|
21
21
|
}
|
|
22
22
|
export class UnsupportedVersionError extends HardwareWalletError {
|
|
23
23
|
name = 'UnsupportedVersionError';
|
|
24
|
+
baseAssetName;
|
|
25
|
+
applicationName;
|
|
24
26
|
supportedVersions;
|
|
25
27
|
actualVersion;
|
|
26
|
-
constructor(actualVersion, supportedVersions) {
|
|
28
|
+
constructor(baseAssetName, applicationName, actualVersion, supportedVersions) {
|
|
27
29
|
super(`version does not meet version requirements: ${actualVersion} does not match ${supportedVersions}`);
|
|
30
|
+
this.baseAssetName = baseAssetName;
|
|
31
|
+
this.applicationName = applicationName;
|
|
28
32
|
this.supportedVersions = supportedVersions;
|
|
29
33
|
this.actualVersion = actualVersion;
|
|
30
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/hw-ledger",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "The ledger module",
|
|
5
5
|
"author": "Exodus Movement, Inc.",
|
|
6
6
|
"repository": {
|
|
@@ -34,11 +34,10 @@
|
|
|
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",
|
|
37
|
-
"@exodus/hw-common": "^2.
|
|
37
|
+
"@exodus/hw-common": "^2.5.0",
|
|
38
38
|
"@exodus/ledger-bitcoin": "^0.2.3-exodus.3",
|
|
39
39
|
"@exodus/ledgerhq-devices": "^8.1.0-exodus.3",
|
|
40
40
|
"@exodus/ledgerhq-hw-app-eth": "^6.33.7-exodus.8",
|
|
41
|
-
"@exodus/module": "^1.2.2",
|
|
42
41
|
"@exodus/redux-dependency-injection": "^4.0.0",
|
|
43
42
|
"@exodus/secp256k1": "^4.0.2-exodus.0",
|
|
44
43
|
"@ledgerhq/hw-app-solana": "^7.0.10",
|
|
@@ -72,5 +71,5 @@
|
|
|
72
71
|
"tiny-secp256k1": "^2.2.3",
|
|
73
72
|
"ts-jest": "^29.0.3"
|
|
74
73
|
},
|
|
75
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "d4838cd68554c8a09b6d2815a6c77dd6187234a0"
|
|
76
75
|
}
|