Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear min & max sats buttons #2803

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

matjaz
Copy link
Contributor

@matjaz matjaz commented Oct 8, 2023

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

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

@pavanjoshi914
Copy link
Contributor

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

@reneaaron
Copy link
Contributor

@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? 🤔

@matjaz
Copy link
Contributor Author

matjaz commented Oct 9, 2023

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.

@reneaaron
Copy link
Contributor

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 🤔 (e.g. also your lightning address has min and max values defined)

@matjaz
Copy link
Contributor Author

matjaz commented Oct 10, 2023

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
Copy link
Contributor Author

matjaz commented Oct 26, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants