Improve typing
This commit is contained in:
@@ -13,7 +13,7 @@ from schedule import Scheduler
|
|||||||
|
|
||||||
from freqtrade import constants
|
from freqtrade import constants
|
||||||
from freqtrade.configuration import validate_config_consistency
|
from freqtrade.configuration import validate_config_consistency
|
||||||
from freqtrade.constants import BuySell, Config, LongShort
|
from freqtrade.constants import BuySell, Config, ExchangeConfig, LongShort
|
||||||
from freqtrade.data.converter import order_book_to_dataframe
|
from freqtrade.data.converter import order_book_to_dataframe
|
||||||
from freqtrade.data.dataprovider import DataProvider
|
from freqtrade.data.dataprovider import DataProvider
|
||||||
from freqtrade.edge import Edge
|
from freqtrade.edge import Edge
|
||||||
@@ -64,7 +64,7 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
|
|
||||||
# Init objects
|
# Init objects
|
||||||
self.config = config
|
self.config = config
|
||||||
exchange_config = deepcopy(config['exchange'])
|
exchange_config: ExchangeConfig = deepcopy(config['exchange'])
|
||||||
# Remove credentials from original exchange config to avoid accidental credentail exposure
|
# Remove credentials from original exchange config to avoid accidental credentail exposure
|
||||||
remove_exchange_credentials(config['exchange'], True)
|
remove_exchange_credentials(config['exchange'], True)
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
This module loads custom exchanges
|
This module loads custom exchanges
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Dict, Optional
|
from typing import Optional
|
||||||
|
|
||||||
import freqtrade.exchange as exchanges
|
import freqtrade.exchange as exchanges
|
||||||
from freqtrade.constants import Config
|
from freqtrade.constants import Config, ExchangeConfig
|
||||||
from freqtrade.exchange import MAP_EXCHANGE_CHILDCLASS, Exchange
|
from freqtrade.exchange import MAP_EXCHANGE_CHILDCLASS, Exchange
|
||||||
from freqtrade.resolvers import IResolver
|
from freqtrade.resolvers import IResolver
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ class ExchangeResolver(IResolver):
|
|||||||
object_type = Exchange
|
object_type = Exchange
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def load_exchange(config: Config, *, exchange_config: Optional[Dict[str, Any]] = None,
|
def load_exchange(config: Config, *, exchange_config: Optional[ExchangeConfig] = None,
|
||||||
validate: bool = True, load_leverage_tiers: bool = False) -> Exchange:
|
validate: bool = True, load_leverage_tiers: bool = False) -> Exchange:
|
||||||
"""
|
"""
|
||||||
Load the custom class from config parameter
|
Load the custom class from config parameter
|
||||||
|
|||||||
Reference in New Issue
Block a user