2019-06-12 09:33:20 +00:00
|
|
|
import logging
|
2020-01-26 12:17:26 +00:00
|
|
|
from typing import Any, Dict
|
2019-06-12 09:33:20 +00:00
|
|
|
|
2020-01-26 12:17:26 +00:00
|
|
|
from freqtrade.configuration import (Configuration, remove_credentials,
|
2020-01-02 09:41:10 +00:00
|
|
|
validate_config_consistency)
|
2019-06-12 09:33:20 +00:00
|
|
|
from freqtrade.state import RunMode
|
|
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
2019-09-12 18:16:39 +00:00
|
|
|
def setup_utils_configuration(args: Dict[str, Any], method: RunMode) -> Dict[str, Any]:
|
2019-06-12 09:33:20 +00:00
|
|
|
"""
|
2019-06-16 18:37:43 +00:00
|
|
|
Prepare the configuration for utils subcommands
|
2019-06-12 09:33:20 +00:00
|
|
|
:param args: Cli args from Arguments()
|
|
|
|
:return: Configuration
|
|
|
|
"""
|
|
|
|
configuration = Configuration(args, method)
|
2019-08-16 12:42:44 +00:00
|
|
|
config = configuration.get_config()
|
2019-06-12 09:33:20 +00:00
|
|
|
|
|
|
|
# Ensure we do not use Exchange credentials
|
2019-11-05 11:39:19 +00:00
|
|
|
remove_credentials(config)
|
2020-01-02 09:41:10 +00:00
|
|
|
validate_config_consistency(config)
|
2019-06-12 09:33:20 +00:00
|
|
|
|
|
|
|
return config
|