# 枚举值与约束

## Header 枚举

| 字段               | 允许值                                  |
| ---------------- | ------------------------------------ |
| `x-api-chain-id` | `1`、`143`、`11155111`、`10143`、`84532` |
| `x-api-p`        | `MondayTrade`、`Anchored`             |

## 权限枚举

| 字段       | 允许值         | 说明                     |
| -------- | ----------- | ---------------------- |
| `access` | `READ_ONLY` | 仅允许 GET 请求。            |
| `access` | `WRITABLE`  | 允许 GET、POST、DELETE 请求。 |

## 订单枚举

### 基本枚举

| 字段              | 允许值                                             | 说明                           |
| --------------- | ----------------------------------------------- | ---------------------------- |
| `side`          | `Buy`、`Sell`                                    | 订单方向。                        |
| `type`          | `Market`、`Limit`                                | 订单类型。                        |
| `timeInForce`   | `DAY`、`GTC`、`OPG`、`IOC`、`FOK`、`GTX`、`GTD`、`CLS` | 限价单有效期策略。链上编码依次为 `0` \~ `7`。 |
| `operationType` | `trade`、`deposit`、`withdraw`                    | 交易映射类型。                      |

### 订单状态（映射后）

| 值                | 说明                 |
| ---------------- | ------------------ |
| `Init`           | 初始状态。              |
| `Pending`        | 已记录或处理中。           |
| `New`            | 已被 indexer 识别为新订单。 |
| `Partial filled` | 部分成交。              |
| `Filled`         | 已全部成交。             |
| `Canceled`       | 已取消。               |
| `Expired`        | 已过期。               |
| `Rejected`       | 已拒绝。               |
| `Failed`         | 失败。                |

### 原始链上状态

| 值           | 说明     |
| ----------- | ------ |
| `placing`   | 下单处理中。 |
| `canceling` | 撤单处理中。 |

### Broker 原始状态

```
init, pending, failed, new, partially_filled, filled, done_for_day,
canceled, expired, replaced, pending_cancel, pending_replace, accepted,
pending_new, accepted_for_bidding, stopped, rejected, suspended, calculated
```

## 现金状态枚举

### operationStatus

| 值            | 说明   |
| ------------ | ---- |
| `requested`  | 已请求。 |
| `processing` | 处理中。 |
| `settled`    | 已结算。 |
| `closed`     | 已关闭。 |

### mappingStatus

复用订单映射状态枚举：`Init`、`Pending`、`New`、`Partial filled`、`Filled`、`Canceled`、`Expired`、`Rejected`、`Failed`。

## 行情枚举

### K 线周期 (interval)

| 值     | 说明    |
| ----- | ----- |
| `1m`  | 1 分钟  |
| `3m`  | 3 分钟  |
| `5m`  | 5 分钟  |
| `15m` | 15 分钟 |
| `1h`  | 1 小时  |
| `1d`  | 1 天   |
| `1w`  | 1 周   |

### 复权方式 (adjustment)

| 值          | 说明           |
| ---------- | ------------ |
| `raw`      | 不复权。         |
| `split`    | 拆股复权。        |
| `dividend` | 分红复权。        |
| `spin-off` | Spin-off 复权。 |
| `all`      | 应用全部复权（默认）。  |

## 数值与地址约束

| 字段             | 约束                                        |
| -------------- | ----------------------------------------- |
| `stockAddress` | 必须是有效 EVM 地址。服务端转小写后编码。                   |
| `userAddress`  | 必须是有效 EVM 地址。                             |
| `tokenAddress` | 必须是有效 EVM 地址。                             |
| `quantity`     | 必须 > 0，最多 18 位小数。                         |
| `notional`     | 必须 > 0，最多 18 位小数。                         |
| `price`        | 必须 > 0，最多 18 位小数。                         |
| `tokenAmount`  | 必须 > 0，小数位 ≤ token decimals，raw ≤ uint96。 |
| `creditAmount` | 必须 > 0，最多 18 位小数，raw ≤ uint96。            |
| `deadline`     | Unix 秒，> 0 且 ≤ `4294967295`。              |
| `orderId`      | 撤单接口中必须是 bytes32 hex（64 字符）。              |
| `signature`    | One Click enable 用，65 bytes hex。          |
| `gasLimit`     | 可选；为空或 ≤ 0 时服务端自动估算。                      |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.anchored.finance/trading-api-docs-zh/fu-lu/enums.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
