Learn R Programming

Rbitcoin (version 0.9.2)

antiddos: Anti DDoS

Description

Wait if you should before next API call to market (or any other source system) to do not get banned.

Usage

antiddos(market, antispam_interval = 10, verbose = getOption("Rbitcoin.verbose", 0))

Arguments

market
character, a unique name of source system, could be any name c('kraken','bitstamp','blockchain','alt_bitstamp')
antispam_interval
numeric time in seconds between API calls on the particular source system, defeault 10s.
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, by default 0.

Value

numeric time of wait in seconds.

Side effect

Environment of name Rbitcoin.last_api_call in .GlobalEnv which holds the timestamps of last api call per market during the R session.

See Also

market.api.process, wallet_manager

Examples

Run this code
## Not run: 
# # run below code in a batch
# wait <- antiddos(market = 'kraken', antispam_interval = 5, verbose = 1)
# market.api.process('kraken',c('BTC','EUR'),'ticker')
# wait2 <- antiddos(market = 'kraken', antispam_interval = 5, verbose = 1)
# market.api.process('kraken',c('BTC','EUR'),'ticker')
# ## End(Not run)

Run the code above in your browser using DataLab