Merge remote-tracking branch 'origin/gdax_enabled' into gdax_enabled

# Conflicts:
#	freqtrade/exchange/__init__.py
This commit is contained in:
creslinux 2018-07-29 13:29:08 +00:00
commit 894181bf37

View File

@ -96,7 +96,9 @@ class Exchange(object):
except (KeyError, AttributeError): except (KeyError, AttributeError):
raise OperationalException(f'Exchange {name} is not supported') raise OperationalException(f'Exchange {name} is not supported')
self.set_sandbox(api, exchange_config, name) # check if config requests sandbox, if so use ['test'] from url
if (exchange_config.get('sandbox')):
api.urls['api'] = api.urls['test']
return api return api
@ -110,16 +112,6 @@ class Exchange(object):
"""exchange ccxt id""" """exchange ccxt id"""
return self._api.id return self._api.id
def set_sandbox(self, api, exchange_config: dict, name: str):
if exchange_config.get('sandbox'):
if api.urls.get('test'):
api.urls['api'] = api.urls['test']
logger.info("Enabled Sandbox API on %s", name)
else:
logger.warning(self, "No Sandbox URL in CCXT, exiting. "
"Please check your config.json")
raise OperationalException(f'Exchange {name} does not provide a sandbox api')
def validate_pairs(self, pairs: List[str]) -> None: def validate_pairs(self, pairs: List[str]) -> None:
""" """
Checks if all given pairs are tradable on the current exchange. Checks if all given pairs are tradable on the current exchange.