Crate solana_ai_registries

Crate solana_ai_registries 

Source
Expand description

§Solana AI Registries SDK

This crate provides a Rust SDK for interacting with the Solana AI Registries, which includes both Agent Registry and MCP Server Registry protocols.

§Features

  • Agent Registry: Register, update, and manage autonomous agents
  • MCP Server Registry: Register, update, and manage Model Context Protocol servers
  • Payment Systems: Support for prepay, pay-as-you-go, and streaming payments
  • Type Safety: Fully typed requests and responses
  • Error Handling: Comprehensive error types matching on-chain program errors

§Feature Flags

  • stream: Enable streaming payment functionality
  • pyg: Enable pay-as-you-go payment functionality
  • prepay: Enable prepaid payment functionality

§Example Usage

use solana_ai_registries::{SolanaAiRegistriesClient, AgentBuilder};
use solana_sdk::signer::keypair::Keypair;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Create a client
    let client = SolanaAiRegistriesClient::new("https://api.devnet.solana.com");
     
    // Build and register an agent
    let agent = AgentBuilder::new("my-agent", "My AI Agent")
        .description("An AI agent that does useful things")
        .version("1.0.0")
        .build()?;
     
    let keypair = Keypair::new();
    let signature = client.register_agent(&keypair, agent).await?;
    println!("Agent registered with signature: {}", signature);
     
    Ok(())
}

Re-exports§

pub use client::deserialize_account_data;
pub use client::SolanaAiRegistriesClient;
pub use errors::SdkError;
pub use errors::SdkResult;
pub use agent::AgentArgs;
pub use agent::AgentBuilder;
pub use agent::AgentEntry;
pub use agent::AgentPatch;
pub use agent::AgentRegistry;
pub use agent::AgentSkill;
pub use agent::AgentStatus;
pub use agent::ServiceEndpoint;
pub use mcp::McpPromptDefinition;
pub use mcp::McpResourceDefinition;
pub use mcp::McpServerArgs;
pub use mcp::McpServerBuilder;
pub use mcp::McpServerEntry;
pub use mcp::McpServerPatch;
pub use mcp::McpServerRegistry;
pub use mcp::McpServerStatus;
pub use mcp::McpToolDefinition;

Modules§

agent
Agent Registry SDK module
client
RPC client wrapper for Solana AI Registries
errors
Error types for the Solana AI Registries SDK
idl
IDL definitions for compile-time inclusion
mcp
MCP Server Registry SDK module

Structs§

Keypair
A vanilla Ed25519 key pair
Pubkey
The address of a Solana account.
Signature

Constants§

AGENT_REGISTRY_VERSION
Current registry versions supported
MCP_SERVER_REGISTRY_VERSION
VERSION
SDK version

Traits§

Signer
The Signer trait declares operations that all digital signature providers must support. It is the primary interface by which signers are specified in Transaction signing interfaces