Two SubEtha packages are published to npm; both are Apache-2.0, ESM-only, and
require Node.js >= 20. Everything below is the surface actually exported by
the package entry points at the pinned product commit — nothing more.
applies to @subetha/x402-scheme 0.1.0 (npm, verified 2026-07-27)applies to @subetha/provider 0.1.0 (npm, verified 2026-07-27)
The facilitator is not on this list on purpose: @subetha/facilitator is
private/workspace-internal and is operated from the product repository source
only (npm returns 404 for it — see
Versions & compatibility).
@x402/core (^2.17.0) is a peer dependency; viem (^2.21.0) is installed
automatically as a regular dependency. The package entry re-exports three
modules
(src/index.ts):
x402 v2 scheme handler for subetha-zerc20 (structurally implements the official SchemeNetworkClient). Members: scheme, createPaymentPayload(x402Version, requirements), burnTxFor(challengeNonce) (self-transfer mode), lastRequirements
In the default "permit" mode the client fail-fasts when an offer lacks
extra.helper — it never silently degrades to a gas-paying transfer.
Construction requires rpcUrl or an injected publicClient.
@x402/core (^2.17.0) is a peer dependency; @subetha/x402-scheme is
installed automatically as a regular dependency. The package entry re-exports
four modules
(src/index.ts):
what a resource handler returns instead of writing to res: { body, status?, contentType? }
SubethaHandlerResponse
interface
the structural slice of express.Response the wrapper drives (no express dependency)
subethaHandler(fn)
function
wraps a return-value handler into an Express-compatible route handler with exactly one response commit; a thrown handler becomes a 500 and the payment is not settled
structurally implements the official SchemeNetworkServer; mints one fresh burn-address offer per unpaid 402 via the facilitator and caches live offers in memory (single-process assumption)
subethaAccepts(schemeServer, { network, price })
function
builds a route’s accepts entry whose dynamic payTo mints per 402 and echoes the client’s accepted.payTo on the paying request
price is the list price in base units; the quoted amount (with any
fee) comes from the facilitator per request. The provider holds no keys except
its payout EOA and never touches the chain or the zERC20 SDK.