|
|
@ -9,6 +9,7 @@ from lnbits.core.crud import delete_expired_invoices |
|
|
|
from lnbits.decorators import api_check_wallet_key, api_validate_post_request |
|
|
|
from lnbits.settings import WALLET, LNBITS_ADMIN_USERS |
|
|
|
|
|
|
|
|
|
|
|
@core_app.route("/api/v1/payments", methods=["GET"]) |
|
|
|
@api_check_wallet_key("invoice") |
|
|
|
def api_payments(): |
|
|
@ -122,15 +123,12 @@ def api_payment(payment_hash): |
|
|
|
|
|
|
|
return jsonify({"paid": False}), HTTPStatus.OK |
|
|
|
|
|
|
|
|
|
|
|
@core_app.route("/api/v1/balance", methods=["POST"]) |
|
|
|
@api_check_wallet_key("admin") |
|
|
|
@api_validate_post_request( |
|
|
|
schema={ |
|
|
|
"amount": {"type": "integer", "min": 1, "required": True} |
|
|
|
} |
|
|
|
) |
|
|
|
@api_validate_post_request(schema={"amount": {"type": "integer", "min": 1, "required": True}}) |
|
|
|
def api_update_balance(): |
|
|
|
print(g.wallet.user) |
|
|
|
if g.wallet.user in LNBITS_ADMIN_USERS: |
|
|
|
return update_wallet_balance(g.wallet.id, g.data["amount"]) |
|
|
|
return jsonify({"message": "Not an admin wallet"}), HTTPStatus.INTERNAL_SERVER_ERROR |
|
|
|
return jsonify({"message": "Not an admin wallet"}), HTTPStatus.INTERNAL_SERVER_ERROR |
|
|
|