huwwp / cryptop

command line crypto portfolio
MIT License
235 stars 41 forks source link

Oscars changes #46

Open oschub opened 7 years ago

oschub commented 7 years ago

I really like the idea and the look and feel of cryptop. Decided to add a few things that I like to have myself. Never really did anything serious with Python before so it was also nice learning opportunity.

Here's a list of things I added

talisein commented 7 years ago

With just 1 ETH in a wallet, the program ends 'Could not parse data' when hiting the f key (switch to per-eth). With an additional coin in the wallet it works ok. Same problem with just BTC in wallet and pushing f key to per-btc.

oschub commented 7 years ago

You're right. I didn't notice it before because I had multiple coins in my wallet. Turns out this is related to how the cryptocompare API works.

If you only have BTC in your wallet and try to view your portfolio in terms of BTC, then right now data is requested using https://min-api.cryptocompare.com/data/pricemultifull?fsyms=BTC&tsyms=BTC. If you go to that url you will see that it returns nonsense.

However, if you add another coin to your wallet, say ETH, then data is requested using https://min-api.cryptocompare.com/data/pricemultifull?fsyms=BTC,ETH&tsyms=BTC. If you visit this url you see it returns the correct data for both BTC and ETH.

I should write some logic to correct for this :)