6.28.6 • Published 21 days ago

@ledgerhq/hw-transport-node-speculos v6.28.6

Weekly downloads
1,081
License
Apache-2.0
Repository
github
Last release
21 days ago

@ledgerhq/hw-transport-node-speculos

A transport for https://github.com/LedgerHQ/speculos Nano simulator.

GitHub, Ledger Devs Discord, Developer Portal

Getting started

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

const apduPort = 40000;

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

async function exampleAdvanced() {
  const transport = await SpeculosTransport.open({ apduPort });
  setTimeout(() => {
    // in 1s i'll click on right button and release
    transport.button("Rr");
  }, 1000); // 1s is a tradeoff here. In future, we need to be able to "await & expect a text" but that will need a feature from speculos to notify us when text changes.
  // derivate btc address and ask for device verification
  const res = await transport.send(0xE0, 0x40, 0x01, 0x00, Buffer.from("058000002c8000000080000000000000000000000f"));
}

With ledger-live CLI

It's working with SPECULOS_APDU_PORT and SPECULOS_HOST envs.

SPECULOS_APDU_PORT=40000 ledger-live sync -c btc

# starts an http proxy with speculos (http proxy that works with LLD and LLM)
SPECULOS_APDU_PORT=40000 ledger-live proxy

To make it work with Docker, I had to expose some port and do this:

docker run -it -p 40000:40000 -v "$(pwd)"/apps:/speculos/apps speculos /bin/bash

$ pipenv shell
$ ./speculos.py -m nanos ./apps/btc.elf --sdk 1.6 --seed "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about" --display headless --apdu-port 40000

API

Table of Contents

SpeculosTransportOpts

Type: {apduPort: number, buttonPort: number?, automationPort: number?, host: string?}

Properties

SpeculosTransport

Extends Transport

Speculos TCP transport implementation

Parameters

Examples

import SpeculosTransport from "@ledgerhq/hw-transport-node-speculos";
const transport = await SpeculosTransport.open({ apduPort });
const res = await transport.send(0xE0, 0x01, 0, 0);

button

Send a speculos button command typically "Ll" would press and release the left button typically "Rr" would press and release the right button

Parameters
  • command any

Returns Promise\

open

Parameters

Returns Promise<SpeculosTransport>

6.28.6

21 days ago

6.28.6-next.0

1 month ago

6.28.6-nightly.0

1 month ago

6.28.5

2 months ago

6.28.5-nightly.1

2 months ago

6.28.5-nightly.0

2 months ago

6.28.5-next.0

2 months ago

6.28.4-new-wc.0

3 months ago

6.28.4

3 months ago

6.28.4-wc-test.0

3 months ago

6.28.4-next.0

3 months ago

6.28.4-nightly.0

3 months ago

6.28.3

3 months ago

6.28.3-next.0

4 months ago

6.28.2

4 months ago

6.28.2-nightly.1

4 months ago

6.28.2-next.0

4 months ago

6.28.2-nightly.0

5 months ago

6.28.1

5 months ago

6.28.1-next.0

5 months ago

6.28.0-next.0

6 months ago

6.27.20-nightly.0

8 months ago

6.27.20-nightly.2

7 months ago

6.27.20-nightly.1

7 months ago

6.27.20-nightly.3

6 months ago

6.28.1-nightly.0

5 months ago

6.28.0-nightly.2

6 months ago

6.28.0-nightly.3

6 months ago

6.28.0

6 months ago

6.27.21-nightly.1

6 months ago

6.27.21-nightly.0

6 months ago

6.27.17

10 months ago

6.27.20-next.0

6 months ago

6.27.18

9 months ago

6.27.19

9 months ago

6.27.18-nightly.2

9 months ago

6.27.18-nightly.1

9 months ago

6.27.18-nightly.0

10 months ago

6.27.20

6 months ago

6.27.20-tag-word.0

7 months ago

6.27.19-next.0

9 months ago

6.27.17-nightly.0

