class Ryp::BitcoinAddress

Public Class Methods

data_map() click to toggle source

www.blockcypher.com/dev/bitcoin/#address-balance-endpoint

# File lib/ryp/bitcoin_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/bitcoin_address.rb, line 26
def balance
  @balance.to_i / 1e8
end
total_received() click to toggle source
# File lib/ryp/bitcoin_address.rb, line 18
def total_received
  @total_received.to_i / 1e8
end
total_sent() click to toggle source
# File lib/ryp/bitcoin_address.rb, line 22
def total_sent
  @total_sent.to_i / 1e8
end
unconfirmed_balance() click to toggle source
# File lib/ryp/bitcoin_address.rb, line 30
def unconfirmed_balance
  @unconfirmed_balance.to_i / 1e8
end
url() click to toggle source
# File lib/ryp/bitcoin_address.rb, line 34
def url
  "https://blockchain.info/address/#{address}"
end