Skip to content

fix: add state field to lookup_invoice and list_transactions responses#49

Closed
dadofsambonzuki wants to merge 1 commit into
lnbits:mainfrom
dadofsambonzuki:fix-add-state-field
Closed

fix: add state field to lookup_invoice and list_transactions responses#49
dadofsambonzuki wants to merge 1 commit into
lnbits:mainfrom
dadofsambonzuki:fix-add-state-field

Conversation

@dadofsambonzuki

Copy link
Copy Markdown

Problem

The Alby Go wallet shows successful transactions as failed. It relies on a state field in NWC transaction responses to determine settlement status, while other wallets fall back to checking settled_at + preimage.

LNBits NWC Service Provider was not sending a state field, causing Alby to misinterpret completed payments.

Fix

Added "state": "settled" if is_settled else "pending" to both:

  • _on_lookup_invoice response dict
  • _on_list_transactions transaction dict

This matches the NIP-47 convention where state is one of "settled", "pending", or "failed".

Testing

Confirmed working: Alby Go wallet now correctly shows transactions as settled. Other wallets remain unaffected since they already handled the missing field via settled_at/preimage fallback.

Alby Go wallet relies on the state field to determine settlement
status, while other wallets fall back to settled_at + preimage.
Without state, Alby shows successful transactions as failed.
@dadofsambonzuki dadofsambonzuki deleted the fix-add-state-field branch June 25, 2026 14:29
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.

1 participant