near-ledger-js
v0.2.1
Published
Connect to NEAR Ledger app from browser
Downloads
810
Readme
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
yarn
to install dependenciesyarn start
to 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.