How to use the @ledgerhq/hw-transport-web-ble.create function in @ledgerhq/hw-transport-web-ble

To help you get started, we’ve selected a few @ledgerhq/hw-transport-web-ble 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 / app / flex / ledger / index.js View on Github external
async scan () {
    try {
      const device = await TransportWebBLE.create()
      if (!this.devices[device.id]) {
        this.devices[device.id] = new Device(device, this.emit)
        device.on('disconnect', () => {
          this.devices[device.id].disconnect()
          delete this.devices[device.id]
          // remove list
          this.emit('ledger:scan') // Request scan
        })
      }
    } catch (e) {
      console.log(e)
    }
  }
github LedgerHQ / ledger-live-common / tools / src / live-common-setup.js View on Github external
open: (id: string): ?Promise<*> => {
    if (id.startsWith("webble")) {
      const existingDevice = webbleDevices[id];
      return existingDevice
        ? TransportWebBLE.open(existingDevice)
        : TransportWebBLE.create();
    }
    return null;
  },

@ledgerhq/hw-transport-web-ble

Ledger Hardware Wallet Web Bluetooth implementation of the communication layer

MIT
Latest version published 3 days ago

Package Health Score

90 / 100
Full package analysis