Retrieves the current TRX price and market data against other currencies
get_current_trx_price( vs_currencies = "usd", include_market_cap = FALSE, include_24h_vol = FALSE, include_24h_change = FALSE, max_attempts = 3L )
vs_currencies | (character): a vector with
names of the base currencies to benchmark TRX against, e.g.
|
---|---|
include_market_cap | (boolean, defaults to |
include_24h_vol | (boolean, defaults to |
include_24h_change | (boolean, defaults to |
max_attempts | (integer, positive): specifies the
maximum number of additional attempts to call a URL if the
first attempt fails (i.e. its call status is different from
|
A tibble with as many rows as the length of vs_currencies
and at
at least 3 columns: trx_price
(double), vs_currency
(character),
and last_updated_at
(POSIXct, UTC timezone). If the boolean arguments
of this function are all TRUE
, then the resultant tibble will
include additional three columns: market_cap
(double),
vol_24h
(double) and price_percent_change_24h
(double).
This function is based on the public CoinGecko API, which has a limit of 100 calls per minute. Please keep this limit in mind when developing your code.
#> # A tibble: 2 x 3 #> trx_price vs_currency last_updated_at #> <dbl> <chr> <dttm> #> 1 0.0603 usd 2021-07-12 22:03:53 #> 2 0.0509 eur 2021-07-12 22:03:53