coinbasepro-python icon indicating copy to clipboard operation
coinbasepro-python copied to clipboard

Use parameters in get_product_trades()

Open tbm opened this issue 4 years ago • 5 comments

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

Fixes #414

tbm avatar Feb 03 '21 12:02 tbm

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

tbm avatar Feb 03 '21 12:02 tbm

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?

spnichol avatar Feb 04 '21 15:02 spnichol

after works which is the only thing I tried.

tbm avatar Feb 05 '21 03:02 tbm

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

tbm avatar Feb 05 '21 03:02 tbm

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

ceritium avatar Mar 18 '21 21:03 ceritium