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

feat: withdraw custom amount from savings #597

Merged
merged 3 commits into from
Sep 4, 2024

Conversation

rolznz
Copy link
Contributor

@rolznz rolznz commented Sep 3, 2024

Closes #575

This allows users to send explicit amounts, e.g. to do a boltz swap, but is kept in the advanced options as Alby Hub is primarily a lightning wallet.

In the withdraw page, an input and send all checkbox are added. Because of how transaction fee calculation in bitcoin works, send all vs sending an amount are two different actions. The user is also warned if they send all when they have channels open, as it will drain their anchor reserves.

image

image

</Alert>
)}
{!!balances?.onchain.reserved &&
(sendAll || +amount > balances.onchain.total * 0.9) && (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use spendable instead of total

@rolznz rolznz added this to the v1.7.0 milestone Sep 3, 2024
@bumi
Copy link
Contributor

bumi commented Sep 3, 2024

btw. I find this screen a bit too complicated and I have never seen a wallet where I need to confirm my address and check a box.

why does it actually need to be that I am the owner of that address and having the seed phrase of it?

<Input
id="amount"
type="number"
value={sendAll ? balances.onchain.total : amount}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure "send all" will be that amount?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, good catch!

@rolznz
Copy link
Contributor Author

rolznz commented Sep 4, 2024

btw. I find this screen a bit too complicated and I have never seen a wallet where I need to confirm my address and check a box.

@bumi this was because one of our users sent their funds to the wrong address 😢

I'll update the copy a bit.

Update: replaced with confirmation dialog

@rolznz
Copy link
Contributor Author

rolznz commented Sep 4, 2024

Updated UI:
image

image

Anchor reserve variants:

image

image

Replaced checkbox and confirm input with a confirmation dialog:

image

image

@rolznz rolznz merged commit ae43099 into master Sep 4, 2024
9 checks passed
@rolznz rolznz deleted the feat/withdraw-savings-custom-amount branch September 4, 2024 04:45
@bumi
Copy link
Contributor

bumi commented Sep 4, 2024

that's a nice UI.

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.

Send specific amount of Savings to an address
2 participants