Repository navigation
feat(x402): add Bazaar discovery to five GET-query guard routes - #630
Merged
Merged
Conversation
Hyperliquid, Monad, Solana and BNB perp guards plus Prediction Guard returned a valid 402 on GET but advertised no discovery extension, so CDP validate accepted the quote without listing the resource. Declare GET-query Bazaar contracts for all five and switch their route configs from routeConfigWithoutDiscovery to routeConfigFor. Pin each declaration with the official spec/info-vs-schema validators and assert the wire 402 carries bazaar for these routes.
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.
Five paid REST routes returned a valid 402 on GET but advertised no Bazaar discovery extension, so CDP validate accepted the quote without listing the resource:
/api/v1/safety/hyperliquid-perp-guard/api/v1/safety/monad-perp-guard/api/v1/safety/solana-perp-guard/api/v1/safety/bnb-perp-guard/api/v1/safety/prediction-guardEach is a read-only, query-param-driven GET guard (POST binds an exact unsigned order where applicable, and stays out of discovery). This PR declares a GET-query Bazaar contract for each and switches their route configs from
routeConfigWithoutDiscoverytorouteConfigFor.Tests: official
validateDiscoveryExtensionSpec+validateDiscoveryExtensionon all five declarations, plus a wire-402 assertion that each route's PAYMENT-REQUIRED header carriesextensions.bazaar. Local: tsc clean, 181 x402 tests pass, eslint/prettier clean.