Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to the `nirium` package are documented here.

## Unreleased

### Added

- `x402Serve()` routes can declare `input`, `inputSchema`, and/or `output` ([#217](https://github.com/nirium-protocol/nirium/issues/217)): when any is present, the route is announced via `@x402/extensions/bazaar`'s `declareDiscoveryExtension()` as that route's `extensions`, letting a Bazaar (Rail402 on Stellar testnet, Coinbase's CDP Bazaar where applicable) catalog it once a payment for it settles. Without those fields, a route behaves exactly as before - no `extensions` key, no new required dependency (`@x402/extensions` is dynamically loaded only when at least one route opts in). Verified end to end against Rail402's hosted testnet facilitator: a settled payment against a public `x402Serve()`-protected route got the resource listed at `GET https://testnet.rail402.dev/discovery/resources`, trust `origin_verified`.

## 0.17.0 - 2026-11-05

### Added
Expand Down
22 changes: 22 additions & 0 deletions packages/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,28 @@ Runs on **your own server**, not Nirium's - `x402Serve()` is a client-side funct

**Known limitation:** by default `x402Serve()` does not protect against replay and does not rate-limit callers. It is turned on by passing `guard` (see below).

#### Getting listed in an x402 Bazaar (optional)

Add `input`, `inputSchema`, and/or `output` to a route to declare its discovery metadata ([`@x402/extensions/bazaar`](https://www.npmjs.com/package/@x402/extensions)'s `declareDiscoveryExtension()`). A facilitator that reads the Bazaar extension (for example [Rail402](https://docs.rail402.dev/bazaar/discovery) on Stellar testnet) catalogs the route the first time a payment for it settles, so agents can discover it by searching instead of needing the URL hardcoded:

```typescript
app.use('/premium', x402Serve({
payTo: 'G...',
routes: {
'GET /signals': {
price: '$0.02',
description: 'Nirium arbitrage signals',
input: { count: 20 },
inputSchema: { properties: { count: { type: 'integer', maximum: 100 } } },
output: { example: { signals: [{ pair: 'XLM/USDC', confidence: 0.85 }] } },
},
},
facilitatorApiKey: '...',
}));
```

Without `input`/`inputSchema`/`output`, a route behaves exactly as before - no `extensions` key, no new required dependency (`@x402/extensions` is only ever loaded if at least one route uses them).

#### Replay and rate-limit guard (optional)

Without `guard`, `x402Serve()` verifies and settles the payment and does nothing else. It does not stop the same signed payment from being sent twice, and it does not limit how often one caller can hit a route. Pass `guard` to get both:
Expand Down
Loading
Loading