@openx402/bazaar-sdk is the seller-side package. It compiles readable
configuration into the official x402 Bazaar extension. It does not sign,
settle, hold keys, or replace the facilitator.
Declare a complete HTTP resource
Configure server defaults once, then declare the route, payment, and discovery metadata together:path, routeKey, resourceUrl, paymentConfig,
compiled resource, extensions, and compile(). The keyed payment config is
important: a bare route config can accidentally payment-gate every route in an
Express application.
HTTP metadata inputs
Descriptions are not decorative. They are the source text used by catalog
search, so keep them specific and truthful. The facilitator never uses a model
to invent missing parameters, prices, or capabilities.
Reuse Zod schemas
The adapter is optional, so the core package stays lightweight:Declare an MCP tool
Reuse the MCP tool’s existinginputSchema. MCP identity is the tuple
(resource.url, input.toolName), not just the URL:
Stellar assets
Use the verified asset registry rather than copying contract strings into every route:Low-level helper
Usebazaar.http() or bazaar.mcp() when you need to assemble a custom
PaymentRequired response. Both helpers delegate to the upstream
@x402/extensions/bazaar builder. The output remains the official wire shape.
What the SDK does not do
- It does not run a facilitator.
- It does not store or access buyer or seller secret keys.
- It does not decide whether a payment is valid.
- It does not create trustlines.
- It does not add proprietary x402 fields.