New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ledgerhq/hw-transport-webhid

Package Overview
Dependencies
Maintainers
8
Versions
245
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ledgerhq/hw-transport-webhid

Ledger Hardware Wallet WebHID implementation of the communication layer

  • 6.30.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
112K
decreased by-18.31%
Maintainers
8
Weekly downloads
 
Created

What is @ledgerhq/hw-transport-webhid?

@ledgerhq/hw-transport-webhid is an npm package that provides a transport layer for communicating with Ledger hardware wallets using the WebHID API. It allows developers to interact with Ledger devices directly from web applications, enabling functionalities such as sending commands to the device and receiving responses.

What are @ledgerhq/hw-transport-webhid's main functionalities?

Open Connection

This feature allows you to establish a connection with a Ledger device using the WebHID API. The code sample demonstrates how to create a transport instance and open a connection to the device.

const TransportWebHID = require('@ledgerhq/hw-transport-webhid');

async function openConnection() {
  const transport = await TransportWebHID.create();
  console.log('Connection opened:', transport);
}

openConnection();

Send APDU Command

This feature allows you to send an APDU command to the Ledger device. The code sample shows how to send a command and receive a response from the device.

const TransportWebHID = require('@ledgerhq/hw-transport-webhid');

async function sendCommand() {
  const transport = await TransportWebHID.create();
  const response = await transport.send(0xE0, 0x01, 0x00, 0x00, Buffer.from([]));
  console.log('Response:', response);
}

sendCommand();

Close Connection

This feature allows you to close the connection with the Ledger device. The code sample demonstrates how to properly close the transport connection.

const TransportWebHID = require('@ledgerhq/hw-transport-webhid');

async function closeConnection() {
  const transport = await TransportWebHID.create();
  await transport.close();
  console.log('Connection closed');
}

closeConnection();

Other packages similar to @ledgerhq/hw-transport-webhid

Keywords

FAQs

Package last updated on 12 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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