@chainsafe/x402-core
v0.0.0-reserved
Published
Shared x402 Canton wire types, canonical requirements hashing, verify primitives, and network presets.
Readme
@chainsafe/x402-core
Shared core for the Canton x402 SDK: wire types, canonical
PaymentRequirements hashing, verify primitives, and network presets. Every
other @chainsafe/x402-* package builds on this one.
Ships dual ESM + CJS with type declarations. Its runtime dependencies
(valibot, @noble/*, protobufjs) are bundled, so it installs with no
external runtime dependencies.
Install
npm install @chainsafe/x402-coreWhat's in it
- Wire types for the exact-canton x402 scheme —
CantonPaymentPayload,CantonPaymentRequirements, and the verify / settle / supported request and response shapes (validated with valibot). requirementsHash()— the canonical hash that binds a payment to itsPaymentRequirements.- Verify primitives —
createExactCantonVerifier()plus Ed25519 signature and party-fingerprint helpers. - Network presets & guards — devnet/mainnet ids and validators such as
isX402Request/isCantonPaymentRequirements.
Consumed by @chainsafe/x402-client,
@chainsafe/x402-express, and
@chainsafe/x402-server-sdk.
License
Apache-2.0
