solana-agent-kit by sendaifun/skills
npx skills add https://github.com/sendaifun/skills --skill solana-agent-kit使用 SendAI 的开源工具包构建能够自主执行 60 多种 Solana 区块链操作 的 AI 智能体。兼容 LangChain、Vercel AI SDK 以及通过 MCP 的 Claude。
Solana Agent Kit 使任何 AI 模型能够:
| 特性 | 描述 |
|---|---|
| 60+ 种操作 | 代币、NFT、DeFi、质押、桥接操作 |
| 插件架构 | 模块化 - 仅使用所需功能 |
| 多框架支持 | LangChain、Vercel AI SDK、MCP、Eliza |
| 模型无关 | 适用于 OpenAI、Claude、Llama、Gemini |
| 自主模式 | 无需干预的执行,带错误恢复功能 |
# 核心包
npm install solana-agent-kit
# 带插件(推荐)
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
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# .env 文件
OPENAI_API_KEY=your_openai_api_key
RPC_URL=https://api.mainnet-beta.solana.com # 或 devnet
SOLANA_PRIVATE_KEY=your_base58_private_key
# 用于增强功能的可选 API 密钥
COINGECKO_API_KEY=your_coingecko_key
HELIUS_API_KEY=your_helius_key
import {
SolanaAgentKit,
createVercelAITools,
KeypairWallet,
} from "solana-agent-kit";
import { Keypair } from "@solana/web3.js";
import bs58 from "bs58";
// 导入插件
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";
// 从私钥创建钱包
const privateKey = bs58.decode(process.env.SOLANA_PRIVATE_KEY!);
const keypair = Keypair.fromSecretKey(privateKey);
const wallet = new KeypairWallet(keypair);
// 使用插件初始化智能体
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);
// 为 AI 框架创建工具
const tools = createVercelAITools(agent, agent.actions);
@solana-agent-kit/plugin-token)| 操作 | 描述 |
|---|---|
deployToken | 部署新的 SPL 代币或 Token-2022 |
transfer | 转移 SOL 或 SPL 代币 |
getBalance | 检查代币余额 |
stake | 通过 Jupiter/Solayer 质押 SOL |
bridge | 通过 Wormhole 桥接代币 |
rugCheck | 分析代币安全性 |
// 部署新代币
const result = await agent.methods.deployToken({
name: "My Token",
symbol: "MTK",
decimals: 9,
initialSupply: 1000000,
});
// 转移代币
await agent.methods.transfer({
to: "recipient_address",
amount: 100,
mint: "token_mint_address", // 可选,默认为 SOL
});
// 检查余额
const balance = await agent.methods.getBalance({
tokenAddress: "token_mint_address", // 可选
});
@solana-agent-kit/plugin-nft)| 操作 | 描述 |
|---|---|
createCollection | 通过 Metaplex 创建 NFT 合集 |
mintNFT | 向合集铸造 NFT |
listNFT | 在市场上架 NFT |
updateMetadata | 更新 NFT 元数据 |
// 创建合集
const collection = await agent.methods.createCollection({
name: "My Collection",
symbol: "MYCOL",
uri: "https://arweave.net/metadata.json",
});
// 向合集铸造 NFT
const nft = await agent.methods.mintNFT({
collectionMint: collection.collectionAddress,
name: "NFT #1",
uri: "https://arweave.net/nft1.json",
});
@solana-agent-kit/plugin-defi)| 操作 | 描述 |
|---|---|
trade | 通过 Jupiter 交换代币 |
createRaydiumPool | 创建 Raydium AMM 池 |
createOrcaPool | 创建 Orca Whirlpool |
createMeteoraPool | 创建 Meteora DLMM 池 |
limitOrder | 通过 Manifest 下限制单 |
lend | 通过 Lulo 借贷资产 |
perpetualTrade | 通过 Adrena/Drift 交易永续合约 |
// 通过 Jupiter 交换代币
const swap = await agent.methods.trade({
outputMint: "target_token_mint",
inputAmount: 1.0,
inputMint: "So11111111111111111111111111111111111111112", // SOL
slippageBps: 50, // 0.5%
});
// 创建 Raydium CPMM 池
const pool = await agent.methods.createRaydiumCpmm({
mintA: "token_a_mint",
mintB: "token_b_mint",
configId: "config_id",
mintAAmount: 1000,
mintBAmount: 1000,
});
@solana-agent-kit/plugin-misc)| 操作 | 描述 |
|---|---|
airdrop | 通过 Helius 进行 ZK 压缩空投 |
getPrice | 通过 CoinGecko 获取代币价格 |
registerDomain | 注册 .sol 域名 |
resolveDomain | 解析域名到地址 |
getTPS | 获取网络 TPS |
// 压缩空投(成本效益高)
const airdrop = await agent.methods.sendCompressedAirdrop({
mintAddress: "token_mint",
amount: 100,
recipients: ["addr1", "addr2", "addr3"],
priorityFeeInLamports: 10000,
});
// 获取代币价格
const price = await agent.methods.getPrice({
tokenId: "solana", // CoinGecko ID
});
@solana-agent-kit/plugin-blinks)直接执行 Solana Actions/Blinks:
// 执行 Blink
const result = await agent.methods.executeBlink({
blinkUrl: "https://example.com/blink",
params: { /* blink-specific params */ },
});
import { SolanaAgentKit, createSolanaTools } from "solana-agent-kit";
import { ChatOpenAI } from "@langchain/openai";
import { createReactAgent } from "@langchain/langgraph/prebuilt";
import { MemorySaver } from "@langchain/langgraph";
import { HumanMessage } from "@langchain/core/messages";
async function createLangChainAgent() {
// 初始化 LLM
const llm = new ChatOpenAI({
modelName: "gpt-4-turbo-preview",
temperature: 0.7,
});
// 初始化 Solana Agent Kit
const solanaKit = new SolanaAgentKit(
wallet,
process.env.RPC_URL!,
{ OPENAI_API_KEY: process.env.OPENAI_API_KEY! }
)
.use(TokenPlugin)
.use(DefiPlugin);
// 创建 LangChain 工具
const tools = createSolanaTools(solanaKit);
// 创建带记忆的智能体
const memory = new MemorySaver();
const agent = createReactAgent({
llm,
tools,
checkpointSaver: memory,
});
return agent;
}
// 运行智能体
async function chat(agent: any, message: string) {
const config = { configurable: { thread_id: "solana-agent" } };
const stream = await agent.stream(
{ messages: [new HumanMessage(message)] },
config
);
for await (const chunk of stream) {
if ("agent" in chunk) {
console.log(chunk.agent.messages[0].content);
}
}
}
import { SolanaAgentKit, createVercelAITools } from "solana-agent-kit";
import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";
async function runVercelAgent(prompt: string) {
const agent = new SolanaAgentKit(wallet, rpcUrl, options)
.use(TokenPlugin)
.use(DefiPlugin);
const tools = createVercelAITools(agent, agent.actions);
const result = await generateText({
model: openai("gpt-4-turbo"),
tools,
maxSteps: 10,
prompt,
});
return result.text;
}
// 用法
const response = await runVercelAgent(
"Swap 0.1 SOL for USDC using the best rate"
);
为 Claude Desktop 安装和配置 MCP 服务器:
# 全局安装
npm install -g solana-mcp
# 或直接运行
npx solana-mcp
添加到 Claude Desktop 配置 (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"solana": {
"command": "npx",
"args": ["solana-mcp"],
"env": {
"RPC_URL": "https://api.mainnet-beta.solana.com",
"SOLANA_PRIVATE_KEY": "your_base58_private_key",
"OPENAI_API_KEY": "your_openai_key"
}
}
}
}
可用的 MCP 工具:
GET_ASSET - 获取代币/资产信息DEPLOY_TOKEN - 创建新代币GET_PRICE - 获取代币价格WALLET_ADDRESS - 获取钱包地址BALANCE - 检查余额TRANSFER - 发送代币MINT_NFT - 创建 NFTTRADE - 执行交换REQUEST_FUNDS - 获取 devnet SOLRESOLVE_DOMAIN - 查找 .sol 域名GET_TPS - 网络吞吐量以完全自主模式运行智能体:
import { SolanaAgentKit } from "solana-agent-kit";
const agent = new SolanaAgentKit(wallet, rpcUrl, options)
.use(TokenPlugin)
.use(DefiPlugin);
// 配置自主行为
const autonomousConfig = {
intervalMs: 60000, // 每分钟检查一次
maxActions: 100, // 每次会话最大操作数
errorRecovery: true, // 失败时自动重试
dryRun: false, // 测试时设为 true
};
// 启动自主循环
async function runAutonomous() {
while (true) {
try {
// 智能体根据市场状况决定做什么
const decision = await agent.analyze({
context: "Monitor my portfolio and rebalance if needed",
constraints: [
"Keep at least 1 SOL for gas",
"Max 10% allocation per token",
],
});
if (decision.shouldAct) {
await agent.execute(decision.action);
}
await sleep(autonomousConfig.intervalMs);
} catch (error) {
if (autonomousConfig.errorRecovery) {
console.error("Error, recovering:", error);
await sleep(5000);
} else {
throw error;
}
}
}
}
使用自定义操作扩展智能体:
import { Action, Tool, SolanaAgentKit } from "solana-agent-kit";
// 定义工具(告诉 LLM 如何使用它)
const myCustomTool: Tool = {
name: "my_custom_action",
description: "在 Solana 上执行自定义操作",
parameters: {
type: "object",
properties: {
param1: {
type: "string",
description: "第一个参数",
},
param2: {
type: "number",
description: "第二个参数",
},
},
required: ["param1"],
},
};
// 定义操作(告诉智能体何时以及为何使用它)
const myCustomAction: Action = {
name: "my_custom_action",
description: "当需要执行自定义操作时使用此功能",
similes: ["custom thing", "special operation"],
examples: [
{
input: "Do the custom thing with value X",
output: "Custom action executed with param1=X",
},
],
handler: async (agent: SolanaAgentKit, params: any) => {
const { param1, param2 } = params;
// 在此处编写自定义逻辑
const connection = agent.connection;
const wallet = agent.wallet;
// 执行 Solana 操作...
return {
success: true,
result: `Executed with ${param1}`,
};
},
};
// 注册自定义操作
agent.registerAction(myCustomAction);
agent.registerTool(myCustomTool);
solana-agent-kit/
├── SKILL.md # 此文件
├── resources/
│ ├── actions-reference.md # 完整操作列表
│ ├── plugins-guide.md # 插件深入指南
│ └── security-checklist.md # 安全最佳实践
├── examples/
│ ├── langchain/ # LangChain 集成
│ ├── vercel-ai/ # Vercel AI SDK
│ ├── mcp-server/ # Claude MCP 设置
│ └── autonomous-agent/ # 自主模式示例
├── templates/
│ └── agent-template.ts # 入门模板
└── docs/
├── custom-actions.md # 创建自定义操作
└── troubleshooting.md # 常见问题
版本 2 代表了工具包的全面演进,包含以下关键改进:
V2 直接解决了 V1 的两个主要挑战:
模块化插件系统让您仅安装所需功能,减少了上下文膨胀和幻觉。
V2 集成了安全钱包提供商以增强安全性:
import { TurnkeyWallet, PrivyWallet } from "solana-agent-kit/wallets";
// Turnkey - 细粒度规则和策略
const turnkeyWallet = new TurnkeyWallet({
organizationId: process.env.TURNKEY_ORG_ID,
privateKeyId: process.env.TURNKEY_PRIVATE_KEY_ID,
});
// Privy - 人工确认环节
const privyWallet = new PrivyWallet({
appId: process.env.PRIVY_APP_ID,
requireConfirmation: true,
});
// 使用安全钱包初始化智能体
const agent = new SolanaAgentKit(turnkeyWallet, rpcUrl, options)
.use(TokenPlugin)
.use(DefiPlugin);
| 特性 | V1 | V2 |
|---|---|---|
| 钱包安全性 | 私钥输入 | 嵌入式钱包(Turnkey、Privy) |
| 工具加载 | 所有 100+ 工具 | 基于插件,按需加载 |
| LLM 上下文 | 大,导致幻觉 | 最小化,专注的上下文 |
| 人工介入 | 不支持 | 通过 Privy 原生支持 |
solana-agent-kit-py每周安装量
77
仓库
GitHub Stars
68
首次出现
2026 年 1 月 24 日
安全审计
安装于
opencode70
gemini-cli69
codex69
github-copilot66
amp64
kimi-cli64
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.
The Solana Agent Kit enables any AI model to:
| 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 |
# 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
# .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
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);
@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
});
@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",
});
@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 |
// Swap tokens via Jupiter
const swap = await agent.methods.trade({
outputMint: "target_token_mint",
inputAmount: 1.0,
inputMint: "So11111111111111111111111111111111111111112", // SOL
slippageBps: 50, // 0.5%
});
// Create Raydium CPMM pool
const pool = await agent.methods.createRaydiumCpmm({
mintA: "token_a_mint",
mintB: "token_b_mint",
configId: "config_id",
mintAAmount: 1000,
mintBAmount: 1000,
});
@solana-agent-kit/plugin-misc)| Action | Description |
|---|---|
airdrop | ZK-compressed airdrop via Helius |
getPrice | Get token price via CoinGecko |
registerDomain | Register .sol domain |
resolveDomain | Resolve domain to address |
getTPS | Get network TPS |
// Compressed airdrop (cost-efficient)
const airdrop = await agent.methods.sendCompressedAirdrop({
mintAddress: "token_mint",
amount: 100,
recipients: ["addr1", "addr2", "addr3"],
priorityFeeInLamports: 10000,
});
// Get token price
const price = await agent.methods.getPrice({
tokenId: "solana", // CoinGecko ID
});
@solana-agent-kit/plugin-blinks)Execute Solana Actions/Blinks directly:
// Execute a Blink
const result = await agent.methods.executeBlink({
blinkUrl: "https://example.com/blink",
params: { /* blink-specific params */ },
});
import { SolanaAgentKit, createSolanaTools } from "solana-agent-kit";
import { ChatOpenAI } from "@langchain/openai";
import { createReactAgent } from "@langchain/langgraph/prebuilt";
import { MemorySaver } from "@langchain/langgraph";
import { HumanMessage } from "@langchain/core/messages";
async function createLangChainAgent() {
// Initialize LLM
const llm = new ChatOpenAI({
modelName: "gpt-4-turbo-preview",
temperature: 0.7,
});
// Initialize Solana Agent Kit
const solanaKit = new SolanaAgentKit(
wallet,
process.env.RPC_URL!,
{ OPENAI_API_KEY: process.env.OPENAI_API_KEY! }
)
.use(TokenPlugin)
.use(DefiPlugin);
// Create LangChain tools
const tools = createSolanaTools(solanaKit);
// Create agent with memory
const memory = new MemorySaver();
const agent = createReactAgent({
llm,
tools,
checkpointSaver: memory,
});
return agent;
}
// Run agent
async function chat(agent: any, message: string) {
const config = { configurable: { thread_id: "solana-agent" } };
const stream = await agent.stream(
{ messages: [new HumanMessage(message)] },
config
);
for await (const chunk of stream) {
if ("agent" in chunk) {
console.log(chunk.agent.messages[0].content);
}
}
}
import { SolanaAgentKit, createVercelAITools } from "solana-agent-kit";
import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";
async function runVercelAgent(prompt: string) {
const agent = new SolanaAgentKit(wallet, rpcUrl, options)
.use(TokenPlugin)
.use(DefiPlugin);
const tools = createVercelAITools(agent, agent.actions);
const result = await generateText({
model: openai("gpt-4-turbo"),
tools,
maxSteps: 10,
prompt,
});
return result.text;
}
// Usage
const response = await runVercelAgent(
"Swap 0.1 SOL for USDC using the best rate"
);
Install and configure the MCP server for Claude Desktop:
# Install globally
npm install -g solana-mcp
# Or run directly
npx solana-mcp
Add to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"solana": {
"command": "npx",
"args": ["solana-mcp"],
"env": {
"RPC_URL": "https://api.mainnet-beta.solana.com",
"SOLANA_PRIVATE_KEY": "your_base58_private_key",
"OPENAI_API_KEY": "your_openai_key"
}
}
}
}
Available MCP tools:
GET_ASSET - Get token/asset infoDEPLOY_TOKEN - Create new tokenGET_PRICE - Fetch token priceWALLET_ADDRESS - Get wallet addressBALANCE - Check balanceTRANSFER - Send tokensMINT_NFT - Create NFTTRADE - Execute swapREQUEST_FUNDS - Get devnet SOLRESOLVE_DOMAIN - Lookup .sol domainRun agent in fully autonomous mode:
import { SolanaAgentKit } from "solana-agent-kit";
const agent = new SolanaAgentKit(wallet, rpcUrl, options)
.use(TokenPlugin)
.use(DefiPlugin);
// Configure autonomous behavior
const autonomousConfig = {
intervalMs: 60000, // Check every minute
maxActions: 100, // Max actions per session
errorRecovery: true, // Auto-retry on failures
dryRun: false, // Set true for testing
};
// Start autonomous loop
async function runAutonomous() {
while (true) {
try {
// Agent decides what to do based on market conditions
const decision = await agent.analyze({
context: "Monitor my portfolio and rebalance if needed",
constraints: [
"Keep at least 1 SOL for gas",
"Max 10% allocation per token",
],
});
if (decision.shouldAct) {
await agent.execute(decision.action);
}
await sleep(autonomousConfig.intervalMs);
} catch (error) {
if (autonomousConfig.errorRecovery) {
console.error("Error, recovering:", error);
await sleep(5000);
} else {
throw error;
}
}
}
}
Extend the agent with custom actions:
import { Action, Tool, SolanaAgentKit } from "solana-agent-kit";
// Define the Tool (tells LLM HOW to use it)
const myCustomTool: Tool = {
name: "my_custom_action",
description: "Does something custom on Solana",
parameters: {
type: "object",
properties: {
param1: {
type: "string",
description: "First parameter",
},
param2: {
type: "number",
description: "Second parameter",
},
},
required: ["param1"],
},
};
// Define the Action (tells agent WHEN and WHY to use it)
const myCustomAction: Action = {
name: "my_custom_action",
description: "Use this when you need to do something custom",
similes: ["custom thing", "special operation"],
examples: [
{
input: "Do the custom thing with value X",
output: "Custom action executed with param1=X",
},
],
handler: async (agent: SolanaAgentKit, params: any) => {
const { param1, param2 } = params;
// Your custom logic here
const connection = agent.connection;
const wallet = agent.wallet;
// Execute Solana operations...
return {
success: true,
result: `Executed with ${param1}`,
};
},
};
// Register custom action
agent.registerAction(myCustomAction);
agent.registerTool(myCustomTool);
solana-agent-kit/
├── SKILL.md # This file
├── resources/
│ ├── actions-reference.md # Complete actions list
│ ├── plugins-guide.md # Plugin deep dive
│ └── security-checklist.md # Security best practices
├── examples/
│ ├── langchain/ # LangChain integration
│ ├── vercel-ai/ # Vercel AI SDK
│ ├── mcp-server/ # Claude MCP setup
│ └── autonomous-agent/ # Autonomous patterns
├── templates/
│ └── agent-template.ts # Starter template
└── docs/
├── custom-actions.md # Creating custom actions
└── troubleshooting.md # Common issues
Version 2 represents a complete evolution of the toolkit with key improvements:
V2 directly addresses two major V1 challenges:
The modular plugin system lets you install only what you need, reducing context bloat and hallucinations.
V2 integrates with secure wallet providers for enhanced security:
import { TurnkeyWallet, PrivyWallet } from "solana-agent-kit/wallets";
// Turnkey - fine-grained rules and policies
const turnkeyWallet = new TurnkeyWallet({
organizationId: process.env.TURNKEY_ORG_ID,
privateKeyId: process.env.TURNKEY_PRIVATE_KEY_ID,
});
// Privy - human-in-the-loop confirmation
const privyWallet = new PrivyWallet({
appId: process.env.PRIVY_APP_ID,
requireConfirmation: true,
});
// Initialize agent with secure wallet
const agent = new SolanaAgentKit(turnkeyWallet, rpcUrl, options)
.use(TokenPlugin)
.use(DefiPlugin);
| Feature | V1 | V2 |
|---|---|---|
| Wallet Security | Private key input | Embedded wallets (Turnkey, Privy) |
| Tool Loading | All 100+ tools | Plugin-based, load what you need |
| LLM Context | Large, caused hallucinations | Minimal, focused context |
| Human-in-loop | Not supported | Native with Privy |
solana-agent-kit-pyWeekly Installs
77
Repository
GitHub Stars
68
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubFailSocketFailSnykWarn
Installed on
opencode70
gemini-cli69
codex69
github-copilot66
amp64
kimi-cli64
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
120,000 周安装
perpetualTrade | Trade perps via Adrena/Drift |
GET_TPS - Network throughput