ericsomdahl / python-bittrex

Python bindings for bittrex
MIT License
585 stars 283 forks source link

v2.0 get_order_history does not use market argument. #68

Open skyl opened 6 years ago

skyl commented 6 years ago

v1.1 returns only orders from the passed market. v2.0 returns a mixed bag of orders.

In [24]: bittrex.api_version
Out[24]: 'v1.1'

In [25]: bittrex.get_order_history('BTC-ZEC')['result'][0]
Out[25]: 
{
 'Exchange': 'BTC-ZEC',
 ....
}

In [26]: bittrex.api_version = 'v2.0'

In [27]: bittrex.get_order_history('BTC-ZEC')['result'][0]
Out[27]: 
{
 'Exchange': 'BTC-XZC',
 ...
}
skyl commented 6 years ago

On the website, it looks like the call is a POST with MarketName:BTC-ZEC in the form data.

Changing the marketname option to CapCase MarketName doesn't have the desired effect.

skyl commented 6 years ago

So, I can't get the MarketName to work with many different attempts :/

All permutations of this give back the same thing that we already have for v2 in 0.2.0...

            import json
            request_url = BASE_URL_V2_0
            request_url = request_url.format(
                # path='/auth/market/GetOrderHistory')
                path='/key/orders/getorderhistory')

            nonce = str(int(time.time() * 1000))
            request_url = "{0}apikey={1}&nonce={2}&MarketName={3}".format(
                request_url, self.api_key, nonce, market)
            # request_url += urlencode(options)
            apisign = hmac.new(
                self.api_secret.encode(),
                request_url.encode(),
                hashlib.sha512
            ).hexdigest()
            print(request_url)
            resp = requests.post(request_url, data={
                'MarketName': market
            }, headers={
                'apisign': apisign,
            })
            # return json.loads(resp.text)
            return resp

I notice on the website they use /auth/market/GetOrderHistory; but, if I try that, I seem to provoke a 500 on their side ...

jogam5 commented 6 years ago

Hi @skyl did u find a way to access your data? I'm trying to get my full order history but it seems impossible both by web (csv) and by API.

tanner314 commented 6 years ago

I am also having an issue with retrieving open orders on V1.1. The response is: {'success': True, 'message': '', 'result': []} Are you guys having the same issue? @jogam5 @skyl

faraday commented 6 years ago

@skyl @tanner314 get_orderbook also returns something totally different at times. You'll notice in subsequent calls. It happens like %20 of the time.