dydxprotocol / dydx-v3-python

Python client for dYdX (API v3)
Apache License 2.0
304 stars 174 forks source link

DydxApiError(status_code=401, response={'errors': [{'msg': 'Unauthorized'}]}) #197

Closed xldistance closed 1 year ago

xldistance commented 1 year ago

I get this error when I test querying an order

https://api.dydx.exchange/v3/orders?market=['BTC-USD']&status=['PENDING', 'OPEN']
Traceback (most recent call last):
  File "H:\Desktop\dydx测试.py", line 22, in <module>
    orders = private_client.private.get_orders(market = ["BTC-USD"],status = ["PENDING","OPEN"])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\xldistance\AppData\Local\Programs\Python\Python311\Lib\site-packages\dydx3\modules\private.py", line 356, in get_orders
    return self._get(
           ^^^^^^^^^^
  File "C:\Users\xldistance\AppData\Local\Programs\Python\Python311\Lib\site-packages\dydx3\modules\private.py", line 78, in _get
    return self._private_request(
           ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\xldistance\AppData\Local\Programs\Python\Python311\Lib\site-packages\dydx3\modules\private.py", line 69, in _private_request
    return request(
           ^^^^^^^^
  File "C:\Users\xldistance\AppData\Local\Programs\Python\Python311\Lib\site-packages\dydx3\helpers\requests.py", line 34, in request
    raise DydxApiError(response)
dydx3.errors.DydxApiError: DydxApiError(status_code=401, response={'errors': [{'msg': 'Unauthorized'}]})
xldistance commented 1 year ago

I have entered the key, secret and passphrase in api_key_credentials, and stark_private_key, stark_public_key

xldistance commented 1 year ago

QQ截图20230219131045

xldistance commented 1 year ago

Did you find the solution ?

There is a problem with the official documentation, I remember changing it to status=['PENDING']