Highlights
- x402 pay-per-verify live on Solana mainnet.
verifyWalletActivity()now accepts an optionaloptions.xPaymentparameter — 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
vitestplusprepublishOnly: test && buildso the xPayment passthrough can't silently regress.
Changes
See CHANGELOG.md for the full list.
src/tools/verify.ts— 5th argoptions?: { xPayment?: string },@deprecatedJSDoc onapiKey(Phase 2)src/tools/verify.test.ts— 4 tests pinning passthrough + back-compatvitest.config.ts— minimal test setuppackage.json— dep@uzproof/verify→^1.2.0, scriptstest/test:watch/prepublishOnly, devDepvitestREADME.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