> ## Documentation Index
> Fetch the complete documentation index at: https://dexbuilder.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 事件合约 Broker 认证

> 事件合约 Broker 私有 REST 接口的路径、认证和钱包地址要求。

事件合约公开行情使用 `/api/v4/event_contracts/...`，无需 Broker API Key。Broker 代旗下用户访问订单、持仓和账户等私有 REST 接口时，使用 `/api/v4/broker/event_contracts/...`。

私有请求须使用已开通事件合约权限的 Broker API Key，在请求头携带 `KEY`、`Timestamp`、`SIGN` 和 `X-User-Wallet-Address`。钱包地址必须对应当前 Broker 旗下用户。终端用户个人 API Key 不能代替 Broker API Key。

* [Broker API Key 与签名](https://dexbuilder.mintlify.site/api-reference/common/broker-authentication.md)：Key 用途、请求头和签名步骤。
* [代表用户访问](https://dexbuilder.mintlify.site/api-reference/common/sub-user-wallet.md)：钱包地址与归属要求。
* [API 使用说明](https://dexbuilder.mintlify.site/api-reference/common/overview.md)：接入地址和公开、私有路径。

## 请求示例

签名时使用实际访问的外部路径 `/api/v4/broker/event_contracts/positions`：

```bash theme={null}
BASE_URL="https://api.dexbuilder.com"
API_PATH="/api/v4/broker/event_contracts/positions"

curl -i --request GET "${BASE_URL}${API_PATH}" \
  --header "KEY: ${BROKER_API_KEY}" \
  --header "SIGN: ${SIGN}" \
  --header "Timestamp: ${TIMESTAMP}" \
  --header "X-User-Wallet-Address: ${WALLET}" \
  --header 'Accept: application/json'
```

WebSocket 私有频道使用其专属认证方式，详见[事件合约 WebSocket 认证](https://dexbuilder.mintlify.site/zh/event-contracts/websocket/authentication.md)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.