1.0.4 • Published 3 years ago

@gorlitzer/wei-converter v1.0.4

Weekly downloads
8
License
ISC
Repository
github
Last release
3 years ago

ITALIANO 🇮🇹

Semplice implementazione funzioni { fromWei, toWei } conversione da/a wei e multipli.

Dipendenze:

* 'bn.js' => creare e gestire type BigNumber
* 'number-to-bn' => convertire int e hex int to BN

Utilizzo:

const ethConverter = require('eth-converter')

let curr = ethConverter.toWei('10', 'ether')
let curr = ethConverter.fromWei('10000', 'ether')

converts to one of the following:

'noether': '0', 
'wei': '1', 
'kwei': '1000', 
'Kwei': '1000',
'babbage': '1000', 
'femtoether': '1000', 
'mwei': '1000000',
'Mwei': '1000000',
'lovelace': '1000000', 
'picoether': '1000000', 
'gwei': '1000000000', 
'Gwei': '1000000000', 
'shannon': '1000000000', 
'nanoether': '1000000000', 
'nano': '1000000000', 
'szabo': '1000000000000', 
'microether': '1000000000000', 
'micro': '1000000000000', 
'finney': '1000000000000000', 
'milliether': '1000000000000000', 
'milli': '1000000000000000', 
'ether': '1000000000000000000',
'kether': '1000000000000000000000',
'grand': '1000000000000000000000', 
'mether': '1000000000000000000000000',
'gether': '1000000000000000000000000000', 
'tether': '1000000000000000000000000000000' 

ENGLISH 🏴󠁧󠁢󠁥󠁮󠁧󠁿

Simple and lightweight implementation of { fromWei, toWei } functions, conversion from/to wei and multiples.

Node dependencies:

* 'bn.js' => creare e gestire type BigNumber
* 'number-to-bn' => convertire int e hex int to BN

How to:

const ethConverter = require('eth-converter')

let curr = ethConverter.toWei('10', 'ether')
let curr = ethConverter.fromWei('10000', 'ether')

converts to one of the following:

'noether': '0', 
'wei': '1', 
'kwei': '1000', 
'Kwei': '1000',
'babbage': '1000', 
'femtoether': '1000', 
'mwei': '1000000',
'Mwei': '1000000',
'lovelace': '1000000', 
'picoether': '1000000', 
'gwei': '1000000000', 
'Gwei': '1000000000', 
'shannon': '1000000000', 
'nanoether': '1000000000', 
'nano': '1000000000', 
'szabo': '1000000000000', 
'microether': '1000000000000', 
'micro': '1000000000000', 
'finney': '1000000000000000', 
'milliether': '1000000000000000', 
'milli': '1000000000000000', 
'ether': '1000000000000000000',
'kether': '1000000000000000000000',
'grand': '1000000000000000000000', 
'mether': '1000000000000000000000000',
'gether': '1000000000000000000000000000', 
'tether': '1000000000000000000000000000000' 
1.0.4

3 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago