46 lines
No EOL
3.1 KiB
Python
46 lines
No EOL
3.1 KiB
Python
from pydantic import BaseModel, Field
|
|
from typing import List, Optional, Dict, Any
|
|
|
|
class CoinInfo(BaseModel):
|
|
availableToBorrow: Optional[str] = Field(None, description="Số lượng có thể vay")
|
|
bonus: Optional[str] = Field(None, description="Tiền thưởng")
|
|
accruedInterest: Optional[str] = Field(None, description="Lãi tích lũy")
|
|
availableToWithdraw: Optional[str] = Field(None, description="Số lượng có thể rút")
|
|
totalOrderIM: Optional[str] = Field(None, description="Initial margin cho lệnh")
|
|
equity: Optional[str] = Field(None, description="Tổng tài sản coin")
|
|
totalPositionMM: Optional[str] = Field(None, description="Maintenance margin cho vị thế")
|
|
usdValue: Optional[str] = Field(None, description="Giá trị USD của coin")
|
|
unrealisedPnl: Optional[str] = Field(None, description="Lãi/lỗ chưa chốt")
|
|
collateralSwitch: Optional[bool] = Field(None, description="Có dùng làm tài sản thế chấp không")
|
|
spotHedgingQty: Optional[str] = Field(None, description="Số lượng spot hedging")
|
|
borrowAmount: Optional[str] = Field(None, description="Số lượng đã vay")
|
|
totalPositionIM: Optional[str] = Field(None, description="Initial margin cho vị thế")
|
|
walletBalance: Optional[str] = Field(None, description="Số dư ví coin")
|
|
cumRealisedPnl: Optional[str] = Field(None, description="Lãi/lỗ đã chốt tích lũy")
|
|
locked: Optional[str] = Field(None, description="Số lượng bị khóa")
|
|
marginCollateral: Optional[bool] = Field(None, description="Có dùng làm tài sản margin không")
|
|
coin: str = Field(..., description="Mã coin")
|
|
|
|
class AccountInfo(BaseModel):
|
|
totalEquity: str = Field(..., description="Tổng tài sản quy USD")
|
|
accountIMRate: str = Field(..., description="Initial margin rate")
|
|
totalMarginBalance: str = Field(..., description="Tổng margin balance")
|
|
totalInitialMargin: str = Field(..., description="Tổng initial margin")
|
|
accountType: str = Field(..., description="Loại tài khoản (ví dụ: UNIFIED)")
|
|
totalAvailableBalance: str = Field(..., description="Tổng số dư khả dụng")
|
|
accountMMRate: str = Field(..., description="Maintenance margin rate")
|
|
totalPerpUPL: str = Field(..., description="Lãi/lỗ chưa chốt của perpetual")
|
|
totalWalletBalance: str = Field(..., description="Tổng số dư ví")
|
|
accountLTV: str = Field(..., description="Loan to value")
|
|
totalMaintenanceMargin: str = Field(..., description="Tổng maintenance margin")
|
|
coin: List[CoinInfo] = Field(..., description="Danh sách coin")
|
|
|
|
class ResultInfo(BaseModel):
|
|
list: List[AccountInfo] = Field(..., description="Danh sách tài khoản")
|
|
|
|
class AccountResponseSchema(BaseModel):
|
|
retCode: int = Field(..., description="Mã kết quả trả về (0 là thành công)")
|
|
retMsg: str = Field(..., description="Thông báo kết quả")
|
|
result: ResultInfo = Field(..., description="Kết quả chi tiết")
|
|
retExtInfo: Dict[str, Any] = Field(..., description="Thông tin mở rộng")
|
|
time: int = Field(..., description="Timestamp trả về") |