@onflow/ledger
TypeScript icon, indicating that this package has built-in type declarations

0.15.0 • Public • Published

@onflow/ledger

License npm version

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

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

Notes

Use yarn install to avoid issues.

Minimal example

This is very simple. First you need to use one of the transport classes provided by Ledger.

import TransportWebUSB from "@ledgerhq/hw-transport-webusb";
import FlowApp from "@onflow/ledger";

transport = await TransportWebUSB.create();
const app = new FlowApp(transport);

The FlowApp object will provide:

const response = await app.getVersion();

if (response.returnCode !== FlowApp.ERROR_CODE.NoError) {
      console.log(`Error [${response.returnCode}] ${response.errorMessage}`);
} else {
    console.log(response);
}

Acknowledgements

Developed by Zondax GmbH and Vacuumlabs.

/@onflow/ledger/

    Package Sidebar

    Install

    npm i @onflow/ledger

    Homepage

    onflow.org

    Weekly Downloads

    144

    Version

    0.15.0

    License

    Apache-2.0

    Unpacked Size

    242 kB

    Total Files

    20

    Last publish

    Collaborators

    • han210
    • dapperj
    • dapper_labs
    • jeffreydoyle
    • harry.eth
    • turbolent_flow
    • chasefleming
    • gregsantos
    • gregorggg
    • jribbink
    • bthaile
    • nialexsan
    • sisyphussmiling
    • flowtom