fix bug
This commit is contained in:
@@ -6,6 +6,14 @@ from .models import Assets, OrderItem, Portfolio, PositionItem
|
||||
|
||||
|
||||
class PortfolioMixin:
|
||||
def org(self, datatype: str) -> list[dict[str, Any]]:
|
||||
"""查询 account、order、deal 或 position,返回原始字段字典列表。"""
|
||||
datatype = str(datatype).strip().lower()
|
||||
if datatype not in {"account", "order", "deal", "position"}:
|
||||
raise ValueError(f"unsupported org datatype: {datatype}")
|
||||
response = self._get_json(f"/api/portfolio/org/{datatype}")
|
||||
return response["data"]
|
||||
|
||||
def portfolio(self) -> Portfolio:
|
||||
data = self._get_json("/api/portfolio") or {}
|
||||
positions = {
|
||||
|
||||
Reference in New Issue
Block a user