# @tronweb3/tronwallet-adapter-ledger-evm

> Wallet adapter for Ledger Hardware Wallet on EVM-Compatible Chains.

Latest version **1.0.0** (published 2026-07-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tronweb3/tronwallet-adapter-ledger-evm
pnpm add @tronweb3/tronwallet-adapter-ledger-evm
yarn add @tronweb3/tronwallet-adapter-ledger-evm
bun add @tronweb3/tronwallet-adapter-ledger-evm
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2026-07-10 |
| First published | 2026-07-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16 |
| Dependencies | 11 |
| Unpacked size | 7.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 80 |
| Author | tronweb3 |
| Maintainers | troncore, tronwallet-adapter |
| Keywords | EVM, Ethereum Wallet, Ledger wallet, Hardware wallet |

## Links

- npm: https://www.npmjs.com/package/@tronweb3/tronwallet-adapter-ledger-evm
- Repository: https://github.com/tronweb3/tronwallet-adapter
- Homepage: https://github.com/tronweb3/tronwallet-adapter#readme
- Issues: https://github.com/tronweb3/tronwallet-adapter/issues
- npm.io page: https://npm.io/package/@tronweb3/tronwallet-adapter-ledger-evm

## Dependencies (11)

- [buffer](https://npm.io/package/buffer.md) 6.0.3
- [preact](https://npm.io/package/preact.md) 10.23.0
- [@ethereumjs/tx](https://npm.io/package/@ethereumjs/tx.md) 5.4.0
- [@ethereumjs/rlp](https://npm.io/package/@ethereumjs/rlp.md) 5.0.2
- [@ethereumjs/util](https://npm.io/package/@ethereumjs/util.md) 9.1.0
- [@ethereumjs/common](https://npm.io/package/@ethereumjs/common.md) 4.4.0
- [@ethersproject/hash](https://npm.io/package/@ethersproject/hash.md) 5.8.0
- [@ledgerhq/hw-app-eth](https://npm.io/package/@ledgerhq/hw-app-eth.md) 6.35.6
- [@ledgerhq/hw-transport](https://npm.io/package/@ledgerhq/hw-transport.md) 6.27.1
- [@ledgerhq/hw-transport-webhid](https://npm.io/package/@ledgerhq/hw-transport-webhid.md) 6.27.1
- [@tronweb3/abstract-adapter-evm](https://npm.io/package/@tronweb3/abstract-adapter-evm.md) ^1.1.1

## Recent versions

- 1.0.0 (latest) — 2026-07-10

## README

# `@tronweb3/tronwallet-adapter-ledger-evm`

This package provides an adapter for the Ledger Hardware Wallet on EVM-compatible chains.

## Demo

```typescript
import { LedgerEvmAdapter } from '@tronweb3/tronwallet-adapter-ledger-evm';
import { ethers } from 'ethers';

const adapter = new LedgerEvmAdapter({
    // Initial total accounts to get once connection is created
    accountNumber: 5,
    // Custom derivation path for address
    getDerivationPath(index) {
        return `44'/60'/${index}'/0/0`;
    },
});
// connect (shows account selection modal)
await adapter.connect();

// then you can get the address
console.log(adapter.address);

// create a transaction with your provider
const provider = new ethers.JsonRpcProvider('https://eth.llamarpc.com');
const unSignedTransaction = {
    to: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
    value: ethers.parseEther('0.001').toString(),
    nonce: await provider.getTransactionCount(adapter.address!, 'pending'),
    gasLimit: '21000',
    gasPrice: (await provider.getFeeData()).gasPrice!.toString(),
    chainId: 1,
};
// using adapter to sign the transaction
const signedTransaction = await adapter.signTransaction(unSignedTransaction);
// broadcast the transaction with your provider
await provider.broadcastTransaction(signedTransaction);
```

## Documentation

### API

-   `Constructor(config: LedgerAdapterConfig)`

    ```typescript
    interface LedgerAdapterConfig {
        /**
         * Set if open Wallet's website when wallet is not installed.
         * Default is true.
         */
        openUrlWhenWalletNotFound?: boolean;
        /**
         * Initial total accounts to get once connection is created, default is 1
         */
        accountNumber?: number;

        /**
         * Hook function to call before connecting to ledger and getting accounts.
         * By default, a modal will popup to remind the user to prepare the ledger and enter the Ethereum app.
         * You can specify a function to disable this modal.
         */
        beforeConnect?: () => Promise<unknown> | unknown;

        /**
         * Hook function to call after connecting to ledger and getting initial accounts.
         * The function should return the selected account including the index of the account.
         * Following operations such as `signMessage` will use the selected account.
         */
        selectAccount?: (params: { accounts: Account[]; ledgerUtils: LedgerUtils }) => Promise<Account>;

        /**
         * Function to get the derivation BIP44 path by index.
         * Default is `44'/60'/${index}'/0/0`
         */
        getDerivationPath?: (index: number) => string;
    }
    interface Account {
        /**
         * The index to get the BIP44 path.
         */
        index: number;
        /**
         * The BIP44 path to derive the address.
         */
        path: string;
        /**
         * The derived address.
         */
        address: string;
    }
    interface LedgerUtils {
        /**
         * Get accounts from ledger by index. `from` is included and `to` is excluded.
         * User can use the function to load more accounts.
         */
        getAccounts: (from: number, to: number) => Promise<Account[]>;
        /**
         * Request to get an address with specified index using getDerivationPath(index) to get the BIP44 path.
         * If `display` is true, will request the user to approve on the ledger.
         * The promise will resolve if the user approves and reject if the user cancels the operation.
         */
        getAddress: (index: number, display: boolean) => Promise<{ publicKey: string; address: string }>;
    }
    ```

-   Property: `ledgerUtils`
    `ledgerUtils` on LedgerEvmAdapter is used to get useful functions to interact with the Ledger directly. `ledgerUtils` is defined in the section above.

    -   `getAccounts(from: number, to: number)` is a wrapped function to get multiple accounts by index range from the ledger.
        For example:

        ```typescript
        const adapter = new LedgerEvmAdapter();
        // get 5 accounts from ledger
        const accounts = await adapter.ledgerUtils.getAccounts(0, 5);
        // [{ address: string, index: 0, path: "44'/60'/0'/0/0" }, ...]
        ```

    -   `getAddress(index: number, display: boolean)` is a raw function to request an address from the ledger.
        If `display` is true, will request the user to approve on the ledger.
        For example, the following code will request the user to approve on the Ledger to confirm connecting their ledger.

        ```typescript
        const adapter = new LedgerEvmAdapter();
        const result = await adapter.ledgerUtils.getAddress(0, true);
        // { address: 'some address', publicKey: 'publicKey for address' }
        ```

### Methods

-   `signTransaction(transaction)`

    Sign a transaction via the Ledger wallet and return the signed raw transaction (`0x...` format).

    ```typescript
    async signTransaction(transaction: {
        to: string;
        value?: string;
        data?: string;
        nonce: number;                    // Required
        gasLimit: string;                 // Required
        gasPrice?: string;                // For legacy transactions
        maxFeePerGas?: string;            // For EIP-1559
        maxPriorityFeePerGas?: string;    // For EIP-1559
        chainId: number;                  // Required
    }): Promise<string>
    ```

    Both legacy and EIP-1559 transactions are supported. Provide `gasPrice` for legacy transactions, or `maxFeePerGas` / `maxPriorityFeePerGas` for EIP-1559.

-   `signMessage(params)`

    Sign a personal message.

    ```typescript
    async signMessage(params: { message: string; address?: string }): Promise<string>
    ```

-   `signTypedData(params)`

    Sign EIP-712 typed data.

    ```typescript
    async signTypedData(params: { typedData: TypedData; address?: string }): Promise<string>
    ```

### Transaction Broadcasting

**The Ledger adapter only signs transactions. It does NOT broadcast them**, following the same design as the TRON Ledger adapter:

-   Adapter handles: hardware communication + signing
-   Your dApp handles: network access + broadcasting

Use your dApp's existing provider to broadcast the signed raw transaction:

```typescript
// ethers.js
await provider.broadcastTransaction(signedTx);

// web3.js
await web3.eth.sendSignedTransaction(signedTx);

// viem
await client.sendRawTransaction({ serializedTransaction: signedTx });
```

### Caveats

-   `multiSign()` is not supported.
-   WebHID is required for direct Ledger connection. It is supported on Chrome / Edge / Brave (desktop) but **not** on Firefox or mobile browsers. For mobile users, recommend using Ledger Live + WalletConnect.

For more information about tronwallet adapters, please refer to [`@tronweb3/tronwallet-adapters`](https://github.com/tronweb3/tronwallet-adapter/tree/main/packages/adapters/adapters)

---
_Source: https://npm.io/package/@tronweb3/tronwallet-adapter-ledger-evm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
