How to use the @ledgerhq/hw-transport-node-hid-noevents.list function in @ledgerhq/hw-transport-node-hid-noevents

To help you get started, weā€™ve selected a few @ledgerhq/hw-transport-node-hid-noevents examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LedgerHQ / ledgerjs / packages / hw-transport-node-hid-singleton / src / TransportNodeHid.js View on Github external
* node-hid Transport implementation
 * @example
 * import TransportNodeHid from "@ledgerhq/hw-transport-node-hid-singleton";
 * ...
 * TransportNodeHid.create().then(transport => ...)
 */
export default class TransportNodeHidSingleton extends TransportNodeHidNoEvents {
  /**
   *
   */
  static isSupported = TransportNodeHidNoEvents.isSupported;

  /**
   *
   */
  static list = TransportNodeHidNoEvents.list;

  /**
   */
  static listen = (observer: Observer>): Subscription => {
    let unsubscribed;
    Promise.resolve(getDevices()).then(devices => {
      // this needs to run asynchronously so the subscription is defined during this phase
      for (const device of devices) {
        if (!unsubscribed) {
          const deviceModel = identifyUSBProductId(device.productId);
          observer.next({
            type: "add",
            descriptor: "",
            device: { name: device.deviceName },
            deviceModel
          });
github LedgerHQ / ledgerjs / packages / hw-transport-node-hid / src / TransportNodeHid.js View on Github external
* node-hid Transport implementation
 * @example
 * import TransportNodeHid from "@ledgerhq/hw-transport-node-hid";
 * ...
 * TransportNodeHid.create().then(transport => ...)
 */
export default class TransportNodeHid extends TransportNodeHidNoEvents {
  /**
   *
   */
  static isSupported = TransportNodeHidNoEvents.isSupported;

  /**
   *
   */
  static list = TransportNodeHidNoEvents.list;

  /**
   *
   */
  static setListenDevicesDebounce = (delay: number) => {
    listenDevicesDebounce = delay;
  };

  /**
   *
   */
  static setListenDevicesPollingSkip = (conditionToSkip: () => boolean) => {
    listenDevicesPollingSkip = conditionToSkip;
  };

  /**

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

Ledger Hardware Wallet Node implementation of the communication layer, using node-hid. without usb events

MIT
Latest version published 1 month ago

Package Health Score

90 / 100
Full package analysis