Skip to main content

SDK & reference

HPP works with the standard @x402 SDK maintained by the x402 Foundation. There is no HPP-specific fork — HPP Mainnet and Sepolia are recognized via their CAIP-2 network identifiers, the same way the SDK recognizes Base, Polygon, and other EVM chains.

Packages

PackageUsed byPurpose
@x402/corebothx402Client, HTTPFacilitatorClient, RoutesConfig types.
@x402/evmbothEVM scheme clients (exact, upto) and the DEFAULT_STABLECOINS asset map.
@x402/expresssellerspaymentMiddleware and x402ResourceServer for Express.
@x402/extensionssellersRoute extensions, e.g. declareEip2612GasSponsoringExtension() for gasless upto.
@x402/fetchbuyerswrapFetchWithPayment to make a paying fetch.
viembuyersWallet account and chain utilities (privateKeyToAccount, defineChain).

Scheme clients are imported per role and scheme:

// Seller (resource server)
import { ExactEvmScheme } from "@x402/evm/exact/server";
import { UptoEvmScheme } from "@x402/evm/upto/server";

// Buyer (client)
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { UptoEvmScheme } from "@x402/evm/upto/client";

HPP network identifiers

x402 uses CAIP-2 network identifiers. Use these values for the network field everywhere in the SDK:

Networkx402 network
HPP Mainneteip155:190415
HPP Sepoliaeip155:181228

Asset

FieldValue
USDC.e address (both chains)0x401eCb1D350407f13ba348573E5630B83638E30D
Decimals6
EIP-712 domainname Bridged USDC, version 2

Register it in the SDK's default-asset map so EIP-3009 domains are filled in automatically — see Quickstart: Sellers → Register USDC.e.

Discovery

x402 includes an optional discovery mechanism (the "bazaar" extension) that lets sellers publish their paid endpoints so buyers and agents can find them. A seller opts in by declaring the discovery extension on its routes; HPP operates a discovery service that indexes published HPP x402 services. Discovery is not required to accept or make payments — it is an add-on for marketplace-style use.