Soroban AgentKit is a production-grade, modular TypeScript toolkit and SDK that connects autonomous AI agents (ElizaOS, LangChain, CrewAI, AutoGen, and OpenAI function calling) directly to the Stellar blockchain and Soroban smart contracts.
Empower your LLMs to query balances, transfer native XLM or SAC tokens, simulate and invoke Soroban contracts, and interact with the decentralized financial ecosystem in natural language.
graph TD
User([User Prompt / Autonomous Goal]) --> AgentRuntime[AI Agent: ElizaOS / LangChain / OpenAI]
AgentRuntime -->|Structured Tool Call| AgentKit[🦀 Soroban AgentKit SDK]
subgraph "Soroban AgentKit Core"
AgentKit --> ToolRegistry[Tool Registry: Balance, Transfer, Contract Call]
AgentKit --> Signer[🔐 Secure Ed25519 Keypair Signer]
AgentKit --> XDRSerializer[XDR Type Parser & Soroban Serializer]
end
Signer --> RPCClient[Stellar Horizon & Soroban RPC]
XDRSerializer --> RPCClient
RPCClient --> SorobanHost[📜 Soroban Smart Contracts WASM]
RPCClient --> StellarLedger[⛓️ Stellar Ledger Settlement XLM / USDC]
- ⚡ Lightweight & Modular: Zero unnecessary bloat. Pure TypeScript with first-class
@stellar/stellar-sdksupport. - 🤖 Universal Framework Adapters: Out-of-the-box adapters for OpenAI / Anthropic Function Calling, LangChain Structured Tools, and ElizaOS Actions.
- 🔐 Secure Key Management: Client-side transaction signing with Stellar Keypairs. Private keys never leave your runtime environment.
- 📦 Smart Contract Support: Seamlessly simulate and execute invocations on any deployed Soroban smart contract with automatic type serializations.
- 🌐 Multi-Network Ready: First-class support for
testnet,mainnet, and localstandalonenetworks.
npm install soroban-agentkitimport { SorobanAgentKit, toOpenAITools } from 'soroban-agentkit';
// Initialize with your Stellar secret key
const agent = new SorobanAgentKit({
secretKey: process.env.STELLAR_SECRET_KEY!,
network: 'testnet' // 'testnet' | 'mainnet' | 'standalone'
});
console.log('Agent Public Key:', agent.getPublicKey());
console.log('Network:', agent.getNetwork());import OpenAI from 'openai';
import { SorobanAgentKit, toOpenAITools } from 'soroban-agentkit';
const agent = new SorobanAgentKit({ secretKey: process.env.STELLAR_SECRET_KEY! });
const tools = agent.getTools();
const openaiTools = toOpenAITools(tools);
const openai = new OpenAI();
const response = await openai.chat.completions.create({
model: 'gpt-4o-mini',
messages: [{ role: 'user', content: 'What is my current XLM balance?' }],
tools: openaiTools
});import { SorobanAgentKit, toLangChainTools } from 'soroban-agentkit';
const agent = new SorobanAgentKit({ secretKey: process.env.STELLAR_SECRET_KEY! });
const langchainTools = toLangChainTools(agent.getTools());| Tool Name | Description |
|---|---|
stellar_get_balance |
Queries native XLM and issued asset balances for any Stellar address. |
stellar_transfer_token |
Sends native XLM or assets to a recipient with an optional memo. |
stellar_get_account_info |
Retrieves account sequence, thresholds, subentry count, and active signers. |
soroban_call_contract |
Simulates and executes smart contract function calls with arguments. |
# Clone the repository
git clone https://github.com/Ranjeet2063/soroban-agentkit.git
cd soroban-agentkit
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run unit tests
npm testNeed to integrate autonomous AI agents into your Web3 protocol, build custom Soroban tool plugins, or audit your smart contracts?
- Author & Architect: Ranjeet Kumar Gupta (Full-Stack Web3 & Soroban Engineer)
- 💬 Telegram: @guptakumarranjeet
- 📧 Direct Email: guptakumarranjeet150@gmail.com
- 🚀 Available for Full-Time Remote Roles, Protocol Architecture & High-Impact Consulting Contracts.
Contributions are warmly welcome! Please see CONTRIBUTING.md for details on submitting pull requests and reporting issues.
This project is licensed under the MIT License.