Merge staging-spark into master - #4339
Open
thisconnect wants to merge 191 commits into
Open
Conversation
This is a new draft implementation of a Spark-based Lightning wallet. It basically collapses all the development done on the old staging-ln branch, plus a Spark PoC integration that replaces the old Greenlight one. It is not perfect: there are a lot of things that still need to be refactored, but I thought that it makes sense to have a starting point now and to open small, specific PRs from now on in this new staging branch.
Conflicts:
backend/config/config.go
Additional change:
lightning.tsx -> update payment struct to use NativeCoinUnit
We used to expose the lightning config struct to the whole backend and the frontend. This adds specific methods to set/unset a lightning account and remove the complexity from the code where is not needed.
- move payment-related types and methods into payments.go - hide breez-specific request/response shapes behind app-facing types - remove unused lightning endpoints and dead backend/frontend code - drop query-string dep from the lightning frontend api - refactor api/lightning.ts to use types instead of interfaces
Conflicts: frontends/web/src/api/coins.ts frontends/web/src/components/forms/index.tsx frontends/web/src/components/sidebar/sidebar.tsx frontends/web/src/contexts/providers.tsx frontends/web/src/routes/account/summary/balancerow.tsx
Activating a lightning account (especially a previously activated one) could take several seconds. This adds a waiting screen to clearly indicate that the wallet is being created.
Lightning icon centering in the sidebar was wrong. This fixes it using flex centering to bring it onto the same vertical alignment as the other sidebar icons. This also adds limits to the icon size.
The LN account was only shown in the wide screen sidebar. This adds it on the accounts view for mobile/tablet as well.
The current frontend send flow is long and complicated, hard to read and to maintain. This refactors it, making it more modular and introducing a dedicated context/provider that allows keeping track of the flow status while splitting the differents parts.
Conflicts: frontends/web/src/api/account.ts frontends/web/src/routes/accounts/all-accounts.tsx
Status component renamed the dismissible field to dismissibleKey. This commit adapts the code to the change after the merge of master branch.
During the previous merge commit I didn't remove the unitClassName param from AccountRow in all-accounts.tsx. Now it's fixed.
Split Lightning payment quoting from payment submission across the backend and web send flow. Add a prepare-payment API that returns the amount, fee, and total debit before sending. Pass the approved fee back on send, reject stale approvals in the backend, and refresh the quote in the UI when the SDK requires a new approval.
Lightning payments were just drafted in the frontend: the backend was providing a DTO object that wasn't matching the frontend representation and was lacking the amounts' fiat conversions. This fixes it by creating a dedicated lightning payment component in the frontend and adapting the data returned by the backend.
Co-authored-by: beerosagos <luca@bitbox.swiss>
Lightning balances were fetched only when a view loaded, so the view could keep showing a stale balance after a payment was received. Publish balance notifications from the backend whenever the balance or its displayed value changes, and consume them with useSync wherever the frontend displays a Lightning balance. This preserves the initial load while keeping the current view updated as the balance changes.
Accept BIP21 URIs in the Lightning send flow and use their address, amount and message for on-chain payments. Prefer embedded BOLT11 invoices over the on-chain fallback. Preserve the invoice description when present. Otherwise, show the BIP21 message as the payment note. Cover on-chain, amountless and hybrid inputs with parser tests. Co-authored-by: beerosagos <luca@bitbox.swiss>
- revamp QR scanner - use this QR scanner in 3 places: onchain send, LN send, and WalletConnect scan - add paste button on receiver input Co-authored-by: thisconnect <this@shiftcrypto.ch>
conflict: frontends/web/src/routes/account/account.module.css
BackButton component should be used for back buttons to enable back navigation gestures on iOS and Android. Also enables back navigation for the QR scanner.
Collaborator
Author
|
changelog entry missing :) |
thisconnect
marked this pull request as ready for review
August 20, 2026 08:22
Collaborator
Author
|
@coderabbitai review |
|
thisconnect
requested review from
benma and
bznein
and removed request for
benma and
bznein
August 20, 2026 10:08
Collaborator
Author
|
this should fix the new conflicts #4341 cc @sutterseba |
Conflicts: CHANGELOG.md frontends/web/src/app.tsx frontends/web/src/components/bottom-navigation/bottom-navigation.tsx frontends/web/src/components/bottom-navigation/utils.test.ts frontends/web/src/components/bottom-navigation/utils.ts frontends/web/src/routes/router.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before asking for reviews, here is a check list of the most common things you might need to consider: