mirror of
https://github.com/bohd4nx/FragmentAPI.git
synced 2026-07-25 06:14:29 +00:00
d2d046a2b9
- Rename app/ → fragmentapi/ for proper package naming - Add FragmentClient class with gift_premium, gift_stars, topup_ton methods - Restructure core/ → types/ (exceptions, results, constants) - Merge utils/hash.py into utils/client.py - Replace _version.py with importlib.metadata - Add input validation with min/max bounds - Add unit tests: decode, client init/cookies - Rename 002_test_hash → 003_test_hash - Clean up pyproject.toml: pin deps, production classifiers
35 lines
775 B
Python
35 lines
775 B
Python
import time
|
|
from dataclasses import dataclass, field
|
|
|
|
__all__ = ["AdsTopupResult", "PremiumResult", "StarsResult"]
|
|
|
|
|
|
@dataclass
|
|
class PremiumResult:
|
|
"""Result of a successful Telegram Premium gift."""
|
|
|
|
transaction_id: str
|
|
username: str
|
|
months: int
|
|
timestamp: int = field(default_factory=lambda: int(time.time()))
|
|
|
|
|
|
@dataclass
|
|
class StarsResult:
|
|
"""Result of a successful Telegram Stars purchase."""
|
|
|
|
transaction_id: str
|
|
username: str
|
|
stars: int
|
|
timestamp: int = field(default_factory=lambda: int(time.time()))
|
|
|
|
|
|
@dataclass
|
|
class AdsTopupResult:
|
|
"""Result of a successful Telegram Ads balance top-up."""
|
|
|
|
transaction_id: str
|
|
username: str
|
|
amount: int
|
|
timestamp: int = field(default_factory=lambda: int(time.time()))
|