From 930ebfd6cca888d0ceacc20178391b1af1200c92 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Thu, 24 Nov 2022 15:17:20 +0100 Subject: [PATCH] clean up for merge --- .../cashu/templates/cashu/index.html | 4 +- lnbits/extensions/cashu/views.py | 6 - lnbits/extensions/cashu/views_api.py | 281 ------------------ 3 files changed, 2 insertions(+), 289 deletions(-) diff --git a/lnbits/extensions/cashu/templates/cashu/index.html b/lnbits/extensions/cashu/templates/cashu/index.html index 6c69da93..eb90b2c1 100644 --- a/lnbits/extensions/cashu/templates/cashu/index.html +++ b/lnbits/extensions/cashu/templates/cashu/index.html @@ -122,7 +122,7 @@ :options="g.user.walletOptions" label="Cashu wallet *" > - @@ -179,7 +179,7 @@ label="Coins that 'exist' in mint (optional)" placeholder="∞" > - + -->
invoice.amount: -# raise HTTPException( -# status_code=HTTPStatus.PAYMENT_REQUIRED, -# detail=f"Requested amount too high: {total_requested}. Invoice amount: {invoice.amount}", -# ) - -# status: PaymentStatus = await check_transaction_status(cashu.wallet, payment_hash) -# # todo: revert to: status.paid != True: -# if status.paid != True: -# raise HTTPException( -# status_code=HTTPStatus.PAYMENT_REQUIRED, detail="Invoice not paid." -# ) -# try: -# await update_lightning_invoice(cashu_id, payment_hash, True) - -# amounts = [] -# B_s = [] -# for payload in data.blinded_messages: -# amounts.append(payload.amount) -# B_s.append(PublicKey(bytes.fromhex(payload.B_), raw=True)) - -# promises = await generate_promises(cashu.prvkey, amounts, B_s) -# for amount, B_, p in zip(amounts, B_s, promises): -# await store_promise(amount, B_.serialize().hex(), p.C_, cashu_id) - -# return promises -# except Exception as e: -# logger.error(e) -# raise HTTPException(status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(e)) - - -# @cashu_ext.post("/api/v1/{cashu_id}/melt") -# async def melt_coins(payload: MeltPayload, cashu_id: str = Query(None)): -# """Invalidates proofs and pays a Lightning invoice.""" -# cashu: Cashu = await get_cashu(cashu_id) -# if cashu is None: -# raise HTTPException( -# status_code=HTTPStatus.NOT_FOUND, detail="Mint does not exist." -# ) -# try: -# ok, preimage = await melt(cashu, payload.proofs, payload.invoice) -# return {"paid": ok, "preimage": preimage} -# except Exception as e: -# logger.error(e) -# raise HTTPException(status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(e)) - - -# @cashu_ext.post("/api/v1/{cashu_id}/check") -# async def check_spendable_coins(payload: CheckPayload, cashu_id: str = Query(None)): -# return await check_spendable(payload.proofs, cashu_id) - - -# @cashu_ext.post("/api/v1/{cashu_id}/split") -# async def split_proofs(payload: SplitRequest, cashu_id: str = Query(None)): -# """ -# Requetst a set of tokens with amount "total" to be split into two -# newly minted sets with amount "split" and "total-split". -# """ -# print("### RECEIVE") -# print("payload", json.dumps(payload, default=vars)) -# cashu: Cashu = await get_cashu(cashu_id) -# if cashu is None: -# raise HTTPException( -# status_code=HTTPStatus.NOT_FOUND, detail="Mint does not exist." -# ) -# proofs = payload.proofs -# amount = payload.amount -# outputs = payload.outputs.blinded_messages if payload.outputs else None -# try: -# split_return = await split(cashu, proofs, amount, outputs) -# except Exception as exc: -# raise CashuError(error=str(exc)) -# if not split_return: -# return {"error": "there was a problem with the split."} -# frst_promises, scnd_promises = split_return -# resp = PostSplitResponse(fst=frst_promises, snd=scnd_promises) -# print("### resp", json.dumps(resp, default=vars)) -# return resp - - -################################################################## -################################################################## -# CASHU LIB -##################################################################