mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 14:54:21 +01:00
21 lines
672 B
Python
21 lines
672 B
Python
from .websocket import BfxWebsocketClient
|
|
|
|
from typing import Optional
|
|
|
|
from enum import Enum
|
|
|
|
class Constants(str, Enum):
|
|
REST_HOST = "https://api.bitfinex.com/v2"
|
|
PUB_REST_HOST = "https://api-pub.bitfinex.com/v2"
|
|
|
|
WSS_HOST = "wss://api.bitfinex.com/ws/2"
|
|
PUB_WSS_HOST = "wss://api-pub.bitfinex.com/ws/2"
|
|
|
|
class Client(object):
|
|
def __init__(self, WSS_HOST: str = Constants.WSS_HOST, API_KEY: Optional[str] = None, API_SECRET: Optional[str] = None, log_level: str = "WARNING"):
|
|
self.wss = BfxWebsocketClient(
|
|
host=WSS_HOST,
|
|
API_KEY=API_KEY,
|
|
API_SECRET=API_SECRET,
|
|
log_level=log_level
|
|
) |