solana-agent-kit
它能做什么
这项技能指导使用 Solana Agent Kit 构建 AI 智能体,该工具包让 AI 模型能够执行区块链操作。它适合希望打造能与 Solana 协作的 AI 助手的开发者。
适用场景
- ✓当你希望 AI 智能体能在 Solana 上发行代币、交易或质押的时候。
- ✓当你要把 Solana 操作接入 LangChain、Vercel AI SDK 或 MCP 服务器时。
- ✓当你希望打造具备错误恢复能力的自主 Solana 智能体的时候。
技能链接
https://github.com/internet-court/internet-court-skill/blob/main/vendored/sendaifun/solana-agent-kit/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能用 Solana Agent Kit 设置一个 AI 智能体,让它能查询我的余额并兑换代币吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会安装核心工具包和你需要的插件,从环境变量中设置 RPC 地址和钱包密钥,并将这些操作连接到你的 AI 模型。它既可以交互运行,也可以完全自主运行。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Solana Agent Kit Development Guide
Build AI agents that autonomously execute 60+ Solana blockchain operations using SendAI's open-source toolkit. Compatible with LangChain, Vercel AI SDK, and Claude via MCP.
Overview
The Solana Agent Kit enables any AI model to:
- Deploy and manage tokens (SPL & Token-2022)
- Create and trade NFTs via Metaplex
- Execute DeFi operations (Jupiter, Raydium, Orca, Meteora)
- Stake SOL, bridge tokens, register domains
- Run in interactive or fully autonomous modes
Key Features
| Feature | Description |
|---|---|
| 60+ Actions | Token, NFT, DeFi, staking, bridging operations |
| Plugin Architecture | Modular - use only what you need |
| Multi-Framework | LangChain, Vercel AI SDK, MCP, Eliza |
| Model Agnostic | Works with OpenAI, Claude, Llama, Gemini |
| Autonomous Mode | Hands-off execution with error recovery |
Quick Start
Installation
# Core package
npm install solana-agent-kit
# With plugins (recommended)
npm install solana-agent-kit \
@solana-agent-kit/plugin-token \
@solana-agent-kit/plugin-nft \
@solana-agent-kit/plugin-defi \
@solana-agent-kit/plugin-misc \
@solana-agent-kit/plugin-blinks
Environment Setup
# .env file
OPENAI_API_KEY=your_openai_api_key
RPC_URL=https://api.mainnet-beta.solana.com # or devnet
SOLANA_PRIVATE_KEY=your_base58_private_key
# Optional API keys for enhanced features
COINGECKO_API_KEY=your_coingecko_key
HELIUS_API_KEY=your_helius_key
Basic Agent Setup
import {
SolanaAgentKit,
createVercelAITools,
KeypairWallet,
} from "solana-agent-kit";
import { Keypair } from "@solana/web3.js";
import bs58 from "bs58";
// Import plugins
import TokenPlugin from "@solana-agent-kit/plugin-token";
import NFTPlugin from "@solana-agent-kit/plugin-nft";
import DefiPlugin from "@solana-agent-kit/plugin-defi";
import MiscPlugin from "@solana-agent-kit/plugin-misc";
import BlinksPlugin from "@solana-agent-kit/plugin-blinks";
// Create wallet from private key
const privateKey = bs58.decode(process.env.SOLANA_PRIVATE_KEY!);
const keypair = Keypair.fromSecretKey(privateKey);
const wallet = new KeypairWallet(keypair);
// Initialize agent with plugins
const agent = new SolanaAgentKit(
wallet,
process.env.RPC_URL!,
{
OPENAI_API_KEY: process.env.OPENAI_API_KEY!,
}
)
.use(TokenPlugin)
.use(NFTPlugin)
.use(DefiPlugin)
.use(MiscPlugin)
.use(BlinksPlugin);
// Create tools for AI framework
const tools = createVercelAITools(agent, agent.actions);
Plugins & Actions
Token Plugin (@solana-agent-kit/plugin-token)
| Action | Description |
|---|---|
deployToken |
Deploy new SPL token or Token-2022 |
transfer |
Transfer SOL or SPL tokens |
getBalance |
Check token balances |
stake |
Stake SOL via Jupiter/Solayer |
bridge |
Bridge tokens via Wormhole |
rugCheck |
Analyze token safety |
// Deploy a new token
const result = await agent.methods.deployToken({
name: "My Token",
symbol: "MTK",
decimals: 9,
initialSupply: 1000000,
});
// Transfer tokens
await agent.methods.transfer({
to: "recipient_address",
amount: 100,
mint: "token_mint_address", // optional, defaults to SOL
});
// Check balance
const balance = await agent.methods.getBalance({
tokenAddress: "token_mint_address", // optional
});
NFT Plugin (@solana-agent-kit/plugin-nft)
| Action | Description |
|---|---|
createCollection |
Create NFT collection via Metaplex |
mintNFT |
Mint NFT to collection |
listNFT |
List NFT on marketplaces |
updateMetadata |
Update NFT metadata |
// Create collection
const collection = await agent.methods.createCollection({
name: "My Collection",
symbol: "MYCOL",
uri: "https://arweave.net/metadata.json",
});
// Mint NFT to collection
const nft = await agent.methods.mintNFT({
collectionMint: collection.collectionAddress,
name: "NFT #1",
uri: "https://arweave.net/nft1.json",
});
DeFi Plugin (@solana-agent-kit/plugin-defi)
| Action | Description |
|---|---|
trade |
Swap tokens via Jupiter |
createRaydiumPool |
Create Raydium AMM pool |
createOrcaPool |
Create Orca Whirlpool |
createMeteoraPool |
Create Meteora DLMM pool |
limitOrder |
Place limit order via Manifest |
lend |
Lend assets via Lulo |
perpetualTrade |
Trade perps via Adrena/Drift |
常见问题
它支持哪些 AI 模型?
该技能说明,它支持 OpenAI、Claude、Llama 和 Gemini。
我可以只使用部分操作吗?
可以。该工具包基于插件,因此你可以只安装所需的插件。
私钥应放在哪里?
该技能说明,应将其保存在环境变量中,而不是代码里。
详情
作者的原始描述
Comprehensive guide for building AI agents that interact with Solana blockchain using SendAI's Solana Agent Kit. Covers 60+ actions, LangChain/Vercel AI integration, MCP server setup, and autonomous agent patterns.
热度
- GitHub 星标
- 7.0k
- 排名
- #13681
- 许可证
- —
- 更新时间
- 2026/10/26
评论
- …
同一仓库的更多技能
internet-court
7.0k帮你的智能体安全地向其他 AI 智能体或付费服务付款、雇用或进行交易,并指引它找到合适的专业指南。
genlayer-erc7710-connector
7.0k帮你的智能体把 AI 审核结果与权限系统连接起来,使不合格的审核可以限制或取消智能体的权限。
genlayer-intelligent-contracts
7.0k帮你的智能体定义 AI 裁判的规则、证据和输出,用于检查另一个智能体是否遵循了其授权范围。
x402-erc7710
7.0k帮你的智能体按次为网络服务付款,并设置在权限预算范围内的持续支出。