Skip to content

Commit 063626f

Browse files
committed
increased proof limit to 1024
1 parent ee51249 commit 063626f

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

safebox/cli.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,17 @@ def deposit(amount: int):
228228
click.echo(f"\n\nPlease pay invoice:\n {cli_quote.invoice}")
229229

230230
click.echo(f"\n\nPlease run safebox check invoice check to see if invoice is paid")
231+
232+
@click.command(help="withdraw funds from wallet via lightning invoice")
233+
@click.argument('invoice')
234+
235+
def withdraw(invoice: str):
236+
click.echo(f"invoice: {invoice}")
237+
wallet_obj = Wallet(nsec=NSEC, relays=RELAYS,mints=MINTS,home_relay=HOME_RELAY)
238+
cli_out = wallet_obj.withdraw(invoice)
239+
click.echo(cli_out)
240+
241+
231242

232243
@click.command(help="Check for payment")
233244
@click.argument('param')
@@ -366,6 +377,7 @@ def accept(token):
366377

367378

368379
cli.add_command(deposit)
380+
cli.add_command(withdraw)
369381
cli.add_command(proofs)
370382
cli.add_command(balance)
371383
cli.add_command(swap)

safebox/wallet.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,12 @@ def deposit(self, amount:int)->cliQuote:
867867

868868
return cliQuote(invoice=invoice, quote=quote)
869869
# return f"Please pay invoice \n{invoice} \nfor quote: \n{quote}."
870-
870+
def withdraw(self, lninvoice:str):
871+
872+
msg_out = self.pay_multi_invoice(lninvoice=lninvoice)
873+
874+
return msg_out
875+
871876
def add_proofs(self,text, replicate_relays: List[str]=None):
872877
# make sure have latest kind
873878
print("get rid of this function")
@@ -988,7 +993,7 @@ def _load_proofs(self):
988993

989994

990995
FILTER = [{
991-
'limit': 10,
996+
'limit': 1024,
992997
'authors': [self.pubkey_hex],
993998
'kinds': [self.wallet_config.kind_cashu]
994999
}]
@@ -1349,7 +1354,10 @@ def pay_multi_invoice( self,
13491354
comment: str = "Paid!"):
13501355

13511356
# decode amount from invoice
1352-
ln_amount = int(bolt11.decode(lninvoice).amount_msat//1e3)
1357+
try:
1358+
ln_amount = int(bolt11.decode(lninvoice).amount_msat//1e3)
1359+
except Exception as e:
1360+
return f"error {e}"
13531361

13541362
print("pay from multiple mints")
13551363
available_amount = 0

0 commit comments

Comments
 (0)