tigeropen 0.4.0 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -2
- package/dist/cjs/client/api-response.js +28 -7
- package/dist/cjs/client/case-convert.js +4 -3
- package/dist/cjs/client/http-client.js +124 -8
- package/dist/cjs/client/token-methods.js +42 -0
- package/dist/cjs/config/client-config.js +115 -16
- package/dist/cjs/config/config-parser.js +19 -9
- package/dist/cjs/config/index.js +4 -1
- package/dist/cjs/config/token-manager.js +54 -4
- package/dist/cjs/index.js +53 -2
- package/dist/cjs/model/enums.js +18 -1
- package/dist/cjs/model/order-helpers.js +149 -0
- package/dist/cjs/push/index.js +1 -0
- package/dist/cjs/push/push-client.js +47 -19
- package/dist/cjs/push/tick-util.js +172 -0
- package/dist/cjs/quote/quote-client.js +300 -70
- package/dist/cjs/trade/trade-client.js +174 -13
- package/dist/cjs/version.js +4 -0
- package/dist/esm/client/api-request.js +1 -1
- package/dist/esm/client/api-response.js +29 -8
- package/dist/esm/client/case-convert.js +4 -3
- package/dist/esm/client/http-client.js +128 -12
- package/dist/esm/client/index.js +6 -6
- package/dist/esm/client/token-methods.js +37 -0
- package/dist/esm/config/client-config.js +118 -20
- package/dist/esm/config/config-parser.js +19 -9
- package/dist/esm/config/index.js +4 -3
- package/dist/esm/config/token-manager.js +55 -5
- package/dist/esm/index.js +15 -1
- package/dist/esm/logger/index.js +1 -1
- package/dist/esm/model/contract-helpers.js +1 -1
- package/dist/esm/model/enums.js +17 -0
- package/dist/esm/model/order-helpers.js +142 -1
- package/dist/esm/model/order-status.js +1 -1
- package/dist/esm/push/index.js +6 -5
- package/dist/esm/push/pb/PushData.js +11 -11
- package/dist/esm/push/pb/QuoteBasicData.js +1 -1
- package/dist/esm/push/pb/Response.js +1 -1
- package/dist/esm/push/pb/index.js +17 -17
- package/dist/esm/push/proto-message.js +3 -3
- package/dist/esm/push/push-client.js +54 -26
- package/dist/esm/push/tick-util.js +165 -0
- package/dist/esm/quote/index.js +1 -1
- package/dist/esm/quote/quote-client.js +269 -72
- package/dist/esm/signer/index.js +2 -2
- package/dist/esm/trade/index.js +1 -1
- package/dist/esm/trade/trade-client.js +144 -16
- package/dist/esm/version.js +1 -0
- package/dist/types/client/api-response.d.ts +6 -4
- package/dist/types/client/case-convert.d.ts +3 -1
- package/dist/types/client/http-client.d.ts +32 -1
- package/dist/types/client/token-methods.d.ts +34 -0
- package/dist/types/config/client-config.d.ts +22 -1
- package/dist/types/config/index.d.ts +3 -1
- package/dist/types/config/token-manager.d.ts +27 -3
- package/dist/types/index.d.ts +22 -1
- package/dist/types/model/enums.d.ts +18 -2
- package/dist/types/model/order-helpers.d.ts +52 -1
- package/dist/types/model/order.d.ts +127 -10
- package/dist/types/model/quote-requests.d.ts +27 -15
- package/dist/types/model/quote.d.ts +150 -24
- package/dist/types/model/trade-requests.d.ts +118 -4
- package/dist/types/model/trade.d.ts +121 -17
- package/dist/types/push/callbacks.d.ts +3 -7
- package/dist/types/push/index.d.ts +1 -0
- package/dist/types/push/push-client.d.ts +5 -3
- package/dist/types/push/tick-util.d.ts +30 -0
- package/dist/types/quote/quote-client.d.ts +101 -36
- package/dist/types/trade/trade-client.d.ts +57 -11
- package/dist/types/version.d.ts +1 -0
- package/package.json +5 -2
|
@@ -12,18 +12,36 @@ export interface OrderLeg {
|
|
|
12
12
|
timeInForce?: string;
|
|
13
13
|
quantity?: number;
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Algo order parameters — response side.
|
|
17
|
+
*
|
|
18
|
+
* The response shape flattens the [{tag, value}, ...] wire form into an
|
|
19
|
+
* object, and the server historically emits `startTime` / `endTime` as
|
|
20
|
+
* epoch-ms numbers (matching what the request side sends). Some legacy
|
|
21
|
+
* paths still return the raw string; accept both.
|
|
22
|
+
*
|
|
23
|
+
* Note: `algoStrategy` on the response side is server-echoed; on the
|
|
24
|
+
* request side it lives on `OrderRequest`, not `AlgoParamsRequest`.
|
|
25
|
+
*/
|
|
16
26
|
export interface AlgoParams {
|
|
17
27
|
algoStrategy?: string;
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
/** Epoch-ms; server may echo as string on legacy paths */
|
|
29
|
+
startTime?: number | string;
|
|
30
|
+
/** Epoch-ms; server may echo as string on legacy paths */
|
|
31
|
+
endTime?: number | string;
|
|
32
|
+
/** Whether to minimize trade count (VWAP) */
|
|
33
|
+
noTakeLiq?: boolean;
|
|
34
|
+
/** Whether to allow completion after end_time (TWAP / VWAP) */
|
|
35
|
+
allowPastEndTime?: boolean;
|
|
36
|
+
/** Participation rate 0.01–0.5 (VWAP only) */
|
|
20
37
|
participationRate?: number;
|
|
21
38
|
}
|
|
22
39
|
/** Order response model (returned by order query methods). */
|
|
23
40
|
export interface Order {
|
|
24
41
|
account?: string;
|
|
25
|
-
|
|
26
|
-
|
|
42
|
+
/** int64 order ID — may be a string when it exceeds Number.MAX_SAFE_INTEGER */
|
|
43
|
+
id?: number | string;
|
|
44
|
+
orderId?: number | string;
|
|
27
45
|
externalId?: string;
|
|
28
46
|
action?: string;
|
|
29
47
|
orderType?: string;
|
|
@@ -82,6 +100,8 @@ export interface OrderRequest {
|
|
|
82
100
|
account?: string;
|
|
83
101
|
/** Global order ID (required for modify) */
|
|
84
102
|
id?: number;
|
|
103
|
+
/** Institutional account trading key (client fills it in automatically if set) */
|
|
104
|
+
secretKey?: string;
|
|
85
105
|
/** Account-level order ID */
|
|
86
106
|
orderId?: number;
|
|
87
107
|
/** BUY / SELL */
|
|
@@ -124,18 +144,115 @@ export interface OrderRequest {
|
|
|
124
144
|
remark?: string;
|
|
125
145
|
/** User mark */
|
|
126
146
|
userMark?: string;
|
|
147
|
+
/** 冰山单:展示数量 */
|
|
148
|
+
displaySize?: number;
|
|
149
|
+
/** 冰山单:最小展示数量 */
|
|
150
|
+
minDisplaySize?: number;
|
|
151
|
+
/** 冰山单:价检间隔(秒) */
|
|
152
|
+
checkIntervals?: number;
|
|
153
|
+
/** 冰山单:价格类型(LIMIT_PRICE / ASK_PRICE / BID_PRICE / LATEST_PRICE) */
|
|
154
|
+
priceType?: string;
|
|
155
|
+
/**
|
|
156
|
+
* 冰山单:生效开始时间(epoch ms)。
|
|
157
|
+
* Wire note: the gateway accepts both `number` (epoch ms) and `string`
|
|
158
|
+
* (epoch ms as string) for ICEBERG orders; `number | string` keeps
|
|
159
|
+
* TypeScript callers who pass `String(now)` from hitting a compile error.
|
|
160
|
+
*/
|
|
161
|
+
startTime?: number | string;
|
|
162
|
+
/**
|
|
163
|
+
* 冰山单:生效结束时间(epoch ms)。
|
|
164
|
+
* Same dual-type note as `startTime` above.
|
|
165
|
+
*/
|
|
166
|
+
endTime?: number | string;
|
|
167
|
+
/** GTD 到期时间(epoch ms) */
|
|
168
|
+
expireTime?: number;
|
|
169
|
+
/** 盘后委托价格 */
|
|
170
|
+
afterHoursPrice?: number;
|
|
171
|
+
/** 批次号 */
|
|
172
|
+
batchNo?: number;
|
|
173
|
+
/** 资金类型(CASH / MARGIN) */
|
|
174
|
+
segType?: string;
|
|
175
|
+
/** 按金额下单:委托金额 */
|
|
176
|
+
amount?: number;
|
|
177
|
+
/** 按金额下单:现金金额(wire: cash_amount,与 amount 二选一) */
|
|
178
|
+
cashAmount?: number;
|
|
179
|
+
/**
|
|
180
|
+
* @deprecated 服务端不再需要此字段,by-amount 订单直接设置 `cashAmount`。
|
|
181
|
+
* 保留仅为向前兼容,新代码勿使用。
|
|
182
|
+
*/
|
|
183
|
+
isQuantityByAmount?: boolean;
|
|
184
|
+
/** 账户分配列表(机构账户) */
|
|
185
|
+
allocAccounts?: string[];
|
|
186
|
+
/** 各账户分配份额(与 allocAccounts 一一对应) */
|
|
187
|
+
allocShares?: number[];
|
|
188
|
+
/** 下单来源 */
|
|
189
|
+
source?: string;
|
|
190
|
+
/** 下单渠道 */
|
|
191
|
+
channel?: string;
|
|
192
|
+
/** 虚拟订单类型 */
|
|
193
|
+
virtualOrderType?: string;
|
|
194
|
+
/** 虚拟订单 ID */
|
|
195
|
+
virtualId?: string;
|
|
196
|
+
/** 止盈订单 ID(bracket 关联) */
|
|
197
|
+
profitTakerOrderId?: number;
|
|
198
|
+
/** 止损订单 ID(bracket 关联) */
|
|
199
|
+
stopLossOrderId?: number;
|
|
200
|
+
/** 本地流水号 */
|
|
201
|
+
localNo?: string;
|
|
202
|
+
/** OCA 订单组(One-Cancels-All) */
|
|
203
|
+
ocaOrders?: OrderRequest[];
|
|
204
|
+
/** 多腿期权各腿(MLEG) */
|
|
205
|
+
contractLegs?: ContractLegRequest[];
|
|
206
|
+
/** 组合单类型(如 MLEG) */
|
|
207
|
+
comboType?: string;
|
|
208
|
+
/**
|
|
209
|
+
* Algo strategy name for TWAP / VWAP orders (e.g. `'TWAP'`, `'VWAP'`).
|
|
210
|
+
* Lives on `OrderRequest`, not inside `algoParams` — the Python SDK
|
|
211
|
+
* places it at the top-level order object, and the gateway expects
|
|
212
|
+
* `algo_strategy` as a sibling of `algo_params`.
|
|
213
|
+
*
|
|
214
|
+
* Note: `AlgoParamsRequest` intentionally omits this field (see its
|
|
215
|
+
* doc-comment). Pass `algoStrategy` here and `algoParams` as the
|
|
216
|
+
* companion object.
|
|
217
|
+
*/
|
|
218
|
+
algoStrategy?: string;
|
|
219
|
+
}
|
|
220
|
+
/** Single leg of a multi-leg option order (MLEG) */
|
|
221
|
+
export interface ContractLegRequest {
|
|
222
|
+
symbol?: string;
|
|
223
|
+
secType?: string;
|
|
224
|
+
expiry?: string;
|
|
225
|
+
strike?: string;
|
|
226
|
+
right?: string;
|
|
227
|
+
action?: string;
|
|
228
|
+
ratio?: number;
|
|
127
229
|
}
|
|
128
|
-
/** Attached leg for request side */
|
|
230
|
+
/** Attached profit/loss leg for order request side */
|
|
129
231
|
export interface OrderLegRequest {
|
|
130
232
|
legType: string;
|
|
131
233
|
price?: number;
|
|
132
234
|
timeInForce?: string;
|
|
133
235
|
quantity?: number;
|
|
134
236
|
}
|
|
135
|
-
/**
|
|
237
|
+
/**
|
|
238
|
+
* Algo parameters for request side (TWAP / VWAP).
|
|
239
|
+
*
|
|
240
|
+
* Fields match the Python SDK's AlgoParams. On the wire, the SDK marshals
|
|
241
|
+
* this object into the `[{tag, value}, ...]` array shape the gateway
|
|
242
|
+
* expects — callers should just pass the natural object.
|
|
243
|
+
*
|
|
244
|
+
* `algoStrategy` is intentionally not here: it lives on the parent
|
|
245
|
+
* `OrderRequest`, not inside `algoParams`.
|
|
246
|
+
*/
|
|
136
247
|
export interface AlgoParamsRequest {
|
|
137
|
-
|
|
138
|
-
startTime?:
|
|
139
|
-
|
|
248
|
+
/** Epoch-ms start time (TWAP / VWAP only) */
|
|
249
|
+
startTime?: number;
|
|
250
|
+
/** Epoch-ms end time (TWAP / VWAP only) */
|
|
251
|
+
endTime?: number;
|
|
252
|
+
/** Try to minimize trade count (VWAP only) */
|
|
253
|
+
noTakeLiq?: boolean;
|
|
254
|
+
/** Allow completing after end_time (TWAP / VWAP only) */
|
|
255
|
+
allowPastEndTime?: boolean;
|
|
256
|
+
/** Participation rate 0.01–0.5 (VWAP only) */
|
|
140
257
|
participationRate?: number;
|
|
141
258
|
}
|
|
@@ -27,6 +27,7 @@ export interface TradeTickRequest {
|
|
|
27
27
|
beginIndex?: number;
|
|
28
28
|
endIndex?: number;
|
|
29
29
|
limit?: number;
|
|
30
|
+
tradeSession?: string;
|
|
30
31
|
lang?: string;
|
|
31
32
|
}
|
|
32
33
|
/** Real-time futures quotes. wire: future_brief */
|
|
@@ -58,11 +59,10 @@ export interface StockDelayBriefsRequest {
|
|
|
58
59
|
secType?: string;
|
|
59
60
|
lang?: string;
|
|
60
61
|
}
|
|
61
|
-
/**
|
|
62
|
-
* K-line bars (full options). wire: kline
|
|
62
|
+
/** K-line request. wire: kline
|
|
63
63
|
* BeginTime/EndTime (ms) and BeginIndex/EndIndex are mutually exclusive.
|
|
64
64
|
*/
|
|
65
|
-
export interface
|
|
65
|
+
export interface KlineRequest {
|
|
66
66
|
symbols?: string[];
|
|
67
67
|
period?: string;
|
|
68
68
|
right?: string;
|
|
@@ -79,8 +79,9 @@ export interface BarsRequest {
|
|
|
79
79
|
lang?: string;
|
|
80
80
|
}
|
|
81
81
|
/** K-line client-side pagination wrapper. */
|
|
82
|
-
export interface
|
|
82
|
+
export interface KlineByPageRequest {
|
|
83
83
|
symbol?: string;
|
|
84
|
+
secType?: string;
|
|
84
85
|
period?: string;
|
|
85
86
|
beginTime?: number;
|
|
86
87
|
endTime?: number;
|
|
@@ -90,6 +91,11 @@ export interface BarsByPageRequest {
|
|
|
90
91
|
lang?: string;
|
|
91
92
|
tradeSession?: string;
|
|
92
93
|
}
|
|
94
|
+
/** Intraday timeline request. wire: timeline */
|
|
95
|
+
export interface TimelineRequest {
|
|
96
|
+
symbols?: string[];
|
|
97
|
+
secType?: string;
|
|
98
|
+
}
|
|
93
99
|
/** Historical intraday timeline. wire: history_timeline */
|
|
94
100
|
export interface TimelineHistoryRequest {
|
|
95
101
|
symbols?: string[];
|
|
@@ -135,7 +141,7 @@ export interface KlineQuotaRequest {
|
|
|
135
141
|
withDetails?: boolean;
|
|
136
142
|
lang?: string;
|
|
137
143
|
}
|
|
138
|
-
/**
|
|
144
|
+
/** Market data permission entry request. wire: get_quote_permission */
|
|
139
145
|
export interface QuotePermissionRequest {
|
|
140
146
|
beginDate?: string;
|
|
141
147
|
endDate?: string;
|
|
@@ -155,15 +161,21 @@ export interface OptionQueryItem {
|
|
|
155
161
|
endIndex?: number;
|
|
156
162
|
pageToken?: string;
|
|
157
163
|
}
|
|
158
|
-
/** Option
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
/** Option tick trades. wire: option_trade_tick
|
|
165
|
+
*
|
|
166
|
+
* **Wire contract:** the server expects `biz_content` to be a **top-level
|
|
167
|
+
* JSON array** (`[{symbol, expiry, ...}, ...]`), not `{"contracts": [...]}`.
|
|
168
|
+
* This matches Java (`BatchApiModel.items` serialized directly) and Python
|
|
169
|
+
* (`MultipleContractParams.to_openapi_dict` returns a list).
|
|
170
|
+
*
|
|
171
|
+
* The client unwraps `contracts` before serialization; sending it as an
|
|
172
|
+
* object caused `biz param error(failed to parse parameters in 'biz_content')`.
|
|
173
|
+
* `lang` is retained for API symmetry but is not sent on the wire — the
|
|
174
|
+
* gateway has no `lang` input for this method.
|
|
175
|
+
*/
|
|
165
176
|
export interface OptionTradeTicksRequest {
|
|
166
177
|
contracts?: OptionQueryItem[];
|
|
178
|
+
/** Retained for API symmetry; wire is a top-level array, so `lang` is not sent. */
|
|
167
179
|
lang?: string;
|
|
168
180
|
}
|
|
169
181
|
/** Option intraday timeline. wire: option_timeline */
|
|
@@ -215,8 +227,8 @@ export interface FutureHistoryMainContractRequest {
|
|
|
215
227
|
endTime?: number;
|
|
216
228
|
lang?: string;
|
|
217
229
|
}
|
|
218
|
-
/** Futures K-line
|
|
219
|
-
export interface
|
|
230
|
+
/** Futures K-line request. wire: future_kline */
|
|
231
|
+
export interface FutureKlineRequest {
|
|
220
232
|
contractCodes?: string[];
|
|
221
233
|
contractCode?: string;
|
|
222
234
|
period?: string;
|
|
@@ -229,7 +241,7 @@ export interface FutureBarsRequest {
|
|
|
229
241
|
lang?: string;
|
|
230
242
|
}
|
|
231
243
|
/** Futures K-line client-side pagination wrapper. */
|
|
232
|
-
export interface
|
|
244
|
+
export interface FutureKlineByPageRequest {
|
|
233
245
|
contractCode?: string;
|
|
234
246
|
period?: string;
|
|
235
247
|
beginTime?: number;
|
|
@@ -37,6 +37,7 @@ export interface Brief {
|
|
|
37
37
|
export interface KlineItem {
|
|
38
38
|
time: number;
|
|
39
39
|
volume: number;
|
|
40
|
+
volumeDecimal?: number | null;
|
|
40
41
|
open: number;
|
|
41
42
|
close: number;
|
|
42
43
|
high: number;
|
|
@@ -52,6 +53,7 @@ export interface Kline {
|
|
|
52
53
|
export interface TimelineItem {
|
|
53
54
|
time: number;
|
|
54
55
|
volume: number;
|
|
56
|
+
volumeDecimal?: number | null;
|
|
55
57
|
price: number;
|
|
56
58
|
avgPrice: number;
|
|
57
59
|
}
|
|
@@ -71,6 +73,9 @@ export interface TradeTickItem {
|
|
|
71
73
|
volume: number;
|
|
72
74
|
price: number;
|
|
73
75
|
type: string;
|
|
76
|
+
partCode?: string;
|
|
77
|
+
partName?: string;
|
|
78
|
+
cond?: string;
|
|
74
79
|
}
|
|
75
80
|
export interface TradeTick {
|
|
76
81
|
symbol: string;
|
|
@@ -116,11 +121,37 @@ export interface OptionLeg {
|
|
|
116
121
|
theta?: number;
|
|
117
122
|
vega?: number;
|
|
118
123
|
rho?: number;
|
|
124
|
+
markPrice?: number;
|
|
125
|
+
preMarkPrice?: number;
|
|
126
|
+
markTimestamp?: number;
|
|
127
|
+
midPrice?: number;
|
|
128
|
+
preMidPrice?: number;
|
|
129
|
+
midTimestamp?: number;
|
|
119
130
|
}
|
|
120
131
|
export interface OptionChainRow {
|
|
121
132
|
put?: OptionLeg;
|
|
122
133
|
call?: OptionLeg;
|
|
123
134
|
}
|
|
135
|
+
/** Range filter, serialized as { min, max } — corresponds to Java Range<T> */
|
|
136
|
+
export interface Range {
|
|
137
|
+
min?: number;
|
|
138
|
+
max?: number;
|
|
139
|
+
}
|
|
140
|
+
/** Greeks range filters for option_chain (corresponds to Java OptionChainFilterModel.Greeks) */
|
|
141
|
+
export interface OptionChainFilterGreeks {
|
|
142
|
+
delta?: Range;
|
|
143
|
+
gamma?: Range;
|
|
144
|
+
vega?: Range;
|
|
145
|
+
theta?: Range;
|
|
146
|
+
rho?: Range;
|
|
147
|
+
}
|
|
148
|
+
/** Option chain filter (corresponds to Java OptionChainFilterModel) */
|
|
149
|
+
export interface OptionChainFilter {
|
|
150
|
+
inTheMoney?: boolean;
|
|
151
|
+
impliedVolatility?: Range;
|
|
152
|
+
openInterest?: Range;
|
|
153
|
+
greeks?: OptionChainFilterGreeks;
|
|
154
|
+
}
|
|
124
155
|
export interface OptionChain {
|
|
125
156
|
symbol: string;
|
|
126
157
|
expiry: number;
|
|
@@ -217,6 +248,42 @@ export interface CorporateAction {
|
|
|
217
248
|
fromFactor?: number;
|
|
218
249
|
toFactor?: number;
|
|
219
250
|
}
|
|
251
|
+
export interface CorporateSymbolChange {
|
|
252
|
+
symbol: string;
|
|
253
|
+
market?: string;
|
|
254
|
+
exchange?: string;
|
|
255
|
+
executeDate?: string;
|
|
256
|
+
actionType?: string;
|
|
257
|
+
oldSymbol?: string;
|
|
258
|
+
/** newSymbol is the ticker after the rename; same as symbol. */
|
|
259
|
+
newSymbol?: string;
|
|
260
|
+
}
|
|
261
|
+
export interface CorporateDelisting {
|
|
262
|
+
symbol: string;
|
|
263
|
+
market?: string;
|
|
264
|
+
exchange?: string;
|
|
265
|
+
executeDate?: string;
|
|
266
|
+
actionType?: string;
|
|
267
|
+
announcedDate?: string;
|
|
268
|
+
reason?: string;
|
|
269
|
+
}
|
|
270
|
+
export interface CorporateIPO {
|
|
271
|
+
symbol: string;
|
|
272
|
+
market?: string;
|
|
273
|
+
exchange?: string;
|
|
274
|
+
executeDate?: string;
|
|
275
|
+
actionType?: string;
|
|
276
|
+
ipoName?: string;
|
|
277
|
+
listingDate?: string;
|
|
278
|
+
listingPrice?: number;
|
|
279
|
+
sharesOutstanding?: number;
|
|
280
|
+
sharesFloat?: number;
|
|
281
|
+
offerAmount?: number;
|
|
282
|
+
priceRange?: string;
|
|
283
|
+
currency?: string;
|
|
284
|
+
minPurchaseQuantity?: number;
|
|
285
|
+
leverageRatio?: number;
|
|
286
|
+
}
|
|
220
287
|
export interface CapitalFlowItem {
|
|
221
288
|
time: string;
|
|
222
289
|
timestamp: number;
|
|
@@ -272,20 +339,39 @@ export interface FinancialDailyRequest {
|
|
|
272
339
|
beginDate: string;
|
|
273
340
|
endDate: string;
|
|
274
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* Financial report request.
|
|
344
|
+
*
|
|
345
|
+
* **Wire types (breaking):** `beginDate` / `endDate` are epoch-ms integers,
|
|
346
|
+
* not date strings. Python SDK converts via `date_str_to_timestamp` before
|
|
347
|
+
* sending; sending raw strings makes the gateway reject with
|
|
348
|
+
* `biz param error(failed to parse parameters in 'biz_content')`.
|
|
349
|
+
*/
|
|
275
350
|
export interface FinancialReportRequest {
|
|
276
351
|
symbols: string[];
|
|
277
352
|
market: string;
|
|
278
353
|
fields: string[];
|
|
279
354
|
periodType: string;
|
|
280
|
-
|
|
281
|
-
|
|
355
|
+
/** epoch-ms start time */
|
|
356
|
+
beginDate?: number;
|
|
357
|
+
/** epoch-ms end time */
|
|
358
|
+
endDate?: number;
|
|
282
359
|
}
|
|
360
|
+
/**
|
|
361
|
+
* Corporate action request.
|
|
362
|
+
*
|
|
363
|
+
* **Wire types (breaking):** `beginDate` / `endDate` are epoch-ms integers,
|
|
364
|
+
* matching `FinancialReportRequest`. Server rejects string dates with
|
|
365
|
+
* `biz param error(failed to parse parameters in 'biz_content')`.
|
|
366
|
+
*/
|
|
283
367
|
export interface CorporateActionRequest {
|
|
284
368
|
symbols: string[];
|
|
285
369
|
market: string;
|
|
286
370
|
actionType: string;
|
|
287
|
-
|
|
288
|
-
|
|
371
|
+
/** epoch-ms start time */
|
|
372
|
+
beginDate?: number;
|
|
373
|
+
/** epoch-ms end time */
|
|
374
|
+
endDate?: number;
|
|
289
375
|
}
|
|
290
376
|
export interface FutureKlineRequest {
|
|
291
377
|
contractCodes: string[];
|
|
@@ -407,16 +493,26 @@ export interface KlineQuota {
|
|
|
407
493
|
}
|
|
408
494
|
/** Option historical-volatility time series point. */
|
|
409
495
|
export interface OptionVolatilityPoint {
|
|
410
|
-
|
|
411
|
-
|
|
496
|
+
impliedVol?: number;
|
|
497
|
+
percentile?: number;
|
|
498
|
+
rank?: number;
|
|
499
|
+
hisVolatility?: number;
|
|
500
|
+
timestamp?: number;
|
|
501
|
+
}
|
|
502
|
+
/** Implied-volatility metric for a specific period. */
|
|
503
|
+
export interface ImpliedVolMetric {
|
|
504
|
+
period?: string;
|
|
505
|
+
percentile?: number;
|
|
506
|
+
rank?: number;
|
|
412
507
|
}
|
|
413
508
|
/** Option analysis (option_analysis). */
|
|
414
509
|
export interface OptionAnalysis {
|
|
415
510
|
symbol?: string;
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
511
|
+
impliedVol30Days?: number;
|
|
512
|
+
hisVolatility?: number;
|
|
513
|
+
ivHisVRatio?: number;
|
|
514
|
+
callPutRatio?: number;
|
|
515
|
+
impliedVolMetric?: ImpliedVolMetric;
|
|
420
516
|
volatilityList?: OptionVolatilityPoint[];
|
|
421
517
|
}
|
|
422
518
|
/** Option symbol listing (option_symbol). */
|
|
@@ -486,10 +582,32 @@ export interface WarrantFilterResult {
|
|
|
486
582
|
pageSize?: number;
|
|
487
583
|
page?: number;
|
|
488
584
|
}
|
|
489
|
-
/**
|
|
585
|
+
/**
|
|
586
|
+
* Industry list row (industry_list).
|
|
587
|
+
*
|
|
588
|
+
* **Wire fields (breaking):** the server returns `nameCN` / `nameEN` /
|
|
589
|
+
* `industryLevel`, not `name` / `level` (matches Python SDK's
|
|
590
|
+
* `IndustryListResponse` which reads `ind.get('nameCN')`,
|
|
591
|
+
* `ind.get('nameEN')`, `ind.get('industryLevel')`).
|
|
592
|
+
* Since responses come back already-camelCase (no snake→camel step) and the
|
|
593
|
+
* server keeps `nameCN` / `nameEN` in mixed case, the fields are exposed
|
|
594
|
+
* exactly as sent.
|
|
595
|
+
*
|
|
596
|
+
* `name` and `level` are backwards-compat aliases populated by
|
|
597
|
+
* `getIndustryList` after the raw response is decoded — `name` mirrors
|
|
598
|
+
* `nameEN || nameCN`, `level` mirrors `industryLevel`.
|
|
599
|
+
*/
|
|
490
600
|
export interface IndustryItem {
|
|
491
601
|
id?: string;
|
|
602
|
+
/** Chinese name. Wire: `nameCN`. */
|
|
603
|
+
nameCN?: string;
|
|
604
|
+
/** English name. Wire: `nameEN`. */
|
|
605
|
+
nameEN?: string;
|
|
606
|
+
/** Industry level. Wire: `industryLevel`. */
|
|
607
|
+
industryLevel?: string;
|
|
608
|
+
/** Convenience alias: `nameEN || nameCN`. Populated by `getIndustryList`. */
|
|
492
609
|
name?: string;
|
|
610
|
+
/** @deprecated Use `industryLevel`. Mirrored by `getIndustryList` for back-compat. */
|
|
493
611
|
level?: string;
|
|
494
612
|
}
|
|
495
613
|
/** Stock belonging to an industry (industry_stock_list). */
|
|
@@ -507,12 +625,15 @@ export interface TradingCalendarItem {
|
|
|
507
625
|
isTrading?: boolean;
|
|
508
626
|
sessionType?: string;
|
|
509
627
|
}
|
|
628
|
+
/** Single day's FX rate value within an ExchangeRate.dailyValueList entry. */
|
|
629
|
+
export interface ExchangeRateDailyValue {
|
|
630
|
+
date?: number;
|
|
631
|
+
value?: number;
|
|
632
|
+
}
|
|
510
633
|
/** FX rate (financial_exchange_rate). */
|
|
511
634
|
export interface ExchangeRate {
|
|
512
635
|
currency?: string;
|
|
513
|
-
|
|
514
|
-
rate?: number;
|
|
515
|
-
baseCurrency?: string;
|
|
636
|
+
dailyValueList?: ExchangeRateDailyValue[];
|
|
516
637
|
}
|
|
517
638
|
/** Financial currency per symbol (financial_currency). */
|
|
518
639
|
export interface FinancialCurrency {
|
|
@@ -523,17 +644,19 @@ export interface FinancialCurrency {
|
|
|
523
644
|
/** Overnight quote (quote_overnight). */
|
|
524
645
|
export interface QuoteOvernight {
|
|
525
646
|
symbol?: string;
|
|
647
|
+
latestPrice?: number;
|
|
648
|
+
askPrice?: number;
|
|
649
|
+
askSize?: number;
|
|
650
|
+
bidPrice?: number;
|
|
651
|
+
bidSize?: number;
|
|
526
652
|
preClose?: number;
|
|
527
|
-
open?: number;
|
|
528
|
-
close?: number;
|
|
529
|
-
high?: number;
|
|
530
|
-
low?: number;
|
|
531
653
|
volume?: number;
|
|
532
654
|
amount?: number;
|
|
655
|
+
timestamp?: number;
|
|
656
|
+
tradingStatus?: number;
|
|
533
657
|
change?: number;
|
|
534
658
|
changeRate?: number;
|
|
535
|
-
|
|
536
|
-
endTime?: number;
|
|
659
|
+
amplitude?: number;
|
|
537
660
|
}
|
|
538
661
|
/** Single market-scanner tag. */
|
|
539
662
|
export interface MarketScannerTag {
|
|
@@ -541,11 +664,14 @@ export interface MarketScannerTag {
|
|
|
541
664
|
name?: string;
|
|
542
665
|
values?: string[];
|
|
543
666
|
}
|
|
544
|
-
/** Market
|
|
545
|
-
export interface
|
|
546
|
-
|
|
547
|
-
|
|
667
|
+
/** Market-scanner tag group (one entry per market). wire: market_scanner_tags returns array of these. */
|
|
668
|
+
export interface MarketScannerTagGroup {
|
|
669
|
+
market?: string;
|
|
670
|
+
multiTagField?: string;
|
|
671
|
+
tagList?: MarketScannerTag[];
|
|
548
672
|
}
|
|
673
|
+
/** @deprecated Use MarketScannerTagGroup[] instead. Kept for backwards compatibility. */
|
|
674
|
+
export type MarketScannerTags = MarketScannerTagGroup;
|
|
549
675
|
/** Fund contract info (fund_contracts). */
|
|
550
676
|
export interface FundContractInfo {
|
|
551
677
|
symbol?: string;
|