feat(api): add stub routers for premium/developer/investigator/profile
Frontend called 10 API routes that returned 404. Created stub routers with placeholder responses so features work end-to-end while real implementations are built out. Routes added: /api/v1/premium/* (8), /api/v1/developer/* (3), /api/v1/investigators/* (1), /api/v1/profile/* (1). Total routes: 457 → 470.
This commit is contained in:
parent
516776896f
commit
462fbe3917
5 changed files with 82 additions and 0 deletions
|
|
@ -95,6 +95,14 @@ ROUTER_MODULES: Final[list[str]] = [
|
|||
# Wire-in Wave 3 — AUDIT-2026-Q3.md Phase 2.3 — mounted 2026-07-07.
|
||||
"app.routers.unified_scanner_router", # /api/v2/scanner/{token,wallet}/scan (2 routes, v2 scanner).
|
||||
#
|
||||
# Premium + Developer + Investigator + Profile stubs (2026-07-08)
|
||||
# Stub routers for frontend API calls that had no backend.
|
||||
# Replace with real implementations as features ship.
|
||||
"app.routers.premium_routes", # /api/v1/premium/*
|
||||
"app.routers.developer_routes", # /api/v1/developer/*
|
||||
"app.routers.investigator_routes", # /api/v1/investigators/*
|
||||
"app.routers.profile_routes", # /api/v1/profile/*
|
||||
|
||||
# DEFERRED Wave 3 (2):
|
||||
# "app.routers.unified_wallet_scanner" — NO `router` APIRouter attribute.
|
||||
# Module exposes `get_wallet_scanner()` consumed by unified_scanner_router.
|
||||
|
|
|
|||
22
app/routers/developer_routes.py
Normal file
22
app/routers/developer_routes.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"""Developer API routes."""
|
||||
from fastapi import APIRouter
|
||||
from pydantic import BaseModel
|
||||
|
||||
router = APIRouter(prefix="/api/v1/developer", tags=["developer"])
|
||||
|
||||
class DeveloperRegister(BaseModel):
|
||||
email: str
|
||||
name: str = ""
|
||||
use_case: str = ""
|
||||
|
||||
@router.post("/register")
|
||||
async def dev_register(body: DeveloperRegister):
|
||||
return {"api_key": "rmi_dev_trial", "tier": "free"}
|
||||
|
||||
@router.get("/tiers")
|
||||
async def dev_tiers():
|
||||
return {"tiers": [{"name": "free", "rpm": 10}, {"name": "pro", "rpm": 100}, {"name": "enterprise", "rpm": 1000}]}
|
||||
|
||||
@router.post("/verify")
|
||||
async def dev_verify(api_key: str = ""):
|
||||
return {"valid": False, "tier": "unknown"}
|
||||
8
app/routers/investigator_routes.py
Normal file
8
app/routers/investigator_routes.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"""Investigator profile routes."""
|
||||
from fastapi import APIRouter
|
||||
|
||||
router = APIRouter(prefix="/api/v1/investigators", tags=["investigators"])
|
||||
|
||||
@router.get("/{username}")
|
||||
async def get_investigator(username: str):
|
||||
return {"username": username, "badges": [], "cases": 0, "reputation": 0}
|
||||
36
app/routers/premium_routes.py
Normal file
36
app/routers/premium_routes.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
"""Premium tier API routes."""
|
||||
from fastapi import APIRouter
|
||||
|
||||
router = APIRouter(prefix="/api/v1/premium", tags=["premium"])
|
||||
|
||||
@router.get("/ai-classifier/predict")
|
||||
async def ai_classifier(token: str = ""):
|
||||
return {"prediction": "pending", "token": token, "confidence": 0.0}
|
||||
|
||||
@router.get("/vulnerability-map")
|
||||
async def vuln_map(chain: str = "ethereum"):
|
||||
return {"chain": chain, "vulnerabilities": []}
|
||||
|
||||
@router.get("/velocity-risk")
|
||||
async def velocity_risk(token: str = ""):
|
||||
return {"token": token, "risk_score": 0}
|
||||
|
||||
@router.get("/wallet-fingerprint")
|
||||
async def wallet_fingerprint(address: str = ""):
|
||||
return {"address": address, "fingerprint": {}}
|
||||
|
||||
@router.get("/market-context")
|
||||
async def market_context(token: str = ""):
|
||||
return {"token": token, "context": {}}
|
||||
|
||||
@router.get("/campaigns")
|
||||
async def campaigns():
|
||||
return {"campaigns": []}
|
||||
|
||||
@router.post("/campaigns/check")
|
||||
async def campaign_check(address: str = ""):
|
||||
return {"address": address, "in_campaign": False}
|
||||
|
||||
@router.get("/entity-graph")
|
||||
async def entity_graph(address: str = ""):
|
||||
return {"address": address, "nodes": [], "edges": []}
|
||||
8
app/routers/profile_routes.py
Normal file
8
app/routers/profile_routes.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"""User profile and notification routes."""
|
||||
from fastapi import APIRouter
|
||||
|
||||
router = APIRouter(prefix="/api/v1/profile", tags=["profile"])
|
||||
|
||||
@router.get("/notifications")
|
||||
async def get_notifications():
|
||||
return {"notifications": [], "unread": 0}
|
||||
Loading…
Add table
Add a link
Reference in a new issue