2 releases (1 stable)
1.0.0 | Feb 27, 2025 |
---|---|
0.1.0 | Feb 6, 2025 |
#919 in Magic Beans
298 downloads per month
205KB
6K
SLoC
Rig Onchain Kit
A rig companion crate for building AI-powered applications that interact natively with blockchain networks built in partnership with listen. Combines LLM capabilities with secure blockchain operations to create intelligent agents capable of executing complex on-chain interactions across Solana and EVM networks.
Features
- Dual-chain Support - Native support for Solana and EVM ecosystems
- Secure by Design - Thread-local signer isolation and Privy-based authentication
- Real-time Streaming - SSE-enabled HTTP service for concurrent user sessions
- Extensible Tool System - Combine prebuilt DeFi operations with custom logic
- Wallet Agnostic - Supports local key management and Privy-embedded wallets
Quick Start
# Add to your project
cargo add rig-onchain-kit --features full
# For custom tools
cargo add rig-tool-macro
Basic usage:
use rig_onchain_kit::agent::create_solana_agent;
use rig_onchain_kit::signer::SignerContext;
use rig_onchain_kit::signer::solana::LocalSolanaSigner;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let private_key = std::env::var("SOLANA_PRIVATE_KEY")?;
let signer = LocalSolanaSigner::new(private_key);
SignerContext::with_signer(Arc::new(signer), async {
let agent = create_solana_agent();
let response = agent.prompt("what is my public key?")?);
println!("{}", response);
});
Ok(())
}
Documentation
Read the full documentation to learn more
License
build with <3 by listen
Dependencies
~31–59MB
~1M SLoC