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

To help you get started, we’ve selected a few @ledgerhq/hw-transport-node-hid 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 floating / frame / main / signers / ledger / Ledger / index.js View on Github external
async getDevice () {
    if (this.pause) throw new Error('Device access is paused')
    if (Date.now() - this.lastUse < 300) await this.wait(300)
    await this.releaseDevice()
    this.pause = true
    this.currentDevice = new HID.HID(this.devicePath)
    this.currentTransport = new TransportNodeHid(this.currentDevice)
    return new Eth(this.currentTransport)
  }