x402pp-indexer
Analytics and reputation tracking for providers
X402Indexer
Initialize Indexer
import { X402Indexer } from 'x402pp-indexer';
const indexer = new X402Indexer({
connection: new Connection('https://api.devnet.solana.com')
});Index Receipts
// Index a receipt
indexer.indexReceipt(receipt);
// Index a session
indexer.indexSession(session);Get Provider Reputation
const reputation = indexer.getProviderReputation(providerPubkey);
console.log(reputation);
// {
// providerPubkey: "...",
// score: 95, // 0-100
// totalRequests: 1000,
// slaComplianceRate: 0.95,
// averageLatency: 1234,
// disputeRate: 0.02
// }Get Market Analytics
const analytics = indexer.getMarketAnalytics('gpt-4-inference');
console.log(analytics);
// {
// capability: "gpt-4-inference",
// averagePrice: 0.015,
// priceRange: { min: 0.008, max: 0.025 },
// totalVolume: 1000.50,
// providerCount: 12
// }