Repository navigation
fix(nextjs-x402): enforce real x402Serve payment verification and reject arbitrary headers (fixes #81) - #84
Merged
Conversation
Eras256
marked this pull request as ready for review
August 29, 2026 23:10
M0nsxx
pushed a commit
to M0nsxx/nirium-sdk
that referenced
this pull request
Oct 23, 2026
nirium-protocol#84 switched nirium from file:../../packages/sdk to ^0.10.1 in package.json but kept the old lock, where nirium is still a link to the local SDK. npm ci has failed in this example since then. Regenerated against the current package.json (nirium resolves to 0.10.2) and bumped fast-uri to 3.1.8 in the same pass. npm ci, npm test (7/7), typecheck and next build all pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 of Changes
examples/nextjs-x402/app/lib/nirium-x402-seller.tswithx402Serve()middleware from the Nirium SDK, ensuring payment proofs undergo cryptographic validation and settlement via the x402 facilitator.500error whenpayToor facilitator credentials/endpoints are misconfigured or missing.PAYMENT-SIGNATURE/payment-signature) as primary headers while retaining backwards-compatible routing forX-PAYMENTto ensure it is strictly verified.examples/nextjs-x402/test/smoke.test.jscovering misconfiguration handling, failure modes, refusal of arbitrary/bogusX-PAYMENTandPAYMENT-SIGNATUREtokens, and direct handler execution.README.mdandpage.tsxinexamples/nextjs-x402to reflect facilitator requirements and the modernPAYMENT-SIGNATUREprotocol header.Stipulations Compliance Checklist
withNiriumX402with realx402Serve()/facilitator-backed path ensuring true cryptographic verification.X-PAYMENTandPAYMENT-SIGNATUREheaders are rejected without invoking the paid handler.PAYMENT-SIGNATURE/payment-signature.npm test,npm run typecheck, andnpm run buildpass without error.Fixes #81
Payout Routing
0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC