Skip to content

Blockchain-AI-Agent. This is the AI project to implement AI assistant to the blockchain (EVM, Solana).

Notifications You must be signed in to change notification settings

dieharye/blockchain-AI-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

41 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


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:

npm install blockchain-ai-agent

πŸ”§ Configuration

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
});

πŸ“ƒ Usage Examples

1. Mint and Transfer Tokens (Solana)

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)

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

const collection = await agent.solana.createCollection({
  name: "AI Art",
  symbol: "AIA",
  uri: "https://example.com/collection-metadata.json",
});

EVM

const nft = await agent.evm.deployNFT({
  name: "AI Art NFT",
  symbol: "AIA",
  baseUri: "https://example.com/nft-metadata/",
});

4. Fetch Market Data

Solana

const solPrice = await agent.solana.getPrice("SOL/USD");
console.log("Current SOL Price:", solPrice);

EVM

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.

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.

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.


πŸ› οΈ Contributing

We welcome contributions! Please follow the guidelines in 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!

About

Blockchain-AI-Agent. This is the AI project to implement AI assistant to the blockchain (EVM, Solana).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published