Issue 320 x402 discovery - #369
Merged
Merged
Conversation
|
Someone is attempting to deploy a commit to the Emmanuel's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Fayedamz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
closes #320
Summary
Adds standardized x402 discovery metadata at /.well-known/x402 so autonomous clients can discover StellarSearch’s paid resources and payment requirements without scraping human documentation.
Changes
Added a shared runtime-configured x402 discovery metadata builder.
Added Express support for GET /.well-known/x402.
Added the matching Vercel serverless handler and root-path rewrite.
Advertised resource templates for /search, /images, and /news.
Included active Stellar networks, Soroban USDC contract, exact payment scheme, amount, currency, and receiving address.
Added canonical priceDiscoveryUrl generation with optional PUBLIC_BASE_URL support.
Added five-minute cache headers for discovery responses.
Updated the Vercel service index and README documentation.
Added unit and API-level coverage for metadata shape, runtime configuration, URL derivation, method restrictions, and cross-runtime behavior.
Verification
205 tests passed across 18 test files.
Production build passed.
TypeScript validation passed.
git diff --check passed.
Existing payment approval, x402 verification, replay protection, and settlement behavior remains unchanged.
Branch
issue-320-x402-discovery