mirror of
https://github.com/bohd4nx/FragmentAPI.git
synced 2026-07-25 14:24:31 +00:00
ae164d4fe7
- Added MarketplaceService for searching usernames, numbers, and gifts. - Introduced PurchasesService for purchasing stars and premium subscriptions. - Created WalletService for wallet operations including balance checks and top-ups. - Developed transaction handling for TON and USDT transfers. - Added models for payments, marketplace results, and wallet information. - Implemented error handling for various operations including wallet and transaction errors. - Established domain structure for purchases, marketplace, and wallet functionalities.
46 lines
1.0 KiB
Python
46 lines
1.0 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} TON, tx='{self.transaction_id}')"
|
|
|
|
|
|
@dataclass
|
|
class AdsRechargeResult:
|
|
transaction_id: str
|
|
amount: int
|
|
|
|
def __repr__(self) -> str:
|
|
return f"AdsRechargeResult(amount={self.amount} TON, tx='{self.transaction_id}')"
|
|
|
|
|
|
__all__ = ["AdsRechargeResult", "AdsTopupResult", "PremiumResult", "StarsResult"]
|