Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
style: format api/api.py with black 26.5.1
  • Loading branch information
devin-ai-integration[bot] committed Jul 1, 2026
commit 734a5ade0ae9c4f824f7db78b318b4338aa09167
36 changes: 24 additions & 12 deletions api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
# MIDDLEWARE
# =========================


@app.before_request
def before_request_handler():
g.request_id = request.headers.get("X-Request-ID", uuid.uuid4().hex)
Expand Down Expand Up @@ -107,6 +108,7 @@ def handle_500(e):
# HEALTH (enhanced)
# =========================


@v1.route("/health")
def health():
subsystems = {
Expand All @@ -117,13 +119,15 @@ def health():
"database": _check_db(),
}
all_ok = all(s["status"] == "ok" for s in subsystems.values())
return jsonify({
"status": "online" if all_ok else "degraded",
"engine": "WEB4_BLACK_MUCIZEWORK",
"version": API_VERSION,
"subsystems": subsystems,
"timestamp": time.time(),
})
return jsonify(
{
"status": "online" if all_ok else "degraded",
"engine": "WEB4_BLACK_MUCIZEWORK",
"version": API_VERSION,
"subsystems": subsystems,
"timestamp": time.time(),
}
)


def _check_graph():
Expand Down Expand Up @@ -169,6 +173,7 @@ def _check_db():
# GRAPH
# =========================


@v1.route("/graph")
def graph():
return jsonify(cluster.graph())
Expand All @@ -178,6 +183,7 @@ def graph():
# RADAR
# =========================


@v1.route("/radar")
def get_radar():
return jsonify(radar.scan())
Expand All @@ -187,6 +193,7 @@ def get_radar():
# FUNDING (with wallet path param)
# =========================


@v1.route("/funding/<wallet>")
def get_funding(wallet):
data = funding.trace(wallet=wallet)
Expand All @@ -203,6 +210,7 @@ def get_funding_all():
# FLOW
# =========================


@v1.route("/flow", methods=["POST"])
def flow():
data = request.json
Expand All @@ -219,6 +227,7 @@ def flow():
# HASH (SHA256)
# =========================


@v1.route("/hash/sha256", methods=["POST"])
def hash_sha256():
data = request.json
Expand All @@ -233,6 +242,7 @@ def hash_sha256():
# SIGN / VERIFY
# =========================


@v1.route("/sign/verify", methods=["POST"])
def sign_verify():
data = request.json
Expand All @@ -243,11 +253,13 @@ def sign_verify():
if missing:
return error_response(422, f"Eksik alanlar: {', '.join(missing)}")
result = sig.verify(data["wallet"], data["message"], data["signature"])
return jsonify({
"valid": result["valid"],
"hash": result["hash"],
"wallet": data["wallet"],
})
return jsonify(
{
"valid": result["valid"],
"hash": result["hash"],
"wallet": data["wallet"],
}
)


# =========================
Expand Down
Loading