创建端点

说明

POST /api/dashboard/endpoints 在 BlockReq Web 上为 Management API Key 所有者创建(或复用)端点。

请求体字段

字段类型必填说明
chainstring是要创建端点的网络,例如 ethereum 或 bsc。可用取值见 GET /api/dashboard/chains。
namestring否端点显示名称。
keyModeshared | dedicated否shared(默认)复用你的共享 API Key;dedicated 只为这个端点新建一把 Key。
txBroadcastmev_protection | normal否eth_sendRawTransaction 的交易广播方式,默认 mev_protection。

交易广播

txBroadcast 在 Ethereum 主网(ethereum)、BSC 主网(bsc)和 Base 主网(base)生效:

  • mev_protection(默认):把交易私下发给区块构建者,不会被抢跑或夹击。
  • normal:经我们的节点广播到公共 mempool。不走私有通道,没有 backrun,也没有返利。

其它网络只接受 mev_protection,传 normal 会返回 400,错误码 tx_broadcast_unsupported_chain。传入这两个以外的值会返回 400 校验错误,问题信息为 tx_broadcast_invalid。如果请求复用了同一网络上已有的共享端点,该端点保留当前模式。

修改已有端点的模式:调用 PATCH /api/dashboard/endpoints,请求体为 { "endpointId": "ep_...", "txBroadcast": "normal" }。端点列表和端点详情的响应都包含当前的 txBroadcast。

示例

curl -X POST https://blockreq.com/api/dashboard/endpoints \ -H "Authorization: Bearer akv1_YOUR_MANAGEMENT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"chain":"ethereum","txBroadcast":"mev_protection"}'

试一试

POST /dashboard/endpoints

https://blockreq.com/api/dashboard/endpoints