mirror of
https://github.com/bohd4nx/FragmentAPI.git
synced 2026-07-25 06:14:29 +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.
41 lines
987 B
Python
41 lines
987 B
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass
|
|
class WalletInfo:
|
|
address: str
|
|
state: str
|
|
ton_balance: float
|
|
usdt_balance: float
|
|
|
|
def __repr__(self) -> str:
|
|
return (
|
|
f"WalletInfo(address='{self.address}', state='{self.state}', "
|
|
f"ton_balance={self.ton_balance} TON, usdt_balance={self.usdt_balance} USDT)"
|
|
)
|
|
|
|
|
|
@dataclass
|
|
class TonTransferResult:
|
|
transaction_id: str
|
|
destination: str
|
|
amount: int
|
|
|
|
def __repr__(self) -> str:
|
|
return f"TonTransferResult(destination='{self.destination}', amount={self.amount} TON, tx='{self.transaction_id}')"
|
|
|
|
|
|
@dataclass
|
|
class UsdtTransferResult:
|
|
transaction_id: str
|
|
destination: str
|
|
amount: int
|
|
|
|
def __repr__(self) -> str:
|
|
return f"UsdtTransferResult(destination='{self.destination}', amount={self.amount} USDT, tx='{self.transaction_id}')"
|
|
|
|
|
|
__all__ = ["TonTransferResult", "UsdtTransferResult", "WalletInfo"]
|