Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dieharye/blockchain-ai-agent
Blockchain-AI-Agent. This is the AI project to implement AI assistant to the blockchain.
https://github.com/dieharye/blockchain-ai-agent
agent ai assistant blockchain ethereum onchain
Last synced: 14 days ago
JSON representation
Blockchain-AI-Agent. This is the AI project to implement AI assistant to the blockchain.
- Host: GitHub
- URL: https://github.com/dieharye/blockchain-ai-agent
- Owner: dieharye
- License: mit
- Created: 2025-01-23T19:06:08.000Z (21 days ago)
- Default Branch: main
- Last Pushed: 2025-01-23T19:08:33.000Z (21 days ago)
- Last Synced: 2025-01-23T20:18:36.166Z (21 days ago)
- Topics: agent, ai, assistant, blockchain, ethereum, onchain
- Language: TypeScript
- Homepage:
- Size: 36.1 KB
- Stars: 8
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
---
# Blockchain AI Agent
**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.
---
## 🌟 Features
### 🚀 **Blockchain Operations**
#### **Solana Integration**
- **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#### **EVM Integration**
- **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---
### 🤖 **AI Features**
- **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---
## 📦 Installation
Install the library via npm:
```bash
npm install blockchain-ai-agent
```---
## 🔧 Configuration
To initialize the agent for Solana and EVM, provide your wallet credentials and the respective RPC URLs.
```typescript
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
});
```---
## 📃 Usage Examples
### **1. Mint and Transfer Tokens (Solana)**
```typescript
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,
});
```### **2. Swap Tokens (EVM)**
```typescript
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);
```### **3. Deploy an NFT Collection**
#### **Solana**
```typescript
const collection = await agent.solana.createCollection({
name: "AI Art",
symbol: "AIA",
uri: "https://example.com/collection-metadata.json",
});
```#### **EVM**
```typescript
const nft = await agent.evm.deployNFT({
name: "AI Art NFT",
symbol: "AIA",
baseUri: "https://example.com/nft-metadata/",
});
```### **4. Fetch Market Data**
#### **Solana**
```typescript
const solPrice = await agent.solana.getPrice("SOL/USD");
console.log("Current SOL Price:", solPrice);
```#### **EVM**
```typescript
const ethPrice = await agent.evm.getPrice("ETH/USD", "chainlink");
console.log("Current ETH Price:", ethPrice);
```---
## 🤖 AI Agent Integration
### **Natural Language Commands**
Integrate AI for processing blockchain tasks via natural language commands.```typescript
const result = await agent.ai.executeCommand("Create an NFT on Solana with 5% royalties");
console.log("AI Response:", result);
```### **NFT Artwork Generation**
Use DALL-E to generate custom NFT artwork.```typescript
const nftImage = await agent.ai.generateNFTArtwork({
prompt: "A futuristic AI in a neon city",
});
console.log("NFT Image URL:", nftImage);
```---
## 🌐 Supported Platforms
### Blockchain Networks:
- **Solana**
- **EVM-Compatible Chains**:
- Ethereum
- Binance Smart Chain
- Polygon
- Avalanche
- Fantom
- Arbitrum
- Optimism### AI Frameworks:
- OpenAI (ChatGPT, GPT-4)
- LangChain
- DALL-E---
## 📚 Documentation
Explore the full documentation at [docs.blockchain-ai-agent.com](https://docs.blockchain-ai-agent.com).
---
## 🛠️ Contributing
We welcome contributions! Please follow the guidelines in [CONTRIBUTING.md](CONTRIBUTING.md) to submit a PR.
---
## 🛡️ Security
**Important**: This toolkit involves sensitive operations like private key handling. Always use it in a secure environment.
---
## 🧧 Funding
If you’d like to support this open-source project, please donate to the treasury wallet:
- **Solana Address**: `DmUvVRb52eh9vGhkbAkNNaFju5RWHZAJZuxg6sUqVdkZ`
- **EVM Address**: `0xCb4097624472e367983720CC915ed6ff948081C1`---
## Contact
https://t.me/dieharye
https://x.com/dieharye
Let me know if you'd like to tweak any section or add further customizations!