question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bitso "Invalid Nonce or Invalid Credentials" error on certain Private methods

See original GitHub issue
  • OS: Windows 10
  • Programming Language version: Python 3.6
  • CCXT version: 1.10.810
  • Exchange: Bitso
  • Method: fetch_order

I’m getting an “Invalid Nonce or Invalid Credentials”. Though this does not happen when I try to fetch my balance or when I create an order. Note the only private methods that seem to work for Bitso in the ccxt library are create_order and fetch_balance. cancel_order should be using privateDeleteOrdersOid. That I already fixed. But I’m not getting any further with “Invalid Nonce or Invalid Credentials” error. Any ideas?

---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
~\Anaconda3\envs\LambdaDeploymentPackage\TradingBotEnv\lib\site-packages\ccxt\base\exchange.py in fetch(self, url, method, headers, body)
    351             self.last_http_response = response.text
--> 352             response.raise_for_status()
    353 

~\Anaconda3\envs\LambdaDeploymentPackage\TradingBotEnv\lib\site-packages\requests\models.py in raise_for_status(self)
    934         if http_error_msg:
--> 935             raise HTTPError(http_error_msg, response=self)
    936 

HTTPError: 401 Client Error: Unauthorized for url: https://api.bitso.com/v3/orders/XS2aQZOlGB1zQ08e

During handling of the above exception, another exception occurred:

AuthenticationError                       Traceback (most recent call last)
<ipython-input-5-5bb3a58b2ab6> in <module>()
     11 # BuyOrder = Bitso.create_order('ETH/MXN', 'market', 'buy', 0.001)
     12 # BuyOrder
---> 13 CancelledOrder = Bitso.cancel_order('XS2aQZOlGB1zQ08e')
     14 
     15 # CancelledOrder = Bitso.privateDeleteOrdersOid({'oid': 'XS2aQZOlGB1zQ08e'})

~\Anaconda3\envs\LambdaDeploymentPackage\TradingBotEnv\lib\site-packages\ccxt\bitso.py in cancel_order(self, id, symbol, params)
    269     def cancel_order(self, id, symbol=None, params={}):
    270         self.load_markets()
--> 271         response = self.privateDeleteOrdersOid(self.extend({'oid': id}, params))
    272         return {
    273             'info': response,

~\Anaconda3\envs\LambdaDeploymentPackage\TradingBotEnv\lib\site-packages\ccxt\bitso.py in request(self, path, api, method, params, headers, body)
    299 
    300     def request(self, path, api='public', method='GET', params={}, headers=None, body=None):
--> 301         response = self.fetch2(path, api, method, params, headers, body)
    302         if 'success' in response:
    303             if response['success']:

~\Anaconda3\envs\LambdaDeploymentPackage\TradingBotEnv\lib\site-packages\ccxt\base\exchange.py in fetch2(self, path, api, method, params, headers, body)
    297         self.lastRestRequestTimestamp = self.milliseconds()
    298         request = self.sign(path, api, method, params, headers, body)
--> 299         return self.fetch(request['url'], request['method'], request['headers'], request['body'])
    300 
    301     def request(self, path, api='public', method='GET', params={}, headers=None, body=None):

~\Anaconda3\envs\LambdaDeploymentPackage\TradingBotEnv\lib\site-packages\ccxt\base\exchange.py in fetch(self, url, method, headers, body)
    363         except HTTPError as e:
    364             self.handle_errors(response.status_code, response.reason, url, method, None, self.last_http_response)
--> 365             self.handle_rest_errors(e, response.status_code, self.last_http_response, url, method)
    366             self.raise_error(ExchangeError, url, method, e, self.last_http_response)
    367 

~\Anaconda3\envs\LambdaDeploymentPackage\TradingBotEnv\lib\site-packages\ccxt\base\exchange.py in handle_rest_errors(self, exception, http_status_code, response, url, method)
    394             error = AuthenticationError
    395         if error:
--> 396             self.raise_error(error, url, method, exception if exception else http_status_code, response)
    397 
    398     def handle_rest_response(self, response, url, method='GET', headers=None, body=None):

~\Anaconda3\envs\LambdaDeploymentPackage\TradingBotEnv\lib\site-packages\ccxt\base\exchange.py in raise_error(self, exception_type, url, method, error, details)
    279                 method,
    280                 url,
--> 281                 details,
    282             ]))
    283         else:

AuthenticationError: bitso DELETE https://api.bitso.com/v3/orders/XS2aQZOlGB1zQ08e 401 Client Error: Unauthorized for url: https://api.bitso.com/v3/orders/XS2aQZOlGB1zQ08e {"success":false,"error":{"code":"0201","message":"Invalid Nonce or Invalid Credentials"}}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

Introduction – Bitso API Reference - GitHub Pages
0201: Check your credentials; 0202: API key is not authorized to execute the requested method; 0203: Login token is invalid or expired; 0204:...
Read more >
Comprar e vender bitcoin é simples assim. - API
0201: Check your credentials; 0202: API key is not authorized to execute the requested method; 0203: Login token is invalid or expired; 0204:...
Read more >
Python bitstamp api invalid nonce error
Generating a new api key/secret fixed this problem. I believe it was caused by using a mix of the php api and the...
Read more >
Exchanges — ccxt 2.4.71 documentation
In case your calls hit a rate limit or get nonce errors, the ccxt library will throw an InvalidNonce exception, or, in some...
Read more >
ccxt Documentation
Seychelles bitso ... private API for a particular crypto exchange. ... In case your calls hit a rate limit or get nonce errors,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found