Merge branch 'feat/objectify-ccxt' into ccxt-objectify-pr1

This commit is contained in:
Samuel Husso
2018-04-06 10:56:06 +03:00
committed by GitHub
7 changed files with 277 additions and 14 deletions

View File

@@ -67,7 +67,6 @@ def init(config: dict) -> None:
if name not in ccxt.exchanges:
raise OperationalException('Exchange {} is not supported'.format(name))
try:
_API = getattr(ccxt, name.lower())({
'apiKey': exchange_config.get('key'),
@@ -75,7 +74,7 @@ def init(config: dict) -> None:
'password': exchange_config.get('password'),
'uid': exchange_config.get('uid'),
})
except KeyError:
except (KeyError, AttributeError):
raise OperationalException('Exchange {} is not supported'.format(name))
logger.info('Using Exchange "%s"', get_name())
@@ -92,9 +91,6 @@ def validate_pairs(pairs: List[str]) -> None:
:return: None
"""
if not _API.markets:
_API.load_markets()
try:
markets = _API.load_markets()
except ccxt.BaseError as e: