Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ledgerhq/hw-transport-node-speculos-http

Package Overview
Dependencies
Maintainers
0
Versions
148
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ledgerhq/hw-transport-node-speculos-http

Ledger Hardware Wallet communication layer with speculos Nano simulator using the http api

  • 6.29.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
864
decreased by-4%
Maintainers
0
Weekly downloads
 
Created
Source

@ledgerhq/hw-transport-node-speculos-http

A transport for https://github.com/LedgerHQ/speculos Nano simulator using its HTTP API.

GitHub, Ledger Devs Discord, Developer Portal

Getting started

import SpeculosTransport from "@ledgerhq/hw-transport-node-speculos-http";

async function exampleSimple() {
  const transport = await SpeculosTransport.open();
  const res = await transport.send(0xE0, 0x01, 0x00, 0x00);
}

async function exampleAdvanced() {
  const transport = await SpeculosTransport.open({ baseURL: "http://localhost:5000" });
  transport.eventStream.once("data", {
    // we will click right when the display changes
    transport.button("right");
  });
  // we can also use eventStream.on and match the data buffer with the expected display before taking action
  // derivate btc address and ask for device verification
  const res = await transport.send(0xE0, 0x40, 0x01, 0x00, Buffer.from("058000002c8000000080000000000000000000000f"));
}

API

Table of Contents

SpeculosHttpTransport

Extends Transport

Speculos TCP transport implementation

Parameters
  • instance AxiosInstance
  • opts SpeculosHttpTransportOpts
Examples
import SpeculosHttpTransport from "@ledgerhq/hw-transport-node-speculos-http";
const transport = await SpeculosHttpTransport.open();
const res = await transport.send(0xE0, 0x01, 0, 0);
button

Press and release button buttons available: left, right, both

Parameters
  • but any

Returns Promise<void>

Keywords

FAQs

Package last updated on 27 Sep 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