danpaquin / coinbasepro-python

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

Implementation of nasks and nbids #332

Open kkuette opened 6 years ago

kkuette commented 6 years ago

With the order book we are able to pull only the last upper bid and lower ask, i was thinking about adding 2 functions

def get_nasks(self, n):
        return [self.get_asks(self._asks.peekitem(i)[0]) for i in range(n+1)]

And

def get_nbids(self, n):
        return [self.get_bids(self._bids.peekitem(-i)[0]) for i in range(1, n+1)]

With these functions we are able to pull as many ask and bid data we want, with ease.