diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 43ccb843..e4db10c1 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.7.14 +current_version = 0.7.15 commit = True tag = True tag_name = {new_version} diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e0a5e89..113cd788 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,4 +48,8 @@ Add default `Confirmed` commitment in `StandardTxSender` ## [0.7.14] - 2024-1-18 -Add `PriorityFeeSubscriber` \ No newline at end of file +Add `PriorityFeeSubscriber` + +## [0.7.15] - 2024-1-18 + +Fix bug where `PriorityFeeSubscriber.subscribe()` blocks \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index af001463..90ea160a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "driftpy" -version = "0.7.14" +version = "0.7.15" description = "A Python client for the Drift DEX" authors = ["x19 ", "bigz "] license = "MIT" diff --git a/src/driftpy/__init__.py b/src/driftpy/__init__.py index 6de11f48..1746246f 100644 --- a/src/driftpy/__init__.py +++ b/src/driftpy/__init__.py @@ -1 +1 @@ -__version__ = "0.7.14" +__version__ = "0.7.15" diff --git a/src/driftpy/priority_fees/priority_fee_subscriber.py b/src/driftpy/priority_fees/priority_fee_subscriber.py index 2fe6cba4..04d9088a 100644 --- a/src/driftpy/priority_fees/priority_fee_subscriber.py +++ b/src/driftpy/priority_fees/priority_fee_subscriber.py @@ -2,7 +2,6 @@ import jsonrpcclient from dataclasses import dataclass -from typing import Optional from solana.rpc.async_api import AsyncClient from solders.pubkey import Pubkey @@ -35,8 +34,11 @@ async def subscribe(self): self.subscribed = True + asyncio.create_task(self.poll()) + + async def poll(self): while self.subscribed: - await self.load() + asyncio.create_task(self.load()) await asyncio.sleep(self.frequency_ms) async def load(self): @@ -70,6 +72,8 @@ async def load(self): ) / len(desc_results) self.max_priority_fee = max(item["prioritizationFee"] for item in desc_results) + print("loaded") + async def unsubscribe(self): if self.subscribed: self.subscribed = False