Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @ledgerhq/hw-transport-node-hid with all npm packages installed. Try it out:

var hwTransportNodeHid = require("@ledgerhq/hw-transport-node-hid")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@ledgerhq/hw-transport-node-hid v4.47.0

Ledger Hardware Wallet Node implementation of the communication layer, using node-hid

Github, API Doc, Ledger Devs Slack

@ledgerhq/hw-transport-node-hid

Allows to communicate with Ledger Hardware Wallets.

[Node]/Electron (HID) – uses node-hid and usb.

API

Table of Contents

TransportNodeHid

Extends Transport

node-hid Transport implementation

Parameters

  • device HID.HID

Examples

import TransportNodeHid from "@ledgerhq/hw-transport-node-hid";
...
TransportNodeHid.create().then(transport => ...)

exchange

Exchange with the device using APDU protocol.

Parameters

Returns Promise<Buffer> a promise of apdu response

close

release the USB device.

Returns Promise<void>

isSupported

Returns Promise<boolean>

list

Returns Promise<Array<string>>

setListenDevicesDebounce

Parameters

setListenDevicesPollingSkip

Parameters
  • conditionToSkip function (): boolean

setListenDevicesDebug

Parameters

listen

Parameters
  • observer Observer<DescriptorEvent<string>>

Returns Subscription

open

if path="" is not provided, the library will take the first device

Parameters
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free