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 solagent::{Config, SolanaAgentKit, create_solana_tools};
#[tokio::main]
async fn main() {
let config = Config { openai_api_key: Some("your_api_key".to_string()),
..Default::default() };
let agent = SolanaAgentKit::new("private_key", "RPC_URL", config);
let toolset = create_solana_tools(agent);
}
Get Balance
use solagent::{Config, SolanaAgentKit};
#[tokio::main]
async fn main() {
let config = Config { openai_api_key: Some("your_api_key".to_string()),
..Default::default() };
let agent = SolanaAgentKit::new("private_key", "RPC_URL", config);
let balance = agent.get_balance(None).await.unwrap();
println!("My balance: {}", balance);
}
Re-exports§
pub use ::helius;
pub use anyhow;
pub use async_trait;
pub use base64;
pub use bincode;
pub use lazy_static;
pub use mpl_token_metadata;
pub use reqwest;
pub use rig;
pub use serde;
pub use serde_json;
pub use solana_account_decoder;
pub use solana_client;
pub use solana_program;
pub use solana_sdk;
pub use spl_associated_token_account;
pub use spl_token;
pub use spl_token_2022;
pub use thiserror;
Modules§
- create_
solana_ tools - deploy_
collection - deploy_
token - fetch_
price - get_
balance_ other - get_
wallet_ address - gibwork
- goplus
- jupiter
- launch_
token_ pumpfun - mint_
nft - pyth_
fetch_ price - rugcheck
- solana
- solayer
- stake_
with_ jup - trade
Structs§
- Config
- NFTMetadata
- Metadata for deploying an NFT/Collection.
- Solana
Agent Kit - Represents a Solana agent that interacts with the blockchain. Provides a unified interface for token operations, NFT management, trading and more
Functions§
- create_
solana_ tools - An function to build a set of tools that can be used with Solana.