Skip to content

NIP-47: add state to transactions#1933

Merged
vitorpamplona merged 1 commit into
nostr-protocol:masterfrom
im-adithya:chore/nip47-state
Jul 31, 2025
Merged

NIP-47: add state to transactions#1933
vitorpamplona merged 1 commit into
nostr-protocol:masterfrom
im-adithya:chore/nip47-state

Conversation

@im-adithya
Copy link
Copy Markdown
Contributor

@im-adithya im-adithya commented May 21, 2025

Description

This PR adds support for a new state field to the transaction object returned in make_invoice, lookup_invoice, and list_transactions responses. This allows clients to distinguish between pending, settled, and failed transactions in a consistent way.

  • state can be pending, settled, or failed
  • Notifications (payment_received, payment_sent) now explicitly include "state": "settled" (since we only send on successful send/receive) to be consistent with the transaction type

This change is backward-compatible and aims to improve UX for clients fetching payments.

Implementation examples

Transaction lists can now show success, failed, and pending payments using this addition.

Alby Hub

Screenshot 2025-06-03 at 6 15 01 PM

Alby Go

Screenshot 2025-06-03 at 6 15 01 PM

@getalby/js-sdk

You can also test this by creating a connection in Alby Hub and fetching txs using this example.

@im-adithya im-adithya changed the title docs: add state to NIP-47 transactions feat: add state to NIP-47 transactions Jun 3, 2025
@im-adithya im-adithya changed the title feat: add state to NIP-47 transactions NIP-47: add state to transactions Jun 3, 2025
@im-adithya im-adithya force-pushed the chore/nip47-state branch from 2386342 to 7b120de Compare June 3, 2025 11:58
Comment thread 47.md Outdated
@rolznz
Copy link
Copy Markdown
Contributor

rolznz commented Jul 31, 2025

@Semisol can this PR be merged?

@vitorpamplona
Copy link
Copy Markdown
Collaborator

This sound's simple enough of a PR.

@vitorpamplona vitorpamplona merged commit 0595d43 into nostr-protocol:master Jul 31, 2025
yukibtc pushed a commit to rust-nostr/nostr that referenced this pull request Aug 4, 2025
…ate field for transactions

Notably adding state field for transactions: nostr-protocol/nips#1933

Pull-Request: #1021
Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
pats2sats pushed a commit to sudonym-btc/accommodation-nip that referenced this pull request May 20, 2026
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.

4 participants