Blockchain AI Agent is an open-source framework that enables developers to integrate AI-powered agents with Solana and EVM (Ethereum Virtual Machine) blockchains. With built-in tools and streamlined APIs, the agent empowers developers to perform advanced blockchain operations autonomously using AI models.
- Token Management
- Mint SPL tokens
- Transfer assets
- Stake SOL
- Execute compressed airdrops
- NFT Utilities
- Create and list NFTs with Metaplex
- Build collections and marketplaces
- DeFi Protocols
- Swap tokens with Jupiter
- Manage liquidity with Raydium and Orca
- Lend and borrow assets on Solana platforms
- Market Data
- Fetch Pyth price feeds
- Resolve domains with SNS
- Advanced Actions
- Execute transactions via Jito bundles
- Manage perpetuals with Drift Protocol
- Smart Contract Interaction
- Deploy, call, and manage Solidity-based contracts
- Execute ERC20/721 operations
- Token Management
- Launch tokens (ERC20) with custom parameters
- Transfer assets across wallets
- DeFi Protocols
- Trade tokens on Uniswap, PancakeSwap, and other DEXs
- Stake assets on popular EVM protocols
- Fetch market data using Chainlink price oracles
- NFT Operations
- Mint, transfer, and list NFTs for sale
- Manage metadata and royalties
- Autonomous Execution
- AI agents can independently perform blockchain actions
- Configurable decision-making and execution intervals
- LangChain Integration
- Prebuilt tools for natural language command execution
- Support for memory and persistent interactions
- Multi-Blockchain Compatibility
- Seamless switching between Solana and EVM blockchains
- Customizable Workflows
- Extendable modules for task-specific AI agents
- Fully typed APIs for TypeScript developers
Install the library via npm:
npm install blockchain-ai-agent
To initialize the agent for Solana and EVM, provide your wallet credentials and the respective RPC URLs.
import { BlockchainAIAgent } from "blockchain-ai-agent";
const agent = new BlockchainAIAgent({
solana: {
privateKey: "your-solana-wallet-private-key",
rpcUrl: "https://api.mainnet-beta.solana.com",
},
evm: {
privateKey: "your-evm-wallet-private-key",
rpcUrl: "https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID",
},
aiApiKey: "your-openai-api-key", // Optional for AI-driven actions
});
const tokenMint = await agent.solana.mintToken({
name: "AI Token",
symbol: "AIT",
uri: "https://example.com/metadata.json",
decimals: 9,
supply: 1000000,
});
await agent.solana.transfer({
mint: tokenMint,
to: "recipient-wallet-address",
amount: 100,
});
const tx = await agent.evm.swapTokens({
dex: "uniswap",
inputToken: "USDT",
outputToken: "ETH",
amount: 100, // USDT amount
slippage: 1, // 1%
});
console.log("Swap Transaction Hash:", tx);
const collection = await agent.solana.createCollection({
name: "AI Art",
symbol: "AIA",
uri: "https://example.com/collection-metadata.json",
});
const nft = await agent.evm.deployNFT({
name: "AI Art NFT",
symbol: "AIA",
baseUri: "https://example.com/nft-metadata/",
});
const solPrice = await agent.solana.getPrice("SOL/USD");
console.log("Current SOL Price:", solPrice);
const ethPrice = await agent.evm.getPrice("ETH/USD", "chainlink");
console.log("Current ETH Price:", ethPrice);
Integrate AI for processing blockchain tasks via natural language commands.
const result = await agent.ai.executeCommand("Create an NFT on Solana with 5% royalties");
console.log("AI Response:", result);
Use DALL-E to generate custom NFT artwork.
const nftImage = await agent.ai.generateNFTArtwork({
prompt: "A futuristic AI in a neon city",
});
console.log("NFT Image URL:", nftImage);
- Solana
- EVM-Compatible Chains:
- Ethereum
- Binance Smart Chain
- Polygon
- Avalanche
- Fantom
- Arbitrum
- Optimism
- OpenAI (ChatGPT, GPT-4)
- LangChain
- DALL-E
Explore the full documentation at docs.blockchain-ai-agent.com.
We welcome contributions! Please follow the guidelines in CONTRIBUTING.md to submit a PR.
Important: This toolkit involves sensitive operations like private key handling. Always use it in a secure environment.
If youβd like to support this open-source project, please donate to the treasury wallet:
- Solana Address:
DmUvVRb52eh9vGhkbAkNNaFju5RWHZAJZuxg6sUqVdkZ
- EVM Address:
0xCb4097624472e367983720CC915ed6ff948081C1
Let me know if you'd like to tweak any section or add further customizations!