Module: BlockExplorer::BlockChain

Included in:
BlockExplorer
Defined in:
lib/block_explorer/block_chain.rb

Instance Method Summary collapse

Instance Method Details

#getreceivedbyaddress(address, minconf = 0) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/block_explorer/block_chain.rb', line 12

def getreceivedbyaddress(address, minconf = 0)
  if minconf > 0 
    url = "#{getreceivedbyaddress_url}/#{address}/#{minconf}"
  else
    url = "#{getreceivedbyaddress_url}/#{address}"
  end
  
  BigDecimal(open(url).read)
end

#mytransactions(addresses) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/block_explorer/block_chain.rb', line 4

def mytransactions(addresses)
  if addresses.is_a?(String)
    addresses = [addresses]
  end
  
  get_json "#{mytransactions_url}/#{addresses.join('.')}"
end