refactor(domains): merge token/tokens + scanner/scanners, drop empty app/domain/

- Move app/domains/tokens/deployer.py -> app/domains/token/deployer.py.
  Delete app/domains/tokens/ (was a single-file shadow of the token domain).
- Move app/domains/scanner/* into app/domains/scanners/core/. The 31
  detector modules in app/domains/scanners/ + the core service are now
  a single coherent domain.
- Update import paths in app/token_scanner.py and app/token_deployer.py.
- Delete empty app/domain/ (singular, was a leftover scaffold).
- Factory still loads 466 routes, mypy-gate clean.
This commit is contained in:
Crypto Rug Munch 2026-07-07 17:48:53 +07:00
parent 1b53332695
commit bd412acb2b
9 changed files with 14 additions and 33 deletions

View file

@ -15,6 +15,6 @@ Architecture:
- app/token_scanner.py Backward compatibility shim - app/token_scanner.py Backward compatibility shim
""" """
from app.domains.scanner.service import ScanResult, quick_scan_text, scan_token from app.domains.scanners.core.service import ScanResult, quick_scan_text, scan_token
__all__ = ["ScanResult", "quick_scan_text", "scan_token"] __all__ = ["ScanResult", "quick_scan_text", "scan_token"]

View file

@ -4,7 +4,7 @@ from typing import Any
import httpx import httpx
from app.domains.scanner.models import SOLANA_RPC_ENDPOINTS from app.domains.scanners.core.models import SOLANA_RPC_ENDPOINTS
logger = __import__("app.core.logging", fromlist=["get_logger"]).get_logger(__name__) logger = __import__("app.core.logging", fromlist=["get_logger"]).get_logger(__name__)

View file

@ -4,7 +4,7 @@ import asyncio
from typing import Any from typing import Any
from app.core.logging import get_logger from app.core.logging import get_logger
from app.domains.scanner.modules import ( from app.domains.scanners.core.modules import (
_get_deployer_info, _get_deployer_info,
_get_holder_data, _get_holder_data,
) )
@ -12,9 +12,9 @@ from app.domains.scanner.modules import (
logger = get_logger(__name__) logger = get_logger(__name__)
# Re-export ScanResult for backward compatibility # Re-export ScanResult for backward compatibility
from app.domains.scanner.market_data import fetch_market_data # noqa: E402 from app.domains.scanners.core.market_data import fetch_market_data # noqa: E402
from app.domains.scanner.models import ScanResult # noqa: E402 from app.domains.scanners.core.models import ScanResult # noqa: E402
from app.domains.scanner.modules import ( # noqa: E402 from app.domains.scanners.core.modules import ( # noqa: E402
_check_blockscout, _check_blockscout,
_check_defi_scanner, _check_defi_scanner,
_check_honeypot_is, _check_honeypot_is,
@ -297,4 +297,4 @@ async def quick_scan_text(token_address: str, chain: str = "solana") -> str:
# Backward compatibility: re-export scan_token # Backward compatibility: re-export scan_token
from app.domains.scanner.service import scan_token # noqa: E402, F811 from app.domains.scanners.core.service import scan_token # noqa: E402, F811

View file

@ -1,19 +0,0 @@
"""Tokens subsystem.
Phase 3B of AUDIT-2026-Q3.md.
Re-exports the canonical public API of the token deployer. Implementation
lives in app.tokens.deployer (moved verbatim from app.token_deployer on
2026-07-07).
"""
from app.domains.tokens.deployer import ( # noqa: F401
ChainDeployer,
DeployParams,
DeploymentStorage,
EVMDeployer,
SolanaDeployer,
TokenDeployment,
TokenDeployerFactory,
TronDeployer,
get_storage,
)

View file

@ -1,19 +1,19 @@
"""token_deployer.py - DEPRECATED shim. Use app.domains.tokens.deployer. """token_deployer.py - DEPRECATED shim. Use app.domains.token.deployer.
Phase 4 of AUDIT-2026-Q3.md moved this to app/domains/tokens/deployer/. Phase 4 of AUDIT-2026-Q3.md moved this to app/domains/token/deployer/.
This shim re-exports the public surface for legacy callers. This shim re-exports the public surface for legacy callers.
""" """
from app.domains.tokens.deployer import * # noqa: F401,F403 from app.domains.token.deployer import * # noqa: F403
from app.domains.tokens.deployer import ( # noqa: F401 from app.domains.token.deployer import ( # noqa: F401
ChainDeployer, ChainDeployer,
DeployParams,
DeploymentStorage, DeploymentStorage,
DeployParams,
EVMDeployer, EVMDeployer,
SolanaDeployer, SolanaDeployer,
TokenDeployerFactory, TokenDeployerFactory,
TokenDeployment, TokenDeployment,
TronDeployer, TronDeployer,
_storage,
get_storage, get_storage,
logger, logger,
_storage,
) )

View file

@ -6,6 +6,6 @@ better organization (per architecture standard: NO file > 500 lines).
This file re-exports the main API from the new modules. This file re-exports the main API from the new modules.
""" """
from app.domains.scanner import ScanResult, quick_scan_text, scan_token from app.domains.scanners.core import ScanResult, quick_scan_text, scan_token
__all__ = ["ScanResult", "quick_scan_text", "scan_token"] __all__ = ["ScanResult", "quick_scan_text", "scan_token"]