You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get an error of unexpected argument when i'm trying to submit an order.
The code i used (as readme example).
frombfxapiimportClient, REST_HOSTfrombfxapi.typesimportNotification, Orderbfx=Client(
rest_host=REST_HOST,
api_key="<YOUR BFX API-KEY>",
api_secret="<YOUR BFX API-SECRET>"
)
notification: Notification[Order] =bfx.rest.auth.submit_order(
type="EXCHANGE LIMIT", symbol="tBTCUSD", amount=0.165212, price=30264.0)
order: Order=notification.dataifnotification.status=="SUCCESS":
print(f"Successful new order for {order.symbol} at {order.price}$.")
ifnotification.status=="ERROR":
raiseException(f"Something went wrong: {notification.text}")
Error:
Traceback (most recent call last):
File "...\main_2.py", line 77, in
notification: Notification[Order] = bfx.rest.auth.submit_order(
File "...\lib\site-packages\bfxapi\rest_interfaces\rest_auth_endpoints.py", line 120, in submit_order
*self.m.post("auth/w/order/submit", body=body)
File "...\lib\site-packages\bfxapi\rest_interface\middleware.py", line 82, in post
data = request.json(cls=JSONDecoder)
File "...\lib\site-packages\requests\models.py", line 974, in json
return complexjson.loads(self.text, **kwargs)
File "...\lib\site-packages\simplejson_init.py", line 533, in loads
return cls(encoding=encoding, **kw).decode(s)
File "...\lib\site-packages\bfxapi_utils\json_decoder.py", line 16, in init
super().init(*args, **kwargs, object_hook=_object_hook)
TypeError: JSONDecoder.init() got an unexpected keyword argument 'encoding'
Python version
Python 3.10.14
The text was updated successfully, but these errors were encountered:
Unfortunately, I am unable to replicate the issue (even using python 3.10.14).
I think the issue might be caused by a conflict with one of your project's dependencies.
Could you please attach your project's requirements.txt?
I get an error of unexpected argument when i'm trying to submit an order.
The code i used (as readme example).
Error:
Traceback (most recent call last):
File "...\main_2.py", line 77, in
notification: Notification[Order] = bfx.rest.auth.submit_order(
File "...\lib\site-packages\bfxapi\rest_interfaces\rest_auth_endpoints.py", line 120, in submit_order
*self.m.post("auth/w/order/submit", body=body)
File "...\lib\site-packages\bfxapi\rest_interface\middleware.py", line 82, in post
data = request.json(cls=JSONDecoder)
File "...\lib\site-packages\requests\models.py", line 974, in json
return complexjson.loads(self.text, **kwargs)
File "...\lib\site-packages\simplejson_init.py", line 533, in loads
return cls(encoding=encoding, **kw).decode(s)
File "...\lib\site-packages\bfxapi_utils\json_decoder.py", line 16, in init
super().init(*args, **kwargs, object_hook=_object_hook)
TypeError: JSONDecoder.init() got an unexpected keyword argument 'encoding'
Python version
Python 3.10.14
The text was updated successfully, but these errors were encountered: