@tigeropenapi/tigeropen 0.1.0 → 0.4.0
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 +475 -104
- package/dist/cjs/client/api-request.js +16 -10
- package/dist/cjs/client/api-response.js +23 -3
- package/dist/cjs/client/case-convert.js +35 -0
- package/dist/cjs/client/http-client.js +47 -21
- package/dist/cjs/client/index.js +6 -2
- package/dist/cjs/config/client-config.js +130 -49
- package/dist/cjs/config/domain.js +21 -2
- package/dist/cjs/config/index.js +3 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/model/contract.js +1 -2
- package/dist/cjs/model/enums.js +89 -7
- package/dist/cjs/model/order-helpers.js +9 -9
- package/dist/cjs/model/order-status.js +46 -0
- package/dist/cjs/model/order.js +5 -2
- package/dist/cjs/model/position.js +1 -2
- package/dist/cjs/model/quote-requests.js +11 -0
- package/dist/cjs/model/quote.js +7 -0
- package/dist/cjs/model/trade-requests.js +13 -0
- package/dist/cjs/model/trade.js +2 -0
- package/dist/cjs/push/index.js +6 -3
- package/dist/cjs/push/pb/AssetData.js +208 -0
- package/dist/cjs/push/pb/KlineData.js +184 -0
- package/dist/cjs/push/pb/OptionTopData.js +427 -0
- package/dist/cjs/push/pb/OrderStatusData.js +592 -0
- package/dist/cjs/push/pb/OrderTransactionData.js +256 -0
- package/dist/cjs/push/pb/PositionData.js +316 -0
- package/dist/cjs/push/pb/PushData.js +219 -0
- package/dist/cjs/push/pb/QuoteBBOData.js +160 -0
- package/dist/cjs/push/pb/QuoteBasicData.js +329 -0
- package/dist/cjs/push/pb/QuoteData.js +507 -0
- package/dist/cjs/push/pb/QuoteDepthData.js +220 -0
- package/dist/cjs/push/pb/Request.js +278 -0
- package/dist/cjs/push/pb/Response.js +97 -0
- package/dist/cjs/push/pb/SocketCommon.js +86 -0
- package/dist/cjs/push/pb/StockTopData.js +199 -0
- package/dist/cjs/push/pb/TickData.js +202 -0
- package/dist/cjs/push/pb/TradeTickData.js +308 -0
- package/dist/cjs/push/pb/index.js +49 -0
- package/dist/cjs/push/proto-message.js +135 -0
- package/dist/cjs/push/push-client.js +361 -163
- package/dist/cjs/push/push-message.js +8 -60
- package/dist/cjs/push/varint.js +76 -0
- package/dist/cjs/quote/index.js +3 -2
- package/dist/cjs/quote/quote-client.js +440 -94
- package/dist/cjs/signer/signer.js +10 -10
- package/dist/cjs/trade/trade-client.js +197 -62
- package/dist/esm/client/api-request.js +14 -8
- package/dist/esm/client/api-response.js +22 -3
- package/dist/esm/client/case-convert.js +31 -0
- package/dist/esm/client/http-client.js +48 -22
- package/dist/esm/client/index.js +3 -2
- package/dist/esm/config/client-config.js +131 -51
- package/dist/esm/config/domain.js +20 -2
- package/dist/esm/config/index.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/model/contract.js +1 -2
- package/dist/esm/model/enums.js +87 -6
- package/dist/esm/model/order-helpers.js +9 -9
- package/dist/esm/model/order-status.js +43 -0
- package/dist/esm/model/order.js +5 -2
- package/dist/esm/model/position.js +1 -2
- package/dist/esm/model/quote-requests.js +10 -0
- package/dist/esm/model/quote.js +6 -0
- package/dist/esm/model/trade-requests.js +12 -0
- package/dist/esm/model/trade.js +1 -0
- package/dist/esm/push/index.js +4 -2
- package/dist/esm/push/pb/AssetData.js +205 -0
- package/dist/esm/push/pb/KlineData.js +181 -0
- package/dist/esm/push/pb/OptionTopData.js +424 -0
- package/dist/esm/push/pb/OrderStatusData.js +589 -0
- package/dist/esm/push/pb/OrderTransactionData.js +253 -0
- package/dist/esm/push/pb/PositionData.js +313 -0
- package/dist/esm/push/pb/PushData.js +216 -0
- package/dist/esm/push/pb/QuoteBBOData.js +157 -0
- package/dist/esm/push/pb/QuoteBasicData.js +326 -0
- package/dist/esm/push/pb/QuoteData.js +504 -0
- package/dist/esm/push/pb/QuoteDepthData.js +217 -0
- package/dist/esm/push/pb/Request.js +275 -0
- package/dist/esm/push/pb/Response.js +94 -0
- package/dist/esm/push/pb/SocketCommon.js +83 -0
- package/dist/esm/push/pb/StockTopData.js +196 -0
- package/dist/esm/push/pb/TickData.js +199 -0
- package/dist/esm/push/pb/TradeTickData.js +305 -0
- package/dist/esm/push/pb/index.js +25 -0
- package/dist/esm/push/proto-message.js +127 -0
- package/dist/esm/push/push-client.js +329 -164
- package/dist/esm/push/push-message.js +7 -56
- package/dist/esm/push/varint.js +72 -0
- package/dist/esm/quote/index.js +2 -2
- package/dist/esm/quote/quote-client.js +439 -94
- package/dist/esm/signer/signer.js +10 -10
- package/dist/esm/trade/trade-client.js +197 -62
- package/dist/types/client/api-request.d.ts +12 -11
- package/dist/types/client/api-response.d.ts +15 -7
- package/dist/types/client/case-convert.d.ts +16 -0
- package/dist/types/client/http-client.d.ts +26 -14
- package/dist/types/client/index.d.ts +3 -2
- package/dist/types/config/client-config.d.ts +29 -13
- package/dist/types/config/domain.d.ts +9 -0
- package/dist/types/config/index.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/model/contract.d.ts +13 -29
- package/dist/types/model/enums.d.ts +60 -6
- package/dist/types/model/order-helpers.d.ts +21 -20
- package/dist/types/model/order-status.d.ts +14 -0
- package/dist/types/model/order.d.ts +101 -55
- package/dist/types/model/position.d.ts +26 -24
- package/dist/types/model/quote-requests.d.ts +344 -0
- package/dist/types/model/quote.d.ts +572 -0
- package/dist/types/model/trade-requests.d.ts +195 -0
- package/dist/types/model/trade.d.ts +235 -0
- package/dist/types/push/callbacks.d.ts +32 -51
- package/dist/types/push/index.d.ts +5 -3
- package/dist/types/push/pb/AssetData.d.ts +47 -0
- package/dist/types/push/pb/KlineData.d.ts +43 -0
- package/dist/types/push/pb/OptionTopData.d.ts +76 -0
- package/dist/types/push/pb/OrderStatusData.d.ts +100 -0
- package/dist/types/push/pb/OrderTransactionData.d.ts +51 -0
- package/dist/types/push/pb/PositionData.d.ts +63 -0
- package/dist/types/push/pb/PushData.d.ts +46 -0
- package/dist/types/push/pb/QuoteBBOData.d.ts +35 -0
- package/dist/types/push/pb/QuoteBasicData.d.ts +66 -0
- package/dist/types/push/pb/QuoteData.d.ts +94 -0
- package/dist/types/push/pb/QuoteDepthData.d.ts +37 -0
- package/dist/types/push/pb/Request.d.ts +44 -0
- package/dist/types/push/pb/Response.d.ts +30 -0
- package/dist/types/push/pb/SocketCommon.d.ts +64 -0
- package/dist/types/push/pb/StockTopData.d.ts +37 -0
- package/dist/types/push/pb/TickData.d.ts +44 -0
- package/dist/types/push/pb/TradeTickData.d.ts +53 -0
- package/dist/types/push/pb/index.d.ts +39 -0
- package/dist/types/push/proto-message.d.ts +33 -0
- package/dist/types/push/push-client.d.ts +100 -68
- package/dist/types/push/push-message.d.ts +7 -147
- package/dist/types/push/varint.d.ts +23 -0
- package/dist/types/quote/index.d.ts +2 -2
- package/dist/types/quote/quote-client.d.ts +154 -47
- package/dist/types/signer/signer.d.ts +6 -6
- package/dist/types/trade/trade-client.d.ts +106 -38
- package/package.json +11 -6
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.6
|
|
4
|
+
// protoc v5.28.3
|
|
5
|
+
// source: QuoteDepthData.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
export const protobufPackage = "com.tigerbrokers.stock.openapi.client.socket.data.pb";
|
|
9
|
+
function createBaseQuoteDepthData() {
|
|
10
|
+
return { symbol: "", timestamp: 0, ask: undefined, bid: undefined };
|
|
11
|
+
}
|
|
12
|
+
export const QuoteDepthData = {
|
|
13
|
+
encode(message, writer = new BinaryWriter()) {
|
|
14
|
+
if (message.symbol !== "") {
|
|
15
|
+
writer.uint32(10).string(message.symbol);
|
|
16
|
+
}
|
|
17
|
+
if (message.timestamp !== 0) {
|
|
18
|
+
writer.uint32(16).uint64(message.timestamp);
|
|
19
|
+
}
|
|
20
|
+
if (message.ask !== undefined) {
|
|
21
|
+
QuoteDepthData_OrderBook.encode(message.ask, writer.uint32(26).fork()).join();
|
|
22
|
+
}
|
|
23
|
+
if (message.bid !== undefined) {
|
|
24
|
+
QuoteDepthData_OrderBook.encode(message.bid, writer.uint32(34).fork()).join();
|
|
25
|
+
}
|
|
26
|
+
return writer;
|
|
27
|
+
},
|
|
28
|
+
decode(input, length) {
|
|
29
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
30
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
31
|
+
const message = createBaseQuoteDepthData();
|
|
32
|
+
while (reader.pos < end) {
|
|
33
|
+
const tag = reader.uint32();
|
|
34
|
+
switch (tag >>> 3) {
|
|
35
|
+
case 1: {
|
|
36
|
+
if (tag !== 10) {
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
message.symbol = reader.string();
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
case 2: {
|
|
43
|
+
if (tag !== 16) {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
message.timestamp = longToNumber(reader.uint64());
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
case 3: {
|
|
50
|
+
if (tag !== 26) {
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
message.ask = QuoteDepthData_OrderBook.decode(reader, reader.uint32());
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
case 4: {
|
|
57
|
+
if (tag !== 34) {
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
message.bid = QuoteDepthData_OrderBook.decode(reader, reader.uint32());
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
reader.skip(tag & 7);
|
|
68
|
+
}
|
|
69
|
+
return message;
|
|
70
|
+
},
|
|
71
|
+
create(base) {
|
|
72
|
+
return QuoteDepthData.fromPartial(base ?? {});
|
|
73
|
+
},
|
|
74
|
+
fromPartial(object) {
|
|
75
|
+
const message = createBaseQuoteDepthData();
|
|
76
|
+
message.symbol = object.symbol ?? "";
|
|
77
|
+
message.timestamp = object.timestamp ?? 0;
|
|
78
|
+
message.ask = (object.ask !== undefined && object.ask !== null)
|
|
79
|
+
? QuoteDepthData_OrderBook.fromPartial(object.ask)
|
|
80
|
+
: undefined;
|
|
81
|
+
message.bid = (object.bid !== undefined && object.bid !== null)
|
|
82
|
+
? QuoteDepthData_OrderBook.fromPartial(object.bid)
|
|
83
|
+
: undefined;
|
|
84
|
+
return message;
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
function createBaseQuoteDepthData_OrderBook() {
|
|
88
|
+
return { price: [], volume: [], orderCount: [], exchange: [], time: [] };
|
|
89
|
+
}
|
|
90
|
+
export const QuoteDepthData_OrderBook = {
|
|
91
|
+
encode(message, writer = new BinaryWriter()) {
|
|
92
|
+
writer.uint32(10).fork();
|
|
93
|
+
for (const v of message.price) {
|
|
94
|
+
writer.double(v);
|
|
95
|
+
}
|
|
96
|
+
writer.join();
|
|
97
|
+
writer.uint32(18).fork();
|
|
98
|
+
for (const v of message.volume) {
|
|
99
|
+
writer.sint64(v);
|
|
100
|
+
}
|
|
101
|
+
writer.join();
|
|
102
|
+
writer.uint32(26).fork();
|
|
103
|
+
for (const v of message.orderCount) {
|
|
104
|
+
writer.uint32(v);
|
|
105
|
+
}
|
|
106
|
+
writer.join();
|
|
107
|
+
for (const v of message.exchange) {
|
|
108
|
+
writer.uint32(34).string(v);
|
|
109
|
+
}
|
|
110
|
+
writer.uint32(42).fork();
|
|
111
|
+
for (const v of message.time) {
|
|
112
|
+
writer.sint64(v);
|
|
113
|
+
}
|
|
114
|
+
writer.join();
|
|
115
|
+
return writer;
|
|
116
|
+
},
|
|
117
|
+
decode(input, length) {
|
|
118
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
119
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
120
|
+
const message = createBaseQuoteDepthData_OrderBook();
|
|
121
|
+
while (reader.pos < end) {
|
|
122
|
+
const tag = reader.uint32();
|
|
123
|
+
switch (tag >>> 3) {
|
|
124
|
+
case 1: {
|
|
125
|
+
if (tag === 9) {
|
|
126
|
+
message.price.push(reader.double());
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (tag === 10) {
|
|
130
|
+
const end2 = reader.uint32() + reader.pos;
|
|
131
|
+
while (reader.pos < end2) {
|
|
132
|
+
message.price.push(reader.double());
|
|
133
|
+
}
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
case 2: {
|
|
139
|
+
if (tag === 16) {
|
|
140
|
+
message.volume.push(longToNumber(reader.sint64()));
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (tag === 18) {
|
|
144
|
+
const end2 = reader.uint32() + reader.pos;
|
|
145
|
+
while (reader.pos < end2) {
|
|
146
|
+
message.volume.push(longToNumber(reader.sint64()));
|
|
147
|
+
}
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
case 3: {
|
|
153
|
+
if (tag === 24) {
|
|
154
|
+
message.orderCount.push(reader.uint32());
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (tag === 26) {
|
|
158
|
+
const end2 = reader.uint32() + reader.pos;
|
|
159
|
+
while (reader.pos < end2) {
|
|
160
|
+
message.orderCount.push(reader.uint32());
|
|
161
|
+
}
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
case 4: {
|
|
167
|
+
if (tag !== 34) {
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
message.exchange.push(reader.string());
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
case 5: {
|
|
174
|
+
if (tag === 40) {
|
|
175
|
+
message.time.push(longToNumber(reader.sint64()));
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if (tag === 42) {
|
|
179
|
+
const end2 = reader.uint32() + reader.pos;
|
|
180
|
+
while (reader.pos < end2) {
|
|
181
|
+
message.time.push(longToNumber(reader.sint64()));
|
|
182
|
+
}
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
reader.skip(tag & 7);
|
|
192
|
+
}
|
|
193
|
+
return message;
|
|
194
|
+
},
|
|
195
|
+
create(base) {
|
|
196
|
+
return QuoteDepthData_OrderBook.fromPartial(base ?? {});
|
|
197
|
+
},
|
|
198
|
+
fromPartial(object) {
|
|
199
|
+
const message = createBaseQuoteDepthData_OrderBook();
|
|
200
|
+
message.price = object.price?.map((e) => e) || [];
|
|
201
|
+
message.volume = object.volume?.map((e) => e) || [];
|
|
202
|
+
message.orderCount = object.orderCount?.map((e) => e) || [];
|
|
203
|
+
message.exchange = object.exchange?.map((e) => e) || [];
|
|
204
|
+
message.time = object.time?.map((e) => e) || [];
|
|
205
|
+
return message;
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
function longToNumber(int64) {
|
|
209
|
+
const num = globalThis.Number(int64.toString());
|
|
210
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
211
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
212
|
+
}
|
|
213
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
214
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
215
|
+
}
|
|
216
|
+
return num;
|
|
217
|
+
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.6
|
|
4
|
+
// protoc v5.28.3
|
|
5
|
+
// source: Request.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
export const protobufPackage = "com.tigerbrokers.stock.openapi.client.socket.data.pb";
|
|
9
|
+
function createBaseRequest() {
|
|
10
|
+
return { command: 0, id: 0, subscribe: undefined, connect: undefined };
|
|
11
|
+
}
|
|
12
|
+
export const Request = {
|
|
13
|
+
encode(message, writer = new BinaryWriter()) {
|
|
14
|
+
if (message.command !== 0) {
|
|
15
|
+
writer.uint32(8).int32(message.command);
|
|
16
|
+
}
|
|
17
|
+
if (message.id !== 0) {
|
|
18
|
+
writer.uint32(16).uint32(message.id);
|
|
19
|
+
}
|
|
20
|
+
if (message.subscribe !== undefined) {
|
|
21
|
+
Request_Subscribe.encode(message.subscribe, writer.uint32(26).fork()).join();
|
|
22
|
+
}
|
|
23
|
+
if (message.connect !== undefined) {
|
|
24
|
+
Request_Connect.encode(message.connect, writer.uint32(34).fork()).join();
|
|
25
|
+
}
|
|
26
|
+
return writer;
|
|
27
|
+
},
|
|
28
|
+
decode(input, length) {
|
|
29
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
30
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
31
|
+
const message = createBaseRequest();
|
|
32
|
+
while (reader.pos < end) {
|
|
33
|
+
const tag = reader.uint32();
|
|
34
|
+
switch (tag >>> 3) {
|
|
35
|
+
case 1: {
|
|
36
|
+
if (tag !== 8) {
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
message.command = reader.int32();
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
case 2: {
|
|
43
|
+
if (tag !== 16) {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
message.id = reader.uint32();
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
case 3: {
|
|
50
|
+
if (tag !== 26) {
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
message.subscribe = Request_Subscribe.decode(reader, reader.uint32());
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
case 4: {
|
|
57
|
+
if (tag !== 34) {
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
message.connect = Request_Connect.decode(reader, reader.uint32());
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
reader.skip(tag & 7);
|
|
68
|
+
}
|
|
69
|
+
return message;
|
|
70
|
+
},
|
|
71
|
+
create(base) {
|
|
72
|
+
return Request.fromPartial(base ?? {});
|
|
73
|
+
},
|
|
74
|
+
fromPartial(object) {
|
|
75
|
+
const message = createBaseRequest();
|
|
76
|
+
message.command = object.command ?? 0;
|
|
77
|
+
message.id = object.id ?? 0;
|
|
78
|
+
message.subscribe = (object.subscribe !== undefined && object.subscribe !== null)
|
|
79
|
+
? Request_Subscribe.fromPartial(object.subscribe)
|
|
80
|
+
: undefined;
|
|
81
|
+
message.connect = (object.connect !== undefined && object.connect !== null)
|
|
82
|
+
? Request_Connect.fromPartial(object.connect)
|
|
83
|
+
: undefined;
|
|
84
|
+
return message;
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
function createBaseRequest_Connect() {
|
|
88
|
+
return {
|
|
89
|
+
tigerId: "",
|
|
90
|
+
sign: "",
|
|
91
|
+
sdkVersion: "",
|
|
92
|
+
acceptVersion: undefined,
|
|
93
|
+
sendInterval: undefined,
|
|
94
|
+
receiveInterval: undefined,
|
|
95
|
+
useFullTick: undefined,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export const Request_Connect = {
|
|
99
|
+
encode(message, writer = new BinaryWriter()) {
|
|
100
|
+
if (message.tigerId !== "") {
|
|
101
|
+
writer.uint32(10).string(message.tigerId);
|
|
102
|
+
}
|
|
103
|
+
if (message.sign !== "") {
|
|
104
|
+
writer.uint32(18).string(message.sign);
|
|
105
|
+
}
|
|
106
|
+
if (message.sdkVersion !== "") {
|
|
107
|
+
writer.uint32(26).string(message.sdkVersion);
|
|
108
|
+
}
|
|
109
|
+
if (message.acceptVersion !== undefined) {
|
|
110
|
+
writer.uint32(34).string(message.acceptVersion);
|
|
111
|
+
}
|
|
112
|
+
if (message.sendInterval !== undefined) {
|
|
113
|
+
writer.uint32(40).uint32(message.sendInterval);
|
|
114
|
+
}
|
|
115
|
+
if (message.receiveInterval !== undefined) {
|
|
116
|
+
writer.uint32(48).uint32(message.receiveInterval);
|
|
117
|
+
}
|
|
118
|
+
if (message.useFullTick !== undefined) {
|
|
119
|
+
writer.uint32(56).bool(message.useFullTick);
|
|
120
|
+
}
|
|
121
|
+
return writer;
|
|
122
|
+
},
|
|
123
|
+
decode(input, length) {
|
|
124
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
125
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
126
|
+
const message = createBaseRequest_Connect();
|
|
127
|
+
while (reader.pos < end) {
|
|
128
|
+
const tag = reader.uint32();
|
|
129
|
+
switch (tag >>> 3) {
|
|
130
|
+
case 1: {
|
|
131
|
+
if (tag !== 10) {
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
message.tigerId = reader.string();
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
case 2: {
|
|
138
|
+
if (tag !== 18) {
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
message.sign = reader.string();
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
case 3: {
|
|
145
|
+
if (tag !== 26) {
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
message.sdkVersion = reader.string();
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
case 4: {
|
|
152
|
+
if (tag !== 34) {
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
message.acceptVersion = reader.string();
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
case 5: {
|
|
159
|
+
if (tag !== 40) {
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
message.sendInterval = reader.uint32();
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
case 6: {
|
|
166
|
+
if (tag !== 48) {
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
message.receiveInterval = reader.uint32();
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
case 7: {
|
|
173
|
+
if (tag !== 56) {
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
message.useFullTick = reader.bool();
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
reader.skip(tag & 7);
|
|
184
|
+
}
|
|
185
|
+
return message;
|
|
186
|
+
},
|
|
187
|
+
create(base) {
|
|
188
|
+
return Request_Connect.fromPartial(base ?? {});
|
|
189
|
+
},
|
|
190
|
+
fromPartial(object) {
|
|
191
|
+
const message = createBaseRequest_Connect();
|
|
192
|
+
message.tigerId = object.tigerId ?? "";
|
|
193
|
+
message.sign = object.sign ?? "";
|
|
194
|
+
message.sdkVersion = object.sdkVersion ?? "";
|
|
195
|
+
message.acceptVersion = object.acceptVersion ?? undefined;
|
|
196
|
+
message.sendInterval = object.sendInterval ?? undefined;
|
|
197
|
+
message.receiveInterval = object.receiveInterval ?? undefined;
|
|
198
|
+
message.useFullTick = object.useFullTick ?? undefined;
|
|
199
|
+
return message;
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
function createBaseRequest_Subscribe() {
|
|
203
|
+
return { dataType: 0, symbols: undefined, account: undefined, market: undefined };
|
|
204
|
+
}
|
|
205
|
+
export const Request_Subscribe = {
|
|
206
|
+
encode(message, writer = new BinaryWriter()) {
|
|
207
|
+
if (message.dataType !== 0) {
|
|
208
|
+
writer.uint32(8).int32(message.dataType);
|
|
209
|
+
}
|
|
210
|
+
if (message.symbols !== undefined) {
|
|
211
|
+
writer.uint32(18).string(message.symbols);
|
|
212
|
+
}
|
|
213
|
+
if (message.account !== undefined) {
|
|
214
|
+
writer.uint32(26).string(message.account);
|
|
215
|
+
}
|
|
216
|
+
if (message.market !== undefined) {
|
|
217
|
+
writer.uint32(34).string(message.market);
|
|
218
|
+
}
|
|
219
|
+
return writer;
|
|
220
|
+
},
|
|
221
|
+
decode(input, length) {
|
|
222
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
223
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
224
|
+
const message = createBaseRequest_Subscribe();
|
|
225
|
+
while (reader.pos < end) {
|
|
226
|
+
const tag = reader.uint32();
|
|
227
|
+
switch (tag >>> 3) {
|
|
228
|
+
case 1: {
|
|
229
|
+
if (tag !== 8) {
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
message.dataType = reader.int32();
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
case 2: {
|
|
236
|
+
if (tag !== 18) {
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
message.symbols = reader.string();
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
case 3: {
|
|
243
|
+
if (tag !== 26) {
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
message.account = reader.string();
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
case 4: {
|
|
250
|
+
if (tag !== 34) {
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
message.market = reader.string();
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
reader.skip(tag & 7);
|
|
261
|
+
}
|
|
262
|
+
return message;
|
|
263
|
+
},
|
|
264
|
+
create(base) {
|
|
265
|
+
return Request_Subscribe.fromPartial(base ?? {});
|
|
266
|
+
},
|
|
267
|
+
fromPartial(object) {
|
|
268
|
+
const message = createBaseRequest_Subscribe();
|
|
269
|
+
message.dataType = object.dataType ?? 0;
|
|
270
|
+
message.symbols = object.symbols ?? undefined;
|
|
271
|
+
message.account = object.account ?? undefined;
|
|
272
|
+
message.market = object.market ?? undefined;
|
|
273
|
+
return message;
|
|
274
|
+
},
|
|
275
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.6
|
|
4
|
+
// protoc v5.28.3
|
|
5
|
+
// source: Response.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
import { PushData } from "./PushData";
|
|
9
|
+
export const protobufPackage = "com.tigerbrokers.stock.openapi.client.socket.data.pb";
|
|
10
|
+
function createBaseResponse() {
|
|
11
|
+
return { command: 0, id: undefined, code: undefined, msg: undefined, body: undefined };
|
|
12
|
+
}
|
|
13
|
+
export const Response = {
|
|
14
|
+
encode(message, writer = new BinaryWriter()) {
|
|
15
|
+
if (message.command !== 0) {
|
|
16
|
+
writer.uint32(8).int32(message.command);
|
|
17
|
+
}
|
|
18
|
+
if (message.id !== undefined) {
|
|
19
|
+
writer.uint32(16).uint32(message.id);
|
|
20
|
+
}
|
|
21
|
+
if (message.code !== undefined) {
|
|
22
|
+
writer.uint32(24).int32(message.code);
|
|
23
|
+
}
|
|
24
|
+
if (message.msg !== undefined) {
|
|
25
|
+
writer.uint32(34).string(message.msg);
|
|
26
|
+
}
|
|
27
|
+
if (message.body !== undefined) {
|
|
28
|
+
PushData.encode(message.body, writer.uint32(42).fork()).join();
|
|
29
|
+
}
|
|
30
|
+
return writer;
|
|
31
|
+
},
|
|
32
|
+
decode(input, length) {
|
|
33
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
34
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
35
|
+
const message = createBaseResponse();
|
|
36
|
+
while (reader.pos < end) {
|
|
37
|
+
const tag = reader.uint32();
|
|
38
|
+
switch (tag >>> 3) {
|
|
39
|
+
case 1: {
|
|
40
|
+
if (tag !== 8) {
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
message.command = reader.int32();
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
case 2: {
|
|
47
|
+
if (tag !== 16) {
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
message.id = reader.uint32();
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
case 3: {
|
|
54
|
+
if (tag !== 24) {
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
message.code = reader.int32();
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
case 4: {
|
|
61
|
+
if (tag !== 34) {
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
message.msg = reader.string();
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
case 5: {
|
|
68
|
+
if (tag !== 42) {
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
message.body = PushData.decode(reader, reader.uint32());
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
reader.skip(tag & 7);
|
|
79
|
+
}
|
|
80
|
+
return message;
|
|
81
|
+
},
|
|
82
|
+
create(base) {
|
|
83
|
+
return Response.fromPartial(base ?? {});
|
|
84
|
+
},
|
|
85
|
+
fromPartial(object) {
|
|
86
|
+
const message = createBaseResponse();
|
|
87
|
+
message.command = object.command ?? 0;
|
|
88
|
+
message.id = object.id ?? undefined;
|
|
89
|
+
message.code = object.code ?? undefined;
|
|
90
|
+
message.msg = object.msg ?? undefined;
|
|
91
|
+
message.body = (object.body !== undefined && object.body !== null) ? PushData.fromPartial(object.body) : undefined;
|
|
92
|
+
return message;
|
|
93
|
+
},
|
|
94
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.6
|
|
4
|
+
// protoc v5.28.3
|
|
5
|
+
// source: SocketCommon.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
export const protobufPackage = "com.tigerbrokers.stock.openapi.client.socket.data.pb";
|
|
9
|
+
/** request and response command */
|
|
10
|
+
export var SocketCommon_Command;
|
|
11
|
+
(function (SocketCommon_Command) {
|
|
12
|
+
SocketCommon_Command[SocketCommon_Command["UNKNOWN"] = 0] = "UNKNOWN";
|
|
13
|
+
SocketCommon_Command[SocketCommon_Command["CONNECT"] = 1] = "CONNECT";
|
|
14
|
+
SocketCommon_Command[SocketCommon_Command["CONNECTED"] = 2] = "CONNECTED";
|
|
15
|
+
SocketCommon_Command[SocketCommon_Command["SEND"] = 3] = "SEND";
|
|
16
|
+
SocketCommon_Command[SocketCommon_Command["SUBSCRIBE"] = 4] = "SUBSCRIBE";
|
|
17
|
+
SocketCommon_Command[SocketCommon_Command["UNSUBSCRIBE"] = 5] = "UNSUBSCRIBE";
|
|
18
|
+
SocketCommon_Command[SocketCommon_Command["DISCONNECT"] = 6] = "DISCONNECT";
|
|
19
|
+
SocketCommon_Command[SocketCommon_Command["MESSAGE"] = 7] = "MESSAGE";
|
|
20
|
+
SocketCommon_Command[SocketCommon_Command["HEARTBEAT"] = 8] = "HEARTBEAT";
|
|
21
|
+
SocketCommon_Command[SocketCommon_Command["ERROR"] = 9] = "ERROR";
|
|
22
|
+
SocketCommon_Command[SocketCommon_Command["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
23
|
+
})(SocketCommon_Command || (SocketCommon_Command = {}));
|
|
24
|
+
/** data type */
|
|
25
|
+
export var SocketCommon_DataType;
|
|
26
|
+
(function (SocketCommon_DataType) {
|
|
27
|
+
SocketCommon_DataType[SocketCommon_DataType["Unknown"] = 0] = "Unknown";
|
|
28
|
+
SocketCommon_DataType[SocketCommon_DataType["Quote"] = 1] = "Quote";
|
|
29
|
+
SocketCommon_DataType[SocketCommon_DataType["Option"] = 2] = "Option";
|
|
30
|
+
SocketCommon_DataType[SocketCommon_DataType["Future"] = 3] = "Future";
|
|
31
|
+
SocketCommon_DataType[SocketCommon_DataType["QuoteDepth"] = 4] = "QuoteDepth";
|
|
32
|
+
SocketCommon_DataType[SocketCommon_DataType["TradeTick"] = 5] = "TradeTick";
|
|
33
|
+
SocketCommon_DataType[SocketCommon_DataType["Asset"] = 6] = "Asset";
|
|
34
|
+
SocketCommon_DataType[SocketCommon_DataType["Position"] = 7] = "Position";
|
|
35
|
+
SocketCommon_DataType[SocketCommon_DataType["OrderStatus"] = 8] = "OrderStatus";
|
|
36
|
+
SocketCommon_DataType[SocketCommon_DataType["OrderTransaction"] = 9] = "OrderTransaction";
|
|
37
|
+
SocketCommon_DataType[SocketCommon_DataType["StockTop"] = 10] = "StockTop";
|
|
38
|
+
SocketCommon_DataType[SocketCommon_DataType["OptionTop"] = 11] = "OptionTop";
|
|
39
|
+
SocketCommon_DataType[SocketCommon_DataType["Kline"] = 12] = "Kline";
|
|
40
|
+
SocketCommon_DataType[SocketCommon_DataType["Cc"] = 13] = "Cc";
|
|
41
|
+
SocketCommon_DataType[SocketCommon_DataType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
42
|
+
})(SocketCommon_DataType || (SocketCommon_DataType = {}));
|
|
43
|
+
export var SocketCommon_QuoteType;
|
|
44
|
+
(function (SocketCommon_QuoteType) {
|
|
45
|
+
SocketCommon_QuoteType[SocketCommon_QuoteType["None"] = 0] = "None";
|
|
46
|
+
/** BASIC - basic quote data */
|
|
47
|
+
SocketCommon_QuoteType[SocketCommon_QuoteType["BASIC"] = 1] = "BASIC";
|
|
48
|
+
/** BBO - best bid and offer(include fields: askSize,askPrice,bidSize,bizePrice) */
|
|
49
|
+
SocketCommon_QuoteType[SocketCommon_QuoteType["BBO"] = 2] = "BBO";
|
|
50
|
+
/** ALL - include BASIC AND BBO */
|
|
51
|
+
SocketCommon_QuoteType[SocketCommon_QuoteType["ALL"] = 3] = "ALL";
|
|
52
|
+
SocketCommon_QuoteType[SocketCommon_QuoteType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
53
|
+
})(SocketCommon_QuoteType || (SocketCommon_QuoteType = {}));
|
|
54
|
+
function createBaseSocketCommon() {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
export const SocketCommon = {
|
|
58
|
+
encode(_, writer = new BinaryWriter()) {
|
|
59
|
+
return writer;
|
|
60
|
+
},
|
|
61
|
+
decode(input, length) {
|
|
62
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
63
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
64
|
+
const message = createBaseSocketCommon();
|
|
65
|
+
while (reader.pos < end) {
|
|
66
|
+
const tag = reader.uint32();
|
|
67
|
+
switch (tag >>> 3) {
|
|
68
|
+
}
|
|
69
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
reader.skip(tag & 7);
|
|
73
|
+
}
|
|
74
|
+
return message;
|
|
75
|
+
},
|
|
76
|
+
create(base) {
|
|
77
|
+
return SocketCommon.fromPartial(base ?? {});
|
|
78
|
+
},
|
|
79
|
+
fromPartial(_) {
|
|
80
|
+
const message = createBaseSocketCommon();
|
|
81
|
+
return message;
|
|
82
|
+
},
|
|
83
|
+
};
|