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

Calculate and display open-channel fee estimate #921

Merged
merged 6 commits into from
Jul 11, 2023
Merged

Calculate and display open-channel fee estimate #921

merged 6 commits into from
Jul 11, 2023

Conversation

da-kami
Copy link
Contributor

@da-kami da-kami commented Jul 7, 2023

fixes https://github.com/get10101/meta/issues/172

Please note: The screen font may look a bit odd for you because my default test setup is iPhone SE (3rd gen) with Accessibility Large, Bold Text activated to ensure that the screen does not break (unless users somehow increase the font even more, not sure if that is possible):

2023-07-07 14 56 04

@da-kami
Copy link
Contributor Author

da-kami commented Jul 7, 2023

Note: The info message as one text blob is not optimal - we could optimize this and highlight certain parts.

I tried to keep the text short - if you have suggestions on how to shorten it more please add suggestions!

@da-kami
Copy link
Contributor Author

da-kami commented Jul 7, 2023

I think it would be great to come to a conclusion for https://github.com/get10101/meta/issues/178 on top of this work.
For transparency it would be great if all fees would be explained - if there is a channel opening fee, and additionally the coordinator adds fees to the invoice we would have to see how we explain this to the user.

The trade minimum is not the same as the receive minimum so the message may read weird if we already have a balance.
It's nice for the user to have this information there.
This is in preparation for displaying additional fees.
By passing in a widget as child from the outside we can use this info model more flexible.
If we don't have a `ChannelInfo` yet we know this is an initial channel open and estimate the channel opening fee.
The fee information is based on a transaction weight estimate of `220` for the funding transaction estimate with two inputs. For most users this will likely be cheaper because only one UTXO will be used but it's better to safe funds than to have to pay more.

If we have a fee on record when creating an invoice we add this fee to the minimum receive value to ensure the user will be able to pay the fee and trade.
We pass a potential fee on to the share invoice screen where the fee is displayed including an info button that pops up an explanatory modal.
Copy link
Contributor

@klochowicz klochowicz left a comment

Choose a reason for hiding this comment

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

👍

nit: I got confused in the last commit message due to typo: s/safe/save

@da-kami
Copy link
Contributor Author

da-kami commented Jul 11, 2023

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 11, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 49e0dc4 into main Jul 11, 2023
7 checks passed
@bors bors bot deleted the receive-fees branch July 11, 2023 03:39
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.

2 participants