mobnetic / BitcoinChecker

DataModule for Bitcoin Checker android app
342 stars 212 forks source link

Huobi "parsing error" #680

Open philippe-git opened 6 years ago

philippe-git commented 6 years ago

Hi! Thanks for all the great work that's been put into this app, it's one of the most useful ones for me on a daily basis 👍

I've noticed that Huobi markets weren't fetched anymore: all pairs fail with "Error: Parsing error". This has been happening for a few weeks at least now, and I'm running 1.15.1.

Hopefully there were only minor changes to how data is formatted in Huobi's API and this is a quick fix!

philippe-git commented 6 years ago

edit: dismiss this message, see comment below

Looking at the current parsing code: https://github.com/mobnetic/BitcoinChecker/blob/ffc4ca35aeafa5a4045101e62754cc404c70626e/dataModule/src/main/java/com/mobnetic/coinguardian/model/market/Huobi.java#L31-L39

And what Huobi's API sends back:

image

It looks like it's not sending back the last field anymore.

A one-liner should fix this: we could estimate the last value out of the bids/asks (e.g. averaging both). I can submit a PR, but it's only one line so I'd prefer someone with more context in the project to do so :)

fdmsaraiva commented 6 years ago

@pioul do it! (please)

philippe-git commented 6 years ago

Actually, dismiss my previous message. We're not looking up last, we're looking up close which is still sent back by the API.

I'm not sure why this is failing, and I unfortunately don't have any Android/Java development environment to help debug this.