[docs]@dataclassclassHopHandler:""" Dataclass in charge of handling pair hopping. Is mostly integrated within fetchers to handle different quote currencies. :param hopped_currencies: Dict between the quote currency and the new quote currency """hopped_currencies:Dict[str,str]=field(default_factory=dict)
[docs]defget_hop_pair(self,pair:Pair)->Optional[Pair]:""" Returns a new pair if the quote currency is in the hopped_currencies list Otherwise, returns None :param pair: Pair :return: Optional[Pair] """ifpair.quote_currency.idnotinself.hopped_currencies:returnNonenew_currency_id=self.hopped_currencies[pair.quote_currency.id]returnPair(pair.base_currency,Currency.from_asset_config(AssetConfig.from_ticker(new_currency_id)),)