toBTC: Fast convert to/from BTC

Description Usage Arguments Value References See Also Examples

View source: R/blockchain.R

Description

Fast convert to/from BTC based on blockchain.info exchange rates API.

Usage

1
2
3
toBTC(value = 1, currency = "USD",
  antiddos = getOption("Rbitcoin.antiddos", TRUE),
  verbose = getOption("Rbitcoin.verbose", 0))

Arguments

value

numeric.

currency

character.

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.

Value

converted value.

References

https://blockchain.info/api/exchange_rates_api

See Also

fromBTC, blockchain.api.query, antiddos

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# 1000 USD (default) to BTC
toBTC(1000)
toBTC(1000, "GBP")
# 1 BTC to USD (default)
fromBTC(1)
fromBTC(1, "EUR")

## End(Not run)

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