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

Add screen to spend expired swap-ins #564

Merged
merged 10 commits into from
Jun 6, 2024
Merged

Add screen to spend expired swap-ins #564

merged 10 commits into from
Jun 6, 2024

Conversation

dpad85
Copy link
Member

@dpad85 dpad85 commented May 13, 2024

This PR adds a new screen accessible from the swap-in wallet view that lets users spend cancelled funds that have expired and are not eligible to be swapped to Lightning anymore.

Previously, users needed to perform a manual procedure to spend cancelled funds.

@robbiehanson if you have suggestions for the wording in the new screens, do not hesitate.

This PR depends on https://github.com/ACINQ/lightning-kmp/tree/spend-expired-swapin (not merged yet).

Android screens

Tapping on Cancelled funds opens the screen to spend the cancelled funds.

image

The address and the feerate are set by the user.

The amount cannot be modified. It depends on what is available in the wallet.
See: peerManager.swapInWallet.readyForRefund.balance.

image

Low feerate check

Using a feerate below the mempool.space hour estimation triggers a "low feerate" warning, like for the splice-out screen (although unlike splice-outs, Phoenix cannot splice-CPFP that transaction later on, so the message is different and the acceleration part of it is removed).

image

@dpad85 dpad85 force-pushed the spend-expired-swap branch from 3fdb159 to 1d39e0b Compare May 22, 2024 11:59
@dpad85 dpad85 marked this pull request as ready for review May 22, 2024 11:59
@robbiehanson
Copy link
Contributor

iOS screens so far:

This is in branch ios-564 which is rebased on master, and requires latest commit from lightning-kmp spend-expired-swapin.

@dpad85
Copy link
Member Author

dpad85 commented Jun 4, 2024

Cherry-picked ios-564 to include the iOS changes and merged master.

I also added support for ACINQ/lightning-kmp#657. This PR makes the peer's client and watcher interfaces (i.e., may not always be ElectrumClient/Watcher).

In theory it meansPeer.swapInWallet and Peer.finalWallet may be null, although in our case, they are always defined since Phoenix is always using Electrum. So I've added 2 extensions for Peer (see PeerManager): Peer.phoenixSwapInWallet and Peer.finalSwapInWallet. @robbiehanson if you used Peer.swapInWallet and Peer.finalWallet in the iOS app, you will have to switch and use these 2 extensions instead.

@dpad85 dpad85 requested a review from robbiehanson June 4, 2024 17:25
@dpad85 dpad85 merged commit f629cb2 into master Jun 6, 2024
@dpad85 dpad85 deleted the spend-expired-swap branch June 6, 2024 08:40
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