# checks if the trading pair is valid def validate_trading_pair(value: str) -> Optional[str]: market = dev_1_get_order_book_config_map.get("exchange").value return validate_market_trading_pair(market, value) dev_1_get_order_book_config_map = { "strategy": ConfigVar( key="strategy", prompt="", default="dev_1_get_order_book", ), "exchange": ConfigVar( key="exchange", prompt="Enter the name of the exchange >>> ", validator=validate_exchange, on_validated=lambda value: required_exchanges.add(value), prompt_on_new=True, ), "trading_pair": ConfigVar( key="trading_pair", prompt=trading_pair_prompt, validator=validate_trading_pair, type_str="str", prompt_on_new=True, ), }
def derivative_on_validated(value: str): required_exchanges.add(value)
def secondary_market_on_validated(value: str): required_exchanges.add(value)
def exchange_on_validated(value: str): required_exchanges.add(value)
def exchange_post_validation(cls, values: Dict): required_exchanges.add(values["exchange"])