Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@petejkim/ledger-web3-subprovider

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@petejkim/ledger-web3-subprovider

Ledger Web3 subprovider with support for arbitrary chain IDs

  • 5.35.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

@petejkim/ledger-web3-subprovider

A web3 subprovider for Ledger hardware wallets, with support for arbitrary chain IDs.

Github, Ledger Devs Slack

API

Table of Contents

SubproviderOptions

Properties
  • networkId number
  • paths Array<string>?
  • askConfirm boolean?
  • accountsLength number?
  • accountsOffset number?

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 "@petejkim/ledger-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,
  networkId: 1 // supports arbitrary chain IDs
});

engine.addProvider(ledger);
engine.addProvider(new RpcSubprovider({ rpcUrl }));
engine.start();

const web3 = new Web3(engine);

Returns HookedWalletSubprovider

Keywords

FAQs

Package last updated on 24 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc