lavori in corso: agginto campo provider a productinfo. Inseguire le istanze e mettere il campo provider come init quano si istanzia

This commit is contained in:
Simone Garau
2025-10-30 11:15:26 +01:00
parent 55858a7458
commit 512bc4568e
3 changed files with 30 additions and 10 deletions

View File

@@ -104,7 +104,9 @@ class MarketAPIsTool(MarketWrapper, Toolkit):
Raises:
Exception: If all providers fail to return results.
"""
all_products = self.handler.try_call_all(lambda w: w.get_products(asset_ids))
all_products: dict[str, list[ProductInfo]] = {}
for asset in asset_ids:
all_products[asset] = self.handler.try_call_all(lambda w: w.get_product(asset))
return ProductInfo.aggregate(all_products)
def get_historical_prices_aggregated(self, asset_id: str = "BTC", limit: int = 100) -> list[Price]: