tigeropen 0.3.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.
Files changed (84) hide show
  1. package/README.md +55 -2
  2. package/dist/cjs/client/api-response.js +28 -7
  3. package/dist/cjs/client/case-convert.js +4 -3
  4. package/dist/cjs/client/http-client.js +124 -8
  5. package/dist/cjs/client/token-methods.js +42 -0
  6. package/dist/cjs/config/client-config.js +115 -16
  7. package/dist/cjs/config/config-parser.js +19 -9
  8. package/dist/cjs/config/index.js +4 -1
  9. package/dist/cjs/config/token-manager.js +54 -4
  10. package/dist/cjs/index.js +53 -2
  11. package/dist/cjs/model/enums.js +106 -7
  12. package/dist/cjs/model/order-helpers.js +149 -0
  13. package/dist/cjs/model/order-status.js +46 -0
  14. package/dist/cjs/model/quote-requests.js +11 -0
  15. package/dist/cjs/model/trade-requests.js +13 -0
  16. package/dist/cjs/push/index.js +1 -0
  17. package/dist/cjs/push/pb/OrderStatusData.js +24 -0
  18. package/dist/cjs/push/proto-message.js +6 -0
  19. package/dist/cjs/push/push-client.js +117 -19
  20. package/dist/cjs/push/push-message.js +4 -0
  21. package/dist/cjs/push/tick-util.js +172 -0
  22. package/dist/cjs/quote/quote-client.js +584 -42
  23. package/dist/cjs/trade/trade-client.js +334 -32
  24. package/dist/cjs/version.js +4 -0
  25. package/dist/esm/client/api-request.js +1 -1
  26. package/dist/esm/client/api-response.js +29 -8
  27. package/dist/esm/client/case-convert.js +4 -3
  28. package/dist/esm/client/http-client.js +128 -12
  29. package/dist/esm/client/index.js +6 -6
  30. package/dist/esm/client/token-methods.js +37 -0
  31. package/dist/esm/config/client-config.js +118 -20
  32. package/dist/esm/config/config-parser.js +19 -9
  33. package/dist/esm/config/index.js +4 -3
  34. package/dist/esm/config/token-manager.js +55 -5
  35. package/dist/esm/index.js +15 -1
  36. package/dist/esm/logger/index.js +1 -1
  37. package/dist/esm/model/contract-helpers.js +1 -1
  38. package/dist/esm/model/enums.js +104 -6
  39. package/dist/esm/model/order-helpers.js +142 -1
  40. package/dist/esm/model/order-status.js +43 -0
  41. package/dist/esm/model/quote-requests.js +10 -0
  42. package/dist/esm/model/trade-requests.js +12 -0
  43. package/dist/esm/push/index.js +6 -5
  44. package/dist/esm/push/pb/OrderStatusData.js +24 -0
  45. package/dist/esm/push/pb/PushData.js +11 -11
  46. package/dist/esm/push/pb/QuoteBasicData.js +1 -1
  47. package/dist/esm/push/pb/Response.js +1 -1
  48. package/dist/esm/push/pb/index.js +17 -17
  49. package/dist/esm/push/proto-message.js +9 -3
  50. package/dist/esm/push/push-client.js +124 -26
  51. package/dist/esm/push/push-message.js +4 -0
  52. package/dist/esm/push/tick-util.js +165 -0
  53. package/dist/esm/quote/index.js +1 -1
  54. package/dist/esm/quote/quote-client.js +553 -44
  55. package/dist/esm/signer/index.js +2 -2
  56. package/dist/esm/trade/index.js +1 -1
  57. package/dist/esm/trade/trade-client.js +303 -34
  58. package/dist/esm/version.js +1 -0
  59. package/dist/types/client/api-response.d.ts +6 -4
  60. package/dist/types/client/case-convert.d.ts +3 -1
  61. package/dist/types/client/http-client.d.ts +32 -1
  62. package/dist/types/client/token-methods.d.ts +34 -0
  63. package/dist/types/config/client-config.d.ts +22 -1
  64. package/dist/types/config/index.d.ts +3 -1
  65. package/dist/types/config/token-manager.d.ts +27 -3
  66. package/dist/types/index.d.ts +22 -1
  67. package/dist/types/model/enums.d.ts +77 -7
  68. package/dist/types/model/order-helpers.d.ts +52 -1
  69. package/dist/types/model/order-status.d.ts +14 -0
  70. package/dist/types/model/order.d.ts +127 -10
  71. package/dist/types/model/quote-requests.d.ts +356 -0
  72. package/dist/types/model/quote.d.ts +391 -4
  73. package/dist/types/model/trade-requests.d.ts +309 -0
  74. package/dist/types/model/trade.d.ts +231 -5
  75. package/dist/types/push/callbacks.d.ts +3 -7
  76. package/dist/types/push/index.d.ts +1 -0
  77. package/dist/types/push/pb/OrderStatusData.d.ts +4 -0
  78. package/dist/types/push/push-client.d.ts +36 -3
  79. package/dist/types/push/push-message.d.ts +4 -0
  80. package/dist/types/push/tick-util.d.ts +30 -0
  81. package/dist/types/quote/quote-client.d.ts +193 -15
  82. package/dist/types/trade/trade-client.d.ts +136 -18
  83. package/dist/types/version.d.ts +1 -0
  84. package/package.json +5 -2
