@exodus/hw-ledger 3.6.0 → 3.7.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 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.7.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@3.6.1...@exodus/hw-ledger@3.7.0) (2025-09-16)
7
+
8
+ ### Features
9
+
10
+ - feat: update bip322-js and bitcoinjs (#13812)
11
+
12
+ ## [3.6.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@3.6.0...@exodus/hw-ledger@3.6.1) (2025-09-01)
13
+
14
+ ### Bug Fixes
15
+
16
+ - fix: only sign for required wallet policies (#13720)
17
+
6
18
  ## [3.6.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@3.5.0...@exodus/hw-ledger@3.6.0) (2025-07-18)
7
19
 
8
20
  ### Features
@@ -52,11 +52,11 @@ async function createHandler(transport, walletPolicyAtom) {
52
52
  });
53
53
  derivationPathToPublicKeyMap[derivationPath] = publicKey;
54
54
  }
55
- tagPsbtWithDerivationPaths(psbt, fpr, derivationPathToPublicKeyMap, addressToDerivationPathMap);
55
+ const derivationPathsToSignFor = tagPsbtWithDerivationPaths(psbt, fpr, derivationPathToPublicKeyMap, addressToDerivationPathMap);
56
56
  addDummyInputs(psbt);
57
57
  assertPsbtOnlyHasAllowedDerivationPaths(psbt, fpr, params.derivationPaths);
58
+ const walletPolicies = await derivationPathsToWalletPolicy(fpr, app, derivationPathsToSignFor, params.multisigData);
58
59
  const signatures = [];
59
- const walletPolicies = await derivationPathsToWalletPolicy(fpr, app, params.derivationPaths, params.multisigData);
60
60
  for (const walletPolicy of walletPolicies) {
61
61
  const hmac = params.multisigData ? await registerWalletPolicy(walletPolicy) : null;
62
62
  const _signatures = await app.signPsbt(psbt.serialize(), walletPolicy, hmac);
@@ -2,7 +2,7 @@ import type { PsbtV2 } from '@exodus/ledger-bitcoin';
2
2
  import { DefaultWalletPolicy, WalletPolicy } from '@exodus/ledger-bitcoin';
3
3
  import type { MultisigData } from 'libraries/hw-common/lib';
4
4
  export declare function assertPsbtOnlyHasAllowedDerivationPaths(psbt: PsbtV2, masterFingerprint: string, derivationPaths: string[]): void;
5
- export declare function tagPsbtWithDerivationPaths(psbt: PsbtV2, masterFingerprint: string, derivationPathToPublicKeyMap: Record<string, Buffer>, addressToDerivationPathMap?: Record<string, string>): void;
5
+ export declare function tagPsbtWithDerivationPaths(psbt: PsbtV2, masterFingerprint: string, derivationPathToPublicKeyMap: Record<string, Buffer>, addressToDerivationPathMap?: Record<string, string>): string[];
6
6
  export declare const getWalletPolicy: (fpr: string, xpub: string, purpose: string, coin: string, account: string) => DefaultWalletPolicy;
7
7
  export declare const getMultisigWalletPolicy: (fpr: string, xpub: string, purpose: string, coin: string, account: string, multisigData: MultisigData) => WalletPolicy;
8
8
  export declare function derivationPathsToWalletPolicy(fpr: string, app: any, derivationPaths: string[], multisigData?: MultisigData): Promise<WalletPolicy[]>;
@@ -34,6 +34,7 @@ function assertAllowedDerivation(bip32Derivation, masterFingerprint, derivationP
34
34
  export function tagPsbtWithDerivationPaths(psbt, masterFingerprint, derivationPathToPublicKeyMap, addressToDerivationPathMap) {
35
35
  const masterFingerprintBuffer = Buffer.from(masterFingerprint, 'hex');
36
36
  const scriptPubKeyToDerivationPathMap = computeScriptPubKeyToDerivationPathMap(derivationPathToPublicKeyMap);
37
+ const derivationPathsToSignFor = [];
37
38
  for (let inputIndex = 0; inputIndex < psbt.getGlobalInputCount(); inputIndex++) {
38
39
  const witnessUtxo = psbt.getInputWitnessUtxo(inputIndex);
39
40
  const nonWitnessUtxo = psbt.getInputNonWitnessUtxo(inputIndex);
@@ -67,6 +68,7 @@ export function tagPsbtWithDerivationPaths(psbt, masterFingerprint, derivationPa
67
68
  else {
68
69
  psbt.setInputBip32Derivation(inputIndex, publicKey, masterFingerprintBuffer, derivationPathNumerical);
69
70
  }
71
+ derivationPathsToSignFor.push(derivationPath);
70
72
  }
71
73
  }
72
74
  for (let outputIndex = 0; outputIndex < psbt.getGlobalOutputCount(); outputIndex++) {
@@ -91,6 +93,7 @@ export function tagPsbtWithDerivationPaths(psbt, masterFingerprint, derivationPa
91
93
  }
92
94
  }
93
95
  }
96
+ return derivationPathsToSignFor;
94
97
  }
95
98
  function computeScriptPubKeyToDerivationPathMap(derivationPathToPublicKeyMap) {
96
99
  return Object.entries(derivationPathToPublicKeyMap).reduce((acc, [derivationPath, publicKey]) => {
@@ -23,8 +23,9 @@ export class LedgerDiscovery {
23
23
  Object.entries(transportsFactories).every(([transportName, transportFactory]) => ['usb', 'bluetooth', 'tcp'].includes(transportName) &&
24
24
  transportFactory !== undefined &&
25
25
  typeof transportFactory.list === 'function' &&
26
- typeof transportFactory.open === 'function')))
26
+ typeof transportFactory.open === 'function'))) {
27
27
  throw new UnknownTransportError();
28
+ }
28
29
  if (!Number.isInteger(config.bluetoothScannerTimeout)) {
29
30
  throw new TypeError(`Invalid bluetoothScannerTimeout passed through config`);
30
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/hw-ledger",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "description": "The ledger module",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "repository": {
@@ -31,8 +31,8 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@exodus/atoms": "^9.0.0",
34
- "@exodus/bip322-js": "^2.0.0",
35
- "@exodus/bitcoinjs": "^1.1.0",
34
+ "@exodus/bip322-js": "^3.1.0",
35
+ "@exodus/bitcoinjs": "^2.0.0",
36
36
  "@exodus/crypto": "^1.0.0-rc.14",
37
37
  "@exodus/ethereumjs": "^1.5.0",
38
38
  "@exodus/ethersproject-transactions": "^5.4.2-exodus.0",
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "gitHead": "d633626e2234250851c7935c8790b64280c5d682"
69
+ "gitHead": "514fc4377ffdbde51aecf2e622d312d6f87e6fb6"
70
70
  }