@exodus/hw-ledger 3.7.0 → 3.8.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,12 @@
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.8.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hw-ledger@3.7.0...@exodus/hw-ledger@3.8.0) (2025-12-11)
7
+
8
+ ### Features
9
+
10
+ - feat: support XRP in hw-trezor and hw-ledger (#14600)
11
+
6
12
  ## [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
13
 
8
14
  ### Features
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("libraries/atoms/lib").Atom<import("./atoms").BluetoothStatus>;
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("libraries/atoms/lib").Atom<boolean>;
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("libraries/atoms/lib").Atom<Record<string, Buffer<ArrayBufferLike>> | {}>;
26
+ }) => import("@exodus/atoms").Atom<Record<string, Buffer<ArrayBufferLike>> | {}>;
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("libraries/atoms/lib").Atom<import("./atoms").BluetoothStatus>;
36
- bluetoothScanningAtom: import("libraries/atoms/lib").Atom<boolean>;
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
  }) => {
@@ -24,5 +24,10 @@ declare const applications: {
24
24
  supportedVersions: string;
25
25
  primaryAssetName: string;
26
26
  };
27
+ XRP: {
28
+ applicationName: string;
29
+ supportedVersions: string;
30
+ primaryAssetName: string;
31
+ };
27
32
  };
28
33
  export default applications;
@@ -23,11 +23,17 @@ const Tron = {
23
23
  supportedVersions: '^0.7.0',
24
24
  primaryAssetName: 'tronmainnet',
25
25
  };
26
+ const XRP = {
27
+ applicationName: 'XRP',
28
+ supportedVersions: '^1.0.0',
29
+ primaryAssetName: 'ripple',
30
+ };
26
31
  const applications = {
27
32
  Bitcoin,
28
33
  Solana,
29
34
  Ethereum,
30
35
  Polygon,
31
36
  Tron,
37
+ XRP,
32
38
  };
33
39
  export default applications;
@@ -2,6 +2,7 @@ import bitcoin from './bitcoin';
2
2
  import basemainnet from './basemainnet';
3
3
  import ethereum from './ethereum';
4
4
  import matic from './matic';
5
+ import ripple from './ripple';
5
6
  import solana from './solana';
6
7
  import tronmainnet from './tronmainnet';
7
8
  import applications from './applications';
