Skip to content

uzproof/solana-agent-kit-plugin-uzproof

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

solana-agent-kit-plugin-uzproof

npm License: MIT

Solana Agent Kit plugin for UZPROOF — verify real on-chain usage on Solana. Supports x402 pay-per-verify on mainnet.

Install

npm install solana-agent-kit-plugin-uzproof

Usage

import { SolanaAgentKit } from "solana-agent-kit";
import UzproofPlugin from "solana-agent-kit-plugin-uzproof";

const agent = new SolanaAgentKit(wallet, rpcUrl, {}).use(UzproofPlugin);

Free tools (no payment)

// Detect a protocol from a program ID
const info = await agent.methods.detectProtocol(
  agent,
  "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
);

// Fetch token metadata + live price
const token = await agent.methods.getTokenInfo(
  agent,
  "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN",
);

// Read on-chain SAS attestation status
const status = await agent.methods.checkAttestation(agent, "7H4RVL...");

Paid verify (x402)

verifyWalletActivity() is gated behind x402 — programmatic callers pay $0.05 USDC per call on Solana mainnet. Pass the USDC transaction signature via options.xPayment:

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

async function verifyJupiterSwap(wallet: string) {
  try {
    // First attempt — will 402 with payment schema
    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];

      // Sign + broadcast a USDC transfer to scheme.payTo for
      // scheme.maxAmountRequired (use @solana/web3.js + @solana/spl-token).
      const paymentSig = await sendUsdc(scheme.payTo, scheme.maxAmountRequired);

      // Retry with X-Payment signature
      return await agent.methods.verifyWalletActivity(
        agent,
        wallet,
        "defi_swap",
        { program_id: "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4", min_amount_usd: 10 },
        { xPayment: paymentSig },
      );
    }
    throw err;
  }
}

API keys (OTHER_API_KEYS.UZPROOF_API_KEY) are reserved for a future Phase 2 release. They're still accepted by the SDK for forward compatibility but produce 401 on the live API today. Use xPayment.

Actions (natural-language)

AI agents can invoke these actions via natural language:

Action Trigger phrases Description
UZPROOF_VERIFY_WALLET_ACTIVITY "verify wallet swapped", "check if holds" Verify on-chain activity across 15 protocols (requires agent-side x402 payment)
UZPROOF_DETECT_PROTOCOL "what protocol is this", "detect program" Auto-detect protocol from program ID
UZPROOF_GET_TOKEN_INFO "token price", "token info" Fetch token metadata and live price
UZPROOF_CHECK_ATTESTATION "check attestation", "proof of use" Check SAS on-chain attestation

The UZPROOF_VERIFY_WALLET_ACTIVITY action schema deliberately omits xPayment — LLM tool invocations shouldn't auto-spend USDC. If you want an AI agent to pay, wrap the action in your own handler that signs and injects the payment.

Supported Protocols

Jupiter, Marinade, Sanctum, Orca, Raydium, Drift, Drift Vaults, Kamino, MarginFi, Meteora, Jito, Tensor, Magic Eden, Metaplex, SPL Token.

Supported Action Types (26)

defi_swap, defi_swap_buy, defi_swap_sell, defi_swap_volume, defi_hold_token, defi_hold_stablecoin, defi_hold_staked, defi_hold_token_duration, defi_hold_lp, defi_stake_sol, defi_add_liquidity, defi_bridge, defi_lend, defi_borrow, defi_vote, defi_repay, defi_claim, defi_create_lst, defi_perp_trade, defi_perp_volume, nft_hold, nft_mint, nft_check, token_balance, tx_verify, gaming_play.

Links

License

MIT

About

Solana Agent Kit plugin for UZPROOF — verify real on-chain usage (swaps, staking, holdings, NFTs) across 14 Solana protocols. Anti-fraud scoring and SAS attestation.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors