Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

Latest commit

 

History

History

hw-transport-node-hid-singleton

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Github, Ledger Devs Slack

@ledgerhq/hw-transport-node-hid-singleton

Allows to communicate with Ledger Hardware Wallets.

[Node]/Electron (HID) – uses node-hid and usb-detection. Keep transport opened and re-use it as a singleton, one device at a time on a computer but more robust implementation.

API

Table of Contents

TransportNodeHidSingleton

Extends TransportNodeHidNoEvents

node-hid Transport implementation

Examples

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

exchange

Exchange with the device using APDU protocol.

Parameters

Returns Promise<Buffer> a promise of apdu response

isSupported

list

listen

Parameters
  • observer Observer<DescriptorEvent<any>>

Returns Subscription

autoDisconnect

convenience wrapper for auto-disconnect logic

Returns void

disconnect

globally disconnect the transport singleton

open

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

Returns Promise<TransportNodeHidSingleton>