Module: EtherUnits

Included in:
Integer
Defined in:
lib/units-money.rb

Instance Method Summary collapse

Instance Method Details

#etherObject Also known as: eth



90
# File 'lib/units-money.rb', line 90

def ether()      self * e18; end

#gweiObject Also known as: shannon



87
# File 'lib/units-money.rb', line 87

def gwei()       self * e9; end

#kweiObject Also known as: babbage



85
# File 'lib/units-money.rb', line 85

def kwei()       self * e3; end

#microetherObject Also known as: szabo, microeth, micro



88
# File 'lib/units-money.rb', line 88

def microether() self * e12; end

#millietherObject Also known as: finney, millieth, milli



89
# File 'lib/units-money.rb', line 89

def milliether() self * e15; end

#mweiObject Also known as: lovelace



86
# File 'lib/units-money.rb', line 86

def mwei()       self * e6; end

#weiObject

Ethereum money units

wei                     1 wei | 1
kwei (babbage)        1e3 wei | 1_000
mwei (lovelace)       1e6 wei | 1_000_000
gwei (shannon)        1e9 wei | 1_000_000_000
microether (szabo)   1e12 wei | 1_000_000_000_000
milliether (finney)  1e15 wei | 1_000_000_000_000_000
ether                1e18 wei | 1_000_000_000_000_000_000

Names in Honor:
 wei            => Wei Dai
 lovelace       => Ada Lovelace (1815-1852)
 babbage	       => Charles Babbage (1791-1871)
 shannon	       => Claude Shannon (1916-2001)
 szabo          => Nick Szabo
 finney         => Hal Finney (1956-2014)


84
# File 'lib/units-money.rb', line 84

def wei()        self; end