API 参考
批量发送
在单次请求中提交多笔已签名交易,实现高吞吐投递。
POST
/v1/send/batch请求
请求头
| 请求头 | 值 | 必填 |
|---|---|---|
| Authorization | Bearer YOUR_API_KEY | 必填 |
| Content-Type | application/json | 必填 |
请求体参数
| 字段 | 类型 | 描述 |
|---|---|---|
| transactions | string[] | Base64 编码的已签名交易数组(最多 100 笔) |
请求示例
cURL
curl -X POST https://bolttx.io/v1/send/batch \
-H "Authorization: Bearer btx_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"transactions": [
"AQAAAAAAAAAAAAAAAAAAAAA...",
"AgAAAAAAAAAAAABBBBBBBB...",
"AwAAAAAAAAAAAACCCCCCCC..."
]
}'批量限制
每次批量请求最多接受 100 笔交易。这一上限经过精细调校,能让批次中每一笔都以峰值速度投递;超过该上限会显著增加尾延迟,不建议使用。批次内所有交易共用同一 options 配置。每笔交易必须独立包含有效的 Tip 指令。校验失败的交易会在响应中单独标记,不影响批次内其他交易。
响应
成功 (200)
{
"success": true,
"results": [
{
"index": 0,
"signature": "5xKnR8qXe...",
"status": "sent"
},
{
"index": 1,
"signature": "3mPqY7wBz...",
"status": "sent"
},
{
"index": 2,
"signature": null,
"status": "failed",
"error": "deserialize error: invalid transaction format"
}
]
}结果字段
| 字段 | 类型 | 描述 |
|---|---|---|
| index | number | 交易在输入数组中的位置 |
| signature | string | null | 交易签名,若被拒绝则为 null |
| status | string | "sent" 或 "failed" |
| error | string? | 交易被拒绝时的错误信息 |
错误码
| 代码 | 信息 | 描述 |
|---|---|---|
| 400 | 请求无效 | 缺少 transactions 数组,或批次大小超过 100 |
| 401 | 未授权 | 缺少或无效的 API Key |
| 429 | 速率超限 | N 笔批次会一次性消耗你套餐每秒 TPS 配额中的 N 个 token;该上限按用户聚合(你所有 API Key 共享同一上限) |