class Ryp::EthereumAddress

Public Class Methods

data_map() click to toggle source

www.blockcypher.com/dev/ethereum/#address

# File lib/ryp/ethereum_address.rb, line 5
def self.data_map
  {
    address: 'address',
    total_received: 'total_received',
    total_sent: 'total_sent',
    balance: 'balance',
    unconfirmed_balance: 'unconfirmed_balance',
    transaction_count: 'n_tx',
    unconfirmed_transaction_count: 'unconfirmed_n_tx'
  }
end

Public Instance Methods

balance() click to toggle source
# File lib/ryp/ethereum_address.rb, line 30
def balance
  @balance.to_i / 1e18
end
hash() click to toggle source
# File lib/ryp/ethereum_address.rb, line 18
def hash
  "0x#{@hash}"
end
total_received() click to toggle source
# File lib/ryp/ethereum_address.rb, line 22
def total_received
  @total_received.to_i / 1e18
end
total_sent() click to toggle source
# File lib/ryp/ethereum_address.rb, line 26
def total_sent
  @total_sent.to_i / 1e18
end
unconfirmed_balance() click to toggle source
# File lib/ryp/ethereum_address.rb, line 34
def unconfirmed_balance
  @unconfirmed_balance.to_i / 1e18
end
url() click to toggle source
# File lib/ryp/ethereum_address.rb, line 38
def url
  "https://etherscan.io/address/0x#{address}"
end