https://github.com/minterteam/minterjs-util
A collection of utility functions for Minter
https://github.com/minterteam/minterjs-util
blockchain cryptocurrency minter utils
Last synced: 7 months ago
JSON representation
A collection of utility functions for Minter
- Host: GitHub
- URL: https://github.com/minterteam/minterjs-util
- Owner: MinterTeam
- License: mit
- Created: 2018-07-13T14:09:38.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-05T11:10:26.000Z (about 3 years ago)
- Last Synced: 2025-10-30T12:33:28.325Z (8 months ago)
- Topics: blockchain, cryptocurrency, minter, utils
- Language: JavaScript
- Homepage: https://minter.network
- Size: 1.35 MB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# minterjs-util
[](https://www.npmjs.org/package/minterjs-util)
[](https://github.com/MinterTeam/minterjs-util/actions/workflows/test-with-coverage.yml)
[](https://coveralls.io/github/MinterTeam/minterjs-util?branch=master)
[](https://github.com/MinterTeam/minterjs-util/blob/master/LICENSE)
A collection of utility functions for Minter
Please note that this package is under active development and is subject to change.
It is complemented by the following packages:
- [minter-js-sdk](https://github.com/MinterTeam/minter-js-sdk) complete JS solution to work with Minter
- [minterjs-wallet](https://github.com/MinterTeam/minterjs-wallet) take care of BIP39 mnemonic phrase, private key and address
## Install
`npm install minterjs-util`
or from browser
```html
const pips = minterUtil.convertFromPip(1);
const fee = (new minterUtil.FeePrice({/* ... */})).getFeeValue('0x01');
```
### FeePrice.getFeeValue()
Params:
- txType: number or string, tx type
- options: object
- options.payload: string or Buffer, tx payload
- options.payloadLength: number, length of payload
- options.coinSymbol: string, coin symbol if tx is coin creation (can be replaced with `coinSymbolLength`)
- options.coinSymbolLength: number, coin symbol length if tx is coin creation (can be replaced with `coinSymbol`)
- options.multisendCount: number, count of recipients if tx is multisend
Full example: [github.com/MinterTeam/minterjs-util/blob/master/test/fee.test.js](https://github.com/MinterTeam/minterjs-util/blob/master/test/fee.test.js)
```
import { FeePrice, TX_TYPE } from 'minterjs-util';
const getFeeValue = (new FeePrice({/* ... */})).getFeeValue;
getFeeValue(TX_TYPE.SEND);
// 0.01
getFeeValue(TX_TYPE.SEND, {payload: 'asé'});
// 0.018
getFeeValue(TX_TYPE.CREATE_COIN, {coinSymbol: 'ABCDEFG'});
// 10000
getFeeValue(TX_TYPE.CREATE_COIN, {coinSymbolLength: 6});
// 100000
getFeeValue(TX_TYPE.MULTISEND, {deltaItemCount: 5});
// 0.035
```
## License
MIT License