Module: BlockExplorer::BlockChain
- Included in:
- BlockExplorer
- Defined in:
- lib/block_explorer/block_chain.rb
Constant Summary collapse
- MyTransactions =
"#{BlockExplorer::Domain}/q/mytransactions"
- RawTx =
"#{BlockExplorer::Domain}/rawtx"
- GetReceivedByAddress =
"#{BlockExplorer::Domain}/q/getreceivedbyaddress"
Instance Method Summary collapse
Instance Method Details
#getreceivedbyaddress(address, minconf = 0) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/block_explorer/block_chain.rb', line 15 def getreceivedbyaddress(address, minconf = 0) if minconf > 0 url = "#{GetReceivedByAddress}/#{address}/#{minconf}" else url = "#{GetReceivedByAddress}/#{address}" end BigDecimal(open(url).read) end |
#mytransactions(addresses) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/block_explorer/block_chain.rb', line 7 def mytransactions(addresses) if addresses.is_a?(String) addresses = [addresses] end get_json "#{MyTransactions}/#{addresses.join('.')}" end |