# noahjs-util

> Utils for Noah

Latest version **0.12.4** (published 2019-10-03) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install noahjs-util
pnpm add noahjs-util
yarn add noahjs-util
bun add noahjs-util
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.12.4 |
| Published | 2019-10-03 |
| First published | 2019-08-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 9 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | noah-blockchain |
| Maintainers | gbmikaelian, pillardev |
| Keywords | noah, blockchain |

## Links

- npm: https://www.npmjs.com/package/noahjs-util
- Repository: https://github.com/noah-blockchain/noahjs-util
- Homepage: https://github.com/noah-blockchain/noahjs-util#readme
- Issues: https://github.com/noah-blockchain/noahjs-util/issues
- npm.io page: https://npm.io/package/noahjs-util

## Dependencies (9)

- [bn.js](https://npm.io/package/bn.js.md) ^4.11.8
- [big.js](https://npm.io/package/big.js.md) ^5.2.2
- [elliptic](https://npm.io/package/elliptic.md) latest
- [noahjs-tx](https://npm.io/package/noahjs-tx.md) ^6.1.1
- [secp256k1](https://npm.io/package/secp256k1.md) ^3.7.1
- [buffer-es6](https://npm.io/package/buffer-es6.md) github:shrpne/buffer-es6#fix-internal-is-buffer
- [ethjs-util](https://npm.io/package/ethjs-util.md) ^0.1.6
- [safe-buffer](https://npm.io/package/safe-buffer.md) ^5.2.0
- [ethereumjs-util](https://npm.io/package/ethereumjs-util.md) ^6.1.0

## Recent versions

- 0.12.4 (latest) — 2019-10-03
- 0.12.3 — 2019-09-02
- 0.12.1 — 2019-09-02
- 0.12.0 — 2019-08-31

## README

# noahjs-util

[![NPM Package](https://img.shields.io/npm/v/noahjs-util.svg?style=flat-square)](https://www.npmjs.org/package/noahjs-util)
[![Build Status](https://travis-ci.org/noah-blockchain/noahjs-util.svg?branch=master)](https://travis-ci.org/noah-blockchain/noahjs-util)
[![Coverage Status](https://coveralls.io/repos/github/noah-blockchain/noahjs-util/badge.svg?branch=master)](https://coveralls.io/github/noah-blockchain/noahjs-util?branch=master)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/noah-blockchain/noahjs-util/blob/master/LICENSE)

A collection of utility functions for Noah

Please note that this package is under active development and is subject to change.

It is complemented by the following packages:
- [noah-js-sdk](https://github.com/noah-blockchain/noah-js-sdk) complete JS solution to work with Noah
- [noah-js-org](https://github.com/noah-blockchain/noah-js-org) communicate with noah.org user database
- [noahjs-wallet](https://github.com/noah-blockchain/noahjs-wallet) to create wallet
- [noahjs-tx](https://github.com/noah-blockchain/noahjs-tx) to create, manipulate and sign Noah transactions.

## Install

`npm install noahjs-util`

or from browser

```html
<script src="https://unpkg.com/noahjs-util"></script>
<script>
const pips = noahUtil.convertFromPip(1);
const fee = noahUtil.getFeeValue('0x01');
</script>
```

### getFeeValue()
Params:
- txType: number or string, tx type
- options: object
- options.payload: string or Buffer, tx payload
- options.coinSymbol: string, coin symbol if tx is coin creation
- options.multisendCount: number, count of recipients if tx is multisend
```
import { getFeeValue } from 'noahjs-util';
import {TX_TYPE_SEND, TX_TYPE_CREATE_COIN, TX_TYPE_MULTISEND} from 'noahjs-tx';

getFeeValue(1); 
// 0.01

getFeeValue(TX_TYPE_SEND);
// 0.01

getFeeValue(TX_TYPE_SEND, {payload: 'asé'});
// 0.018

getFeeValue(TX_TYPE_CREATE_COIN, {coinSymbol: 'ABCDEFG'});
// 100

getFeeValue(TX_TYPE_MULTISEND, {multisendCount: 5});
// 0.035
```

## License

MIT License

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