[docs]classQueryAccountDataResponse(BaseModel):"""Model for the response of QueryAccountData. Args: code (int): Error code, 0 means successfully response, others means response failure. msg (str): Error details description. data (List[AccountData]): The response data. """code:intmsg:strdata:list["AccountData"]
[docs]classAccountData(BaseModel):"""Model for account data. Args: user_id (str): User ID. asset (str): Asset name, e.g., USDT. balance (str): Asset balance. equity (str): Net asset value. unrealized_profit (str): Unrealized profit and loss. realised_profit (str): Realized profit and loss. available_margin (str): Available margin. used_margin (str): Used margin. freezed_margin (str): Frozen margin. """user_id:str=Field(...,alias="userId")asset:strbalance:strequity:strunrealized_profit:str=Field(...,alias="unrealizedProfit")realised_profit:str=Field(...,alias="realisedProfit")available_margin:str=Field(...,alias="availableMargin")used_margin:str=Field(...,alias="usedMargin")freezed_margin:str=Field(...,alias="freezedMargin")
[docs]classQueryPositionDataResponse(BaseModel):"""Model for the response of QueryPositionData. Args: code (int): Error code, 0 means successfully response, others means response failure. msg (str): Error details description. data (List[PositionData]): The response data. """code:intmsg:strdata:list["PositionData"]
[docs]classPositionData(BaseModel):"""Model for position data. Args: position_id (str): Position ID. symbol (str): Trading pair, e.g., BNB-USDT. currency (str): Currency, e.g., USDT. position_amt (str): Position amount. available_amt (str): Available amount. position_side (str): Position direction (LONG/SHORT). isolated (bool): Whether it is isolated margin mode. avg_price (str): Average opening price. initial_margin (str): Initial margin. leverage (int): Leverage. unrealized_profit (str): Unrealized profit and loss. realised_profit (str): Realized profit and loss. liquidation_price (float): Liquidation price. """position_id:str=Field(...,alias="positionId")symbol:strcurrency:strposition_amt:str=Field(...,alias="positionAmt")available_amt:str=Field(...,alias="availableAmt")position_side:str=Field(...,alias="positionSide")isolated:boolavg_price:str=Field(...,alias="avgPrice")initial_margin:str=Field(...,alias="initialMargin")leverage:intunrealized_profit:str=Field(...,alias="unrealizedProfit")realised_profit:str=Field(...,alias="realisedProfit")liquidation_price:float=Field(...,alias="liquidationPrice")
[docs]classGetAccountProfitAndLossFundFlowResponse(BaseModel):"""Model for the response of GetAccountProfitAndLossFundFlow. Args: code (int): Error code, 0 means successfully response, others means response failure. msg (str): Error details description. data (List[FundFlowData]): The response data. """code:intmsg:strdata:list["FundFlowData"]
[docs]classFundFlowData(BaseModel):"""Model for fund flow data. Args: symbol (str): Trading pair, e.g., LDO-USDT. income_type (str): Income type, e.g., FUNDING_FEE. income (str): The amount of capital flow, positive numbers represent inflows, negative numbers represent outflows. asset (str): Asset content. info (str): Remarks, depending on the type of stream. time (int): Time, unit: millisecond. tran_id (str): Transfer ID. trade_id (str): The original transaction ID that caused the transaction. """symbol:strincome_type:str=Field(...,alias="incomeType")income:strasset:strinfo:strtime:inttran_id:str=Field(...,alias="tranId")trade_id:str=Field(...,alias="tradeId")
[docs]classSwapQueryTradingCommissionRateResponse(BaseModel):"""Model for the response of QueryTradingCommissionRate. Args: code (int): Error code, 0 means successfully response, others means response failure. msg (str): Error details description. data (CommissionData): The response data. """code:intmsg:strdata:"CommissionData"
[docs]classCommissionData(BaseModel):"""Model for commission data. Args: commission (CommissionDetails): Commission details. """commission:"CommissionDetails"