def _api_query(self, protection=None, path_dict=None, options=None):
        """
        Queries Bittrex

        :param request_url: fully-formed URL to request
        :type options: dict
        :return: JSON response from Bittrex
        :rtype : dict
        """

        if not options:
            options = {}

        if self.api_version not in path_dict:
            raise Exception('method call not available under API version {}'.format(self.api_version))

        request_url = BASE_URL_V2_0 if self.api_version == API_V2_0 else BASE_URL_V1_1
        request_url = request_url.format(path=path_dict[self.api_version])

        nonce = str(int(time.time() * 1000))

        if protection != PROTECTION_PUB:
            request_url = "{0}apikey={1}&nonce={2}&".format(request_url, self.api_key, nonce)

        request_url += urlencode(options)

        try:
            if sys.version_info >= (3, 0) and protection != PROTECTION_PUB:

                apisign = hmac.new(bytearray(self.api_secret, 'ascii'),
                                   bytearray(request_url, 'ascii'),
                                   hashlib.sha512).hexdigest()

            else:

                apisign = hmac.new(self.api_secret.encode(),
                                   request_url.encode(),
                                   hashlib.sha512).hexdigest()

            self.wait()

            return self.dispatch(request_url, apisign)

        except Exception:
            return {
                'success': False,
                'message': 'NO_API_RESPONSE',
                'result': None
            }
def _api_query ( self , protection = None , path_dict = None , options = None ) : if not options : options = { } if self . api_version not in path_dict : raise Exception ( 'method call not available under API version {}' . format ( self . api_version ) ) request_url = BASE_URL_V2_0 if self . api_version == API_V2_0 else BASE_URL_V1_1 request_url = request_url . format ( path = path_dict [ self . api_version ] ) nonce = str ( int ( time . time ( ) * 1000 ) ) if protection != PROTECTION_PUB : request_url = "{0}apikey={1}&nonce={2}&" . format ( request_url , self . api_key , nonce ) request_url += urlencode ( options ) try : if sys . version_info >= ( 3 , 0 ) and protection != PROTECTION_PUB : apisign = hmac . new ( bytearray ( self . api_secret , 'ascii' ) , bytearray ( request_url , 'ascii' ) , hashlib . sha512 ) . hexdigest ( ) else : apisign = hmac . new ( self . api_secret . encode ( ) , request_url . encode ( ) , hashlib . sha512 ) . hexdigest ( ) self . wait ( ) return self . dispatch ( request_url , apisign ) except Exception : return { 'success' : False , 'message' : 'NO_API_RESPONSE' , 'result' : None }
Queries Bittrex

        :param request_url: fully-formed URL to request
        :type options: dict
        :return: JSON response from Bittrex
        :rtype : dict