0x subproviders
A bunch of useful subproviders, including a Ledger Nano subprovider.
Ledger Subprovider for Web3
Usage example as a Web3 Provider Engine.
; const networkId = 42;const provider = ;// Browser (U2F) or Nodeconst conn = LedgerBrowserCommunicationFactory;const wallet = conn networkId; const ledgerSubProvider = ;// Hooks in as a HookedWalletSubProvider// This takes over all Signing operations in the web3 stackprovider;// All other operations need to fall through to an underlying provider// in this case infura or another JSON RPC endpointprovider;providerstart;
Offset the derivation path
// Offset the derivation pathconst conn = LedgerBrowserCommunicationFactory;const wallet = conn networkId;wallet;
Use directly rather than as a Web3 Provider
// Offset the derivation pathconst conn = LedgerBrowserCommunicationFactory;const wallet = conn networkId;wallet;wallet;
Set the modified provider in 0x.js
this.zeroEx = new ZeroEx(provider);
Test the connection before assuming the ledger is present.
provider = ;const conn = LedgerBrowserCommunicationFactory;const wallet = conn networkId;const timeout = 500;wallet;