Integrations
FastAPI Integration
HACK is designed FastAPI-first. See the Quick Start for the minimal wiring, and Middleware for router-level protection.
Router-level example
python
from fastapi import APIRouter
from hack.toolkit import PaidEndpoint
router = APIRouter(prefix="/api/premium")
@router.post("/query")
@PaidEndpoint(price="0.5 HBAR")
async def query(...):
...
@router.post("/report")
@PaidEndpoint(price="1 HBAR")
async def report(...):
...