mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-20 07:14:20 +01:00
24 lines
395 B
Python
24 lines
395 B
Python
import os
|
|
import sys
|
|
sys.path.append('../../../')
|
|
|
|
from bfxapi import Client
|
|
|
|
bfx = Client(
|
|
logLevel='DEBUG'
|
|
)
|
|
|
|
@bfx.ws.on('error')
|
|
def log_error(err):
|
|
print ("Error: {}".format(err))
|
|
|
|
@bfx.ws.on('new_funding_ticker')
|
|
def log_ticker(ticker):
|
|
print ("New ticker: {}".format(ticker))
|
|
|
|
async def start():
|
|
await bfx.ws.subscribe('ticker', 'fUSD')
|
|
|
|
bfx.ws.on('connected', start)
|
|
bfx.ws.run()
|