0.12.4 • Published 5 years ago
noahjs-util v0.12.4
noahjs-util
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 complete JS solution to work with Noah
- noah-js-org communicate with noah.org user database
- noahjs-wallet to create wallet
- noahjs-tx to create, manipulate and sign Noah transactions.
Install
npm install noahjs-util
or from browser
<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