lightning-browser-extension icon indicating copy to clipboard operation
lightning-browser-extension copied to clipboard

Linear min & max sats buttons

Open matjaz opened this issue 2 years ago • 6 comments

Describe the changes you have made in this PR

Sats buttons 4 linear values from min to max, with nice rounding & formating. min & max values are unchanged.

Type of change

  • feat: New feature (non-breaking change which adds functionality)

Checklist

  • [x] Self-review of changed code
  • [x] Manual testing
  • [ ] Added automated tests where applicable
  • [ ] Update Docs & Guides
  • For UI-related changes
  • [x] Darkmode
  • [x] Responsive layout

matjaz avatar Oct 08 '23 20:10 matjaz

can you please try and fix code quality checks in the code?

pavanjoshi914 avatar Oct 09 '23 04:10 pavanjoshi914

@matjaz I don't think a linear distribution of the amounts between min and max is what I would want as a user. When I tip someone I use those buttons as kind of shortcuts for smaller amounts.

I don't think people would use a 1M sat button a lot, do you? :thinking:

reneaaron avatar Oct 09 '23 14:10 reneaaron

Using LNURL, LN SERVICE specify min & max. So it's up to service what values they want. Example I was considering is service balance withdrawal where max is balance.

When you tip someone you don't use LNURL (no min&max). When min & max are not specified it fallbacks to current values(1k, 5k 10k, 25k).

There is no point of having disabled buttons.

What do you suggest, @reneaaron ?

@pavanjoshi914 fixed formatting.

matjaz avatar Oct 09 '23 17:10 matjaz

Example I was considering is service balance withdrawal where max is balance.

Ahh, okay. I wasn't considering this screen. Can you share the use case (and app) where you would think this would improve the flow for the user?

The problem could be here that you won't be able to withdraw the full amount for most of the services. (they keep a little reserve to protect themselves from fee draining attacks)

I think there are basically 2 use cases where those buttons are in use currently:

  • LNURL-pay (paying to some other LNURL)
  • makeInvoice (e.g. withdrawing from a service)

When you tip someone you don't use LNURL (no min&max).

Every lightning address is a LNURL :thinking: (e.g. also your lightning address has min and max values defined)

reneaaron avatar Oct 10 '23 08:10 reneaaron

https://lntictactoe.com & https://www.lnflip.com enables balance withdrawal. They also have built-in fees which covers withdrawal fees. Probably they also have throttling for withdrawals.

Let's say user has a balance of 2500 sats, most of the buttons are disabled. For 150000 sats button values are too low.

So for tag

  • payRequest, Alby could have a max value of wallet balance or LNURL maxSendable
  • withdrawRequest, LN SERVICE defines maxWithdrawable

matjaz avatar Oct 10 '23 09:10 matjaz

Any feedback on this? I don't see the point in buttons with higher values than available. For both, payRequest and withdrawRequest.

matjaz avatar Oct 26 '23 15:10 matjaz