# nanocurrency

> A toolkit for the Nano cryptocurrency, allowing you to derive keys, generate seeds, hashes, signatures, proofs of work and blocks.

Latest version **2.5.0** (published 2020-06-30) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install nanocurrency
pnpm add nanocurrency
yarn add nanocurrency
bun add nanocurrency
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.5.0 |
| Published | 2020-06-30 |
| First published | 2018-02-13 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 221 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 147 |
| Author | Marvin ROGER |
| Maintainers | marvinroger |
| Keywords | crypto, currency, nano, pow, raiblocks |

## Links

- npm: https://www.npmjs.com/package/nanocurrency
- Repository: https://github.com/marvinroger/nanocurrency-js
- Homepage: https://github.com/marvinroger/nanocurrency-js/tree/master/packages/nanocurrency
- Issues: https://github.com/marvinroger/nanocurrency-js/issues
- npm.io page: https://npm.io/package/nanocurrency

## Dependencies (2)

- [blakejs](https://npm.io/package/blakejs.md) ^1.1.0
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.0.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.5.0 (latest) — 2020-06-30
- 2.4.0 — 2020-03-02
- 2.3.0 — 2019-03-15
- 2.2.1 — 2019-03-15
- 2.2.0 — 2019-03-14
- 2.1.0 — 2019-03-14
- 2.0.4 — 2018-09-03
- 2.0.3 — 2018-07-27
- 2.0.2 — 2018-07-12
- 2.0.1 — 2018-07-12
- 2.0.0 — 2018-07-12
- 1.12.0 — 2018-05-12
- 1.11.2 — 2018-05-08
- 1.11.1 — 2018-05-07
- 1.11.0 — 2018-05-07
- … 20 more at https://npm.io/package/nanocurrency/versions

## README

# nanocurrency

[![npm version](https://img.shields.io/npm/v/nanocurrency.svg)](https://www.npmjs.com/package/nanocurrency)
[![Test](https://github.com/marvinroger/nanocurrency-js/workflows/Test/badge.svg)](https://github.com/marvinroger/nanocurrency-js/actions?query=branch%3Amaster+workflow%3ATest)

A [battle-tested](__tests__) toolkit for the Nano cryptocurrency.

If you are looking for legacy blocks, you will want the `^1.0.0` versions.

![Code showcase](https://raw.githubusercontent.com/marvinroger/nanocurrency-js/master/packages/nanocurrency/showcase.png)

The documentation is available locally in [`docs/`](docs/) or online at [https://marvinroger.github.io/nanocurrency-js/packages/nanocurrency/docs/](https://marvinroger.github.io/nanocurrency-js/packages/nanocurrency/docs/).

---

## Features

- Generate seeds
- Derive secret keys, public keys and addresses
- Hash blocks
- Sign and verify blocks
- Compute and test proofs of work
- Check the format of seeds, secret keys, public keys, addresses, amounts, etc.
- Convert Nano units
- **[CLI doing all of the above](https://www.npmjs.com/package/nanocurrency-cli)**

---

## Usage

To install the library:

```
npm install nanocurrency
# or yarn add nanocurrency
```

```js
import * as nanocurrency from 'nanocurrency'
```

---

## Performance

You might be wondering how fast is the work generation. There's a `pow-benchmark` example in the `examples/` directory.
On an Intel Core i7-8550U CPU, with 100 iterations, [the average computation time is 18.5s per work](https://gist.github.com/marvinroger/5181d213df1306fe2f7af0578d365aa3).

Considering you can pre-compute and cache the work prior to an actual transaction, this should be satisfying for a smooth user experience.

---

## Contribute

Contributions are very welcome. To develop, make use of the following commands (using [Yarn](https://yarnpkg.com)):

- `yarn build:dev`: build the C++ code to WebAssembly and bundle the files into the `dist/` directory, without optimization so that it is fast while developing. Note that you'll need to have Docker installed

- `yarn test`: test the code

- `yarn lint`: lint the code against [JavaScript Standard Style](https://standardjs.com)

- `yarn generate-docs`: generate the `docs/` website from the [JSDoc](http://usejsdoc.org) annotations

---

## Donations

If you like the project, feel free to donate some nano:

`xrb_3mrogerjhkdyj6mzf4e7aatf3xs3gp4stwc9yt9ymgasw7kr7g17t4jwwwy8`

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