@v402pay/sdk
v0.3.1
Published
v402pay client: 402 → pay → retry with wallet adapter
Maintainers
Readme
@v402pay/sdk
Client SDK for the v402 payment protocol — handles the 402 → pay → retry flow with wallet adapters.
Install
npm install @v402pay/sdkUsage
import { createV402Client, createKeypairAdapter } from "@v402pay/sdk";
const adapter = createKeypairAdapter({ keypair, rpcUrl });
const { fetch } = createV402Client({ walletAdapter: adapter });
// Automatically handles 402 → pay on Solana → retry with proof → 200
const res = await fetch("https://api.example.com/tool", { method: "POST", body: "{}" });
console.log(res.status); // 200CLI
npx @v402pay/sdk https://api.example.com/tool