Crate solagent

Source
Expand description

solagent.rs: Bridging the Gap Between AI and Solana protocols
solagent.rs is an open-source Rust library designed to streamline the integration of AI agents with Solana protocols. Built upon the rig framework, solagent.rs empowers developers to construct portable, modular, and lightweight full-stack AI agents capable of interacting with the Solana blockchain.
This powerful toolkit simplifies agent-to-blockchain communication, offering a comprehensive suite of functions for tasks such as token operations, trading, and more. By leveraging solagent.rs, developers can seamlessly connect their AI agents to the Solana ecosystem, unlocking a world of possibilities for on-chain automation and intelligent decision-making.

Quick Start

use std::sync::Arc;
use solagent::{AgentProvider, SolanaAgentKit, create_solana_tools};
#[tokio::main]
async fn main() {
    let agent = Arc::new(SolanaAgentKit::new("private_key_bs58",
                                        "rpc_url",
                         AgentProvider::OpenAI("key".into())));
    let toolset = create_solana_tools(agent);
}

Get Balance

use std::sync::Arc;
use solagent::{AgentProvider, SolanaAgentKit};

#[tokio::main]
async fn main() {
    let agent = Arc::new(SolanaAgentKit::new("private_key_bs58",
                                        "rpc_url",
                         AgentProvider::OpenAI("key".into())));
   let balance = agent.get_balance(None).await.unwrap();
   println!("My balance: {}", balance);
}

Modules§

Structs§

  • Metadata for deploying an NFT/Collection.
  • Represents a Solana agent that interacts with the blockchain. Provides a unified interface for token operations, NFT management, trading and more

Enums§

Functions§