Handle WebSocket authentication events
masterWhen using an authenticated WebSocket connection, you must wait for the authenticated event before performing operations that require permissions. The data payload contains user information and capability flags (caps).
@bfx.wss.on("authenticated")
def on_authenticated(data: Dict[str, Any]):
print(f"Successful login for user <{data['userId']}>.")
# Check specific permissions
if not data["caps"]["orders"]["read"]:
raise Exception("This application requires read permissions on orders.")