use Config typing in more places
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import logging
|
||||
from typing import Any, Dict
|
||||
|
||||
from freqtrade.constants import Config
|
||||
from freqtrade.enums import RPCMessageType
|
||||
from freqtrade.rpc import RPC
|
||||
from freqtrade.rpc.webhook import Webhook
|
||||
@@ -10,7 +10,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Discord(Webhook):
|
||||
def __init__(self, rpc: 'RPC', config: Dict[str, Any]):
|
||||
def __init__(self, rpc: 'RPC', config: Config):
|
||||
# super().__init__(rpc, config)
|
||||
self.rpc = rpc
|
||||
self.config = config
|
||||
|
@@ -5,6 +5,7 @@ import logging
|
||||
from collections import deque
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from freqtrade.constants import Config
|
||||
from freqtrade.enums import RPCMessageType
|
||||
from freqtrade.rpc import RPC, RPCHandler
|
||||
|
||||
@@ -89,7 +90,7 @@ class RPCManager:
|
||||
'msg': msg,
|
||||
})
|
||||
|
||||
def startup_messages(self, config: Dict[str, Any], pairlist, protections) -> None:
|
||||
def startup_messages(self, config: Config, pairlist, protections) -> None:
|
||||
if config['dry_run']:
|
||||
self.send_msg({
|
||||
'type': RPCMessageType.WARNING,
|
||||
|
@@ -24,7 +24,7 @@ from telegram.ext import CallbackContext, CallbackQueryHandler, CommandHandler,
|
||||
from telegram.utils.helpers import escape_markdown
|
||||
|
||||
from freqtrade.__init__ import __version__
|
||||
from freqtrade.constants import DUST_PER_COIN
|
||||
from freqtrade.constants import DUST_PER_COIN, Config
|
||||
from freqtrade.enums import RPCMessageType, SignalDirection, TradingMode
|
||||
from freqtrade.exceptions import OperationalException
|
||||
from freqtrade.misc import chunks, plural, round_coin_value
|
||||
@@ -88,7 +88,7 @@ def authorized_only(command_handler: Callable[..., None]) -> Callable[..., Any]:
|
||||
class Telegram(RPCHandler):
|
||||
""" This class handles all telegram communication """
|
||||
|
||||
def __init__(self, rpc: RPC, config: Dict[str, Any]) -> None:
|
||||
def __init__(self, rpc: RPC, config: Config) -> None:
|
||||
"""
|
||||
Init the Telegram call, and init the super class RPCHandler
|
||||
:param rpc: instance of RPC Helper class
|
||||
|
@@ -7,6 +7,7 @@ from typing import Any, Dict
|
||||
|
||||
from requests import RequestException, post
|
||||
|
||||
from freqtrade.constants import Config
|
||||
from freqtrade.enums import RPCMessageType
|
||||
from freqtrade.rpc import RPC, RPCHandler
|
||||
|
||||
@@ -19,7 +20,7 @@ logger.debug('Included module rpc.webhook ...')
|
||||
class Webhook(RPCHandler):
|
||||
""" This class handles all webhook communication """
|
||||
|
||||
def __init__(self, rpc: RPC, config: Dict[str, Any]) -> None:
|
||||
def __init__(self, rpc: RPC, config: Config) -> None:
|
||||
"""
|
||||
Init the Webhook class, and init the super class RPCHandler
|
||||
:param rpc: instance of RPC Helper class
|
||||
|
Reference in New Issue
Block a user