0.2.1 • Published 4 years ago
near-ledger-js v0.2.1
near-ledger-js
A JavaScript library for communication with Ledger Hardware Wallet.
Example usage
import { createClient, getSupportedTransport } from "near-ledger-js";
const transport = await getSupportedTransport();
transport.setScrambleKey("NEAR");
transport.on('disconnect', () => {...});In an onClick handler:
const client = await createClient(transport);
// If no error thrown, ledger is available. NOTE: U2F transport will still get here even if device is not present To see debug logging for getSupportedTransport(), import setDebugLogging() and call setDebugLogging(true) before using the package.
How to run demo project
yarnto install dependenciesyarn startto start local server with Parcel- Open https://localhost:1234 in your browser
- Open browser console
- Try examples shown on the page
License
This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE and LICENSE-APACHE for details.