@parallel-protocol/x402-types
v0.1.1
Published
Parallel Protocol x402 facilitator HTTP wire-format types and Zod schemas (signing primitives live in @parallel-protocol/payment-core)
Readme
@parallel-protocol/x402-types
Wire-format types, Zod schemas, and EIP-712 / EIP-3009 helpers for the Parallel Protocol x402 facilitator.
This package is the contract between the facilitator server
(parallel-mcp/facilitator) and any client that talks to it
(@parallel-protocol/x402 SDK, custom integrations).
Install
npm install @parallel-protocol/x402-types viemviem is a peer dependency (used for Address / Hex typing only).
What's inside
import {
// Wire-format Zod schemas + inferred types
X402PaymentPayloadSchema,
TwoPhaseRequestSchema,
VerifyResponseSchema,
SettleResponseSchema,
PaymentRequirementsSchema,
type X402PaymentPayload,
type TwoPhaseRequest,
type PaymentRequirements,
} from "@parallel-protocol/x402-types";
import {
// EIP-712 domain + typehashes
buildEip712Domain,
TRANSFER_WITH_AUTHORIZATION_TYPES,
RECEIVE_WITH_AUTHORIZATION_TYPES,
SWAP_EXACT_OUTPUT_TYPEHASH,
SWAP_EXACT_INPUT_TYPEHASH,
} from "@parallel-protocol/x402-types/eip712";
import {
// EIP-3009 helpers — random nonce, validity window, typed data builders
generateNonce,
buildAuthorizationMessage,
buildTransferAuthorizationTypedData,
buildReceiveAuthorizationTypedData,
type Eip3009Domain,
type TransferAuthorization,
} from "@parallel-protocol/x402-types/eip3009";Contract stability
The schemas exported from this package — X402PaymentPayloadSchema,
TwoPhaseRequestSchema, VerifyResponseSchema, SettleResponseSchema,
ErrorResponseSchema — define the wire format consumed by the facilitator's
/verify, /settle, and /pay endpoints. Breaking changes require a major
bump of this package and a versioned endpoint on the facilitator running
in parallel during the migration window.
License
MIT
