Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@thorchain/ledger-thorchain

thorchain8.3kApache-2.00.1.0-alpha.2TypeScript support: included

Node API for THORChain App (Ledger Nano S/X)

Ledger, TypeScript, Tendermint, THORChain

readme

ledger-thorchain-js

License

This package provides a basic client library to communicate with a THORChain App running in a Ledger Nano S/X

We recommend using the npm package in order to receive updates/fixes.

Build

yarn build

Tests

Unit tests

yarn test:unit

e2e tests

`e2e' tests are to run some tests against your connected Ledger locally (no CI).

Create a .e2e.env (use .e2e.env.sample as template) to add THOR_PUB_KEY (public key of your Ledger) and THOR_ADDRESS (thor address of your Ledger).

Connect your Ledger, open THORChain app on it and start e2e tests locally:

yarn test:e2e

Hint: Add .only to the tests to run a single test only

Example

This repo also includes a simple Vue example for WebUSB and WebHID.

To run it locally

yarn serve

and open Chrome at https://localhost:8080/

Example

changelog

0.1.0 (2021-XX-XX)

Update

  • Rewrite in TypeScript
  • Introduce custom LedgerError
  • Improve Promise handling

Breaking changes

  • Values of misc. XYZResponse's have been renamed to use camel case (instead of snake case)
  • Re-organize helper function to be available in helpers and common only (Deprecated v1 helpers have been removed)
  • Rename some methods of THORChain app (mostly to prefix getter methods with get...)

0.0.3 (2021-07-20)

Internal updates

  • Update dependencies, Remove deprecated @ledgerhq/hw-transport-u2f from examples, Use same jest.setTimeout for all e2e tests #2
  • Update tests #1

0.0.2 (2021-06-30)

Initial release