danpaquin / coinbasepro-python

The unofficial Python client for the Coinbase Pro API
MIT License
1.82k stars 732 forks source link

get_fills() is no longer working after switch to cbpro #320

Closed Kieranator closed 6 years ago

Kieranator commented 6 years ago

the generator returned by get_fills doesn't iterate correctly. using

fills_gen = auth_client.get_fills()

all_fills = list(fills_gen)
for fill in all_fills: 
    print(fill)

prints out a single item in the list thats just a string that says "message"

from what I can see, all other functions related to auth_client are working correctly, such as balances.

Kieranator commented 6 years ago

Seems to be related to this:

https://docs.pro.coinbase.com/#introduction

"8/23/18 - Query parameters on /fills will now be required. more info"

https://docs.pro.coinbase.com/#fills

"DEPRECATION NOTICE - Requests without either order_id or product_id will be rejected after 8/23/18."

Kieranator commented 6 years ago

So yeah this isn't really a bug, just a limitation imposed by coinbase. You can't query for fills without either an order_id or product_id. Explicitly specifying one fixes the issue: fills_gen = auth_client.get_fills(product_id= 'BTC-USD')

danpaquin commented 6 years ago

Good catch. I added a note in the comments, but was unsure to raise any exceptions. If a related issues comes up again, we may want to raise an error to enable a better developer experience.

Kieranator commented 6 years ago

I think raising some kind of error would be prudent because as it is the generator just mangles the error response from coinbase. It took some time for me to figure out what was going on.