bingX-connector-python icon indicating copy to clipboard operation
bingX-connector-python copied to clipboard

Issue with cancel_all_orders futures V2

Open ghost opened this issue 2 years ago • 0 comments

I tried to close few orders but got this error I am not very skilled, what I understand is that the answer from BingX to the request is not a right JSON format because i contains several items. Could it be that it is supposed to be a list of cancelled orders but they did not make it a list so it is several not listed dict of orders. I don't know It is above my skills maybe I am saying BS. image

[2023-04-26 14:23:57,255] ERROR in app: Exception on /tool [POST]
Traceback (most recent call last):
  File "..../lib/python3.9/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/opt/alt/python39/lib64/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/opt/alt/python39/lib64/python3.9/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 5 (char 4)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "..../lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "..../lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "..../lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "..../lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "send_orders.py", line 44, in tool
    answers.append(w.action(action))
  File "...webhookfunctions.py", line 119, in action
    orderreturn = client.cancel_all_orders(
  File "..../lib/python3.9/site-packages/bingX/perpetual/v2/trade.py", line 121, in cancel_all_orders
    res = self.post("/openApi/swap/v2/trade/allOpenOrders", params={
  File "..../lib/python3.9/site-packages/bingX/api.py", line 59, in post
    return self._request('POST', path, params=params)
  File "..../lib/python3.9/site-packages/bingX/api.py", line 53, in _request
    return r.json()
  File "..../lib/python3.9/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Extra data: line 1 column 5 (char 4)

ghost avatar Apr 26 '23 18:04 ghost