2025-10-03 22:27:30 +02:00
|
|
|
from fastapi import APIRouter
|
|
|
|
|
|
2026-02-16 19:10:21 +04:00
|
|
|
from . import blocks, fork_choice, health, index, transactions
|
2025-10-03 22:27:30 +02:00
|
|
|
|
|
|
|
|
|
2025-10-20 15:42:12 +02:00
|
|
|
def create_v1_router() -> APIRouter:
|
2025-12-19 10:11:49 +01:00
|
|
|
"""
|
|
|
|
|
Route order must be preserved.
|
|
|
|
|
"""
|
2025-10-20 15:42:12 +02:00
|
|
|
router = APIRouter()
|
|
|
|
|
|
|
|
|
|
router.add_api_route("/", index.index, methods=["GET", "HEAD"])
|
|
|
|
|
|
|
|
|
|
router.add_api_route("/health/stream", health.stream, methods=["GET", "HEAD"])
|
2025-12-19 10:11:49 +01:00
|
|
|
router.add_api_route("/health", health.get, methods=["GET", "HEAD"])
|
2025-10-20 15:42:12 +02:00
|
|
|
|
|
|
|
|
router.add_api_route("/transactions/stream", transactions.stream, methods=["GET"])
|
2026-02-16 23:58:06 +04:00
|
|
|
router.add_api_route("/transactions/list", transactions.list_transactions, methods=["GET"])
|
2025-12-19 10:11:49 +01:00
|
|
|
router.add_api_route("/transactions/{transaction_hash:str}", transactions.get, methods=["GET"])
|
2025-10-20 15:42:12 +02:00
|
|
|
|
2026-02-16 19:10:21 +04:00
|
|
|
router.add_api_route("/fork-choice", fork_choice.get, methods=["GET"])
|
|
|
|
|
|
2025-10-20 15:42:12 +02:00
|
|
|
router.add_api_route("/blocks/stream", blocks.stream, methods=["GET"])
|
2026-02-05 12:41:42 +04:00
|
|
|
router.add_api_route("/blocks/list", blocks.list_blocks, methods=["GET"])
|
2025-12-19 10:11:49 +01:00
|
|
|
router.add_api_route("/blocks/{block_hash:str}", blocks.get, methods=["GET"])
|
2025-10-20 15:42:12 +02:00
|
|
|
|
|
|
|
|
return router
|