Module: Etherlite::Api::Address

Included in:
Etherlite::Account::Base, Etherlite::Address, Node, Contract::Base
Defined in:
lib/etherlite/api/address.rb

Instance Method Summary collapse

Instance Method Details

#addressObject



4
5
6
# File 'lib/etherlite/api/address.rb', line 4

def address
  '0x' + normalized_address
end

#get_balance(block: :latest) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/etherlite/api/address.rb', line 8

def get_balance(block: :latest)
  Etherlite::Utils.hex_to_uint(
    connection.ipc_call(
      :eth_getBalance,
      json_encoded_address,
      Etherlite::Utils.encode_block_param(block)
    )
  )
end