Socket
Socket
Sign inDemoInstall

@ledgerhq/hw-http-proxy-devserver

Package Overview
Dependencies
144
Maintainers
12
Versions
179
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ledgerhq/hw-http-proxy-devserver

Ledger Hardware Wallet debug communication layer http proxy (for development only)


Version published
Weekly downloads
206
increased by25.61%
Maintainers
12
Install size
15.2 MB
Created
Weekly downloads
 

Readme

Source

@ledgerhq/hw-http-proxy-devserver

Proxy a Ledger device plugged in USB over HTTP / WebSocket.

  • Plug your Ledger device on your computer
  • Run a HTTP server with the ledger-hw-http-proxy-devserver command
  • Use @ledgerhq/hw-transport-http in your code like a normal transport so you can run Legder device APDU over http.

Goal: This library is meant for DEV & testing purpose only. It is not designed to be used in PROD.

Setup

Install with one of these:

npm i -g @ledgerhq/hw-http-proxy-devserver
yarn global add @ledgerhq/hw-http-proxy-devserver

Run the server

In a console, simply run:

ledger-hw-http-proxy-devserver

hw-transport-http to communicate with the server

To communicate with this server, there is a dedicated Transport library. You can use it like any other Ledger transport like hw-transport-node-hid, hw-transport-u2f, ...

import withStaticURL from "@ledgerhq/hw-transport-http";

// you can change localhost to a local IP (e.g. to use from a Phone)
const Transport = withStaticURL("ws://localhost:8435");

// ... normal @ledgerhq/* code

import AppBtc from "@ledgerhq/hw-app-btc";
const getBtcAddress = async () => {
  const transport = await Transport.create();
  const btc = new AppBtc(transport);
  const result = await btc.getWalletPublicKey("44'/0'/0'/0/0");
  return result.bitcoinAddress;
};
getBtcAddress().then(a => console.log(a));

More information

Github, Ledger Devs Slack

Keywords

FAQs

Last updated on 17 Dec 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc