Files
fund-tracer/backend/app/schemas/analysis.py

36 lines
647 B
Python
Raw Normal View History

2026-03-09 14:46:56 +08:00
"""Analysis response schemas."""
from decimal import Decimal
from pydantic import BaseModel
class AppSummary(BaseModel):
in_amount: Decimal
out_amount: Decimal
class AnalysisSummaryResponse(BaseModel):
total_out: Decimal
total_in: Decimal
net_loss: Decimal
by_app: dict[str, AppSummary]
counterparty_count: int
class FlowNode(BaseModel):
id: str
label: str
type: str | None = None # victim_app | counterparty
class FlowEdge(BaseModel):
source: str
target: str
amount: Decimal
count: int = 1
class FlowGraphResponse(BaseModel):
nodes: list[FlowNode]
edges: list[FlowEdge]