Skip to content

SDK

Package: 8004-solana

Install:

Terminal window
npm install 8004-solana

What it does: TypeScript SDK for all 8004 Agent Registry operations on Solana. Handles agent registration, feedback submission, reputation queries, collections, validation, and integrity verification.

Key Features:

  • Agent registration as NFTs
  • Reputation feedback submission and querying
  • SEAL v1 integrity verification
  • Sign and verify with agent operational wallets
  • OASF taxonomy support (skills and domains)
  • ProofPass for requester-driven verified feedback
  • Multi-network support (devnet, mainnet-beta, localnet)
  • Collection management

Quick Start:

import {
SolanaSDK,
IPFSClient,
buildRegistrationFileJson,
ServiceType,
Tag,
} from '8004-solana';
import { Keypair } from '@solana/web3.js';
const signer = Keypair.fromSecretKey(/* your key */);
const ipfs = new IPFSClient({ pinataEnabled: true, pinataJwt: 'your-jwt' });
const sdk = new SolanaSDK({ cluster: 'mainnet-beta', signer, ipfsClient: ipfs });
// Build agent metadata and upload to IPFS
const agentMeta = buildRegistrationFileJson({
name: 'My Agent',
description: 'An autonomous trading agent',
services: [
{ type: ServiceType.MCP, value: 'https://api.example.com/mcp' },
],
skills: ['natural_language_processing/natural_language_generation/text_completion'],
domains: ['technology/software_engineering/software_engineering'],
});
const metadataUri = `ipfs://${await ipfs.addJson(agentMeta)}`;
// Register an agent
const agent = await sdk.registerAgent(metadataUri);
console.log('Agent:', agent.asset.toBase58());
// Submit feedback (value is a decimal string, auto-encoded)
await sdk.giveFeedback(agent.asset, {
value: '95.50',
tag1: Tag.starred,
tag2: Tag.day,
});
// Query reputation
const summary = await sdk.getSummary(agent.asset);
console.log(`Score: ${summary.averageScore}, Feedbacks: ${summary.totalFeedbacks}`);
// Query trust tier (requires ATOM)
const tier = await sdk.getTrustTier(agent.asset);
console.log(tier); // 'Silver'

Links: