mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-22 06:21:53 +01:00
cleanup/fix breaking imports
This commit is contained in:
parent
4739a0811d
commit
cf23e56dc5
4 changed files with 54 additions and 71 deletions
|
@ -1,19 +1,17 @@
|
||||||
import json
|
|
||||||
import time
|
|
||||||
|
|
||||||
from datetime import datetime
|
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
from lnbits.decorators import check_user_exists, WalletTypeInfo, get_key_type
|
|
||||||
from . import jukebox_ext, jukebox_renderer
|
from fastapi import Request
|
||||||
from .crud import get_jukebox
|
|
||||||
from fastapi import FastAPI, Request
|
|
||||||
from fastapi.params import Depends
|
from fastapi.params import Depends
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
from starlette.exceptions import HTTPException
|
from starlette.exceptions import HTTPException
|
||||||
from starlette.responses import HTMLResponse
|
from starlette.responses import HTMLResponse
|
||||||
from lnbits.core.models import User, Payment
|
|
||||||
from .views_api import api_get_jukebox_device_check
|
|
||||||
|
|
||||||
|
from lnbits.core.models import User
|
||||||
|
from lnbits.decorators import WalletTypeInfo, check_user_exists, get_key_type
|
||||||
|
|
||||||
|
from . import jukebox_ext, jukebox_renderer
|
||||||
|
from .crud import get_jukebox
|
||||||
|
from .views_api import api_get_jukebox_device_check
|
||||||
|
|
||||||
templates = Jinja2Templates(directory="templates")
|
templates = Jinja2Templates(directory="templates")
|
||||||
|
|
||||||
|
|
|
@ -1,34 +1,30 @@
|
||||||
from fastapi import Request
|
import base64
|
||||||
|
import json
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
from fastapi import Request
|
||||||
|
from fastapi.param_functions import Query
|
||||||
|
from fastapi.params import Depends
|
||||||
from starlette.exceptions import HTTPException
|
from starlette.exceptions import HTTPException
|
||||||
from starlette.responses import HTMLResponse, JSONResponse # type: ignore
|
from starlette.responses import HTMLResponse, JSONResponse # type: ignore
|
||||||
import base64
|
|
||||||
from lnbits.core.crud import get_wallet
|
from lnbits.core.crud import get_wallet
|
||||||
from lnbits.core.services import create_invoice, check_invoice_status
|
from lnbits.core.services import check_invoice_status, create_invoice
|
||||||
import json
|
from lnbits.decorators import WalletTypeInfo, get_key_type
|
||||||
from typing import Optional
|
|
||||||
from fastapi.params import Depends
|
|
||||||
from fastapi.param_functions import Query
|
|
||||||
from .models import CreateJukeLinkData, CreateJukeboxPayment
|
|
||||||
from lnbits.decorators import (
|
|
||||||
check_user_exists,
|
|
||||||
WalletTypeInfo,
|
|
||||||
get_key_type,
|
|
||||||
api_validate_post_request,
|
|
||||||
)
|
|
||||||
import httpx
|
|
||||||
from . import jukebox_ext
|
from . import jukebox_ext
|
||||||
from .crud import (
|
from .crud import (
|
||||||
create_jukebox,
|
create_jukebox,
|
||||||
update_jukebox,
|
|
||||||
get_jukebox,
|
|
||||||
get_jukeboxs,
|
|
||||||
delete_jukebox,
|
|
||||||
create_jukebox_payment,
|
create_jukebox_payment,
|
||||||
|
delete_jukebox,
|
||||||
|
get_jukebox,
|
||||||
get_jukebox_payment,
|
get_jukebox_payment,
|
||||||
|
get_jukeboxs,
|
||||||
|
update_jukebox,
|
||||||
update_jukebox_payment,
|
update_jukebox_payment,
|
||||||
)
|
)
|
||||||
|
from .models import CreateJukeboxPayment, CreateJukeLinkData
|
||||||
|
|
||||||
|
|
||||||
@jukebox_ext.get("/api/v1/jukebox")
|
@jukebox_ext.get("/api/v1/jukebox")
|
||||||
|
|
|
@ -1,35 +1,28 @@
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl # type: ignore
|
|
||||||
from http import HTTPStatus
|
from fastapi import Request
|
||||||
from starlette.exceptions import HTTPException
|
|
||||||
from starlette.responses import HTMLResponse, JSONResponse # type: ignore
|
|
||||||
from lnbits.core.crud import get_user
|
|
||||||
from lnbits.decorators import api_validate_post_request
|
|
||||||
from .models import CreateSatsDiceLink, CreateSatsDiceWithdraws, CreateSatsDicePayment
|
|
||||||
from . import satsdice_ext
|
|
||||||
from fastapi import FastAPI, Request
|
|
||||||
from fastapi.params import Depends
|
|
||||||
from typing import Optional
|
|
||||||
from fastapi.param_functions import Query
|
from fastapi.param_functions import Query
|
||||||
|
from fastapi.params import Depends
|
||||||
|
from lnurl.exceptions import InvalidUrl as LnurlInvalidUrl # type: ignore
|
||||||
|
from starlette.exceptions import HTTPException
|
||||||
|
|
||||||
|
from lnbits.core.crud import get_user
|
||||||
|
from lnbits.decorators import WalletTypeInfo, get_key_type
|
||||||
|
|
||||||
|
from . import satsdice_ext
|
||||||
from .crud import (
|
from .crud import (
|
||||||
create_satsdice_pay,
|
create_satsdice_pay,
|
||||||
|
create_satsdice_withdraw,
|
||||||
|
delete_satsdice_pay,
|
||||||
|
delete_satsdice_withdraw,
|
||||||
get_satsdice_pay,
|
get_satsdice_pay,
|
||||||
get_satsdice_pays,
|
get_satsdice_pays,
|
||||||
update_satsdice_pay,
|
|
||||||
delete_satsdice_pay,
|
|
||||||
create_satsdice_withdraw,
|
|
||||||
get_satsdice_withdraw,
|
get_satsdice_withdraw,
|
||||||
get_satsdice_withdraws,
|
get_satsdice_withdraws,
|
||||||
|
update_satsdice_pay,
|
||||||
update_satsdice_withdraw,
|
update_satsdice_withdraw,
|
||||||
delete_satsdice_withdraw,
|
|
||||||
create_withdraw_hash_check,
|
|
||||||
)
|
|
||||||
from lnbits.decorators import (
|
|
||||||
check_user_exists,
|
|
||||||
WalletTypeInfo,
|
|
||||||
get_key_type,
|
|
||||||
api_validate_post_request,
|
|
||||||
)
|
)
|
||||||
|
from .models import CreateSatsDiceLink, CreateSatsDiceWithdraws
|
||||||
|
|
||||||
################LNURL pay
|
################LNURL pay
|
||||||
|
|
||||||
|
|
|
@ -1,29 +1,25 @@
|
||||||
import json
|
|
||||||
import httpx
|
|
||||||
import base64
|
import base64
|
||||||
from .crud import get_targets, set_targets
|
import json
|
||||||
from .models import Target, TargetPut
|
|
||||||
from fastapi import Request
|
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
from typing import Optional
|
||||||
|
|
||||||
|
import httpx
|
||||||
|
from fastapi import Request
|
||||||
|
from fastapi.param_functions import Query
|
||||||
|
from fastapi.params import Depends
|
||||||
from starlette.exceptions import HTTPException
|
from starlette.exceptions import HTTPException
|
||||||
from starlette.responses import HTMLResponse, JSONResponse # type: ignore
|
from starlette.responses import HTMLResponse, JSONResponse # type: ignore
|
||||||
from typing import Optional
|
|
||||||
from fastapi.params import Depends
|
|
||||||
from fastapi.param_functions import Query
|
|
||||||
from . import splitpayments_ext
|
|
||||||
from lnbits.decorators import (
|
|
||||||
check_user_exists,
|
|
||||||
WalletTypeInfo,
|
|
||||||
get_key_type,
|
|
||||||
api_validate_post_request,
|
|
||||||
WalletAdminKeyChecker,
|
|
||||||
WalletInvoiceKeyChecker,
|
|
||||||
)
|
|
||||||
from lnbits.core.crud import get_wallet, get_wallet_for_key
|
from lnbits.core.crud import get_wallet, get_wallet_for_key
|
||||||
|
from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key
|
||||||
|
|
||||||
|
from . import splitpayments_ext
|
||||||
|
from .crud import get_targets, set_targets
|
||||||
|
from .models import Target, TargetPut
|
||||||
|
|
||||||
|
|
||||||
@splitpayments_ext.get("/api/v1/targets")
|
@splitpayments_ext.get("/api/v1/targets")
|
||||||
async def api_targets_get(wallet: WalletTypeInfo = Depends(WalletAdminKeyChecker())):
|
async def api_targets_get(wallet: WalletTypeInfo = Depends(require_admin_key)):
|
||||||
print(wallet)
|
print(wallet)
|
||||||
targets = await get_targets(wallet.wallet.id)
|
targets = await get_targets(wallet.wallet.id)
|
||||||
return [target.dict() for target in targets] or []
|
return [target.dict() for target in targets] or []
|
||||||
|
@ -31,7 +27,7 @@ async def api_targets_get(wallet: WalletTypeInfo = Depends(WalletAdminKeyChecker
|
||||||
|
|
||||||
@splitpayments_ext.put("/api/v1/targets")
|
@splitpayments_ext.put("/api/v1/targets")
|
||||||
async def api_targets_set(
|
async def api_targets_set(
|
||||||
data: TargetPut, wallet: WalletTypeInfo = Depends(WalletAdminKeyChecker())
|
data: TargetPut, wallet: WalletTypeInfo = Depends(require_admin_key)
|
||||||
):
|
):
|
||||||
targets = []
|
targets = []
|
||||||
for entry in data.targets:
|
for entry in data.targets:
|
||||||
|
|
Loading…
Add table
Reference in a new issue