0.25.1 • Published 1 year ago

minterjs-util v0.25.1

Weekly downloads
304
License
MIT
Repository
github
Last release
1 year 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

1 year ago

0.25.0

1 year ago

0.24.2

1 year ago

0.24.1

2 years ago

0.24.0

2 years ago

0.23.0-alpha.6

2 years ago

0.23.0-alpha.4

2 years ago

0.23.0-alpha.5

2 years ago

0.23.0-alpha.2

2 years ago

0.23.0-alpha.3

2 years ago

0.23.0

2 years ago

0.23.0-alpha.0

2 years ago

0.23.0-alpha.1

2 years ago

0.22.0

2 years ago

0.22.0-alpha.1

3 years ago

0.22.0-alpha.2

3 years ago

0.21.0

3 years ago

0.21.0-aplha.13

3 years ago

0.21.0-aplha.12

3 years ago

0.21.0-aplha.11

3 years ago

0.21.0-aplha.10

3 years ago

0.21.0-aplha.9

3 years ago

0.21.0-aplha.8

3 years ago

0.21.0-aplha.7

3 years ago

0.21.0-aplha.6

3 years ago

0.21.0-aplha.5

3 years ago

0.21.0-aplha.4

3 years ago

0.21.0-aplha.3

3 years ago

0.21.0-aplha.2

3 years ago

0.20.0

3 years ago

0.19.0

3 years ago

0.19.2-aplha.1

3 years ago

0.19.2-aplha.0

3 years ago

0.18.2

4 years ago

0.18.1

4 years ago

0.18.0

4 years ago

0.18.0-alpha.6

4 years ago

0.18.0-alpha.4

4 years ago

0.18.0-alpha.5

4 years ago

0.18.0-alpha.3

4 years ago

0.18.0-alpha.2

4 years ago

0.18.0-alpha.1

4 years ago

0.17.0

4 years ago

0.16.2

4 years ago

0.16.0

4 years ago

0.16.1

4 years ago

0.15.2

4 years ago

0.15.1

4 years ago

0.15.0

4 years ago

0.14.1

4 years ago

0.14.0

4 years ago

0.13.1

5 years ago

0.13.0

5 years ago

0.12.0

5 years ago

0.11.0

5 years ago

0.10.1

5 years ago

0.10.0

5 years ago

0.9.1

5 years ago

0.9.0

5 years ago

0.8.1

5 years ago

0.8.0

5 years ago

0.7.3

5 years ago

0.7.2

5 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago