Skip to content

v1.1.0 — x402 pay-per-verify support

Latest

Choose a tag to compare

@Joingithubstyle Joingithubstyle released this 16 Apr 18:44
· 4 commits to main since this release

Highlights

  • x402 pay-per-verify live on Solana mainnet. verifyWalletActivity() now accepts an optional options.xPayment parameter — pass a USDC transaction signature to authenticate B2B verify calls against uzproof.com ($0.05 USDC per call).
  • Back-compat. Existing 4-arg callers keep working. New 5th argument is optional and mirrors the SDK's own options?: { xPayment?: string } shape.
  • Tests. Added vitest plus prepublishOnly: test && build so the xPayment passthrough can't silently regress.

Changes

See CHANGELOG.md for the full list.

  • src/tools/verify.ts — 5th arg options?: { xPayment?: string }, @deprecated JSDoc on apiKey (Phase 2)
  • src/tools/verify.test.ts — 4 tests pinning passthrough + back-compat
  • vitest.config.ts — minimal test setup
  • package.json — dep @uzproof/verify^1.2.0, scripts test / test:watch / prepublishOnly, devDep vitest
  • README.md + CHANGELOG.md — x402 integration walkthrough, Keep-a-Changelog history

Install

```bash
npm install solana-agent-kit-plugin-uzproof@1.1.0
```

Usage

```typescript
import { PaymentRequiredError } from "@uzproof/verify";

try {
return await agent.methods.verifyWalletActivity(
agent, wallet, "defi_swap",
{ program_id: "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4", min_amount_usd: 10 },
);
} catch (err) {
if (err instanceof PaymentRequiredError) {
const scheme = (err.details as any).schemes[0];
const paymentSig = await sendUsdc(scheme.payTo, scheme.maxAmountRequired);
return await agent.methods.verifyWalletActivity(
agent, wallet, "defi_swap",
{ program_id: "...", min_amount_usd: 10 },
{ xPayment: paymentSig },
);
}
throw err;
}
```

Links

🤖 Generated with Claude Code