Skip to content

unexpected argument from bitfinex-api-py library #249

@RomeoVir

Description

@RomeoVir

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions