Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mcamou committed Jul 29, 2024
1 parent 12e545e commit 22b36de
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions example_publisher/providers/hermes.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import asyncio
from typing import List, Optional
from pythclient.hermes import HermesClient
# from pythclient.pythaccounts import PythPriceAccount, PythPriceStatus


from structlog import get_logger

Expand Down Expand Up @@ -33,17 +31,6 @@ def latest_price(self, symbol: Symbol) -> Optional[Price]:
)

async def _get_hermes_prices(self):
# feed_ids = await self._client.get_price_feed_ids()
# feed_ids_rel = feed_ids[:2]

# self._client.add_feed_ids(feed_ids_rel)

# prices_latest = await self._client.get_all_prices(version=version_http)

# print("Initial prices")
# for feed_id, price_feed in prices_latest.items():
# print(f"Feed ID: {feed_id}, Price: {price_feed['price'].price}, Confidence: {price_feed['price'].conf}, Time: {price_feed['price'].publish_time}")

print("Starting web socket...")
ws_call = self._client.ws_pyth_prices(version=1)
ws_task = asyncio.create_task(ws_call)
Expand All @@ -52,6 +39,6 @@ async def _get_hermes_prices(self):
await asyncio.sleep(5)
if ws_task.done():
break
# print("Latest prices:")
# for feed_id, price_feed in self._client.prices_dict.items():
# print(f"Feed ID: {feed_id}, Price: {price_feed['price'].price}, Confidence: {price_feed['price'].conf}, Time: {price_feed['price'].publish_time}")
print("Latest prices:")
for symbol, price_feed in self._client.prices_dict.items():
print(f"Symbol: {symbol}, Price: {price_feed['price'].price}, Confidence: {price_feed['price'].conf}, Time: {price_feed['price'].publish_time}")

0 comments on commit 22b36de

Please sign in to comment.