Socket
Socket
Sign inDemoInstall

@ledgerhq/devices

Package Overview
Dependencies
Maintainers
11
Versions
261
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ledgerhq/devices - npm Package Compare versions

Comparing version 4.35.0 to 4.35.1-beta.28

LICENSE

7

lib/hid-framing.js

@@ -23,3 +23,6 @@ "use strict";

exports.default = function (channel, packetSize) {
/**
*
*/
var createHIDframing = function createHIDframing(channel, packetSize) {
return {

@@ -83,2 +86,4 @@ makeBlocks: function makeBlocks(apdu) {

};
exports.default = createHIDframing;
//# sourceMappingURL=hid-framing.js.map

@@ -38,8 +38,12 @@ "use strict";

// $FlowFixMe
var devicesList = Object.values(devices);
/**
*
*/
var ledgerUSBVendorId = exports.ledgerUSBVendorId = 0x2c97;
/**
*
*/
var getDeviceModel = exports.getDeviceModel = function getDeviceModel(id) {

@@ -51,2 +55,5 @@ var info = devices[id];

/**
*
*/
var identifyUSBProductId = exports.identifyUSBProductId = function identifyUSBProductId(usbProductId) {

@@ -74,2 +81,5 @@ return devicesList.find(function (d) {

/**
*
*/
var getBluetoothServiceUuids = exports.getBluetoothServiceUuids = function getBluetoothServiceUuids() {

@@ -79,5 +89,17 @@ return bluetoothServices;

/**
*
*/
var getInfosForServiceUuid = exports.getInfosForServiceUuid = function getInfosForServiceUuid(uuid) {
return serviceUuidToInfos[uuid.toLowerCase()];
};
/**
*
*/
/**
*
*/
//# sourceMappingURL=index.js.map

14

package.json
{
"name": "@ledgerhq/devices",
"version": "4.35.0",
"version": "4.35.1-beta.28+0f83986",
"description": "Ledger devices",

@@ -22,7 +22,7 @@ "keywords": [

"devDependencies": {
"flow-bin": "^0.78.0",
"flow-typed": "^2.4.0"
"flow-bin": "^0.92.1",
"flow-typed": "^2.5.1"
},
"dependencies": {
"@ledgerhq/errors": "^4.35.0"
"@ledgerhq/errors": "^4.35.1-beta.28+0f83986"
},

@@ -33,4 +33,6 @@ "scripts": {

"build": "bash ../../script/build.sh",
"watch": "bash ../../script/watch.sh"
}
"watch": "bash ../../script/watch.sh",
"doc": "bash ../../script/doc.sh"
},
"gitHead": "0f839862fcbb7b74581b74162c1534c9897463cf"
}

@@ -5,2 +5,82 @@ <img src="https://user-images.githubusercontent.com/211411/34776833-6f1ef4da-f618-11e7-8b13-f0697901d6a8.png" height="100" />

Logic for all Ledger devices.
Logic for all Ledger devices.
## API
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
#### Table of Contents
- [createHIDframing](#createhidframing)
- [Parameters](#parameters)
- [ledgerUSBVendorId](#ledgerusbvendorid)
- [getDeviceModel](#getdevicemodel)
- [Parameters](#parameters-1)
- [identifyUSBProductId](#identifyusbproductid)
- [Parameters](#parameters-2)
- [getBluetoothServiceUuids](#getbluetoothserviceuuids)
- [getInfosForServiceUuid](#getinfosforserviceuuid)
- [Parameters](#parameters-3)
- [DeviceModel](#devicemodel)
- [Properties](#properties)
- [BluetoothInfos](#bluetoothinfos)
- [Properties](#properties-1)
### createHIDframing
#### Parameters
- `channel` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
- `packetSize` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
### ledgerUSBVendorId
Type: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)
### getDeviceModel
#### Parameters
- `id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
Returns **[DeviceModel](#devicemodel)**
### identifyUSBProductId
#### Parameters
- `usbProductId` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
Returns **[DeviceModel](#devicemodel)?**
### getBluetoothServiceUuids
### getInfosForServiceUuid
#### Parameters
- `uuid` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
Returns **[BluetoothInfos](#bluetoothinfos)?**
### DeviceModel
Type: {id: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), productName: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), usbProductId: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number), bluetoothSpec: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;{serviceUuid: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), writeUuid: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), notifyUuid: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>?}
#### Properties
- `id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
- `productName` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
- `usbProductId` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
- `bluetoothSpec` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;{serviceUuid: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), writeUuid: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), notifyUuid: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>?**
### BluetoothInfos
Type: {deviceModel: [DeviceModel](#devicemodel), serviceUuid: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), writeUuid: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), notifyUuid: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}
#### Properties
- `deviceModel` **[DeviceModel](#devicemodel)**
- `serviceUuid` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
- `writeUuid` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
- `notifyUuid` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

@@ -25,3 +25,6 @@ // @flow

export default (channel: number, packetSize: number) => {
/**
*
*/
const createHIDframing = (channel: number, packetSize: number) => {
return {

@@ -86,1 +89,3 @@ makeBlocks(apdu: Buffer): Buffer[] {

};
export default createHIDframing;
// @flow
export type DeviceModel = {
id: string,
productName: string,
usbProductId: number,
bluetoothSpec?: Array<{
serviceUuid: string,
writeUuid: string,
notifyUuid: string
}>
};
const devices: { [id: string]: DeviceModel } = {

@@ -48,4 +37,10 @@ blue: {

/**
*
*/
export const ledgerUSBVendorId = 0x2c97;
/**
*
*/
export const getDeviceModel = (id: string): DeviceModel => {

@@ -57,12 +52,8 @@ const info = devices[id];

/**
*
*/
export const identifyUSBProductId = (usbProductId: number): ?DeviceModel =>
devicesList.find(d => d.usbProductId === usbProductId);
export type BluetoothInfos = {
deviceModel: DeviceModel,
serviceUuid: string,
writeUuid: string,
notifyUuid: string
};
const bluetoothServices: string[] = [];

@@ -85,5 +76,35 @@ const serviceUuidToInfos: {

/**
*
*/
export const getBluetoothServiceUuids = () => bluetoothServices;
/**
*
*/
export const getInfosForServiceUuid = (uuid: string): ?BluetoothInfos =>
serviceUuidToInfos[uuid.toLowerCase()];
/**
*
*/
export type DeviceModel = {
id: string,
productName: string,
usbProductId: number,
bluetoothSpec?: Array<{
serviceUuid: string,
writeUuid: string,
notifyUuid: string
}>
};
/**
*
*/
export type BluetoothInfos = {
deviceModel: DeviceModel,
serviceUuid: string,
writeUuid: string,
notifyUuid: string
};

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