@@ -11,6 +12,7 @@ export const assetApplications = {
11
12
  bitcointestnet: bitcoin,
12
13
  bitcoinregtest: bitcoin,
13
14
  matic,
15
+ ripple,
14
16
  solana,
15
17
  ethereum,
16
18
  ethereumsepolia: ethereum,
@@ -0,0 +1,12 @@
1
+ import type Transport from '@ledgerhq/hw-transport';
2
+ import type { HardwareWalletAssetHandler } from '@exodus/hw-common';
3
+ declare function createHandler(transport: Transport): Promise<HardwareWalletAssetHandler>;
4
+ declare const metadata: {
5
+ applications: {
6
+ applicationName: string;
7
+ supportedVersions: string;
8
+ primaryAssetName: string;
9
+ }[];
10
+ handler: typeof createHandler;
11
+ };
12
+ export default metadata;
@@ -0,0 +1,53 @@
1
+ import AppXrp from '@ledgerhq/hw-app-xrp';
2
+ import assert from 'minimalistic-assert';
3
+ import { XPubUnsupportedError, SignMessageUnsupportedError } from '@exodus/hw-common';
4
+ import binaryCodec from '@exodus/ripple-binary-codec';
5
+ import applications from './applications';
6
+ async function createHandler(transport) {
7
+ const app = new AppXrp(transport);
8
+ const getAddress = async (params) => {
9
+ const { address } = await app.getAddress(params.derivationPath.replace('m/', ''));
10
+ return address;
11
+ };
12
+ const getXPub = async () => {
13
+ throw new XPubUnsupportedError();
14
+ };
15
+ const getPublicKey = async (params) => {
16
+ const { publicKey } = await app.getAddress(params.derivationPath.replace('m/', ''));
17
+ return Buffer.from(publicKey, 'hex');
18
+ };
19
+ const signTransaction = async (params) => {
20
+ assert(Array.isArray(params.derivationPaths) && params.derivationPaths.length === 1, 'derivationsPath array must be one element long');
21
+ const { txData } = params.signableTransaction;
22
+ const derivationPath = params.derivationPaths[0].replace('m/', '');
23
+ const { address, publicKey } = await app.getAddress(derivationPath);
24
+ const txForSigning = {
25
+ ...txData,
26
+ Account: address,
27
+ SigningPubKey: publicKey.toUpperCase(),
28
+ };
29
+ const encoded = binaryCodec.encode(txForSigning);
30
+ const signature = await app.signTransaction(derivationPath, encoded);
31
+ return [
32
+ {
33
+ signature: Buffer.from(signature, 'hex'),
34
+ publicKey: Buffer.from(publicKey, 'hex'),
35
+ },
36
+ ];
37
+ };
38
+ const signMessage = async () => {
39
+ throw new SignMessageUnsupportedError();
40
+ };
41
+ return {
42
+ getAddress,
43
+ getPublicKey,
44
+ getXPub,
45
+ signTransaction,
46
+ signMessage,
47
+ };
48
+ }
49
+ const metadata = {
50
+ applications: [applications.XRP],
51
+ handler: createHandler,
52
+ };
53
+ export default metadata;
@@ -8,7 +8,7 @@ export function splitDerivationPath(derivationPath) {
8
8
  }
9
9
  export function assertBip44Path(parts) {
10
10
  assert(parts.length === 5, 'invalid bip44 derivation path: length must be 5');
11
- assert(parts.every((part) => typeof part === 'string'));
11
+ assert(parts.every((part) => typeof part === 'string'), 'Invalid parts');
12
12
  }
13
13
  export function splitBip44DerivationPath(derivationPath) {
14
14
  const parts = splitDerivationPath(derivationPath);
@@ -21,7 +21,7 @@ export function splitBip44DerivationPath(derivationPath) {
21
21
  }
22
22
  export function assertBip44PathNumber(parts) {
23
23
  assert(parts.length === 5, 'invalid bip44 derivation path: length must be 5');
24
- assert(parts.every((part) => typeof part === 'number'));
24
+ assert(parts.every((part) => typeof part === 'number'), 'Invalid parts');
25
25
  }
26
26
  export function buildBip44PathFromNumber(parts) {
27
27
  const [purpose, coin, account, chainIndex, addressIndex] = parts;
@@ -1 +1 @@
1
- export declare function buildFauxXPUB(publicKey: Buffer, chainCode: Buffer): string;
1
+ export declare function buildFauxXPUB(publicKey: Buffer, chainCode: Buffer): any;
@@ -1,4 +1,4 @@
1
- import bs58check from 'bs58check';
1
+ import { toBase58checkSync } from '@exodus/bytes/base58check.js';
2
2
  export function buildFauxXPUB(publicKey, chainCode) {
3
3
  const LEN = 78;
4
4
  const XPUB_PREFIX = 0x04_88_b2_1e;
@@ -12,5 +12,5 @@ export function buildFauxXPUB(publicKey, chainCode) {
12
12
  buffer.writeUInt32BE(index, 9);
13
13
  chainCode.copy(buffer, 13);
14
14
  publicKey.copy(buffer, 45);
15
- return bs58check.encode(buffer);
15
+ return toBase58checkSync(buffer);
16
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/hw-ledger",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "description": "The ledger module",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "repository": {
@@ -33,7 +33,8 @@
33
33
  "@exodus/atoms": "^9.0.0",
34
34
  "@exodus/bip322-js": "^3.1.0",
35
35
  "@exodus/bitcoinjs": "^2.0.0",
36
- "@exodus/crypto": "^1.0.0-rc.14",
36
+ "@exodus/bytes": "^1.0.0-rc.6",
37
+ "@exodus/crypto": "^1.0.0-rc.29",
37
38
  "@exodus/ethereumjs": "^1.5.0",
38
39
  "@exodus/ethersproject-transactions": "^5.4.2-exodus.0",
39
40
  "@exodus/hw-common": "^3.1.0",
@@ -41,11 +42,12 @@
41
42
  "@exodus/ledgerhq-devices": "^8.1.0-exodus.3",
42
43
  "@exodus/ledgerhq-hw-app-eth": "^6.33.7-exodus.8",
43
44
  "@exodus/redux-dependency-injection": "^4.0.0",
45
+ "@exodus/ripple-binary-codec": "^0.2.6",
44
46
  "@ledgerhq/hw-app-solana": "^7.0.10",
45
47
  "@ledgerhq/hw-app-trx": "^6.29.4",
48
+ "@ledgerhq/hw-app-xrp": "^6.32.7",
46
49
  "@ledgerhq/hw-transport": "^6.28.5",
47
50
  "bs58": "^4.0.0",
48
- "bs58check": "^3.0.1",
49
51
  "minimalistic-assert": "^1.0.1",
50
52
  "semver": "^7.3.5"
51
53
  },
@@ -54,17 +56,16 @@
54
56
  "@exodus/dependency-types": "^2.1.1",
55
57
  "@solana/web3.js": "^1.78.0",
56
58
  "@types/bs58": "^4.0.1",
57
- "@types/bs58check": "^2.1.0",
58
59
  "@types/minimalistic-assert": "^1.0.1",
59
60
  "@types/semver": "^7.3.5",
60
61
  "@zondax/zemu": "^0.51.0",
61
- "bitcoinjs-lib": "^6.1.3",
62
62
  "ecpair": "^2.1.0",
63
63
  "p-defer": "^4.0.1",
64
64
  "redux": "^4.2.1"
65
65
  },
66
66
  "publishConfig": {
67
- "access": "public"
67
+ "access": "public",
68
+ "provenance": false
68
69
  },
69
- "gitHead": "514fc4377ffdbde51aecf2e622d312d6f87e6fb6"
70
+ "gitHead": "95d196bd3cb808f5f511db5f885e6a468665049b"
70
71
  }