How to use the @ledgerhq/hw-transport-webusb.request function in @ledgerhq/hw-transport-webusb

To help you get started, we’ve selected a few @ledgerhq/hw-transport-webusb 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 shapeshift / hdwallet / packages / hdwallet-ledger-webusb / src / transport.ts View on Github external
export async function getTransport(): Promise {
  if (!(window && window.navigator.usb))
    throw new WebUSBNotAvailable()

  try {
    return await TransportWebUSB.request()
  } catch (err) {
    if (err.name === 'TransportInterfaceNotAvailable') {
      throw new ConflictingApp('Ledger')
    }

    throw new WebUSBCouldNotPair('Ledger', err.message)
  }
}
github Mrtenz / FindETH / packages / web / src / wallets / ledger / LedgerUSB.ts View on Github external
private async getTransport(): Promise {
    const transport = await TransportWebUSB.request();

    transport.on('disconnect', () => {
      this.transport = null;
    });

    return transport;
  }
}
github Mrtenz / FindETH / src / wallets / ledger / LedgerUSB.ts View on Github external
private async getTransport(): Promise {
    const transport = await TransportWebUSB.request();

    transport.on('disconnect', () => {
      this.transport = null;
    });

    return transport;
  }
}