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

Feature request: allow onchain fees to be known before committing to paying them #526

Closed
danielgranhao opened this issue Oct 17, 2023 · 8 comments

Comments

@danielgranhao
Copy link
Contributor

When either using any of the following methods:

  • send_onchain()
  • sweep()
  • refund()

it would improve UX if we could know the fees that will be paid.

This could be done by splitting the methods into preparation and execution steps, such that after preparing, one can decide whether to execute or not based on the fees.

@roeierez
Copy link
Member

That's right @danielgranhao
for sweep we are going to introduce prepareSweep: #294
For send_onchain we have https://github.com/breez/breez-sdk/blob/main/libs/sdk-core/src/breez_services.rs#L630C18-L630C41
for refund perhaps we can add the refund tx weight to the list_refundables ?

@danielgranhao
Copy link
Contributor Author

That's right @danielgranhao
for sweep we are going to introduce prepareSweep: #294
For send_onchain we have https://github.com/breez/breez-sdk/blob/main/libs/sdk-core/src/breez_services.rs#L630C18-L630C41

Oh, sorry, completely missed that PR and the fetch_reverse_swap_fees() method.

for refund perhaps we can add the refund tx weight to the list_refundables ?

That would be nice!

@danielgranhao
Copy link
Contributor Author

@roeierez I was working on a PR for adding the refund tx weight to list_refundables and realized that this won't lead to an exact prediction of the fees. Without knowing the address the user chooses, the tx weight will just be a guess (of course, very close to the real one, and one could opt for the worst-case scenario).

Wouldn't it be better to go with a "prepare" approach (similar to #294) that would provide the exact fee that will be used?

@roeierez
Copy link
Member

Yes makes sense.

@JssDWt
Copy link
Contributor

JssDWt commented Oct 19, 2023

For send_onchain we have https://github.com/breez/breez-sdk/blob/main/libs/sdk-core/src/breez_services.rs#L630C18-L630C41

Link currently points to a different line of code.

@roeierez
Copy link
Member

@JssDWt
Copy link
Contributor

JssDWt commented Oct 19, 2023

@danielgranhao
Copy link
Contributor Author

Closed by #294 and #548

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

No branches or pull requests

3 participants