mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-21 02:54:20 +01:00
ask for confirmation
This commit is contained in:
@@ -418,9 +418,12 @@ async def invoices(ctx):
|
|||||||
help="Show more information.",
|
help="Show more information.",
|
||||||
type=bool,
|
type=bool,
|
||||||
)
|
)
|
||||||
|
@click.option(
|
||||||
|
"--yes", "-y", default=False, is_flag=True, help="Skip confirmation.", type=bool
|
||||||
|
)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
@coro
|
@coro
|
||||||
async def nsend(ctx, amount: int, pubkey: str, verbose: bool):
|
async def nsend(ctx, amount: int, pubkey: str, verbose: bool, yes: bool):
|
||||||
wallet: Wallet = ctx.obj["WALLET"]
|
wallet: Wallet = ctx.obj["WALLET"]
|
||||||
await wallet.load_mint()
|
await wallet.load_mint()
|
||||||
wallet.status()
|
wallet.status()
|
||||||
@@ -429,8 +432,16 @@ async def nsend(ctx, amount: int, pubkey: str, verbose: bool):
|
|||||||
)
|
)
|
||||||
token = await wallet.serialize_proofs(send_proofs)
|
token = await wallet.serialize_proofs(send_proofs)
|
||||||
|
|
||||||
|
print("")
|
||||||
print(token)
|
print(token)
|
||||||
wallet.status()
|
|
||||||
|
if not yes:
|
||||||
|
print("")
|
||||||
|
click.confirm(
|
||||||
|
f"Send {amount} sat to nostr pubkey {pubkey}?",
|
||||||
|
abort=True,
|
||||||
|
default=True,
|
||||||
|
)
|
||||||
|
|
||||||
# we only use ephemeral private keys for sending
|
# we only use ephemeral private keys for sending
|
||||||
client = NostrClient()
|
client = NostrClient()
|
||||||
|
|||||||
Reference in New Issue
Block a user