mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Add overrides for Exchange Support
This commit is contained in:
parent
3ea1cccda9
commit
cc7d341afc
|
@ -88,6 +88,8 @@ class Exchange:
|
||||||
"order_props_in_contracts": ['amount', 'filled', 'remaining'],
|
"order_props_in_contracts": ['amount', 'filled', 'remaining'],
|
||||||
# Override createMarketBuyOrderRequiresPrice where ccxt has it wrong
|
# Override createMarketBuyOrderRequiresPrice where ccxt has it wrong
|
||||||
"marketOrderRequiresPrice": False,
|
"marketOrderRequiresPrice": False,
|
||||||
|
"exchange_has_overrides": {}, # Dictionary overriding ccxt's "has".
|
||||||
|
# Expected to be in the format {"fetchOHLCV": True} or {"fetchOHLCV": False}
|
||||||
}
|
}
|
||||||
_ft_has: Dict = {}
|
_ft_has: Dict = {}
|
||||||
_ft_has_futures: Dict = {}
|
_ft_has_futures: Dict = {}
|
||||||
|
@ -717,6 +719,8 @@ class Exchange:
|
||||||
:param endpoint: Name of endpoint (e.g. 'fetchOHLCV', 'fetchTickers')
|
:param endpoint: Name of endpoint (e.g. 'fetchOHLCV', 'fetchTickers')
|
||||||
:return: bool
|
:return: bool
|
||||||
"""
|
"""
|
||||||
|
if endpoint in self._ft_has.get('exchange_has_overrides', {}):
|
||||||
|
return self._ft_has['exchange_has_overrides'][endpoint]
|
||||||
return endpoint in self._api.has and self._api.has[endpoint]
|
return endpoint in self._api.has and self._api.has[endpoint]
|
||||||
|
|
||||||
def get_precision_amount(self, pair: str) -> Optional[float]:
|
def get_precision_amount(self, pair: str) -> Optional[float]:
|
||||||
|
|
|
@ -1066,6 +1066,9 @@ def test_exchange_has(default_conf, mocker):
|
||||||
exchange = get_patched_exchange(mocker, default_conf, api_mock)
|
exchange = get_patched_exchange(mocker, default_conf, api_mock)
|
||||||
assert not exchange.exchange_has("deadbeef")
|
assert not exchange.exchange_has("deadbeef")
|
||||||
|
|
||||||
|
exchange._ft_has['exchange_has_overrides'] = {'deadbeef': True}
|
||||||
|
assert exchange.exchange_has("deadbeef")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("side,leverage", [
|
@pytest.mark.parametrize("side,leverage", [
|
||||||
("buy", 1),
|
("buy", 1),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user