How to use the @ledgerhq/hw-transport-node-hid-noevents.create 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 MyCryptoHQ / MyCrypto / shared / enclave / server / wallets / ledger.ts View on Github external
async function getEthApp() {
  try {
    if (!transport) {
      transport = await TransportNodeHid.create();
      transport.on('disconnect', () => (transport = null));
    }
    return new LedgerEth(transport);
  } catch (err) {
    if (err && err.name === 'TransportError') {
      throw new Error('ENCLAVE_LEDGER_IN_USE');
    }
    if (err && err.message && err.message.includes('cannot open device with path')) {
      throw new Error('ENCLAVE_LEDGER_IN_USE');
    }
    throw err;
  }
}

@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 2 months ago

Package Health Score

90 / 100
Full package analysis