How to use @ledgerhq/hw-transport-web-ble - 7 common examples

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 Mrtenz / FindETH / src / wallets / ledger / LedgerBLE.ts View on Github external
return new Promise((resolve, reject) => {
      const subscription = TransportWebBLE.listen({
        next(event: DescriptorEvent): void {
          if (event.type === 'add') {
            subscription.unsubscribe();
            resolve(event.descriptor);
          }
        },
        error(error: any): void {
          reject(error);
        },
        complete(): void {
          // noop
        }
      });
    });
  }
github Mrtenz / FindETH / packages / web / src / wallets / ledger / LedgerBLE.ts View on Github external
return new Promise((resolve, reject) => {
      const subscription = TransportWebBLE.listen({
        next(event: DescriptorEvent): void {
          if (event.type === 'add') {
            subscription.unsubscribe();
            resolve(event.descriptor);
          }
        },
        error(error: any): void {
          reject(error);
        },
        complete(): void {
          // noop
        }
      });
    });
  }
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;
  },
github Mrtenz / FindETH / packages / web / src / wallets / ledger / LedgerBLE.ts View on Github external
private async getTransport(): Promise {
    const device = await this.getDevice();
    const transport = await TransportWebBLE.open(device);

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

    return transport;
  }
github Mrtenz / FindETH / src / wallets / ledger / LedgerBLE.ts View on Github external
private async getTransport(): Promise {
    const device = await this.getDevice();
    const transport = await TransportWebBLE.open(device);

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

    return transport;
  }
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 1 month ago

Package Health Score

87 / 100
Full package analysis