raising exceptions if keys are not defined
This commit is contained in:
parent
6c7f0989a6
commit
074de41e57
@ -8,6 +8,14 @@ from bfxbot.models import SymbolStatus, Ticker, EventHandler, Strategy
|
||||
|
||||
class BfxBot:
|
||||
def __init__(self, api_key: str, api_secret: str, tick_duration: int = 1):
|
||||
if api_key is None:
|
||||
print("API_KEY is not set!")
|
||||
raise ValueError
|
||||
|
||||
if api_secret is None:
|
||||
print("API_SECRET is not set!")
|
||||
raise ValueError
|
||||
|
||||
self.bfx: BfxWrapper = BfxWrapper(api_key, api_secret)
|
||||
self.status: Dict[Symbol, SymbolStatus] = {}
|
||||
self.ticker: Ticker = Ticker(tick_duration)
|
||||
|
Loading…
Reference in New Issue
Block a user