10 months ago

6.27.17-next.0

10 months ago

6.27.18-next.0

9 months ago

6.27.16-notarizer.0

11 months ago

6.27.15-nightly.0

12 months ago

6.27.16-nightly.0

11 months ago

6.27.16

11 months ago

6.27.14

1 year ago

6.27.15

12 months ago

6.27.15-next.0

12 months ago

6.27.14-next.0

1 year ago

6.27.16-next.0

11 months ago

6.27.13

1 year ago

6.27.13-next.0

1 year ago

6.27.12

1 year ago

6.27.11

1 year ago

6.27.12-next.0

1 year ago

6.27.11-next.0

1 year ago

6.27.9-next.0

1 year ago

6.27.7-next.0

1 year ago

6.27.7-nightly.1

2 years ago

6.27.8-next.0

1 year ago

6.27.10

1 year ago

6.27.9

1 year ago

6.27.7

1 year ago

6.27.8

1 year ago

6.27.10-next.0

1 year ago

6.27.6-next.0

2 years ago

6.27.7-nightly.0

2 years ago

6.27.5

2 years ago

6.27.6

2 years ago

6.27.7-ts-llm.0

2 years ago

6.27.5-nightly.2

2 years ago

6.27.5-nightly.0

2 years ago

6.27.5-nightly.1

2 years ago

6.27.3

2 years ago

6.27.4

2 years ago

6.27.5-next.0

2 years ago

6.27.4-nightly.0

2 years ago

6.27.4-next.0

2 years ago

6.27.2-next.0

2 years ago

6.27.2-yolo.0

2 years ago

6.27.2-nightly.1

2 years ago

6.27.2

2 years ago

6.27.3-next.0

2 years ago

6.27.3-nightly.0

2 years ago

6.27.2-nightly.0

2 years ago

6.27.1

2 years ago

6.27.1-fts.6

2 years ago

6.24.1

2 years ago

6.25.1-alpha.3

2 years ago

6.20.0

2 years ago

6.19.0

2 years ago

6.11.2

3 years ago

6.11.0

3 years ago

6.9.1-taproot.0

3 years ago

6.10.0

3 years ago

6.7.0

3 years ago

6.3.0

3 years ago

6.2.0-bsc.5

3 years ago

6.2.0-bsc.4

3 years ago

6.2.0

3 years ago

6.2.0-bsc.1

3 years ago

6.2.0-bsc.2

3 years ago

6.2.0-bsc.3

3 years ago

6.2.0-bsc.0

3 years ago

6.1.0

3 years ago

6.0.1

3 years ago

6.0.0

3 years ago

6.0.2

3 years ago

6.0.0-rc.0

3 years ago

6.0.0-alpha.5

3 years ago

5.48.1-alpha.25

3 years ago

5.51.1

3 years ago

5.50.0

3 years ago

5.51.0

3 years ago

5.49.0

3 years ago

5.48.1-uglify.0

3 years ago

5.48.0

3 years ago

5.46.0

3 years ago

5.45.0

3 years ago

5.43.0

3 years ago

5.41.0

3 years ago

5.40.0

3 years ago

5.39.1

3 years ago

5.39.0

3 years ago

5.38.0

3 years ago

5.36.0

3 years ago

5.34.0

3 years ago

5.33.1-alpha.3

3 years ago

5.30.0

3 years ago

5.29.0

3 years ago

5.28.0

4 years ago

5.26.0

4 years ago

5.25.0

4 years ago

5.23.0

4 years ago

5.22.0

4 years ago

5.21.0

4 years ago

5.19.1

4 years ago

5.19.0

4 years ago

5.17.0

4 years ago

5.16.1

4 years ago

5.15.3

4 years ago

5.15.2

4 years ago

5.15.0

4 years ago

5.13.1

4 years ago

5.13.0

4 years ago

5.12.0

4 years ago

5.11.0

4 years ago

5.9.0

4 years ago

5.8.0

4 years ago