npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

x402z-server

v0.0.19

Published

Server-side helpers for the erc7984-mind-v1 x402 scheme.

Readme

x402z-server

Server-side helpers for the erc7984-mind-v1 x402 scheme.

Install

pnpm add x402z-server

Folder map

  • src/http/: server HTTP helpers
  • src/scheme/: scheme implementation + registration
  • src/index.ts: public exports

Usage

import { createX402zServer } from "x402z-server";
import { createRelayer, SepoliaConfig } from "x402z-shared";

const relayer = await createRelayer({
  ...SepoliaConfig,
  network: "https://sepolia.infura.io/v3/...",
});

const server = await createX402zServer({
  facilitatorUrl: "http://localhost:8040",
  asset: "0xToken",
  eip712: { name: "FHEToken Confidential", version: "1" },
  decimals: 6,
  batcherAddress: "0xBatcher",
  signer: { address, signTypedData },
  relayer,
  routes: {
    "GET /demo": {
      accepts: {
        payTo: "0xPayTo",
        price: "1.0",
        network: "eip155:11155111",
        maxTimeoutSeconds: 300,
      },
      description: "Demo content",
      mimeType: "text/plain",
    },
  },
  onPaid: async () => ({
    body: "demo content from server",
  }),
});

server.listen(8080);

API

  • createX402zServer(config)
    • facilitatorUrl (required): HTTP facilitator endpoint
    • asset, eip712, decimals, batcherAddress: scheme config
    • signer (required): signer used to decrypt transfer amounts
    • relayer (required): FHEVM relayer instance used for decryption
    • routes: map of METHOD /path to payment requirements
    • onPaid: handler for successful payment (returns response body + optional headers)

Examples

See examples/README.md for the full-process server + facilitator setup.

Notes

  • Scheme name: erc7984-mind-v1
  • confidential.batcherAddress is required in requirements; clients bind encrypted inputs to it.

API surface

Exports:

  • X402zEvmServerScheme: server scheme implementation for erc7984-mind-v1.
  • registerX402zEvmServerScheme: registers the scheme with x402 server.
  • createX402zServer: helper to configure the paywalled server.
  • x402ResourceServer: core x402 resource server.
  • HTTPFacilitatorClient: HTTP facilitator client wrapper.
  • x402HTTPResourceServer: HTTP resource server helpers.

Types:

  • X402zServerSchemeOptions: scheme config for server registration.
  • X402zServerNetworkOptions: network config for the scheme.
  • X402zServerRegistrationOptions: registration options for the scheme.
  • X402zRouteOptions: route config for paywalled endpoints.
  • X402zRouteHandler: handler signature for paid requests.
  • X402zServerOptions: options for createX402zServer.
  • CompiledRoute: compiled route metadata.
  • DynamicPayTo: callback for dynamic payee address.
  • DynamicPrice: callback for dynamic pricing.
  • FacilitatorClient: facilitator interface for settle requests.
  • FacilitatorConfig: facilitator config shape.
  • HTTPAdapter: adapter for HTTP runtime integration.
  • HTTPProcessResult: result type for processing requests.
  • HTTPRequestContext: request context for handlers.
  • HTTPResponseInstructions: response instructions for handlers.
  • PaywallConfig: paywall configuration for routes.
  • PaywallProvider: interface for paywall config providers.
  • PaymentOption: acceptable payment option shape.
  • ProcessSettleFailureResponse: settle failure response shape.
  • ProcessSettleResultResponse: settle result response shape.
  • ProcessSettleSuccessResponse: settle success response shape.
  • RouteConfigurationError: route config validation error.
  • RouteValidationError: route validation error type.
  • RoutesConfig: routes config map.
  • UnpaidResponseBody: unpaid response shape.
  • UnpaidResponseResult: unpaid response result.
  • re-exported types from @x402/core/types: shared x402 types.