Skip to content

Persist x402 receipts and SSE events to a durable store (Vercel Postgres + KV) - #464

Open
Menjay7 wants to merge 6 commits into
Bitcoindefi:mainfrom
Menjay7:jay
Open

Menjay7 wants to merge 6 commits into
Bitcoindefi:mainfrom
Menjay7:jay

Conversation

@Menjay7

@Menjay7 Menjay7 commented Jul 24, 2026 •

Copy link
Copy Markdown

Description
This PR introduces durable persistence for x402 receipts and Server-Sent Events (SSE) by leveraging Vercel Postgres for relational data and Vercel KV for fast key-value lookups.

Motivation
Reliability: Ensure receipts and SSE events are not lost in transient memory.

Replayability: Enable event replay and auditing by storing events durably.

Scalability: Use Postgres for structured queries and KV for lightweight caching.

Consistency: Provide a single source of truth for receipts and event streams.

Changes
Added vercel/postgres integration for storing x402 receipts.

Added vercel/kv integration for SSE event persistence.

Updated controllers to write receipts and events to the durable store.

Implemented retrieval endpoints for receipts and SSE event replay.

Adjusted tests to validate persistence and retrieval logic.
Closed #147

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

This branch has not been deployed

No deployments
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.

Persist x402 receipts and SSE events to a durable store (Vercel Postgres + KV)

2 participants