tarkah / tickrs

Realtime ticker data in your terminal 📈
MIT License
1.17k stars 58 forks source link

Crash on Crypto #34

Closed Kaffiend closed 3 years ago

Kaffiend commented 3 years ago

Crashes on unwrap of None value when looking at options of Crypto assets.

tarkah commented 3 years ago

Can you give me the full panic? What "symbol" do you enter to get it to crash? I don't support crypto but the program shouldn't panic, it should just show a blank screen for unknown symbols

Kaffiend commented 3 years ago

F2982F6D-6675-42D2-93F3-569F6275E986

PS C:\Users\ianm> tickrs

Backtrace omitted. Run with RUST_BACKTRACE=1 to display it.
Run with RUST_BACKTRACE=full to include source snippets.

The application panicked (crashed).
  called `Option::unwrap()` on a `None` value
in C:\Users\ianm\.cargo\registry\src\github.com-1ecc6299db9ec823\tickrs-0.7.1\src\widget\options.rs, line 87
thread: main
tarkah commented 3 years ago

wow... TIL you can get to crypto via that Yahoo Finance API and it basically works :P Knowing this, I can make sure crypto is fully supported properly and that the market hours are being accounted for accurately for it on the 1D view. I'll probably just disable the options pane since that won't be applicable for crypto. Thanks for the bug report!

Kaffiend commented 3 years ago

Options would be applicable, but not via Yahoo API, something like tradingview that combines stock and multiple crypto exchanges would have both combined and keep the same API

Another option would be RobinHood's API as they do both, I think tradingview requires some brokerage account etc.

Edit: Link

tarkah commented 3 years ago

Got it. Honestly the options pane isn't even that useful since the options data from Yahoo finance is pretty delayed.

Unfortunately I don't know of any other api that I can get free intraday & historical charting data, and realtime options data. On top of that crypto options data. I don't plan on supporting any premium api with this program that'd require the user to plug in an API key. I want it to just work out of the box for anyone.

I'll go ahead and disable the options pane for any crypto instruments from the Yahoo finance api.

Kaffiend commented 3 years ago

reasonable action. I'm building mining tooling and monitoring because i'm tired of paid mining OS and extra fees. I found your project and took some inspiration from it for my daily/weekly/monthly profitability estimations. Most miners have an exchange API for crypto so it's something more feasible for my use case. Sidenote, if you use Brave Rewards or setup a BAT wallet, folks can send you a Tip, maybe accept donations via crypto with a public wallet too. BTC, ETH, XMR etc. I for one like to Tip folks who share good open source software and i find it useful.

tarkah commented 3 years ago

Interesting! Glad my project could serve for some inspiration.

I appreciate the recommendation for accepting donations. As this is just a hobby for me, I don't expect donations of any kind. If I were to gain a large user base and needed to dedicate more of my free time to the project, then I'd definitely consider it. Thank you!