HTTP client for communicating with x402 discovery/bazaar services
const client = new DiscoveryClient({ baseUrl: 'https://bazaar.example.com',});// Discover resourcesconst resources = await client.discover({ type: 'http', network: 'base:sepolia', limit: 10,});// Register a resource (for providers)const result = await client.register({ resource: 'https://api.myservice.com/data', type: 'http', accepts: [paymentRequirements], metadata: { category: 'data', provider: 'MyService' },}); Copy
const client = new DiscoveryClient({ baseUrl: 'https://bazaar.example.com',});// Discover resourcesconst resources = await client.discover({ type: 'http', network: 'base:sepolia', limit: 10,});// Register a resource (for providers)const result = await client.register({ resource: 'https://api.myservice.com/data', type: 'http', accepts: [paymentRequirements], metadata: { category: 'data', provider: 'MyService' },});
Discover x402-enabled resources Spec compliance: x402 v2 - Section 8.1 GET /discovery/resources
Optional
Register a resource in the bazaar
Unregister a resource from the bazaar
Update a resource's information
HTTP client for communicating with x402 discovery/bazaar services
Example