Giter Club home page Giter Club logo

Comments (3)

souresia avatar souresia commented on September 28, 2024 1

Same thing happened to me and managed to fix it

The pyee library version 8 was recently released with backward incompatible changes for bitfinex-api-py. Normally, we should use the pyee version specified in https://github.com/bitfinexcom/bitfinex-api-py/blob/master/requirements.txt#L7

But it works when downgrading to version 7:

pip3 install pyee~=7.0.4 

from bitfinex-api-py.

jbarrerobuch avatar jbarrerobuch commented on September 28, 2024

I just copy the example, put my keys and run it

`
import os
import sys
import asyncio
import time
sys.path.append('../../../')

from bfxapi import Client

API_KEY=os.getenv("my_key")
API_SECRET=os.getenv("my_secret")

bfx = Client(
API_KEY=API_KEY,
API_SECRET=API_SECRET,
logLevel='DEBUG'
)

now = int(round(time.time() * 1000))
then = now - (1000 * 60 * 60 * 24 * 10) # 10 days ago

async def log_wallets():
wallets = await bfx.rest.get_wallets()
print ("Wallets:")
[ print (w) for w in wallets ]

async def log_active_orders():
orders = await bfx.rest.get_active_orders('tBTCUSD')
print ("Orders:")
[ print (o) for o in orders ]

async def log_orders_history():
orders = await bfx.rest.get_order_history('tBTCUSD', 0, then)
print ("Orders:")
[ print (o) for o in orders ]

async def log_active_positions():
positions = await bfx.rest.get_active_position()
print ("Positions:")
[ print (p) for p in positions ]

async def log_trades():
trades = await bfx.rest.get_trades('fBTC', 0, then)
print ("Trades:")
[ print (t) for t in trades]

async def log_order_trades():
order_id = 1151353463
trades = await bfx.rest.get_order_trades('tBTCUSD', order_id)
print ("Trade orders:")
[ print (t) for t in trades]

async def log_funding_offers():
offers = await bfx.rest.get_funding_offers('fBTC')
print ("Offers:")
[ print (o) for o in offers]

async def log_funding_offer_history():
offers = await bfx.rest.get_funding_offer_history('fBTC', 0, then)
print ("Offers history:")
[ print (o) for o in offers]

async def log_funding_loans():
loans = await bfx.rest.get_funding_loans('fBTC')
print ("Funding loans:")
[ print (l) for l in loans ]

async def log_funding_loans_history():
loans = await bfx.rest.get_funding_loan_history('fBTC', 0, then)
print ("Funding loan history:")
[ print (l) for l in loans ]

async def log_funding_credits():
credits = await bfx.rest.get_funding_credits('fBTC')
print ("Funding credits:")
[ print (c) for c in credits ]

async def log_funding_credits_history():
credit = await bfx.rest.get_funding_credit_history('fBTC', 0, then)
print ("Funding credit history:")
[ print (c) for c in credit ]

async def run():
await log_wallets()
await log_active_orders()
await log_orders_history()
await log_active_positions()
await log_trades()
await log_order_trades()
await log_funding_offers()
await log_funding_offer_history()
await log_funding_credits()
await log_funding_credits_history()

t = asyncio.ensure_future(run())
asyncio.get_event_loop().run_until_complete(t)
`

and I got the following error

`runcell(0, 'C:/...../untitled2.py')
Traceback (most recent call last):

File "C:\Pythonscripts\untitled2.py", line 19, in
bfx = Client(

File "C:\Miniconda3\lib\site-packages\bfxapi\client.py", line 24, in init
self.ws = BfxWebsocket(API_KEY=API_KEY, API_SECRET=API_SECRET, host=ws_host,

File "C:\Miniconda3\lib\site-packages\bfxapi\websockets\bfx_websocket.py", line 168, in init
super(BfxWebsocket, self).init(host, logLevel=logLevel, *args, **kwargs)

File "C:\Miniconda3\lib\site-packages\bfxapi\websockets\generic_websocket.py", line 80, in init
self.events = create_ee()

File "C:\Miniconda3\lib\site-packages\bfxapi\websockets\generic_websocket.py", line 60, in _start_event_worker
return EventEmitter(scheduler=asyncio.ensure_future)

TypeError: init() got an unexpected keyword argument 'scheduler'`

I downgraded pyee to 7.0.4 as mentioned before but still not working. I'm on python 3.8.3
Any clue??

from bitfinex-api-py.

robertkowalski avatar robertkowalski commented on September 28, 2024

should be fixed in current master branch :)

from bitfinex-api-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.