blockchain.api.query: Query blockchain.info API

Description Usage Arguments Value References See Also Examples

View source: R/blockchain.R

Description

Query bitcoin related data from blockchain.info.

Usage

1
2
blockchain.api.query(..., method, antiddos = getOption("Rbitcoin.antiddos",
  TRUE), verbose = getOption("Rbitcoin.verbose", 0))

Arguments

method

character. For details see references, currently supported 'Single Address' and 'Single Transaction'. If method missing the function will try to guess it based on first param in ....

antiddos

logical default TRUE. Default 10s, read antiddos.

verbose

integer. Rbitcoin processing messages, print to console if verbose > 0, each subfunction reduce verbose by 1. If missing then getOption("Rbitcoin.verbose",0) is used.

...

params passed to blockchain.info API, specific for particular method, example 'bitcoin_address' or 'tx_index', for more see references or examples.

Value

result returned by fromJSON function applied on the blockchain result, most probably the list.

References

https://blockchain.info/api/blockchain_api

See Also

blockchain.api.process, antiddos

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# query bitcoin address information - 'Single Address' method
# Rbitcoin donation address final balance in BTC
blockchain.api.query('15Mb2QcgF3XDMeVn6M7oCG6CQLw4mkedDi',limit=0)[['final_balance']]/1e8
# Rbitcoin donation address full details
blockchain.api.query('15Mb2QcgF3XDMeVn6M7oCG6CQLw4mkedDi',verbose=1)
# some first wallet final balance in BTC
blockchain.api.query('1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa',limit=0)[['final_balance']]/1e8
# some first wallet details (limit to 3 txs, skip two txs)
x <- blockchain.api.query(method = 'Single Address',
     bitcoin_address = '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa', limit=3, offset=2)
str(x)
# query bitcoin transaction information - 'Single Transaction' method
# Some recent transaction of some first wallet
blockchain.api.query('e5c4de1c70cb6d60db53410e871e9cab6a0ba75404360bf4cda1b993e58d45f8')

## End(Not run)

jangorecki/Rbitcoin documentation built on May 18, 2019, 12:24 p.m.