ericsomdahl / python-bittrex

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

Nonce Not Provided #119

Closed rchaud99 closed 6 years ago

rchaud99 commented 6 years ago

Hi, Here is a little snippet of my code:

bapi = Bittrex(bittrex_key, bittrex_secret)

balance = 0

def updateBalance(): global balance balance = bapi.get_balance("BTC")['result']['Available'] print(balance, "BTC left.")

updateBalance()

However, when running the api call, it is returning "none" because Nonce is not provided. I don't see a place to enter the nonce in the function arguments/parameters, and I tried changing it in bittrex.py, but no luck. Can someone please help me? thanks

skyl commented 6 years ago

Are your credentials valid?

In [9]: b = Bittrex(None, None)

In [10]: b.get_balance('BTC')
Out[10]: {'message': 'APIKEY_INVALID', 'result': None, 'success': False}
rchaud99 commented 6 years ago

Thanks skyl. I spent hours trying to change the source code bittrex.py but just realized I had an extra space in my API key. :)

skyl commented 6 years ago

No problemo.

maheshj01 commented 6 years ago

which key do we need to insert(secret or key) to get the balance in json format through this url https://bittrex.com/api/v1.1/account/getbalances?apikey=API_KEY I tried putting both the keys and I received this response in both cases {"success":false,"message":"NONCE_NOT_PROVIDED","result":null}

gaethofs commented 6 years ago

You need to add an apisign header param ( hash_hmac('sha512', $url, <private key>) )and use the public key in het url

kkm commented 6 years ago

@gaethofs give me more information. what is $url and which parameter url api key then from hash_hmac?