mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-03-13 19:37:42 +01:00
fix: syntax errors
This commit is contained in:
parent
a6f0a36664
commit
d20c3ce119
10 changed files with 32 additions and 13 deletions
|
@ -1,4 +1,4 @@
|
||||||
from pydantic.types import constr
|
from pydantic import BaseModel
|
||||||
import trio
|
import trio
|
||||||
import json
|
import json
|
||||||
import httpx
|
import httpx
|
||||||
|
@ -440,7 +440,7 @@ async def api_lnurlscan(code: str):
|
||||||
return params
|
return params
|
||||||
|
|
||||||
|
|
||||||
@core_app.post("/api/v1/lnurlauth", methods=["POST"])
|
@core_app.post("/api/v1/lnurlauth")
|
||||||
@api_check_wallet_key("admin")
|
@api_check_wallet_key("admin")
|
||||||
async def api_perform_lnurlauth(callback: str):
|
async def api_perform_lnurlauth(callback: str):
|
||||||
err = await perform_lnurlauth(callback)
|
err = await perform_lnurlauth(callback)
|
||||||
|
|
|
@ -7,6 +7,7 @@ from . import bleskomat_ext
|
||||||
from .exchange_rates import exchange_rate_providers_serializable, fiat_currencies
|
from .exchange_rates import exchange_rate_providers_serializable, fiat_currencies
|
||||||
from .helpers import get_callback_url
|
from .helpers import get_callback_url
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
|
from fastapi import Request
|
||||||
|
|
||||||
templates = Jinja2Templates(directory="templates")
|
templates = Jinja2Templates(directory="templates")
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
from typing import Union
|
||||||
|
from fastapi.param_functions import Query
|
||||||
|
from pydantic import BaseModel
|
||||||
from quart import g, jsonify, request
|
from quart import g, jsonify, request
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
||||||
|
@ -50,9 +53,9 @@ async def api_bleskomat_retrieve(bleskomat_id):
|
||||||
|
|
||||||
class CreateData(BaseModel):
|
class CreateData(BaseModel):
|
||||||
name: str
|
name: str
|
||||||
fiat_currency: str = fiat_currencies.keys()
|
fiat_currency: str = "EUR" # TODO: fix this
|
||||||
exchange_rate_provider: str = exchange_rate_providers.keys()
|
exchange_rate_provider: str = "bitfinex"
|
||||||
fee: Optional[str, int, float] = Query(...)
|
fee: Union[str, int, float] = Query(...)
|
||||||
|
|
||||||
@bleskomat_ext.post("/api/v1/bleskomat")
|
@bleskomat_ext.post("/api/v1/bleskomat")
|
||||||
@bleskomat_ext.put("/api/v1/bleskomat/<bleskomat_id>")
|
@bleskomat_ext.put("/api/v1/bleskomat/<bleskomat_id>")
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
from typing import Optional
|
||||||
|
from fastapi.param_functions import Query
|
||||||
|
from pydantic.main import BaseModel
|
||||||
from quart import g, jsonify, request
|
from quart import g, jsonify, request
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl # type: ignore
|
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl # type: ignore
|
||||||
|
@ -60,10 +63,10 @@ async def api_link_retrieve(link_id):
|
||||||
|
|
||||||
class CreateData(BaseModel):
|
class CreateData(BaseModel):
|
||||||
description: str
|
description: str
|
||||||
min: int = Query(ge=0.01)
|
min: int = Query(0.01, ge=0.01)
|
||||||
max: int = Query(ge=0.01)
|
max: int = Query(0.01, ge=0.01)
|
||||||
currency: Optional[str]
|
currency: Optional[str]
|
||||||
comment_chars: int = Query(ge=0, lt=800)
|
comment_chars: int = Query(0, ge=0, lt=800)
|
||||||
webhook_url: Optional[str]
|
webhook_url: Optional[str]
|
||||||
success_text: Optional[str]
|
success_text: Optional[str]
|
||||||
success_url: Optional[str]
|
success_url: Optional[str]
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
from typing import Optional
|
||||||
|
from pydantic.main import BaseModel
|
||||||
from quart import g, jsonify
|
from quart import g, jsonify
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl # type: ignore
|
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl # type: ignore
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
from typing import List, Optional
|
||||||
|
from pydantic import BaseModel
|
||||||
from quart import g, jsonify
|
from quart import g, jsonify
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
||||||
|
@ -22,7 +24,8 @@ class SchemaData(BaseModel):
|
||||||
|
|
||||||
@splitpayments_ext.put("/api/v1/targets")
|
@splitpayments_ext.put("/api/v1/targets")
|
||||||
@api_check_wallet_key("admin")
|
@api_check_wallet_key("admin")
|
||||||
async def api_targets_set(targets: Optional(list[SchemaData]) = None):
|
async def api_targets_set(targets: Optional[List[SchemaData]]
|
||||||
|
= None):
|
||||||
targets = []
|
targets = []
|
||||||
|
|
||||||
for entry in targets:
|
for entry in targets:
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
from typing import Optional
|
||||||
|
from pydantic.main import BaseModel
|
||||||
from quart import g, redirect, request, jsonify
|
from quart import g, redirect, request, jsonify
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
||||||
|
@ -34,7 +36,7 @@ class CreateServicesData(BaseModel):
|
||||||
|
|
||||||
@streamalerts_ext.post("/api/v1/services")
|
@streamalerts_ext.post("/api/v1/services")
|
||||||
@api_check_wallet_key("invoice")
|
@api_check_wallet_key("invoice")
|
||||||
async def api_create_service(data: CreateData):
|
async def api_create_service(data: CreateServicesData):
|
||||||
"""Create a service, which holds data about how/where to post donations"""
|
"""Create a service, which holds data about how/where to post donations"""
|
||||||
try:
|
try:
|
||||||
service = await create_service(**data)
|
service = await create_service(**data)
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
from typing import Optional
|
||||||
|
from fastapi.param_functions import Query
|
||||||
|
from pydantic.main import BaseModel
|
||||||
from quart import g, jsonify, request
|
from quart import g, jsonify, request
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
||||||
|
@ -42,7 +45,7 @@ class CreateDomainsData(BaseModel):
|
||||||
domain: str
|
domain: str
|
||||||
cf_token: str
|
cf_token: str
|
||||||
cf_zone_id: str
|
cf_zone_id: str
|
||||||
webhook: optional[str]
|
webhook: Optional[str]
|
||||||
description: str
|
description: str
|
||||||
cost: int
|
cost: int
|
||||||
allowed_record_types: str
|
allowed_record_types: str
|
||||||
|
@ -103,7 +106,7 @@ class CreateDomainsData(BaseModel):
|
||||||
subdomain: str
|
subdomain: str
|
||||||
email: str
|
email: str
|
||||||
ip: str
|
ip: str
|
||||||
sats: int = Query(ge=0)
|
sats: int = Query(0, ge=0)
|
||||||
duration: int
|
duration: int
|
||||||
record_type: str
|
record_type: str
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ from quart import g, render_template
|
||||||
from lnbits.decorators import check_user_exists, validate_uuids
|
from lnbits.decorators import check_user_exists, validate_uuids
|
||||||
|
|
||||||
from . import usermanager_ext
|
from . import usermanager_ext
|
||||||
from fastapi import FastAPI, Request
|
from fastapi import Request
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
|
|
||||||
templates = Jinja2Templates(directory="templates")
|
templates = Jinja2Templates(directory="templates")
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
from typing import Optional
|
||||||
|
from pydantic.main import BaseModel
|
||||||
from quart import g, jsonify
|
from quart import g, jsonify
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue