Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
}
}
private async getTransport(): Promise {
const transport = await TransportWebUSB.request();
transport.on('disconnect', () => {
this.transport = null;
});
return transport;
}
}
private async getTransport(): Promise {
const transport = await TransportWebUSB.request();
transport.on('disconnect', () => {
this.transport = null;
});
return transport;
}
}