Skip to content

Commit

Permalink
initial modules refactory
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Cosentino committed Jan 6, 2024
1 parent e0b6f0b commit 4c5af4d
Show file tree
Hide file tree
Showing 8 changed files with 339 additions and 261 deletions.
6 changes: 3 additions & 3 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
TELEGRAM_TOKEN=your_token
ETHERSCAN_API_KEY=your_api_key
INFURA_API_KEY=your_key
AWS_ACCESS_KEY_ID=your_key_id
AWS_SECRET_ACCESS_KEY=your_access_key
UPDATE_THRESHOLD=5
LOG_LEVEL=DEBUG
LOG_FORMAT="%(asctime)s %(levelprefix)s %(message)s"
LOG_DATE_FORMAT="%Y-%m-%d %H:%M:%S"
CLOUD_PROVIDER=AWS
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
2 changes: 1 addition & 1 deletion release.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@

__metaclass__ = type # pylint: disable=invalid-name

__version__ = "0.2.2"
__version__ = "0.2.3"
__author__ = "F."
14 changes: 9 additions & 5 deletions tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@

from api import app
from core import SingletonMeta

# from enums import Env
from gas_tracker import GasTracker, TrackerState
from release import __version__ as version
from tracker.config import ConfigHandler

# from enums import Env
from tracker.ethereum.gas_tracker import GasTracker, TrackerState
from tracker.ethereum.wallet_tracker import WalletTracker
from tracker.ethereum.wallet_tracker_storage import WalletTrackerStorage
from tracker.logger import Logger
from wallet_tracker import WalletTracker


class Tracker(metaclass=SingletonMeta):
Expand Down Expand Up @@ -152,6 +153,9 @@ async def help_command(self, update, context):
"/track_wallet - Track a wallet for new transactions\n"
"/untrack_wallet - Untrack a wallet\n"
"/list_tracked_wallets - List the tracked wallets\n"
"/resolve_wallet - Resolve a wallet\n"
"/pause_tracking_wallet - Pause tracking a wallet\n"
"/resume_tracking_wallet - Resume tracking a wallet\n\n"
"/help - Show this help message\n\n"
"To receive alerts, use the /subscribe command. When the gas price is low, "
"you'll receive a notification. You can also set custom alert thresholds."
Expand Down Expand Up @@ -348,7 +352,7 @@ async def main(self):
await self.application.start()
asyncio.create_task(gas_tracker.monitor_gas_prices())
asyncio.create_task(wallet_tracker.monitor_wallet_transactions())
asyncio.create_task(wallet_tracker.refresh_db_cache())
asyncio.create_task(WalletTrackerStorage().update_db_cache())
await self.application.updater.start_polling()
await server.serve()
await self.application.updater.stop()
Expand Down
8 changes: 8 additions & 0 deletions tracker/ethereum/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""ETHEREUM module."""

try:
from .gas_tracker import GasTracker
from .wallet_tracker import WalletTracker
from .wallet_tracker_storage import WalletTrackerStorage
except ImportError as ex:
raise ex
File renamed without changes.
Loading

0 comments on commit 4c5af4d

Please sign in to comment.