@@ -0,0 +1,356 @@
1
+ /**
2
+ * Quote request interfaces (v0.4.0).
3
+ *
4
+ * 所有字段可选(用户调用时传一个空对象即可);字段名用 camelCase,
5
+ * client 层通过 keysToSnakeCase 转成服务端 wire 真名的 snake_case。
6
+ * **字段名设计规则:camelCase → snake_case 后必须等于服务端 wire 真名。**
7
+ *
8
+ * 参考 Go SDK model/quote_requests.go。
9
+ */
10
+ /** Real-time stock quotes. wire: quote_real_time */
11
+ export interface BriefRequest {
12
+ symbols?: string[];
13
+ includeHourTrading?: boolean;
14
+ secType?: string;
15
+ lang?: string;
16
+ }
17
+ /** Order-book depth. wire: quote_depth */
18
+ export interface DepthQuoteRequest {
19
+ symbols?: string[];
20
+ market?: string;
21
+ tradeSession?: string;
22
+ lang?: string;
23
+ }
24
+ /** Tick-by-tick trades. wire: trade_tick */
25
+ export interface TradeTickRequest {
26
+ symbols?: string[];
27
+ beginIndex?: number;
28
+ endIndex?: number;
29
+ limit?: number;
30
+ tradeSession?: string;
31
+ lang?: string;
32
+ }
33
+ /** Real-time futures quotes. wire: future_brief */
34
+ export interface FutureBriefRequest {
35
+ contractCodes?: string[];
36
+ lang?: string;
37
+ }
38
+ /** All symbols / symbol names. wire: all_symbols / all_symbol_names */
39
+ export interface SymbolsRequest {
40
+ market?: string;
41
+ secType?: string;
42
+ includeOtc?: boolean;
43
+ lang?: string;
44
+ }
45
+ /** Trade meta (lot size / tick size / shortable). wire: quote_stock_trade */
46
+ export interface TradeMetasRequest {
47
+ symbols?: string[];
48
+ lang?: string;
49
+ }
50
+ /** Stock details. wire: stock_detail. Server returns {items:[...]}. */
51
+ export interface StockDetailsRequest {
52
+ symbols?: string[];
53
+ secType?: string;
54
+ lang?: string;
55
+ }
56
+ /** Delayed stock briefs. wire: quote_delay */
57
+ export interface StockDelayBriefsRequest {
58
+ symbols?: string[];
59
+ secType?: string;
60
+ lang?: string;
61
+ }
62
+ /** K-line request. wire: kline
63
+ * BeginTime/EndTime (ms) and BeginIndex/EndIndex are mutually exclusive.
64
+ */
65
+ export interface KlineRequest {
66
+ symbols?: string[];
67
+ period?: string;
68
+ right?: string;
69
+ beginTime?: number;
70
+ endTime?: number;
71
+ limit?: number;
72
+ beginIndex?: number;
73
+ endIndex?: number;
74
+ pageToken?: string;
75
+ tradeSession?: string;
76
+ date?: string;
77
+ withFundamental?: boolean;
78
+ secType?: string;
79
+ lang?: string;
80
+ }
81
+ /** K-line client-side pagination wrapper. */
82
+ export interface KlineByPageRequest {
83
+ symbol?: string;
84
+ secType?: string;
85
+ period?: string;
86
+ beginTime?: number;
87
+ endTime?: number;
88
+ totalSize?: number;
89
+ pageSize?: number;
90
+ right?: string;
91
+ lang?: string;
92
+ tradeSession?: string;
93
+ }
94
+ /** Intraday timeline request. wire: timeline */
95
+ export interface TimelineRequest {
96
+ symbols?: string[];
97
+ secType?: string;
98
+ }
99
+ /** Historical intraday timeline. wire: history_timeline */
100
+ export interface TimelineHistoryRequest {
101
+ symbols?: string[];
102
+ /** yyyy-MM-dd */
103
+ date?: string;
104
+ right?: string;
105
+ tradeSession?: string;
106
+ lang?: string;
107
+ }
108
+ /** Trade rank (top movers / volume). wire: trade_rank */
109
+ export interface TradeRankRequest {
110
+ market?: string;
111
+ lang?: string;
112
+ }
113
+ /** Short interest. wire: quote_shortable_stocks */
114
+ export interface ShortInterestRequest {
115
+ symbols?: string[];
116
+ lang?: string;
117
+ }
118
+ /** Broker queue. wire: stock_broker */
119
+ export interface StockBrokerRequest {
120
+ symbol?: string;
121
+ limit?: number;
122
+ secType?: string;
123
+ lang?: string;
124
+ }
125
+ /** Stock fundamentals. wire: stock_fundamental */
126
+ export interface StockFundamentalRequest {
127
+ symbols?: string[];
128
+ market?: string;
129
+ secType?: string;
130
+ lang?: string;
131
+ }
132
+ /** Stock industry classification. wire: stock_industry */
133
+ export interface StockIndustryRequest {
134
+ symbol?: string;
135
+ market?: string;
136
+ secType?: string;
137
+ lang?: string;
138
+ }
139
+ /** K-line quota. wire: kline_quota */
140
+ export interface KlineQuotaRequest {
141
+ withDetails?: boolean;
142
+ lang?: string;
143
+ }
144
+ /** Market data permission entry request. wire: get_quote_permission */
145
+ export interface QuotePermissionRequest {
146
+ beginDate?: string;
147
+ endDate?: string;
148
+ lang?: string;
149
+ }
150
+ /** Nested option query item used by option_query / option_basic / contracts. */
151
+ export interface OptionQueryItem {
152
+ symbol?: string;
153
+ expiry?: number;
154
+ strike?: string;
155
+ right?: string;
156
+ period?: string;
157
+ beginTime?: number;
158
+ endTime?: number;
159
+ limit?: number;
160
+ beginIndex?: number;
161
+ endIndex?: number;
162
+ pageToken?: string;
163
+ }
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
+ */
176
+ export interface OptionTradeTicksRequest {
177
+ contracts?: OptionQueryItem[];
178
+ /** Retained for API symmetry; wire is a top-level array, so `lang` is not sent. */
179
+ lang?: string;
180
+ }
181
+ /** Option intraday timeline. wire: option_timeline */
182
+ export interface OptionTimelineRequest {
183
+ optionQuery?: OptionQueryItem[];
184
+ market?: string;
185
+ lang?: string;
186
+ }
187
+ /** Option order-book depth. wire: option_depth */
188
+ export interface OptionDepthRequest {
189
+ optionBasic?: OptionQueryItem[];
190
+ market?: string;
191
+ lang?: string;
192
+ }
193
+ /** Available option symbols. wire: option_symbol */
194
+ export interface OptionSymbolsRequest {
195
+ market?: string;
196
+ lang?: string;
197
+ }
198
+ /** Option analysis (volatility). wire: option_analysis */
199
+ export interface OptionAnalysisRequest {
200
+ symbols?: string[];
201
+ market?: string;
202
+ period?: string;
203
+ requireVolatilityList?: boolean;
204
+ lang?: string;
205
+ }
206
+ /** Lookup a futures contract by code. wire: future_contract_by_contract_code / future_current_contract */
207
+ export interface FutureContractSingleRequest {
208
+ contractCode?: string;
209
+ type?: string;
210
+ lang?: string;
211
+ }
212
+ /** List all futures contracts. wire: future_contracts */
213
+ export interface AllFutureContractsRequest {
214
+ type?: string;
215
+ exchange?: string;
216
+ lang?: string;
217
+ }
218
+ /** Continuous main contracts. wire: future_continuous_contracts */
219
+ export interface FutureContinuousContractsRequest {
220
+ type?: string;
221
+ lang?: string;
222
+ }
223
+ /** Historical main contracts. wire: future_main_contract */
224
+ export interface FutureHistoryMainContractRequest {
225
+ contractCodes?: string[];
226
+ beginTime?: number;
227
+ endTime?: number;
228
+ lang?: string;
229
+ }
230
+ /** Futures K-line request. wire: future_kline */
231
+ export interface FutureKlineRequest {
232
+ contractCodes?: string[];
233
+ contractCode?: string;
234
+ period?: string;
235
+ beginTime?: number;
236
+ endTime?: number;
237
+ beginIndex?: number;
238
+ endIndex?: number;
239
+ limit?: number;
240
+ pageToken?: string;
241
+ lang?: string;
242
+ }
243
+ /** Futures K-line client-side pagination wrapper. */
244
+ export interface FutureKlineByPageRequest {
245
+ contractCode?: string;
246
+ period?: string;
247
+ beginTime?: number;
248
+ endTime?: number;
249
+ totalSize?: number;
250
+ pageSize?: number;
251
+ lang?: string;
252
+ }
253
+ /** Futures tick trades. wire: future_tick (v3.0) */
254
+ export interface FutureTradeTicksRequest {
255
+ contractCode?: string;
256
+ beginIndex?: number;
257
+ endIndex?: number;
258
+ limit?: number;
259
+ lang?: string;
260
+ }
261
+ /** Futures depth. wire: future_depth */
262
+ export interface FutureDepthRequest {
263
+ contractCodes?: string[];
264
+ lang?: string;
265
+ }
266
+ /** Futures trading session times. wire: future_trading_date */
267
+ export interface FutureTradingTimesRequest {
268
+ contractCode?: string;
269
+ tradingDate?: string;
270
+ lang?: string;
271
+ }
272
+ /** Fund symbols. wire: fund_all_symbols */
273
+ export interface FundSymbolsRequest {
274
+ lang?: string;
275
+ }
276
+ /** Fund contracts. wire: fund_contracts */
277
+ export interface FundContractsRequest {
278
+ symbols?: string[];
279
+ lang?: string;
280
+ }
281
+ /** Fund real-time NAV. wire: fund_quote */
282
+ export interface FundQuoteRequest {
283
+ symbols?: string[];
284
+ lang?: string;
285
+ }
286
+ /** Fund historical NAV. wire: fund_history_quote */
287
+ export interface FundHistoryQuoteRequest {
288
+ symbols?: string[];
289
+ beginTime?: number;
290
+ endTime?: number;
291
+ limit?: number;
292
+ lang?: string;
293
+ }
294
+ /** Warrant briefs. wire: warrant_briefs */
295
+ export interface WarrantBriefsRequest {
296
+ symbols?: string[];
297
+ lang?: string;
298
+ }
299
+ /** Warrant filter (paginated). wire: warrant_filter */
300
+ export interface WarrantFilterRequest {
301
+ symbol?: string;
302
+ page?: number;
303
+ pageSize?: number;
304
+ sortFieldName?: string;
305
+ sortDir?: string;
306
+ issuerName?: string;
307
+ expireYm?: string;
308
+ lang?: string;
309
+ }
310
+ /** Industry list. wire: industry_list */
311
+ export interface IndustryListRequest {
312
+ /** IndustryLevel enum value */
313
+ industryLevel?: string;
314
+ lang?: string;
315
+ }
316
+ /** Stocks in an industry. wire: industry_stock_list */
317
+ export interface IndustryStocksRequest {
318
+ industryId?: string;
319
+ market?: string;
320
+ lang?: string;
321
+ }
322
+ /** Trading calendar. wire: trading_calendar */
323
+ export interface TradingCalendarRequest {
324
+ market?: string;
325
+ /** yyyy-MM-dd */
326
+ beginDate?: string;
327
+ endDate?: string;
328
+ lang?: string;
329
+ }
330
+ /** FX rates. wire: financial_exchange_rate */
331
+ export interface FinancialExchangeRateRequest {
332
+ currencyList?: string[];
333
+ /** yyyyMMdd */
334
+ beginDate?: string;
335
+ endDate?: string;
336
+ timezone?: string;
337
+ lang?: string;
338
+ }
339
+ /** Financial currency per symbol. wire: financial_currency */
340
+ export interface FinancialCurrencyRequest {
341
+ symbols?: string[];
342
+ market?: string;
343
+ lang?: string;
344
+ }
345
+ /** Market scanner tags. wire: market_scanner_tags */
346
+ export interface MarketScannerTagsRequest {
347
+ market?: string;
348
+ /** wire: multi_tag_field_list */
349
+ multiTagFieldList?: string[];
350
+ lang?: string;
351
+ }
352
+ /** Overnight quote. wire: quote_overnight */
353
+ export interface QuoteOvernightRequest {
354
+ symbols?: string[];
355
+ lang?: string;
356
+ }