Socket
Socket
Sign inDemoInstall

@ledgerhq/hw-transport-node-hid

Package Overview
Dependencies
Maintainers
7
Versions
399
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ledgerhq/hw-transport-node-hid - npm Package Compare versions

Comparing version 4.33.0 to 4.33.1

24

lib/TransportNodeHid.js

@@ -352,5 +352,7 @@ "use strict";

/**
* if path is not provided, the library will take the first device
*/
value: function () {
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(path) {
var device;
return regeneratorRuntime.wrap(function _callee$(_context) {

@@ -360,5 +362,23 @@ while (1) {

case 0:
return _context.abrupt("return", Promise.resolve(new TransportNodeHid(path ? new _nodeHid2.default.HID(path) : new _nodeHid2.default.HID(0x2c97, 0x01))));
if (!path) {
_context.next = 2;
break;
}
case 1:
return _context.abrupt("return", Promise.resolve(new TransportNodeHid(new _nodeHid2.default.HID(path))));
case 2:
device = (0, _getDevices2.default)()[0];
if (device) {
_context.next = 5;
break;
}
throw new _hwTransport.TransportError("NoDevice", "NoDevice");
case 5:
return _context.abrupt("return", Promise.resolve(new TransportNodeHid(device)));
case 6:
case "end":

@@ -365,0 +385,0 @@ return _context.stop();

2

package.json
{
"name": "@ledgerhq/hw-transport-node-hid",
"version": "4.33.0",
"version": "4.33.1",
"description": "Ledger Hardware Wallet Node implementation of the communication layer, using node-hid",

@@ -5,0 +5,0 @@ "keywords": [

@@ -40,3 +40,3 @@ //@flow

*/
export default class TransportNodeHid extends Transport<string> {
export default class TransportNodeHid extends Transport<?string> {
device: HID.HID;

@@ -123,7 +123,11 @@ ledgerTransport: boolean;

/**
* if path is not provided, the library will take the first device
*/
static async open(path: string) {
return Promise.resolve(
new TransportNodeHid(path ? new HID.HID(path) : new HID.HID(0x2c97, 0x01))
);
static async open(path: ?string) {
if (path) {
return Promise.resolve(new TransportNodeHid(new HID.HID(path)));
}
const device = getDevices()[0];
if (!device) throw new TransportError("NoDevice", "NoDevice");
return Promise.resolve(new TransportNodeHid(device));
}

@@ -130,0 +134,0 @@

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