@ledgerhq/web3-subprovider

Ledger Hardware Wallet Ethereum Web3 subprovider

Stats

StarsIssuesVersionUpdatedCreatedSize
@ledgerhq/web3-subprovider
5.36.0-deprecated9 months ago4 years agoMinified + gzip package size for @ledgerhq/web3-subprovider in KB

Readme

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!


@ledgerhq/web3-subprovider

Library for Ledger Hardware Wallets.

Github, Ledger Devs Slack

API

Table of Contents

SubproviderOptions

Properties

createLedgerSubprovider

Create a HookedWalletSubprovider for Ledger devices.

Parameters

  • getTransport function (): Transport<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?

Examples

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

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.