How to use the @ledgerhq/hw-transport-node-hid.isSupported 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 CityOfZion / neon-wallet / app / ledger / neonLedger.js View on Github external
static async init () {
    const supported = await LedgerNode.isSupported()
    if (!supported) { throw new Error(`Your computer does not support the ledger!`) }
    const paths = await NeonLedger.list()
    if (paths.length === 0) throw new Error('USB Error: No device found.')
    const ledger = new NeonLedger(paths[0])
    return ledger.open()
  }