@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", {
transport.button("right");
});
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
AxiosInstanceopts
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
Returns Promise<void>