@ledgerhq/hw-transport-webusb
Advanced tools
Comparing version 6.0.0-typescript.3 to 6.0.0
@@ -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); |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
98654
1208
Updated@ledgerhq/devices@^6.0.0
Updated@ledgerhq/errors@^6.0.0
Updated@ledgerhq/logs@^6.0.0