alongside one tap zap nip47 also supports showing your wallet balance in-app, so damus can let you know when you’re out of corn. very cool.

Reply to this note

Please Login to reply.

Discussion

very cool πŸ€™πŸ»πŸ’œ

Yep, we use the same

Does it?

It doesnt at the moment. Should the balance be a replaceable event or an rpc call?

get_balance is in nip47 is it not ?

It's not

We can add it tho

Would be really helpful

I see. I saw it mentioned but I guess it was just an example. Would be nice to have it.

Should definitely be an rpc call, not a replaceable event

Why not a replaceable event? Would make sense, no?

hmm I guess that would be good for realtime balance updates

It would. But what if your balance changes because of a non-zap πŸ€” could be tricky to implement on the back-end side

You just send the event whenever a payment is received, is your backend not setup for that ?

Haha that's optimistic of you πŸ˜› yeah it is possible but a bit more work. We have a fairly simple open source backend github.com/getAlby/nostr-wallet-connect so we would need to hook this up to our event queue

There is a privacy issue with this. You could easily probe the relay by sending lightning payments to an account and subscribing to the replaceable events to see which nostr keys are associated with what account.

Also true. But to fix privacy authentication on the relay should be added anyway I think

yeah auth would fix

The wallet balance is not part of NIP-47, is it? How does it get that information?