API 参考
Solana RPC 代理
Solana RPC URL 的直接替代方案。任何 Solana 客户端库都可无改动使用。
POST
/?api-key=YOUR_API_KEY概述
BoltTx 提供兼容 Solana JSON-RPC 的端点,你只需改一下 URL 即可从现有 RPC 提供商迁移过来。代理接受 sendTransaction 方法,并通过我们优化的投递基础设施转发。
为什么用 RPC 模式? 如果你已经在使用 @solana/web3.js, solana-py或 solana-client (Rust),只需替换 RPC URL —— 无需重写代码。对于新集成,我们推荐使用 REST API ,错误处理更清晰。
支持的方法
| 方法 | 状态 | 描述 |
|---|---|---|
| sendTransaction | 已支持 | 提交已签名交易进行投递 |
| Other methods | 不支持 | 查询请继续使用你的常规 Solana RPC |
对于查询(getAccountInfo、getBalance 等),请继续使用你自己的 Solana RPC 端点。BoltTx 专注于快速、可靠的交易投递 —— 不做通用 RPC。
使用示例
import { Connection } from "@solana/web3.js";
// Drop-in replacement — just swap your RPC URL
const connection = new Connection(
"https://bolttx.io/?api-key=YOUR_API_KEY",
"confirmed"
);
// Your existing sendRawTransaction code continues to work
const signature = await connection.sendRawTransaction(
signedTx.serialize(),
{ skipPreflight: true }
);
console.log("Signature:", signature);响应
成功
{
"jsonrpc": "2.0",
"id": 1,
"result": "5xKnR8qXeVm3pN..."
}错误
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 403,
"message": "Invalid API key"
}
}错误码
| 代码 | 含义 |
|---|---|
| 401 | 缺少 API Key |
| 402 | 交易缺少 Tip 或 Tip 不足 |
| 403 | API Key 无效或方法不支持 |
| 429 | 速率超限;该上限按用户聚合(你所有 API Key 共享同一上限) |
| -32602 | 参数无效(编码或格式错误) |
| -32603 | 投递过程内部错误 |