chore: type _ft_has

This commit is contained in:
Matthias
2024-09-04 07:15:17 +02:00
parent d49c556291
commit 964d437c7a
17 changed files with 87 additions and 32 deletions

View File

@@ -70,6 +70,7 @@ from freqtrade.exchange.common import (
from freqtrade.exchange.exchange_types import (
CcxtBalances,
CcxtPosition,
FtHas,
OHLCVResponse,
OrderBook,
Ticker,
@@ -122,10 +123,11 @@ class Exchange:
# Dict to specify which options each exchange implements
# This defines defaults, which can be selectively overridden by subclasses using _ft_has
# or by specifying them in the configuration.
_ft_has_default: Dict = {
_ft_has_default: FtHas = {
"stoploss_on_exchange": False,
"stop_price_param": "stopLossPrice", # Used for stoploss_on_exchange request
"stop_price_prop": "stopLossPrice", # Used for stoploss_on_exchange response parsing
"stoploss_order_types": {},
"order_time_in_force": ["GTC"],
"ohlcv_params": {},
"ohlcv_candle_limit": 500,
@@ -156,8 +158,8 @@ class Exchange:
# Expected to be in the format {"fetchOHLCV": True} or {"fetchOHLCV": False}
"ws_enabled": False, # Set to true for exchanges with tested websocket support
}
_ft_has: Dict = {}
_ft_has_futures: Dict = {}
_ft_has: FtHas = {}
_ft_has_futures: FtHas = {}
_supported_trading_mode_margin_pairs: List[Tuple[TradingMode, MarginMode]] = [
# TradingMode.SPOT always supported and not required in this list
@@ -466,7 +468,7 @@ class Exchange:
"""
return int(
self._ft_has.get("ohlcv_candle_limit_per_timeframe", {}).get(
timeframe, self._ft_has.get("ohlcv_candle_limit")
timeframe, str(self._ft_has.get("ohlcv_candle_limit"))
)
)