# 訂閱交易推送

`WS` `request · cmd 16`

訂閱交易閘道主題。主題 `private` 推送訂單/成交通知。響應返回成功/失敗/當前訂閱主題。

```protobuf
message Sub {
  repeated string topics = 1;
}

message SubResponse {
  repeated string success = 1;
  repeated Fail fail = 2;
  repeated string current = 3;
}
```

## Request Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `topics` | string[] | No | 要訂閱的 topic |

## Response Fields

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | string[] | No | 訂閱成功 |
| `fail` | object[] | No | 訂閱失敗 |
| `└ topic` | string | No | 主題 |
| `└ reason` | string | No | 失敗原因 |
| `current` | string[] | No | 目前訂閱 |

## Response JSON Example

```json
{
  "success": [
    "private"
  ],
  "fail": [],
  "current": [
    "private"
  ]
}
```
