Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected argument from bitfinex-api-py library #249

Open
RomeoVir opened this issue Oct 22, 2024 · 2 comments
Open

unexpected argument from bitfinex-api-py library #249

RomeoVir opened this issue Oct 22, 2024 · 2 comments

Comments

@RomeoVir
Copy link

RomeoVir commented Oct 22, 2024

I get an error of unexpected argument when i'm trying to submit an order.
The code i used (as readme example).

from bfxapi import Client, REST_HOST

from bfxapi.types import Notification, Order

bfx = 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.data

if notification.status == "SUCCESS":
    print(f"Successful new order for {order.symbol} at {order.price}$.")

if notification.status == "ERROR":
    raise Exception(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

@Davi0kProgramsThings
Copy link
Contributor

Hi @RomeoVir.

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?

You can generate it with the following command:

pip freeze > requirements.txt

@gorchakov
Copy link

gorchakov commented Dec 29, 2024

Hi @Davi0kProgramsThings,
I am expiriencing the same problem

self.client.rest.public.get_platform_status()

\lib\site-packages\bfxapi_utils\json_decoder.py", line 16, in init
super().init(*args, **kwargs, object_hook=_object_hook)
TypeError: init() got an unexpected keyword argument 'encoding'

arrow==1.3.0
attrs==24.3.0
bitfinex-api-py==3.0.4
bitmex==0.2.2
bravado==11.0.3
bravado-core==6.1.1
certifi==2024.12.14
charset-normalizer==3.4.1
contourpy==1.3.0
cycler==0.12.1
fonttools==4.55.3
fqdn==1.5.1
idna==3.10
importlib-resources==6.4.5
isoduration==20.11.0
jsonpointer==3.0.0
jsonref==1.1.0
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
kiwisolver==1.4.7
matplotlib==3.9.4
monotonic==1.6
msgpack==1.1.0
mysql-connector-python==9.1.0
numpy==2.0.2
packaging==24.2
pillow==11.0.0
pyee==11.1.1
pyparsing==3.2.0
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
pytz==2024.2
PyYAML==6.0.2
referencing==0.35.1
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.22.3
simplejson==3.19.3
six==1.17.0
swagger-spec-validator==3.0.4
types-python-dateutil==2.9.0.20241206
types-requests==2.31.0.20240406
types-urllib3==1.26.25.14
typing-extensions==4.12.2
uri-template==1.3.0
urllib3==2.3.0
webcolors==24.11.1
websocket-client==1.8.0
websockets==12.0
zipp==3.21.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants