nostr:npub1xtscya34g58tk0z605fvr788k263gsu6cy9x0mhnm87echrgufzsevkk5s nostr:npub1gcxzte5zlkncx26j68ez60fzkvtkm9e0vrwdcvsjakxf9mu9qewqlfnj5z

Alby NWC now supports the "get_balance" RPC. WIP for a long time we decided on the same principle from pay_invoice, just a normal RPC, _not_ a replaceable event. The spec is here: https://github.com/getAlby/nips/blob/master/47.md#get_balance . Current connections do not have permission for this request, so everyone that would want to use it would need to create a new one. The permission is not enabled by default, but if you link people to the Alby page, you can check the permission checkbox default by specifying the request_methods in the url query parameters, as described here: https://github.com/getAlby/nostr-wallet-connect/#query-parameter-options-for-new

Reply to this note

Please Login to reply.

Discussion

Thank you!

Who wants to see your lightning wallet's balance directly on Amethyst? I am torn on this.

Is it a privacy risk? Does it even make sense or should we use the UI space/coding time for something else? Since this is an RPC, when should we call the NWC server to get the updated value? Every second? Once a day? After each zap? Since you can spend your sats outside Amethyst, it will most likely be an out of sync value nevertheless.

nostr:nevent1qqsyaa0psaqntl8anjzuvx3w3rsmvl5g4lw6u39wztysgy4aulw5tnqpremhxue69uhkummnw3ez6ur4vgh8wetvd3hhyer9wghxuet59upzprpmyelfmd4sz92f3np7lngc0528fpjfgzhgl7thsf4emq7jqkrhqvzqqqqqqyquj32u

Might make sense to have a get balance button after you get an insufficient balance error, otherwise it's not too useful

What does balance and max amount mean in relation to the budget? Would like to implement but it's unclear

Balance= the entire account / wallet balance, always. If you set a budget for this nwc connection then there is also max amount and budget_renewal

Is the max amount the amount I'm allowed to spend in a single payment or until the budget renewal?

Until budget renewal. But that implies that this is also the max for a single payment.

Do you guys want me to add this to my nwc extensions pr? Then we can get all these commands in one go

Meh I think it's better to wait a bit. At least until Damus implements it. Not everything has to be in a PR immediately.

Fair enough

I added it to my implementation:

https://github.com/benthecarman/nostr-wallet-connect-lnd