From 96018cee452b854fd7edd50accf61eab8e6b4058 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Mon, 26 Dec 2022 16:37:02 +0100 Subject: [PATCH] use receive function of cli --- cashu/wallet/cli.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/cashu/wallet/cli.py b/cashu/wallet/cli.py index 06a0863..8f39ba1 100644 --- a/cashu/wallet/cli.py +++ b/cashu/wallet/cli.py @@ -457,17 +457,12 @@ async def nostr(ctx): await asyncio.sleep(2) def get_token_callback(event: Event, decrypted_content): - print( - f"From {event.public_key[:3]}..{event.public_key[-3:]}: {decrypted_content}" - ) + # print( + # f"From {event.public_key[:3]}..{event.public_key[-3:]}: {decrypted_content}" + # ) try: - proofs = [ - Proof(**p) - for p in json.loads(base64.urlsafe_b64decode(decrypted_content)) - ] - wallet: Wallet = ctx.obj["WALLET"] - asyncio.run(wallet.redeem(proofs)) - wallet.status() + # call the receive method + asyncio.run(receive(ctx, decrypted_content)) except Exception as e: pass