@ledgerhq/hw-transport-node-hid
Advanced tools
Comparing version 4.22.0-beta.ae6f5c51 to 4.22.0
@@ -12,11 +12,10 @@ "use strict"; | ||
var _isLedgerDevice = require("./isLedgerDevice"); | ||
var _isLedgerDevice2 = _interopRequireDefault(_isLedgerDevice); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var filterInterface = function filterInterface(device) { | ||
return ["win32", "darwin"].includes(process.platform) ? device.usagePage === 0xffa0 : device.interface === 0; | ||
}; | ||
function getDevices() { | ||
return _nodeHid2.default.devices().filter(_isLedgerDevice2.default); | ||
return _nodeHid2.default.devices(0x2c97, 0x0).filter(filterInterface); | ||
} | ||
//# sourceMappingURL=getDevices.js.map |
@@ -73,3 +73,3 @@ "use strict"; | ||
var listenDevicesPollingInterval = 500; | ||
var listenDevicesDebounce = 500; | ||
var listenDevicesPollingSkip = function listenDevicesPollingSkip() { | ||
@@ -416,4 +416,4 @@ return false; | ||
TransportNodeHid.setListenDevicesPollingInterval = function (delay) { | ||
listenDevicesPollingInterval = delay; | ||
TransportNodeHid.setListenDevicesDebounce = function (delay) { | ||
listenDevicesDebounce = delay; | ||
}; | ||
@@ -470,3 +470,3 @@ | ||
var _listenDevices = (0, _listenDevices3.default)(listenDevicesPollingInterval, listenDevicesPollingSkip, listenDevicesDebug), | ||
var _listenDevices = (0, _listenDevices3.default)(listenDevicesDebounce, listenDevicesPollingSkip, listenDevicesDebug), | ||
events = _listenDevices.events, | ||
@@ -473,0 +473,0 @@ stop = _listenDevices.stop; |
{ | ||
"name": "@ledgerhq/hw-transport-node-hid", | ||
"version": "4.22.0-beta.ae6f5c51", | ||
"version": "4.22.0", | ||
"description": "Ledger Hardware Wallet Node implementation of the communication layer, using node-hid", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@ledgerhq/hw-transport": "^4.22.0-beta.ae6f5c51", | ||
"@ledgerhq/hw-transport": "^4.21.0", | ||
"lodash": "^4.17.10", | ||
@@ -31,0 +31,0 @@ "node-hid": "^0.7.2", |
// @flow | ||
import HID from "node-hid"; | ||
import isLedgerDevice from "./isLedgerDevice"; | ||
const filterInterface = device => | ||
["win32", "darwin"].includes(process.platform) | ||
? device.usagePage === 0xffa0 | ||
: device.interface === 0; | ||
export default function getDevices(): Array<*> { | ||
return HID.devices().filter(isLedgerDevice); | ||
return HID.devices(0x2c97, 0x0).filter(filterInterface); | ||
} |
@@ -29,3 +29,3 @@ //@flow | ||
let listenDevicesPollingInterval = 500; | ||
let listenDevicesDebounce = 500; | ||
let listenDevicesPollingSkip = () => false; | ||
@@ -65,4 +65,4 @@ let listenDevicesDebug = () => {}; | ||
static setListenDevicesPollingInterval = (delay: number) => { | ||
listenDevicesPollingInterval = delay; | ||
static setListenDevicesDebounce = (delay: number) => { | ||
listenDevicesDebounce = delay; | ||
}; | ||
@@ -99,3 +99,3 @@ | ||
const { events, stop } = listenDevices( | ||
listenDevicesPollingInterval, | ||
listenDevicesDebounce, | ||
listenDevicesPollingSkip, | ||
@@ -102,0 +102,0 @@ listenDevicesDebug |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
0
83072
15
1004