danpaquin / coinbasepro-python

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

Use parameters in get_product_trades() #422

Open tbm opened 3 years ago

tbm commented 3 years ago

The parameters had no effect since they were never passed to self._send_paginated_message()

Fixes #414

tbm commented 3 years ago

This isn't quite complete since I don't know what to do about results, but at least parameters like after are working now.

spnichol commented 3 years ago

Are you sure these parameters aren't deprecated? I don't see them in the official documentation, and when I tried something like what you pushed here, I got

{'message': 'Invalid positive integer value for parameter - before'}

When parsing the output from the request... were you able to get actual data?

tbm commented 3 years ago

after works which is the only thing I tried.

tbm commented 3 years ago

It's definitely possible this needs to be rewritten completely.

ceritium commented 3 years ago

Hi, what do you think about this approach?

    def get_product_trades(self, product_id, **kwargs):
        return self._send_paginated_message('/products/{}/trades'
                                            .format(product_id), params=kwargs)

It is the same approach that other paginated endpoints on authenticated_client.py

https://github.com/danpaquin/coinbasepro-python/pull/427