0.25.1 • Published 2 years ago

minterjs-util v0.25.1

Weekly downloads
304
License
MIT
Repository
github
Last release
2 years ago

minterjs-util

NPM Package Build Status Coverage Status License: MIT

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:

Install

npm install minterjs-util

or from browser

<script src="https://unpkg.com/minterjs-util"></script>
<script>
const pips = minterUtil.convertFromPip(1);
const fee = (new minterUtil.FeePrice({/* ... */})).getFeeValue('0x01');
</script>

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

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

0.25.1

2 years ago

0.25.0

2 years ago

0.24.2

3 years ago

0.24.1

3 years ago

0.24.0

3 years ago

0.23.0-alpha.6

3 years ago

0.23.0-alpha.4

3 years ago

0.23.0-alpha.5

3 years ago

0.23.0-alpha.2

3 years ago

0.23.0-alpha.3

3 years ago

0.23.0

3 years ago

0.23.0-alpha.0

3 years ago

0.23.0-alpha.1

3 years ago

0.22.0

4 years ago

0.22.0-alpha.1

4 years ago

0.22.0-alpha.2

4 years ago

0.21.0

4 years ago

0.21.0-aplha.13

4 years ago

0.21.0-aplha.12

4 years ago

0.21.0-aplha.11

4 years ago

0.21.0-aplha.10

4 years ago

0.21.0-aplha.9

4 years ago

0.21.0-aplha.8

4 years ago

0.21.0-aplha.7

4 years ago

0.21.0-aplha.6

4 years ago

0.21.0-aplha.5

4 years ago

0.21.0-aplha.4

4 years ago

0.21.0-aplha.3

4 years ago

0.21.0-aplha.2

4 years ago

0.20.0

4 years ago

0.19.0

4 years ago

0.19.2-aplha.1

5 years ago

0.19.2-aplha.0

5 years ago

0.18.2

5 years ago

0.18.1

5 years ago

0.18.0

5 years ago

0.18.0-alpha.6

5 years ago

0.18.0-alpha.4

5 years ago

0.18.0-alpha.5

5 years ago

0.18.0-alpha.3

5 years ago

0.18.0-alpha.2

5 years ago

0.18.0-alpha.1

5 years ago

0.17.0

5 years ago

0.16.2

5 years ago

0.16.0

5 years ago

0.16.1

5 years ago

0.15.2

5 years ago

0.15.1

5 years ago

0.15.0

5 years ago

0.14.1

6 years ago

0.14.0

6 years ago

0.13.1

6 years ago

0.13.0

6 years ago

0.12.0

6 years ago

0.11.0

6 years ago

0.10.1

6 years ago

0.10.0

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.3

6 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.0

6 years ago

0.4.0

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago