Socket
Socket
Sign inDemoInstall

@ledgerhq/hw-transport-webusb

Package Overview
Dependencies
Maintainers
14
Versions
288
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ledgerhq/hw-transport-webusb - npm Package Compare versions

Comparing version 6.0.0-typescript.3 to 6.0.0

2

lib-es/TransportWebUSB.js

@@ -67,4 +67,2 @@ var __extends = (this && this.__extends) || (function () {

*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
var TransportWebUSB = /** @class */ (function (_super) {

@@ -71,0 +69,0 @@ __extends(TransportWebUSB, _super);

2

lib-es/webusb.js

@@ -87,3 +87,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

export var isSupported = function () {
return Promise.resolve(!!navigator && // $FlowFixMe
return Promise.resolve(!!navigator &&
!!navigator.usb &&

@@ -90,0 +90,0 @@ typeof navigator.usb.getDevices === "function");

@@ -72,4 +72,2 @@ "use strict";

*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
var TransportWebUSB = /** @class */ (function (_super) {

@@ -76,0 +74,0 @@ __extends(TransportWebUSB, _super);

@@ -93,3 +93,3 @@ "use strict";

var isSupported = function () {
return Promise.resolve(!!navigator && // $FlowFixMe
return Promise.resolve(!!navigator &&
!!navigator.usb &&

@@ -96,0 +96,0 @@ typeof navigator.usb.getDevices === "function");

{
"name": "@ledgerhq/hw-transport-webusb",
"version": "6.0.0-typescript.3",
"version": "6.0.0",
"description": "Ledger Hardware Wallet WebUSB implementation of the communication layer",

@@ -29,6 +29,6 @@ "keywords": [

"dependencies": {
"@ledgerhq/devices": "^6.0.0-typescript.1",
"@ledgerhq/errors": "^6.0.0-typescript.1",
"@ledgerhq/hw-transport": "^6.0.0-typescript.3",
"@ledgerhq/logs": "^6.0.0-typescript.1"
"@ledgerhq/devices": "^6.0.0",
"@ledgerhq/errors": "^6.0.0",
"@ledgerhq/hw-transport": "^6.0.0",
"@ledgerhq/logs": "^6.0.0"
},

@@ -43,5 +43,5 @@ "devDependencies": {

"watch": "bash ../../script/watch.sh",
"doc": "bash ../../script/doc-ts.sh"
"doc": "bash ../../script/doc.sh"
},
"gitHead": "1e33071ab6b72814c432098741c23181daf9e3bc"
"gitHead": "15e2319aaeb6e0d981c48c1d5c4363ee0dcdea80"
}

@@ -24,4 +24,6 @@ import Transport from "@ledgerhq/hw-transport";

} from "./webusb";
const configurationValue = 1;
const endpointNumber = 3;
/**

@@ -34,4 +36,2 @@ * WebUSB Transport implementation

*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
export default class TransportWebUSB extends Transport {

@@ -38,0 +38,0 @@ device: USBDevice;

import { ledgerUSBVendorId } from "@ledgerhq/devices";
const ledgerDevices = [

@@ -7,4 +8,4 @@ {

];
export async function requestLedgerDevice(): Promise<USBDevice> {
// $FlowFixMe
const device = await navigator.usb.requestDevice({

@@ -15,7 +16,8 @@ filters: ledgerDevices,

}
export async function getLedgerDevices(): Promise<USBDevice[]> {
// $FlowFixMe
const devices = await navigator.usb.getDevices();
return devices.filter((d) => d.vendorId === ledgerUSBVendorId);
}
export async function getFirstLedgerDevice(): Promise<USBDevice> {

@@ -26,7 +28,8 @@ const existingDevices = await getLedgerDevices();

}
export const isSupported = (): Promise<boolean> =>
Promise.resolve(
!!navigator && // $FlowFixMe
!!navigator &&
!!navigator.usb &&
typeof navigator.usb.getDevices === "function"
);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc