Feature request
I'm using @circle-fin/x402-batching@3.5.0 with
createGatewayMiddleware().
The current middleware constructs the x402 PaymentRequired.resource
internally, while the route protection API is exposed as:
From the current public API surface, there does not appear to be a
supported route-level way to provide:
- resource.url
- resource.description
- resource.mimeType
- PaymentRequired.extensions
- extensions.bazaar
while continuing to use the existing Gateway middleware.
Current limitation
GatewayMiddlewareConfig provides a global description, but route
metadata is otherwise constructed internally.
For applications exposing multiple paid endpoints, this prevents each
route from supplying its own resource metadata and x402 extensions
without moving to a lower-level payment-server integration.
Requested API
Would Circle consider exposing route-level metadata, for example:
gateway.require("$0.01", {
resource: {
url: "https://api.example.com/v1/resource",
description: "Endpoint-specific description",
mimeType: "application/json"
},
extensions: {
bazaar: {
// extension declaration
}
}
})
or an equivalent supported API?
The exact shape is only illustrative; the main request is a supported
way to provide resource metadata and x402 extensions per protected route.
Motivation
This would allow applications to emit richer x402 v2 discovery metadata
while preserving the existing Circle Gateway middleware path for:
- payment requirement generation
- verification
- settlement
- lifecycle hooks
- Gateway batching behavior
Today, adding this metadata appears to require replacing
createGatewayMiddleware() with a lower-level x402 resource-server
integration even when the existing payment behavior does not otherwise
need to change.
Environment
- @circle-fin/x402-batching: 3.5.0
- @x402/core: 2.21.0
- @x402/evm: 2.21.0
- Runtime: Bun 1.3.14
- Framework: Express 5.2.1
Additional context
I can provide a minimal reproduction or test a proposed API if useful.
Feature request
I'm using @circle-fin/x402-batching@3.5.0 with
createGatewayMiddleware().
The current middleware constructs the x402 PaymentRequired.resource
internally, while the route protection API is exposed as:
From the current public API surface, there does not appear to be a
supported route-level way to provide:
while continuing to use the existing Gateway middleware.
Current limitation
GatewayMiddlewareConfig provides a global description, but route
metadata is otherwise constructed internally.
For applications exposing multiple paid endpoints, this prevents each
route from supplying its own resource metadata and x402 extensions
without moving to a lower-level payment-server integration.
Requested API
Would Circle consider exposing route-level metadata, for example:
or an equivalent supported API?
The exact shape is only illustrative; the main request is a supported
way to provide resource metadata and x402 extensions per protected route.
Motivation
This would allow applications to emit richer x402 v2 discovery metadata
while preserving the existing Circle Gateway middleware path for:
Today, adding this metadata appears to require replacing
createGatewayMiddleware() with a lower-level x402 resource-server
integration even when the existing payment behavior does not otherwise
need to change.
Environment
Additional context
I can provide a minimal reproduction or test a proposed API if useful.