listCurrencyRates: List Betfair's currency conversion rates.

View source: R/listCurrencyRates.R

listCurrencyRatesR Documentation

List Betfair's currency conversion rates.

Description

listCurrencyRates allows you to see Betfair's current currency conversion rates.

Usage

listCurrencyRates(fromCurrency = "GBP", suppress = FALSE, sslVerify = TRUE)

Arguments

fromCurrency

String. Currently GBP is the only currency that is supported. Setting this parameter to any other value will cause an error.

suppress

Boolean. By default, this parameter is set to FALSE, meaning that a warning is posted when the listCurrencyRates call throws an error. Changing this parameter to TRUE will suppress this warning.

sslVerify

Boolean. This argument defaults to TRUE and is optional. In some cases, where users have a self signed SSL Certificate, for example they may be behind a proxy server, Betfair will fail login with "SSL certificate problem: self signed certificate in certificate chain". If this error occurs you may set sslVerify to FALSE. This does open a small security risk of a man-in-the-middle intercepting your login credentials.

Value

Response from Betfair is stored in a list of currency rate pairs, which is then parsed from JSON as a data frame with 2 columns.

Note on ratesOps variable

The ratesOps variable is used to firstly build an R data frame containing all the data to be passed to Betfair, in order for the function to execute successfully. The data frame is then converted to JSON and included in the HTTP POST request. If the listCurrencyRates call throws an error, a data frame containing error information is returned.

See Also

https://docs.developer.betfair.com/display/1smk3cen4v3lu3yomq5qye0ni/listCurrencyRates for general information on calling listCurrencyRates via the Betfair API.

loginBF, which must be executed first, as this function requires a valid session token

Examples

## Not run: 
listCurrencyRates() # returns Betfair's current exchange rates.


## End(Not run)


phillc73/abettor documentation built on June 10, 2022, 4:43 p.m.