mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2026-02-23 14:34:31 +01:00
Apply black to all python files (bfxapi/**/*.py).
This commit is contained in:
@@ -14,29 +14,35 @@ WSS_HOST = "wss://api.bitfinex.com/ws/2"
|
||||
PUB_REST_HOST = "https://api-pub.bitfinex.com/v2"
|
||||
PUB_WSS_HOST = "wss://api-pub.bitfinex.com/ws/2"
|
||||
|
||||
|
||||
class Client:
|
||||
def __init__(
|
||||
self,
|
||||
api_key: Optional[str] = None,
|
||||
api_secret: Optional[str] = None,
|
||||
*,
|
||||
rest_host: str = REST_HOST,
|
||||
wss_host: str = WSS_HOST,
|
||||
filters: Optional[List[str]] = None,
|
||||
timeout: Optional[int] = 60 * 15,
|
||||
log_filename: Optional[str] = None
|
||||
self,
|
||||
api_key: Optional[str] = None,
|
||||
api_secret: Optional[str] = None,
|
||||
*,
|
||||
rest_host: str = REST_HOST,
|
||||
wss_host: str = WSS_HOST,
|
||||
filters: Optional[List[str]] = None,
|
||||
timeout: Optional[int] = 60 * 15,
|
||||
log_filename: Optional[str] = None,
|
||||
) -> None:
|
||||
credentials: Optional["_Credentials"] = None
|
||||
|
||||
if api_key and api_secret:
|
||||
credentials = \
|
||||
{ "api_key": api_key, "api_secret": api_secret, "filters": filters }
|
||||
credentials = {
|
||||
"api_key": api_key,
|
||||
"api_secret": api_secret,
|
||||
"filters": filters,
|
||||
}
|
||||
elif api_key:
|
||||
raise IncompleteCredentialError( \
|
||||
"You must provide both an API-KEY and an API-SECRET (missing API-KEY).")
|
||||
raise IncompleteCredentialError(
|
||||
"You must provide both an API-KEY and an API-SECRET (missing API-KEY)."
|
||||
)
|
||||
elif api_secret:
|
||||
raise IncompleteCredentialError( \
|
||||
"You must provide both an API-KEY and an API-SECRET (missing API-SECRET).")
|
||||
raise IncompleteCredentialError(
|
||||
"You must provide both an API-KEY and an API-SECRET (missing API-SECRET)."
|
||||
)
|
||||
|
||||
self.rest = BfxRestInterface(rest_host, api_key, api_secret)
|
||||
|
||||
@@ -45,5 +51,6 @@ class Client:
|
||||
if log_filename:
|
||||
logger.register(filename=log_filename)
|
||||
|
||||
self.wss = BfxWebSocketClient(wss_host, \
|
||||
credentials=credentials, timeout=timeout, logger=logger)
|
||||
self.wss = BfxWebSocketClient(
|
||||
wss_host, credentials=credentials, timeout=timeout, logger=logger
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user