npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

prova-agent-sdk

v0.1.6

Published

Behavior attestation SDK for AI agents on Solana — wrap any agent action in a cryptographic receipt

Readme

prova-agent-sdk

Official TypeScript SDK for Prova — behavior attestation for AI agents on Solana.

Wrap any agent action in a cryptographic receipt. Every action your agent executes gets sealed on-chain as an immutable record, verifiable by anyone without depending on off-chain logs.

Install

npm install prova-agent-sdk

Quick Start

import { ProvaClient, ProvaApiClient, AttestationBuilder } from 'prova-agent-sdk';
import { Keypair } from '@solana/web3.js';

// ── On-chain: register & attest ─────────────────────────────────────────────
const prova = new ProvaClient({
  rpcUrl: 'https://api.devnet.solana.com',
  agentKeypair: Keypair.fromSecretKey(agentSecretBytes),
});

// Register your agent on-chain (once per operator)
const { agentPda } = await prova.registerAgent({ operatorKeypair });

// Attest an action
const payload = AttestationBuilder.transaction('your-tx-signature', { amount: 100, token: 'USDC' });
const hash = await ProvaClient.hashAction(JSON.stringify(payload));

const { txSignature, explorerUrl } = await prova.attest({
  operatorKeypair,
  actionHash: hash,
  actionType: 'Transaction',
});

console.log('Receipt:', explorerUrl);

// ── Off-chain: query indexed data ────────────────────────────────────────────
const api = new ProvaApiClient({
  apiUrl: 'https://prova-api.fly.dev',
  apiKey: 'prova_...', // required for premium endpoints
});

const { data, pagination } = await api.listAttestations({ agentPda: agentPda.toBase58(), limit: 10 });

API

new ProvaClient(config) — on-chain client

| Parameter | Type | Description | |---|---|---| | rpcUrl | string | Solana RPC URL (devnet or mainnet) | | agentKeypair | Keypair | Agent keypair — signs each action hash off-chain via Ed25519 | | programId | string (optional) | Prova program ID. Defaults to the deployed devnet program |

prova.registerAgent(params)

Registers the agent on-chain and creates the AgentAccount PDA. Call once per operator.

const { txSignature, agentPda, explorerUrl } = await prova.registerAgent({
  operatorKeypair,
  policyRoot, // optional — 32-byte Merkle root
});

prova.attest(params)

Emits a single attestation on-chain.

const { txSignature, explorerUrl } = await prova.attest({
  operatorKeypair,
  actionHash,   // 32-byte sha256 of the action payload
  actionType,   // see Action Types table below
  privacyMode,  // optional — hash stays on-chain, payload stays off-chain
});

prova.batchAttest(params)

Emits up to 100 attestations in a single transaction.

await prova.batchAttest({
  operatorKeypair,
  attestations: [
    { actionHash: hash1, actionType: 'Transaction' },
    { actionHash: hash2, actionType: 'ToolCall' },
  ],
});

prova.getAgentAccount(operator)

Fetches the on-chain AgentAccount.

const account = await prova.getAgentAccount(operatorKeypair.publicKey);
console.log(account.attestationCount);

prova.isAgentActive(operator)

Returns true if the agent is registered and not revoked.

prova.revokeAgent(params)

Revokes the agent. Irreversible — attestations after this point will fail.

prova.updatePolicyRoot(params)

Updates the 32-byte Merkle policy root without re-registering.

ProvaClient.hashAction(data) (static)

SHA-256 hashes any string into a 32-byte Uint8Array.

const hash = await ProvaClient.hashAction('any string or JSON');

new ProvaApiClient(config) — REST API client

Query the indexed attestation data without touching Solana directly.

| Parameter | Type | Description | |---|---|---| | apiUrl | string | Prova API base URL — https://prova-api.fly.dev | | apiKey | string (optional) | prova_... key. Required for premium endpoints |

Public endpoints (no API key)

// List attestations with optional filters
const { data, pagination } = await api.listAttestations({
  agentPda: '...',
  actionType: 'Transaction',
  from: '2026-01-01T00:00:00Z',
  limit: 50,
  offset: 0,
});

// Get a single attestation
const attestation = await api.getAttestation(pda);

// Verify an attestation exists
const { valid, attestation } = await api.verifyAttestation(pda);

// Get agent info
const agent = await api.getAgent(agentId);

// Get agent stats + recent attestations
const stats = await api.getAgentStats(agentId);

Premium endpoints (API key required)

// Verify up to 1000 attestations in one call
const results = await api.bulkVerify([pda1, pda2, pda3]);

// Full attestation history (up to 1000)
const { agent, data } = await api.getFullHistory(agentId);

// Forensic report with summary stats
const { agent, summary } = await api.getForensicReport(agentId);

AttestationBuilder

Fluent builder for typed attestation payloads.

// Static factory methods
AttestationBuilder.transaction(txSignature, extraFields?)
AttestationBuilder.toolCall(toolName, args?)
AttestationBuilder.modelInvocation(model, promptHash, extra?)
AttestationBuilder.decision(choice, rationale?, extra?)
AttestationBuilder.resourceAccess(resource, method, extra?)
AttestationBuilder.policyCheck(policy, 'pass' | 'fail', extra?)
AttestationBuilder.custom(payload, metadata?)

// Or fluent builder
const payload = new AttestationBuilder()
  .setActionType('Decision')
  .setPayload({ decision: 'approve', confidence: 0.97 })
  .setMetadata({ agentVersion: '1.0.0' })
  .build();

const hash = await ProvaClient.hashAction(JSON.stringify(payload));

Action Types

| Type | Use case | |---|---| | Transaction | On-chain transaction executed by the agent | | Decision | Autonomous decision made by the agent | | ModelInvocation | LLM or model call made by the agent | | ToolCall | External tool or function called by the agent | | ResourceAccess | Data read or external resource fetched | | PolicyCheck | Policy or permission check evaluated | | Custom | Any other action type |

Privacy Mode (Vanish)

Pass privacyMode: true to keep the action hash on-chain while the payload stays off-chain. Enables selective disclosure without revealing content.

await prova.attest({
  operatorKeypair,
  actionHash: hash,
  privacyMode: true,
});

Links

License

Apache-2.0