diff --git a/.changeset/sdk-eip3009-payment-flow.md b/.changeset/sdk-eip3009-payment-flow.md deleted file mode 100644 index 550cc32..0000000 --- a/.changeset/sdk-eip3009-payment-flow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"radius-sdk": patch ---- - -`radiusPayments` accepts facilitators that list the `eip3009` transfer method for `exact`. Previously every paid route answered 500 once the facilitator's `/supported` named `eip3009` before `permit2`. diff --git a/.changeset/sdk-facilitator-unknown-outcome.md b/.changeset/sdk-facilitator-unknown-outcome.md deleted file mode 100644 index 9cac9f4..0000000 --- a/.changeset/sdk-facilitator-unknown-outcome.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'radius-sdk': patch ---- - -`radiusPayments` answers `502` (`facilitator_error`) when a facilitator call fails without the facilitator's own answer, such as a dropped connection or an error page from a gateway. These were reported as `402`, which a buyer reads as "rejected, nothing moved", although a settle may have reached the chain. The facilitator's own rejections are still `402`. diff --git a/.changeset/sdk-framework-agnostic-server.md b/.changeset/sdk-framework-agnostic-server.md deleted file mode 100644 index 01c97e6..0000000 --- a/.changeset/sdk-framework-agnostic-server.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -"radius-sdk": minor ---- - -Accept payments from any HTTP stack, not just Hono. New `radius-sdk/server` entry point: - -- `radiusPayments()` is a web-standard handler (`Request` in, `Response` out) for Cloudflare Workers without a framework, Bun, Deno, Node 18+, and Next.js / SvelteKit / Remix route handlers. Paid handlers receive the settled receipt as a second argument. -- `createRadiusServer()` exposes the Radius x402 resource server and a `routes()` builder that plug straight into the upstream adapters: `paymentMiddleware(radius.routes({ … }), radius.server)` with `@x402/express`, `@x402/next` or `@x402/hono`. -- `onSettled` is registered on the resource server, so it fires whichever adapter served the request (it receives the x402 request context; `requestOf(context)` returns the `Request` for the SDK's own adapters). Errors thrown by `onSettled` are logged by x402 core instead of failing the request. -- Paid responses stream through in the default `settle: 'before'` flow instead of being buffered (the previous Hono middleware buffered every paid response, stalling SSE and token streams). -- **Breaking:** `radius-sdk/hono` is now a thin wrapper over the web-standard handler with the same options. `RadiusHonoAdapter` is removed; `RequestAdapter` from `radius-sdk/server` (an x402 `HTTPAdapter` over a web-standard `Request`) replaces it. -- `@x402/core` / `@x402/evm` bumped to 2.27.0 (the version line the upstream adapters require). -- New examples: `examples/worker-plain` (no framework), `examples/express-seller` (`@x402/express`) and `examples/astro-seller` (validate before charging in an Astro API route). diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index d3a1b5b..f270663 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,14 @@ # radius-cli +## 0.3.1 + +### Patch Changes + +- Updated dependencies [23f73d6] +- Updated dependencies [5a915b2] +- Updated dependencies [bdd6d76] + - radius-sdk@0.4.0 + ## 0.3.0 ### Minor Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index aa219ff..d689c5c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "radius-cli", - "version": "0.3.0", + "version": "0.3.1", "description": "CLI wallet for the Radius network \u2014 like cast, with a built-in account", "type": "module", "bin": { diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index 4e66234..bcf1d31 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -1,5 +1,24 @@ # radius-sdk +## 0.4.0 + +### Minor Changes + +- bdd6d76: Accept payments from any HTTP stack, not just Hono. New `radius-sdk/server` entry point: + + - `radiusPayments()` is a web-standard handler (`Request` in, `Response` out) for Cloudflare Workers without a framework, Bun, Deno, Node 18+, and Next.js / SvelteKit / Remix route handlers. Paid handlers receive the settled receipt as a second argument. + - `createRadiusServer()` exposes the Radius x402 resource server and a `routes()` builder that plug straight into the upstream adapters: `paymentMiddleware(radius.routes({ … }), radius.server)` with `@x402/express`, `@x402/next` or `@x402/hono`. + - `onSettled` is registered on the resource server, so it fires whichever adapter served the request (it receives the x402 request context; `requestOf(context)` returns the `Request` for the SDK's own adapters). Errors thrown by `onSettled` are logged by x402 core instead of failing the request. + - Paid responses stream through in the default `settle: 'before'` flow instead of being buffered (the previous Hono middleware buffered every paid response, stalling SSE and token streams). + - **Breaking:** `radius-sdk/hono` is now a thin wrapper over the web-standard handler with the same options. `RadiusHonoAdapter` is removed; `RequestAdapter` from `radius-sdk/server` (an x402 `HTTPAdapter` over a web-standard `Request`) replaces it. + - `@x402/core` / `@x402/evm` bumped to 2.27.0 (the version line the upstream adapters require). + - New examples: `examples/worker-plain` (no framework), `examples/express-seller` (`@x402/express`) and `examples/astro-seller` (validate before charging in an Astro API route). + +### Patch Changes + +- 23f73d6: `radiusPayments` accepts facilitators that list the `eip3009` transfer method for `exact`. Previously every paid route answered 500 once the facilitator's `/supported` named `eip3009` before `permit2`. +- 5a915b2: `radiusPayments` answers `502` (`facilitator_error`) when a facilitator call fails without the facilitator's own answer, such as a dropped connection or an error page from a gateway. These were reported as `402`, which a buyer reads as "rejected, nothing moved", although a settle may have reached the chain. The facilitator's own rejections are still `402`. + ## 0.3.0 ### Minor Changes diff --git a/packages/sdk/package.json b/packages/sdk/package.json index cc64149..430ab03 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "radius-sdk", - "version": "0.3.0", + "version": "0.4.0", "description": "Accept and make Radius payments over x402 v2 \u2014 any web-standard runtime, Hono, or the upstream x402 framework adapters", "type": "module", "license": "MIT",