mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-25 19:36:15 +02:00
feat: make endpoints compatible with cashu
client
This commit is contained in:
@@ -206,7 +206,7 @@ async def api_cashu_check_invoice(cashu_id: str, payment_hash: str):
|
|||||||
########################################
|
########################################
|
||||||
|
|
||||||
|
|
||||||
@cashu_ext.get("/api/v1/mint/keys/{cashu_id}", status_code=HTTPStatus.OK)
|
@cashu_ext.get("/api/v1/mint/{cashu_id}/keys", status_code=HTTPStatus.OK)
|
||||||
async def keys(
|
async def keys(
|
||||||
cashu_id: str = Query(False), wallet: WalletTypeInfo = Depends(get_key_type)
|
cashu_id: str = Query(False), wallet: WalletTypeInfo = Depends(get_key_type)
|
||||||
):
|
):
|
||||||
@@ -219,7 +219,7 @@ async def keys(
|
|||||||
return get_pubkeys(mint.prvkey)
|
return get_pubkeys(mint.prvkey)
|
||||||
|
|
||||||
|
|
||||||
@cashu_ext.get("/api/v1/mint/{cashu_id}")
|
@cashu_ext.get("/api/v1/{cashu_id}/mint")
|
||||||
async def mint_pay_request(
|
async def mint_pay_request(
|
||||||
amount: int = 0,
|
amount: int = 0,
|
||||||
cashu_id: str = Query(None),
|
cashu_id: str = Query(None),
|
||||||
@@ -253,7 +253,7 @@ async def mint_pay_request(
|
|||||||
return {"pr": payment_request, "hash": payment_hash}
|
return {"pr": payment_request, "hash": payment_hash}
|
||||||
|
|
||||||
|
|
||||||
@cashu_ext.post("/api/v1/mint/{cashu_id}")
|
@cashu_ext.post("/api/v1/{cashu_id}/mint")
|
||||||
async def mint_coins(
|
async def mint_coins(
|
||||||
data: MintPayloads,
|
data: MintPayloads,
|
||||||
cashu_id: str = Query(None),
|
cashu_id: str = Query(None),
|
||||||
@@ -311,7 +311,7 @@ async def mint_coins(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@cashu_ext.post("/api/v1/melt/{cashu_id}")
|
@cashu_ext.post("/api/v1/{cashu_id}/melt")
|
||||||
async def melt_coins(payload: MeltPayload, cashu_id: str = Query(None)):
|
async def melt_coins(payload: MeltPayload, cashu_id: str = Query(None)):
|
||||||
cashu: Cashu = await get_cashu(cashu_id)
|
cashu: Cashu = await get_cashu(cashu_id)
|
||||||
if cashu is None:
|
if cashu is None:
|
||||||
|
Reference in New Issue
Block a user