mirror of
https://github.com/revanced/revanced-api.git
synced 2025-04-30 06:34:36 +02:00

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
37 lines
1.0 KiB
Python
37 lines
1.0 KiB
Python
"""
|
|
This module provides a blueprint for the donations endpoint.
|
|
|
|
Routes:
|
|
- GET /donations: Get ReVanced donation links and wallets.
|
|
"""
|
|
|
|
from sanic import Blueprint, Request
|
|
from sanic.response import JSONResponse, json
|
|
from sanic_ext import openapi
|
|
|
|
from api.models.donations import DonationsResponseModel
|
|
from config import api_version, wallets, links
|
|
|
|
donations: Blueprint = Blueprint("donations", version=api_version)
|
|
|
|
|
|
@donations.get("/donations")
|
|
@openapi.definition(
|
|
summary="Get ReVanced donation links and wallets",
|
|
response=[DonationsResponseModel],
|
|
)
|
|
async def root(request: Request) -> JSONResponse:
|
|
"""
|
|
Returns a JSONResponse with a dictionary containing ReVanced donation links and wallets.
|
|
|
|
**Returns:**
|
|
- JSONResponse: A Sanic JSONResponse instance containing a dictionary with the donation links and wallets.
|
|
"""
|
|
data: dict[str, dict] = {
|
|
"donations": {
|
|
"wallets": wallets,
|
|
"links": links,
|
|
}
|
|
}
|
|
return json(data, status=200)
|