mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 10:34:20 +01:00
Wallet: fix nostr receive (#460)
* fix wallet nostr receive * add log * add more relays and print info nicer
This commit is contained in:
@@ -512,6 +512,11 @@ async def receive_cli(
|
||||
await receive(wallet, tokenObj)
|
||||
elif nostr:
|
||||
await receive_nostr(wallet)
|
||||
# exit on keypress
|
||||
print("Press any key to exit.")
|
||||
click.getchar()
|
||||
print("Exiting.")
|
||||
os._exit(0)
|
||||
elif all:
|
||||
reserved_proofs = await get_reserved_proofs(wallet.db)
|
||||
if len(reserved_proofs):
|
||||
@@ -762,25 +767,11 @@ async def info(ctx: Context, mint: bool, mnemonic: bool):
|
||||
if settings.debug:
|
||||
print(f"Debug: {settings.debug}")
|
||||
print(f"Cashu dir: {settings.cashu_dir}")
|
||||
if settings.env_file:
|
||||
print(f"Settings: {settings.env_file}")
|
||||
if settings.tor:
|
||||
print(f"Tor enabled: {settings.tor}")
|
||||
if settings.nostr_private_key:
|
||||
try:
|
||||
client = NostrClient(private_key=settings.nostr_private_key, connect=False)
|
||||
print(f"Nostr public key: {client.public_key.bech32()}")
|
||||
print(f"Nostr relays: {settings.nostr_relays}")
|
||||
except Exception:
|
||||
print("Nostr: Error. Invalid key.")
|
||||
if settings.socks_proxy:
|
||||
print(f"Socks proxy: {settings.socks_proxy}")
|
||||
if settings.http_proxy:
|
||||
print(f"HTTP proxy: {settings.http_proxy}")
|
||||
mint_list = await list_mints(wallet)
|
||||
print(f"Mint URLs: {mint_list}")
|
||||
if mint:
|
||||
for mint_url in mint_list:
|
||||
print("Mints:")
|
||||
for mint_url in mint_list:
|
||||
print(f" - {mint_url}")
|
||||
if mint:
|
||||
wallet.url = mint_url
|
||||
try:
|
||||
mint_info: dict = (await wallet._load_mint_info()).dict()
|
||||
@@ -805,13 +796,29 @@ async def info(ctx: Context, mint: bool, mnemonic: bool):
|
||||
"Supported NUTS:"
|
||||
f" {', '.join(['NUT-'+str(k) for k in mint_info['nuts'].keys()])}"
|
||||
)
|
||||
print("")
|
||||
except Exception as e:
|
||||
print("")
|
||||
print(f"Error fetching mint information for {mint_url}: {e}")
|
||||
|
||||
if mnemonic:
|
||||
assert wallet.mnemonic
|
||||
print(f"Mnemonic: {wallet.mnemonic}")
|
||||
print(f"Mnemonic:\n - {wallet.mnemonic}")
|
||||
if settings.env_file:
|
||||
print(f"Settings: {settings.env_file}")
|
||||
if settings.tor:
|
||||
print(f"Tor enabled: {settings.tor}")
|
||||
if settings.nostr_private_key:
|
||||
try:
|
||||
client = NostrClient(private_key=settings.nostr_private_key, connect=False)
|
||||
print(f"Nostr public key: {client.public_key.bech32()}")
|
||||
print(f"Nostr relays: {', '.join(settings.nostr_relays)}")
|
||||
except Exception:
|
||||
print("Nostr: Error. Invalid key.")
|
||||
if settings.socks_proxy:
|
||||
print(f"Socks proxy: {settings.socks_proxy}")
|
||||
if settings.http_proxy:
|
||||
print(f"HTTP proxy: {settings.http_proxy}")
|
||||
return
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user