open-index/open-npm huggingface dataset:
npm package: @ledgerhq/web3-subprovider
Description: Ledger Hardware Wallet Ethereum Web3 subprovider
Latest version: 5.36.0-deprecated
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

> **IMPORTANT: this package is deprecated due to the fact we had to move away from U2F. Contributions are welcome to make it running in WebUSB!**

---

<img src="https://user-images.githubusercontent.com/211411/34776833-6f1ef4da-f618-11e7-8b13-f0697901d6a8.png" height="100" />

## @ledgerhq/web3-subprovider

Library for Ledger Hardware Wallets.

[Github](https://github.com/LedgerHQ/ledgerjs/),
[Ledger Devs Slack](https://ledger-dev.slack.com/)

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

-   [SubproviderOptions](#subprovideroptions)
    -   [Properties](#properties)
-   [createLedgerSubprovider](#createledgersubprovider)
    -   [Parameters](#parameters)
    -   [Examples](#examples)

### SubproviderOptions

#### Properties

-   `networkId` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** 
-   `paths` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>?** 
-   `askConfirm` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** 
-   `accountsLength` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** 
-   `accountsOffset` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** 

### createLedgerSubprovider

Create a HookedWalletSubprovider for Ledger devices.

#### Parameters

-   `getTransport` **function (): Transport&lt;any>** gets lazily called each time the device is needed. It is a function that returns a Transport instance. You can typically give `()=>TransportU2F.create()`
-   `options` **[SubproviderOptions](#subprovideroptions)?** 

#### Examples

```javascript
import Web3 from "web3";
import createLedgerSubprovider from "@ledgerhq/web3-subprovider";
import TransportU2F from "@ledgerhq/hw-transport-u2f";
import ProviderEngine from "web3-provider-engine";
import RpcSubprovider from "web3-provider-engine/subproviders/rpc";
const engine = new ProviderEngine();
const getTransport = () => TransportU2F.create();
const ledger = createLedgerSubprovider(getTransport, {
accountsLength: 5
});
engine.addProvider(ledger);
engine.addProvider(new RpcSubprovider({ rpcUrl }));
engine.start();
const web3 = new Web3(engine);
```

Returns **HookedWalletSubprovider**