INNER CODE UNIT · Python
PydanticOrderSchema
DogsTailFarmer/martin-binance · martin_binance/backup.py:61
class PydanticOrderSchema(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: int
buy: bool
amount: DecimalStr
order_type: str
received_amount: DecimalStr
price: DecimalStr
remaining_amount: DecimalStr
timestamp: int
def serialize_orders_to_json(orders_manager: Orders) -> Dict[str, Any]:
"""
Converts the Orders object into a JSON-compatible dictionary.
Preserves the list of orders and the tp_order_id attribute.
"""
return {