| Crates.io | rig-onchain-kit |
| lib.rs | rig-onchain-kit |
| version | 1.0.0 |
| created_at | 2025-02-06 20:52:22.429064+00 |
| updated_at | 2025-02-27 23:05:41.32096+00 |
| description | Blockchain actions for AI agents |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1546065 |
| size | 507,367 |
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.
# 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(())
}
Read the full documentation to learn more
build with <3 by listen