andreskull / rFTX

R API for FTX
Other
5 stars 12 forks source link

Return time in POSIXct for all functions #4

Closed PaulineNimo closed 2 years ago

andreskull commented 2 years ago
  1. Check that every function with start time and end time will be start_time and end_time optional (start_time=NA, end_time=NA).
  2. Add tz="GMT" parameter for all functions that return time and pass tz parameter to as.POSIXct function.
  3. In case the resulting tibble is empty you cannot mutate the time. This will throw nasty error. Mutate only if there is something.
andreskull commented 2 years ago

Try to encapsulate duplicate code in the functions to separate helper functions to make changes better managable.

andreskull commented 2 years ago
  1. Check that every function with start time and end time will be start_time and end_time optional (start_time=NA, end_time=NA).

This should solve the issue: https://github.com/andreskull/rFTX/issues/5

andreskull commented 2 years ago
  1. Check that every function with start time and end time will be start_time and end_time optional (start_time=NA, end_time=NA).

This should solve the issue: #5

Actually, it does not solve the issue with this function. I made the change locally and the result is the following:

> ftx_my_spot_borrow_history(key, secret, start_time = now() - days(200), end_time = now()) 
2021-11-02 21:03:37 ERROR::Not logged in
Error in x[[1]] : subscript out of bounds
In addition: Warning message:
In sprintf("Not logged in", query = "1618596217.50369,1635879817.5057") :

 Error in x[[1]] : subscript out of bounds 

Needs more investigations.

andreskull commented 2 years ago
  1. start_time and end_time should be converted using as.integer() function instead of as.numeric(). This avoids the floating numbers in the query as seen here https://github.com/andreskull/rFTX/pull/4#issuecomment-958096297