Integrations
Manages environment variables for configuration including port settings, environment type, Solana RPC URL, and wallet private keys.
Serves as the foundation for this API server, providing HTTP routing and middleware capabilities for all wallet operations.
Provides version control for the project, supporting the contribution workflow outlined in the README.
Solana MCP 钱包代理 API
用于 Solana 区块链钱包操作的完整 Express API。此 API 提供管理 Solana 钱包、转移 SOL 以及使用 SPL 代币的功能。
特征
- 🔐钱包管理:创建和管理 Solana 钱包
- 💰 SOL 转账:在钱包之间转移 SOL
- 🪙代币管理:创建、铸造和转移 SPL 代币
- 📚 API 文档:交互式 Swagger 文档
- 🔄错误处理:强大的错误处理系统
- 🧪开发就绪:易于设置和使用
先决条件
- Node.js(v16+)
- npm 或 yarn
- [可选] Solana CLI 工具用于额外测试
安装
- 克隆存储库:
Copy
- 安装依赖项:
Copy
- 在根目录中创建一个
.env
文件,其内容如下:
Copy
发展
启动开发服务器:
Copy
服务器将从http://localhost:3000
启动并启用热重加载。
构建和生产
构建项目:
Copy
启动生产服务器:
Copy
API 文档
服务器运行后,请访问 Swagger 文档:
Copy
该文档通过请求/响应示例提供了所有可用端点的完整概述。
API 端点
钱包端点
方法 | 端点 | 描述 |
---|---|---|
邮政 | /api/wallet | 创建新钱包 |
得到 | /api/wallet/:publicKey | 获取钱包信息 |
邮政 | /api/wallet/transfer | 将 SOL 转移到另一个钱包 |
令牌端点
方法 | 端点 | 描述 |
---|---|---|
邮政 | /api/wallet/token | 创建新的 SPL 令牌 |
邮政 | /api/wallet/token/mint | 将代币铸造到某个地址 |
邮政 | /api/wallet/token/transfer | 将代币转移到另一个钱包 |
安全注意事项
- 重要提示:本项目使用环境变量作为密钥。在生产环境中,您应该使用合适的密钥管理服务。
- 切勿在客户端代码中暴露您的私钥。
- 对于生产,请考虑实施额外的身份验证和授权机制。
Solana 集成
此 API 与 Solana 区块链交互以:
- 创建和管理钱包
- 在钱包之间转移 SOL
- 创建新的 SPL 代币
- 将代币铸造到地址
- 在钱包之间转移代币
错误处理
该 API 包括全面的错误处理,具有以下特点:
- 开发模式下的详细错误消息
- 生产环境中的清理错误消息
- 正确的 HTTP 状态代码
- 操作错误与编程错误的区别
贡献
- 分叉存储库
- 创建你的功能分支(
git checkout -b feature/amazing-feature
) - 提交您的更改(
git commit -m 'Add some amazing feature'
) - 推送到分支(
git push origin feature/amazing-feature
) - 打开拉取请求
执照
该项目根据 ISC 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。
支持
如需支持,请在存储库中创建问题或联系存储库维护人员。
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that provides Claude with comprehensive access to Solana blockchain data via the Helius API, enabling operations like checking wallet balances, retrieving blockchain information, and interacting with tokens and NFTs.Last updated -1198TypeScriptMIT License
- -securityAlicense-qualityA server that enables interaction with the Solana blockchain, providing access to over 40 Solana RPC methods including getting balances, transaction details, block information, and sending transactions.Last updated -PythonMIT License
- AsecurityFlicenseAqualityA server that provides simple RPC endpoints for common Solana blockchain operations, allowing users to check balances, get account information, and transfer SOL between accounts.Last updated -5TypeScript
- -securityAlicense-qualityA Model Context Protocol server that enables Claude AI to interact with the Solana blockchain through a standardized interface, providing tools for transactions, account queries, and wallet management.Last updated -5972Apache 2.0