dominiktraxl / pykrakenapi

A python implementation of the Kraken API.
GNU Lesser General Public License v3.0
225 stars 53 forks source link

Add earn endpoints #84

Closed PastorJordi closed 8 months ago

PastorJordi commented 8 months ago

Hi there! Congrats for this library. Because the latest new is that this is not maintained I am dropping a PR which

  1. Removes methods to interact with /Staking endpoints which are no longer available since 1st or March, 2024. Namely:
  1. Implements methods to interact with earn endpoints:

Hence resolves #83

  1. Other minor changes:
    • Avoids pandas' FutureWarning when setting index.freq in get_ohlc_data()
    • If there are no orders retrieved by get_open_orders(), even though it still has the behavior .empty == True , now the returned pd.DataFrame has the expected columns defined. IMO, this helps reducing boilerplate if not df.empty: statements in the applications built upon this library

Even though I am bad at styling without linters, I've tried to stick to the original code-style. Feel free to raise comments, cherry-pick or whatever you feel

dominiktraxl commented 8 months ago

Thank you for the PR.

I'm gonna trust you on this one and let the crowd judge. I don't even have an account with Kraken anymore and therefore can't test it.

PastorJordi commented 8 months ago

I did some minimal testing on my end. That's how I discovered the easter egg of hide_zero_allocations param in Earn/Allocations expecting a string literal "true" or "false". In any case, all pykrakenapi users should test these new methods before putting them into production.