Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Lightning payment-status plumbing (mediator → Drawbridge/Gatekeeper types → Keymaster/clients) so that failed Lightning payments (“failed zaps”) are surfaced to users instead of being indistinguishable from pending payments.
Changes:
- Add an optional
statusfield (success/pending/failed) to Lightning payment status/result types across services and packages. - Update the LNbits history adapter to request recent payments from
/api/v1/payments/paginated, sorting by time and handling the paginated response shape. - Update Keymaster CLI and wallet UIs to display “Failed” and emit a user-facing error message when a zap fails.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| services/mediators/lightning/src/types.ts | Extends mediator Lightning payment result type with status. |
| services/mediators/lightning/src/lnbits.ts | Switches LNbits payments fetch to paginated endpoint; adds status mapping and returns it from checkPayment. |
| services/drawbridge/server/src/types.ts | Extends Drawbridge Lightning payment result type with status. |
| packages/keymaster/src/keymaster.ts | Propagates status from Drawbridge to Keymaster’s checkLightningPayment() result. |
| packages/keymaster/src/cli.ts | Includes status in lightning-zap command output. |
| packages/gatekeeper/src/types.ts | Extends shared LightningPaymentStatus type with status. |
| apps/react-wallet/src/components/LightningTab.tsx | Displays failed zap status and shows “Zap failed” error. |
| apps/keymaster-client/src/KeymasterUI.jsx | Displays failed zap status and shows “Zap failed” error. |
| apps/gatekeeper-client/src/KeymasterUI.jsx | Displays failed zap status and shows “Zap failed” error. |
| apps/browser-extension/src/components/LightningTab.tsx | Displays failed zap status and shows “Zap failed” error. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
GET /api/v1/paymentstoGET /api/v1/payments/paginatedstatusso zaps can distinguishfailedfrompendingVerification
npm run buildnpm run build --prefix apps/react-walletnpm run build --prefix apps/browser-extensionnpm run build --prefix apps/gatekeeper-clientnpm run build --prefix apps/keymaster-clientlightning-mediatorandreact-walletPOST http://localhost:4222/api/v1/lightning/paymentsnow includes recent failed zaps, including:028dea32c4aac37e666080626e5779f897b8cd1122e9de0869385b58c654dca7c60a2054c1b402925c705b1e91e32241dd15b70796dda0b7428d400b538ea85f762a8fd42abc96eb9990a54fde1ac0799b23bcc3bf5bb43ea9a02952b3daf8f7POST http://localhost:4222/api/v1/lightning/paymentnow returns failed status for a failed zap, for example:{"paid":false,"status":"failed","paymentHash":"028dea32c4aac37e666080626e5779f897b8cd1122e9de0869385b58c654dca7"}