DheerajAgarwal / rgdax

Wrapper for Coinbase pro (erstwhile GDAX) Cryptocurrency exchange
Other
33 stars 16 forks source link

public_candles() not passing start/end times #17

Closed dabezian closed 2 years ago

dabezian commented 3 years ago

The public_candles() function is not parsing additional query parameters correctly.

When trying to specify start, end, or granularity, it returns

Error in UseMethod("as.request") : no applicable method for 'as.request' applied to an object of class "character"

Looking at the code, it looks like the issue is in the internal function parse_response().

Comparing to public_orderbook() which is passing the level parameter as expected, you have

response <- parse_response(path = req.url, query = list(level = level))

as opposed to

response <- parse_response(path = req.url, query = c(start = start, end = end, granularity = granularity))

I suspect the issue is the function parse_response() is being passed a character vector due to the c() funtion rather than the list() function, which is causing the request to fail. However it also appears public_orderbook() is not parsing the levels parameter properly either, as it only returns one line from the orderbook regardless of the level requested.

DheerajAgarwal commented 3 years ago

This is a known issue including the one on public_orderbook. The package is undergoing some changes and I will take public functions next. Thanks for your patience.

wittec commented 2 years ago

If I locally load the RGDAX 1.0 functions "public_candles" and "parse_response", I get public candles just fine with RGDAX 1.1 installed. Is it as easy as swapping the 1.1 versions of these functions with the old 1.0 versions?

DheerajAgarwal commented 2 years ago

In theory yes. I have just put a fix together and is now pushed to dev branch. Test and let me know how it goes. I am closing this for now.