Example #1
0
    def order_book(self, book=None, group=None):
        """Get a public Bitso order book with a 
        list of all open orders in the specified book
        

        Args:
          book (str, optional):
            Specifies which book to use. Default is btc_mxn
          group (bool, optional):
            Specifies if orders with the same price should
            be grouped. Default is True
            
        Returns:
          A bitso.OrderBook instance.
        
        """

        url = '%s/order_book' % self.base_url
        parameters = {}
        if book:
            if book == True:
                parameters['book'] = True
            else:
                parameters['book'] = False
        if group:
            parameters['group'] = group
        resp = self._request_url(url, 'GET', params=parameters)
        return OrderBook._NewFromJsonDict(resp)
Example #2
0
    def order_book(self, book, aggregate=True):
        """Get a public Bitso order book with a 
        list of all open orders in the specified book
        

        Args:
          book (str):
            Specifies which book to use. Default is btc_mxn
          aggregate (bool):
            Specifies if orders should be aggregated by price
            
        Returns:
          A bitso.OrderBook instance.
        
        """

        url = '%s/order_book/' % self.base_url
        parameters = {}
        parameters['book'] = book
        parameters['aggregate'] = aggregate
        resp = self._request_url(url, 'GET', params=parameters)
        return OrderBook._NewFromJsonDict(resp['payload'])
Example #3
0
    def order_book(self, book, aggregate=True):
        """Get a public Bitso order book with a 
        list of all open orders in the specified book
        

        Args:
          book (str):
            Specifies which book to use. Default is btc_mxn
          aggregate (bool):
            Specifies if orders should be aggregated by price
            
        Returns:
          A bitso.OrderBook instance.
        
        """

        url = '%s/order_book/' % self.base_url
        parameters = {}
        parameters['book'] = book
        parameters['aggregate'] = aggregate
        resp = self._request_url(url, 'GET', params=parameters)
        return OrderBook._NewFromJsonDict(resp['payload'])