hugues31 / coinnect

Coinnect is a Rust library aiming to provide a complete access to main crypto currencies exchanges via REST API.
MIT License
148 stars 43 forks source link

Poloniex returnChartData parse error #67

Closed schickst closed 6 years ago

schickst commented 6 years ago

Hello,

I was trying to call returnChartData of the Poloniex API. But guessing from the output of my code, there seems to be a parsing error.

Interactively in the browser it would be the following request, which executes fine: https://poloniex.com/public?command=returnChartData&currencyPair=BTC_STR&start=1527265203&end=1528993203&period=300

My Code: ``
let credentials = PoloniexCreds::new("test", "api_key", "api_secret");

let mut poloniex_api = PoloniexApi::new(credentials).unwrap();

let chartdata = poloniex_api.return_chart_data("BTC_STR", "1527265203", "1528993203", "300");

println!("{:?}", chartdata); ``

Output: Err(Error(BadParse, State { next_error: None, backtrace: None }))

hugues31 commented 6 years ago

Thanks for your report ! I'll take a look at it and come back quickly ;)

hugues31 commented 6 years ago

This should be fixed with #68 :) Update your Coinnect version to 0.5.11, you should be able to get your data in the "data" field of the map returned.

I'm waiting for the async/await to land in nightly for a complete rewrite of Coinnect (version 0.6). This crate deserves it.