mirror of
https://github.com/bohd4nx/FragmentAPI.git
synced 2026-07-25 06:14:29 +00:00
8f865f4911
- Updated imports and references from TON to GRAM across multiple modules. - Renamed functions and variables to reflect the change from TON to GRAM. - Adjusted validation checks for top-up and recharge amounts to use GRAM limits. - Modified error messages and exceptions to indicate GRAM instead of TON. - Updated tests to ensure they reflect the new GRAM terminology and functionality. - Introduced new constants for GRAM-related configurations.
46 lines
1.1 KiB
Python
46 lines
1.1 KiB
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass
|
|
class PremiumResult:
|
|
transaction_id: str
|
|
username: str
|
|
amount: int
|
|
|
|
def __repr__(self) -> str:
|
|
return f"PremiumResult(username='{self.username}', amount={self.amount} months, tx='{self.transaction_id}')"
|
|
|
|
|
|
@dataclass
|
|
class StarsResult:
|
|
transaction_id: str
|
|
username: str
|
|
amount: int
|
|
|
|
def __repr__(self) -> str:
|
|
return f"StarsResult(username='{self.username}', amount={self.amount} stars, tx='{self.transaction_id}')"
|
|
|
|
|
|
@dataclass
|
|
class AdsTopupResult:
|
|
transaction_id: str
|
|
username: str
|
|
amount: int
|
|
|
|
def __repr__(self) -> str:
|
|
return f"AdsTopupResult(username='{self.username}', amount={self.amount} GRAM (ex TON), tx='{self.transaction_id}')"
|
|
|
|
|
|
@dataclass
|
|
class AdsRechargeResult:
|
|
transaction_id: str
|
|
amount: int
|
|
|
|
def __repr__(self) -> str:
|
|
return f"AdsRechargeResult(amount={self.amount} GRAM (ex TON), tx='{self.transaction_id}')"
|
|
|
|
|
|
__all__ = ["AdsRechargeResult", "AdsTopupResult", "PremiumResult", "StarsResult"]
|