mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-24 01:04:22 +01:00
websocket: add new events and use t/f to define ticker
This commit is contained in:
committed by
Jacob Plaster
parent
554c8c6112
commit
1f300dd326
@@ -12,12 +12,12 @@ bfx = Client(
|
||||
def log_error(err):
|
||||
print ("Error: {}".format(err))
|
||||
|
||||
@bfx.ws.on('new_ticker')
|
||||
def log_candle(ticker):
|
||||
@bfx.ws.on('new_funding_ticker')
|
||||
def log_ticker(ticker):
|
||||
print ("New ticker: {}".format(ticker))
|
||||
|
||||
async def start():
|
||||
await bfx.ws.subscribe('ticker', 'tBTCUSD')
|
||||
await bfx.ws.subscribe('ticker', 'fUSD')
|
||||
|
||||
bfx.ws.on('connected', start)
|
||||
bfx.ws.run()
|
||||
|
||||
Reference in New Issue
Block a user