@v402pay/core
v0.3.0
Published
v402pay types, canonicalization, hashing, and Solana verification
Maintainers
Readme
@v402pay/core
Crypto primitives, types, hashing, Solana verification, and receipt signing for the v402 payment protocol.
Install
npm install @v402pay/coreUsage
import { requestHash, verifySolanaPayment, signReceipt } from "@v402pay/core";
// Hash a request for intent binding
const hash = requestHash("POST", "/api/tool", "", '{"q":"hello"}', "application/json");
// Verify a Solana payment matches an intent
const result = await verifySolanaPayment({ txSig, intent, rpcUrl, usdcMint });
// Sign a receipt with Ed25519
const sig = await signReceipt(receiptPayload, privateKeySeed);