From 2cdc102a743531b9b8f3e7698e352296d0c485be Mon Sep 17 00:00:00 2001 From: bohd4nx Date: Thu, 5 Mar 2026 06:36:27 +0200 Subject: [PATCH] refactor: reorganize imports across multiple files for consistency and clarity --- app/core/__init__.py | 10 +++++++++- app/methods/premium.py | 11 ++++++++--- app/methods/stars.py | 11 ++++++++--- app/methods/ton.py | 4 +--- app/utils/client.py | 2 +- app/utils/hash.py | 2 +- app/utils/wallet.py | 4 +--- 7 files changed, 29 insertions(+), 15 deletions(-) diff --git a/app/core/__init__.py b/app/core/__init__.py index 537895b..4388f7a 100644 --- a/app/core/__init__.py +++ b/app/core/__init__.py @@ -1,5 +1,12 @@ from app.core.config import config -from app.core.constants import ADS_PAGE, BASE_HEADERS, DEVICE, PREMIUM_PAGE, STARS_PAGE +from app.core.constants import ( + ADS_PAGE, + BASE_HEADERS, + DEVICE, + PREMIUM_PAGE, + STARS_PAGE, + WALLET_CLASSES, +) from app.core.cookies import load_cookies from app.core.exceptions import ( ConfigError, @@ -19,6 +26,7 @@ __all__ = [ "DEVICE", "PREMIUM_PAGE", "STARS_PAGE", + "WALLET_CLASSES", "ConfigError", "CookiesError", "FragmentError", diff --git a/app/methods/premium.py b/app/methods/premium.py index a6004f9..9d68d9c 100644 --- a/app/methods/premium.py +++ b/app/methods/premium.py @@ -4,9 +4,14 @@ import time import httpx -from app.core import load_cookies -from app.core.constants import BASE_HEADERS, DEVICE, PREMIUM_PAGE -from app.core.exceptions import FragmentError, UserNotFoundError +from app.core import ( + BASE_HEADERS, + DEVICE, + PREMIUM_PAGE, + FragmentError, + UserNotFoundError, + load_cookies, +) from app.utils import ( execute_transaction_request, get_account_info, diff --git a/app/methods/stars.py b/app/methods/stars.py index 2dbf05e..97d1f60 100644 --- a/app/methods/stars.py +++ b/app/methods/stars.py @@ -4,9 +4,14 @@ import time import httpx -from app.core import load_cookies -from app.core.constants import BASE_HEADERS, DEVICE, STARS_PAGE -from app.core.exceptions import FragmentError, UserNotFoundError +from app.core import ( + BASE_HEADERS, + DEVICE, + STARS_PAGE, + FragmentError, + UserNotFoundError, + load_cookies, +) from app.utils import ( execute_transaction_request, get_account_info, diff --git a/app/methods/ton.py b/app/methods/ton.py index 60b3932..79ed10a 100644 --- a/app/methods/ton.py +++ b/app/methods/ton.py @@ -4,9 +4,7 @@ import time import httpx -from app.core import load_cookies -from app.core.constants import ADS_PAGE, BASE_HEADERS, DEVICE -from app.core.exceptions import FragmentError, UserNotFoundError +from app.core import ADS_PAGE, BASE_HEADERS, DEVICE, FragmentError, UserNotFoundError, load_cookies from app.utils import ( execute_transaction_request, get_account_info, diff --git a/app/utils/client.py b/app/utils/client.py index 694d40f..8627390 100644 --- a/app/utils/client.py +++ b/app/utils/client.py @@ -3,7 +3,7 @@ from typing import Any import httpx -from app.core.exceptions import RequestError, WalletError +from app.core import RequestError, WalletError from app.utils.wallet import link_wallet logger = logging.getLogger(__name__) diff --git a/app/utils/hash.py b/app/utils/hash.py index a09455d..790e683 100644 --- a/app/utils/hash.py +++ b/app/utils/hash.py @@ -4,7 +4,7 @@ from typing import Any import httpx -from app.core.exceptions import HashFetchError +from app.core import HashFetchError logger = logging.getLogger(__name__) diff --git a/app/utils/wallet.py b/app/utils/wallet.py index 01932cd..a19af69 100644 --- a/app/utils/wallet.py +++ b/app/utils/wallet.py @@ -7,9 +7,7 @@ import httpx from tonutils.clients import TonapiClient from tonutils.types import NetworkGlobalID -from app.core import config -from app.core.constants import DEVICE, WALLET_CLASSES -from app.core.exceptions import TransactionError, WalletError +from app.core import DEVICE, WALLET_CLASSES, TransactionError, WalletError, config from app.utils.decoder import clean_decode logger = logging.getLogger(__name__)