# near-ledger-js

> Connect to NEAR Ledger app from browser

Latest version **0.2.1** (published 2022-03-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install near-ledger-js
pnpm add near-ledger-js
yarn add near-ledger-js
bun add near-ledger-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2022-03-07 |
| First published | 2019-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 21.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | maximushaximus, nearvlad |

## Links

- npm: https://www.npmjs.com/package/near-ledger-js
- npm.io page: https://npm.io/package/near-ledger-js

## Dependencies (5)

- [bs58](https://npm.io/package/bs58.md) ^4.0.1
- [platform](https://npm.io/package/platform.md) ^1.3.6
- [@ledgerhq/hw-transport-u2f](https://npm.io/package/@ledgerhq/hw-transport-u2f.md) ^5.36.0-deprecated
- [@ledgerhq/hw-transport-webhid](https://npm.io/package/@ledgerhq/hw-transport-webhid.md) ^5.51.1
- [@ledgerhq/hw-transport-webusb](https://npm.io/package/@ledgerhq/hw-transport-webusb.md) ^5.53.1

## Recent versions

- 0.2.1 (latest) — 2022-03-07
- 0.2.0 — 2021-06-19
- 0.1.2 — 2020-06-26
- 0.1.1 — 2020-05-19
- 0.1.0 — 2020-05-16
- 0.0.4 — 2019-10-09
- 0.0.3 — 2019-10-08
- 0.0.2 — 2019-09-27

## README

# near-ledger-js 

A JavaScript library for communication with [Ledger](https://www.ledger.com/) Hardware Wallet.

# Example usage
```javascript
  import { createClient, getSupportedTransport } from "near-ledger-js";
  
  const transport = await getSupportedTransport();
  transport.setScrambleKey("NEAR");
  
  transport.on('disconnect', () => {...});
```

In an onClick handler:
```javascript
  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
1. `yarn` to install dependencies
2. `yarn start` to start local server with Parcel
3. Open https://localhost:1234 in your browser
4. Open browser console
5. 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](LICENSE) and [LICENSE-APACHE](LICENSE-APACHE) for details.

---
_Source: https://npm.io/package/near-ledger-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
