Method: Web3::Eth::EthModule#getBalance

Defined in:
lib/web3ethereum/eth_module.rb

#getBalance(address, block = 'latest', convert_to_eth = true) ⇒ Object



14
15
16
17
# File 'lib/web3ethereum/eth_module.rb', line 14

def getBalance address, block = 'latest', convert_to_eth = true
  wei = @web3_rpc.request("#{PREFIX}#{__method__}", [address, block]).to_i 16
  convert_to_eth ? wei_to_ether(wei) : wei
end