Files
FragmentAPI/pyfragment/types/results.py
T
bohd4nx 8135a9da7e Refactor FragmentAPI to pyfragment
- Renamed the package from `fragmentapi` to `pyfragment` across all modules and tests.
- Removed the old wallet utility functions and replaced them with new implementations.
- Updated the `pyproject.toml` to reflect the new package name and repository links.
- Adjusted all import statements in tests to use the new package name.
- Implemented new methods for gifting Telegram Premium, Stars, and topping up TON balance.
- Added exception handling for various error scenarios in the API interactions.
- Created new utility functions for handling HTTP requests and decoding payloads.
- Established a clear structure for types and constants used throughout the library.
2026-03-15 22:07:01 +02:00

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()))