mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 14:54:21 +01:00
example: creates connect example
This commit is contained in:
19
bfxapi/examples/connect.py
Normal file
19
bfxapi/examples/connect.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import os
|
||||
import sys
|
||||
sys.path.append('../')
|
||||
|
||||
from bfxapi.websockets.LiveWebsocket import LiveBfxWebsocket
|
||||
|
||||
ws = LiveBfxWebsocket(
|
||||
logLevel='INFO'
|
||||
)
|
||||
|
||||
@ws.on('error')
|
||||
def log_error(msg):
|
||||
print ("Error: {}".format(msg))
|
||||
|
||||
@ws.on('all')
|
||||
async def log_output(output):
|
||||
print ("WS: {}".format(output))
|
||||
|
||||
ws.run()
|
||||
Reference in New Issue
Block a user